Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java	(revision 3878)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java	(revision 3879)
@@ -211,15 +211,11 @@
     }
 
-    public void drawNodeSymbol(Node n, Symbol s, boolean selected, boolean member, TextElement text) {
+    public void drawNodeSymbol(Node n, Symbol s, Color fillColor, Color strokeColor, TextElement text) {
         Point p = nc.getPoint(n);
         if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return;
         int radius = s.size / 2;
 
-        if (s.fillColor != null) {
-            if (inactive || n.isDisabled()) {
-                g.setColor(inactiveColor);
-            } else {
-                g.setColor(s.fillColor);
-            }
+        if (fillColor != null) {
+            g.setColor(fillColor);
             switch (s.symbol) {
                 case SQUARE:
@@ -235,9 +231,5 @@
         if (s.stroke != null) {
             g.setStroke(s.stroke);
-            if (inactive || n.isDisabled()) {
-                g.setColor(inactiveColor);
-            } else {
-                g.setColor(s.strokeColor);
-            }
+            g.setColor(strokeColor);
             switch (s.symbol) {
                 case SQUARE:
@@ -353,10 +345,10 @@
     }
 
-    public void drawArea(Way w, Color color, BufferedImage fillImage, String name) {
+    public void drawArea(Way w, Color color, BufferedImage fillImage, float fillImageAlpha, String name) {
         Polygon polygon = getPolygon(w);
-        drawArea(polygon, color, fillImage, name);
-    }
-
-    protected void drawArea(Polygon polygon, Color color, BufferedImage fillImage, String name) {
+        drawArea(polygon, color, fillImage, fillImageAlpha, name);
+    }
+
+    protected void drawArea(Polygon polygon, Color color, BufferedImage fillImage, float fillImageAlpha, String name) {
 
         if (fillImage == null) {
@@ -367,6 +359,6 @@
                     new Rectangle(polygon.xpoints[0], polygon.ypoints[0], fillImage.getWidth(), fillImage.getHeight()));
             g.setPaint(texture);
-            if (color.getAlpha() != 255) {
-                g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, Utils.color_int2float(color.getAlpha())));
+            if (fillImageAlpha != 1f) {
+                g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, fillImageAlpha));
             }
             g.fill(polygon);
@@ -411,5 +403,5 @@
     }
 
-    public void drawArea(Relation r, Color color, BufferedImage fillImage, String name) {
+    public void drawArea(Relation r, Color color, BufferedImage fillImage, float fillImageAlpha, String name) {
         Multipolygon multipolygon = new Multipolygon(nc);
         multipolygon.load(r);
@@ -420,5 +412,5 @@
                     continue;
                 }
-                drawArea(p, color, fillImage, getAreaName(r));
+                drawArea(p, color, fillImage, fillImageAlpha, getAreaName(r));
             }
         }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java	(revision 3878)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java	(revision 3879)
@@ -14,22 +14,31 @@
 import org.openstreetmap.josm.data.osm.visitor.paint.MapPainter;
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
+import org.openstreetmap.josm.tools.CheckParameterUtil;
 import org.openstreetmap.josm.tools.Utils;
 
 public class AreaElemStyle extends ElemStyle
 {
+    /**
+     * If fillImage == null, color is the fill-color, otherwise
+     * an arbitrary color value sampled from the fillImage
+     */
     public Color color;
     public BufferedImage fillImage;
+    public float fillImageAlpha;
 
-    protected AreaElemStyle(Cascade c, Color color, BufferedImage fillImage) {
+    protected AreaElemStyle(Cascade c, Color color, BufferedImage fillImage, float fillImageAlpha) {
         super(c);
+        CheckParameterUtil.ensureParameterNotNull(color);
         this.color = color;
         this.fillImage = fillImage;
+        this.fillImageAlpha = fillImageAlpha;
     }
 
     public static AreaElemStyle create(Cascade c) {
         BufferedImage fillImage = null;
+        Color color = null;
+        float fillImageAlpha = 1f;
+
         IconReference iconRef = c.get("fill-image", null, IconReference.class);
-        Integer fillImageAlpha = null;
-
         if (iconRef != null) {
             ImageIcon icon = MapPaintStyles.getIcon(iconRef, false);
@@ -42,34 +51,29 @@
                 fillImage = (BufferedImage) icon.getImage();
 
-                fillImageAlpha = Math.min(255, Math.max(0, Integer.valueOf(Main.pref.getInteger("mappaint.fill-image-alpha", 255))));
-                Integer pAlpha = Utils.color_float2int(c.get("fill-opacity", null, float.class));
+                color = new Color(fillImage.getRGB(fillImage.getWidth() / 2, fillImage.getHeight() / 2));
+
+                fillImageAlpha = Utils.color_int2float(Math.min(255, Math.max(0, Integer.valueOf(Main.pref.getInteger("mappaint.fill-image-alpha", 255)))));
+                Float pAlpha = c.get("fill-opacity", null, Float.class);
                 if (pAlpha != null) {
+                    if (pAlpha < 0f || pAlpha > 1f) {
+                        pAlpha= 1f;
+                    }
                     fillImageAlpha = pAlpha;
                 }
             }
-        }
-
-        Color color = c.get("fill-color", null, Color.class);
-        if (color != null) {
-
-            int alpha;
-            if (fillImageAlpha != null) {
-                alpha = fillImageAlpha;
-            } else {
-                alpha = Math.min(255, Math.max(0, Integer.valueOf(Main.pref.getInteger("mappaint.fillalpha", 50))));
+        } else {
+            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))));
                 Integer pAlpha = Utils.color_float2int(c.get("fill-opacity", null, float.class));
                 if (pAlpha != null) {
                     alpha = pAlpha;
                 }
+                color = new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha);
             }
-            color = new Color(color.getRed(), color.getGreen(), color.getBlue(), alpha);
         }
         
