Changeset 2974 in josm for trunk/src/org/openstreetmap/josm/gui/tagging/TagCellRenderer.java
- Timestamp:
- 13.02.2010 17:45:10 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TagCellRenderer.java
r2512 r2974 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Color;7 6 import java.awt.Component; 8 7 import java.awt.Font; 9 8 import java.util.logging.Logger; 10 9 11 import javax.swing.BorderFactory;12 import javax.swing.ImageIcon;13 10 import javax.swing.JLabel; 14 11 import javax.swing.JTable; 15 import javax.swing. border.Border;12 import javax.swing.UIManager; 16 13 import javax.swing.border.EmptyBorder; 17 14 import javax.swing.table.TableCellRenderer; … … 25 22 public class TagCellRenderer extends JLabel implements TableCellRenderer { 26 23 27 private static Logger logger = Logger.getLogger(TagCellRenderer.class.getName()); 28 29 public static final Color BG_COLOR_SELECTED = new Color(143,170,255); 30 public static final Color BG_COLOR_HIGHLIGHTED = new Color(255,255,204); 31 32 public static final Border BORDER_EMPHASIZED = BorderFactory.createLineBorder(new Color(253,75,45)); 33 34 /** the icon displayed for deleting a tag */ 35 private ImageIcon deleteIcon = null; 24 private static final Logger logger = Logger.getLogger(TagCellRenderer.class.getName()); 36 25 37 26 private Font fontStandard = null; … … 39 28 40 29 public TagCellRenderer() { 41 fontStandard = getFont();30 fontStandard = UIManager.getFont("Table.font"); 42 31 fontItalic = fontStandard.deriveFont(Font.ITALIC); 43 32 setOpaque(true); … … 67 56 setText(tag.getValues().get(0)); 68 57 } else if (tag.getValueCount() > 1) { 69 setText(tr(" <multiple>"));58 setText(tr("multiple")); 70 59 setFont(fontItalic); 71 60 } … … 86 75 87 76 /** 88 * renders the background color. The default color is white. It is 89 * set to {@see TableCellRenderer#BG_COLOR_HIGHLIGHTED} if this cell 90 * displays the tag which is suggested by the currently selected 91 * preset. 92 * 77 * renders the background color. 78 * 93 79 * @param tagModel the tag model 94 80 * @param model the tag editor model 95 81 */ 96 82 protected void renderBackgroundColor(TagModel tagModel, TagEditorModel model) { 97 setBackground( Color.WHITE); // standard color83 setBackground(UIManager.getColor("Table.background")); // standard color 98 84 } 99 85 … … 117 103 // 118 104 if (isSelected){ 119 setBackground(BG_COLOR_SELECTED); 105 setBackground(UIManager.getColor("Table.selectionBackground")); 106 setForeground(UIManager.getColor("Table.selectionForeground")); 120 107 } else { 121 108 renderBackgroundColor(getModel(table).get(rowIndex), getModel(table)); … … 130 117 if (hasFocus && isSelected) { 131 118 if (table.getSelectedColumnCount() == 1 && table.getSelectedRowCount() == 1) { 132 boolean success = table.editCellAt(rowIndex, vColIndex);133 134 119 if (table.getEditorComponent() != null) { 135 120 table.getEditorComponent().requestFocusInWindow();
Note: See TracChangeset
for help on using the changeset viewer.
