source: josm/trunk/src/org/openstreetmap/josm/gui/conflict/pair/ComparePairListCellRenderer.java@ 5299

Last change on this file since 5299 was 4162, checked in by stoecker, 13 years ago

fix #4140 - make colors in conflict dialog configurable

  • Property svn:eol-style set to native
File size: 917 bytes
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.conflict.pair;
3
4import java.awt.Component;
5
6import javax.swing.JLabel;
7import javax.swing.JList;
8import javax.swing.ListCellRenderer;
9
10import org.openstreetmap.josm.gui.conflict.ConflictColors;
11
12public class ComparePairListCellRenderer extends JLabel implements ListCellRenderer {
13 public ComparePairListCellRenderer() {
14 setOpaque(true);
15 }
16 public Component getListCellRendererComponent(
17 JList list,
18 Object value,
19 int index,
20 boolean isSelected,
21 boolean cellHasFocus)
22 {
23 ComparePairType type = (ComparePairType)value;
24 setText(type.getDisplayName());
25 setBackground(isSelected ? ConflictColors.BGCOLOR_SELECTED.get() : ConflictColors.BGCOLOR.get());
26 setForeground(ConflictColors.FGCOLOR.get());
27 return this;
28 }
29}
Note: See TracBrowser for help on using the repository browser.