Changeset 694 in josm for trunk


Ignore:
Timestamp:
2008-07-09T17:51:43+02:00 (16 years ago)
Author:
stoecker
Message:

added icon support for preset menus (see #1088), sorted toolbar preferences

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
3 edited

Legend:

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

    r680 r694  
    135135                                        String[] sp = name.split("/");
    136136                                        if (sp.length <= 1) {
    137                                                 Main.main.menu.presetsMenu.add(new JMenuItem(p));
     137                                                if(p.isEmpty())
     138                                                {
     139                                                        JMenu submenu = submenus.get(sp[0]);
     140                                                        if (submenu == null) {
     141                                                                submenu = new JMenu(p);
     142                                                                submenus.put(sp[0], submenu);
     143                                                                Main.main.menu.presetsMenu.add(submenu);
     144                                                        }
     145                                                }
     146                                                else
     147                                                {
     148                                                        Main.main.menu.presetsMenu.add(new JMenuItem(p));
     149                                                }
    138150                                        } else {
    139151                                                p.setDisplayName(sp[1]);
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r627 r694  
    1414import java.awt.event.ActionListener;
    1515import java.util.HashMap;
     16import java.util.TreeMap;
    1617import java.util.Map;
    1718
     
    141142                selected.removeAllElements();
    142143                unselected.removeAllElements();
     144                Map<String, Action> us = new TreeMap<String, Action>();
    143145                for (Action a : actions.values())
    144                         unselected.addElement(a);
     146                {
     147                        String name = a.getValue(a.NAME).toString();
     148                        if(!name.equals(" "))
     149                                us.put(a.getValue(a.NAME).toString(), a);
     150                }
     151                for (String a : us.keySet())
     152                        unselected.addElement(us.get(a));
    145153                unselected.addElement(null);
    146154
    147155                final JPanel left = new JPanel(new GridBagLayout());
    148                 left.add(new JLabel("Toolbar"), GBC.eol());
     156                left.add(new JLabel(tr("Toolbar")), GBC.eol());
    149157                left.add(new JScrollPane(selectedList), GBC.std().fill(GBC.BOTH));
    150158
    151159                final JPanel right = new JPanel(new GridBagLayout());
    152                 right.add(new JLabel("Available"), GBC.eol());
     160                right.add(new JLabel(tr("Available")), GBC.eol());
    153161                right.add(new JScrollPane(unselectedList), GBC.eol().fill(GBC.BOTH));
    154162
     
    191199                p.add(right);
    192200
    193                 JPanel panel = gui.createPreferenceTab("toolbar", "Toolbar customization", "Customize the elements on the toolbar.");
     201                JPanel panel = gui.createPreferenceTab("toolbar", tr("Toolbar customization"), tr("Customize the elements on the toolbar."));
    194202                panel.add(p, GBC.eol().fill(GBC.BOTH));
    195203
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r692 r694  
    334334        public TaggingPreset() {}
    335335
     336
     337        public boolean isEmpty()
     338        {
     339                return (data.size() == 0);
     340        }
    336341        /**
    337342         * Called from the XML parser to set the name of the tagging preset
Note: See TracChangeset for help on using the changeset viewer.