- Timestamp:
- 2009-12-30T11:56:09+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/SideButton.java
r2586 r2710 20 20 { 21 21 super(action); 22 fixIcon(); 23 doStyle(); 24 } 25 26 public SideButton(Action action, boolean usename) 27 { 28 super(action); 29 if(!usename) 30 setText(null); 22 31 fixIcon(); 23 32 doStyle(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r2689 r2710 41 41 import org.openstreetmap.josm.gui.MapFrame; 42 42 import org.openstreetmap.josm.gui.MapView; 43 import org.openstreetmap.josm.gui.SideButton; 43 44 import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetCacheManager; 44 45 import org.openstreetmap.josm.gui.dialogs.changeset.ChangesetHeaderDownloadTask; … … 184 185 185 186 protected JPanel buildButtonPanel() { 186 JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT)); 187 188 JToolBar tp = new JToolBar(JToolBar.HORIZONTAL); 189 tp.setFloatable(false); 187 JPanel tp = getButtonPanel(5); 190 188 191 189 // -- select objects action 192 190 selectObjectsAction = new SelectObjectsAction(); 193 tp.add( selectObjectsAction);191 tp.add(new SideButton(selectObjectsAction, false)); 194 192 cbInSelectionOnly.addItemListener(selectObjectsAction); 195 193 lstInActiveDataLayer.getSelectionModel().addListSelectionListener(selectObjectsAction); … … 198 196 // -- read changesets action 199 197 readChangesetAction = new ReadChangesetsAction(); 200 tp.add( readChangesetAction);198 tp.add(new SideButton(readChangesetAction, false)); 201 199 cbInSelectionOnly.addItemListener(readChangesetAction); 202 200 lstInActiveDataLayer.getSelectionModel().addListSelectionListener(readChangesetAction); … … 205 203 // -- close changesets action 206 204 closeChangesetAction = new CloseOpenChangesetsAction(); 207 tp.add( closeChangesetAction);205 tp.add(new SideButton(closeChangesetAction, false)); 208 206 cbInSelectionOnly.addItemListener(closeChangesetAction); 209 207 lstInActiveDataLayer.getSelectionModel().addListSelectionListener(closeChangesetAction); … … 212 210 // -- show info action 213 211 showChangsetInfoAction = new ShowChangesetInfoAction(); 214 tp.add( showChangsetInfoAction);212 tp.add(new SideButton(showChangsetInfoAction, false)); 215 213 cbInSelectionOnly.addItemListener(showChangsetInfoAction); 216 214 lstInActiveDataLayer.getSelectionModel().addListSelectionListener(showChangsetInfoAction); … … 219 217 // -- launch changeset manager action 220 218 launchChangesetManagerAction = new LaunchChangesetManagerAction(); 221 tp.add( launchChangesetManagerAction);219 tp.add(new SideButton(launchChangesetManagerAction, false)); 222 220 cbInSelectionOnly.addItemListener(launchChangesetManagerAction); 223 221 lstInActiveDataLayer.getSelectionModel().addListSelectionListener(launchChangesetManagerAction); 224 222 lstInSelection.getSelectionModel().addListSelectionListener(launchChangesetManagerAction); 225 223 226 pnl.add(tp); 227 return pnl; 224 return tp; 228 225 } 229 226 -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r2655 r2710 8 8 import java.awt.Color; 9 9 import java.awt.Graphics; 10 import java.awt.GridLayout;11 10 import java.awt.Point; 12 11 import java.awt.event.ActionEvent; … … 106 105 lstConflicts.getSelectionModel().addListSelectionListener(actSelect); 107 106 108 JPanel buttonPanel = new JPanel(new GridLayout(1,2));107 JPanel buttonPanel = getButtonPanel(2); 109 108 buttonPanel.add(btnResolve); 110 109 buttonPanel.add(btnSelect); -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
r2626 r2710 63 63 64 64 protected JPanel buildButtonRow() { 65 JPanel pnl = new JPanel(new GridLayout(1, 4));65 JPanel pnl = getButtonPanel(5); 66 66 67 67 addButton = new SideButton(marktr("Add"), "add", "SelectionList", tr("Add filter."), -
trunk/src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java
r2560 r2710 6 6 import java.awt.BorderLayout; 7 7 import java.awt.Component; 8 import java.awt.GridLayout;9 8 import java.awt.event.ActionEvent; 10 9 import java.awt.event.KeyEvent; … … 72 71 */ 73 72 protected JPanel buildButtonRow() { 74 JPanel buttons = new JPanel(new GridLayout(1,2));73 JPanel buttons = getButtonPanel(2); 75 74 76 75 SideButton btn = new SideButton(reloadAction = new ReloadAction()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r2697 r2710 5 5 import java.awt.BorderLayout; 6 6 import java.awt.Component; 7 import java.awt.FlowLayout;8 7 import java.awt.Point; 9 8 import java.awt.Rectangle; … … 29 28 import javax.swing.JPanel; 30 29 import javax.swing.JScrollPane; 31 import javax.swing.JToolBar;32 30 import javax.swing.KeyStroke; 33 31 import javax.swing.ListModel; … … 43 41 import org.openstreetmap.josm.gui.MapFrame; 44 42 import org.openstreetmap.josm.gui.MapView; 43 import org.openstreetmap.josm.gui.SideButton; 45 44 import org.openstreetmap.josm.gui.help.HelpUtil; 46 45 import org.openstreetmap.josm.gui.io.SaveLayersDialog; … … 98 97 99 98 protected JPanel createButtonPanel() { 100 JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0)); 101 102 JToolBar tb = new JToolBar(JToolBar.HORIZONTAL); 103 tb.setFloatable(false); 99 JPanel buttonPanel = getButtonPanel(5); 104 100 105 101 // -- move up action … … 107 103 adaptTo(moveUpAction, model); 108 104 adaptTo(moveUpAction,selectionModel); 109 tb.add(moveUpAction);105 buttonPanel.add(new SideButton(moveUpAction)); 110 106 111 107 // -- move down action … … 113 109 adaptTo(moveDownAction, model); 114 110 adaptTo(moveDownAction,selectionModel); 115 tb.add(moveDownAction);111 buttonPanel.add(new SideButton(moveDownAction)); 116 112 117 113 // -- activate action … … 119 115 adaptTo(activateLayerAction, selectionModel); 120 116 MapView.addLayerChangeListener(activateLayerAction); 121 tb.add(activateLayerAction);117 buttonPanel.add(new SideButton(activateLayerAction)); 122 118 123 119 // -- show hide action 124 120 ShowHideLayerAction showHideLayerAction = new ShowHideLayerAction(); 125 121 adaptTo(showHideLayerAction, selectionModel); 126 tb.add(showHideLayerAction);122 buttonPanel.add(new SideButton(showHideLayerAction)); 127 123 128 124 // -- merge layer action … … 130 126 adaptTo(mergeLayerAction, model); 131 127 adaptTo(mergeLayerAction,selectionModel); 132 tb.add(mergeLayerAction);128 buttonPanel.add(new SideButton(mergeLayerAction)); 133 129 134 130 … … 140 136 layerList.getActionMap().put("deleteLayer", deleteLayerAction); 141 137 adaptTo(deleteLayerAction, selectionModel); 142 tb.add(deleteLayerAction); 143 144 buttonPanel.add(tb); 138 buttonPanel.add(new SideButton(deleteLayerAction, false)); 139 145 140 return buttonPanel; 146 141 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r2691 r2710 24 24 import javax.swing.JPopupMenu; 25 25 import javax.swing.JScrollPane; 26 import javax.swing.J ToolBar;26 import javax.swing.JPanel; 27 27 import javax.swing.KeyStroke; 28 28 import javax.swing.ListSelectionModel; … … 49 49 import org.openstreetmap.josm.gui.MapView; 50 50 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 51 import org.openstreetmap.josm.gui.SideButton; 51 52 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 52 53 import org.openstreetmap.josm.gui.dialogs.relation.DownloadRelationTask; … … 100 101 // create the panel with buttons 101 102 // 102 JToolBar tp = new JToolBar(JToolBar.HORIZONTAL); 103 tp.setFloatable(false); 103 JPanel tp = getButtonPanel(5); 104 104 // the new action 105 105 // 106 106 newAction = new NewAction(); 107 tp.add(new Action);107 tp.add(new SideButton(newAction, false)); 108 108 109 109 // the edit action … … 111 111 editAction = new EditAction(); 112 112 displaylist.addListSelectionListener(editAction); 113 tp.add( editAction);113 tp.add(new SideButton(editAction, false)); 114 114 115 115 // the duplicate action … … 117 117 DuplicateAction duplicateAction = new DuplicateAction(); 118 118 displaylist.addListSelectionListener(duplicateAction); 119 tp.add( duplicateAction);119 tp.add(new SideButton(duplicateAction, false)); 120 120 121 121 // the delete action … … 123 123 deleteAction = new DeleteAction(); 124 124 displaylist.addListSelectionListener(deleteAction); 125 tp.add( deleteAction);125 tp.add(new SideButton(deleteAction, false)); 126 126 127 127 // the select action … … 129 129 SelectAction selectAction = new SelectAction(); 130 130 displaylist.addListSelectionListener(selectAction); 131 tp.add( selectAction);131 tp.add(new SideButton(selectAction, false)); 132 132 133 133 add(tp, BorderLayout.SOUTH); -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r2658 r2710 8 8 import java.awt.BorderLayout; 9 9 import java.awt.Color; 10 import java.awt.GridLayout;11 10 import java.awt.Rectangle; 12 11 import java.awt.event.ActionEvent; … … 111 110 add(new JScrollPane(displaylist), BorderLayout.CENTER); 112 111 113 JPanel buttonPanel = new JPanel(new GridLayout(1, 2));112 JPanel buttonPanel = getButtonPanel(2); 114 113 115 114 selectButton = new SideButton(marktr("Select"), "select", "SelectionList", -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r2613 r2710 8 8 import java.awt.Dimension; 9 9 import java.awt.Graphics; 10 import java.awt.FlowLayout; 11 import java.awt.GridLayout; 10 12 import java.awt.GridBagLayout; 11 13 import java.awt.Image; … … 562 564 * and the toggle dialogs themself are discared, for instance because no layer is 563 565 * left in JOSM and the main screen turns from the map editor to the MOTD panel. 564 * 566 * 565 567 * Override in subclasses to unregister as listener. After tearDown() is invoked 566 568 * the dialog should be registered as listener. 567 * 569 * 568 570 * The default implementation is empty. 569 571 */ 570 572 public void tearDown() {} 573 574 protected JPanel getButtonPanel(int columns) { 575 JPanel pnl = new JPanel(); 576 pnl.setLayout(Main.pref.getBoolean("dialog.align.left", false) 577 ? new FlowLayout(FlowLayout.LEFT) : new GridLayout(1,columns)); 578 return pnl; 579 } 571 580 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r2626 r2710 6 6 7 7 import java.awt.BorderLayout; 8 import java.awt.FlowLayout;9 8 import java.awt.event.ActionEvent; 10 9 import java.awt.event.KeyEvent; … … 79 78 80 79 protected JPanel buildButtonRow() { 81 JPanel pnl = new JPanel(); 82 pnl.setLayout(new FlowLayout(FlowLayout.LEFT)); 80 JPanel pnl = getButtonPanel(2); 83 81 84 82 // -- select users primitives action
Note:
See TracChangeset
for help on using the changeset viewer.