Ignore:
Timestamp:
2009-02-08T11:34:23+01:00 (17 years ago)
Author:
stoecker
Message:

apply #2127. patch by xeen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r1265 r1379  
    1515import java.awt.image.BufferedImage;
    1616import java.util.ArrayList;
     17import java.util.Enumeration;
    1718import java.util.Collection;
    1819import java.util.Collections;
    1920import java.util.LinkedList;
    2021
     22import javax.swing.AbstractButton;
    2123import javax.swing.JComponent;
    2224import javax.swing.JOptionPane;
     
    2527import org.openstreetmap.josm.actions.AutoScaleAction;
    2628import org.openstreetmap.josm.actions.JosmAction;
     29import org.openstreetmap.josm.actions.mapmode.MapMode;
    2730import org.openstreetmap.josm.actions.MoveAction;
    2831import org.openstreetmap.josm.data.Bounds;
     
    357360                l.activeLayerChange(old, layer);
    358361        }
     362       
     363        /* This only makes the buttons look disabled. Disabling the actions as well requires
     364         * the user to re-select the tool after i.e. moving a layer. While testing I found
     365         * that I switch layers and actions at the same time and it was annoying to mind the
     366         * order. This way it works as visual clue for new users */
     367        for (Enumeration e = Main.map.toolGroup.getElements() ; e.hasMoreElements() ;) {
     368            AbstractButton x=(AbstractButton)e.nextElement();
     369            x.setEnabled(((MapMode)x.getAction()).layerIsSupported(layer));
     370        }
    359371        repaint();
    360372    }
Note: See TracChangeset for help on using the changeset viewer.