Index: applications/editors/josm/plugins/smed2/src/panels/ShowFrame.java
===================================================================
--- applications/editors/josm/plugins/smed2/src/panels/ShowFrame.java	(revision 29184)
+++ applications/editors/josm/plugins/smed2/src/panels/ShowFrame.java	(revision 29184)
@@ -0,0 +1,58 @@
+package panels;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+
+import javax.swing.JFrame;
+
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+
+import seamap.MapHelper;
+import seamap.Renderer;
+import seamap.SeaMap;
+import seamap.SeaMap.Coord;
+import seamap.SeaMap.Feature;
+
+public class ShowFrame extends JFrame implements MapHelper {
+	private static final long serialVersionUID = 1L;
+	
+	public SeaMap showMap;
+
+	public ShowFrame(String title) {
+		super(title);
+	}
+	
+	public void showFeature(OsmPrimitive osm, SeaMap map) {
+		long id;
+		Feature feature;
+		
+		id = osm.getUniqueId();
+		feature = map.index.get(id);
+		showMap = new SeaMap();
+		showMap.nodes = map.nodes;
+		showMap.ways = map.ways;
+		showMap.mpolys = map.mpolys;
+		showMap.index = map.index;
+		if (feature != null) {
+			showMap.features.put(feature.type, new ArrayList<Feature>());
+			showMap.features.get(feature.type).add(feature);
+		}
+		repaint();
+	}
+	
+	@Override
+	public Point2D getPoint(Coord coord) {
+		return new Point2D.Double(150, 150);
+	}
+	
+	public void paint(Graphics g) {
+		Graphics2D g2 = (Graphics2D)g;
+		g2.setBackground(new Color(0xb5d0d0));
+		g2.clearRect(0, 0, 300, 300);
+		Renderer.reRender(g2, 16, 32, showMap, this);
+	}
+
+}
Index: applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
===================================================================
--- applications/editors/josm/plugins/smed2/src/seamap/Renderer.java	(revision 29176)
+++ applications/editors/josm/plugins/smed2/src/seamap/Renderer.java	(revision 29184)
@@ -14,5 +14,4 @@
 import java.awt.geom.Point2D;
 import java.util.ArrayList;
-import java.util.EnumMap;
 import java.util.HashMap;
 
@@ -43,10 +42,10 @@
 			g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
 			g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
-			Rules.MainRules(map, zoom);
+			Rules.rules(map, zoom);
 		}
 	}
 	
