Index: trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 5810)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 5811)
@@ -24,5 +24,5 @@
  * applies for Nodes and turn restriction relations
  */
-public class NodeElemStyle extends ElemStyle {
+public class NodeElemStyle extends ElemStyle implements StyleKeys {
     public MapImage mapImage;
     public Symbol symbol;
@@ -104,5 +104,5 @@
         Cascade c = env.mc.getCascade(env.layer);
 
-        MapImage mapImage = createIcon(env);
+        MapImage mapImage = createIcon(env, ICON_KEYS);
         Symbol symbol = null;
         if (mapImage == null) {
@@ -118,23 +118,24 @@
     }
 
-    private static MapImage createIcon(Environment env) {
+    public static MapImage createIcon(Environment env, String[] keys) {
         Cascade c = env.mc.getCascade(env.layer);
-        Cascade c_def = env.mc.getCascade("default");
-
-        final IconReference iconRef = c.get(ICON_IMAGE, null, IconReference.class);
+
+        final IconReference iconRef = c.get(keys[ICON_IMAGE_IDX], null, IconReference.class);
         if (iconRef == null)
             return null;
 
-        Float widthOnDefault = c_def.get("icon-width", null, Float.class);
+        Cascade c_def = env.mc.getCascade("default");
+
+        Float widthOnDefault = c_def.get(keys[ICON_WIDTH_IDX], null, Float.class);
         if (widthOnDefault != null && widthOnDefault <= 0) {
             widthOnDefault = null;
         }
-        Float widthF = getWidth(c, "icon-width", widthOnDefault);
-
-        Float heightOnDefault = c_def.get("icon-height", null, Float.class);
+        Float widthF = getWidth(c, keys[ICON_WIDTH_IDX], widthOnDefault);
+
+        Float heightOnDefault = c_def.get(keys[ICON_HEIGHT_IDX], null, Float.class);
         if (heightOnDefault != null && heightOnDefault <= 0) {
             heightOnDefault = null;
         }
-        Float heightF = getWidth(c, "icon-height", heightOnDefault);
+        Float heightF = getWidth(c, keys[ICON_HEIGHT_IDX], heightOnDefault);
 
         int width = widthF == null ? -1 : Math.round(widthF);
@@ -147,5 +148,5 @@
 
         mapImage.alpha = Math.min(255, Math.max(0, Integer.valueOf(Main.pref.getInteger("mappaint.icon-image-alpha", 255))));
-        Integer pAlpha = Utils.color_float2int(c.get("icon-opacity", null, float.class));
+        Integer pAlpha = Utils.color_float2int(c.get(keys[ICON_OPACITY_IDX], null, float.class));
         if (pAlpha != null) {
             mapImage.alpha = pAlpha;
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/RepeatImageElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/RepeatImageElemStyle.java	(revision 5810)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/RepeatImageElemStyle.java	(revision 5811)
@@ -8,5 +8,4 @@
 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings;
 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer;
-import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 
@@ -31,12 +30,8 @@
 
     public static RepeatImageElemStyle create(Environment env) {
-        // FIXME: make use of NodeElemStyle.createIcon, in order to have
-        // -width, -height and -opacity properties.
+        MapImage pattern = NodeElemStyle.createIcon(env, REPEAT_IMAGE_KEYS);
+        if (pattern == null)
+            return null;
         Cascade c = env.mc.getCascade(env.layer);
-
-        IconReference iconRef = c.get(REPEAT_IMAGE, null, IconReference.class);
-        if (iconRef == null)
-            return null;
-        MapImage pattern = new MapImage(iconRef.iconName, iconRef.source);
         Float offset = c.get(REPEAT_IMAGE_OFFSET, 0f, Float.class);
         Float spacing = c.get(REPEAT_IMAGE_SPACING, 0f, Float.class);
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/StyleKeys.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/StyleKeys.java	(revision 5810)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/StyleKeys.java	(revision 5811)
@@ -26,3 +26,10 @@
     String REPEAT_IMAGE_SPACING = "repeat-image-spacing";
     String REPEAT_IMAGE_ALIGN = "repeat-image-align";
+
+    int ICON_IMAGE_IDX = 0;
+    int ICON_WIDTH_IDX = 1;
+    int ICON_HEIGHT_IDX = 2;
+    int ICON_OPACITY_IDX = 3;
+    String[] ICON_KEYS = {"icon-image", "icon-width", "icon-height", "icon-opacity"};
+    String[] REPEAT_IMAGE_KEYS = {"repeat-image", "repeat-image-width", "repeat-image-height", "repeat-image-opacity"};
 }
