Index: /applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/Renderer.java	(revision 29201)
+++ /applications/editors/josm/plugins/smed2/src/seamap/Renderer.java	(revision 29202)
@@ -11,6 +11,10 @@
 
 import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Font;
 import java.awt.Graphics2D;
+import java.awt.Rectangle;
 import java.awt.RenderingHints;
+import java.awt.font.TextLayout;
 import java.awt.geom.GeneralPath;
 import java.awt.geom.Path2D;
@@ -25,4 +29,5 @@
 import seamap.SeaMap;
 import seamap.SeaMap.*;
+import symbols.Areas;
 import symbols.Symbols;
 import symbols.Symbols.*;
@@ -69,5 +74,10 @@
 	public static double calcArea(Feature feature) {
 	  if (feature.flag == Fflag.AREA) {
-			ArrayList<Long> way = map.ways.get(feature.refs);
+			ArrayList<Long> way;
+			if (map.mpolys.containsKey(feature.refs)) {
+				way = map.ways.get(map.mpolys.get(feature.refs));
+			} else {
+				way = map.ways.get(feature.refs);
+			}
 			Coord coord = map.nodes.get(way.get(0));
 	    double llon = coord.lon;
@@ -89,5 +99,10 @@
 	public static Coord findCentroid(Feature feature) {
 		Coord coord;
-		ArrayList<Long> way = map.ways.get(feature.refs);
+		ArrayList<Long> way;
+		if (map.mpolys.containsKey(feature.refs)) {
+			way = map.ways.get(map.mpolys.get(feature.refs));
+		} else {
+			way = map.ways.get(feature.refs);
+		}
 		switch (feature.flag) {
 		case NODE:
@@ -142,10 +157,13 @@
 	public static void lineVector (Feature feature, LineStyle style) {
 		if (feature.flag != Fflag.NODE) {
-			Long mpoly = map.outers.get(feature.refs);
 			ArrayList<Long> ways = new ArrayList<Long>();
-			if (mpoly != null) {
-				ways.addAll(map.mpolys.get(mpoly));
+			if (map.outers.containsKey(feature.refs)) {
+				ways.addAll(map.mpolys.get(map.outers.get(feature.refs)));
 			} else {
-				ways.add(feature.refs);
+				if (map.mpolys.containsKey(feature.refs)) {
+					ways.addAll(map.mpolys.get(feature.refs));
+				} else {
+					ways.add(feature.refs);
+				}
 			}
 			Path2D.Double p = new Path2D.Double();
@@ -168,5 +186,5 @@
 					System.arraycopy(style.dash, 0, dash, 0, style.dash.length);
 					for (int i = 0; i < style.dash.length; i++) {
-						dash[i] *= (float) (sScale);
+						dash[i] *= (float) sScale;
 					}
 					g2.setStroke(new BasicStroke((float) (style.width * sScale), BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 1, dash, 0));
@@ -184,10 +202,14 @@
 	}
 	
-	public static void labelText (Feature feature, String str, TextStyle style, Delta delta) {
+	public static void labelText (Feature feature, String str, Font font, Delta delta) {
+		Symbol label = new Symbol();
+		label.add(new Instr(Prim.FILL, Color.black));
+		label.add(new Instr(Prim.TEXT, new Caption(str, font, delta)));
+		Point2D point = helper.getPoint(findCentroid(feature));
+		Symbols.drawSymbol(g2, label, tScale, point.getX(), point.getY(), delta, null);
+	}
+	
+	public static void lineText (Feature feature, String str, Font font, double offset, double dy) {
 		
 	}
-	
-	public static void lineText (Feature feature, String str, TextStyle style, double offset, Delta delta) {
-		
-	}
 }
Index: /applications/editors/josm/plugins/smed2/src/seamap/Rules.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/Rules.java	(revision 29201)
+++ /applications/editors/josm/plugins/smed2/src/seamap/Rules.java	(revision 29202)
@@ -103,7 +103,6 @@
 	
 	private static void shoreline(Feature feature) {
-		CatSLC cat = (CatSLC) Renderer.getAttVal(feature, feature.type, 0, Att.CATSLC);
 		if (zoom >= 12) {
-			switch (cat) {
+			switch ((CatSLC) Renderer.getAttVal(feature, feature.type, 0, Att.CATSLC)) {
 			case SLC_TWAL:
 				WatLEV lev = (WatLEV) Renderer.getAttVal(feature, feature.type, 0, Att.WATLEV);
@@ -111,10 +110,10 @@
 					Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
 					if (zoom >= 15)
-						Renderer.lineText(feature, "(covers)", new TextStyle(new Font("Arial", Font.PLAIN, 80)), 0.5, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 20)));
+						Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), 0.5, 20);
 				} else {
 					Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null));
 				}
 				if (zoom >= 15)
-					Renderer.lineText(feature, "Training Wall", new TextStyle(new Font("Arial", Font.PLAIN, 80)), 0.5, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -20)));
+					Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), 0.5, -20);
 			}
 		}
