- Timestamp:
- 2009-01-09T21:44:01+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/SideButton.java
r1180 r1227 4 4 import java.awt.event.ActionListener; 5 5 import java.awt.Insets; 6 import java.awt.Image; 6 7 import javax.swing.Action; 7 8 import javax.swing.JButton; 9 import javax.swing.ImageIcon; 8 10 9 11 import org.openstreetmap.josm.Main; … … 18 20 setText(null); 19 21 } 22 23 private static ImageIcon smallIcon(String imagename) { 24 Image im = ImageProvider.get("dialogs", imagename).getImage(); 25 return new ImageIcon(im.getScaledInstance(20 , 20, Image.SCALE_SMOOTH)); 26 } 27 20 28 public SideButton(String imagename, String property, String tooltip, ActionListener actionListener) 21 29 { 22 super( ImageProvider.get("dialogs",imagename));30 super(smallIcon(imagename)); 23 31 doStyle(); 24 32 setActionCommand(imagename); … … 28 36 public SideButton(String name, String imagename, String property, String tooltip, Shortcut shortcut, ActionListener actionListener) 29 37 { 30 super( tr(name), ImageProvider.get("dialogs",imagename));38 super(smallIcon(imagename)); 31 39 if(shortcut != null) 32 40 { … … 39 47 public SideButton(String name, String imagename, String property, String tooltip, ActionListener actionListener) 40 48 { 41 super( tr(name), ImageProvider.get("dialogs",imagename));49 super(smallIcon(imagename)); 42 50 setup(name, property, tooltip, actionListener); 43 51 }
Note:
See TracChangeset
for help on using the changeset viewer.