Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java	(revision 5341)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java	(revision 5342)
@@ -39,5 +39,5 @@
         Color color = null;
 
-        IconReference iconRef = c.get("fill-image", null, IconReference.class);
+        IconReference iconRef = c.get(FILL_IMAGE, null, IconReference.class);
         if (iconRef != null) {
             fillImage = new MapImage(iconRef.iconName, iconRef.source);
@@ -54,5 +54,5 @@
             }
         } else {
-            color = c.get("fill-color", null, Color.class);
+            color = c.get(FILL_COLOR, null, Color.class);
             if (color != null) {
                 int alpha = Math.min(255, Math.max(0, Integer.valueOf(Main.pref.getInteger("mappaint.fillalpha", 50))));
@@ -66,5 +66,5 @@
 
         TextElement text = null;
-        Keyword textPos = c.get("text-position", null, Keyword.class);
+        Keyword textPos = c.get(TEXT_POSITION, null, Keyword.class);
         if (textPos == null || Utils.equal(textPos.val, "center")) {
             text = TextElement.create(c, PaintColors.AREA_TEXT.get(), true);
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/BoxTextElemStyle.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/BoxTextElemStyle.java	(revision 5341)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/BoxTextElemStyle.java	(revision 5342)
@@ -162,5 +162,5 @@
         MultiCascade mc = new MultiCascade();
         Cascade c = mc.getOrCreateCascade("default");
-        c.put("text", Keyword.AUTO);
+        c.put(TEXT, Keyword.AUTO);
         Node n = new Node();
         n.put("name", "dummy");
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java	(revision 5341)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java	(revision 5342)
@@ -14,5 +14,5 @@
 import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction.RelativeFloat;
 
-abstract public class ElemStyle {
+abstract public class ElemStyle implements StyleKeys {
 
     public float major_z_index;
@@ -31,7 +31,7 @@
     protected ElemStyle(Cascade c, float default_major_z_index) {
         major_z_index = c.get("major-z-index", default_major_z_index, Float.class);
-        z_index = c.get("z-index", 0f, Float.class);
-        object_z_index = c.get("object-z-index", 0f, Float.class);
-        isModifier = c.get("modifier", false, Boolean.class);
+        z_index = c.get(Z_INDEX, 0f, Float.class);
+        object_z_index = c.get(OBJECT_Z_INDEX, 0f, Float.class);
+        isModifier = c.get(MODIFIER, false, Boolean.class);
     }
 
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java	(revision 5341)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java	(revision 5342)
@@ -22,8 +22,8 @@
         MultiCascade mc = new MultiCascade();
         Cascade c = mc.getOrCreateCascade("default");
-        c.put("width", Keyword.DEFAULT);
-        c.put("color", color != null ? color : PaintColors.UNTAGGED.get());
+        c.put(WIDTH, Keyword.DEFAULT);
+        c.put(COLOR, color != null ? color : PaintColors.UNTAGGED.get());
         if (isAreaEdge) {
-            c.put("z-index", -3f);
+            c.put(Z_INDEX, -3f);
         }
         return createLine(new Environment(null, mc, "default", null));
@@ -99,13 +99,13 @@
             case NORMAL:
             {
-                Float widthOnDefault = getWidth(c_def, "width", null);
-                width = getWidth(c, "width", widthOnDefault);
+                Float widthOnDefault = getWidth(c_def, WIDTH, null);
+                width = getWidth(c, WIDTH, widthOnDefault);
                 break;
             }
             case CASING:
             {
-                Float casingWidth = c.get(type.prefix + "width", null, Float.class, true);
+                Float casingWidth = c.get(type.prefix + WIDTH, null, Float.class, true);
                 if (casingWidth == null) {
-                    RelativeFloat rel_casingWidth = c.get(type.prefix + "width", null, RelativeFloat.class, true);
+                    RelativeFloat rel_casingWidth = c.get(type.prefix + WIDTH, null, RelativeFloat.class, true);
                     if (rel_casingWidth != null) {
                         casingWidth = rel_casingWidth.val / 2;
@@ -114,6 +114,6 @@
                 if (casingWidth == null)
                     return null;
-                Float widthOnDefault = getWidth(c_def, "width", null);
-                width = getWidth(c, "width", widthOnDefault);
+                Float widthOnDefault = getWidth(c_def, WIDTH, null);
+                width = getWidth(c, WIDTH, widthOnDefault);
                 if (width == null) {
                     width = 0f;
@@ -124,5 +124,5 @@
             case LEFT_CASING:
             case RIGHT_CASING:
-                width = getWidth(c, type.prefix + "width", null);
+                width = getWidth(c, type.prefix + WIDTH, null);
                 break;
             default:
@@ -132,5 +132,5 @@
             return null;
 
-        float realWidth = c.get(type.prefix + "real_width", 0f, Float.class);
+        float realWidth = c.get(type.prefix + REAL_WIDTH, 0f, Float.class);
         if (realWidth > 0 && MapPaintSettings.INSTANCE.isUseRealWidth()) {
 
@@ -149,20 +149,20 @@
         }
 
-        Float offset = c.get("offset", 0f, Float.class);
+        Float offset = c.get(OFFSET, 0f, Float.class);
         switch (type) {
             case NORMAL:
                 break;
             case CASING:
-                offset += c.get(type.prefix + "offset", 0f, Float.class);
+                offset += c.get(type.prefix + OFFSET, 0f, Float.class);
                 break;
             case LEFT_CASING:
             case RIGHT_CASING:
             {
-                Float baseWidthOnDefault = getWidth(c_def, "width", null);
-                Float baseWidth = getWidth(c, "width", baseWidthOnDefault);
+                Float baseWidthOnDefault = getWidth(c_def, WIDTH, null);
+                Float baseWidth = getWidth(c, WIDTH, baseWidthOnDefault);
                 if (baseWidth == null || baseWidth < 2f) {
                     baseWidth = 2f;
                 }
-                float casingOffset = c.get(type.prefix + "offset", 0f, Float.class);
+                float casingOffset = c.get(type.prefix + OFFSET, 0f, Float.class);
                 casingOffset += baseWidth / 2 + width / 2;
                 /* flip sign for the right-casing-offset */
@@ -175,7 +175,7 @@
         }
 
-        Color color = c.get(type.prefix + "color", null, Color.class);
+        Color color = c.get(type.prefix + COLOR, null, Color.class);
         if (type == LineType.NORMAL && color == null) {
-            color = c.get("fill-color", null, Color.class);
+            color = c.get(FILL_COLOR, null, Color.class);
         }
         if (color == null) {
@@ -184,5 +184,5 @@
 
         int alpha = 255;
-        Integer pAlpha = Utils.color_float2int(c.get("opacity", null, Float.class));
+        Integer pAlpha = Utils.color_float2int(c.get(OPACITY, null, Float.class));
         if (pAlpha != null) {
             alpha = pAlpha;
@@ -190,5 +190,5 @@
         color = new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha);
 
-        float[] dashes = c.get(type.prefix + "dashes", null, float[].class);
+        float[] dashes = c.get(type.prefix + DASHES, null, float[].class);
         if (dashes != null) {
             boolean hasPositive = false;
@@ -206,8 +206,8 @@
             }
         }
-        float dashesOffset = c.get(type.prefix + "dashes-offset", 0f, Float.class);
-        Color dashesBackground = c.get(type.prefix + "dashes-background-color", null, Color.class);
+        float dashesOffset = c.get(type.prefix + DASHES_OFFSET, 0f, Float.class);
+        Color dashesBackground = c.get(type.prefix + DASHES_BACKGROUND_COLOR, null, Color.class);
         if (dashesBackground != null) {
-            pAlpha = Utils.color_float2int(c.get(type.prefix + "dashes-background-opacity", null, Float.class));
+            pAlpha = Utils.color_float2int(c.get(type.prefix + DASHES_BACKGROUND_OPACITY, null, Float.class));
             if (pAlpha != null) {
                 alpha = pAlpha;
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/LineTextElemStyle.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/LineTextElemStyle.java	(revision 5341)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/LineTextElemStyle.java	(revision 5342)
@@ -20,5 +20,5 @@
         Cascade c = env.mc.getCascade(env.layer);
 
-        Keyword textPos = c.get("text-position", null, Keyword.class);
+        Keyword textPos = c.get(TEXT_POSITION, null, Keyword.class);
         if (textPos != null && !Utils.equal(textPos.val, "line"))
             return null;
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/MultiCascade.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/MultiCascade.java	(revision 5341)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/MultiCascade.java	(revision 5342)
@@ -14,5 +14,5 @@
  * StyleSources apply zoom level dependent properties.
  */
-public class MultiCascade {
+public class MultiCascade implements StyleKeys {
 
     private Map<String, Cascade> layers;
@@ -40,5 +40,5 @@
                 // be a modifier. Can be overridden in style definition.
                 if (!layer.equals("default") && !layer.equals("*")) {
-                    c.put("modifier", true);
+                    c.put(MODIFIER, true);
                 }
             }
@@ -61,5 +61,5 @@
             c = new Cascade();
             if (!layer.equals("default") && !layer.equals("*")) {
-                c.put("modifier", true);
+                c.put(MODIFIER, true);
             }
         }
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 5341)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 5342)
@@ -122,5 +122,5 @@
         Cascade c_def = env.mc.getCascade("default");
 
-        final IconReference iconRef = c.get("icon-image", null, IconReference.class);
+        final IconReference iconRef = c.get(ICON_IMAGE, null, IconReference.class);
         if (iconRef == null)
             return null;
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleKeys.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleKeys.java	(revision 5342)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/StyleKeys.java	(revision 5342)
@@ -0,0 +1,23 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.mappaint;
+
+public interface StyleKeys {
+
+    public static final String COLOR = "color";
+    public static final String DASHES = "dashes";
+    public static final String DASHES_BACKGROUND_COLOR = "dashes-background-color";
+    public static final String DASHES_BACKGROUND_OPACITY = "dashes-background-opacity";
+    public static final String DASHES_OFFSET = "dashes-offset";
+    public static final String FILL_COLOR = "fill-color";
+    public static final String FILL_IMAGE = "fill-image";
+    public static final String ICON_IMAGE = "icon-image";
+    public static final String MODIFIER = "modifier";
+    public static final String OBJECT_Z_INDEX = "object-z-index";
+    public static final String OFFSET = "offset";
+    public static final String OPACITY = "opacity";
+    public static final String REAL_WIDTH = "real-width";
+    public static final String TEXT_POSITION = "text-position";
+    public static final String TEXT = "text";
+    public static final String WIDTH = "width";
+    public static final String Z_INDEX = "z-index";
+}
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java	(revision 5341)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java	(revision 5342)
@@ -19,5 +19,5 @@
  *
  */
-public class TextElement {
+public class TextElement implements StyleKeys {
     static public final LabelCompositionStrategy AUTO_LABEL_COMPOSITION_STRATEGY = new DeriveLabelFromNameTagsCompositionStrategy();
 
@@ -85,5 +85,5 @@
          * from a tag value.
          */
-        TagKeyReference tkr = c.get("text", null, TagKeyReference.class, true);
+        TagKeyReference tkr = c.get(TEXT, null, TagKeyReference.class, true);
         if (tkr != null)
             return new TagLookupCompositionStrategy(tkr.key);
@@ -93,5 +93,5 @@
          * a keyword
          */
-        Keyword keyword = c.get("text", null, Keyword.class, true);
+        Keyword keyword = c.get(TEXT, null, Keyword.class, true);
         if (equal(keyword, Keyword.AUTO))
             return AUTO_LABEL_COMPOSITION_STRATEGY;
@@ -100,5 +100,5 @@
          * Do we have a static text label?
          */
-        String text = c.get("text", null, String.class, true);
+        String text = c.get(TEXT, null, String.class, true);
         if (text != null)
             return new StaticLabelCompositionStrategy(text);
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Instruction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Instruction.java	(revision 5341)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Instruction.java	(revision 5342)
@@ -9,6 +9,7 @@
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
+import org.openstreetmap.josm.gui.mappaint.StyleKeys;
 
-abstract public class Instruction {
+abstract public class Instruction implements StyleKeys {
 
     public abstract void execute(Environment env);
@@ -35,5 +36,5 @@
             if (val instanceof Expression.LiteralExpression) {
                 Object litValue = ((Expression.LiteralExpression) val).evaluate(null);
-                if (key.equals("text")) {
+                if (key.equals(TEXT)) {
                     /* Special case for declaration 'text: ...'
                      * 
@@ -72,5 +73,5 @@
                 value = val;
             }
-            if (key.equals("icon-image") || key.equals("fill-image") || key.equals("pattern-image")) {
+            if (key.equals(ICON_IMAGE) || key.equals(FILL_IMAGE) || key.equals("pattern-image")) {
                 if (value instanceof String) {
                     value = new IconReference((String) value, env.source);
Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 5341)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 5342)
@@ -23,4 +23,5 @@
 import org.openstreetmap.josm.gui.mappaint.MultiCascade;
 import org.openstreetmap.josm.gui.mappaint.Range;
+import org.openstreetmap.josm.gui.mappaint.StyleKeys;
 import org.openstreetmap.josm.gui.mappaint.StyleSource;
 import org.openstreetmap.josm.gui.preferences.SourceEntry;
@@ -31,5 +32,5 @@
 import org.xml.sax.SAXParseException;
 
-public class XmlStyleSource extends StyleSource {
+public class XmlStyleSource extends StyleSource implements StyleKeys {
 
     protected final HashMap<String, IconPrototype> icons = new HashMap<String, IconPrototype>();
@@ -286,11 +287,11 @@
             IconPrototype icon = getNode(osm, (useMinMaxScale ? scale : null), mc);
             if (icon != null) {
-                def.put("icon-image", icon.icon);
+                def.put(ICON_IMAGE, icon.icon);
                 if (osm instanceof Node) {
                     if (icon.annotate != null) {
                         if (icon.annotate) {
-                            def.put("text", Keyword.AUTO);
+                            def.put(TEXT, Keyword.AUTO);
                         } else {
-                            def.remove("text");
+                            def.remove(TEXT);
                         }
                     }
@@ -301,17 +302,17 @@
             get(osm, pretendWayIsClosed || !(osm instanceof Way) || ((Way) osm).isClosed(), p, (useMinMaxScale ? scale : null), mc);
             if (p.line != null) {
-                def.put("width", new Float(p.line.getWidth()));
-                def.putOrClear("real-width", p.line.realWidth != null ? new Float(p.line.realWidth) : null);
-                def.putOrClear("color", p.line.color);
+                def.put(WIDTH, new Float(p.line.getWidth()));
+                def.putOrClear(REAL_WIDTH, p.line.realWidth != null ? new Float(p.line.realWidth) : null);
+                def.putOrClear(COLOR, p.line.color);
                 if (p.line.color != null) {
                     int alpha = p.line.color.getAlpha();
                     if (alpha != 255) {
-                        def.put("opacity", Utils.color_int2float(alpha));
+                        def.put(OPACITY, Utils.color_int2float(alpha));
                     }
                 }
-                def.putOrClear("dashes", p.line.getDashed());
-                def.putOrClear("dashes-background-color", p.line.dashedColor);
-            }
-            Float refWidth = def.get("width", null, Float.class);
+                def.putOrClear(DASHES, p.line.getDashed());
+                def.putOrClear(DASHES_BACKGROUND_COLOR, p.line.dashedColor);
+            }
+            Float refWidth = def.get(WIDTH, null, Float.class);
             if (refWidth != null && p.linemods != null) {
                 int numOver = 0, numUnder = 0;
@@ -325,22 +326,22 @@
                         String layer = String.format("over_%d", numOver);
                         c = mc.getOrCreateCascade(layer);
-                        c.put("object-z-index", new Float(numOver));
+                        c.put(OBJECT_Z_INDEX, new Float(numOver));
                         ++numOver;
                     } else {
                         String layer = String.format("under_%d", numUnder);
                         c = mc.getOrCreateCascade(layer);
-                        c.put("object-z-index", new Float(-numUnder));
+                        c.put(OBJECT_Z_INDEX, new Float(-numUnder));
                         ++numUnder;
                     }
-                    c.put("width", new Float(mod.getWidth(refWidth)));
-                    c.putOrClear("color", mod.color);
+                    c.put(WIDTH, new Float(mod.getWidth(refWidth)));
+                    c.putOrClear(COLOR, mod.color);
                     if (mod.color != null) {
                         int alpha = mod.color.getAlpha();
                         if (alpha != 255) {
-                            c.put("opacity", Utils.color_int2float(alpha));
+                            c.put(OPACITY, Utils.color_int2float(alpha));
                         }
                     }
-                    c.putOrClear("dashes", mod.getDashed());
-                    c.putOrClear("dashes-background-color", mod.dashedColor);
+                    c.putOrClear(DASHES, mod.getDashed());
+                    c.putOrClear(DASHES_BACKGROUND_COLOR, mod.dashedColor);
                 }
             }
@@ -353,8 +354,8 @@
             }
             if (p.area != null) {
-                def.putOrClear("fill-color", p.area.color);
-                def.putOrClear("text-position", Keyword.CENTER);
-                def.putOrClear("text", Keyword.AUTO);
-                def.remove("fill-image");
+                def.putOrClear(FILL_COLOR, p.area.color);
+                def.putOrClear(TEXT_POSITION, Keyword.CENTER);
+                def.putOrClear(TEXT, Keyword.AUTO);
+                def.remove(FILL_IMAGE);
             }
         }
