Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java	(revision 3865)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.data.osm.visitor.paint;
 
+import java.awt.AlphaComposite;
 import java.awt.BasicStroke;
 import java.awt.Color;
@@ -31,5 +32,7 @@
 import org.openstreetmap.josm.data.osm.visitor.paint.relations.Multipolygon.PolyData;
 import org.openstreetmap.josm.gui.NavigatableComponent;
+import org.openstreetmap.josm.gui.mappaint.ElemStyle;
 import org.openstreetmap.josm.gui.mappaint.NodeElemStyle;
+import org.openstreetmap.josm.gui.mappaint.NodeElemStyle.Symbol;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.LanguageInfo;
@@ -54,5 +57,4 @@
 
     private final Font orderFont;
-    private final int fillAlpha;
     private final int virtualNodeSize;
     private final int virtualNodeSpace;
@@ -89,5 +91,4 @@
 
         this.orderFont = new Font(Main.pref.get("mappaint.font", "Helvetica"), Font.PLAIN, Main.pref.getInteger("mappaint.fontsize", 8));
-        this.fillAlpha = Math.min(255, Math.max(0, Integer.valueOf(Main.pref.getInteger("mappaint.fillalpha", 50))));
         this.virtualNodeSize = virtual ? Main.pref.getInteger("mappaint.node.virtual-size", 8) / 2 : 0;
         this.virtualNodeSpace = Main.pref.getInteger("mappaint.node.virtual-space", 70);
@@ -187,10 +188,14 @@
     }
 
-    public void drawNodeIcon(Node n, ImageIcon icon, boolean selected, boolean member, String name) {
+    public void drawNodeIcon(Node n, ImageIcon icon, float iconAlpha, boolean selected, boolean member, String name) {
         Point p = nc.getPoint(n);
         if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return;
 
         int w = icon.getIconWidth(), h=icon.getIconHeight();
+        if (iconAlpha != 1f) {
+            g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, iconAlpha));
+        }
         icon.paintIcon ( nc, g, p.x-w/2, p.y-h/2 );
+        g.setPaintMode();
         if(name != null) {
             if (inactive || n.isDisabled()) {
@@ -208,4 +213,35 @@
             g.setColor(selected? selectedColor : relationSelectedColor);
             g.drawRect(p.x-w/2-2, p.y-h/2-2, w+4, h+4);
+        }
+    }
+
+    public void drawNodeSymbol(Node n, Symbol s, boolean selected, boolean member, String name) {
+        Point p = nc.getPoint(n);
+        if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return;
+        int radius = (int) (s.size / 2);
+
+        if (s.fillColor != null) {
+            g.setColor(s.fillColor);
+            switch (s.symbol) {
+                case CIRCLE:
+                    g.fillOval(p.x - radius, p.y - radius, (int) s.size, (int) s.size);
+                    break;
+                case SQUARE:
+                    g.fillRect(p.x - radius, p.y - radius, (int) s.size, (int) s.size);
+                    break;
+            }
+        }
+        if (s.stroke != null) {
+            g.setStroke(s.stroke);
+            g.setColor(s.strokeColor);
+            switch (s.symbol) {
+                case CIRCLE:
+                    g.drawOval(p.x - radius, p.y - radius, (int) s.size - 1, (int) s.size - 1);
+                    break;
+                case SQUARE:
+                    g.drawRect(p.x - radius, p.y - radius, (int) s.size - 1, (int) s.size - 1);
+                    break;
+            }
+            g.setStroke(new BasicStroke());
         }
     }
@@ -271,7 +307,10 @@
             TexturePaint texture = new TexturePaint(fillImage, 
                     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, ElemStyle.color_int2float(color.getAlpha())));
+            }
             g.fill(polygon);
+            g.setPaintMode();
         }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java	(revision 3865)
@@ -3,6 +3,4 @@
 
 import java.awt.Color;
-import java.awt.Rectangle;
-import java.awt.TexturePaint;
 import java.awt.image.BufferedImage;
 
@@ -17,5 +15,4 @@
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference;
 import org.openstreetmap.josm.tools.Utils;
-
 
 public class AreaElemStyle extends ElemStyle
@@ -33,4 +30,6 @@
         BufferedImage fillImage = null;
         IconReference iconRef = c.get("fill-image", null, IconReference.class);
