Changeset 10646 in osm for applications/editors/josm/plugins/wmsplugin
- Timestamp:
- 2008-09-12T11:57:49+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
r10382 r10646 21 21 import javax.swing.ImageIcon; 22 22 import javax.swing.JFileChooser; 23 import javax.swing.JCheckBoxMenuItem; 23 24 import javax.swing.JMenuItem; 24 25 import javax.swing.JOptionPane; … … 51 52 52 53 public int messageNum = 5; //limit for messages per layer 53 protected boolean started = true;54 54 protected boolean stopAfterPaint = false; 55 55 protected int ImageSize = 500; … … 59 59 protected double pixelPerDegree; 60 60 protected GeorefImage[][] images = new GeorefImage[dax][day]; 61 JCheckBoxMenuItem startstop = new JCheckBoxMenuItem(tr("Automatic downloading"), true); 61 62 62 63 protected String baseURL; … … 84 85 if (baseURL == null) return; 85 86 //set resolution 86 if(start ed|| Math.round(pixelPerDegree/10000) != Math.round(_pixelPerDegree/10000))87 if(startstop.isSelected() || Math.round(pixelPerDegree/10000) != Math.round(_pixelPerDegree/10000)) 87 88 initializeImages(); 88 89 pixelPerDegree = _pixelPerDegree; 89 if(!start ed)stopAfterPaint = true;90 start ed = true;90 if(!startstop.isSelected()) stopAfterPaint = true; 91 startstop.setSelected(true); 91 92 } 92 93 … … 96 97 97 98 @Override public String getToolTipText() { 98 if(start ed)99 if(startstop.isSelected()) 99 100 return tr("WMS layer ({0}), automaticaly downloading in zoom {1}", name, Math.round(pixelPerDegree/10000)); 100 101 else … … 132 133 133 134 134 if( !start ed|| (pixelPerDegree / (mv.getWidth() / (b.max.lon() - b.min.lon())) > minZoom) ){ //don't download when it's too outzoomed135 if( !startstop.isSelected() || (pixelPerDegree / (mv.getWidth() / (b.max.lon() - b.min.lon())) > minZoom) ){ //don't download when it's too outzoomed 135 136 for(int x = 0; x<dax; ++x) 136 137 for(int y = 0; y<day; ++y){ … … 151 152 } 152 153 if(stopAfterPaint){ 153 start ed = false;154 startstop.setSelected(false); 154 155 stopAfterPaint = false; 155 156 } … … 177 178 new JMenuItem(new SaveWmsAction()), 178 179 new JSeparator(), 179 new JMenuItem(new StartWmsAction()), 180 new JMenuItem(new StopWmsAction()), 180 startstop, 181 181 new JSeparator(), 182 182 new JMenuItem(new LayerListPopup.InfoAction(this))}; … … 250 250 ois.close(); 251 251 fis.close(); 252 start ed = false;252 startstop.setSelected(false); 253 253 } 254 254 catch (Exception ex) { … … 261 261 return; 262 262 } 263 }264 }265 266 public class StartWmsAction extends AbstractAction {267 public StartWmsAction() {268 super(tr("Start automatic downloading"), null);269 }270 public void actionPerformed(ActionEvent ev) {271 started = true;272 }273 }274 275 public class StopWmsAction extends AbstractAction {276 public StopWmsAction() {277 super(tr("Stop automatic downloading"), null);278 }279 public void actionPerformed(ActionEvent ev) {280 started = false;281 263 } 282 264 }
Note:
See TracChangeset
for help on using the changeset viewer.