Index: trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java	(revision 873)
+++ trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java	(revision 874)
@@ -114,4 +114,5 @@
 
 		Color colour = untaggedColor;
+		Color areacolour = untaggedColor;
 		int width = defaultSegmentWidth;
 		int realWidth = 0; //the real width of the element in meters
@@ -126,20 +127,26 @@
 		if(wayStyle!=null)
 		{
+			LineElemStyle l = null;
 			if(wayStyle instanceof LineElemStyle)
 			{
-				colour = ((LineElemStyle)wayStyle).colour;
-				width = ((LineElemStyle)wayStyle).width;
-				realWidth = ((LineElemStyle)wayStyle).realWidth;
-				dashed = ((LineElemStyle)wayStyle).dashed;
+				l = (LineElemStyle)wayStyle;
 			}
 			else if (wayStyle instanceof AreaElemStyle)
 			{
-				colour = ((AreaElemStyle)wayStyle).getColour();
+				areacolour = ((AreaElemStyle)wayStyle).colour;
+				l = ((AreaElemStyle)wayStyle).line;
 				area = true;
 			}
+			if(l != null)
+			{
+				colour = l.colour;
+				width = l.width;
+				realWidth = l.realWidth;
+				dashed = l.dashed;
+			}
 		}
 
 		if (area && fillAreas)
-			drawWayAsArea(w, colour);
+			drawWayAsArea(w, areacolour);
 		int orderNumber = 0;
 
@@ -152,5 +159,6 @@
 			orderNumber++;
 
-			if (!area && realWidth > 0 && useRealWidth && !showDirection) {
+			if (realWidth > 0 && useRealWidth && !showDirection)
+			{
 				int tmpWidth = (int) (100 /  (float) (circum / realWidth));
 				if (tmpWidth > width) width = tmpWidth;
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java	(revision 873)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java	(revision 874)
@@ -4,5 +4,6 @@
 public class AreaElemStyle extends ElemStyle
 {
-	Color colour;
+	public Color colour;
+	public LineElemStyle line = null;
 
 	public AreaElemStyle (Color colour, long maxScale, long minScale) {
@@ -12,6 +13,10 @@
 	}
 
-	public Color getColour() {
-		return colour;
+	public AreaElemStyle(AreaElemStyle a, LineElemStyle l)
+	{
+		this.colour = a.colour;
+		this.maxScale = a.maxScale;
+		this.minScale = a.minScale;
+		this.line = l;
 	}
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java	(revision 873)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java	(revision 874)
@@ -145,8 +145,8 @@
 						curLineDashed, curScaleMax, curScaleMin);
 				MapPaintStyles.add(curKey, curValue, curBoolean, newStyle);
-				curLineWidth	= -1;
+				curLineWidth = -1;
 				curLineRealWidth= 0;
-				curLineDashed   = false;
-				curLineColour 	= null;
+				curLineDashed = false;
+				curLineColour = null;
 			}
 			
@@ -154,5 +154,5 @@
 				newStyle = new IconElemStyle(curIcon, curIconAnnotate, curScaleMax, curScaleMin);
 				MapPaintStyles.add(curKey, curValue, curBoolean, newStyle);
-				curIcon 		= null;
+				curIcon = null;
 				curIconAnnotate = true;
 			}
@@ -160,5 +160,5 @@
 				newStyle = new AreaElemStyle (curAreaColour, curScaleMax, curScaleMin);
 				MapPaintStyles.add(curKey, curValue, curBoolean, newStyle);
-				curAreaColour 	= null;
+				curAreaColour = null;
 			}
 			curScaleMax = 1000000000;
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 873)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 874)
@@ -5,9 +5,9 @@
 
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.data.osm.OsmUtils;
+
 public class ElemStyles
 {
-	HashMap<String, ElemStyle> styles;
-	// static int nr = 0;
-
+	private HashMap<String, ElemStyle> styles;
 
 	public ElemStyles()
@@ -16,28 +16,35 @@
 	}
 
