Changeset 2586 in josm
- Timestamp:
- 2009-12-06T14:32:51+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/SideButton.java
r2017 r2586 8 8 9 9 import javax.swing.Action; 10 import javax.swing.Icon; 10 11 import javax.swing.ImageIcon; 11 12 import javax.swing.JButton; … … 19 20 { 20 21 super(action); 22 fixIcon(); 21 23 doStyle(); 22 24 } … … 24 26 public SideButton(Action action, String imagename) 25 27 { 26 this(action);28 super(action); 27 29 setIcon(makeIcon(imagename)); 30 doStyle(); 31 } 32 33 void fixIcon() { 34 Icon i = getIcon(); 35 if(i != null && i instanceof ImageIcon) 36 { 37 Image im = ((ImageIcon) i).getImage(); 38 setIcon(new ImageIcon(im.getScaledInstance(20 , 20, Image.SCALE_SMOOTH))); 39 } 28 40 } 29 41
Note:
See TracChangeset
for help on using the changeset viewer.