Changeset 1418 in josm for trunk


Ignore:
Timestamp:
2009-02-16T15:24:57+01:00 (16 years ago)
Author:
stoecker
Message:

fixed #2054

Location:
trunk/src/org/openstreetmap/josm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/DeleteAction.java

    r1169 r1418  
    2525
    2626    public void actionPerformed(ActionEvent e) {
     27        if(!Main.map.mapView.isVisibleDrawableLayer())
     28            return;
    2729        new org.openstreetmap.josm.actions.mapmode.DeleteAction(Main.map)
    2830                .doActionPerformed(e);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java

    r1415 r1418  
    9595        if (e.getButton() != MouseEvent.BUTTON1)
    9696            return;
    97         if(!Main.map.mapView.isDrawableLayer())
     97        if(!Main.map.mapView.isVisibleDrawableLayer())
    9898            return;
    9999        boolean ctrl = (e.getModifiers() & ActionEvent.CTRL_MASK) != 0;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r1379 r1418  
    126126     */
    127127    @Override public void mouseDragged(MouseEvent e) {
     128        if(!Main.map.mapView.isVisibleDrawableLayer())
     129            return;
    128130        if (mode == Mode.select) return;
    129131
     
    193195     */
    194196    @Override public void mousePressed(MouseEvent e) {
     197        if(!Main.map.mapView.isVisibleDrawableLayer())
     198            return;
    195199        if (!(Boolean)this.getValue("active")) return;
    196200        if (e.getButton() != MouseEvent.BUTTON1)
     
    220224     */
    221225    @Override public void mouseReleased(MouseEvent e) {
     226        if(!Main.map.mapView.isVisibleDrawableLayer())
     227            return;
    222228        restoreCursor();
    223229        if (selectedSegment == null) return;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r1412 r1418  
    145145     */
    146146    @Override public void mouseDragged(MouseEvent e) {
     147        if(!Main.map.mapView.isVisibleDrawableLayer())
     148            return;
     149       
    147150        cancelDrawMode = true;
    148151        if (mode == Mode.select) return;
     
    283286     */
    284287    @Override public void mousePressed(MouseEvent e) {
     288        if(!Main.map.mapView.isVisibleDrawableLayer())
     289            return;
     290       
    285291        cancelDrawMode = false;
    286292        if (! (Boolean)this.getValue("active")) return;
     
    332338     */
    333339    @Override public void mouseReleased(MouseEvent e) {
     340        if(!Main.map.mapView.isVisibleDrawableLayer())
     341            return;
     342       
    334343        if (mode == Mode.select) {
    335344            selectionManager.unregister(Main.map.mapView);
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r1415 r1418  
    190190        return activeLayer != null && activeLayer instanceof OsmDataLayer;
    191191    }
     192   
     193    public Boolean isVisibleDrawableLayer() {
     194        return isDrawableLayer() && activeLayer.visible;
     195    }
     196   
    192197
    193198    /**
Note: See TracChangeset for help on using the changeset viewer.