+        Integer fillImageAlpha = null;
+
         if (iconRef != null) {
             ImageIcon icon = MapPaintStyles.getIcon(iconRef, false);
@@ -42,4 +41,10 @@
                     throw new RuntimeException();
                 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));
+                if (pAlpha != null) {
+                    fillImageAlpha = pAlpha;
+                }
             }
         }
@@ -48,14 +53,23 @@
         if (color != null) {
 
-            int alpha = Math.min(255, Math.max(0, Integer.valueOf(Main.pref.getInteger("mappaint.fillalpha", 50))));
-            Integer pAlpha = color_float2int(c.get("fill-opacity", null, float.class));
-            if (pAlpha != null) {
-                alpha = pAlpha;
+            int alpha;
+            if (fillImageAlpha != null) {
+                alpha = fillImageAlpha;
+            } else {
+                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);
         }
         
-        if (fillImage != null || color != null)
+        if (fillImage != null || color != null) {
+            if (color == null) {
+                color = new Color(0, 0, 0, fillImageAlpha);
+            }
             return new AreaElemStyle(c, color, fillImage);
+        }
         else
             return null;
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java	(revision 3865)
@@ -15,7 +15,21 @@
 public class Cascade implements Cloneable {
     
-    public static final Cascade EMPTY_CASCADE = new Cascade();
+    public static final Cascade EMPTY_CASCADE = new Cascade(false);
 
     protected Map<String, Object> prop = new HashMap<String, Object>();
+
+    /**
+     * constructor
+     * @param isModifier Everything that is not on the default layer is assumed to
+     *                   be a modifier. Can be overridden in style definition.
+     */
+    public Cascade(boolean isModifier) {
+        if (isModifier) {
+            put("modifier", true);
+        }
+    }
+
+    private Cascade() {
+    }
 
     public <T> T get(String key, T def, Class<T> klass) {
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java	(revision 3865)
@@ -7,11 +7,14 @@
 
 abstract public class ElemStyle {
-    
+
     public float z_index;
     public float object_z_index;
+    public boolean isModifier;  // false, if style can serve as main style for the
+                                // primitive; true, if it is a highlight or modifier
 
-    public ElemStyle(float z_index, float object_z_index) {
+    public ElemStyle(float z_index, float object_z_index, boolean isModifier) {
         this.z_index = z_index;
         this.object_z_index = object_z_index;
+        this.isModifier = isModifier;
     }
 
@@ -19,4 +22,5 @@
         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);
     }
 
@@ -28,5 +32,5 @@
             return false;
         ElemStyle s = (ElemStyle) o;
-        return z_index == s.z_index && object_z_index == s.object_z_index;
+        return z_index == s.z_index && object_z_index == s.object_z_index && isModifier == s.isModifier;
     }
 
@@ -36,4 +40,5 @@
         hash = 41 * hash + Float.floatToIntBits(this.z_index);
         hash = 41 * hash + Float.floatToIntBits(this.object_z_index);
+        hash = 41 * hash + (isModifier ? 1 : 0);
         return hash;
     }
@@ -42,18 +47,6 @@
     public String toString() {
         if (z_index != 0f || object_z_index != 0f)
-            return String.format("z_idx=%s/%s ", z_index, object_z_index);
+            return String.format("z_idx=%s/%s ", z_index, object_z_index) + (isModifier ? "modifier " : "");
         return "";
     }
-
-    public static Integer color_float2int(Float val) {
-        if (val == null || val < 0 || val > 1)
-            return null;
-        return (int) (255f * val + 0.5f);
-    }
-    
-    public static Float color_int2float(Integer val) {
-        if (val == null || val < 0 || val > 255)
-            return null;
-        return ((float) val) / 255f;
-    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 3865)
@@ -52,10 +52,28 @@
         }
         Pair<StyleList, Range> p = getImpl(osm, scale, nc);
