Changeset 32476 in osm for applications/editors/josm/plugins
- Timestamp:
- 2016-06-30T23:56:10+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/walkingpapers
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/walkingpapers/.settings/org.eclipse.jdt.core.prefs
r30736 r32476 85 85 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 86 86 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 87 org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore 87 88 org.eclipse.jdt.core.compiler.problem.unusedImport=warning 88 89 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -
applications/editors/josm/plugins/walkingpapers/.settings/org.eclipse.jdt.ui.prefs
r16522 r32476 1 #Wed Jul 15 15:49:32 CEST 20092 1 eclipse.preferences.version=1 2 editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true 3 3 internal.default.compliance=default 4 sp_cleanup.add_default_serial_version_id=true 5 sp_cleanup.add_generated_serial_version_id=false 6 sp_cleanup.add_missing_annotations=true 7 sp_cleanup.add_missing_deprecated_annotations=true 8 sp_cleanup.add_missing_methods=false 9 sp_cleanup.add_missing_nls_tags=false 10 sp_cleanup.add_missing_override_annotations=true 11 sp_cleanup.add_missing_override_annotations_interface_methods=true 12 sp_cleanup.add_serial_version_id=false 13 sp_cleanup.always_use_blocks=true 14 sp_cleanup.always_use_parentheses_in_expressions=false 15 sp_cleanup.always_use_this_for_non_static_field_access=false 16 sp_cleanup.always_use_this_for_non_static_method_access=false 17 sp_cleanup.convert_functional_interfaces=false 18 sp_cleanup.convert_to_enhanced_for_loop=false 19 sp_cleanup.correct_indentation=true 20 sp_cleanup.format_source_code=false 21 sp_cleanup.format_source_code_changes_only=false 22 sp_cleanup.insert_inferred_type_arguments=false 23 sp_cleanup.make_local_variable_final=true 24 sp_cleanup.make_parameters_final=false 25 sp_cleanup.make_private_fields_final=true 26 sp_cleanup.make_type_abstract_if_missing_method=false 27 sp_cleanup.make_variable_declarations_final=false 28 sp_cleanup.never_use_blocks=false 29 sp_cleanup.never_use_parentheses_in_expressions=true 30 sp_cleanup.on_save_use_additional_actions=true 31 sp_cleanup.organize_imports=true 32 sp_cleanup.qualify_static_field_accesses_with_declaring_class=false 33 sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true 34 sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true 35 sp_cleanup.qualify_static_member_accesses_with_declaring_class=false 36 sp_cleanup.qualify_static_method_accesses_with_declaring_class=false 37 sp_cleanup.remove_private_constructors=true 38 sp_cleanup.remove_redundant_type_arguments=true 39 sp_cleanup.remove_trailing_whitespaces=true 40 sp_cleanup.remove_trailing_whitespaces_all=true 41 sp_cleanup.remove_trailing_whitespaces_ignore_empty=false 42 sp_cleanup.remove_unnecessary_casts=true 43 sp_cleanup.remove_unnecessary_nls_tags=false 44 sp_cleanup.remove_unused_imports=true 45 sp_cleanup.remove_unused_local_variables=false 46 sp_cleanup.remove_unused_private_fields=true 47 sp_cleanup.remove_unused_private_members=false 48 sp_cleanup.remove_unused_private_methods=true 49 sp_cleanup.remove_unused_private_types=true 50 sp_cleanup.sort_members=false 51 sp_cleanup.sort_members_all=false 52 sp_cleanup.use_anonymous_class_creation=false 53 sp_cleanup.use_blocks=false 54 sp_cleanup.use_blocks_only_for_return_and_throw=false 55 sp_cleanup.use_lambda=true 56 sp_cleanup.use_parentheses_in_expressions=false 57 sp_cleanup.use_this_for_non_static_field_access=false 58 sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true 59 sp_cleanup.use_this_for_non_static_method_access=false 60 sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true 61 sp_cleanup.use_type_arguments=false -
applications/editors/josm/plugins/walkingpapers/build.xml
r31923 r32476 5 5 <property name="commit.message" value="Changed the constructor signature of the plugin main class"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value=" 7817"/>7 <property name="plugin.main.version" value="10279"/> 8 8 9 9 <property name="plugin.author" value="Frederik Ram"/> -
applications/editors/josm/plugins/walkingpapers/src/org/openstreetmap/josm/plugins/walkingpapers/WalkingPapersAddLayerAction.java
r30738 r32476 85 85 86 86 WalkingPapersLayer wpl = new WalkingPapersLayer(mungedWpId, tile, b, minz, maxz); 87 Main.main.addLayer(wpl); 88 87 Main.getLayerManager().addLayer(wpl); 89 88 } 90 89 -
applications/editors/josm/plugins/walkingpapers/src/org/openstreetmap/josm/plugins/walkingpapers/WalkingPapersLayer.java
r31114 r32476 21 21 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 22 22 import org.openstreetmap.josm.gui.MapView; 23 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;24 23 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 25 24 import org.openstreetmap.josm.gui.dialogs.LayerListPopup; 26 25 import org.openstreetmap.josm.gui.layer.Layer; 26 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; 27 import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener; 28 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent; 29 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent; 30 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; 31 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; 27 32 import org.openstreetmap.josm.tools.ImageProvider; 28 33 … … 67 72 clearTileStorage(); 68 73 69 MapView.addLayerChangeListener(new LayerChangeListener() { 70 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 71 // if user changes to a walking papers layer, zoom there just as if 72 // it was newly added 73 layerAdded(newLayer); 74 } 75 76 public void layerAdded(Layer newLayer) { 77 // only do something if we are affected 78 if (newLayer != WalkingPapersLayer.this) return; 79 BoundingXYVisitor bbox = new BoundingXYVisitor(); 80 bbox.visit(printBounds); 81 Main.map.mapView.zoomTo(bbox); 82 needRedraw = true; 83 } 84 85 public void layerRemoved(Layer oldLayer) { 86 if (oldLayer == WalkingPapersLayer.this) { 87 MapView.removeLayerChangeListener(this); 74 final ActiveLayerChangeListener activeListener = new ActiveLayerChangeListener() { 75 @Override 76 public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) { 77 // if user changes to a walking papers layer, zoom there just as if it was newly added 78 handleNewLayer(Main.getLayerManager().getActiveLayer()); 79 } 80 }; 81 82 Main.getLayerManager().addActiveLayerChangeListener(activeListener); 83 Main.getLayerManager().addLayerChangeListener(new LayerChangeListener() { 84 85 @Override 86 public void layerAdded(LayerAddEvent e) { 87 handleNewLayer(e.getAddedLayer()); 88 } 89 90 @Override 91 public void layerRemoving(LayerRemoveEvent e) { 92 if (e.getRemovedLayer() == WalkingPapersLayer.this) { 93 Main.getLayerManager().removeLayerChangeListener(this); 94 Main.getLayerManager().removeActiveLayerChangeListener(activeListener); 88 95 } 89 96 } 97 98 @Override 99 public void layerOrderChanged(LayerOrderChangeEvent e) { 100 } 90 101 }); 102 } 103 104 private void handleNewLayer(Layer newLayer) { 105 // only do something if we are affected 106 if (newLayer != WalkingPapersLayer.this) return; 107 BoundingXYVisitor bbox = new BoundingXYVisitor(); 108 bbox.visit(printBounds); 109 Main.map.mapView.zoomTo(bbox); 110 needRedraw = true; 91 111 } 92 112 … … 117 137 118 138 static class TileTimeComp implements Comparator<WalkingPapersTile> { 139 @Override 119 140 public int compare(WalkingPapersTile s1, WalkingPapersTile s2) { 120 141 long t1 = s1.access_time(); … … 170 191 int realHeight = img.getHeight(this); 171 192 if (realWidth == -1 || realHeight == -1) 172 193 return null; 173 194 int drawWidth = p1.x - p0.x; 174 195 int drawHeight = p1.x - p0.x; … … 189 210 190 211 if (botRight.lon() == 0.0 || botRight.lat() == 0) { 191 192 212 // probably still initializing 213 return; 193 214 } 194 215 if (lastTopLeft != null && lastBotRight != null … … 209 230 210 231 if (!LatLon.isValidLat(topLeft.lat()) || 211 !LatLon.isValidLat(botRight.lat()) || 212 !LatLon.isValidLon(topLeft.lon()) || 213 !LatLon.isValidLon(botRight.lon())) 232 !LatLon.isValidLat(botRight.lat()) || 233 !LatLon.isValidLon(topLeft.lon()) || 234 !LatLon.isValidLon(botRight.lon())) 214 235 return; 215 236 … … 257 278 // check if tile is in range 258 279 Bounds tileBounds = new Bounds(new LatLon(tileYToLat(y+1), tileXToLon(x)), 259 new LatLon(tileYToLat(y), tileXToLon(x+1))); 280 new LatLon(tileYToLat(y), tileXToLon(x+1))); 260 281 if (!tileBounds.asRect().intersects(printBounds.asRect())) continue; 261 282 tile = new WalkingPapersTile(x, y, currentZoomLevel, this); … … 397 418 } 398 419 420 @Override 399 421 public boolean imageUpdate(Image img, int infoflags, int x, int y, 400 422 int width, int height) { … … 414 436 public URL formatImageUrl(int x, int y, int z) { 415 437 String urlstr = tileUrlTemplate. 416 replace("{x}", String.valueOf(x)). 417 replace("{y}", String.valueOf(y)). 418 replace("{z}", String.valueOf(z)); 438 replace("{x}", String.valueOf(x)). 439 replace("{y}", String.valueOf(y)). 440 replace("{z}", String.valueOf(z)); 419 441 try { 420 442 return new URL(urlstr);
Note:
See TracChangeset
for help on using the changeset viewer.