Changeset 1750 in josm for trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
- Timestamp:
- 2009-07-08T21:50:32+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r1662 r1750 8 8 import java.awt.event.KeyEvent; 9 9 import java.util.Collection; 10 import java.util.HashSet; 10 11 11 12 import javax.swing.JOptionPane; … … 70 71 BoundingXYVisitor v = new BoundingXYVisitor(); 71 72 if (mode.equals("data")) { 72 for (Layer l : Main.map.mapView.getAllLayers()) 73 for (Layer l : Main.map.mapView.getAllLayers()) { 73 74 l.visitBoundingBox(v); 74 } else if (mode.equals("layer")) 75 } 76 } else if (mode.equals("layer")) { 75 77 Main.map.mapView.getActiveLayer().visitBoundingBox(v); 76 else if (mode.equals("selection") || mode.equals("conflict")) { 77 Collection<OsmPrimitive> sel = mode.equals("selection") ? Main.ds.getSelected() 78 : Main.map.conflictDialog.conflicts.keySet(); 78 } else if (mode.equals("selection") || mode.equals("conflict")) { 79 Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>(); 80 if (mode.equals("selection")) { 81 sel = Main.ds.getSelected(); 82 } else if (mode.equals("conflict")) { 83 if (Main.map.conflictDialog.getConflicts() != null) { 84 sel = Main.map.conflictDialog.getConflicts().getMyConflictParties(); 85 } 86 } 79 87 if (sel.isEmpty()) { 80 88 JOptionPane.showMessageDialog(Main.parent, … … 82 90 return null; 83 91 } 84 for (OsmPrimitive osm : sel) 92 for (OsmPrimitive osm : sel) { 85 93 osm.visit(v); 94 } 86 95 // increase bbox by 0.001 degrees on each side. this is required 87 96 // especially if the bbox contains one single node, but helpful
Note:
See TracChangeset
for help on using the changeset viewer.