@@ -149,5 +148,5 @@
 			AttItem name = feature.atts.get(Att.OBJNAM);
 			if ((zoom >= 10) && (name != null))
-				Renderer.labelText(feature, (String) name.val, new TextStyle(new Font("Arial", Font.BOLD, 150)), null);
+				Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), null);
 			break;
 		case TSELNE:
@@ -171,5 +170,5 @@
 			}
 			if ((zoom >= 15) && (name != null))
-				Renderer.labelText(feature, (String) name.val, new TextStyle(new Font("Arial", Font.BOLD, 80)), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
+				Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
 			break;
 		case MARCUL:
@@ -196,5 +195,5 @@
 				Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, null));
 			if ((zoom >= 12) && (name != null))
-				Renderer.labelText(feature, (String) name.val, new TextStyle(new Font("Arial", Font.PLAIN, 100)), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 0)));
+				Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.PLAIN, 100), new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 0)));
 			break;
 		case RESARE:
@@ -210,8 +209,19 @@
 				Renderer.lineVector(feature, new LineStyle(Color.black, 20, new float[] { 40, 40 }, null));
 				if ((zoom >= 15) && (name != null))
-					Renderer.labelText(feature, (String) name.val, new TextStyle(new Font("Arial", Font.BOLD, 80)), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));
+					Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));
 			}
 			break;
 		case SEAARE:
+			switch ((CatSEA) Renderer.getAttVal(feature, feature.type, 0, Att.CATSEA)) {
+			case SEA_RECH:
+				break;
+			case SEA_BAY:
+				break;
+			case SEA_SHOL:
+				break;
+			case SEA_GAT:
+			case SEA_NRRW:
+				break;
+			}
 			break;
 		case SNDWAV:
Index: /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java	(revision 29201)
+++ /applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java	(revision 29202)
@@ -120,5 +120,4 @@
 	private Feature feature;
 	private ArrayList<Long> list;
-	private long mpid;
 
 	public SeaMap() {
@@ -154,5 +153,7 @@
 		list = new ArrayList<Long>();
 		mpolys.put(id, list);
-		mpid = id;
+		feature = new Feature();
+		feature.refs = id;
+		feature.flag = Fflag.AREA;
 	}
 
