Last change
on this file since 1954 was 1954, checked in by Gubaer, 15 years ago |
Moved package org.openstreetmap.josm.gui.conflict to org.openstreetmap.josm.gui.conflict.pair
|
File size:
929 bytes
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.conflict.pair;
|
---|
3 |
|
---|
4 | import java.awt.Color;
|
---|
5 | import java.awt.Component;
|
---|
6 |
|
---|
7 | import javax.swing.JLabel;
|
---|
8 | import javax.swing.JList;
|
---|
9 | import javax.swing.ListCellRenderer;
|
---|
10 |
|
---|
11 | public class ComparePairListCellRenderer extends JLabel implements ListCellRenderer {
|
---|
12 | public final static Color BGCOLOR_SELECTED = new Color(143,170,255);
|
---|
13 |
|
---|
14 | public ComparePairListCellRenderer() {
|
---|
15 | setOpaque(true);
|
---|
16 | }
|
---|
17 | public Component getListCellRendererComponent(
|
---|
18 | JList list,
|
---|
19 | Object value,
|
---|
20 | int index,
|
---|
21 | boolean isSelected,
|
---|
22 | boolean cellHasFocus)
|
---|
23 | {
|
---|
24 | ComparePairType type = (ComparePairType)value;
|
---|
25 | setText(type.getDisplayName());
|
---|
26 | setBackground(isSelected ? BGCOLOR_SELECTED : Color.WHITE);
|
---|
27 | setForeground(Color.BLACK);
|
---|
28 | return this;
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.