Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java	(revision 24931)
@@ -1,5 +1,3 @@
 package oseam.dialogs;
-
-import static org.openstreetmap.josm.tools.I18n.tr;
 
 import oseam.panels.*;
@@ -7,6 +5,4 @@
 import java.awt.Dimension;
 import java.util.Collection;
-import java.util.Iterator;
-import java.util.Map;
 
 import javax.swing.JPanel;
@@ -20,10 +16,10 @@
 import oseam.Messages;
 import oseam.seamarks.SeaMark;
-import oseam.seamarks.SeaMark.Obj;
 import smed.plug.ifc.SmedPluginManager;
 
 public class OSeaMAction {
 
-	private SmedPluginManager manager;
+	private OSeaMAction dlg = null;
+	public SmedPluginManager manager = null;;
 	public PanelMain panelMain = null;
 
@@ -44,5 +40,5 @@
 						if (nextNode.compareTo(node) != 0) {
 							node = nextNode;
-							parseNode();
+							mark = new SeaMark(dlg);
 						}
 					} else
@@ -61,6 +57,7 @@
 	public OSeaMAction(SmedPluginManager mngr) {
 
+		dlg = this;
+		manager = mngr;
 		DataSet.addSelectionListener(SmpListener);
-		manager = mngr;
 		String str = Main.pref.get("mappaint.style.sources");
 		if (!str.contains("dev.openseamap.org")) {
@@ -82,93 +79,4 @@
 		return panelMain;
 	}
-
-	private void parseNode() {
-
-		Map<String, String> keys;
-
-		manager.showVisualMessage("");
-		String type = "";
-		String str = "";
-
-		mark = new SeaMark(this);
-		keys = node.getKeys();
-
-		if (keys.containsKey("seamark:type"))
-			type = keys.get("seamark:type");
-
-		Iterator<Obj> it = mark.objects.keySet().iterator();
-		while (it.hasNext()) {
-			Obj obj = it.next();
-			if (mark.objects.get(obj).equals(type)) {
-				mark.setObject(obj);
-			}
-		}
-
-		if (type.equals("light_float")) {
-			if (keys.containsKey("seamark:light_float:colour")) {
-				str = keys.get("seamark:light_float:colour");
-				if (str.equals("red") || str.equals("green") || str.equals("red;green;red") || str.equals("green;red;green")) {
-					mark.setObject(Obj.BOYLAT);
-				} else if (str.equals("black;yellow") || str.equals("black;yellow;black") || str.equals("yellow;black")
-						|| str.equals("yellow;black;yellow")) {
-					mark.setObject(Obj.BOYCAR);
-				} else if (str.equals("black;red;black")) {
-					mark.setObject(Obj.BOYISD);
-				} else if (str.equals("red;white")) {
-					mark.setObject(Obj.BOYSAW);
-				} else if (str.equals("yellow")) {
-					mark.setObject(Obj.BOYSPP);
-				}
-			} else if (keys.containsKey("seamark:light_float:topmark:shape")) {
-				str = keys.get("seamark:light_float:topmark:shape");
-				if (str.equals("cylinder") || str.equals("cone, point up")) {
-					mark.setObject(Obj.BOYLAT);
-				}
-			} else if (keys.containsKey("seamark:light_float:topmark:colour")) {
-				str = keys.get("seamark:light_float:topmark:colour");
-				if (str.equals("red") || str.equals("green")) {
-					mark.setObject(Obj.BOYLAT);
-				}
-			}
-		} else if (keys.containsKey("buoy_lateral:category") || keys.containsKey("buoy_lateral:shape") || keys.containsKey("buoy_lateral:colour")) {
-			mark.setObject(Obj.BOYLAT);
-		} else if (keys.containsKey("beacon_lateral:category") || keys.containsKey("beacon_lateral:shape") || keys.containsKey("beacon_lateral:colour")) {
-			mark.setObject(Obj.BCNLAT);
-		} else if (keys.containsKey("buoy_cardinal:category") || keys.containsKey("buoy_cardinal:shape") || keys.containsKey("buoy_cardinal:colour")) {
-			mark.setObject(Obj.BOYCAR);
-		} else if (keys.containsKey("beacon_cardinal:category") || keys.containsKey("beacon_cardinal:shape") || keys.containsKey("beacon_cardinal:colour")) {
-			mark.setObject(Obj.BCNCAR);
-		} else if (keys.containsKey("buoy_isolated_danger:category") || keys.containsKey("buoy_isolated_danger:shape") || keys.containsKey("buoy_isolated_danger:colour")) {
-			mark.setObject(Obj.BOYISD);
-		} else if (keys.containsKey("beacon_isolated_danger:category") || keys.containsKey("beacon_isolated_danger:shape") || keys.containsKey("beacon_isolated_danger:colour")) {
-			mark.setObject(Obj.BCNISD);
-		} else if (keys.containsKey("buoy_safe_water:category") || keys.containsKey("buoy_safe_water:shape") || keys.containsKey("buoy_safe_water:colour")) {
-			mark.setObject(Obj.BOYSAW);
-		} else if (keys.containsKey("beacon_safe_water:category") || keys.containsKey("beacon_safe_water:shape") || keys.containsKey("beacon_safe_water:colour")) {
-			mark.setObject(Obj.BCNSAW);
-		} else if (keys.containsKey("buoy_special_purpose:category") || keys.containsKey("buoy_special_purpose:shape") || keys.containsKey("buoy_special_purpose:colour")) {
-			mark.setObject(Obj.BOYSPP);
-		} else if (keys.containsKey("beacon_special_purpose:category") || keys.containsKey("beacon_special_purpose:shape") || keys.containsKey("beacon_special_purpose:colour")) {
-			mark.setObject(Obj.BCNSPP);
-		}
-
-		if (mark.getObject() == Obj.UNKNOWN) {
-			manager.showVisualMessage(Messages.getString("NoMark"));
-			panelMain.clearSelections();
-		} else {
-			if (keys.containsKey("seamark:" + type + ":name")) {
-				panelMain.nameBox.setText(keys.get("seamark:" + type + ":name"));
-				panelMain.nameBox.postActionEvent();
-			} else if (keys.containsKey("seamark:name")) {
-				panelMain.nameBox.setText(keys.get("seamark:name"));
-				panelMain.nameBox.postActionEvent();
-			} else if (keys.containsKey("name")) {
-				panelMain.nameBox.setText(keys.get("name"));
-				panelMain.nameBox.postActionEvent();
-			} else
-				panelMain.nameBox.setText("");
-			mark.parseMark();
-			mark.paintSign();
-		}
-	}
+	
 }
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java	(revision 24931)
@@ -42,11 +42,8 @@
 				shp = dlg.mark.getShape();
 			if (portButton.isSelected() || prefPortButton.isSelected()) {
-//				if (!(dlg.mark instanceof MarkLat)) {
-//					dlg.mark = new MarkLat(dlg);
-					dlg.panelMain.topButton.setEnabled(true);
-					dlg.panelMain.fogButton.setEnabled(true);
-					dlg.panelMain.radButton.setEnabled(true);
-					dlg.panelMain.litButton.setEnabled(true);
-//				}
+				dlg.panelMain.topButton.setEnabled(true);
+				dlg.panelMain.fogButton.setEnabled(true);
+				dlg.panelMain.radButton.setEnabled(true);
+				dlg.panelMain.litButton.setEnabled(true);
 				dlg.panelMain.panelTop.enableAll(false);
 				dlg.panelMain.panelTop.noTopButton.setEnabled(true);
@@ -107,11 +104,8 @@
 			}
 			if (stbdButton.isSelected() || prefStbdButton.isSelected()) {
-//				if (!(dlg.mark instanceof MarkLat)) {
-//					dlg.mark = new MarkLat(dlg);
-					dlg.panelMain.topButton.setEnabled(true);
-					dlg.panelMain.fogButton.setEnabled(true);
-					dlg.panelMain.radButton.setEnabled(true);
-					dlg.panelMain.litButton.setEnabled(true);
-//				}
+				dlg.panelMain.topButton.setEnabled(true);
+				dlg.panelMain.fogButton.setEnabled(true);
+				dlg.panelMain.radButton.setEnabled(true);
+				dlg.panelMain.litButton.setEnabled(true);
 				dlg.panelMain.panelTop.enableAll(false);
 				dlg.panelMain.panelTop.noTopButton.setEnabled(true);
@@ -172,19 +166,16 @@
 			}
 			if (safeWaterButton.isSelected()) {
-//				if (!(dlg.mark instanceof MarkSaw)) {
-//					dlg.mark = new MarkSaw(dlg);
-					if (panelSaw.shapes.containsKey(shp)) {
-						panelSaw.shapes.get(shp).doClick();
-					} else {
-						panelSaw.clearSelections();
-						dlg.mark.setShape(Shp.UNKNOWN);
-					}
-					dlg.panelMain.panelTop.enableAll(false);
-					dlg.panelMain.panelTop.noTopButton.setEnabled(true);
-					dlg.panelMain.panelTop.sphereTopButton.setEnabled(true);
-					dlg.panelMain.panelTop.panelCol.enableAll(false);
-					dlg.panelMain.panelTop.panelCol.redButton.setEnabled(true);
-					dlg.panelMain.panelTop.panelCol.redButton.doClick();
-//				}
+				if (panelSaw.shapes.containsKey(shp)) {
+					panelSaw.shapes.get(shp).doClick();
+				} else {
+					panelSaw.clearSelections();
+					dlg.mark.setShape(Shp.UNKNOWN);
+				}
+				dlg.panelMain.panelTop.enableAll(false);
+				dlg.panelMain.panelTop.noTopButton.setEnabled(true);
+				dlg.panelMain.panelTop.sphereTopButton.setEnabled(true);
+				dlg.panelMain.panelTop.panelCol.enableAll(false);
+				dlg.panelMain.panelTop.panelCol.redButton.setEnabled(true);
+				dlg.panelMain.panelTop.panelCol.redButton.doClick();
 				dlg.mark.setColour(Ent.BODY, Col.RED_WHITE);
 				safeWaterButton.setBorderPainted(true);
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java	(revision 24931)
@@ -14,5 +14,4 @@
 
 import java.util.EnumMap;
-import java.util.Iterator;
 
 import oseam.dialogs.OSeaMAction;
@@ -38,7 +37,5 @@
 	private ActionListener alColour = new ActionListener() {
 		public void actionPerformed(java.awt.event.ActionEvent e) {
-			Iterator<Col> it = colours.keySet().iterator();
-			while (it.hasNext()) {
-				Col col = it.next();
+			for (Col col : colours.keySet()) {
 				JRadioButton button = colours.get(col);
 				if (button.isSelected()) {
@@ -73,7 +70,6 @@
 
 	public void enableAll(boolean state) {
-		Iterator<Col> it = colours.keySet().iterator();
-		while (it.hasNext()) {
-			colours.get(it.next()).setEnabled(state);
+		for (JRadioButton button : colours.values()) {
+			button.setEnabled(state);
 		}
 	}
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java	(revision 24931)
@@ -12,5 +12,4 @@
 
 import java.util.EnumMap;
-import java.util.Iterator;
 
 import oseam.Messages;
@@ -111,7 +110,5 @@
 	private ActionListener alShape = new ActionListener() {
 		public void actionPerformed(java.awt.event.ActionEvent e) {
-			Iterator<Shp> it = shapes.keySet().iterator();
-			while (it.hasNext()) {
-				Shp shp = it.next();
+			for (Shp shp : shapes.keySet()) {
 				JRadioButton button = shapes.get(shp);
 				if (button.isSelected()) {
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java	(revision 24931)
@@ -12,5 +12,4 @@
 
 import java.util.EnumMap;
-import java.util.Iterator;
 
 import oseam.Messages;
@@ -23,16 +22,14 @@
 	private OSeaMAction dlg;
 	private ButtonGroup catButtons = new ButtonGroup();
-	private JRadioButton houseButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LighthouseButton.png")));
-	private JRadioButton majorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMajorButton.png")));
-	private JRadioButton minorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMinorButton.png")));
-	private JRadioButton vesselButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightVesselButton.png")));
-	private JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightFloatButton.png")));
+	public JRadioButton houseButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LighthouseButton.png")));
+	public JRadioButton majorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMajorButton.png")));
+	public JRadioButton minorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMinorButton.png")));
+	public JRadioButton vesselButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightVesselButton.png")));
+	public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightFloatButton.png")));
 	private EnumMap<Cat, JRadioButton> categories = new EnumMap<Cat, JRadioButton>(Cat.class);
 	private EnumMap<Cat, Obj> objects = new EnumMap<Cat, Obj>(Cat.class);
 	private ActionListener alCat = new ActionListener() {
 		public void actionPerformed(java.awt.event.ActionEvent e) {
-			Iterator<Cat> it = categories.keySet().iterator();
-			while (it.hasNext()) {
-				Cat cat = it.next();
+			for (Cat cat : categories.keySet()) {
 				JRadioButton button = categories.get(cat);
 				if (button.isSelected()) {
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java	(revision 24931)
@@ -5,5 +5,4 @@
 import java.awt.Rectangle;
 
-import oseam.Messages;
 import oseam.dialogs.OSeaMAction;
 import oseam.seamarks.SeaMark.Ent;
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java	(revision 24931)
@@ -119,8 +119,4 @@
 				}
 				if (chanButton.isSelected()) {
-//					if (!((dlg.mark instanceof MarkLat) || (dlg.mark instanceof MarkSaw))) {
-//						dlg.mark = null;
-//						clearType();
-//					}
 					chanButton.setBorderPainted(true);
 					panelChan.setVisible(true);
@@ -131,8 +127,4 @@
 				}
 				if (hazButton.isSelected()) {
-//					if (!((dlg.mark instanceof MarkCard) || (dlg.mark instanceof MarkIsol))) {
-//						dlg.mark = null;
-//						clearType();
-//					}
 					hazButton.setBorderPainted(true);
 					panelHaz.setVisible(true);
@@ -143,17 +135,13 @@
 				}
 				if (specButton.isSelected()) {
-//					if (!(dlg.mark instanceof MarkSpec)) {
-//						dlg.mark = new MarkSpec(dlg);
-//						clearType();
-						dlg.panelMain.panelSpec.panelCol.yellowButton.doClick();
-						dlg.panelMain.panelTop.enableAll(true);
-						dlg.panelMain.panelTop.noTopButton.doClick();
-						dlg.panelMain.panelTop.panelCol.enableAll(true);
-						dlg.panelMain.panelTop.panelCol.yellowButton.doClick();
-						topButton.setEnabled(true);
-						fogButton.setEnabled(true);
-						radButton.setEnabled(true);
-						litButton.setEnabled(true);
-//					}
+					dlg.panelMain.panelSpec.panelCol.yellowButton.doClick();
+					dlg.panelMain.panelTop.enableAll(true);
+					dlg.panelMain.panelTop.noTopButton.doClick();
+					dlg.panelMain.panelTop.panelCol.enableAll(true);
+					dlg.panelMain.panelTop.panelCol.yellowButton.doClick();
+					topButton.setEnabled(true);
+					fogButton.setEnabled(true);
+					radButton.setEnabled(true);
+					litButton.setEnabled(true);
 					specButton.setBorderPainted(true);
 					panelSpec.setVisible(true);
@@ -164,12 +152,8 @@
 				}
 				if (lightsButton.isSelected()) {
-//					if (!(dlg.mark instanceof MarkLight)) {
-//						dlg.mark = new MarkLight(dlg);
-//						clearType();
-						fogButton.setEnabled(true);
-						radButton.setEnabled(true);
-						litButton.setEnabled(true);
-						litButton.doClick();
-//					}
+					fogButton.setEnabled(true);
+					radButton.setEnabled(true);
+					litButton.setEnabled(true);
+					litButton.doClick();
 					lightsButton.setBorderPainted(true);
 					panelLights.setVisible(true);
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java	(revision 24931)
@@ -12,5 +12,4 @@
 
 import java.util.EnumMap;
-import java.util.Iterator;
 
 import oseam.Messages;
@@ -44,7 +43,5 @@
 	private ActionListener alShape = new ActionListener() {
 		public void actionPerformed(java.awt.event.ActionEvent e) {
-			Iterator<Shp> it = shapes.keySet().iterator();
-			while (it.hasNext()) {
-				Shp shp = it.next();
+			for (Shp shp : shapes.keySet()) {
 				JRadioButton button = shapes.get(shp);
 				if (button.isSelected()) {
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java	(revision 24931)
@@ -3,22 +3,5 @@
 import javax.swing.JPanel;
 
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Rectangle;
-import java.awt.Font;
-
-import javax.swing.ButtonGroup;
-import javax.swing.ImageIcon;
-import javax.swing.JLabel;
-import javax.swing.JTextField;
-import javax.swing.JComboBox;
-import javax.swing.JCheckBox;
-import javax.swing.JRadioButton;
-
-import oseam.Messages;
 import oseam.dialogs.OSeaMAction;
-
-import java.awt.Cursor;
-import java.awt.event.ActionListener;
 
 public class PanelRadar extends JPanel {
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java	(revision 24931)
@@ -12,5 +12,4 @@
 
 import java.util.EnumMap;
-import java.util.Iterator;
 
 import oseam.Messages;
@@ -32,7 +31,5 @@
 	private ActionListener alShape = new ActionListener() {
 		public void actionPerformed(java.awt.event.ActionEvent e) {
-			Iterator<Shp> it = shapes.keySet().iterator();
-			while (it.hasNext()) {
-				Shp shp = it.next();
+			for (Shp shp : shapes.keySet()) {
 				JRadioButton button = shapes.get(shp);
 				if (button.isSelected()) {
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java	(revision 24931)
@@ -12,5 +12,4 @@
 
 import java.util.EnumMap;
-import java.util.Iterator;
 
 import oseam.Messages;
@@ -39,7 +38,5 @@
 	private ActionListener alShape = new ActionListener() {
 		public void actionPerformed(java.awt.event.ActionEvent e) {
-			Iterator<Shp> it = shapes.keySet().iterator();
-			while (it.hasNext()) {
-				Shp shp = it.next();
+			for (Shp shp : shapes.keySet()) {
 				JRadioButton button = shapes.get(shp);
 				if (button.isSelected()) {
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java	(revision 24931)
@@ -12,5 +12,4 @@
 
 import java.util.EnumMap;
-import java.util.Iterator;
 
 import oseam.Messages;
@@ -44,7 +43,5 @@
 	private ActionListener alShape = new ActionListener() {
 		public void actionPerformed(java.awt.event.ActionEvent e) {
-			Iterator<Shp> it = shapes.keySet().iterator();
-			while (it.hasNext()) {
-				Shp shp = it.next();
+			for (Shp shp : shapes.keySet()) {
 				JRadioButton button = shapes.get(shp);
 				if (button.isSelected()) {
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java	(revision 24931)
@@ -11,9 +11,7 @@
 import java.awt.event.ActionListener;
 import java.util.EnumMap;
-import java.util.Iterator;
 
 import oseam.Messages;
 import oseam.dialogs.OSeaMAction;
-import oseam.seamarks.SeaMark.Col;
 import oseam.seamarks.SeaMark.Top;
 import oseam.seamarks.SeaMark.Day;
@@ -46,7 +44,5 @@
 	private ActionListener alTop = new ActionListener() {
 		public void actionPerformed(java.awt.event.ActionEvent e) {
-			Iterator<Top> it = tops.keySet().iterator();
-			while (it.hasNext()) {
-				Top top = it.next();
+			for (Top top : tops.keySet()) {
 				JRadioButton button = tops.get(top);
 				if (button.isSelected()) {
@@ -57,7 +53,5 @@
 					button.setBorderPainted(false);
 			}
-			Iterator<Day> id = days.keySet().iterator();
-			while (id.hasNext()) {
-				Day day = id.next();
+			for (Day day : days.keySet()) {
 				JRadioButton button = days.get(day);
 				if (button.isSelected()) {
@@ -104,7 +98,6 @@
 
 	public void enableAll(boolean state) {
-		Iterator<Top> it = tops.keySet().iterator();
-		while (it.hasNext()) {
-			tops.get(it.next()).setEnabled(state);
+	for (JRadioButton button : tops.values()) {
+			button.setEnabled(state);
 		}
 	}
Index: applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
===================================================================
--- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java	(revision 24925)
+++ applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java	(revision 24931)
@@ -2,8 +2,6 @@
 
 import javax.swing.ImageIcon;
-import javax.swing.JRadioButton;
 
 import java.util.EnumMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.regex.Matcher;
@@ -13,4 +11,5 @@
 import org.openstreetmap.josm.command.ChangePropertyCommand;
 
+import oseam.Messages;
 import oseam.dialogs.OSeaMAction;
 
@@ -26,4 +25,5 @@
 		dlg = dia;
 		region = Main.pref.get("tomsplugin.IALA").equals("A") ? Reg.A : Reg.B;
+		parseNode();
 	}
 
@@ -113,5 +113,5 @@
 		groups.put(Obj.MORFAC, Grp.SPP);
 	}
-	
+
 	public enum Cat {
 		UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT, MOORING_BUOY
@@ -576,9 +576,190 @@
 	}
 
-	public void parseMark() {
-
-		String str;
-		Map<String, String> keys;
-		keys = dlg.node.getKeys();
+	public void parseNode() {
+
+		dlg.panelMain.clearSelections();
+		dlg.manager.showVisualMessage("");
+		String type = "";
+		String str = "";
+		String col = "";
+
+		Map<String, String> keys = dlg.node.getKeys();
+
+		if (keys.containsKey("seamark:type"))
+			type = keys.get("seamark:type");
+
+		for (Obj obj : objects.keySet()) {
+			if (objects.get(obj).equals(type))
+				setObject(obj);
+		}
+
+		if (type.equals("light_float") || type.equals("") || keys.containsKey("seamark:light_float:colour")
+				|| keys.containsKey("seamark:light_float:colour_pattern")) {
+			if (keys.containsKey("seamark:light_float:colour_pattern")) {
+				setObject(Obj.LITFLT);
+				type = "light_float";
+			}
+			if (keys.containsKey("seamark:light_float:colour")) {
+				col = keys.get("seamark:light_float:colour");
+				if (col.equals("red") || col.equals("green") || col.equals("red;green;red") || col.equals("green;red;green")) {
+					setObject(Obj.BOYLAT);
+				} else if (col.equals("black;yellow") || col.equals("black;yellow;black") || col.equals("yellow;black")
+						|| col.equals("yellow;black;yellow")) {
+					setObject(Obj.BOYCAR);
+				} else if (col.equals("black;red;black")) {
+					setObject(Obj.BOYISD);
+				} else if (col.equals("red;white")) {
+					setObject(Obj.BOYSAW);
+				} else if (col.equals("yellow")) {
+					setObject(Obj.BOYSPP);
+				} else
+					setObject(Obj.LITFLT);
+				type = "light_float";
+			}
+			if (type.equals("")) {
+				if (keys.containsKey("seamark:buoy_lateral:category") || keys.containsKey("seamark:buoy_lateral:shape")
+						|| keys.containsKey("seamark:buoy_lateral:colour")) {
+					setObject(Obj.BOYLAT);
+				} else if (keys.containsKey("seamark:beacon_lateral:category") || keys.containsKey("seamark:beacon_lateral:shape")
+						|| keys.containsKey("seamark:beacon_lateral:colour")) {
+					setObject(Obj.BCNLAT);
+				} else if (keys.containsKey("seamark:buoy_cardinal:category") || keys.containsKey("seamark:buoy_cardinal:shape")
+						|| keys.containsKey("seamark:buoy_cardinal:colour")) {
+					setObject(Obj.BOYCAR);
+				} else if (keys.containsKey("seamark:beacon_cardinal:category") || keys.containsKey("seamark:beacon_cardinal:shape")
+						|| keys.containsKey("seamark:beacon_cardinal:colour")) {
+					setObject(Obj.BCNCAR);
+				} else if (keys.containsKey("seamark:buoy_isolated_danger:category") || keys.containsKey("seamark:buoy_isolated_danger:shape")
+						|| keys.containsKey("seamark:buoy_isolated_danger:colour")) {
+					setObject(Obj.BOYISD);
+				} else if (keys.containsKey("seamark:beacon_isolated_danger:category") || keys.containsKey("seamark:beacon_isolated_danger:shape")
+						|| keys.containsKey("seamark:beacon_isolated_danger:colour")) {
+					setObject(Obj.BCNISD);
+				} else if (keys.containsKey("seamark:buoy_safe_water:category") || keys.containsKey("seamark:buoy_safe_water:shape")
+						|| keys.containsKey("seamark:buoy_safe_water:colour")) {
+					setObject(Obj.BOYSAW);
+				} else if (keys.containsKey("seamark:beacon_safe_water:category") || keys.containsKey("seamark:beacon_safe_water:shape")
+						|| keys.containsKey("seamark:beacon_safe_water:colour")) {
+					setObject(Obj.BCNSAW);
+				} else if (keys.containsKey("seamark:buoy_special_purpose:category") || keys.containsKey("seamark:buoy_special_purpose:shape")
+						|| keys.containsKey("seamark:buoy_special_purpose:colour")) {
+					setObject(Obj.BOYSPP);
+				} else if (keys.containsKey("seamark:beacon_special_purpose:category") || keys.containsKey("seamark:beacon_special_purpose:shape")
+						|| keys.containsKey("seamark:beacon_special_purpose:colour")) {
+					setObject(Obj.BCNSPP);
+				}
+			}
+		}
+
+		if (getObject() == Obj.UNKNOWN) {
+			dlg.manager.showVisualMessage(Messages.getString("NoMark"));
+			return;
+		}
+
+		if (keys.containsKey("seamark:" + type + ":name")) {
+			dlg.panelMain.nameBox.setText(keys.get("seamark:" + type + ":name"));
+			dlg.panelMain.nameBox.postActionEvent();
+		} else if (keys.containsKey("seamark:name")) {
+			dlg.panelMain.nameBox.setText(keys.get("seamark:name"));
+			dlg.panelMain.nameBox.postActionEvent();
+		} else if (keys.containsKey("name")) {
+			dlg.panelMain.nameBox.setText(keys.get("name"));
+			dlg.panelMain.nameBox.postActionEvent();
+		} else
+			dlg.panelMain.nameBox.setText("");
+
+		switch (groups.get(getObject())) {
+		case LAT:
+			dlg.panelMain.chanButton.doClick();
+			switch (getObject()) {
+			case BCNLAT:
+				if (keys.containsKey("seamark:beacon_lateral:category"))
+					str = keys.get("seamark:beacon_lateral:category");
+				break;
+			case BOYLAT:
+				if (keys.containsKey("seamark:buoy_lateral:category"))
+					str = keys.get("seamark:buoy_lateral:category");
+				else if (type.equals("light_float")) {
+					if (region == Reg.A) {
+						if (col.equals("red"))
+							dlg.panelMain.panelChan.portButton.doClick();
+						else if (col.equals("green"))
+							dlg.panelMain.panelChan.stbdButton.doClick();
+						else if (col.equals("red;green;red"))
+							dlg.panelMain.panelChan.prefPortButton.doClick();
+						else if (col.equals("green;red;green"))
+							dlg.panelMain.panelChan.prefStbdButton.doClick();
+					} else {
+						if (col.equals("green"))
+							dlg.panelMain.panelChan.portButton.doClick();
+						else if (col.equals("red"))
+							dlg.panelMain.panelChan.stbdButton.doClick();
+						else if (col.equals("green;red;green"))
+							dlg.panelMain.panelChan.prefPortButton.doClick();
+						else if (col.equals("red;green;red"))
+							dlg.panelMain.panelChan.prefStbdButton.doClick();
+					}
+				}
+				break;
+			}
+			if (str.equals("port"))
+				dlg.panelMain.panelChan.portButton.doClick();
+			else if (str.equals("starboard"))
+				dlg.panelMain.panelChan.stbdButton.doClick();
+			else if (str.equals("preferred_channel_port"))
+				dlg.panelMain.panelChan.prefPortButton.doClick();
+			else if (str.equals("preferred_channel_starboard"))
+				dlg.panelMain.panelChan.prefStbdButton.doClick();
+			break;
+		case CAR:
+			dlg.panelMain.hazButton.doClick();
+			switch (getObject()) {
+			case BCNCAR:
+				if (keys.containsKey("seamark:beacon_cardinal:category"))
+					str = keys.get("seamark:beacon_cardinal:category");
+				break;
+			case BOYCAR:
+				if (keys.containsKey("seamark:buoy_cardinal:category"))
+					str = keys.get("seamark:buoy_cardinal:category");
+				else if (type.equals("light_float")) {
+					if (col.equals("black;yellow"))
+						dlg.panelMain.panelHaz.northButton.doClick();
+					else if (col.equals("yellow;black"))
+						dlg.panelMain.panelHaz.southButton.doClick();
+					else if (col.equals("black;yellow;black"))
+						dlg.panelMain.panelHaz.eastButton.doClick();
+					else if (col.equals("yellow;black;yellow"))
+						dlg.panelMain.panelHaz.westButton.doClick();
+				}
+				break;
+			}
+			if (str.equals("north"))
+				dlg.panelMain.panelHaz.northButton.doClick();
+			else if (str.equals("south"))
+				dlg.panelMain.panelHaz.southButton.doClick();
+			else if (str.equals("east"))
+				dlg.panelMain.panelHaz.eastButton.doClick();
+			else if (str.equals("west"))
+				dlg.panelMain.panelHaz.westButton.doClick();
+			break;
+		case SAW:
+			dlg.panelMain.chanButton.doClick();
+			dlg.panelMain.panelChan.safeWaterButton.doClick();
+			break;
+		case ISD:
+			dlg.panelMain.hazButton.doClick();
+			dlg.panelMain.panelHaz.isolButton.doClick();
+			break;
+		case SPP:
+			dlg.panelMain.specButton.doClick();
+			break;
+		case FLT:
+			dlg.panelMain.lightsButton.doClick();
+			dlg.panelMain.panelLights.floatButton.doClick();
+			break;
+		case LIT:
+			dlg.panelMain.lightsButton.doClick();
+			break;
+		}
 
 		if (keys.containsKey("seamark:topmark:shape")) {
@@ -586,11 +767,7 @@
 		}
 
-		setFired(false);
-		setSectored(false);
-		Iterator it = keys.entrySet().iterator();
-		while (it.hasNext()) {
-			Map.Entry entry = (Map.Entry) it.next();
-			String key = (String) entry.getKey();
-			String value = ((String) entry.getValue()).trim();
+		for (Map.Entry<String, String> entry : keys.entrySet()) {
+			String key = entry.getKey();
+			String value = entry.getValue().trim();
 			if (key.contains("seamark:light:")) {
 				setFired(true);
@@ -641,7 +818,4 @@
 		}
 
-		setFog(false);
-		setRadar(false);
-		setRacon(false);
 		if (keys.containsKey("seamark:fog_signal") || keys.containsKey("seamark:fog_signal:category")
 				|| keys.containsKey("seamark:fog_signal:group") || keys.containsKey("seamark:fog_signal:period")) {
@@ -708,8 +882,8 @@
 			}
 			imgStr += ".png";
-if (getClass().getResource(imgStr) == null)
-System.out.println(imgStr);
-else
-			dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(imgStr)));
+			if (getClass().getResource(imgStr) == null)
+				System.out.println(imgStr);
+			else
+				dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(imgStr)));
 		}
 
@@ -749,68 +923,53 @@
 					imgStr += ("_" + colStr);
 				imgStr += ".png";
-if (getClass().getResource(imgStr) == null)
-System.out.println(imgStr);
-else
-				dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(imgStr)));
-			}
-		}
-/*
-		if (hasRadar()) {
-			dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png")));
-		} else if (hasRacon()) {
-			dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Station.png")));
-			// if (getRaType() != 0) {
-			// String c = (String) dlg.cbM01Racon.getSelectedItem();
-			// if ((getRaType() == RATYPE_RACON) && !getRaconGroup().isEmpty())
-			// c += ("(" + getRaconGroup() + ")");
-			// dlg.lM01RadarMarkeys.setText(c);
-			// }
-		}
-
-		if (hasFog()) {
-			dlg.panelMain.fogIcon.setIcon(new ImageIcon(getClass().getResource("/images/Fog_Signal.png")));
-			// if (getFogSound() != 0) {
-			// String c = (String) dlg.cbM01Fog.getSelectedItem();
-			// if (!getFogGroup().isEmpty())
-			// c += ("(" + getFogGroup() + ")");
-			// if (!getFogPeriod().isEmpty())
-			// c += (" " + getFogPeriod() + "s");
-			// dlg.lM01FogMarkeys.setText(c);
-			// }
-		}
-
-		if (isFired()) {
-			String lp, c;
-			String tmp = null;
-			int i1;
-
-			Col col = getColour(Ent.LIGHT);
-			if (col == Col.WHITE) {
-				dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png")));
-			} else if (col == Col.RED) {
-				dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Red_120.png")));
-			} else if (col == Col.GREEN) {
-				dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Green_120.png")));
-			} else {
-				dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")));
-			}
-
-			 c = getLightChar(); if (c.contains("+")) { i1 = c.indexOf("+"); tmp =
-			 c.substring(i1, c.length()); c = c.substring(0, i1); if
-			 (!getLightGroup().isEmpty()) { c = c + "(" + getLightGroup() + ")"; }
-			 if (tmp != null) c = c + tmp; } else if (!getLightGroup().isEmpty()) c
-			 = c + "(" + getLightGroup() + ")"; c = c + " " + getLightColour(); lp =
-			 getLightPeriod(); if (!lp.isEmpty()) c = c + " " + lp + "s";
-			 }*/
+				if (getClass().getResource(imgStr) == null)
+					System.out.println(imgStr);
+				else
+					dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(imgStr)));
+			}
+		}
+		/*
+		 * if (hasRadar()) { dlg.panelMain.radarIcon.setIcon(new
+		 * ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png"))); }
+		 * else if (hasRacon()) { dlg.panelMain.radarIcon.setIcon(new
+		 * ImageIcon(getClass().getResource("/images/Radar_Station.png"))); // if
+		 * (getRaType() != 0) { // String c = (String)
+		 * dlg.cbM01Racon.getSelectedItem(); // if ((getRaType() == RATYPE_RACON) &&
+		 * !getRaconGroup().isEmpty()) // c += ("(" + getRaconGroup() + ")"); //
+		 * dlg.lM01RadarMarkeys.setText(c); // } }
+		 * 
+		 * if (hasFog()) { dlg.panelMain.fogIcon.setIcon(new
+		 * ImageIcon(getClass().getResource("/images/Fog_Signal.png"))); // if
+		 * (getFogSound() != 0) { // String c = (String)
+		 * dlg.cbM01Fog.getSelectedItem(); // if (!getFogGroup().isEmpty()) // c +=
+		 * ("(" + getFogGroup() + ")"); // if (!getFogPeriod().isEmpty()) // c +=
+		 * (" " + getFogPeriod() + "s"); // dlg.lM01FogMarkeys.setText(c); // } }
+		 * 
+		 * if (isFired()) { String lp, c; String tmp = null; int i1;
+		 * 
+		 * Col col = getColour(Ent.LIGHT); if (col == Col.WHITE) {
+		 * dlg.panelMain.lightIcon.setIcon(new
+		 * ImageIcon(getClass().getResource("/images/Light_White_120.png"))); } else
+		 * if (col == Col.RED) { dlg.panelMain.lightIcon.setIcon(new
+		 * ImageIcon(getClass().getResource("/images/Light_Red_120.png"))); } else
+		 * if (col == Col.GREEN) { dlg.panelMain.lightIcon.setIcon(new
+		 * ImageIcon(getClass().getResource("/images/Light_Green_120.png"))); } else
+		 * { dlg.panelMain.lightIcon.setIcon(new
+		 * ImageIcon(getClass().getResource("/images/Light_Magenta_120.png"))); }
+		 * 
+		 * c = getLightChar(); if (c.contains("+")) { i1 = c.indexOf("+"); tmp =
+		 * c.substring(i1, c.length()); c = c.substring(0, i1); if
+		 * (!getLightGroup().isEmpty()) { c = c + "(" + getLightGroup() + ")"; } if
+		 * (tmp != null) c = c + tmp; } else if (!getLightGroup().isEmpty()) c = c +
+		 * "(" + getLightGroup() + ")"; c = c + " " + getLightColour(); lp =
+		 * getLightPeriod(); if (!lp.isEmpty()) c = c + " " + lp + "s"; }
+		 */
 	}
 
 	public void saveSign() {
-		Iterator<String> it = dlg.node.getKeys().keySet().iterator();
-		String str;
 
 		Main.pref.put("tomsplugin.IALA", getRegion() == Reg.A ? "A" : "B");
 
-		while (it.hasNext()) {
-			str = it.next();
+		for (String str : dlg.node.getKeys().keySet()) {
 			if (str.contains("seamark"))
 				if (!str.equals("seamark")) {
@@ -825,5 +984,5 @@
 			Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", objStr));
 
-			str = categories.get(category);
+			String str = categories.get(category);
 			if (str != null)
 				Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", str));
@@ -851,5 +1010,5 @@
 		}
 
-		str = tops.get(topShape);
+		String str = tops.get(topShape);
 		if (str != null) {
 			Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", str));