@@ -164,5 +165,5 @@
 		if (outer) {
 			list.add(0, way);
-			outers.put(way, mpid);
+			outers.put(way, feature.refs);
 		} else {
 			list.add(way);
Index: /applications/editors/josm/plugins/smed2/src/smed2/MapImage.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/smed2/MapImage.java	(revision 29201)
+++ /applications/editors/josm/plugins/smed2/src/smed2/MapImage.java	(revision 29202)
@@ -64,6 +64,6 @@
 	public void paint(Graphics2D g2, MapView mv, Bounds bb) {
 		Rectangle rect = Main.map.mapView.getBounds();
-		g2.setBackground(new Color(0xb5d0d0));
-		g2.clearRect(rect.x, rect.y, rect.width, rect.height);
+//		g2.setBackground(new Color(0xb5d0d0));
+//		g2.clearRect(rect.x, rect.y, rect.width, rect.height);
 		g2.setPaint(Color.black);
 		g2.setFont(new Font("Arial", Font.BOLD, 20));
Index: /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java	(revision 29201)
+++ /applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java	(revision 29202)
@@ -207,17 +207,11 @@
 		if (data != null) {
 			for (OsmPrimitive osm : data) {
-				if ((osm instanceof Node) || (osm instanceof Way)) {
-					if (osm instanceof Node) {
-						map.addNode(((Node) osm).getUniqueId(), ((Node) osm).getCoor().lat(), ((Node) osm).getCoor().lon());
-					} else {
-						map.addWay(((Way) osm).getUniqueId());
-						for (Node node : ((Way) osm).getNodes()) {
-							map.addToWay((node.getUniqueId()));
-						}
-					}
-					for (Entry<String, String> entry : osm.getKeys().entrySet()) {
-						map.addTag(entry.getKey(), entry.getValue());
-					}
-					map.tagsDone(osm.getUniqueId());
+				if (osm instanceof Node) {
+					map.addNode(((Node) osm).getUniqueId(), ((Node) osm).getCoor().lat(), ((Node) osm).getCoor().lon());
+				} else if (osm instanceof Way) {
+					map.addWay(((Way) osm).getUniqueId());
+					for (Node node : ((Way) osm).getNodes()) {
+						map.addToWay((node.getUniqueId()));
+					}
 				} else if ((osm instanceof Relation) && ((Relation) osm).isMultipolygon()) {
 					map.addMpoly(((Relation) osm).getUniqueId());
@@ -227,4 +221,8 @@
 					}
 				}
+				for (Entry<String, String> entry : osm.getKeys().entrySet()) {
+					map.addTag(entry.getKey(), entry.getValue());
+				}
+				map.tagsDone(osm.getUniqueId());
 			}
 		}
Index: /applications/editors/josm/plugins/smed2/src/symbols/Notices.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/symbols/Notices.java	(revision 29201)
+++ /applications/editors/josm/plugins/smed2/src/symbols/Notices.java	(revision 29202)
@@ -51,5 +51,5 @@
 	private static final Symbol Sport = new Symbol();
 	static {
-		Sport.add(new Instr(Prim.TEXT, new Caption("SPORT", new TextStyle(new Font("Arial", Font.BOLD, 15)), (float)-25.0, (float)5.0)));
+		Sport.add(new Instr(Prim.TEXT, new Caption("SPORT", new Font("Arial", Font.BOLD, 15), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 0)))));
 	}
 	private static final Symbol Turn = new Symbol();
@@ -65,5 +65,5 @@
 	private static final Symbol VHF = new Symbol();
 	static {
-		VHF.add(new Instr(Prim.TEXT, new Caption("VHF", new TextStyle(new Font("Arial", Font.BOLD, 20)), (float)-20.0, (float)-5.0)));
+		VHF.add(new Instr(Prim.TEXT, new Caption("VHF", new Font("Arial", Font.BOLD, 20), new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 0)))));
 	}
 	private static final Symbol Waterbike = new Symbol();
Index: /applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
===================================================================
--- /applications/editors/josm/plugins/smed2/src/symbols/Symbols.java	(revision 29201)
+++ /applications/editors/josm/plugins/smed2/src/symbols/Symbols.java	(revision 29202)
@@ -15,4 +15,5 @@
 import java.awt.Graphics2D;
 import java.awt.Rectangle;
+import java.awt.font.TextLayout;
 import java.awt.geom.*;
 import java.util.ArrayList;
@@ -59,5 +60,5 @@
 		Object params;
 
