Changeset 1246 in josm for trunk/src/org
- Timestamp:
- 2009-01-11T16:41:49+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/SideButton.java
r1227 r1246 21 21 } 22 22 23 p rivate static ImageIcon smallIcon(String imagename) {23 public static ImageIcon makeIcon(String imagename) { 24 24 Image im = ImageProvider.get("dialogs", imagename).getImage(); 25 25 return new ImageIcon(im.getScaledInstance(20 , 20, Image.SCALE_SMOOTH)); … … 28 28 public SideButton(String imagename, String property, String tooltip, ActionListener actionListener) 29 29 { 30 super( smallIcon(imagename));30 super(makeIcon(imagename)); 31 31 doStyle(); 32 32 setActionCommand(imagename); … … 36 36 public SideButton(String name, String imagename, String property, String tooltip, Shortcut shortcut, ActionListener actionListener) 37 37 { 38 super( smallIcon(imagename));38 super(tr(name), makeIcon(imagename)); 39 39 if(shortcut != null) 40 40 { 41 41 shortcut.setMnemonic(this); 42 42 if(tooltip != null) 43 43 tooltip = Main.platform.makeTooltip(tooltip, shortcut); 44 44 } 45 45 setup(name, property, tooltip, actionListener); 46 46 } 47 47 public SideButton(String name, String imagename, String property, String tooltip, ActionListener actionListener) 48 48 { 49 super( smallIcon(imagename));49 super(tr(name), makeIcon(imagename)); 50 50 setup(name, property, tooltip, actionListener); 51 51 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r1228 r1246 62 62 63 63 public DeleteLayerAction(Layer layer) { 64 super(tr("Delete"), ImageProvider.get("dialogs","delete"));64 super(tr("Delete"), SideButton.makeIcon("delete")); 65 65 putValue(SHORT_DESCRIPTION, tr("Delete the selected layer.")); 66 66 putValue("help", "Action/LayerDelete"); … … 98 98 99 99 public ShowHideLayerAction(Layer layer) { 100 super(tr("Show/Hide"), ImageProvider.get("dialogs","showhide"));100 super(tr("Show/Hide"), SideButton.makeIcon("showhide")); 101 101 putValue(SHORT_DESCRIPTION, tr("Toggle visible state of the selected layer.")); 102 102 putValue("help", "Action/LayerShowHide"); … … 254 254 buttonPanel.add(new SideButton(deleteAction)); 255 255 256 mergeButton = new SideButton(" Merge", "mergedown", "LayerList", tr("Merge the layer directly below into the selected layer."),256 mergeButton = new SideButton("mergedown", "LayerList", tr("Merge the layer directly below into the selected layer."), 257 257 new ActionListener(){ 258 258 public void actionPerformed(ActionEvent e) { … … 265 265 } 266 266 }); 267 mergeButton.setText(null);268 267 buttonPanel.add(mergeButton); 269 268 … … 286 285 downButton.setEnabled(sel >= 0 && sel < model.getSize()-1); 287 286 deleteAction.setEnabled(!model.isEmpty()); 288 287 289 288 if(model.getSize() != 0) { 290 289 setTitle(tr("Layers: {0}", model.getSize()), true);
Note:
See TracChangeset
for help on using the changeset viewer.