source: josm/trunk/src/org/openstreetmap/josm/gui/mappaint/Keyword.java@ 5530

Last change on this file since 5530 was 3967, checked in by bastiK, 13 years ago

MapCSS: an identifier literal at the right side of a declaration is now parsed as Keyword and not as String. This means 'color: "blue";' does not work any longer, but you have to write 'color: blue;'. This is useful for future extensions.

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.mappaint;
3
4import org.openstreetmap.josm.tools.Utils;
5
6public class Keyword {
7 public final String val;
8
9 public Keyword(String val) {
10 this.val = val.toLowerCase();
11 }
12
13 @Override
14 public String toString() {
15 return "Keyword{" + val + '}';
16 }
17
18 @Override
19 public boolean equals(Object obj) {
20 if (obj == null || getClass() != obj.getClass())
21 return false;
22 return Utils.equal(val, ((Keyword) obj).val);
23 }
24
25 @Override
26 public int hashCode() {
27 return val.hashCode();
28 }
29
30 public final static Keyword AUTO = new Keyword("auto");
31 public final static Keyword BOTTOM = new Keyword("bottom");
32 public final static Keyword CENTER = new Keyword("center");
33 public final static Keyword DEFAULT = new Keyword("default");
34 public final static Keyword RIGHT = new Keyword("right");
35 public final static Keyword THINNEST = new Keyword("thinnest");
36}
Note: See TracBrowser for help on using the repository browser.