Last change
on this file since 4162 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.
|
---|
2 | package org.openstreetmap.josm.gui.conflict.pair;
|
---|
3 |
|
---|
4 | import java.awt.Component;
|
---|
5 |
|
---|
6 | import javax.swing.JLabel;
|
---|
7 | import javax.swing.JList;
|
---|
8 | import javax.swing.ListCellRenderer;
|
---|
9 |
|
---|
10 | import org.openstreetmap.josm.gui.conflict.ConflictColors;
|
---|
11 |
|
---|
12 | public 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.