-	public void add (String k, String v, ElemStyle style)
+	public void add(String k, String v, String b, ElemStyle style)
 	{
 		ElemStyle  old_style;
-		String key = k + "=" + v;
-		
+		String key;
+
 		/* unfortunately, there don't seem to be an efficient way to */
 		/* find out, if a given OsmPrimitive is an area or not, */
 		/* so distinguish only between way and node here - for now */
-		if(style instanceof AreaElemStyle) {
-			key = key + "way";
-		}
-		else if(style instanceof LineElemStyle) {
-			key = key + "way";
-		}
-		else if(style instanceof IconElemStyle) {
-			key = key + "node";
-		}
+		if (style instanceof AreaElemStyle)
+			key = "w";
+		else if (style instanceof LineElemStyle)
+			key = "w";
+		else if (style instanceof IconElemStyle)
+			key = "n";
+		else
+			key = "";
+
+		if(v != null)
+			key += "n" + k + "=" + v;
+		else if(b != null)
+			key += "b" + k  + "=" + OsmUtils.getNamedOsmBoolean(b);
+		else
+			key += "x" + k;
+
 		/* avoid duplicates - for now */
 		old_style = styles.get(key);
-		if(old_style == null) {
+		if (old_style == null) {
 			/* new key/value, insert */
 			styles.put(key, style);
 		} else {
-			if(style.getMaxScale() < old_style.getMaxScale()) {
+			if (style.getMaxScale() < old_style.getMaxScale()) {
 				/* existing larger scale key/value, replace */
 				styles.remove(old_style);
@@ -47,62 +54,46 @@
 	}
 
-	public ElemStyle getStyle (OsmPrimitive p)
+	public ElemStyle get(OsmPrimitive p, Boolean area)
 	{
-		if(p.keys!=null)
-		{
+		if (p.keys!=null) {
 			String classname;
 			String kv = null;
-			
-			if(p instanceof org.openstreetmap.josm.data.osm.Node) {
-				classname = "node";
+
+			if (p instanceof org.openstreetmap.josm.data.osm.Node) {
+				if(area)
+					return null;
+				classname = "n";
 			} else {
-				classname = "way";
+				classname = "w";
 			}
 			Iterator<String> iterator = p.keys.keySet().iterator();
-			while(iterator.hasNext())	
+			while (iterator.hasNext())
 			{
 				String key = iterator.next();
-				kv = key + "=" + p.keys.get(key) + classname;
-				if(styles.containsKey(kv))
+				ElemStyle style = null;
+				kv = classname + "n" + key + "=" + p.keys.get(key);
+				if (styles.containsKey(kv))
 				{
-					return styles.get(kv);
+					style = styles.get(kv);
+					if(area == style instanceof AreaElemStyle)
+						return style;
+				}
+				kv = classname + "b" + key + "=" + OsmUtils.getNamedOsmBoolean(p.keys.get(key));
+				if (styles.containsKey(kv))
+				{
+					style = styles.get(kv);
+					if(area == style instanceof AreaElemStyle)
+						return style;
+				}
+				kv = classname + "x" + key;
+				if (styles.containsKey(kv))
+				{
+					style = styles.get(kv);
+					if(area == style instanceof AreaElemStyle)
+						return style;
 				}
 			}
-/**
-            // not a known key/value combination
-			boolean first_line = true;
+		}
 
-            // filter out trivial tags and show the rest
-			iterator = p.keys.keySet().iterator();
-			while(iterator.hasNext())	
-			{
-				String key = iterator.next();
-				kv = key + "=" + p.keys.get(key);
-				if(	!kv.startsWith("created_by=") &&
-					!kv.startsWith("converted_by=") &&
-					!kv.startsWith("source=") &&
-					!kv.startsWith("note=") &&
-					!kv.startsWith("layer=") &&
-					!kv.startsWith("bridge=") &&
-					!kv.startsWith("tunnel=") &&
-					!kv.startsWith("oneway=") &&
-					!kv.startsWith("speedlimit=") &&
-					!kv.startsWith("motorcar=") &&
-					!kv.startsWith("horse=") &&
-					!kv.startsWith("bicycle=") &&
-					!kv.startsWith("foot=")
-					) {
-						
-					if (first_line) {
-						nr++;
-						//System.out.println("mappaint - rule not found[" + nr + "]: " + kv + " id:" + p.id);
-					} else {
-						//System.out.println("mappaint - rule not found[" + nr + "]: " + kv);
-					}
-					first_line=false;
-				}
-			}
-*/		
-		}
 		return null;
 	}
@@ -110,5 +101,5 @@
 	public boolean isArea(OsmPrimitive p)
 	{
-		return getStyle(p) instanceof AreaElemStyle;
+		return get(p, true) instanceof AreaElemStyle;
 	}
 }
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 873)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 874)
@@ -9,5 +9,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
-import org.openstreetmap.josm.data.osm.OsmUtils;
+import org.openstreetmap.josm.gui.mappaint.ElemStyles;
 import org.xml.sax.InputSource;
 import org.xml.sax.XMLReader;
@@ -20,5 +20,5 @@
 	private static String internalImageDir;
 	private static Boolean isInternal = false;
-	private static HashMap<String, ElemStyle> styles = new HashMap<String, ElemStyle>();
+	private static ElemStyles styles = new ElemStyles();
 	
 	public static String getStyleDir(){
@@ -33,4 +33,27 @@
 	public static Boolean isInternal(){
 		return isInternal;
+	}
+	public static void add(String k, String v, String b, ElemStyle style)
+	{
+		styles.add(k, v, b, style);
+	}
+	public static ElemStyle getStyle(OsmPrimitive osm)
+	{
+		ElemStyle s = styles.get(osm, true);
+		if(s != null)
+		{
+			ElemStyle l = styles.get(osm, false);
+			if(l != null && l instanceof LineElemStyle)
+			{
+				s = new AreaElemStyle((AreaElemStyle)s, (LineElemStyle)l);
+			}
+		}
+		else
+			s = styles.get(osm, false);
+		return s;
+	}
+	public static boolean isArea(OsmPrimitive osm)
+	{
+		return styles.isArea(osm);
 	}
 
@@ -93,109 +116,3 @@
 	}
 
-//	static int nr = 0;
-
-	public static void add (String k, String v, String b, ElemStyle style) {
-		ElemStyle  old_style;
-		String key;
-
-		/* unfortunately, there don't seem to be an efficient way to */
-		/* find out, if a given OsmPrimitive is an area or not, */
-		/* so distinguish only between way and node here - for now */
-		if (style instanceof AreaElemStyle)
-			key = "way";
-		else if (style instanceof LineElemStyle)
-			key = "way";
-		else if (style instanceof IconElemStyle)
-			key = "node";
-		else
-			key = "";
-
-		if(v != null)
-			key += "n" + k + "=" + v;
-		else if(b != null)
-			key += "b" + k  + "=" + OsmUtils.getNamedOsmBoolean(b);
-		else
-			key += "x" + k;
-
-		/* avoid duplicates - for now */
-		old_style = styles.get(key);
-		if (old_style == null) {
-			/* new key/value, insert */
-			styles.put(key, style);
-		} else {
-			if (style.getMaxScale() < old_style.getMaxScale()) {
-				/* existing larger scale key/value, replace */
-				styles.remove(old_style);
-				styles.put(key, style);
-			}
-		}
-	}
-
-	public static ElemStyle getStyle (OsmPrimitive p)
-	{
-		if (p.keys!=null) {
-			String classname;
-			String kv = null;
-
-			if (p instanceof org.openstreetmap.josm.data.osm.Node) {
-				classname = "node";
-			} else {
-				classname = "way";
-			}
-			Iterator<String> iterator = p.keys.keySet().iterator();
-			while (iterator.hasNext())	
-			{
-				String key = iterator.next();
-				kv = classname + "n" + key + "=" + p.keys.get(key);
-				if (styles.containsKey(kv))
-					return styles.get(kv);
-				kv = classname + "b" + key + "=" + OsmUtils.getNamedOsmBoolean(p.keys.get(key));
-				if (styles.containsKey(kv))
-					return styles.get(kv);
-				kv = classname + "x" + key;
-				if (styles.containsKey(kv))
-					return styles.get(kv);
-			}
-
-			// not a known key/value combination
-//			boolean first_line = true;
-
-			// filter out trivial tags and show the rest
-//			iterator = p.keys.keySet().iterator();
-//			while (iterator.hasNext()) {
-//				String key = iterator.next();
-//				kv = key + "=" + p.keys.get(key);
-//				if (!kv.startsWith("created_by=") &&
-//						!kv.startsWith("converted_by=") &&
-//						!kv.startsWith("source=") &&
-//						!kv.startsWith("note=") &&
-//						!kv.startsWith("layer=") &&
-//						!kv.startsWith("bridge=") &&
-//						!kv.startsWith("tunnel=") &&
-//						!kv.startsWith("oneway=") &&
-//						!kv.startsWith("speedlimit=") &&
-//						!kv.startsWith("motorcar=") &&
-//						!kv.startsWith("horse=") &&
-//						!kv.startsWith("bicycle=") &&
-//						!kv.startsWith("foot=")
-//				) {
-
-//					if (first_line) {
-//						nr++;
-//						System.out.println("mappaint - rule not found[" + nr + "]: " + kv + " id:" + p.id);
-//					} else {
-//						System.out.println("mappaint - rule not found[" + nr + "]: " + kv);
-//					}
-//					first_line=false;
-//				}
-//			}
-		}
-
-		return null;
-	}
-
-	public static boolean isArea(OsmPrimitive p)
-	{
-		return getStyle(p) instanceof AreaElemStyle;
-	}
 }
Index: trunk/styles/standard/elemstyles.xml
===================================================================
--- trunk/styles/standard/elemstyles.xml	(revision 873)
+++ trunk/styles/standard/elemstyles.xml	(revision 874)
@@ -595,6 +595,5 @@
 	<rule>
 		<condition k="junction" v="roundabout"/>
-		<!-- this overwrites the "underlying" highway tag, so comment it out until we have a better way to display this -->
-		<!--area width="1" colour="roundabout#eeeeee" /-->
+		<area width="1" colour="roundabout#eeeeee"/>
 		<!-- tagging a node makes no real sense, a roundabout should be tagged with several nodes, or a highway=mini_roundabout should probably be used -->
 		<icon annotate="true" src="misc/deprecated.png"/>
