Changeset 1153 in josm for trunk/src/org/openstreetmap/josm
- Timestamp:
- 2008-12-22T14:02:32+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r997 r1153 50 50 /** 51 51 * The toolbar with the action icons. To add new toggle dialog actions, use addToggleDialog 52 * instead of adding directly to this list. 52 * instead of adding directly to this list. To add a new mode use addMapMode. 53 53 */ 54 54 public JToolBar toolBarActions = new JToolBar(JToolBar.VERTICAL); 55 public JToolBar toolBarToggle = new JToolBar(JToolBar.VERTICAL); 55 56 /** 56 57 * The status line below the map … … 82 83 // toolbar 83 84 toolBarActions.setFloatable(false); 84 toolBarActions.add(new IconToggleButton(new ZoomAction(this))); 85 toolBarActions.add(new IconToggleButton(new SelectAction(this))); 86 toolBarActions.add(new IconToggleButton(new DrawAction(this))); 87 toolBarActions.add(new IconToggleButton(new DeleteAction(this))); 88 toolBarActions.add(new IconToggleButton(new ExtrudeAction(this))); 89 90 for (Component c : toolBarActions.getComponents()) 91 toolGroup.add((AbstractButton)c); 85 addMapMode(new IconToggleButton(new ZoomAction(this))); 86 addMapMode(new IconToggleButton(new SelectAction(this))); 87 addMapMode(new IconToggleButton(new DrawAction(this))); 88 addMapMode(new IconToggleButton(new DeleteAction(this))); 89 addMapMode(new IconToggleButton(new ExtrudeAction(this))); 90 92 91 toolGroup.setSelected(((AbstractButton)toolBarActions.getComponent(0)).getModel(), true); 93 94 toolBarActions.addSeparator(); 95 92 96 93 add(toggleDialogs, BorderLayout.EAST); 97 94 toggleDialogs.setLayout(new BoxLayout(toggleDialogs, BoxLayout.Y_AXIS)); 98 95 96 toolBarToggle.setFloatable(false); 99 97 addToggleDialog(new LayerListDialog(this)); 100 98 addToggleDialog(new PropertiesDialog(this)); … … 118 116 if (toolBarActions.getComponent(i) instanceof Destroyable) 119 117 ((Destroyable)toolBarActions).destroy(); 118 for (int i = 0; i < toolBarToggle.getComponentCount(); ++i) 119 if (toolBarToggle.getComponent(i) instanceof Destroyable) 120 ((Destroyable)toolBarToggle).destroy(); 120 121 121 122 // remove menu entries … … 148 149 dlg.action.button = button; 149 150 dlg.parent = toggleDialogs; 150 toolBar Actions.add(button);151 toolBarToggle.add(button); 151 152 toggleDialogs.add(dlg); 152 153 } 153 154 155 public void addMapMode(IconToggleButton b) { 156 toolBarActions.add(b); 157 toolGroup.add((AbstractButton)b); 158 } 154 159 155 160 /** … … 187 192 public void fillPanel(Container panel) { 188 193 panel.add(this, BorderLayout.CENTER); 189 panel.add(toolBarActions, BorderLayout.WEST); 194 JToolBar jb = new JToolBar(JToolBar.VERTICAL); 195 jb.setFloatable(false); 196 jb.add(toolBarActions); 197 jb.addSeparator(); 198 jb.add(toolBarToggle); 199 panel.add(jb, BorderLayout.WEST); 190 200 if (statusLine != null) 191 201 panel.add(statusLine, BorderLayout.SOUTH);
Note:
See TracChangeset
for help on using the changeset viewer.