Changeset 1903 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-08-04T08:08:30+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r1895 r1903 73 73 } 74 74 75 protected Layer getActiveLayer() { 76 try { 77 return Main.map.mapView.getActiveLayer(); 78 } catch(NullPointerException e) { 79 return null; 80 } 81 } 82 75 83 private BoundingXYVisitor getBoundingBox() { 76 84 BoundingXYVisitor v = new BoundingXYVisitor(); … … 80 88 } 81 89 } else if (mode.equals("layer")) { 82 Main.map.mapView.getActiveLayer().visitBoundingBox(v); 90 if (getActiveLayer() == null) 91 return null; 92 getActiveLayer().visitBoundingBox(v); 83 93 } else if (mode.equals("selection") || mode.equals("conflict")) { 84 94 Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>(); … … 131 141 if ("selection".equals(mode)) { 132 142 setEnabled(getCurrentDataSet() != null && ! getCurrentDataSet().getSelected().isEmpty()); 143 } else if ("layer".equals(mode)) { 144 setEnabled(getActiveLayer() != null); 133 145 } else { 134 146 setEnabled(
Note:
See TracChangeset
for help on using the changeset viewer.