Changeset 17556 in osm
- Timestamp:
- 2009-09-09T14:54:46+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/wmsplugin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wmsplugin
- Property svn:ignore
-
old new 3 3 build.log 4 4 build.err 5 dist
-
- Property svn:ignore
-
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/GeorefImage.java
r17522 r17556 1 1 package wmsplugin; 2 2 3 import java.awt.Color; 3 4 import java.awt.Dimension; 4 5 import java.awt.Graphics; -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/Grabber.java
r17343 r17556 10 10 import org.openstreetmap.josm.Main; 11 11 import org.openstreetmap.josm.data.ProjectionBounds; 12 import org.openstreetmap.josm.data.coor.EastNorth; 12 13 import org.openstreetmap.josm.data.projection.Projection; 13 14 import org.openstreetmap.josm.gui.MapView; … … 25 26 Grabber(ProjectionBounds b, GeorefImage image, MapView mv, WMSLayer layer, CacheFiles cache) 26 27 { 27 this.b = b; 28 if (b.min != null && b.max != null && WMSPlugin.doOverlap) { 29 double eastSize = b.max.east() - b.min.east(); 30 double northSize = b.max.north() - b.min.north(); 31 32 double eastCoef = WMSPlugin.overlapEast / 100.0; 33 double northCoef = WMSPlugin.overlapNorth / 100.0; 34 35 this.b = new ProjectionBounds( new EastNorth(b.min.east(), 36 b.min.north()), 37 new EastNorth(b.max.east() + eastCoef * eastSize, 38 b.max.north() + northCoef * northSize)); 39 } else 40 this.b = b; 41 28 42 this.proj = Main.proj; 29 43 this.pixelPerDegree = layer.pixelPerDegree; … … 32 46 this.layer = layer; 33 47 this.cache = cache; 48 34 49 } 35 50 -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java
r17397 r17556 48 48 static TreeMap<String,String> wmsListDefault = new TreeMap<String,String>(); 49 49 50 static boolean doOverlap = false; 51 static int overlapEast = 14; 52 static int overlapNorth = 4; 53 50 54 // remember state of menu item to restore on changed preferences 51 55 static private boolean menuEnabled = false; … … 90 94 TreeSet<String> keys = new TreeSet<String>(prefs.keySet()); 91 95 96 // Here we load the settings for "overlap" checkbox and spinboxes. 97 98 try { 99 doOverlap = Boolean.valueOf(prefs.get("wmsplugin.url.overlap")); 100 } catch (Exception e) {} // If sth fails, we drop to default settings. 101 102 try { 103 overlapEast = Integer.valueOf(prefs.get("wmsplugin.url.overlapEast")); 104 } catch (Exception e) {} // If sth fails, we drop to default settings. 105 106 try { 107 overlapNorth = Integer.valueOf(prefs.get("wmsplugin.url.overlapNorth")); 108 } catch (Exception e) {} // If sth fails, we drop to default settings. 109 92 110 // And then the names+urls of WMS servers 93 111 int prefid = 0; -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPreferenceEditor.java
r17407 r17556 1 1 package wmsplugin; 2 2 3 import java.awt.BorderLayout; 4 import java.awt.FlowLayout; 5 import javax.swing.JCheckBox; 6 import javax.swing.JSpinner; 7 import javax.swing.SpinnerNumberModel; 8 import org.openstreetmap.josm.Main; 3 9 import static org.openstreetmap.josm.tools.I18n.tr; 4 10 … … 32 38 private HashMap<Integer, WMSInfo> oldValues = new HashMap<Integer, WMSInfo>(); 33 39 40 JCheckBox overlapCheckBox; 41 JSpinner spinEast; 42 JSpinner spinNorth; 43 34 44 public void addGui(final PreferenceDialog gui) { 35 45 JPanel p = gui.createPreferenceTab("wms", tr("WMS Plugin Preferences"), tr("Modify list of WMS servers displayed in the WMS plugin menu")); … … 153 163 browser.setSelectedItem(Main.pref.get("wmsplugin.browser", "webkit-image {0}")); 154 164 p.add(new JLabel(tr("Downloader:")), GBC.eol().fill(GBC.HORIZONTAL)); 155 p.add(browser, GBC.eol().fill(GBC.HORIZONTAL)); 165 p.add(browser); 166 167 168 //Overlap 169 p.add(Box.createHorizontalGlue(), GBC.eol().fill(GBC.HORIZONTAL)); 170 171 overlapCheckBox = new JCheckBox(tr("Overlap tiles"), WMSPlugin.doOverlap ); 172 JLabel labelEast = new JLabel(tr("% of east:")); 173 JLabel labelNorth = new JLabel(tr("% of north:")); 174 spinEast = new JSpinner(new SpinnerNumberModel(WMSPlugin.overlapEast, 1, 50, 1)); 175 spinNorth = new JSpinner(new SpinnerNumberModel(WMSPlugin.overlapNorth, 1, 50, 1)); 176 177 JPanel overlapPanel = new JPanel(new FlowLayout()); 178 overlapPanel.add(overlapCheckBox); 179 overlapPanel.add(labelEast); 180 overlapPanel.add(spinEast); 181 overlapPanel.add(labelNorth); 182 overlapPanel.add(spinNorth); 183 184 p.add(overlapPanel); 156 185 } 157 186 … … 192 221 193 222 if (change) WMSPlugin.refreshMenu(); 223 224 WMSPlugin.doOverlap = overlapCheckBox.getModel().isSelected(); 225 WMSPlugin.overlapEast = (Integer) spinEast.getModel().getValue(); 226 WMSPlugin.overlapNorth = (Integer) spinNorth.getModel().getValue(); 227 228 Main.pref.put("wmsplugin.url.overlap", String.valueOf(WMSPlugin.doOverlap)); 229 Main.pref.put("wmsplugin.url.overlapEast", String.valueOf(WMSPlugin.overlapEast)); 230 Main.pref.put("wmsplugin.url.overlapNorth", String.valueOf(WMSPlugin.overlapNorth)); 194 231 195 232 Main.pref.put("wmsplugin.browser", browser.getEditor().getItem().toString());
Note:
See TracChangeset
for help on using the changeset viewer.