-        if (fillImage != null || color != null) {
-            if (color == null) {
-                color = new Color(0, 0, 0, fillImageAlpha);
-            }
-            return new AreaElemStyle(c, color, fillImage);
-        }
+        if (color != null)
+            return new AreaElemStyle(c, color, fillImage, fillImageAlpha);
         else
             return null;
@@ -86,5 +90,5 @@
                 }
             }
-            painter.drawArea((Way) osm, myColor, fillImage,
+            painter.drawArea((Way) osm, myColor, fillImage, fillImageAlpha,
                     painter.isShowNames() ? painter.getAreaName(osm) : null);
         } else if (osm instanceof Relation)
@@ -96,5 +100,5 @@
                 }
             }
-            painter.drawArea((Relation) osm, myColor, fillImage,
+            painter.drawArea((Relation) osm, myColor, fillImage, fillImageAlpha,
                     painter.getAreaName(osm));
         }
@@ -109,7 +113,9 @@
         AreaElemStyle other = (AreaElemStyle) obj;
         // we should get the same image object due to caching
-        if (fillImage != other.fillImage && (fillImage == null || other.fillImage == null || fillImage != other.fillImage))
+        if (fillImage != other.fillImage)
             return false;
         if (!Utils.equal(color, other.color))
+            return false;
+        if (fillImageAlpha != other.fillImageAlpha)
             return false;
         return true;
@@ -119,6 +125,7 @@
     public int hashCode() {
         int hash = 3;
-        hash = 61 * hash + (this.color != null ? this.color.hashCode() : 0);
-        hash = 61 * hash + (this.fillImage != null ? this.fillImage.hashCode() : 0);
+        hash = 61 * hash + color.hashCode();
+        hash = 61 * hash + (fillImage != null ? fillImage.hashCode() : 0);
+        hash = 61 * hash + Float.floatToIntBits(fillImageAlpha);
         return hash;
     }
