source: josm/trunk/src/org/openstreetmap/josm/gui/conflict/ConflictColors.java@ 10824

Last change on this file since 10824 was 10824, checked in by Don-vip, 8 years ago

see #13309 - Caching and notifying preferences (patch by michael2402) - gsoc-core

  • Property svn:eol-style set to native
File size: 4.7 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.conflict;
3
4import static org.openstreetmap.josm.tools.I18n.marktr;
5
6import java.awt.Color;
7
8import org.openstreetmap.josm.data.preferences.ColorProperty;
9
10/**
11 * Conflict color constants.
12 * @since 4162
13 */
14public enum ConflictColors {
15
16 /** Conflict background: no conflict */
17 BGCOLOR_NO_CONFLICT(marktr("Conflict background: no conflict"), new Color(234, 234, 234)),
18 /** Conflict background: decided */
19 BGCOLOR_DECIDED(marktr("Conflict background: decided"), new Color(217, 255, 217)),
20 /** Conflict background: undecided */
21 BGCOLOR_UNDECIDED(marktr("Conflict background: undecided"), new Color(255, 197, 197)),
22 /** Conflict background: drop */
23 BGCOLOR_DROP(marktr("Conflict background: drop"), Color.white),
24 /** Conflict background: keep */
25 BGCOLOR_KEEP(marktr("Conflict background: keep"), new Color(217, 255, 217)),
26 /** Conflict background: combined */
27 BGCOLOR_COMBINED(marktr("Conflict background: combined"), new Color(217, 255, 217)),
28 /** Conflict background: selected */
29 BGCOLOR_SELECTED(marktr("Conflict background: selected"), new Color(143, 170, 255)),
30
31 /** Conflict foreground: undecided */
32 FGCOLOR_UNDECIDED(marktr("Conflict foreground: undecided"), Color.black),
33 /** Conflict foreground: drop */
34 FGCOLOR_DROP(marktr("Conflict foreground: drop"), Color.lightGray),
35 /** Conflict foreground: keep */
36 FGCOLOR_KEEP(marktr("Conflict foreground: keep"), Color.black),
37
38 /** Conflict background: empty row */
39 BGCOLOR_EMPTY_ROW(marktr("Conflict background: empty row"), new Color(234, 234, 234)),
40 /** Conflict background: frozen */
41 BGCOLOR_FROZEN(marktr("Conflict background: frozen"), new Color(234, 234, 234)),
42 /** Conflict background: in comparison */
43 BGCOLOR_PARTICIPATING_IN_COMPARISON(marktr("Conflict background: in comparison"), Color.black),
44 /** Conflict foreground: in comparison */
45 FGCOLOR_PARTICIPATING_IN_COMPARISON(marktr("Conflict foreground: in comparison"), Color.white),
46 /** Conflict background */
47 BGCOLOR(marktr("Conflict background"), Color.white),
48 /** Conflict foreground */
49 FGCOLOR(marktr("Conflict foreground"), Color.black),
50
51 /** Conflict background: not in opposite */
52 BGCOLOR_NOT_IN_OPPOSITE(marktr("Conflict background: not in opposite"), new Color(255, 197, 197)),
53 /** Conflict background: in opposite */
54 BGCOLOR_IN_OPPOSITE(marktr("Conflict background: in opposite"), new Color(255, 234, 213)),
55 /** Conflict background: same position in opposite */
56 BGCOLOR_SAME_POSITION_IN_OPPOSITE(marktr("Conflict background: same position in opposite"), new Color(217, 255, 217)),
57
58 /** Conflict background: keep one tag */
59 BGCOLOR_TAG_KEEP_ONE(marktr("Conflict background: keep one tag"), new Color(217, 255, 217)),
60 /** Conflict foreground: keep one tag */
61 FGCOLOR_TAG_KEEP_ONE(marktr("Conflict foreground: keep one tag"), Color.black),
62 /** Conflict background: drop tag */
63 BGCOLOR_TAG_KEEP_NONE(marktr("Conflict background: drop tag"), Color.lightGray),
64 /** Conflict foreground: drop tag */
65 FGCOLOR_TAG_KEEP_NONE(marktr("Conflict foreground: drop tag"), Color.black),
66 /** Conflict background: keep all tags */
67 BGCOLOR_TAG_KEEP_ALL(marktr("Conflict background: keep all tags"), new Color(255, 234, 213)),
68 /** Conflict foreground: keep all tags */
69 FGCOLOR_TAG_KEEP_ALL(marktr("Conflict foreground: keep all tags"), Color.black),
70 /** Conflict background: sum all numeric tags */
71 BGCOLOR_TAG_SUM_ALL_NUM(marktr("Conflict background: sum all numeric tags"), new Color(255, 234, 213)),
72 /** Conflict foreground: sum all numeric tags */
73 FGCOLOR_TAG_SUM_ALL_NUM(marktr("Conflict foreground: sum all numeric tags"), Color.black),
74
75 /** Conflict background: keep member */
76 BGCOLOR_MEMBER_KEEP(marktr("Conflict background: keep member"), new Color(217, 255, 217)),
77 /** Conflict foreground: keep member */
78 FGCOLOR_MEMBER_KEEP(marktr("Conflict foreground: keep member"), Color.black),
79 /** Conflict background: remove member */
80 BGCOLOR_MEMBER_REMOVE(marktr("Conflict background: remove member"), Color.lightGray),
81 /** Conflict foreground: remove member */
82 FGCOLOR_MEMBER_REMOVE(marktr("Conflict foreground: remove member"), Color.black);
83
84 private final ColorProperty property;
85
86 ConflictColors(String name, Color defaultColor) {
87 property = new ColorProperty(name, defaultColor);
88 }
89
90 /**
91 * Returns the color.
92 * @return the color
93 */
94 public Color get() {
95 return property.get();
96 }
97
98 /**
99 * Loads all colors from preferences.
100 */
101 public static void getColors() {
102 for (ConflictColors c : values()) {
103 c.get();
104 }
105 }
106}
Note: See TracBrowser for help on using the repository browser.