Changeset 4407 in josm
- Timestamp:
- 2011-09-07T23:57:40+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PresetListPanel.java
r4148 r4407 8 8 import java.awt.event.MouseEvent; 9 9 import java.awt.event.MouseListener; 10 import java.awt.font.TextAttribute; 10 11 import java.util.Collection; 12 import java.util.Collections; 13 import java.util.Hashtable; 11 14 import java.util.List; 12 15 import java.util.Map; 13 16 17 import javax.swing.Action; 18 import javax.swing.Icon; 14 19 import javax.swing.JLabel; 15 20 import javax.swing.JPanel; … … 42 47 private static class PresetLabelML implements MouseListener { 43 48 final JLabel label; 44 final Font bold;49 final Font hover; 45 50 final Font normal; 46 51 final TaggingPreset tag; … … 52 57 lbl.setCursor(new Cursor(Cursor.HAND_CURSOR)); 53 58 normal = label.getFont(); 54 bold = normal.deriveFont(normal.getStyle() ^ Font.BOLD);59 hover = normal.deriveFont(Collections.singletonMap(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_LOW_DOTTED)); 55 60 tag = t; 56 61 this.presetHandler = presetHandler; … … 68 73 } 69 74 public void mouseEntered(MouseEvent arg0) { 70 label.setFont( bold);75 label.setFont(hover); 71 76 } 72 77 public void mouseExited(MouseEvent arg0) { … … 134 139 } 135 140 136 JLabel lbl = new JLabel(t.getName()); 141 JLabel lbl = new JLabel(t.getName() + " …"); 142 lbl.setIcon((Icon) t.getValue(Action.SMALL_ICON)); 137 143 lbl.addMouseListener(new PresetLabelML(lbl, t, presetHandler)); 138 144 add(lbl, GBC.eol().fill(GBC.HORIZONTAL));
Note:
See TracChangeset
for help on using the changeset viewer.