Changeset 8130 in josm for trunk/src/org/openstreetmap/josm/gui/tagging/PresetLabel.java
- Timestamp:
- 2015-03-09T08:46:22+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/PresetLabel.java
r7937 r8130 2 2 package org.openstreetmap.josm.gui.tagging; 3 3 4 import javax.swing.JLabel;5 4 import java.awt.Cursor; 6 5 import java.awt.Font; … … 10 9 import java.util.Collections; 11 10 11 import javax.swing.JLabel; 12 12 13 public class PresetLabel extends JLabel { 13 14 14 15 protected final TaggingPreset t; 15 16 17 /** 18 * Constructs a new {@code PresetLabel}. 19 * @param t the tagging preset 20 */ 16 21 public PresetLabel(TaggingPreset t) { 17 22 super(t.getName() + " …"); … … 26 31 */ 27 32 public static class PresetLabelMouseListener implements MouseListener { 28 final protectedJLabel label;29 final protectedFont hover;30 final protectedFont normal;33 protected final JLabel label; 34 protected final Font hover; 35 protected final Font normal; 31 36 37 /** 38 * Constructs a new {@code PresetLabelMouseListener}. 39 * @param lbl Label to highlight 40 */ 32 41 public PresetLabelMouseListener(JLabel lbl) { 33 42 label = lbl; … … 36 45 hover = normal.deriveFont(Collections.singletonMap(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_LOW_DOTTED)); 37 46 } 47 38 48 @Override 39 public void mouseClicked(MouseEvent arg0) { 49 public void mouseClicked(MouseEvent e) { 50 // Do nothing 40 51 } 41 52 42 53 @Override 43 public void mouseEntered(MouseEvent arg0) {54 public void mouseEntered(MouseEvent e) { 44 55 label.setFont(hover); 45 56 } 57 46 58 @Override 47 public void mouseExited(MouseEvent arg0) {59 public void mouseExited(MouseEvent e) { 48 60 label.setFont(normal); 49 61 } 62 50 63 @Override 51 public void mousePressed(MouseEvent arg0) {} 64 public void mousePressed(MouseEvent e) { 65 // Do nothing 66 } 67 52 68 @Override 53 public void mouseReleased(MouseEvent arg0) {} 69 public void mouseReleased(MouseEvent e) { 70 // Do nothing 71 } 54 72 } 55 73 }
Note:
See TracChangeset
for help on using the changeset viewer.