-        if (osm instanceof Node && p.a.isEmpty()) {
-            p.a = StyleList.SIMPLE_NODE;
-        } else if (osm instanceof Way && !Utils.exists(p.a, LineElemStyle.class)) {
-            AreaElemStyle area = Utils.find(p.a, AreaElemStyle.class);
-            LineElemStyle line = (area == null ? LineElemStyle.UNTAGGED_WAY : LineElemStyle.createSimpleLineStyle(area.color));
-            p.a = new StyleList(p.a, line);
+        if (osm instanceof Node) {
+            boolean hasNonModifier = false;
+            for (ElemStyle s : p.a) {
+                if (!s.isModifier) {
+                    hasNonModifier = true;
+                    break;
+                }
+            }
+            if (!hasNonModifier) {
+                p.a = new StyleList(p.a, NodeElemStyle.SIMPLE_NODE_ELEMSTYLE);
+            }
+        } else if (osm instanceof Way) {
+            boolean hasNonModifierLine = false;
+            for (ElemStyle s : p.a) {
+                if (s instanceof LineElemStyle && !s.isModifier) {
+                    hasNonModifierLine = true;
+                    break;
+                }
+            }
+            if (!hasNonModifierLine) {
+                AreaElemStyle area = Utils.find(p.a, AreaElemStyle.class);
+                LineElemStyle line = (area == null ? LineElemStyle.UNTAGGED_WAY : LineElemStyle.createSimpleLineStyle(area.color));
+                p.a = new StyleList(p.a, line);
+            }
         }
         osm.mappaintStyle = osm.mappaintStyle.put(p.a, p.b);
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java	(revision 3865)
@@ -20,5 +20,5 @@
 
     public static LineElemStyle createSimpleLineStyle(Color color) {
-        Cascade c = new Cascade();
+        Cascade c = new Cascade(false);
         c.put("width", -1f);
         c.put("color", color != null ? color : PaintColors.UNTAGGED.get());
@@ -29,9 +29,9 @@
     public static final LineElemStyle UNTAGGED_WAY = createSimpleLineStyle(null);
 
-    public float realWidth; // the real width of this line in meter
+    private BasicStroke line;
     public Color color;
     public Color dashesBackground;
-
-    private BasicStroke line;
+    public float realWidth; // the real width of this line in meter
+
     private BasicStroke dashesLine;
 
@@ -106,5 +106,5 @@
 
         int alpha = 255;
-        Integer pAlpha = color_float2int(c.get("opacity", null, float.class));
+        Integer pAlpha = Utils.color_float2int(c.get("opacity", null, float.class));
         if (pAlpha != null) {
             alpha = pAlpha;
@@ -131,5 +131,5 @@
         Color dashesBackground = c.get(prefix + "dashes-background-color", null, Color.class);
         if (dashesBackground != null) {
-            pAlpha = color_float2int(c.get(prefix + "dashes-background-opacity", null, Float.class));
+            pAlpha = Utils.color_float2int(c.get(prefix + "dashes-background-opacity", null, Float.class));
             if (pAlpha != null) {
                 alpha = pAlpha;
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MultiCascade.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MultiCascade.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MultiCascade.java	(revision 3865)
@@ -18,10 +18,12 @@
 
     public Cascade getCascade(String key) {
-        Cascade ret = get(key);
-        if (ret == null) {
-            ret = new Cascade();
-            put(key, ret);
+        if (key == null)
+            throw new IllegalArgumentException();
+        Cascade c = get(key);
+        if (c == null) {
+            c = new Cascade(!key.equals("default"));
+            put(key, c);
         }
-        return ret;
+        return c;
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java	(revision 3865)
@@ -2,9 +2,14 @@
 package org.openstreetmap.josm.gui.mappaint;
 
+import static org.openstreetmap.josm.tools.Utils.equal;
+
+import java.awt.BasicStroke;
 import java.awt.Color;
+import java.awt.Stroke;
 
 import javax.swing.GrayFilter;
 import javax.swing.ImageIcon;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -22,21 +27,124 @@
     public String annotation_key;
     public ImageIcon icon;
+    public int iconAlpha;
+    public Symbol symbol;
+
     private ImageIcon disabledIcon;
 
-    public static final NodeElemStyle SIMPLE_NODE_ELEMSTYLE = new NodeElemStyle(Cascade.EMPTY_CASCADE, true, null, null);
-
-    protected NodeElemStyle(Cascade c, boolean annotate, String annotation_key, ImageIcon icon) {
+    public static class Symbol {
+        public SymbolShape symbol;
+        public float size;
+        public Stroke stroke;
+        public Color strokeColor;
+        public Color fillColor;
+
+        public Symbol(SymbolShape symbol, float size, Stroke stroke, Color strokeColor, Color fillColor) {
+            if (stroke != null && strokeColor == null)
+                throw new IllegalArgumentException();
+            if (stroke == null && fillColor == null)
+                throw new IllegalArgumentException();
+            this.symbol = symbol;
+            this.size = size;
+            this.stroke = stroke;
+            this.strokeColor = strokeColor;
+            this.fillColor = fillColor;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (obj == null || getClass() != obj.getClass())
+                return false;
+            final Symbol other = (Symbol) obj;
+            return  symbol == other.symbol &&
+                    size == other.size &&
+                    equal(stroke, other.stroke) &&
+                    equal(strokeColor, other.strokeColor) &&
+                    equal(fillColor, other.fillColor);
+        }
+
+        @Override
+        public int hashCode() {
+            int hash = 7;
+            hash = 67 * hash + symbol.hashCode();
+            hash = 67 * hash + Float.floatToIntBits(size);
+            hash = 67 * hash + (stroke != null ? stroke.hashCode() : 0);
+            hash = 67 * hash + (strokeColor != null ? strokeColor.hashCode() : 0);
+            hash = 67 * hash + (fillColor != null ? fillColor.hashCode() : 0);
+            return hash;
+        }
+
+        @Override
+        public String toString() {
+            return "symbol=" + symbol + " size=" + size +
+                    (stroke != null ? (" stroke=" + stroke + " strokeColor=" + strokeColor) : "") +
+                    (fillColor != null ? (" fillColor=" + fillColor) : "");
+        }
+    }
+    
+    public enum SymbolShape { SQUARE, CIRCLE }
+
+    public static final NodeElemStyle SIMPLE_NODE_ELEMSTYLE = new NodeElemStyle(Cascade.EMPTY_CASCADE, true, null, null, 0, null);
+
+    protected NodeElemStyle(Cascade c, boolean annotate, String annotation_key, ImageIcon icon, int iconAlpha, Symbol symbol) {
         super(c);
         this.annotate = annotate;
         this.annotation_key = annotation_key;
         this.icon = icon;
+        this.iconAlpha = iconAlpha;
+        this.symbol = symbol;
     }
 
     public static NodeElemStyle create(Cascade c) {
         IconReference iconRef = c.get("icon-image", null, IconReference.class);
-        if (iconRef == null)
-            return null;
-        ImageIcon icon = MapPaintStyles.getIcon(iconRef, false);
-        
+        ImageIcon icon = null;
+        int iconAlpha = 0;
+        Symbol symbol = null;
+
+        if (iconRef != null) {
+            icon = MapPaintStyles.getIcon(iconRef, false);
+            iconAlpha = 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));
+            if (pAlpha != null) {
+                iconAlpha = pAlpha;
+            }
+        } else {
+            SymbolShape shape;
+            String shapeStr = c.get("symbol-shape", null, String.class);
+            if (equal(shapeStr, "square")) {
+                shape = SymbolShape.SQUARE;
+            } else if (equal(shapeStr, "circle")) {
+                shape = SymbolShape.CIRCLE;
+            } else
+                return null;
+
+            Float size = c.get("symbol-size", null, Float.class);
+            if (size == null || size <= 0)
+                return null;
+
+            Float strokeWidth = c.get("symbol-stroke-width", null, Float.class);
+            Color strokeColor = c.get("symbol-stroke-color", null, Color.class);
+            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 (fillColor != null) {
+                float fillAlpha = c.get("symbol-fill-opacity", 1f, Float.class);
+                fillColor = new Color(fillColor.getRed(), fillColor.getGreen(),
+                        fillColor.getBlue(), Utils.color_float2int(fillAlpha));
+            }
+
+            if ((stroke == null || strokeColor == null) && fillColor == null)
+                return null;
+
+            symbol = new Symbol(shape, size, stroke, strokeColor, fillColor);
+        }
+
         String text = c.get("text", null, String.class);
 
@@ -44,8 +152,8 @@
         String annotation_key = null;
 
-        if (annotate && !"yes".equalsIgnoreCase(text)) {
+        if (annotate && !"auto".equalsIgnoreCase(text)) {
             annotation_key = text;
         }
-        return new NodeElemStyle(c, annotate, annotation_key, icon);
+        return new NodeElemStyle(c, annotate, annotation_key, icon, iconAlpha, symbol);
     }
 
@@ -56,5 +164,7 @@
             if (icon != null && painter.isShowIcons()) {
                 painter.drawNodeIcon(n, (painter.isInactive() || n.isDisabled()) ? getDisabledIcon() : icon,
-                        selected, member, getName(n, painter));
+                        Utils.color_int2float(iconAlpha), selected, member, getName(n, painter));
+            } else if (symbol != null) {
+                painter.drawNodeSymbol(n, symbol, selected, member, getName(n, painter));
             } else {
                 if (n.isHighlighted()) {
@@ -127,4 +237,6 @@
         hash = 17 * hash + (annotation_key != null ? annotation_key.hashCode() : 0);
         hash = 17 * hash + (icon != null ? icon.getImage().hashCode() : 0);
+        hash = 17 * hash + this.iconAlpha;
+        hash = 17 * hash + (this.symbol != null ? this.symbol.hashCode() : 0);
         return hash;
     }
@@ -143,12 +255,19 @@
         if (annotate != other.annotate)
             return false;
-        if (!Utils.equal(annotation_key, annotation_key))
+        if (!equal(annotation_key, annotation_key))
+            return false;
+        if (this.iconAlpha != other.iconAlpha)
+            return false;
+        if (!equal(symbol, other.symbol))
             return false;
         return true;
     }
 
+
     @Override
     public String toString() {
-        return "NodeElemStyle{" + super.toString() + "annotate=" + annotate + " annotation_key=" + annotation_key + " icon=" + icon + '}';
+        return "NodeElemStyle{" + super.toString() + "annotate=" + annotate + " annotation_key=" + annotation_key +
+                (icon != null ? (" icon=" + icon + " iconAlpha=" + iconAlpha) : "") +
+                (symbol != null ? (" symbol=[" + symbol + "]") : "") + '}';
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java	(revision 3865)
@@ -48,6 +48,4 @@
     {
         private List<ElemStyle> lst;
-
-        public static final StyleList SIMPLE_NODE = new StyleList(NodeElemStyle.SIMPLE_NODE_ELEMSTYLE);
 
         public StyleList() {
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java	(revision 3865)
@@ -129,5 +129,5 @@
                             c = mc.get("*").clone();
                         } else {
-                            c = new Cascade();
+                            c = new Cascade(!sub.equals("default"));
                         }
                         mc.put(sub, c);
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 3865)
@@ -20,5 +20,4 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.mappaint.Cascade;
-import org.openstreetmap.josm.gui.mappaint.ElemStyle;
 import org.openstreetmap.josm.gui.mappaint.MultiCascade;
 import org.openstreetmap.josm.gui.mappaint.Range;
@@ -289,5 +288,5 @@
                     if (icon.annotate != null) {
                         if (icon.annotate) {
-                            def.put("text", "yes");
+                            def.put("text", "auto");
                         } else {
                             def.remove("text");
@@ -306,5 +305,5 @@
                     int alpha = p.line.color.getAlpha();
                     if (alpha != 255) {
-                        def.put("opacity", ElemStyle.color_int2float(alpha));
+                        def.put("opacity", Utils.color_int2float(alpha));
                     }
                 }
@@ -335,5 +334,5 @@
                         int alpha = mod.color.getAlpha();
                         if (alpha != 255) {
-                            c.put("opacity", ElemStyle.color_int2float(alpha));
+                            c.put("opacity", Utils.color_int2float(alpha));
                         }
                     }
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 3864)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 3865)
@@ -124,3 +124,27 @@
             return String.format("#%06x(alpha=%d)", c.getRGB() & 0x00ffffff, c.getAlpha());
     }
+
+    /**
+     * convert float range 0 <= x <= 1 to integer range 0..255
+     * when dealing with colors and color alpha value
+     */
+    public static Integer color_float2int(Float val) {
+        if (val == null)
+            return null;
+        if (val < 0 || val > 1)
+            return 255;
+        return (int) (255f * val + 0.5f);
+    }
+
+    /**
+     * convert back
+     */
+    public static Float color_int2float(Integer val) {
+        if (val == null)
+            return null;
+        if (val < 0 || val > 255)
+            return 1f;
+        return ((float) val) / 255f;
+    }
+
 }
