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

Last change on this file since 3715 was 3671, checked in by bastiK, 13 years ago

adapt coding style (to some degree); there shouldn't be any semantic changes in this commit

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
1// License: GPL. See LICENSE file for details.
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.Main;
10
11/** The error severity */
12public enum Severity {
13 /** Error messages */
14 ERROR(tr("Errors"), "error.gif", Main.pref.getColor(marktr("validation error"), Color.RED)),
15 /** Warning messages */
16 WARNING(tr("Warnings"), "warning.gif", Main.pref.getColor(marktr("validation warning"), Color.YELLOW)),
17 /** Other messages */
18 OTHER(tr("Other"), "other.gif", Main.pref.getColor(marktr("validation other"), Color.CYAN));
19
20 /** Description of the severity code */
21 private final String message;
22
23 /** Associated icon */
24 private final String icon;
25
26 /** Associated color */
27 private final Color color;
28
29 /**
30 * Constructor
31 *
32 * @param message Description
33 * @param icon Associated icon
34 * @param color The color of this severity
35 */
36 Severity(String message, String icon, Color color) {
37 this.message = message;
38 this.icon = icon;
39 this.color = color;
40 }
41
42 @Override
43 public String toString() {
44 return message;
45 }
46
47 /**
48 * Gets the associated icon
49 * @return the associated icon
50 */
51 public String getIcon() {
52 return icon;
53 }
54
55 /**
56 * Gets the associated color
57 * @return The associated color
58 */
59 public Color getColor() {
60 return color;
61 }
62
63
64}
Note: See TracBrowser for help on using the repository browser.