Changeset 18597 in osm for applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
- Timestamp:
- 2009-11-14T20:01:49+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
r17817 r18597 5 5 import java.awt.Component; 6 6 import java.awt.Graphics; 7 import java.awt.Graphics2D; 7 8 import java.awt.Toolkit; 8 9 import java.awt.event.ActionEvent; … … 27 28 import org.openstreetmap.josm.actions.DiskAccessAction; 28 29 import org.openstreetmap.josm.actions.SaveActionBase; 30 import org.openstreetmap.josm.data.Bounds; 29 31 import org.openstreetmap.josm.data.ProjectionBounds; 30 32 import org.openstreetmap.josm.data.coor.EastNorth; … … 69 71 /** set to true if the user confirmed to use an potentially invalid WMS base url */ 70 72 private boolean isInvalidUrlConfirmed = false; 71 73 72 74 public WMSLayer() { 73 75 this(tr("Blank Layer"), null, null); … … 79 81 super(name); 80 82 alphaChannel.setSelected(Main.pref.getBoolean("wmsplugin.alpha_channel")); 81 setBackgroundLayer(true); /* set global background variable */ 83 setBackgroundLayer(true); /* set global background variable */ 82 84 initializeImages(); 83 85 this.baseURL = baseURL; … … 112 114 113 115 @Override 114 public void destroy() { 116 public void destroy() { 115 117 try { 116 118 executor.shutdownNow(); … … 163 165 } 164 166 165 @Override public void paint(Graphics g, final MapView mv) {167 @Override public void paint(Graphics2D g, final MapView mv, Bounds bounds) { 166 168 if(baseURL == null) return; 167 169 if (usesInvalidUrl && !isInvalidUrlConfirmed) return; … … 191 193 + "This is likely to lead to invalid WMS request. You should check your<br>" 192 194 + "preference settings.<br>" 193 + "Do you want to fetch WMS tiles anyway?", 195 + "Do you want to fetch WMS tiles anyway?", 194 196 url); 195 197 String [] options = new String[] { … … 198 200 }; 199 201 int ret = JOptionPane.showOptionDialog( 200 Main.parent, 202 Main.parent, 201 203 msg, 202 204 tr("Invalid URL?"), 203 JOptionPane.YES_NO_OPTION, 204 JOptionPane.WARNING_MESSAGE, 205 null, 205 JOptionPane.YES_NO_OPTION, 206 JOptionPane.WARNING_MESSAGE, 207 null, 206 208 options, options[1] 207 209 ); … … 228 230 ); 229 231 return; 230 } 231 232 } 233 232 234 for(int x = bminx; x<bmaxx; ++x) { 233 235 for(int y = bminy; y<bmaxy; ++y){ … … 352 354 } 353 355 } 354 356 355 357 public class SaveWmsAction extends AbstractAction { 356 358 public SaveWmsAction() {
Note:
See TracChangeset
for help on using the changeset viewer.