-	public static EnumMap<Att, AttItem> getAtts(Feature feature, Obj obj, int idx) {
-		HashMap<Integer, EnumMap<Att, AttItem>> objs = feature.objs.get(obj);
+	public static AttMap getAtts(Feature feature, Obj obj, int idx) {
+		HashMap<Integer, AttMap> objs = feature.objs.get(obj);
 		if (objs == null) return null;
 		else return objs.get(idx);
@@ -54,5 +53,5 @@
 	
 	public static Object getAttVal(Feature feature, Obj obj, int idx, Att att) {
-		EnumMap<Att, AttItem> atts = getAtts(feature, obj, idx);
+		AttMap atts = getAtts(feature, obj, idx);
 		if (atts == null) return  S57val.nullVal(att);
 		else {
@@ -62,7 +61,37 @@
 		}
 	}
+
+	public static Coord findCentroid(Feature feature) {
+    double slon = 0.0;
+    double slat = 0.0;
+    double sarc = 0.0;
+    double llon = 0.0;
+    double llat = 0.0;
+		if (feature.flag == Fflag.NODE) {
+			return map.nodes.get(feature.refs);
+		}
+		ArrayList<Long> way = map.ways.get(feature.refs);
+		if (feature.flag == Fflag.WAY) {
+			llon = map.nodes.get(way.get(1)).lon;
+			llat = map.nodes.get(way.get(1)).lat;
+		} else {
+			llon = map.nodes.get(way.get(0)).lon;
+			llat = map.nodes.get(way.get(0)).lat;
+		}
+		for (long node : way) {
+      double lon = map.nodes.get(node).lon;
+      double lat = map.nodes.get(node).lat;
+      double arc = Math.sqrt(Math.pow((lon-llon), 2) + Math.pow((lat-llat), 2));
+      slon += (lon * arc);
+      slat += (lat * arc);
+      sarc += arc;
+      llon = lon;
+      llat = lat;
+		}
+		return map.new Coord((sarc > 0.0 ? slat/sarc : 0.0), (sarc > 0.0 ? slon/sarc : 0.0));
+	}
 	
 	public static void symbol(Feature feature, ArrayList<Instr> symbol, Obj obj) {
-		Point2D point = helper.getPoint(map.nodes.get(feature.refs));
+		Point2D point = helper.getPoint(findCentroid(feature));
 		ArrayList<ColCOL> colours = (ArrayList<ColCOL>) getAttVal(feature, obj, 0, Att.COLOUR);
 		ArrayList<ColPAT> pattern = (ArrayList<ColPAT>) getAttVal(feature, obj, 0, Att.COLPAT);
Index: applications/editors/josm/plugins/smed2/src/seamap/Rules.java
===================================================================
--- applications/editors/josm/plugins/smed2/src/seamap/Rules.java	(revision 29176)
+++ applications/editors/josm/plugins/smed2/src/seamap/Rules.java	(revision 29184)
@@ -28,5 +28,5 @@
 	static int zoom;
 	
-	public static void MainRules (SeaMap m, int z) {
+	public static void rules (SeaMap m, int z) {
 		map = m;
 		zoom = z;
@@ -123,4 +123,5 @@
 			ArrayList<Instr> fncSym = Landmarks.Funcs.get(fncs.get(0));
 			if ((fncs.get(0) == FncFNC.FNC_CHCH) && (cats.get(0) == CatLMK.LMK_TOWR)) catSym = Landmarks.ChurchTower;
+			if ((cats.get(0) == CatLMK.LMK_UNKN) && (fncs.get(0) == FncFNC.FNC_UNKN)) catSym = Beacons.LightMajor;
 			Renderer.symbol(feature, catSym, feature.type);
 			Renderer.symbol(feature, fncSym, feature.type);
Index: applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java
===================================================================
--- applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java	(revision 29176)
+++ applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java	(revision 29184)
@@ -15,5 +15,5 @@
 
 import s57.S57att;
-import s57.S57att.*;
+import s57.S57att.Att;
 import s57.S57obj;
 import s57.S57obj.*;
@@ -37,10 +37,59 @@
 	}
 
+	public class AttMap extends EnumMap<Att, AttItem> {
+		private static final long serialVersionUID = 1L;
+		public AttMap() {
+			super(Att.class);
+		}
+	}
+	
+	public class ObjTab extends HashMap<Integer, AttMap> {
+		private static final long serialVersionUID = 1L;
+		public ObjTab() {
+			super();
+		}
+	}
+	
+	public class ObjMap extends EnumMap<Obj, ObjTab> {
+		private static final long serialVersionUID = 1L;
+		public ObjMap() {
+			super(Obj.class);
+		}
+	}
+	
+	public class NodeTab extends HashMap<Long, Coord> {
+		private static final long serialVersionUID = 1L;
+		public NodeTab() {
+			super();
+		}
+	}
+	
+	public class WayTab extends HashMap<Long, ArrayList<Long>> {
+		private static final long serialVersionUID = 1L;
+		public WayTab() {
+			super();
+		}
+	}
+	
+	public class FtrMap extends EnumMap<Obj, ArrayList<Feature>> {
+		private static final long serialVersionUID = 1L;
+		public FtrMap() {
+			super(Obj.class);
+		}
+	}
+	
+	public class FtrTab extends HashMap<Long, Feature> {
+		private static final long serialVersionUID = 1L;
+		public FtrTab() {
+			super();
+		}
+	}
+	
 	public class Feature {
 		public Fflag flag;
 		public long refs;
 		public Obj type;
-		public EnumMap<Att, AttItem> atts;
-		public EnumMap<Obj, HashMap<Integer, EnumMap<Att, AttItem>>> objs;
+		public AttMap atts;
+		public ObjMap objs;
 
 		Feature() {
@@ -48,6 +97,6 @@
 			refs = 0;
 			type = Obj.UNKOBJ;
-			atts = new EnumMap<Att, AttItem>(Att.class);
-			objs = new EnumMap<Obj, HashMap<Integer, EnumMap<Att, AttItem>>>(Obj.class);
+			atts = new AttMap();
+			objs = new ObjMap();
 		}
 	}
@@ -57,5 +106,5 @@
 		public double lon;
 
-		Coord(double ilat, double ilon) {
+		public Coord(double ilat, double ilon) {
 			lat = ilat;
 			lon = ilon;
@@ -63,8 +112,9 @@
 	}
 
-	public HashMap<Long, Coord> nodes;
-	public HashMap<Long, ArrayList<Long>> ways;
-	public HashMap<Long, ArrayList<Long>> mpolys;
-	public EnumMap<Obj, ArrayList<Feature>> features;
+	public NodeTab nodes;
+	public WayTab ways;
+	public WayTab mpolys;
+	public FtrMap features;
+	public FtrTab index;
 
 	private Feature feature;
@@ -72,9 +122,10 @@
 
 	public SeaMap() {
-		nodes = new HashMap<Long, Coord>();
-		ways = new HashMap<Long, ArrayList<Long>>();
-		mpolys = new HashMap<Long, ArrayList<Long>>();
+		nodes = new NodeTab();
+		ways = new WayTab();
+		mpolys = new WayTab();
 		feature = new Feature();
-		features = new EnumMap<Obj, ArrayList<Feature>>(Obj.class);
+		features = new FtrMap();
+		index = new FtrTab();
 	}
 
@@ -84,4 +135,8 @@
 		feature.refs = id;
 		feature.flag = Fflag.NODE;
+	}
+
+	public void moveNode(long id, double lat, double lon) {
+		nodes.put(id, new Coord(lat, lon));
 	}
 
@@ -110,7 +165,8 @@
 	}
 
-	public void tagsDone() {
-		if (feature.type != Obj.UNKOBJ) {
-			if ((feature.flag == Fflag.WAY) && (list.size() > 0) && (list.get(0) == list.get(list.size() - 1))) {
+	public void tagsDone(long id) {
+		if ((feature.type != Obj.UNKOBJ) && !((feature.flag == Fflag.WAY) && (list.size() < 2))) {
+			index.put(id, feature);
+			if ((feature.flag == Fflag.WAY) && (list.size() > 0) && (list.get(0).equals(list.get(list.size() - 1)))) {
 				feature.flag = Fflag.AREA;
 			}
@@ -137,12 +193,12 @@
 					att = S57att.enumAttribute(subkeys[2], obj);
 				}
-				HashMap<Integer, EnumMap<Att, AttItem>> items = feature.objs.get(obj);
+				ObjTab items = feature.objs.get(obj);
 				if (items == null) {
-					items = new HashMap<Integer, EnumMap<Att, AttItem>>();
+					items = new ObjTab();
 					feature.objs.put(obj, items);
 				}
-				EnumMap<Att, AttItem> atts = items.get(idx);
+				AttMap atts = items.get(idx);
 				if (atts == null) {
-					atts = new EnumMap<Att, AttItem>(Att.class);
+					atts = new AttMap();
 					items.put(idx, atts);
 				}
Index: applications/editors/josm/plugins/smed2/src/smed2/MapImage.java
===================================================================
--- applications/editors/josm/plugins/smed2/src/smed2/MapImage.java	(revision 29176)
+++ applications/editors/josm/plugins/smed2/src/smed2/MapImage.java	(revision 29184)
@@ -2,5 +2,7 @@
 
 import java.awt.Color;
+import java.awt.Font;
 import java.awt.Graphics2D;
+import java.awt.Rectangle;
 import java.awt.geom.Point2D;
 
@@ -18,10 +20,9 @@
 import seamap.MapHelper;
 import seamap.Renderer;
-import seamap.SeaMap;
 import seamap.SeaMap.Coord;
 
 public class MapImage extends ImageryLayer implements ZoomChangeListener, MapHelper {
 
-	private SeaMap mapdata;
+	private Smed2Action dlg;
 
 	double top;
@@ -33,9 +34,9 @@
 	int zoom;
 	
-	public MapImage(ImageryInfo info, SeaMap map) {
+	public MapImage(ImageryInfo info, Smed2Action d) {
 		super(info);
+		dlg = d;
+		MapView.addZoomChangeListener(this);
 		zoomChanged();
-		MapView.addZoomChangeListener(this);
-		mapdata = map;
 	}
 	
@@ -62,7 +63,11 @@
 	@Override
 	public void paint(Graphics2D g2, MapView mv, Bounds bb) {
-		g2.setPaint(new Color(0xb5d0d0));
-		g2.fill(Main.map.mapView.getBounds());
-		Renderer.reRender(g2, zoom, Math.pow(2, (zoom-12)), mapdata, this);
+		Rectangle rect = Main.map.mapView.getBounds();
+		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));
+		g2.drawString(("Z" + zoom), (rect.x + rect.width - 40), (rect.y + rect.height - 10));
+		Renderer.reRender(g2, zoom, Math.pow(2, (zoom-12)), dlg.map, this);
 	}
 
Index: applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
===================================================================
--- applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java	(revision 29176)
+++ applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java	(revision 29184)
@@ -23,4 +23,5 @@
 
 import panels.PanelMain;
+import panels.ShowFrame;
 
 public class Smed2Action extends JosmAction implements EditLayerChangeListener, SelectionChangedListener {
@@ -28,5 +29,6 @@
 	private static final long serialVersionUID = 1L;
 	private static String editor = tr("SeaMap Editor");
-	public static JFrame frame = null;
+	public static JFrame editFrame = null;
+	public static ShowFrame showFrame = null;
 	public static S57dat panelS57;
 	private boolean isOpen = false;
@@ -45,5 +47,8 @@
 		@Override
 		public void nodeMoved(NodeMovedEvent e) {
-			// reMap();
+			if (map != null) {
+				Node node = e.getNode();
+				map.moveNode(node.getUniqueId(), node.getCoor().lat(), node.getCoor().lon());
+			}
 		}
 
@@ -81,6 +86,4 @@
 	public Smed2Action() {
 		super(editor, "Smed2", editor, null, true);
-		MapView.addEditLayerChangeListener(this);
-		DataSet.addSelectionListener(this);
 	}
 
@@ -92,5 +95,5 @@
 					createFrame();
 				else
-					frame.toFront();
+					editFrame.toFront();
 				isOpen = true;
 			}
@@ -99,28 +102,37 @@
 
 	protected void createFrame() {
-		frame = new JFrame(editor);
-		frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
-		frame.setResizable(true);
-		frame.setAlwaysOnTop(false);
-
-		frame.addWindowListener(new java.awt.event.WindowAdapter() {
+		editFrame = new JFrame(editor);
+		editFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+		editFrame.addWindowListener(new java.awt.event.WindowAdapter() {
 			public void windowClosing(java.awt.event.WindowEvent e) {
 				closeDialog();
 			}
 		});
-		frame.setSize(new Dimension(480, 480));
-		frame.setLocation(100, 200);
-		frame.setAlwaysOnTop(true);
-		frame.setVisible(true);
+		editFrame.setSize(new Dimension(480, 480));
+		editFrame.setLocation(100, 200);
+		editFrame.setResizable(true);
+		editFrame.setAlwaysOnTop(true);
+		editFrame.setVisible(true);
 		panelMain = new PanelMain();
-		frame.add(panelMain);
+		editFrame.add(panelMain);
 		panelS57 = new S57dat();
 		panelS57.setVisible(false);
-		frame.add(panelS57);
+		editFrame.add(panelS57);
+
+		showFrame = new ShowFrame("Seamark Inspector");
+		showFrame.setSize(new Dimension(300, 300));
+		Rectangle rect = Main.map.mapView.getBounds();
+		showFrame.setLocation(50, (rect.y + rect.height - 200));
+		showFrame.setResizable(false);
+		showFrame.setAlwaysOnTop(true);
+		showFrame.setVisible(false);
+
 		// System.out.println("hello");
-		rendering = new MapImage(new ImageryInfo("OpenSeaMap"), map);
+		rendering = new MapImage(new ImageryInfo("OpenSeaMap"), this);
 		rendering.setBackgroundLayer(true);
 		Main.main.addLayer(rendering);
-		reMap();
+		MapView.addEditLayerChangeListener(this);
+		DataSet.addSelectionListener(this);
+		editLayerChanged(Main.main.getEditLayer(), Main.main.getEditLayer());
 	}
 
@@ -129,8 +141,8 @@
 			Main.main.removeLayer(rendering);
 			MapView.removeEditLayerChangeListener(this);
-			frame.setVisible(false);
-			frame.dispose();
-//			data = null;
-//			map = null;
+			editFrame.setVisible(false);
+			editFrame.dispose();
+			data = null;
+			map = null;
 		}
 		isOpen = false;
@@ -145,5 +157,6 @@
 			newLayer.data.addDataSetListener(dataSetListener);
 			data = newLayer.data.allPrimitives();
-			reMap();
+			makeMap();
+			if (rendering != null) rendering.zoomChanged();
 		} else {
 			data = null;
@@ -153,10 +166,29 @@
 
 	@Override
-	public void selectionChanged(Collection<? extends OsmPrimitive> arg0) {
-		// TODO Auto-generated method stub
-
-	}
-
-	void reMap() {
+	public void selectionChanged(Collection<? extends OsmPrimitive> selection) {
+		Node nextNode = null;
+		Node node = null;
+
+		if (selection.size() == 0) showFrame.setVisible(false);
+		for (OsmPrimitive osm : selection) {
+			if (osm instanceof Node) {
+				nextNode = (Node) osm;
+				if (selection.size() == 1) {
+					if (nextNode.compareTo(node) != 0) {
+						node = nextNode;
+						showFrame.setVisible(true);
+						showFrame.showFeature(node, map);
+					}
+				} else {
+					showFrame.setVisible(false);
+				}
+			}
+		}
+		if (nextNode == null) {
+			node = null;
+		}
+	}
+
+	void makeMap() {
 		map = new SeaMap();
 		if (data != null) {
@@ -174,5 +206,5 @@
 						map.addTag(entry.getKey(), entry.getValue());
 					}
-					map.tagsDone();
+					map.tagsDone(osm.getUniqueId());
 				} else if ((osm instanceof Relation) && ((Relation) osm).isMultipolygon()) {
 					map.addMpoly(((Relation) osm).getUniqueId());
