source: josm/trunk/src/org/openstreetmap/josm/data/validation/Severity.java@ 12620

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

see #15182 - deprecate all Main logging methods and introduce suitable replacements in Logging for most of them

  • Property svn:eol-style set to native
File size: 2.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.validation;
3
4import static org.openstreetmap.josm.tools.I18n.marktr;
5import static org.openstreetmap.josm.tools.I18n.tr;
6
7import java.awt.Color;
8
9import org.openstreetmap.josm.data.preferences.ColorProperty;
10import org.openstreetmap.josm.tools.Logging;
11
12/** The error severity */
13public enum Severity {
14 // CHECKSTYLE.OFF: SingleSpaceSeparator
15 /** Error messages */
16 ERROR(tr("Errors"), /* ICON(data/) */"error", new ColorProperty(marktr("validation error"), Color.RED).get()),
17 /** Warning messages */
18 WARNING(tr("Warnings"), /* ICON(data/) */"warning", new ColorProperty(marktr("validation warning"), Color.YELLOW).get()),
19 /** Other messages */
20 OTHER(tr("Other"), /* ICON(data/) */"other", new ColorProperty(marktr("validation other"), Color.CYAN).get());
21 // CHECKSTYLE.ON: SingleSpaceSeparator
22
23 /** Description of the severity code */
24 private final String message;
25
26 /** Associated icon */
27 private final String icon;
28
29 /** Associated color */
30 private final Color color;
31
32 /**
33 * Constructor
34 *
35 * @param message Description
36 * @param icon Associated icon
37 * @param color The color of this severity
38 */
39 Severity(String message, String icon, Color color) {
40 this.message = message;
41 this.icon = icon;
42 this.color = color;
43 }
44
45 /**
46 * Retrieves all colors once from the preferences to register them
47 */
48 public static void getColors() {
49 for (Severity c : values()) {
50 Logging.debug("{0}", c);
51 }
52 }
53
54 @Override
55 public String toString() {
56 return message;
57 }
58
59 /**
60 * Gets the associated icon
61 * @return the associated icon
62 */
63 public String getIcon() {
64 return icon;
65 }
66
67 /**
68 * Gets the associated color
69 * @return The associated color
70 */
71 public Color getColor() {
72 return color;
73 }
74}
Note: See TracBrowser for help on using the repository browser.