Ticket #2054: Dont Do stuff on hidden layers.patch
File Dont Do stuff on hidden layers.patch, 4.3 KB (added by , 16 years ago) |
---|
-
src/org/openstreetmap/josm/actions/DeleteAction.java
24 24 } 25 25 26 26 public void actionPerformed(ActionEvent e) { 27 if(!Main.map.mapView.isVisibleDrawableLayer()) 28 return; 27 29 new org.openstreetmap.josm.actions.mapmode.DeleteAction(Main.map) 28 30 .doActionPerformed(e); 29 31 } -
src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
95 95 @Override public void mouseClicked(MouseEvent e) { 96 96 if (e.getButton() != MouseEvent.BUTTON1) 97 97 return; 98 if(!Main.map.mapView.is DrawableLayer())98 if(!Main.map.mapView.isVisibleDrawableLayer()) 99 99 return; 100 100 boolean ctrl = (e.getModifiers() & ActionEvent.CTRL_MASK) != 0; 101 101 boolean shift = (e.getModifiers() & ActionEvent.SHIFT_MASK) != 0; -
src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
125 125 * mouse (which will become selected). 126 126 */ 127 127 @Override public void mouseDragged(MouseEvent e) { 128 if(!Main.map.mapView.isVisibleDrawableLayer()) 129 return; 128 130 if (mode == Mode.select) return; 129 131 130 132 // do not count anything as a move if it lasts less than 100 milliseconds. … … 192 194 /** 193 195 */ 194 196 @Override public void mousePressed(MouseEvent e) { 197 if(!Main.map.mapView.isVisibleDrawableLayer()) 198 return; 195 199 if (!(Boolean)this.getValue("active")) return; 196 200 if (e.getButton() != MouseEvent.BUTTON1) 197 201 return; … … 219 223 * Restore the old mouse cursor. 220 224 */ 221 225 @Override public void mouseReleased(MouseEvent e) { 226 if(!Main.map.mapView.isVisibleDrawableLayer()) 227 return; 222 228 restoreCursor(); 223 229 if (selectedSegment == null) return; 224 230 if (mousePos.distance(initialMousePos) > 10) { -
src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
144 144 * mouse (which will become selected). 145 145 */ 146 146 @Override public void mouseDragged(MouseEvent e) { 147 if(!Main.map.mapView.isVisibleDrawableLayer()) 148 return; 149 147 150 cancelDrawMode = true; 148 151 if (mode == Mode.select) return; 149 152 … … 282 285 * cursor to movement. 283 286 */ 284 287 @Override public void mousePressed(MouseEvent e) { 288 if(!Main.map.mapView.isVisibleDrawableLayer()) 289 return; 290 285 291 cancelDrawMode = false; 286 292 if (! (Boolean)this.getValue("active")) return; 287 293 if (e.getButton() != MouseEvent.BUTTON1) … … 331 337 * Restore the old mouse cursor. 332 338 */ 333 339 @Override public void mouseReleased(MouseEvent e) { 340 if(!Main.map.mapView.isVisibleDrawableLayer()) 341 return; 342 334 343 if (mode == Mode.select) { 335 344 selectionManager.unregister(Main.map.mapView); 336 345 -
src/org/openstreetmap/josm/gui/MapView.java
189 189 { 190 190 return activeLayer != null && activeLayer instanceof OsmDataLayer; 191 191 } 192 193 public Boolean isVisibleDrawableLayer() { 194 return isDrawableLayer() && activeLayer.visible; 195 } 196 192 197 193 198 /** 194 199 * Remove the layer from the mapview. If the layer was in the list before,