@@ -126,5 +133,6 @@
     @Override
     public String toString() {
-        return "AreaElemStyle{" + super.toString() + "color=" + Utils.toString(color) + '}';
+        return "AreaElemStyle{" + super.toString() + "color=" + Utils.toString(color) +
+                " fillImageAlpha=" + fillImageAlpha + " fillImage=[" + fillImage + "]}";
     }
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 3878)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 3879)
@@ -240,21 +240,32 @@
             return null;
 
-        Float size = c.get("symbol-size", null, Float.class);
-        if (size == null || size <= 0)
+        float size = c.get("symbol-size", 10f, Float.class);
+        if (size <= 0)
             return null;
 
         Float strokeWidth = c.get("symbol-stroke-width", null, Float.class);
+        if (strokeWidth != null && strokeWidth <= 0) {
+            strokeWidth = null;
+        }
         Color strokeColor = c.get("symbol-stroke-color", null, Color.class);
+
+        if (strokeWidth == null && strokeColor != null) {
+            strokeWidth = 1f;
+        } else if (strokeWidth != null && strokeColor == null) {
+            strokeColor = Color.ORANGE;
+        }
+
+        Stroke stroke = null;
         if (strokeColor != null) {
             float strokeAlpha = c.get("symbol-stroke-opacity", 1f, Float.class);
             strokeColor = new Color(strokeColor.getRed(), strokeColor.getGreen(),
                     strokeColor.getBlue(), Utils.color_float2int(strokeAlpha));
-        }
-        Stroke stroke = null;
-        if (strokeWidth != null && strokeWidth > 0 && strokeColor != null) {
             stroke = new BasicStroke(strokeWidth);
         }
 
         Color fillColor = c.get("symbol-fill-color", null, Color.class);
+        if (stroke == null && fillColor == null)
+            fillColor = Color.BLUE;
+
         if (fillColor != null) {
             float fillAlpha = c.get("symbol-fill-opacity", 1f, Float.class);
@@ -263,8 +274,5 @@
         }
 
-        if ((stroke == null || strokeColor == null) && fillColor == null)
-            return null;
-
-        return new Symbol(shape, size.intValue(), stroke, strokeColor, fillColor);
+        return new Symbol(shape, Math.round(size), stroke, strokeColor, fillColor);
     }
 
@@ -277,5 +285,33 @@
                         Utils.color_int2float(iconAlpha), selected, member, text);
             } else if (symbol != null) {
-                painter.drawNodeSymbol(n, symbol, selected, member, text);
+                Color fillColor = symbol.fillColor;
+                if (fillColor != null) {
+                    if (n.isHighlighted()) {
+                        fillColor = settings.getHighlightColor();
+                    } else {
+                        if (painter.isInactive() || n.isDisabled()) {
+                            fillColor = settings.getInactiveColor();
+                        } else if (selected) {
+                            fillColor = settings.getSelectedColor(fillColor.getAlpha());
+                        } else if (member) {
+                            fillColor = settings.getRelationSelectedColor(fillColor.getAlpha());
+                        }
+                    }
+                }
+                Color strokeColor = symbol.strokeColor;
+                if (strokeColor != null) {
+                    if (n.isHighlighted()) {
+                        strokeColor = settings.getHighlightColor();
+                    } else {
+                        if (painter.isInactive() || n.isDisabled()) {
+                            strokeColor = settings.getInactiveColor();
+                        } else if (selected) {
+                            strokeColor = settings.getSelectedColor(strokeColor.getAlpha());
+                        } else if (member) {
+                            strokeColor = settings.getRelationSelectedColor(strokeColor.getAlpha());
+                        }
+                    }
+                }
+                painter.drawNodeSymbol(n, symbol, fillColor, strokeColor, text);
             } else {
                 if (n.isHighlighted()) {
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 3878)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 3879)
@@ -138,4 +138,6 @@
      * convert float range 0 <= x <= 1 to integer range 0..255
      * when dealing with colors and color alpha value
+     * @return null if val is null, the corresponding int if val is in the
+     *         range 0...1. If val is outside that range, return 255
      */
     public static Integer color_float2int(Float val) {