-		Instr(Prim itype, Object iparams) {
+		public Instr(Prim itype, Object iparams) {
 			type = itype;
 			params = iparams;
@@ -85,23 +86,13 @@
 	}
 
-	public static class TextStyle {
-		Font font;
-
-		public TextStyle(Font ifont) {
-			font = ifont;
-		}
-	}
-
 	public static class Caption {
 		String str;
-		TextStyle style;
-		float x;
-		float y;
-
-		public Caption(String istr, TextStyle istyle, float ix, float iy) {
+		Font font;
+		Delta dd;
+
+		public Caption(String istr, Font ifont, Delta idd) {
 			str = istr;
-			style = istyle;
-			x = ix;
-			y = iy;
+			font = ifont;
+			dd = idd;
 		}
 	}
@@ -167,41 +158,41 @@
 						switch (dd.h) {
 						case CC:
-							dx = bbox.x + (bbox.width / 2.0);
-							dy = bbox.y + (bbox.height / 2.0);
+							dx -= bbox.x + (bbox.width / 2.0);
+							dy -= bbox.y + (bbox.height / 2.0);
 							break;
 						case TL:
-							dx = bbox.x;
-							dy = bbox.y;
+							dx -= bbox.x;
+							dy -= bbox.y;
 							break;
 						case TR:
-							dx = bbox.x + bbox.width;
-							dy = bbox.y;
+							dx -= bbox.x + bbox.width;
+							dy -= bbox.y;
 							break;
 						case TC:
-							dx = bbox.x + (bbox.width / 2.0);
-							dy = bbox.y;
+							dx -= bbox.x + (bbox.width / 2.0);
+							dy -= bbox.y;
 							break;
 						case LC:
-							dx = bbox.x;
-							dy = bbox.y + (bbox.height / 2.0);
+							dx -= bbox.x;
+							dy -= bbox.y + (bbox.height / 2.0);
 							break;
 						case RC:
-							dx = bbox.x + bbox.width;
-							dy = bbox.y + (bbox.height / 2.0);
+							dx -= bbox.x + bbox.width;
+							dy -= bbox.y + (bbox.height / 2.0);
 							break;
 						case BL:
-							dx = bbox.x;
-							dy = bbox.y + bbox.height;
+							dx -= bbox.x;
+							dy -= bbox.y + bbox.height;
 							break;
 						case BR:
-							dx = bbox.x + bbox.width;
-							dy = bbox.y + bbox.height;
+							dx -= bbox.x + bbox.width;
+							dy -= bbox.y + bbox.height;
 							break;
 						case BC:
-							dx = bbox.x + (bbox.width / 2.0);
-							dy = bbox.y + bbox.height;
+							dx -= bbox.x + (bbox.width / 2.0);
+							dy -= bbox.y + bbox.height;
 							break;
 						}
-						g2.translate(-dx, -dy);
+						g2.translate(dx, dy);
 					}
 					break;
@@ -296,6 +287,50 @@
 				case TEXT:
 					Caption c = (Caption) item.params;
-					g2.setFont(c.style.font);
-					g2.drawString(c.str, c.x, c.y);
+					TextLayout layout = new TextLayout(c.str, c.font, g2.getFontRenderContext());
+					Rectangle2D bb = layout.getBounds();
+					dx = 0;
+					dy = 0;
+					if (c.dd != null) {
+						g2.transform(c.dd.t);
+						switch (c.dd.h) {
+						case CC:
+							dx -= bb.getX() + (bb.getWidth() / 2.0);
+							dy -= bb.getY() + (bb.getHeight() / 2.0);
+							break;
+						case TL:
+							dx -= bb.getX();
+							dy -= bb.getY();
+							break;
+						case TR:
+							dx -= bb.getX() + bb.getWidth();
+							dy -= bb.getY();
+							break;
+						case TC:
+							dx -= bb.getX() + (bb.getWidth() / 2.0);
+							dy -= bb.getY();
+							break;
+						case LC:
+							dx -= bb.getX();
+							dy -= bb.getY() + (bb.getHeight() / 2.0);
+							break;
+						case RC:
+							dx -= bb.getX() + bb.getWidth();
+							dy -= bb.getY() + (bb.getHeight() / 2.0);
+							break;
+						case BL:
+							dx -= bb.getX();
+							dy -= bb.getY() + bb.getHeight();
+							break;
+						case BR:
+							dx -= bb.getX() + bb.getWidth();
+							dy -= bb.getY() + bb.getHeight();
+							break;
+						case BC:
+							dx -= bb.getX() + (bb.getWidth() / 2.0);
+							dy -= bb.getY() + bb.getHeight();
+							break;
+						}
+					}
+					layout.draw(g2, (float)dx, (float)dy);
 					break;
 				}
