Changeset 19050 in osm for applications/editors/josm/plugins/slippymap
- Timestamp:
- 2009-12-12T17:34:12+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/slippymap
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/slippymap/build.xml
r18593 r19050 26 26 <attribute name="Plugin-Description" value="Displays a slippy map grid in JOSM. Can load tiles from slippy map as background and request updates."/> 27 27 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/SlippyMap"/> 28 <attribute name="Plugin-Mainversion" value="2 450"/>28 <attribute name="Plugin-Mainversion" value="2620"/> 29 29 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/> 30 30 </manifest> -
applications/editors/josm/plugins/slippymap/src/org/openstreetmap/josm/plugins/slippymap/SlippyMapLayer.java
r18784 r19050 39 39 import org.openstreetmap.josm.actions.RenameLayerAction; 40 40 import org.openstreetmap.josm.data.Bounds; 41 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent; 41 42 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; 42 43 import org.openstreetmap.josm.data.coor.LatLon; … … 212 213 213 214 // FIXME: currently ran in errors 214 215 215 216 tileOptionMenu.add(new JMenuItem( 216 217 new AbstractAction(tr("Snap to tile size")) { … … 251 252 }); 252 253 253 listeners.add(new LayerChangeListener() {254 addLayerChangeListener(new LayerChangeListener() { 254 255 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 256 // 255 257 } 256 258 257 259 public void layerAdded(Layer newLayer) { 260 // 258 261 } 259 262 260 263 public void layerRemoved(Layer oldLayer) { 261 Main.pref. listener.remove(SlippyMapLayer.this);264 Main.pref.addPreferenceChangeListener(SlippyMapLayer.this); 262 265 } 263 266 }); … … 265 268 }); 266 269 267 Main.pref. listener.add(this);270 Main.pref.addPreferenceChangeListener(this); 268 271 } 269 272 … … 795 798 out("queued to load: " + nr_queued + "/" + tiles.size() + " tiles at zoom: " + zoom); 796 799 } 797 boolean topTile(Tile t) {798 if (t.getYtile() == z12y0 )799 return true;800 return false;801 }802 803 boolean leftTile(Tile t) {804 if (t.getXtile() == z12x0 )805 return true;806 return false;807 }808 800 } 809 801 … … 1032 1024 } 1033 1025 1034 private static int nr_loaded = 0;1035 private static int at_zoom = -1;1036 1037 1026 /* 1038 1027 * (non-Javadoc) … … 1041 1030 * preferenceChanged(java.lang.String, java.lang.String) 1042 1031 */ 1043 public void preferenceChanged( String key, String newValue) {1044 if ( key.startsWith(SlippyMapPreferences.PREFERENCE_PREFIX)) {1032 public void preferenceChanged(PreferenceChangeEvent event) { 1033 if (event.getKey().startsWith(SlippyMapPreferences.PREFERENCE_PREFIX)) { 1045 1034 // System.err.println(this + ".preferenceChanged('" + key + "', '" 1046 1035 // + newValue + "') called"); 1047 1036 // when fade background changed, no need to clear tile storage 1048 1037 // TODO move this code to SlippyMapPreferences class. 1049 if (! key.equals(SlippyMapPreferences.PREFERENCE_FADE_BACKGROUND)) {1038 if (!event.getKey().equals(SlippyMapPreferences.PREFERENCE_FADE_BACKGROUND)) { 1050 1039 autoZoomPopup.setSelected(SlippyMapPreferences.getAutozoom()); 1051 1040 } 1052 if ( key.equals(SlippyMapPreferences.PREFERENCE_TILE_SOURCE)) {1041 if (event.getKey().equals(SlippyMapPreferences.PREFERENCE_TILE_SOURCE)) { 1053 1042 newTileStorage(); 1054 1043 } … … 1059 1048 @Override 1060 1049 public void destroy() { 1061 Main.pref. listener.remove(SlippyMapLayer.this);1050 Main.pref.removePreferenceChangeListener(SlippyMapLayer.this); 1062 1051 } 1063 1052 }
Note:
See TracChangeset
for help on using the changeset viewer.