Ignore:
Timestamp:
2009-08-02T23:15:26+02:00 (15 years ago)
Author:
Gubaer
Message:

update: rewrite of layer dialog
new: allows multiple selection of layers in the dialog
new: move up, move down, toggle visibility, and delete on multiple layers
new: merge from an arbitrary layer into another layer, not only from the first into the second
new: new action for merging of the currently selected primitives on an arbitrary layer
new: make "active" layer explicit (special icon); activating a layer automatically moves it in the first position
refactoring: public fields 'name' and 'visible' on Layer are @deprecated. Use the setter/getters instead, Layer now emits PropertyChangeEvents if name or visibility are changed.

File:
1 edited

Legend:

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

    r1677 r1890  
    100100
    101101        toolBarToggle.setFloatable(false);
    102         addToggleDialog(new LayerListDialog(this));
     102        LayerListDialog.createInstance(this);
     103        addToggleDialog(LayerListDialog.getInstance());
    103104        addToggleDialog(new PropertiesDialog(this));
    104105        addToggleDialog(new HistoryDialog());
     
    133134     */
    134135    public void destroy() {
    135         for (ToggleDialog t : allDialogs)
     136        for (ToggleDialog t : allDialogs) {
    136137            t.close();
     138        }
    137139        for (int i = 0; i < toolBarActions.getComponentCount(); ++i)
    138             if (toolBarActions.getComponent(i) instanceof Destroyable)
     140            if (toolBarActions.getComponent(i) instanceof Destroyable) {
    139141                ((Destroyable)toolBarActions).destroy();
     142            }
    140143        for (int i = 0; i < toolBarToggle.getComponentCount(); ++i)
    141             if (toolBarToggle.getComponent(i) instanceof Destroyable)
     144            if (toolBarToggle.getComponent(i) instanceof Destroyable) {
    142145                ((Destroyable)toolBarToggle).destroy();
     146            }
    143147
    144148        // remove menu entries
     
    195199        boolean old = isVisible();
    196200        super.setVisible(aFlag);
    197         if (old != aFlag)
     201        if (old != aFlag) {
    198202            firePropertyChange("visible", old, aFlag);
     203        }
    199204    }
    200205
     
    209214        if (mapMode == this.mapMode)
    210215            return;
    211         if (this.mapMode != null)
     216        if (this.mapMode != null) {
    212217            this.mapMode.exitMode();
     218        }
    213219        this.mapMode = mapMode;
    214220        mapMode.enterMode();
     
    230236        if(Main.pref.getBoolean("sidetoolbar.visible", true))
    231237        {
    232             if(Main.pref.getBoolean("sidetoolbar.scrollable", true))
     238            if(Main.pref.getBoolean("sidetoolbar.scrollable", true)) {
    233239                panel.add(new ScrollViewport(jb, ScrollViewport.VERTICAL_DIRECTION),
    234                 BorderLayout.WEST);
    235             else
     240                        BorderLayout.WEST);
     241            } else {
    236242                panel.add(jb, BorderLayout.WEST);
    237         }
    238         if (statusLine != null && Main.pref.getBoolean("statusline.visible", true))
     243            }
     244        }
     245        if (statusLine != null && Main.pref.getBoolean("statusline.visible", true)) {
    239246            panel.add(statusLine, BorderLayout.SOUTH);
     247        }
    240248    }
    241249}
Note: See TracChangeset for help on using the changeset viewer.