Index: /applications/editors/josm/plugins/smed/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- /applications/editors/josm/plugins/smed/.settings/org.eclipse.jdt.ui.prefs	(revision 32767)
+++ /applications/editors/josm/plugins/smed/.settings/org.eclipse.jdt.ui.prefs	(revision 32767)
@@ -0,0 +1,60 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=false
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=true
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=true
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
Index: /applications/editors/josm/plugins/smed/src/messages/Messages.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/messages/Messages.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/messages/Messages.java	(revision 32767)
@@ -5,17 +5,17 @@
 
 public class Messages {
-	private static final String BUNDLE_NAME = "resources/msg.messages";
+    private static final String BUNDLE_NAME = "resources/msg.messages";
 
-	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
+    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
 
-	private Messages() {
-	}
+    private Messages() {
+    }
 
-	public static String getString(String key) {
-		try {
-			return RESOURCE_BUNDLE.getString(key);
-		} catch (MissingResourceException e) {
-			return '!' + key + '!';
-		}
-	}
+    public static String getString(String key) {
+        try {
+            return RESOURCE_BUNDLE.getString(key);
+        } catch (MissingResourceException e) {
+            return '!' + key + '!';
+        }
+    }
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelChan.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelChan.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelChan.java	(revision 32767)
@@ -1,317 +1,332 @@
 package panels;
 
-import javax.swing.*;
-
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JToggleButton;
 
 import messages.Messages;
+import seamarks.SeaMark;
+import seamarks.SeaMark.Att;
+import seamarks.SeaMark.Cat;
+import seamarks.SeaMark.Col;
+import seamarks.SeaMark.Grp;
+import seamarks.SeaMark.Pat;
+import seamarks.SeaMark.Shp;
+import seamarks.SeaMark.Top;
 import smed.SmedAction;
-import seamarks.SeaMark;
-import seamarks.SeaMark.*;
 
 public class PanelChan extends JPanel {
 
-	private SmedAction dlg;
-	public PanelPort panelPort = null;
-	public PanelStbd panelStbd = null;
-	public PanelSaw panelSaw = null;
-	public ButtonGroup catButtons = new ButtonGroup();
-	public JRadioButton portButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PortButton.png")));
-	public JRadioButton stbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StbdButton.png")));
-	public JRadioButton prefStbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefStbdButton.png")));
-	public JRadioButton prefPortButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefPortButton.png")));
-	public JRadioButton safeWaterButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SafeWaterButton.png")));
-	private ActionListener alCat = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			panelPort.setVisible(false);
-			panelStbd.setVisible(false);
-			panelSaw.setVisible(false);
-			SmedAction.panelMain.moreButton.setVisible(false);
-			SmedAction.panelMain.saveButton.setEnabled(false);
-			topmarkButton.setVisible(false);
-			lightButton.setVisible(false);
-			Shp shp = SmedAction.panelMain.mark.getShape();
-			if (portButton.isSelected()) {
-				SmedAction.panelMain.mark.setCategory(Cat.LAM_PORT);
-				if (panelPort.shapes.containsKey(shp)) {
-					panelPort.shapes.get(shp).setSelected(true);
-				} else {
-					panelPort.shapeButtons.clearSelection();
-					SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
-				}
-				panelPort.alShape.actionPerformed(null);
-				panelPort.setVisible(true);
-				portButton.setBorderPainted(true);
-			} else {
-				portButton.setBorderPainted(false);
-			}
-			if (stbdButton.isSelected()) {
-				SmedAction.panelMain.mark.setCategory(Cat.LAM_STBD);
-				if (panelStbd.shapes.containsKey(shp)) {
-					panelStbd.shapes.get(shp).setSelected(true);
-				} else {
-					panelStbd.shapeButtons.clearSelection();
-					SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
-				}
-				panelStbd.alShape.actionPerformed(null);
-				panelStbd.setVisible(true);
-				stbdButton.setBorderPainted(true);
-			} else {
-				stbdButton.setBorderPainted(false);
-			}
-			if (prefStbdButton.isSelected()) {
-				SmedAction.panelMain.mark.setCategory(Cat.LAM_PSTBD);
-				if (panelPort.shapes.containsKey(shp)) {
-					panelPort.shapes.get(shp).setSelected(true);
-				} else {
-					panelPort.shapeButtons.clearSelection();
-					SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
-				}
-				panelPort.alShape.actionPerformed(null);
-				panelPort.setVisible(true);
-				prefStbdButton.setBorderPainted(true);
-			} else {
-				prefStbdButton.setBorderPainted(false);
-			}
-			if (prefPortButton.isSelected()) {
-				SmedAction.panelMain.mark.setCategory(Cat.LAM_PPORT);
-				if (panelStbd.shapes.containsKey(shp)) {
-					panelStbd.shapes.get(shp).setSelected(true);
-				} else {
-					panelStbd.shapeButtons.clearSelection();
-					SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
-				}
-				panelStbd.alShape.actionPerformed(null);
-				panelStbd.setVisible(true);
-				prefPortButton.setBorderPainted(true);
-			} else {
-				prefPortButton.setBorderPainted(false);
-			}
-			if (safeWaterButton.isSelected()) {
-				SmedAction.panelMain.mark.setCategory(Cat.NOCAT);
-				panelSaw.setVisible(true);
-				if (panelSaw.shapes.containsKey(shp)) {
-					panelSaw.shapes.get(shp).setSelected(true);
-				} else {
-					panelSaw.shapeButtons.clearSelection();
-					SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
-				}
-				panelSaw.alShape.actionPerformed(null);
-				panelSaw.setVisible(true);
-				safeWaterButton.setBorderPainted(true);
-			} else {
-				safeWaterButton.setBorderPainted(false);
-			}
-			topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
-			lightButton.setVisible(SmedAction.panelMain.mark.testValid());
-			SmedAction.panelMain.panelMore.syncPanel();
-		}
-	};
-	public JToggleButton topmarkButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/ChanTopButton.png")));
-	private ActionListener alTop = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (topmarkButton.isSelected()) {
-				if (SeaMark.GrpMAP.get(SmedAction.panelMain.mark.getObject()) == Grp.SAW) {
-					SmedAction.panelMain.mark.setTopmark(Top.SPHERE);
-					SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT);
-					SmedAction.panelMain.mark.setTopColour(Col.RED);
-				} else {
-					switch (dlg.panelMain.mark.getCategory()) {
-					case LAM_PORT:
-					case LAM_PSTBD:
-						dlg.panelMain.mark.setTopmark(Top.CYL);
-						switch (dlg.panelMain.mark.getRegion()) {
-						case A:
-							dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
-							dlg.panelMain.mark.setTopColour(Col.RED);
-							break;
-						case B:
-							dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
-							dlg.panelMain.mark.setTopColour(Col.GREEN);
-							break;
-						case C:
-							if (dlg.panelMain.mark.getCategory() == Cat.LAM_PORT) {
-								dlg.panelMain.mark.setTopPattern(Pat.HSTRP);
-								dlg.panelMain.mark.setTopColour(Col.RED);
-								dlg.panelMain.mark.addTopColour(Col.WHITE);
-							} else {
-								dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
-								dlg.panelMain.mark.setTopColour(Col.RED);
-							}
-							break;
-						}
-						break;
-					case LAM_STBD:
-					case LAM_PPORT:
-						dlg.panelMain.mark.setTopmark(Top.CONE);
-						switch (dlg.panelMain.mark.getRegion()) {
-						case A:
-							dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
-							dlg.panelMain.mark.setTopColour(Col.GREEN);
-							break;
-						case B:
-							dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
-							dlg.panelMain.mark.setTopColour(Col.RED);
-							break;
-						case C:
-							if (dlg.panelMain.mark.getCategory() == Cat.LAM_STBD) {
-								dlg.panelMain.mark.setTopPattern(Pat.HSTRP);
-								dlg.panelMain.mark.setTopColour(Col.GREEN);
-								dlg.panelMain.mark.addTopColour(Col.WHITE);
-							} else {
-								dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
-								dlg.panelMain.mark.setTopColour(Col.GREEN);
-							}
-							break;
-						}
-						break;
-					}
-				}
-				topmarkButton.setBorderPainted(true);
-			} else {
-				dlg.panelMain.mark.setTopmark(Top.NOTOP);
-				dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
-				dlg.panelMain.mark.setTopColour(Col.UNKCOL);
-				topmarkButton.setBorderPainted(false);
-			}
-			dlg.panelMain.panelTop.syncPanel();
-		}
-	};
-	public JToggleButton lightButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/DefLitButton.png")));
-	private ActionListener alLit = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (lightButton.isSelected()) {
-				if (SeaMark.GrpMAP.get(dlg.panelMain.mark.getObject()) == Grp.SAW) {
-					dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "LFl");
-					dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.WHITE);
-				} else {
-					dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Fl");
-					switch (dlg.panelMain.mark.getCategory()) {
-					case LAM_PORT:
-					case LAM_PPORT:
-						switch (dlg.panelMain.mark.getRegion()) {
-						case A:
-						case C:
-							dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.RED);
-							break;
-						case B:
-							dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.GREEN);
-							break;
-						}
-						break;
-					case LAM_STBD:
-					case LAM_PSTBD:
-						switch (dlg.panelMain.mark.getRegion()) {
-						case A:
-						case C:
-							dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.GREEN);
-							break;
-						case B:
-							dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.RED);
-							break;
-						}
-						break;
-					}
-				}
-				lightButton.setBorderPainted(true);
-			} else {
-				dlg.panelMain.mark.clrLight();
-				lightButton.setBorderPainted(false);
-			}
-			dlg.panelMain.panelLit.syncPanel();
-		}
-	};
-
-	public PanelChan(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		panelPort = new PanelPort(dlg);
-		panelPort.setBounds(new Rectangle(55, 0, 70, 160));
-		panelPort.setVisible(false);
-		panelStbd = new PanelStbd(dlg);
-		panelStbd.setBounds(new Rectangle(55, 0, 70, 160));
-		panelStbd.setVisible(false);
-		panelSaw = new PanelSaw(dlg);
-		panelSaw.setBounds(new Rectangle(55, 0, 70, 160));
-		panelSaw.setVisible(false);
-		add(panelPort);
-		add(panelStbd);
-		add(panelSaw);
-		add(getCatButton(portButton, 0, 0, 52, 32, "Port"));
-		add(getCatButton(stbdButton, 0, 32, 52, 32, "Stbd"));
-		add(getCatButton(prefStbdButton, 0, 64, 52, 32, "PrefStbd"));
-		add(getCatButton(prefPortButton, 0, 96, 52, 32, "PrefPort"));
-		add(getCatButton(safeWaterButton, 0, 128, 52, 32, "SafeWater"));
-
-		topmarkButton.setBounds(new Rectangle(130, 0, 34, 32));
-		topmarkButton.setToolTipText(Messages.getString("Topmark"));
-		topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder());
-		topmarkButton.addActionListener(alTop);
-		topmarkButton.setVisible(false);
-		add(topmarkButton);
-		lightButton.setBounds(new Rectangle(130, 32, 34, 32));
-		lightButton.setToolTipText(Messages.getString("Light"));
-		lightButton.setBorder(BorderFactory.createLoweredBevelBorder());
-		lightButton.addActionListener(alLit);
-		lightButton.setVisible(false);
-		add(lightButton);
-	}
-
-	public void syncPanel() {
-		panelPort.setVisible(false);
-		panelStbd.setVisible(false);
-		panelSaw.setVisible(false);
-		if (dlg.panelMain.mark.getCategory() == Cat.LAM_PORT) {
-			panelPort.setVisible(true);
-			portButton.setBorderPainted(true);
-		} else {
-			portButton.setBorderPainted(false);
-		}
-		if (dlg.panelMain.mark.getCategory() == Cat.LAM_PPORT) {
-			panelStbd.setVisible(true);
-			prefPortButton.setBorderPainted(true);
-		} else {
-			prefPortButton.setBorderPainted(false);
-		}
-		if (dlg.panelMain.mark.getCategory() == Cat.LAM_STBD) {
-			panelStbd.setVisible(true);
-			stbdButton.setBorderPainted(true);
-		} else {
-			stbdButton.setBorderPainted(false);
-		}
-		if (dlg.panelMain.mark.getCategory() == Cat.LAM_PSTBD) {
-			panelPort.setVisible(true);
-			prefStbdButton.setBorderPainted(true);
-		} else {
-			prefStbdButton.setBorderPainted(false);
-		}
-		if (SeaMark.GrpMAP.get(dlg.panelMain.mark.getObject()) == Grp.SAW) {
-			panelSaw.setVisible(true);
-			safeWaterButton.setBorderPainted(true);
-		} else {
-			safeWaterButton.setBorderPainted(false);
-		}
-		topmarkButton.setBorderPainted(dlg.panelMain.mark.getTopmark() != Top.NOTOP);
-		topmarkButton.setSelected(dlg.panelMain.mark.getTopmark() != Top.NOTOP);
-		topmarkButton.setVisible(dlg.panelMain.mark.testValid());
-		Boolean lit = (dlg.panelMain.mark.getLightAtt(Att.COL, 0) != Col.UNKCOL) && !((String)dlg.panelMain.mark.getLightAtt(Att.CHR, 0)).isEmpty();
-		lightButton.setBorderPainted(lit);
-		lightButton.setSelected(lit);
-		lightButton.setVisible(dlg.panelMain.mark.testValid());
-		panelPort.syncPanel();
-		panelStbd.syncPanel();
-		panelSaw.syncPanel();
-		dlg.panelMain.mark.testValid();
-	}
-
-	private JRadioButton getCatButton(JRadioButton button, int x, int y, int w, int h, String tip) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alCat);
-		catButtons.add(button);
-		return button;
-	}
+    private SmedAction dlg;
+    public PanelPort panelPort = null;
+    public PanelStbd panelStbd = null;
+    public PanelSaw panelSaw = null;
+    public ButtonGroup catButtons = new ButtonGroup();
+    public JRadioButton portButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PortButton.png")));
+    public JRadioButton stbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StbdButton.png")));
+    public JRadioButton prefStbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefStbdButton.png")));
+    public JRadioButton prefPortButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefPortButton.png")));
+    public JRadioButton safeWaterButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SafeWaterButton.png")));
+    private ActionListener alCat = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            panelPort.setVisible(false);
+            panelStbd.setVisible(false);
+            panelSaw.setVisible(false);
+            SmedAction.panelMain.moreButton.setVisible(false);
+            SmedAction.panelMain.saveButton.setEnabled(false);
+            topmarkButton.setVisible(false);
+            lightButton.setVisible(false);
+            Shp shp = SmedAction.panelMain.mark.getShape();
+            if (portButton.isSelected()) {
+                SmedAction.panelMain.mark.setCategory(Cat.LAM_PORT);
+                if (panelPort.shapes.containsKey(shp)) {
+                    panelPort.shapes.get(shp).setSelected(true);
+                } else {
+                    panelPort.shapeButtons.clearSelection();
+                    SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
+                }
+                panelPort.alShape.actionPerformed(null);
+                panelPort.setVisible(true);
+                portButton.setBorderPainted(true);
+            } else {
+                portButton.setBorderPainted(false);
+            }
+            if (stbdButton.isSelected()) {
+                SmedAction.panelMain.mark.setCategory(Cat.LAM_STBD);
+                if (panelStbd.shapes.containsKey(shp)) {
+                    panelStbd.shapes.get(shp).setSelected(true);
+                } else {
+                    panelStbd.shapeButtons.clearSelection();
+                    SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
+                }
+                panelStbd.alShape.actionPerformed(null);
+                panelStbd.setVisible(true);
+                stbdButton.setBorderPainted(true);
+            } else {
+                stbdButton.setBorderPainted(false);
+            }
+            if (prefStbdButton.isSelected()) {
+                SmedAction.panelMain.mark.setCategory(Cat.LAM_PSTBD);
+                if (panelPort.shapes.containsKey(shp)) {
+                    panelPort.shapes.get(shp).setSelected(true);
+                } else {
+                    panelPort.shapeButtons.clearSelection();
+                    SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
+                }
+                panelPort.alShape.actionPerformed(null);
+                panelPort.setVisible(true);
+                prefStbdButton.setBorderPainted(true);
+            } else {
+                prefStbdButton.setBorderPainted(false);
+            }
+            if (prefPortButton.isSelected()) {
+                SmedAction.panelMain.mark.setCategory(Cat.LAM_PPORT);
+                if (panelStbd.shapes.containsKey(shp)) {
+                    panelStbd.shapes.get(shp).setSelected(true);
+                } else {
+                    panelStbd.shapeButtons.clearSelection();
+                    SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
+                }
+                panelStbd.alShape.actionPerformed(null);
+                panelStbd.setVisible(true);
+                prefPortButton.setBorderPainted(true);
+            } else {
+                prefPortButton.setBorderPainted(false);
+            }
+            if (safeWaterButton.isSelected()) {
+                SmedAction.panelMain.mark.setCategory(Cat.NOCAT);
+                panelSaw.setVisible(true);
+                if (panelSaw.shapes.containsKey(shp)) {
+                    panelSaw.shapes.get(shp).setSelected(true);
+                } else {
+                    panelSaw.shapeButtons.clearSelection();
+                    SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
+                }
+                panelSaw.alShape.actionPerformed(null);
+                panelSaw.setVisible(true);
+                safeWaterButton.setBorderPainted(true);
+            } else {
+                safeWaterButton.setBorderPainted(false);
+            }
+            topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
+            lightButton.setVisible(SmedAction.panelMain.mark.testValid());
+            SmedAction.panelMain.panelMore.syncPanel();
+        }
+    };
+    public JToggleButton topmarkButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/ChanTopButton.png")));
+    private ActionListener alTop = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if (topmarkButton.isSelected()) {
+                if (SeaMark.GrpMAP.get(SmedAction.panelMain.mark.getObject()) == Grp.SAW) {
+                    SmedAction.panelMain.mark.setTopmark(Top.SPHERE);
+                    SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT);
+                    SmedAction.panelMain.mark.setTopColour(Col.RED);
+                } else {
+                    switch (dlg.panelMain.mark.getCategory()) {
+                    case LAM_PORT:
+                    case LAM_PSTBD:
+                        dlg.panelMain.mark.setTopmark(Top.CYL);
+                        switch (dlg.panelMain.mark.getRegion()) {
+                        case A:
+                            dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
+                            dlg.panelMain.mark.setTopColour(Col.RED);
+                            break;
+                        case B:
+                            dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
+                            dlg.panelMain.mark.setTopColour(Col.GREEN);
+                            break;
+                        case C:
+                            if (dlg.panelMain.mark.getCategory() == Cat.LAM_PORT) {
+                                dlg.panelMain.mark.setTopPattern(Pat.HSTRP);
+                                dlg.panelMain.mark.setTopColour(Col.RED);
+                                dlg.panelMain.mark.addTopColour(Col.WHITE);
+                            } else {
+                                dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
+                                dlg.panelMain.mark.setTopColour(Col.RED);
+                            }
+                            break;
+                        }
+                        break;
+                    case LAM_STBD:
+                    case LAM_PPORT:
+                        dlg.panelMain.mark.setTopmark(Top.CONE);
+                        switch (dlg.panelMain.mark.getRegion()) {
+                        case A:
+                            dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
+                            dlg.panelMain.mark.setTopColour(Col.GREEN);
+                            break;
+                        case B:
+                            dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
+                            dlg.panelMain.mark.setTopColour(Col.RED);
+                            break;
+                        case C:
+                            if (dlg.panelMain.mark.getCategory() == Cat.LAM_STBD) {
+                                dlg.panelMain.mark.setTopPattern(Pat.HSTRP);
+                                dlg.panelMain.mark.setTopColour(Col.GREEN);
+                                dlg.panelMain.mark.addTopColour(Col.WHITE);
+                            } else {
+                                dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
+                                dlg.panelMain.mark.setTopColour(Col.GREEN);
+                            }
+                            break;
+                        }
+                        break;
+                    }
+                }
+                topmarkButton.setBorderPainted(true);
+            } else {
+                dlg.panelMain.mark.setTopmark(Top.NOTOP);
+                dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
+                dlg.panelMain.mark.setTopColour(Col.UNKCOL);
+                topmarkButton.setBorderPainted(false);
+            }
+            dlg.panelMain.panelTop.syncPanel();
+        }
+    };
+    public JToggleButton lightButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/DefLitButton.png")));
+    private ActionListener alLit = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if (lightButton.isSelected()) {
+                if (SeaMark.GrpMAP.get(dlg.panelMain.mark.getObject()) == Grp.SAW) {
+                    dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "LFl");
+                    dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.WHITE);
+                } else {
+                    dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Fl");
+                    switch (dlg.panelMain.mark.getCategory()) {
+                    case LAM_PORT:
+                    case LAM_PPORT:
+                        switch (dlg.panelMain.mark.getRegion()) {
+                        case A:
+                        case C:
+                            dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.RED);
+                            break;
+                        case B:
+                            dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.GREEN);
+                            break;
+                        }
+                        break;
+                    case LAM_STBD:
+                    case LAM_PSTBD:
+                        switch (dlg.panelMain.mark.getRegion()) {
+                        case A:
+                        case C:
+                            dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.GREEN);
+                            break;
+                        case B:
+                            dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.RED);
+                            break;
+                        }
+                        break;
+                    }
+                }
+                lightButton.setBorderPainted(true);
+            } else {
+                dlg.panelMain.mark.clrLight();
+                lightButton.setBorderPainted(false);
+            }
+            dlg.panelMain.panelLit.syncPanel();
+        }
+    };
+
+    public PanelChan(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        panelPort = new PanelPort(dlg);
+        panelPort.setBounds(new Rectangle(55, 0, 70, 160));
+        panelPort.setVisible(false);
+        panelStbd = new PanelStbd(dlg);
+        panelStbd.setBounds(new Rectangle(55, 0, 70, 160));
+        panelStbd.setVisible(false);
+        panelSaw = new PanelSaw(dlg);
+        panelSaw.setBounds(new Rectangle(55, 0, 70, 160));
+        panelSaw.setVisible(false);
+        add(panelPort);
+        add(panelStbd);
+        add(panelSaw);
+        add(getCatButton(portButton, 0, 0, 52, 32, "Port"));
+        add(getCatButton(stbdButton, 0, 32, 52, 32, "Stbd"));
+        add(getCatButton(prefStbdButton, 0, 64, 52, 32, "PrefStbd"));
+        add(getCatButton(prefPortButton, 0, 96, 52, 32, "PrefPort"));
+        add(getCatButton(safeWaterButton, 0, 128, 52, 32, "SafeWater"));
+
+        topmarkButton.setBounds(new Rectangle(130, 0, 34, 32));
+        topmarkButton.setToolTipText(Messages.getString("Topmark"));
+        topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder());
+        topmarkButton.addActionListener(alTop);
+        topmarkButton.setVisible(false);
+        add(topmarkButton);
+        lightButton.setBounds(new Rectangle(130, 32, 34, 32));
+        lightButton.setToolTipText(Messages.getString("Light"));
+        lightButton.setBorder(BorderFactory.createLoweredBevelBorder());
+        lightButton.addActionListener(alLit);
+        lightButton.setVisible(false);
+        add(lightButton);
+    }
+
+    public void syncPanel() {
+        panelPort.setVisible(false);
+        panelStbd.setVisible(false);
+        panelSaw.setVisible(false);
+        if (dlg.panelMain.mark.getCategory() == Cat.LAM_PORT) {
+            panelPort.setVisible(true);
+            portButton.setBorderPainted(true);
+        } else {
+            portButton.setBorderPainted(false);
+        }
+        if (dlg.panelMain.mark.getCategory() == Cat.LAM_PPORT) {
+            panelStbd.setVisible(true);
+            prefPortButton.setBorderPainted(true);
+        } else {
+            prefPortButton.setBorderPainted(false);
+        }
+        if (dlg.panelMain.mark.getCategory() == Cat.LAM_STBD) {
+            panelStbd.setVisible(true);
+            stbdButton.setBorderPainted(true);
+        } else {
+            stbdButton.setBorderPainted(false);
+        }
+        if (dlg.panelMain.mark.getCategory() == Cat.LAM_PSTBD) {
+            panelPort.setVisible(true);
+            prefStbdButton.setBorderPainted(true);
+        } else {
+            prefStbdButton.setBorderPainted(false);
+        }
+        if (SeaMark.GrpMAP.get(dlg.panelMain.mark.getObject()) == Grp.SAW) {
+            panelSaw.setVisible(true);
+            safeWaterButton.setBorderPainted(true);
+        } else {
+            safeWaterButton.setBorderPainted(false);
+        }
+        topmarkButton.setBorderPainted(dlg.panelMain.mark.getTopmark() != Top.NOTOP);
+        topmarkButton.setSelected(dlg.panelMain.mark.getTopmark() != Top.NOTOP);
+        topmarkButton.setVisible(dlg.panelMain.mark.testValid());
+        Boolean lit = (dlg.panelMain.mark.getLightAtt(Att.COL, 0) != Col.UNKCOL) && !((String)dlg.panelMain.mark.getLightAtt(Att.CHR, 0)).isEmpty();
+        lightButton.setBorderPainted(lit);
+        lightButton.setSelected(lit);
+        lightButton.setVisible(dlg.panelMain.mark.testValid());
+        panelPort.syncPanel();
+        panelStbd.syncPanel();
+        panelSaw.syncPanel();
+        dlg.panelMain.mark.testValid();
+    }
+
+    private JRadioButton getCatButton(JRadioButton button, int x, int y, int w, int h, String tip) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alCat);
+        catButtons.add(button);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelChr.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelChr.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelChr.java	(revision 32767)
@@ -3,178 +3,192 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.util.EnumMap;
+import java.util.EnumSet;
 
-import javax.swing.*;
-
-import java.util.*;
+import javax.swing.BorderFactory;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.JToggleButton;
+import javax.swing.SwingConstants;
 
 import messages.Messages;
+import seamarks.SeaMark;
+import seamarks.SeaMark.Att;
+import seamarks.SeaMark.Chr;
+import seamarks.SeaMark.Col;
 import smed.SmedAction;
-import seamarks.SeaMark;
-import seamarks.SeaMark.*;
 
 public class PanelChr extends JPanel {
 
-	private SmedAction dlg;
-	public JLabel col1Label = new JLabel();
-	public JLabel col2Label = new JLabel();
-	public JLabel charLabel = new JLabel();
-	public JTextField charBox = new JTextField();
-	public JToggleButton noneButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/NoCharButton.png")));
-	public JToggleButton fixedButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/FixedButton.png")));
-	public JToggleButton flashButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/FlashButton.png")));
-	public JToggleButton longFlashButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/LongFlashButton.png")));
-	public JToggleButton quickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/QuickButton.png")));
-	public JToggleButton veryQuickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/VeryQuickButton.png")));
-	public JToggleButton ultraQuickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/UltraQuickButton.png")));
-	public JToggleButton interruptedQuickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/InterruptedQuickButton.png")));
-	public JToggleButton interruptedVeryQuickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/InterruptedVeryQuickButton.png")));
-	public JToggleButton interruptedUltraQuickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/InterruptedUltraQuickButton.png")));
-	public JToggleButton isophasedButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/IsophasedButton.png")));
-	public JToggleButton occultingButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/OccultingButton.png")));
-	public JToggleButton morseButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/MorseButton.png")));
-	public JToggleButton alternatingButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/AlternatingButton.png")));
-	private EnumMap<Chr, JToggleButton> buttons = new EnumMap<>(Chr.class);
-	private ActionListener alCharButton = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			JToggleButton source = (JToggleButton) e.getSource();
-			EnumSet<Chr> combo = EnumSet.noneOf(Chr.class);
-			for (Chr chr : buttons.keySet()) {
-				JToggleButton button = buttons.get(chr);
-				if (button.isSelected()) {
-					combo.add(chr);
-					button.setBorderPainted(true);
-				} else {
-					combo.remove(chr);
-					button.setBorderPainted(false);
-				}
-			}
-			if (SeaMark.ChrMAP.containsKey(combo)) {
-				charBox.setText(SeaMark.ChrMAP.get(combo));
-			} else {
-				for (Chr chr : buttons.keySet()) {
-					JToggleButton button = buttons.get(chr);
-					if (button == source) {
-						charBox.setText(SeaMark.ChrMAP.get(EnumSet.of(chr)));
-						button.setSelected(true);
-						button.setBorderPainted(true);
-					} else {
-						button.setSelected(false);
-						button.setBorderPainted(false);
-					}
-				}
-			}
-			String str = charBox.getText();
-			SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, str);
-			if (!str.contains("Al")) {
-				col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0)));
-				SmedAction.panelMain.mark.setLightAtt(Att.ALT, 0, Col.UNKCOL);
-			} else {
-				col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0)));
-			}
-		}
-	};
-	private FocusListener flCharBox = new FocusListener() {
-		public void focusGained(java.awt.event.FocusEvent e) {}
-			public void focusLost(java.awt.event.FocusEvent e) {
-			String str = charBox.getText();
-			SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, str);
-			EnumSet<Chr> set = EnumSet.noneOf(Chr.class);
-			for (EnumSet<Chr> map : SeaMark.ChrMAP.keySet()) {
-				if (str.equals(SeaMark.ChrMAP.get(map))) {
-					set = map;
-					break;
-				}
-			}
-			for (Chr chr : buttons.keySet()) {
-				JToggleButton button = buttons.get(chr);
-				if (set.contains(chr)) {
-					button.setSelected(true);
-					button.setBorderPainted(true);
-				} else {
-					button.setSelected(false);
-					button.setBorderPainted(false);
-				}
-			}
-			if (!str.contains("Al")) {
-				col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0)));
-				SmedAction.panelMain.mark.setLightAtt(Att.ALT, 0, Col.UNKCOL);
-			} else {
-				col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0)));
-			}
-		}
-	};
+    private SmedAction dlg;
+    public JLabel col1Label = new JLabel();
+    public JLabel col2Label = new JLabel();
+    public JLabel charLabel = new JLabel();
+    public JTextField charBox = new JTextField();
+    public JToggleButton noneButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/NoCharButton.png")));
+    public JToggleButton fixedButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/FixedButton.png")));
+    public JToggleButton flashButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/FlashButton.png")));
+    public JToggleButton longFlashButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/LongFlashButton.png")));
+    public JToggleButton quickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/QuickButton.png")));
+    public JToggleButton veryQuickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/VeryQuickButton.png")));
+    public JToggleButton ultraQuickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/UltraQuickButton.png")));
+    public JToggleButton interruptedQuickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/InterruptedQuickButton.png")));
+    public JToggleButton interruptedVeryQuickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/InterruptedVeryQuickButton.png")));
+    public JToggleButton interruptedUltraQuickButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/InterruptedUltraQuickButton.png")));
+    public JToggleButton isophasedButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/IsophasedButton.png")));
+    public JToggleButton occultingButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/OccultingButton.png")));
+    public JToggleButton morseButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/MorseButton.png")));
+    public JToggleButton alternatingButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/AlternatingButton.png")));
+    private EnumMap<Chr, JToggleButton> buttons = new EnumMap<>(Chr.class);
+    private ActionListener alCharButton = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            JToggleButton source = (JToggleButton) e.getSource();
+            EnumSet<Chr> combo = EnumSet.noneOf(Chr.class);
+            for (Chr chr : buttons.keySet()) {
+                JToggleButton button = buttons.get(chr);
+                if (button.isSelected()) {
+                    combo.add(chr);
+                    button.setBorderPainted(true);
+                } else {
+                    combo.remove(chr);
+                    button.setBorderPainted(false);
+                }
+            }
+            if (SeaMark.ChrMAP.containsKey(combo)) {
+                charBox.setText(SeaMark.ChrMAP.get(combo));
+            } else {
+                for (Chr chr : buttons.keySet()) {
+                    JToggleButton button = buttons.get(chr);
+                    if (button == source) {
+                        charBox.setText(SeaMark.ChrMAP.get(EnumSet.of(chr)));
+                        button.setSelected(true);
+                        button.setBorderPainted(true);
+                    } else {
+                        button.setSelected(false);
+                        button.setBorderPainted(false);
+                    }
+                }
+            }
+            String str = charBox.getText();
+            SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, str);
+            if (!str.contains("Al")) {
+                col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0)));
+                SmedAction.panelMain.mark.setLightAtt(Att.ALT, 0, Col.UNKCOL);
+            } else {
+                col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0)));
+            }
+        }
+    };
+    private FocusListener flCharBox = new FocusListener() {
+        @Override
+        public void focusGained(FocusEvent e) {}
+        @Override
+        public void focusLost(FocusEvent e) {
+            String str = charBox.getText();
+            SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, str);
+            EnumSet<Chr> set = EnumSet.noneOf(Chr.class);
+            for (EnumSet<Chr> map : SeaMark.ChrMAP.keySet()) {
+                if (str.equals(SeaMark.ChrMAP.get(map))) {
+                    set = map;
+                    break;
+                }
+            }
+            for (Chr chr : buttons.keySet()) {
+                JToggleButton button = buttons.get(chr);
+                if (set.contains(chr)) {
+                    button.setSelected(true);
+                    button.setBorderPainted(true);
+                } else {
+                    button.setSelected(false);
+                    button.setBorderPainted(false);
+                }
+            }
+            if (!str.contains("Al")) {
+                col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0)));
+                SmedAction.panelMain.mark.setLightAtt(Att.ALT, 0, Col.UNKCOL);
+            } else {
+                col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0)));
+            }
+        }
+    };
 
-	public PanelChr(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		add(getChrButton(noneButton, 0, 0, 44, 16, Messages.getString("NoChar"), Chr.UNKCHR));
-		add(getChrButton(fixedButton, 0, 16, 44, 16, Messages.getString("FChar"), Chr.FIXED));
-		add(getChrButton(flashButton, 0, 32, 44, 16, Messages.getString("FlChar"), Chr.FLASH));
-		add(getChrButton(longFlashButton, 0, 48, 44, 16, Messages.getString("LFlChar"), Chr.LFLASH));
-		add(getChrButton(quickButton, 0, 64, 44, 16, Messages.getString("QChar"), Chr.QUICK));
-		add(getChrButton(veryQuickButton, 0, 80, 44, 16, Messages.getString("VQChar"), Chr.VQUICK));
-		add(getChrButton(ultraQuickButton, 0, 96, 44, 16, Messages.getString("UQChar"), Chr.UQUICK));
-		add(getChrButton(alternatingButton, 44, 0, 44, 16, Messages.getString("AlChar"), Chr.ALTERNATING));
-		add(getChrButton(isophasedButton, 44, 16, 44, 16, Messages.getString("IsoChar"), Chr.ISOPHASED));
-		add(getChrButton(occultingButton, 44, 32, 44, 16, Messages.getString("OcChar"), Chr.OCCULTING));
-		add(getChrButton(morseButton, 44, 48, 44, 16, Messages.getString("MoChar"), Chr.MORSE));
-		add(getChrButton(interruptedQuickButton, 44, 64, 44, 16, Messages.getString("IQChar"), Chr.IQUICK));
-		add(getChrButton(interruptedVeryQuickButton, 44, 80, 44, 16, Messages.getString("IVQChar"), Chr.IVQUICK));
-		add(getChrButton(interruptedUltraQuickButton, 44, 96, 44, 16, Messages.getString("IUQChar"), Chr.IUQUICK));
-		charLabel.setBounds(new Rectangle(0, 113, 88, 20));
-		charLabel.setHorizontalAlignment(SwingConstants.CENTER);
-		charLabel.setText(Messages.getString("Character"));
-		add(charLabel);
-		col1Label.setBounds(new Rectangle(10, 135, 10, 20));
-		col1Label.setOpaque(true);
-		add(col1Label);
-		col2Label.setBounds(new Rectangle(70, 135, 10, 20));
-		col2Label.setOpaque(true);
-		add(col2Label);
-		charBox.setBounds(new Rectangle(20, 135, 50, 20));
-		charBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(charBox);
-		charBox.addFocusListener(flCharBox);
-	}
+    public PanelChr(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        add(getChrButton(noneButton, 0, 0, 44, 16, Messages.getString("NoChar"), Chr.UNKCHR));
+        add(getChrButton(fixedButton, 0, 16, 44, 16, Messages.getString("FChar"), Chr.FIXED));
+        add(getChrButton(flashButton, 0, 32, 44, 16, Messages.getString("FlChar"), Chr.FLASH));
+        add(getChrButton(longFlashButton, 0, 48, 44, 16, Messages.getString("LFlChar"), Chr.LFLASH));
+        add(getChrButton(quickButton, 0, 64, 44, 16, Messages.getString("QChar"), Chr.QUICK));
+        add(getChrButton(veryQuickButton, 0, 80, 44, 16, Messages.getString("VQChar"), Chr.VQUICK));
+        add(getChrButton(ultraQuickButton, 0, 96, 44, 16, Messages.getString("UQChar"), Chr.UQUICK));
+        add(getChrButton(alternatingButton, 44, 0, 44, 16, Messages.getString("AlChar"), Chr.ALTERNATING));
+        add(getChrButton(isophasedButton, 44, 16, 44, 16, Messages.getString("IsoChar"), Chr.ISOPHASED));
+        add(getChrButton(occultingButton, 44, 32, 44, 16, Messages.getString("OcChar"), Chr.OCCULTING));
+        add(getChrButton(morseButton, 44, 48, 44, 16, Messages.getString("MoChar"), Chr.MORSE));
+        add(getChrButton(interruptedQuickButton, 44, 64, 44, 16, Messages.getString("IQChar"), Chr.IQUICK));
+        add(getChrButton(interruptedVeryQuickButton, 44, 80, 44, 16, Messages.getString("IVQChar"), Chr.IVQUICK));
+        add(getChrButton(interruptedUltraQuickButton, 44, 96, 44, 16, Messages.getString("IUQChar"), Chr.IUQUICK));
+        charLabel.setBounds(new Rectangle(0, 113, 88, 20));
+        charLabel.setHorizontalAlignment(SwingConstants.CENTER);
+        charLabel.setText(Messages.getString("Character"));
+        add(charLabel);
+        col1Label.setBounds(new Rectangle(10, 135, 10, 20));
+        col1Label.setOpaque(true);
+        add(col1Label);
+        col2Label.setBounds(new Rectangle(70, 135, 10, 20));
+        col2Label.setOpaque(true);
+        add(col2Label);
+        charBox.setBounds(new Rectangle(20, 135, 50, 20));
+        charBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(charBox);
+        charBox.addFocusListener(flCharBox);
+    }
 
-	public void syncPanel() {
-		String str = (String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0);
-		charBox.setText(str);
-		EnumSet<Chr> set = EnumSet.noneOf(Chr.class);
-		for (EnumSet<Chr> map : SeaMark.ChrMAP.keySet()) {
-			if (dlg.node != null && str.equals(SeaMark.ChrMAP.get(map))) {
-				set = map;
-				break;
-			}
-		}
-		if (!str.contains("Al")) {
-			col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0)));
-		} else {
-			col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0)));
-		}
-		col1Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0)));
-		for (Chr chr : buttons.keySet()) {
-			JToggleButton button = buttons.get(chr);
-			if (set.contains(chr)) {
-				button.setSelected(true);
-				button.setBorderPainted(true);
-			} else {
-				button.setSelected(false);
-				button.setBorderPainted(false);
-			}
-		}
-	}
+    public void syncPanel() {
+        String str = (String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0);
+        charBox.setText(str);
+        EnumSet<Chr> set = EnumSet.noneOf(Chr.class);
+        for (EnumSet<Chr> map : SeaMark.ChrMAP.keySet()) {
+            if (dlg.node != null && str.equals(SeaMark.ChrMAP.get(map))) {
+                set = map;
+                break;
+            }
+        }
+        if (!str.contains("Al")) {
+            col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0)));
+        } else {
+            col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0)));
+        }
+        col1Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, 0)));
+        for (Chr chr : buttons.keySet()) {
+            JToggleButton button = buttons.get(chr);
+            if (set.contains(chr)) {
+                button.setSelected(true);
+                button.setBorderPainted(true);
+            } else {
+                button.setSelected(false);
+                button.setBorderPainted(false);
+            }
+        }
+    }
 
-	private JToggleButton getChrButton(JToggleButton button, int x, int y, int w, int h, String tip, Chr chr) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setBorderPainted(false);
-		button.setToolTipText(tr(tip));
-		button.addActionListener(alCharButton);
-		buttons.put(chr, button);
-		return button;
-	}
+    private JToggleButton getChrButton(JToggleButton button, int x, int y, int w, int h, String tip, Chr chr) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setBorderPainted(false);
+        button.setToolTipText(tr(tip));
+        button.addActionListener(alCharButton);
+        buttons.put(chr, button);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelCol.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelCol.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelCol.java	(revision 32767)
@@ -3,206 +3,224 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-
-import java.util.*;
+import java.awt.Color;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.EnumMap;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
 
 import messages.Messages;
+import seamarks.SeaMark;
+import seamarks.SeaMark.Att;
+import seamarks.SeaMark.Col;
+import seamarks.SeaMark.Ent;
 import smed.SmedAction;
-import seamarks.SeaMark;
-import seamarks.SeaMark.*;
 
 public class PanelCol extends JPanel {
 
-	private SmedAction dlg;
-	private Ent ent;
-	private ButtonGroup colourButtons = new ButtonGroup();
-	public JRadioButton delButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DelButton.png")));
-	public JRadioButton addButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/AddButton.png")));
-	public JRadioButton whiteButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WhiteButton.png")));
-	public JRadioButton redButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RedButton.png")));
-	public JRadioButton greenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreenButton.png")));
-	public JRadioButton yellowButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/YellowButton.png")));
-	public JRadioButton orangeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OrangeButton.png")));
-	public JRadioButton amberButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/AmberButton.png")));
-	public JRadioButton blueButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlueButton.png")));
-	public JRadioButton violetButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/VioletButton.png")));
-	public JRadioButton blackButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlackButton.png")));
-	public JRadioButton greyButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreyButton.png")));
-	public JRadioButton brownButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BrownButton.png")));
-	public JRadioButton magentaButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/MagentaButton.png")));
-	public JRadioButton pinkButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PinkButton.png")));
-	public EnumMap<Col, JRadioButton> colours = new EnumMap<>(Col.class);
-	private ActionListener alColour = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Col col : colours.keySet()) {
-				JRadioButton button = colours.get(col);
-				if (button.isSelected()) {
-					if (ent == Ent.LIGHT) {
-						if (((String) SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0)).contains("Al")) {
-							if (((button == delButton) && (SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0) == Col.UNKCOL))
-									|| (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) == Col.UNKCOL)) {
-								SmedAction.panelMain.mark.setLightAtt(Att.COL, 0, col);
-								SmedAction.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));
-							} else {
-								SmedAction.panelMain.mark.setLightAtt(Att.ALT, 0, col);
-								SmedAction.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));
-							}
-						} else {
-							SmedAction.panelMain.mark.setLightAtt(Att.COL, 0, col);
-							SmedAction.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));
-							SmedAction.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));
-						}
-						button.setBorderPainted(true);
-					} else {
-						if (button == delButton) {
-							SmedAction.panelMain.mark.subColour(ent, stackIdx);
-						} else if (button == addButton) {
-							if (stackCol.size() != 0)
-								stackIdx++;
-							if (stackCol.size() == 0)
-								SmedAction.panelMain.mark.setColour(ent, col);
-							else
-								switch (SmedAction.panelMain.mark.getPattern(ent)) {
-								case NOPAT:
-									break;
-								case BORDER:
-								case CROSS:
-									if (stackCol.size() < 2)
-										SmedAction.panelMain.mark.addColour(ent, stackIdx, col);
-									break;
-								case SQUARED:
-									if (stackCol.size() < 4)
-										SmedAction.panelMain.mark.addColour(ent, stackIdx, col);
-									break;
-								default:
-									SmedAction.panelMain.mark.addColour(ent, stackIdx, col);
-									break;
-								}
-						} else {
-							SmedAction.panelMain.mark.setColour(ent, stackIdx, col);
-						}
-						syncPanel();
-					}
-				} else {
-					button.setBorderPainted(false);
-				}
-			}
-		}
-	};
-	private JPanel stack;
-	private ButtonGroup stackColours = new ButtonGroup();
-	private ArrayList<JRadioButton> stackCol = new ArrayList<>();
-	private int stackIdx = 0;
-	private ActionListener alStack = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (int i = 0; stackCol.size() > i; i++) {
-				JRadioButton button = stackCol.get(i);
-				if (button.isSelected()) {
-					stackIdx = i;
-					button.setBorderPainted(true);
-				} else {
-					button.setBorderPainted(false);
-				}
-			}
-		}
-	};
-
-	public PanelCol(SmedAction dia, Ent entity) {
-		dlg = dia;
-		ent = entity;
-		setLayout(null);
-		add(getColButton(delButton, 0, 0, 34, 16, Messages.getString("RemColour"), Col.UNKCOL));
-		add(getColButton(whiteButton, 0, 16, 34, 16, Messages.getString("White"), Col.WHITE));
-		add(getColButton(redButton, 0, 32, 34, 16, Messages.getString("Red"), Col.RED));
-		add(getColButton(orangeButton, 0, 48, 34, 16, Messages.getString("Orange"), Col.ORANGE));
-		add(getColButton(amberButton, 0, 64, 34, 16, Messages.getString("Amber"), Col.AMBER));
-		add(getColButton(yellowButton, 0, 80, 34, 16, Messages.getString("Yellow"), Col.YELLOW));
-		add(getColButton(greenButton, 0, 96, 34, 16, Messages.getString("Green"), Col.GREEN));
-		add(getColButton(blueButton, 0, 112, 34, 16, Messages.getString("Blue"), Col.BLUE));
-		add(getColButton(violetButton, 0, 128, 34, 16, Messages.getString("Violet"), Col.VIOLET));
-		if (ent != Ent.LIGHT) {
-			add(getColButton(addButton, 0, 144, 34, 16, Messages.getString("AddColour"), Col.BLANK));
-			add(getColButton(blackButton, 37, 0, 34, 16, Messages.getString("Black"), Col.BLACK));
-			add(getColButton(greyButton, 37, 16, 34, 16, Messages.getString("Grey"), Col.GREY));
-			add(getColButton(brownButton, 37, 32, 34, 16, Messages.getString("Brown"), Col.BROWN));
-			add(getColButton(magentaButton, 37, 48, 34, 16, Messages.getString("Magenta"), Col.MAGENTA));
-			add(getColButton(pinkButton, 37, 64, 34, 16, Messages.getString("Pink"), Col.PINK));
-
-			stack = new JPanel();
-			stack.setBorder(BorderFactory.createLineBorder(Color.black, 2));
-			stack.setBounds(38, 87, 34, 64);
-			stack.setLayout(null);
-			add(stack);
-		}
-	}
-
-	public void trimStack(int max) {
-		while (stackCol.size() > max) {
-			stackCol.get(stackCol.size() - 1).setSelected(true);
-			delButton.doClick();
-		}
-	}
-
-	public void syncPanel() {
-		if (ent == Ent.LIGHT) {
-			for (Col col : colours.keySet()) {
-				JRadioButton button = colours.get(col);
-				if (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) == col) {
-					button.setBorderPainted(true);
-				} else
-					button.setBorderPainted(false);
-			}
-		} else {
-			int idx;
-			for (idx = 0; SmedAction.panelMain.mark.getColour(ent, idx) != Col.UNKCOL; idx++) {
-				if (stackCol.size() <= idx) {
-					stackCol.add(idx, new JRadioButton(new ImageIcon(getClass().getResource("/images/ColourButton.png"))));
-					JRadioButton btnI = stackCol.get(idx);
-					btnI.setBorder(BorderFactory.createLoweredBevelBorder());
-					stack.add(btnI);
-					stackColours.add(btnI);
-					btnI.addActionListener(alStack);
-				}
-			}
-			while (idx < stackCol.size()) {
-				JRadioButton btnI = stackCol.get(idx);
-				btnI.removeActionListener(alStack);
-				stackColours.remove(btnI);
-				stack.remove(btnI);
-				stackCol.remove(idx);
-			}
-			if (stackIdx >= stackCol.size())
-				stackIdx = stackCol.size() - 1;
-			if (stackIdx < 0)
-				stackIdx = 0;
-			if (stackCol.size() == 0) {
-				stack.repaint();
-			} else {
-				int height = 60 / stackCol.size();
-				for (idx = 0; stackCol.size() > idx; idx++) {
-					JRadioButton btnI = stackCol.get(idx);
-					btnI.setBounds(2, (2 + (idx * height)), 30, height);
-					btnI.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getColour(ent, idx)));
-					if (stackIdx == idx) {
-						btnI.setBorderPainted(true);
-					} else {
-						btnI.setBorderPainted(false);
-					}
-				}
-			}
-		}
-	}
-
-	private JRadioButton getColButton(JRadioButton button, int x, int y, int w, int h, String tip, Col col) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(tr(tip));
-		button.addActionListener(alColour);
-		colourButtons.add(button);
-		colours.put(col, button);
-		return button;
-	}
+    private SmedAction dlg;
+    private Ent ent;
+    private ButtonGroup colourButtons = new ButtonGroup();
+    public JRadioButton delButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DelButton.png")));
+    public JRadioButton addButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/AddButton.png")));
+    public JRadioButton whiteButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WhiteButton.png")));
+    public JRadioButton redButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RedButton.png")));
+    public JRadioButton greenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreenButton.png")));
+    public JRadioButton yellowButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/YellowButton.png")));
+    public JRadioButton orangeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OrangeButton.png")));
+    public JRadioButton amberButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/AmberButton.png")));
+    public JRadioButton blueButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlueButton.png")));
+    public JRadioButton violetButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/VioletButton.png")));
+    public JRadioButton blackButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlackButton.png")));
+    public JRadioButton greyButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreyButton.png")));
+    public JRadioButton brownButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BrownButton.png")));
+    public JRadioButton magentaButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/MagentaButton.png")));
+    public JRadioButton pinkButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PinkButton.png")));
+    public EnumMap<Col, JRadioButton> colours = new EnumMap<>(Col.class);
+    private ActionListener alColour = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Col col : colours.keySet()) {
+                JRadioButton button = colours.get(col);
+                if (button.isSelected()) {
+                    if (ent == Ent.LIGHT) {
+                        if (((String) SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0)).contains("Al")) {
+                            if (((button == delButton) && (SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0) == Col.UNKCOL))
+                                    || (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) == Col.UNKCOL)) {
+                                SmedAction.panelMain.mark.setLightAtt(Att.COL, 0, col);
+                                SmedAction.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));
+                            } else {
+                                SmedAction.panelMain.mark.setLightAtt(Att.ALT, 0, col);
+                                SmedAction.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));
+                            }
+                        } else {
+                            SmedAction.panelMain.mark.setLightAtt(Att.COL, 0, col);
+                            SmedAction.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));
+                            SmedAction.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));
+                        }
+                        button.setBorderPainted(true);
+                    } else {
+                        if (button == delButton) {
+                            SmedAction.panelMain.mark.subColour(ent, stackIdx);
+                        } else if (button == addButton) {
+                            if (stackCol.size() != 0) {
+                                stackIdx++;
+                            }
+                            if (stackCol.size() == 0) {
+                                SmedAction.panelMain.mark.setColour(ent, col);
+                            } else {
+                                switch (SmedAction.panelMain.mark.getPattern(ent)) {
+                                case NOPAT:
+                                    break;
+                                case BORDER:
+                                case CROSS:
+                                    if (stackCol.size() < 2) {
+                                        SmedAction.panelMain.mark.addColour(ent, stackIdx, col);
+                                    }
+                                    break;
+                                case SQUARED:
+                                    if (stackCol.size() < 4) {
+                                        SmedAction.panelMain.mark.addColour(ent, stackIdx, col);
+                                    }
+                                    break;
+                                default:
+                                    SmedAction.panelMain.mark.addColour(ent, stackIdx, col);
+                                    break;
+                                }
+                            }
+                        } else {
+                            SmedAction.panelMain.mark.setColour(ent, stackIdx, col);
+                        }
+                        syncPanel();
+                    }
+                } else {
+                    button.setBorderPainted(false);
+                }
+            }
+        }
+    };
+    private JPanel stack;
+    private ButtonGroup stackColours = new ButtonGroup();
+    private ArrayList<JRadioButton> stackCol = new ArrayList<>();
+    private int stackIdx = 0;
+    private ActionListener alStack = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (int i = 0; stackCol.size() > i; i++) {
+                JRadioButton button = stackCol.get(i);
+                if (button.isSelected()) {
+                    stackIdx = i;
+                    button.setBorderPainted(true);
+                } else {
+                    button.setBorderPainted(false);
+                }
+            }
+        }
+    };
+
+    public PanelCol(SmedAction dia, Ent entity) {
+        dlg = dia;
+        ent = entity;
+        setLayout(null);
+        add(getColButton(delButton, 0, 0, 34, 16, Messages.getString("RemColour"), Col.UNKCOL));
+        add(getColButton(whiteButton, 0, 16, 34, 16, Messages.getString("White"), Col.WHITE));
+        add(getColButton(redButton, 0, 32, 34, 16, Messages.getString("Red"), Col.RED));
+        add(getColButton(orangeButton, 0, 48, 34, 16, Messages.getString("Orange"), Col.ORANGE));
+        add(getColButton(amberButton, 0, 64, 34, 16, Messages.getString("Amber"), Col.AMBER));
+        add(getColButton(yellowButton, 0, 80, 34, 16, Messages.getString("Yellow"), Col.YELLOW));
+        add(getColButton(greenButton, 0, 96, 34, 16, Messages.getString("Green"), Col.GREEN));
+        add(getColButton(blueButton, 0, 112, 34, 16, Messages.getString("Blue"), Col.BLUE));
+        add(getColButton(violetButton, 0, 128, 34, 16, Messages.getString("Violet"), Col.VIOLET));
+        if (ent != Ent.LIGHT) {
+            add(getColButton(addButton, 0, 144, 34, 16, Messages.getString("AddColour"), Col.BLANK));
+            add(getColButton(blackButton, 37, 0, 34, 16, Messages.getString("Black"), Col.BLACK));
+            add(getColButton(greyButton, 37, 16, 34, 16, Messages.getString("Grey"), Col.GREY));
+            add(getColButton(brownButton, 37, 32, 34, 16, Messages.getString("Brown"), Col.BROWN));
+            add(getColButton(magentaButton, 37, 48, 34, 16, Messages.getString("Magenta"), Col.MAGENTA));
+            add(getColButton(pinkButton, 37, 64, 34, 16, Messages.getString("Pink"), Col.PINK));
+
+            stack = new JPanel();
+            stack.setBorder(BorderFactory.createLineBorder(Color.black, 2));
+            stack.setBounds(38, 87, 34, 64);
+            stack.setLayout(null);
+            add(stack);
+        }
+    }
+
+    public void trimStack(int max) {
+        while (stackCol.size() > max) {
+            stackCol.get(stackCol.size() - 1).setSelected(true);
+            delButton.doClick();
+        }
+    }
+
+    public void syncPanel() {
+        if (ent == Ent.LIGHT) {
+            for (Col col : colours.keySet()) {
+                JRadioButton button = colours.get(col);
+                if (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) == col) {
+                    button.setBorderPainted(true);
+                } else {
+                    button.setBorderPainted(false);
+                }
+            }
+        } else {
+            int idx;
+            for (idx = 0; SmedAction.panelMain.mark.getColour(ent, idx) != Col.UNKCOL; idx++) {
+                if (stackCol.size() <= idx) {
+                    stackCol.add(idx, new JRadioButton(new ImageIcon(getClass().getResource("/images/ColourButton.png"))));
+                    JRadioButton btnI = stackCol.get(idx);
+                    btnI.setBorder(BorderFactory.createLoweredBevelBorder());
+                    stack.add(btnI);
+                    stackColours.add(btnI);
+                    btnI.addActionListener(alStack);
+                }
+            }
+            while (idx < stackCol.size()) {
+                JRadioButton btnI = stackCol.get(idx);
+                btnI.removeActionListener(alStack);
+                stackColours.remove(btnI);
+                stack.remove(btnI);
+                stackCol.remove(idx);
+            }
+            if (stackIdx >= stackCol.size()) {
+                stackIdx = stackCol.size() - 1;
+            }
+            if (stackIdx < 0) {
+                stackIdx = 0;
+            }
+            if (stackCol.size() == 0) {
+                stack.repaint();
+            } else {
+                int height = 60 / stackCol.size();
+                for (idx = 0; stackCol.size() > idx; idx++) {
+                    JRadioButton btnI = stackCol.get(idx);
+                    btnI.setBounds(2, (2 + (idx * height)), 30, height);
+                    btnI.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getColour(ent, idx)));
+                    if (stackIdx == idx) {
+                        btnI.setBorderPainted(true);
+                    } else {
+                        btnI.setBorderPainted(false);
+                    }
+                }
+            }
+        }
+    }
+
+    private JRadioButton getColButton(JRadioButton button, int x, int y, int w, int h, String tip, Col col) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(tr(tip));
+        button.addActionListener(alColour);
+        colourButtons.add(button);
+        colours.put(col, button);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelFog.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelFog.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelFog.java	(revision 32767)
@@ -1,140 +1,157 @@
 package panels;
 
-import javax.swing.*;
-
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
 import java.util.EnumMap;
 
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import javax.swing.SwingConstants;
+
 import messages.Messages;
+import seamarks.SeaMark.Fog;
 import smed.SmedAction;
-import seamarks.SeaMark.*;
 
 public class PanelFog extends JPanel {
 
-	private SmedAction dlg;
-	private ButtonGroup fogButtons = new ButtonGroup();
-	public JRadioButton noFogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png")));
-	public JRadioButton yesFogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogYesButton.png")));
-	public JRadioButton hornButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogHornButton.png")));
-	public JRadioButton sirenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogSirenButton.png")));
-	public JRadioButton diaButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogDiaButton.png")));
-	public JRadioButton bellButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogBellButton.png")));
-	public JRadioButton whisButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogWhisButton.png")));
-	public JRadioButton gongButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogGongButton.png")));
-	public JRadioButton explosButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogExplosButton.png")));
-	private EnumMap<Fog, JRadioButton> fogs = new EnumMap<>(Fog.class);
-	private ActionListener alFog = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Fog fog : fogs.keySet()) {
-				JRadioButton button = fogs.get(fog);
-				if (button.isSelected()) {
-					SmedAction.panelMain.mark.setFogSound(fog);
-					button.setBorderPainted(true);
-				} else
-					button.setBorderPainted(false);
-			}
-		}
-	};
-	public JLabel groupLabel;
-	public JTextField groupBox;
-	private FocusListener flGroup = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setFogGroup(groupBox.getText());
-		}
-	};
-	public JLabel periodLabel;
-	public JTextField periodBox;
-	private FocusListener flPeriod = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setFogPeriod(periodBox.getText());
-		}
-	};
-	public JLabel seqLabel;
-	public JTextField seqBox;
-	private FocusListener flSeq = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setFogSequence(seqBox.getText());
-		}
-	};
-	public JLabel rangeLabel;
-	public JTextField rangeBox;
-	private FocusListener flRange = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setFogRange(rangeBox.getText());
-		}
-	};
+    private SmedAction dlg;
+    private ButtonGroup fogButtons = new ButtonGroup();
+    public JRadioButton noFogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png")));
+    public JRadioButton yesFogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogYesButton.png")));
+    public JRadioButton hornButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogHornButton.png")));
+    public JRadioButton sirenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogSirenButton.png")));
+    public JRadioButton diaButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogDiaButton.png")));
+    public JRadioButton bellButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogBellButton.png")));
+    public JRadioButton whisButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogWhisButton.png")));
+    public JRadioButton gongButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogGongButton.png")));
+    public JRadioButton explosButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogExplosButton.png")));
+    private EnumMap<Fog, JRadioButton> fogs = new EnumMap<>(Fog.class);
+    private ActionListener alFog = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Fog fog : fogs.keySet()) {
+                JRadioButton button = fogs.get(fog);
+                if (button.isSelected()) {
+                    SmedAction.panelMain.mark.setFogSound(fog);
+                    button.setBorderPainted(true);
+                } else {
+                    button.setBorderPainted(false);
+                }
+            }
+        }
+    };
+    public JLabel groupLabel;
+    public JTextField groupBox;
+    private FocusListener flGroup = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setFogGroup(groupBox.getText());
+        }
+    };
+    public JLabel periodLabel;
+    public JTextField periodBox;
+    private FocusListener flPeriod = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setFogPeriod(periodBox.getText());
+        }
+    };
+    public JLabel seqLabel;
+    public JTextField seqBox;
+    private FocusListener flSeq = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setFogSequence(seqBox.getText());
+        }
+    };
+    public JLabel rangeLabel;
+    public JTextField rangeBox;
+    private FocusListener flRange = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setFogRange(rangeBox.getText());
+        }
+    };
 
-	public PanelFog(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		add(getFogButton(noFogButton, 0, 2, 27, 27, "NoFog", Fog.NOFOG));
-		add(getFogButton(yesFogButton, 0, 32, 27, 27, "FogSignal", Fog.FOGSIG));
-		add(getFogButton(hornButton, 0, 62, 27, 27, "Horn", Fog.HORN));
-		add(getFogButton(sirenButton, 0, 92, 27, 27, "Siren", Fog.SIREN));
-		add(getFogButton(gongButton, 0, 122, 27, 27, "Gong", Fog.GONG));
-		add(getFogButton(diaButton, 30, 2, 27, 27, "Diaphone", Fog.DIA));
-		add(getFogButton(bellButton, 30, 32, 27, 27, "Bell", Fog.BELL));
-		add(getFogButton(whisButton, 30, 62, 27, 27, "Whistle", Fog.WHIS));
-		add(getFogButton(explosButton, 30, 92, 27, 27, "Explosion", Fog.EXPLOS));
+    public PanelFog(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        add(getFogButton(noFogButton, 0, 2, 27, 27, "NoFog", Fog.NOFOG));
+        add(getFogButton(yesFogButton, 0, 32, 27, 27, "FogSignal", Fog.FOGSIG));
+        add(getFogButton(hornButton, 0, 62, 27, 27, "Horn", Fog.HORN));
+        add(getFogButton(sirenButton, 0, 92, 27, 27, "Siren", Fog.SIREN));
+        add(getFogButton(gongButton, 0, 122, 27, 27, "Gong", Fog.GONG));
+        add(getFogButton(diaButton, 30, 2, 27, 27, "Diaphone", Fog.DIA));
+        add(getFogButton(bellButton, 30, 32, 27, 27, "Bell", Fog.BELL));
+        add(getFogButton(whisButton, 30, 62, 27, 27, "Whistle", Fog.WHIS));
+        add(getFogButton(explosButton, 30, 92, 27, 27, "Explosion", Fog.EXPLOS));
 
-		groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER);
-		groupLabel.setBounds(new Rectangle(75, 0, 100, 20));
-		add(groupLabel);
-		groupBox = new JTextField();
-		groupBox.setBounds(new Rectangle(100, 20, 50, 20));
-		groupBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(groupBox);
-		groupBox.addFocusListener(flGroup);
+        groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER);
+        groupLabel.setBounds(new Rectangle(75, 0, 100, 20));
+        add(groupLabel);
+        groupBox = new JTextField();
+        groupBox.setBounds(new Rectangle(100, 20, 50, 20));
+        groupBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(groupBox);
+        groupBox.addFocusListener(flGroup);
 
-		periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER);
-		periodLabel.setBounds(new Rectangle(75, 40, 100, 20));
-		add(periodLabel);
-		periodBox = new JTextField();
-		periodBox.setBounds(new Rectangle(100, 60, 50, 20));
-		periodBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(periodBox);
-		periodBox.addFocusListener(flPeriod);
+        periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER);
+        periodLabel.setBounds(new Rectangle(75, 40, 100, 20));
+        add(periodLabel);
+        periodBox = new JTextField();
+        periodBox.setBounds(new Rectangle(100, 60, 50, 20));
+        periodBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(periodBox);
+        periodBox.addFocusListener(flPeriod);
 
-		seqLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER);
-		seqLabel.setBounds(new Rectangle(75, 80, 100, 20));
-		add(seqLabel);
-		seqBox = new JTextField();
-		seqBox.setBounds(new Rectangle(100, 100, 50, 20));
-		seqBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(seqBox);
-		seqBox.addFocusListener(flSeq);
+        seqLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER);
+        seqLabel.setBounds(new Rectangle(75, 80, 100, 20));
+        add(seqLabel);
+        seqBox = new JTextField();
+        seqBox.setBounds(new Rectangle(100, 100, 50, 20));
+        seqBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(seqBox);
+        seqBox.addFocusListener(flSeq);
 
-		rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER);
-		rangeLabel.setBounds(new Rectangle(75, 120, 100, 20));
-		add(rangeLabel);
-		rangeBox = new JTextField();
-		rangeBox.setBounds(new Rectangle(100, 140, 50, 20));
-		rangeBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(rangeBox);
-		rangeBox.addFocusListener(flRange);
+        rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER);
+        rangeLabel.setBounds(new Rectangle(75, 120, 100, 20));
+        add(rangeLabel);
+        rangeBox = new JTextField();
+        rangeBox.setBounds(new Rectangle(100, 140, 50, 20));
+        rangeBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(rangeBox);
+        rangeBox.addFocusListener(flRange);
 
-	}
+    }
 
-	public void syncPanel() {
-		for (Fog fog : fogs.keySet()) {
-			JRadioButton button = fogs.get(fog);
-			button.setBorderPainted(SmedAction.panelMain.mark.getFogSound() == fog);
-		}
-		groupBox.setText(SmedAction.panelMain.mark.getFogGroup());
-		seqBox.setText(SmedAction.panelMain.mark.getFogSequence());
-		periodBox.setText(SmedAction.panelMain.mark.getFogPeriod());
-		rangeBox.setText(SmedAction.panelMain.mark.getFogRange());
-	}
+    public void syncPanel() {
+        for (Fog fog : fogs.keySet()) {
+            JRadioButton button = fogs.get(fog);
+            button.setBorderPainted(SmedAction.panelMain.mark.getFogSound() == fog);
+        }
+        groupBox.setText(SmedAction.panelMain.mark.getFogGroup());
+        seqBox.setText(SmedAction.panelMain.mark.getFogSequence());
+        periodBox.setText(SmedAction.panelMain.mark.getFogPeriod());
+        rangeBox.setText(SmedAction.panelMain.mark.getFogRange());
+    }
 
-	private JRadioButton getFogButton(JRadioButton button, int x, int y, int w, int h, String tip, Fog fog) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alFog);
-		fogButtons.add(button);
-		fogs.put(fog, button);
-		return button;
-	}
+    private JRadioButton getFogButton(JRadioButton button, int x, int y, int w, int h, String tip, Fog fog) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alFog);
+        fogButtons.add(button);
+        fogs.put(fog, button);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelHaz.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelHaz.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelHaz.java	(revision 32767)
@@ -1,246 +1,264 @@
 package panels;
 
-import java.awt.event.*;
-import java.awt.*;
-
-import javax.swing.*;
-
-import java.util.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.EnumMap;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JToggleButton;
 
 import messages.Messages;
+import seamarks.SeaMark;
+import seamarks.SeaMark.Att;
+import seamarks.SeaMark.Cat;
+import seamarks.SeaMark.Col;
+import seamarks.SeaMark.Grp;
+import seamarks.SeaMark.Obj;
+import seamarks.SeaMark.Pat;
+import seamarks.SeaMark.Shp;
+import seamarks.SeaMark.Top;
 import smed.SmedAction;
-import seamarks.SeaMark;
-import seamarks.SeaMark.*;
 
 public class PanelHaz extends JPanel {
 
-	private SmedAction dlg;
-	public ButtonGroup catButtons = new ButtonGroup();
-	public JRadioButton northButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardNButton.png")));
-	public JRadioButton southButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardSButton.png")));
-	public JRadioButton eastButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardEButton.png")));
-	public JRadioButton westButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardWButton.png")));
-	public JRadioButton isolButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/IsolButton.png")));
-	private ActionListener alCat = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP);
-			if (northButton.isSelected()) {
-				SmedAction.panelMain.mark.setCategory(Cat.CAM_NORTH);
-				SmedAction.panelMain.mark.setObjColour(Col.BLACK);
-				SmedAction.panelMain.mark.addObjColour(Col.YELLOW);
-				northButton.setBorderPainted(true);
-			} else {
-				northButton.setBorderPainted(false);
-			}
-			if (southButton.isSelected()) {
-				SmedAction.panelMain.mark.setCategory(Cat.CAM_SOUTH);
-				SmedAction.panelMain.mark.setObjColour(Col.YELLOW);
-				SmedAction.panelMain.mark.addObjColour(Col.BLACK);
-				southButton.setBorderPainted(true);
-			} else {
-				southButton.setBorderPainted(false);
-			}
-			if (eastButton.isSelected()) {
-				SmedAction.panelMain.mark.setCategory(Cat.CAM_EAST);
-				SmedAction.panelMain.mark.setObjColour(Col.BLACK);
-				SmedAction.panelMain.mark.addObjColour(Col.YELLOW);
-				SmedAction.panelMain.mark.addObjColour(Col.BLACK);
-				eastButton.setBorderPainted(true);
-			} else {
-				eastButton.setBorderPainted(false);
-			}
-			if (westButton.isSelected()) {
-				SmedAction.panelMain.mark.setCategory(Cat.CAM_WEST);
-				SmedAction.panelMain.mark.setObjColour(Col.YELLOW);
-				SmedAction.panelMain.mark.addObjColour(Col.BLACK);
-				SmedAction.panelMain.mark.addObjColour(Col.YELLOW);
-				westButton.setBorderPainted(true);
-			} else {
-				westButton.setBorderPainted(false);
-			}
-			if (isolButton.isSelected()) {
-				SmedAction.panelMain.mark.setCategory(Cat.NOCAT);
-				SmedAction.panelMain.mark.setObjColour(Col.BLACK);
-				SmedAction.panelMain.mark.addObjColour(Col.RED);
-				SmedAction.panelMain.mark.addObjColour(Col.BLACK);
-				isolButton.setBorderPainted(true);
-			} else {
-				isolButton.setBorderPainted(false);
-			}
-			topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
-			lightButton.setVisible(SmedAction.panelMain.mark.testValid());
-			SmedAction.panelMain.panelMore.syncPanel();
-		}
-	};
-	private ButtonGroup shapeButtons = new ButtonGroup();
-	public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
-	public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
-	public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
-	public JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
-	public JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
-	public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
-	public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
-	public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
-	public EnumMap<Shp, JRadioButton> shapes = new EnumMap<>(Shp.class);
-	public EnumMap<Shp, Obj> carObjects = new EnumMap<>(Shp.class);
-	public EnumMap<Shp, Obj> isdObjects = new EnumMap<>(Shp.class);
-	private ActionListener alShape = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Shp shp : shapes.keySet()) {
-				JRadioButton button = shapes.get(shp);
-				if (button.isSelected()) {
-					SmedAction.panelMain.mark.setShape(shp);
-					if (isolButton.isSelected())
-						SmedAction.panelMain.mark.setObject(isdObjects.get(shp));
-					else
-						SmedAction.panelMain.mark.setObject(carObjects.get(shp));
-					button.setBorderPainted(true);
-				} else
-					button.setBorderPainted(false);
-			}
-			topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
-			lightButton.setVisible(SmedAction.panelMain.mark.testValid());
-		}
-	};
-	public JToggleButton topmarkButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/HazTopButton.png")));
-	private ActionListener alTop = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (topmarkButton.isSelected()) {
-				SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT);
-				SmedAction.panelMain.mark.setTopColour(Col.BLACK);
-				switch (SmedAction.panelMain.mark.getCategory()) {
-				case CAM_NORTH:
-					SmedAction.panelMain.mark.setTopmark(Top.NORTH);
-					break;
-				case CAM_SOUTH:
-					SmedAction.panelMain.mark.setTopmark(Top.SOUTH);
-					break;
-				case CAM_EAST:
-					SmedAction.panelMain.mark.setTopmark(Top.EAST);
-					break;
-				case CAM_WEST:
-					SmedAction.panelMain.mark.setTopmark(Top.WEST);
-					break;
-				default:
-					SmedAction.panelMain.mark.setTopmark(Top.SPHERES2);
-					break;
-				}
-				topmarkButton.setBorderPainted(true);
-			} else {
-				SmedAction.panelMain.mark.setTopmark(Top.NOTOP);
-				SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT);
-				SmedAction.panelMain.mark.setTopColour(Col.UNKCOL);
-				topmarkButton.setBorderPainted(false);
-			}
-			SmedAction.panelMain.panelTop.syncPanel();
-		}
-	};
-	public JToggleButton lightButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/DefLitButton.png")));
-	private ActionListener alLit = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (lightButton.isSelected()) {
-				SmedAction.panelMain.mark.setLightAtt(Att.COL, 0, Col.WHITE);
-				switch (SmedAction.panelMain.mark.getCategory()) {
-				case CAM_NORTH:
-					SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");
-					SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "");
-					break;
-				case CAM_SOUTH:
-					SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q+LFl");
-					SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "6");
-					break;
-				case CAM_EAST:
-					SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");
-					SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "3");
-					break;
-				case CAM_WEST:
-					SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");
-					SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "9");
-					break;
-				default:
-					SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Fl");
-					SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "2");
-					break;
-				}
-				lightButton.setBorderPainted(true);
-			} else {
-				SmedAction.panelMain.mark.clrLight();
-				lightButton.setBorderPainted(false);
-			}
-			SmedAction.panelMain.panelLit.syncPanel();
-		}
-	};
-
-	public PanelHaz(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		add(getCatButton(northButton, 0, 0, 52, 32, "North"));
-		add(getCatButton(southButton, 0, 32, 52, 32, "South"));
-		add(getCatButton(eastButton, 0, 64, 52, 32, "East"));
-		add(getCatButton(westButton, 0, 96, 52, 32, "West"));
-		add(getCatButton(isolButton, 0, 128, 52, 32, "Isol"));
-
-		add(getShapeButton(pillarButton, 55, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYCAR, Obj.BOYISD));
-		add(getShapeButton(sparButton, 55, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYCAR, Obj.BOYISD));
-		add(getShapeButton(canButton, 55, 64, 34, 32, "Can", Shp.CAN, Obj.BOYCAR, Obj.BOYISD));
-		add(getShapeButton(coneButton, 55, 96, 34, 32, "Cone", Shp.CONI, Obj.BOYCAR, Obj.BOYISD));
-		add(getShapeButton(sphereButton, 55, 128, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYCAR, Obj.BOYISD));
-		add(getShapeButton(floatButton, 90, 0, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT, Obj.LITFLT));
-		add(getShapeButton(beaconButton, 90, 32, 34, 32, "Beacon", Shp.BEACON, Obj.BCNCAR, Obj.BCNISD));
-		add(getShapeButton(towerButton, 90, 64, 34, 32, "TowerB", Shp.TOWER, Obj.BCNCAR, Obj.BCNISD));
-
-		topmarkButton.setBounds(new Rectangle(130, 0, 34, 32));
-		topmarkButton.setToolTipText(Messages.getString("Topmark"));
-		topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder());
-		topmarkButton.addActionListener(alTop);
-		topmarkButton.setVisible(false);
-		add(topmarkButton);
-		lightButton.setBounds(new Rectangle(130, 32, 34, 32));
-		lightButton.setToolTipText(Messages.getString("Light"));
-		lightButton.setBorder(BorderFactory.createLoweredBevelBorder());
-		lightButton.addActionListener(alLit);
-		lightButton.setVisible(false);
-		add(lightButton);
-	}
-
-	public void syncPanel() {
-		northButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_NORTH);
-		southButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_SOUTH);
-		eastButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_EAST);
-		westButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_WEST);
-		isolButton.setBorderPainted(SeaMark.GrpMAP.get(SmedAction.panelMain.mark.getObject()) == Grp.ISD);
-		for (Shp shp : shapes.keySet()) {
-			JRadioButton button = shapes.get(shp);
-			button.setBorderPainted(SmedAction.panelMain.mark.getShape() == shp);
-		}
-		topmarkButton.setBorderPainted(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP);
-		topmarkButton.setSelected(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP);
-		topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
-		Boolean lit = (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) != Col.UNKCOL) && !((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0)).isEmpty();
-		lightButton.setBorderPainted(lit);
-		lightButton.setSelected(lit);
-		lightButton.setVisible(SmedAction.panelMain.mark.testValid());
-	}
-
-	private JRadioButton getCatButton(JRadioButton button, int x, int y, int w, int h, String tip) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alCat);
-		catButtons.add(button);
-		return button;
-	}
-
-	private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj car, Obj isd) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alShape);
-		shapeButtons.add(button);
-		shapes.put(shp, button);
-		carObjects.put(shp, car);
-		isdObjects.put(shp, isd);
-		return button;
-	}
+    private SmedAction dlg;
+    public ButtonGroup catButtons = new ButtonGroup();
+    public JRadioButton northButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardNButton.png")));
+    public JRadioButton southButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardSButton.png")));
+    public JRadioButton eastButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardEButton.png")));
+    public JRadioButton westButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardWButton.png")));
+    public JRadioButton isolButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/IsolButton.png")));
+    private ActionListener alCat = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP);
+            if (northButton.isSelected()) {
+                SmedAction.panelMain.mark.setCategory(Cat.CAM_NORTH);
+                SmedAction.panelMain.mark.setObjColour(Col.BLACK);
+                SmedAction.panelMain.mark.addObjColour(Col.YELLOW);
+                northButton.setBorderPainted(true);
+            } else {
+                northButton.setBorderPainted(false);
+            }
+            if (southButton.isSelected()) {
+                SmedAction.panelMain.mark.setCategory(Cat.CAM_SOUTH);
+                SmedAction.panelMain.mark.setObjColour(Col.YELLOW);
+                SmedAction.panelMain.mark.addObjColour(Col.BLACK);
+                southButton.setBorderPainted(true);
+            } else {
+                southButton.setBorderPainted(false);
+            }
+            if (eastButton.isSelected()) {
+                SmedAction.panelMain.mark.setCategory(Cat.CAM_EAST);
+                SmedAction.panelMain.mark.setObjColour(Col.BLACK);
+                SmedAction.panelMain.mark.addObjColour(Col.YELLOW);
+                SmedAction.panelMain.mark.addObjColour(Col.BLACK);
+                eastButton.setBorderPainted(true);
+            } else {
+                eastButton.setBorderPainted(false);
+            }
+            if (westButton.isSelected()) {
+                SmedAction.panelMain.mark.setCategory(Cat.CAM_WEST);
+                SmedAction.panelMain.mark.setObjColour(Col.YELLOW);
+                SmedAction.panelMain.mark.addObjColour(Col.BLACK);
+                SmedAction.panelMain.mark.addObjColour(Col.YELLOW);
+                westButton.setBorderPainted(true);
+            } else {
+                westButton.setBorderPainted(false);
+            }
+            if (isolButton.isSelected()) {
+                SmedAction.panelMain.mark.setCategory(Cat.NOCAT);
+                SmedAction.panelMain.mark.setObjColour(Col.BLACK);
+                SmedAction.panelMain.mark.addObjColour(Col.RED);
+                SmedAction.panelMain.mark.addObjColour(Col.BLACK);
+                isolButton.setBorderPainted(true);
+            } else {
+                isolButton.setBorderPainted(false);
+            }
+            topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
+            lightButton.setVisible(SmedAction.panelMain.mark.testValid());
+            SmedAction.panelMain.panelMore.syncPanel();
+        }
+    };
+    private ButtonGroup shapeButtons = new ButtonGroup();
+    public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
+    public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
+    public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
+    public JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
+    public JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
+    public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
+    public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
+    public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
+    public EnumMap<Shp, JRadioButton> shapes = new EnumMap<>(Shp.class);
+    public EnumMap<Shp, Obj> carObjects = new EnumMap<>(Shp.class);
+    public EnumMap<Shp, Obj> isdObjects = new EnumMap<>(Shp.class);
+    private ActionListener alShape = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Shp shp : shapes.keySet()) {
+                JRadioButton button = shapes.get(shp);
+                if (button.isSelected()) {
+                    SmedAction.panelMain.mark.setShape(shp);
+                    if (isolButton.isSelected()) {
+                        SmedAction.panelMain.mark.setObject(isdObjects.get(shp));
+                    } else {
+                        SmedAction.panelMain.mark.setObject(carObjects.get(shp));
+                    }
+                    button.setBorderPainted(true);
+                } else {
+                    button.setBorderPainted(false);
+                }
+            }
+            topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
+            lightButton.setVisible(SmedAction.panelMain.mark.testValid());
+        }
+    };
+    public JToggleButton topmarkButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/HazTopButton.png")));
+    private ActionListener alTop = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if (topmarkButton.isSelected()) {
+                SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT);
+                SmedAction.panelMain.mark.setTopColour(Col.BLACK);
+                switch (SmedAction.panelMain.mark.getCategory()) {
+                case CAM_NORTH:
+                    SmedAction.panelMain.mark.setTopmark(Top.NORTH);
+                    break;
+                case CAM_SOUTH:
+                    SmedAction.panelMain.mark.setTopmark(Top.SOUTH);
+                    break;
+                case CAM_EAST:
+                    SmedAction.panelMain.mark.setTopmark(Top.EAST);
+                    break;
+                case CAM_WEST:
+                    SmedAction.panelMain.mark.setTopmark(Top.WEST);
+                    break;
+                default:
+                    SmedAction.panelMain.mark.setTopmark(Top.SPHERES2);
+                    break;
+                }
+                topmarkButton.setBorderPainted(true);
+            } else {
+                SmedAction.panelMain.mark.setTopmark(Top.NOTOP);
+                SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT);
+                SmedAction.panelMain.mark.setTopColour(Col.UNKCOL);
+                topmarkButton.setBorderPainted(false);
+            }
+            SmedAction.panelMain.panelTop.syncPanel();
+        }
+    };
+    public JToggleButton lightButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/DefLitButton.png")));
+    private ActionListener alLit = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if (lightButton.isSelected()) {
+                SmedAction.panelMain.mark.setLightAtt(Att.COL, 0, Col.WHITE);
+                switch (SmedAction.panelMain.mark.getCategory()) {
+                case CAM_NORTH:
+                    SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");
+                    SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "");
+                    break;
+                case CAM_SOUTH:
+                    SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q+LFl");
+                    SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "6");
+                    break;
+                case CAM_EAST:
+                    SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");
+                    SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "3");
+                    break;
+                case CAM_WEST:
+                    SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");
+                    SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "9");
+                    break;
+                default:
+                    SmedAction.panelMain.mark.setLightAtt(Att.CHR, 0, "Fl");
+                    SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, "2");
+                    break;
+                }
+                lightButton.setBorderPainted(true);
+            } else {
+                SmedAction.panelMain.mark.clrLight();
+                lightButton.setBorderPainted(false);
+            }
+            SmedAction.panelMain.panelLit.syncPanel();
+        }
+    };
+
+    public PanelHaz(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        add(getCatButton(northButton, 0, 0, 52, 32, "North"));
+        add(getCatButton(southButton, 0, 32, 52, 32, "South"));
+        add(getCatButton(eastButton, 0, 64, 52, 32, "East"));
+        add(getCatButton(westButton, 0, 96, 52, 32, "West"));
+        add(getCatButton(isolButton, 0, 128, 52, 32, "Isol"));
+
+        add(getShapeButton(pillarButton, 55, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYCAR, Obj.BOYISD));
+        add(getShapeButton(sparButton, 55, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYCAR, Obj.BOYISD));
+        add(getShapeButton(canButton, 55, 64, 34, 32, "Can", Shp.CAN, Obj.BOYCAR, Obj.BOYISD));
+        add(getShapeButton(coneButton, 55, 96, 34, 32, "Cone", Shp.CONI, Obj.BOYCAR, Obj.BOYISD));
+        add(getShapeButton(sphereButton, 55, 128, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYCAR, Obj.BOYISD));
+        add(getShapeButton(floatButton, 90, 0, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT, Obj.LITFLT));
+        add(getShapeButton(beaconButton, 90, 32, 34, 32, "Beacon", Shp.BEACON, Obj.BCNCAR, Obj.BCNISD));
+        add(getShapeButton(towerButton, 90, 64, 34, 32, "TowerB", Shp.TOWER, Obj.BCNCAR, Obj.BCNISD));
+
+        topmarkButton.setBounds(new Rectangle(130, 0, 34, 32));
+        topmarkButton.setToolTipText(Messages.getString("Topmark"));
+        topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder());
+        topmarkButton.addActionListener(alTop);
+        topmarkButton.setVisible(false);
+        add(topmarkButton);
+        lightButton.setBounds(new Rectangle(130, 32, 34, 32));
+        lightButton.setToolTipText(Messages.getString("Light"));
+        lightButton.setBorder(BorderFactory.createLoweredBevelBorder());
+        lightButton.addActionListener(alLit);
+        lightButton.setVisible(false);
+        add(lightButton);
+    }
+
+    public void syncPanel() {
+        northButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_NORTH);
+        southButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_SOUTH);
+        eastButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_EAST);
+        westButton.setBorderPainted(SmedAction.panelMain.mark.getCategory() == Cat.CAM_WEST);
+        isolButton.setBorderPainted(SeaMark.GrpMAP.get(SmedAction.panelMain.mark.getObject()) == Grp.ISD);
+        for (Shp shp : shapes.keySet()) {
+            JRadioButton button = shapes.get(shp);
+            button.setBorderPainted(SmedAction.panelMain.mark.getShape() == shp);
+        }
+        topmarkButton.setBorderPainted(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP);
+        topmarkButton.setSelected(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP);
+        topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
+        Boolean lit = (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) != Col.UNKCOL) && !((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0)).isEmpty();
+        lightButton.setBorderPainted(lit);
+        lightButton.setSelected(lit);
+        lightButton.setVisible(SmedAction.panelMain.mark.testValid());
+    }
+
+    private JRadioButton getCatButton(JRadioButton button, int x, int y, int w, int h, String tip) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alCat);
+        catButtons.add(button);
+        return button;
+    }
+
+    private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj car, Obj isd) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alShape);
+        shapeButtons.add(button);
+        shapes.put(shp, button);
+        carObjects.put(shp, car);
+        isdObjects.put(shp, isd);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelLights.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelLights.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelLights.java	(revision 32767)
@@ -1,609 +1,646 @@
 package panels;
 
-import java.awt.event.*;
-import java.awt.*;
-
-import javax.swing.*;
-
-import java.util.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.util.EnumMap;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import javax.swing.SwingConstants;
 
 import messages.Messages;
+import seamarks.SeaMark.Cat;
+import seamarks.SeaMark.Fnc;
+import seamarks.SeaMark.Obj;
+import seamarks.SeaMark.Shp;
 import smed.SmedAction;
-import seamarks.SeaMark.*;
 
 public class PanelLights extends JPanel {
 
-	private SmedAction dlg;
-
-	public JLabel categoryLabel;
-
-	public JComboBox<String> landCatBox;
-	public EnumMap<Cat, Integer> landCats = new EnumMap<>(Cat.class);
-	private ActionListener alLandCatBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cat cat : landCats.keySet()) {
-				int idx = landCats.get(cat);
-				if (dlg.node != null && (idx == landCatBox.getSelectedIndex())) {
-					SmedAction.panelMain.mark.setCategory(cat);
-					SmedAction.panelMain.mark.testValid();
-				}
-			}
-		}
-	};
-	public JComboBox<String> trafficCatBox;
-	public EnumMap<Cat, Integer> trafficCats = new EnumMap<>(Cat.class);
-	private ActionListener alTrafficCatBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cat cat : trafficCats.keySet()) {
-				int idx = trafficCats.get(cat);
-				if (dlg.node != null && (idx == trafficCatBox.getSelectedIndex())) {
-					SmedAction.panelMain.mark.setCategory(cat);
-					SmedAction.panelMain.mark.testValid();
-				}
-			}
-		}
-	};
-	public JComboBox<String> warningCatBox;
-	public EnumMap<Cat, Integer> warningCats = new EnumMap<>(Cat.class);
-	private ActionListener alWarningCatBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cat cat : warningCats.keySet()) {
-				int idx = warningCats.get(cat);
-				if (dlg.node != null && (idx == warningCatBox.getSelectedIndex())) {
-					SmedAction.panelMain.mark.setCategory(cat);
-					SmedAction.panelMain.mark.testValid();
-				}
-			}
-		}
-	};
-	public JComboBox<String> platformCatBox;
-	public EnumMap<Cat, Integer> platformCats = new EnumMap<>(Cat.class);
-	private ActionListener alPlatformCatBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cat cat : platformCats.keySet()) {
-				int idx = platformCats.get(cat);
-				if (dlg.node != null && (idx == platformCatBox.getSelectedIndex())) {
-					SmedAction.panelMain.mark.setCategory(cat);
-					SmedAction.panelMain.mark.testValid();
-				}
-			}
-		}
-	};
-	public JComboBox<String> pilotCatBox;
-	public EnumMap<Cat, Integer> pilotCats = new EnumMap<>(Cat.class);
-	private ActionListener alPilotCatBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cat cat : pilotCats.keySet()) {
-				int idx = pilotCats.get(cat);
-				if (dlg.node != null && (idx == pilotCatBox.getSelectedIndex())) {
-					SmedAction.panelMain.mark.setCategory(cat);
-					SmedAction.panelMain.mark.testValid();
-				}
-			}
-		}
-	};
-	public JComboBox<String> rescueCatBox;
-	public EnumMap<Cat, Integer> rescueCats = new EnumMap<>(Cat.class);
-	private ActionListener alRescueCatBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cat cat : rescueCats.keySet()) {
-				int idx = rescueCats.get(cat);
-				if (dlg.node != null && (idx == rescueCatBox.getSelectedIndex())) {
-					SmedAction.panelMain.mark.setCategory(cat);
-					SmedAction.panelMain.mark.testValid();
-				}
-			}
-		}
-	};
-	public JComboBox<String> radioCatBox;
-	public EnumMap<Cat, Integer> radioCats = new EnumMap<>(Cat.class);
-	private ActionListener alRadioCatBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cat cat : radioCats.keySet()) {
-				int idx = radioCats.get(cat);
-				if (dlg.node != null && (idx == radioCatBox.getSelectedIndex())) {
-					SmedAction.panelMain.mark.setCategory(cat);
-					SmedAction.panelMain.mark.testValid();
-				}
-			}
-		}
-	};
-	public JComboBox<String> radarCatBox;
-	public EnumMap<Cat, Integer> radarCats = new EnumMap<>(Cat.class);
-	private ActionListener alRadarCatBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cat cat : radarCats.keySet()) {
-				int idx = radarCats.get(cat);
-				if (dlg.node != null && (idx == radarCatBox.getSelectedIndex())) {
-					SmedAction.panelMain.mark.setCategory(cat);
-					SmedAction.panelMain.mark.testValid();
-				}
-			}
-		}
-	};
-	public JLabel functionLabel;
-	public JComboBox<String> functionBox;
-	public EnumMap<Fnc, Integer> functions = new EnumMap<>(Fnc.class);
-	private ActionListener alfunctionBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Fnc fnc : functions.keySet()) {
-				int idx = functions.get(fnc);
-				if (dlg.node != null && (idx == functionBox.getSelectedIndex())) {
-					SmedAction.panelMain.mark.setFunc(fnc);
-					SmedAction.panelMain.mark.testValid();
-				}
-			}
-		}
-	};
-	private ButtonGroup objButtons = new ButtonGroup();
-	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")));
-	public JRadioButton landButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LandmarkButton.png")));
-	public JRadioButton trafficButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TrafficButton.png")));
-	public JRadioButton warningButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WarningButton.png")));
-	public JRadioButton platformButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PlatformButton.png")));
-	public JRadioButton coastguardButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CoastguardButton.png")));
-	public JRadioButton pilotButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PilotButton.png")));
-	public JRadioButton rescueButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RescueButton.png")));
-	public JRadioButton radioButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadioStationButton.png")));
-	public JRadioButton radarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarStationButton.png")));
-	public EnumMap<Obj, JRadioButton> objects = new EnumMap<>(Obj.class);
-	private ActionListener alObj = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Obj obj : objects.keySet()) {
-				JRadioButton button = objects.get(obj);
-				if (button.isSelected()) {
-					SmedAction.panelMain.mark.setObject(obj);
-					button.setBorderPainted(true);
-				} else
-					button.setBorderPainted(false);
-			}
-			if (SmedAction.panelMain.mark.getObject() == Obj.LITVES)
-				SmedAction.panelMain.mark.setShape(Shp.SUPER);
-			else if (SmedAction.panelMain.mark.getObject() == Obj.LITFLT)
-				SmedAction.panelMain.mark.setShape(Shp.FLOAT);
-			else SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
-			functionLabel.setVisible(false);
-			categoryLabel.setVisible(false);
-			functionLabel.setVisible(false);
-			functionBox.setVisible(false);
-			landCatBox.setVisible(false);
-			trafficCatBox.setVisible(false);
-			warningCatBox.setVisible(false);
-			platformCatBox.setVisible(false);
-			pilotCatBox.setVisible(false);
-			rescueCatBox.setVisible(false);
-			radioCatBox.setVisible(false);
-			radarCatBox.setVisible(false);
-			chLabel.setVisible(false);
-			chBox.setVisible(false);
-			SmedAction.panelMain.mark.setCategory(Cat.NOCAT);
-			if (landButton.isSelected()) {
-				functionLabel.setVisible(true);
-				categoryLabel.setVisible(true);
-				functionBox.setVisible(true);
-				landCatBox.setVisible(true);
-				alLandCatBox.actionPerformed(null);
-			} else if (trafficButton.isSelected()) {
-				categoryLabel.setVisible(true);
-				trafficCatBox.setVisible(true);
-				chLabel.setVisible(true);
-				chBox.setVisible(true);
-				alTrafficCatBox.actionPerformed(null);
-			} else if (warningButton.isSelected()) {
-				categoryLabel.setVisible(true);
-				warningCatBox.setVisible(true);
-				chLabel.setVisible(true);
-				chBox.setVisible(true);
-				alWarningCatBox.actionPerformed(null);
-			} else if (platformButton.isSelected()) {
-				categoryLabel.setVisible(true);
-				platformCatBox.setVisible(true);
-				alPlatformCatBox.actionPerformed(null);
-			} else if (pilotButton.isSelected()) {
-				categoryLabel.setVisible(true);
-				pilotCatBox.setVisible(true);
-				chLabel.setVisible(true);
-				chBox.setVisible(true);
-				alPilotCatBox.actionPerformed(null);
-			} else if (rescueButton.isSelected()) {
-				categoryLabel.setVisible(true);
-				rescueCatBox.setVisible(true);
-				alRescueCatBox.actionPerformed(null);
-			} else if (radioButton.isSelected()) {
-				categoryLabel.setVisible(true);
-				radioCatBox.setVisible(true);
-				chLabel.setVisible(true);
-				chBox.setVisible(true);
-				alRadioCatBox.actionPerformed(null);
-			} else if (radarButton.isSelected()) {
-				categoryLabel.setVisible(true);
-				radarCatBox.setVisible(true);
-				chLabel.setVisible(true);
-				chBox.setVisible(true);
-				alRadarCatBox.actionPerformed(null);
-			}
-			SmedAction.panelMain.mark.testValid();
-		}
-	};
-	public JLabel chLabel;
-	public JTextField chBox;
-	private FocusListener flCh = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setChannel(chBox.getText());
-		}
-	};
-
-	public PanelLights(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		add(getObjButton(houseButton, 0, 0, 34, 32, "Lighthouse", Obj.LITHSE));
-		add(getObjButton(majorButton, 34, 0, 34, 32, "MajorLight", Obj.LITMAJ));
-		add(getObjButton(minorButton, 68, 0, 34, 32, "MinorLight", Obj.LITMIN));
-		add(getObjButton(landButton, 102, 0, 34, 32, "Landmark", Obj.LNDMRK));
-		add(getObjButton(platformButton, 136, 0, 34, 32, "Platform", Obj.OFSPLF));
-		add(getObjButton(vesselButton, 0, 32, 34, 32, "LightVessel", Obj.LITVES));
-		add(getObjButton(floatButton, 34, 32, 34, 32, "LightFloat", Obj.LITFLT));
-		add(getObjButton(trafficButton, 68, 32, 34, 32, "SSTraffic", Obj.SISTAT));
-		add(getObjButton(warningButton, 102, 32, 34, 32, "SSWarning", Obj.SISTAW));
-		add(getObjButton(coastguardButton, 0, 64, 34, 32, "CoastguardStation", Obj.CGUSTA));
-		add(getObjButton(pilotButton, 34, 64, 34, 32, "PilotBoarding", Obj.PILBOP));
-		add(getObjButton(rescueButton, 68, 64, 34, 32, "RescueStation", Obj.RSCSTA));
-		add(getObjButton(radioButton, 102, 64, 34, 32, "RadioStation", Obj.RDOSTA));
-		add(getObjButton(radarButton, 136, 64, 34, 32, "RadarStation", Obj.RADSTA));
-
-		functionLabel = new JLabel(Messages.getString("Function"), SwingConstants.CENTER);
-		functionLabel.setBounds(new Rectangle(5, 94, 160, 18));
-		add(functionLabel);
-		functionLabel.setVisible(false);
-
-		functionBox = new JComboBox<>();
-		functionBox.setBounds(new Rectangle(5, 110, 160, 18));
-		add(functionBox);
-		functionBox.addActionListener(alfunctionBox);
-		addLFItem("", Fnc.UNKFNC);
-		addLFItem(Messages.getString("Church"), Fnc.CHCH);
-		addLFItem(Messages.getString("Chapel"), Fnc.CHPL);
-		addLFItem(Messages.getString("Temple"), Fnc.TMPL);
-		addLFItem(Messages.getString("Pagoda"), Fnc.PGDA);
-		addLFItem(Messages.getString("ShintoShrine"), Fnc.SHSH);
-		addLFItem(Messages.getString("BuddhistTemple"), Fnc.BTMP);
-		addLFItem(Messages.getString("Mosque"), Fnc.MOSQ);
-		addLFItem(Messages.getString("Marabout"), Fnc.MRBT);
-		functionBox.setVisible(false);
-
-		categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER);
-		categoryLabel.setBounds(new Rectangle(5, 125, 160, 18));
-		add(categoryLabel);
-		categoryLabel.setVisible(false);
-
-		landCatBox = new JComboBox<>();
-		landCatBox.setBounds(new Rectangle(5, 142, 160, 18));
-		add(landCatBox);
-		landCatBox.addActionListener(alLandCatBox);
-		addLCItem("", Cat.NOCAT);
-		addLCItem(Messages.getString("Tower"), Cat.LMK_TOWR);
-		addLCItem(Messages.getString("WaterTower"), Cat.LMK_WTRT);
-		addLCItem(Messages.getString("Chimney"), Cat.LMK_CHMY);
-		addLCItem(Messages.getString("Mast"), Cat.LMK_MAST);
-		addLCItem(Messages.getString("Column"), Cat.LMK_CLMN);
-		addLCItem(Messages.getString("DishAerial"), Cat.LMK_DSHA);
-		addLCItem(Messages.getString("Flagstaff"), Cat.LMK_FLGS);
-		addLCItem(Messages.getString("FlareStack"), Cat.LMK_FLRS);
-		addLCItem(Messages.getString("Monument"), Cat.LMK_MNMT);
-		addLCItem(Messages.getString("WindMotor"), Cat.LMK_WNDM);
-		addLCItem(Messages.getString("WindSock"), Cat.LMK_WNDS);
-		addLCItem(Messages.getString("Obelisk"), Cat.LMK_OBLK);
-		addLCItem(Messages.getString("Statue"), Cat.LMK_STAT);
-		addLCItem(Messages.getString("Cross"), Cat.LMK_CROS);
-		addLCItem(Messages.getString("Dome"), Cat.LMK_DOME);
-		addLCItem(Messages.getString("RadarScanner"), Cat.LMK_SCNR);
-		addLCItem(Messages.getString("Windmill"), Cat.LMK_WNDL);
-		addLCItem(Messages.getString("Spire"), Cat.LMK_SPIR);
-		addLCItem(Messages.getString("Minaret"), Cat.LMK_MNRT);
-		addLCItem(Messages.getString("Cairn"), Cat.LMK_CARN);
-		landCatBox.setVisible(false);
-
-		trafficCatBox = new JComboBox<>();
-		trafficCatBox.setBounds(new Rectangle(5, 140, 160, 20));
-		add(trafficCatBox);
-		trafficCatBox.addActionListener(alTrafficCatBox);
-		addTCItem("", Cat.NOCAT);
-		addTCItem(Messages.getString("Traffic"), Cat.SIS_TRFC);
-		addTCItem(Messages.getString("PortControl"), Cat.SIS_PTCL);
-		addTCItem(Messages.getString("PortEntry"), Cat.SIS_PTED);
-		addTCItem(Messages.getString("IPT"), Cat.SIS_IPT);
-		addTCItem(Messages.getString("Berthing"), Cat.SIS_BRTH);
-		addTCItem(Messages.getString("Dock"), Cat.SIS_DOCK);
-		addTCItem(Messages.getString("Lock"), Cat.SIS_LOCK);
-		addTCItem(Messages.getString("Barrage"), Cat.SIS_FBAR);
-		addTCItem(Messages.getString("Bridge"), Cat.SIS_BRDG);
-		addTCItem(Messages.getString("Dredging"), Cat.SIS_DRDG);
-		trafficCatBox.setVisible(false);
-
-		warningCatBox = new JComboBox<>();
-		warningCatBox.setBounds(new Rectangle(5, 140, 160, 20));
-		add(warningCatBox);
-		warningCatBox.addActionListener(alWarningCatBox);
-		addWCItem("", Cat.NOCAT);
-		addWCItem(Messages.getString("Danger"), Cat.SIS_DNGR);
-		addWCItem(Messages.getString("Storm"), Cat.SIS_STRM);
-		addWCItem(Messages.getString("Weather"), Cat.SIS_WTHR);
-		addWCItem(Messages.getString("Obstruction"), Cat.SIS_OBST);
-		addWCItem(Messages.getString("Cable"), Cat.SIS_CABL);
-		addWCItem(Messages.getString("Distress"), Cat.SIS_DSTR);
-		addWCItem(Messages.getString("Time"), Cat.SIS_TIME);
-		addWCItem(Messages.getString("Tide"), Cat.SIS_TIDE);
-		addWCItem(Messages.getString("TidalStream"), Cat.SIS_TSTM);
-		addWCItem(Messages.getString("TideGauge"), Cat.SIS_TGAG);
-		addWCItem(Messages.getString("TideScale"), Cat.SIS_TSCL);
-		addWCItem(Messages.getString("Diving"), Cat.SIS_DIVE);
-		addWCItem(Messages.getString("Ice"), Cat.SIS_ICE);
-		addWCItem(Messages.getString("LevelGauge"), Cat.SIS_LGAG);
-		addWCItem(Messages.getString("Military"), Cat.SIS_MILY);
-		warningCatBox.setVisible(false);
-
-		platformCatBox = new JComboBox<>();
-		platformCatBox.setBounds(new Rectangle(5, 140, 160, 20));
-		add(platformCatBox);
-		platformCatBox.addActionListener(alPlatformCatBox);
-		addPLItem("", Cat.NOCAT);
-		addPLItem(Messages.getString("Oil"), Cat.OFP_OIL);
-		addPLItem(Messages.getString("Production"), Cat.OFP_PRD);
-		addPLItem(Messages.getString("Observation"), Cat.OFP_OBS);
-		addPLItem(Messages.getString("ALP"), Cat.OFP_ALP);
-		addPLItem(Messages.getString("SALM"), Cat.OFP_SALM);
-		addPLItem(Messages.getString("MooringTower"), Cat.OFP_MOR);
-		addPLItem(Messages.getString("ArtificialIsland"), Cat.OFP_ISL);
-		addPLItem(Messages.getString("FPSO"), Cat.OFP_FPSO);
-		addPLItem(Messages.getString("Accommodation"), Cat.OFP_ACC);
-		addPLItem(Messages.getString("NCCB"), Cat.OFP_NCCB);
-		platformCatBox.setVisible(false);
-
-		pilotCatBox = new JComboBox<>();
-		pilotCatBox.setBounds(new Rectangle(5, 140, 160, 20));
-		add(pilotCatBox);
-		pilotCatBox.addActionListener(alPilotCatBox);
-		addPTItem("", Cat.NOCAT);
-		addPTItem(Messages.getString("CruisingVessel"), Cat.PIL_VESS);
-		addPTItem(Messages.getString("Helicopter"), Cat.PIL_HELI);
-		addPTItem(Messages.getString("FromShore"), Cat.PIL_SHORE);
-		pilotCatBox.setVisible(false);
-
-		rescueCatBox = new JComboBox<>();
-		rescueCatBox.setBounds(new Rectangle(5, 140, 160, 20));
-		add(rescueCatBox);
-		rescueCatBox.addActionListener(alRescueCatBox);
-		addRSItem("", Cat.NOCAT);
-		addRSItem(Messages.getString("Lifeboat"), Cat.RSC_LFB);
-		addRSItem(Messages.getString("Rocket"), Cat.RSC_RKT);
-		addRSItem(Messages.getString("ShipwreckedRefuge"), Cat.RSC_RSW);
-		addRSItem(Messages.getString("IntertidalRefuge"), Cat.RSC_RIT);
-		addRSItem(Messages.getString("MooredLifeboat"), Cat.RSC_MLB);
-		addRSItem(Messages.getString("Radio"), Cat.RSC_RAD);
-		addRSItem(Messages.getString("FirstAid"), Cat.RSC_FAE);
-		addRSItem(Messages.getString("Seaplane"), Cat.RSC_SPL);
-		addRSItem(Messages.getString("Aircraft"), Cat.RSC_AIR);
-		addRSItem(Messages.getString("Tug"), Cat.RSC_TUG);
-		rescueCatBox.setVisible(false);
-
-		radioCatBox = new JComboBox<>();
-		radioCatBox.setBounds(new Rectangle(5, 140, 160, 20));
-		add(radioCatBox);
-		radioCatBox.addActionListener(alRadioCatBox);
-		addROItem("", Cat.NOCAT);
-		addROItem(Messages.getString("CircularBeacon"), Cat.ROS_OMNI);
-		addROItem(Messages.getString("DirectionalBeacon"), Cat.ROS_DIRL);
-		addROItem(Messages.getString("RotatingBeacon"), Cat.ROS_ROTP);
-		addROItem(Messages.getString("ConsolBeacon"), Cat.ROS_CNSL);
-		addROItem(Messages.getString("DirectionFinding"), Cat.ROS_RDF);
-		addROItem(Messages.getString("QTGService"), Cat.ROS_QTG);
-		addROItem(Messages.getString("AeronaticalBeacon"), Cat.ROS_AERO);
-		addROItem(Messages.getString("Decca"), Cat.ROS_DECA);
-		addROItem(Messages.getString("LoranC"), Cat.ROS_LORN);
-		addROItem(Messages.getString("DGPS"), Cat.ROS_DGPS);
-		addROItem(Messages.getString("Toran"), Cat.ROS_TORN);
-		addROItem(Messages.getString("Omega"), Cat.ROS_OMGA);
-		addROItem(Messages.getString("Syledis"), Cat.ROS_SYLD);
-		addROItem(Messages.getString("Chiaka"), Cat.ROS_CHKA);
-		addROItem(Messages.getString("PublicCommunication"), Cat.ROS_PCOM);
-		addROItem(Messages.getString("CommercialBroadcast"), Cat.ROS_COMB);
-		addROItem(Messages.getString("Facsimile"), Cat.ROS_FACS);
-		addROItem(Messages.getString("TimeSignal"), Cat.ROS_TIME);
-		addROItem(Messages.getString("AIS"), Cat.ROS_PAIS);
-		addROItem(Messages.getString("S-AIS"), Cat.ROS_SAIS);
-		addROItem(Messages.getString("V-AIS"), Cat.ROS_VAIS);
-		addROItem(Messages.getString("V-AISNC"), Cat.ROS_VANC);
-		addROItem(Messages.getString("V-AISSC"), Cat.ROS_VASC);
-		addROItem(Messages.getString("V-AISEC"), Cat.ROS_VAEC);
-		addROItem(Messages.getString("V-AISWC"), Cat.ROS_VAWC);
-		addROItem(Messages.getString("V-AISPL"), Cat.ROS_VAPL);
-		addROItem(Messages.getString("V-AISSL"), Cat.ROS_VASL);
-		addROItem(Messages.getString("V-AISID"), Cat.ROS_VAID);
-		addROItem(Messages.getString("V-AISSW"), Cat.ROS_VASW);
-		addROItem(Messages.getString("V-AISSP"), Cat.ROS_VASP);
-		addROItem(Messages.getString("V-AISWK"), Cat.ROS_VAWK);
-		radioCatBox.setVisible(false);
-
-		radarCatBox = new JComboBox<>();
-		radarCatBox.setBounds(new Rectangle(5, 140, 160, 20));
-		add(radarCatBox);
-		radarCatBox.addActionListener(alRadarCatBox);
-		addRAItem("", Cat.NOCAT);
-		addRAItem(Messages.getString("Surveillance"), Cat.RAS_SRV);
-		addRAItem(Messages.getString("CoastRadar"), Cat.RAS_CST);
-		radarCatBox.setVisible(false);
-
-		chLabel = new JLabel("Ch:", SwingConstants.CENTER);
-		chLabel.setBounds(new Rectangle(140, 32, 30, 15));
-		add(chLabel);
-		chBox = new JTextField();
-		chBox.setBounds(new Rectangle(140, 45, 30, 20));
-		chBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(chBox);
-		chBox.addFocusListener(flCh);
-	}
-
-	public void syncPanel() {
-		functionLabel.setVisible(false);
-		functionBox.setVisible(false);
-		categoryLabel.setVisible(false);
-		landCatBox.setVisible(false);
-		trafficCatBox.setVisible(false);
-		warningCatBox.setVisible(false);
-		platformCatBox.setVisible(false);
-		pilotCatBox.setVisible(false);
-		rescueCatBox.setVisible(false);
-		radioCatBox.setVisible(false);
-		radarCatBox.setVisible(false);
-		chLabel.setVisible(false);
-		chBox.setVisible(false);
-		chBox.setText(SmedAction.panelMain.mark.getChannel());
-		if ((SmedAction.panelMain.mark.getObject() == Obj.LNDMRK) && ((SmedAction.panelMain.mark.getCategory() != Cat.NOCAT) || (SmedAction.panelMain.mark.getFunc() != Fnc.UNKFNC))) {
-			functionLabel.setVisible(true);
-			categoryLabel.setVisible(true);
-			functionBox.setVisible(true);
-			landCatBox.setVisible(true);
-			for (Fnc fnc : functions.keySet()) {
-				int item = functions.get(fnc);
-				if (SmedAction.panelMain.mark.getFunc() == fnc)
-					functionBox.setSelectedIndex(item);
-			}
-			for (Cat cat : landCats.keySet()) {
-				int item = landCats.get(cat);
-				if (SmedAction.panelMain.mark.getCategory() == cat)
-					landCatBox.setSelectedIndex(item);
-			}
-		} else if (SmedAction.panelMain.mark.getObject() == Obj.SISTAT) {
-				categoryLabel.setVisible(true);
-				trafficCatBox.setVisible(true);
-				for (Cat cat : trafficCats.keySet()) {
-					int item = trafficCats.get(cat);
-					if (SmedAction.panelMain.mark.getCategory() == cat)
-						trafficCatBox.setSelectedIndex(item);
-				}
-				chLabel.setVisible(true);
-				chBox.setVisible(true);
-		} else if (SmedAction.panelMain.mark.getObject() == Obj.SISTAW) {
-			categoryLabel.setVisible(true);
-			warningCatBox.setVisible(true);
-			for (Cat cat : warningCats.keySet()) {
-				int item = warningCats.get(cat);
-				if (SmedAction.panelMain.mark.getCategory() == cat)
-					warningCatBox.setSelectedIndex(item);
-			}
-			chLabel.setVisible(true);
-			chBox.setVisible(true);
-		} else if (SmedAction.panelMain.mark.getObject() == Obj.OFSPLF) {
-			categoryLabel.setVisible(true);
-			platformCatBox.setVisible(true);
-			for (Cat cat : platformCats.keySet()) {
-				int item = platformCats.get(cat);
-				if (SmedAction.panelMain.mark.getCategory() == cat)
-					platformCatBox.setSelectedIndex(item);
-			}
-		} else if (SmedAction.panelMain.mark.getObject() == Obj.PILBOP) {
-			categoryLabel.setVisible(true);
-			pilotCatBox.setVisible(true);
-			for (Cat cat : pilotCats.keySet()) {
-				int item = pilotCats.get(cat);
-				if (SmedAction.panelMain.mark.getCategory() == cat)
-					pilotCatBox.setSelectedIndex(item);
-			}
-			chLabel.setVisible(true);
-			chBox.setVisible(true);
-		} else if (SmedAction.panelMain.mark.getObject() == Obj.RSCSTA) {
-			categoryLabel.setVisible(true);
-			rescueCatBox.setVisible(true);
-			for (Cat cat : rescueCats.keySet()) {
-				int item = rescueCats.get(cat);
-				if (SmedAction.panelMain.mark.getCategory() == cat)
-					rescueCatBox.setSelectedIndex(item);
-			}
-		} else if (SmedAction.panelMain.mark.getObject() == Obj.RDOSTA) {
-			categoryLabel.setVisible(true);
-			radioCatBox.setVisible(true);
-			for (Cat cat : radioCats.keySet()) {
-				int item = radioCats.get(cat);
-				if (SmedAction.panelMain.mark.getCategory() == cat)
-					radioCatBox.setSelectedIndex(item);
-			}
-			chLabel.setVisible(true);
-			chBox.setVisible(true);
-		} else if (SmedAction.panelMain.mark.getObject() == Obj.RADSTA) {
-			categoryLabel.setVisible(true);
-			radarCatBox.setVisible(true);
-			for (Cat cat : radarCats.keySet()) {
-				int item = radarCats.get(cat);
-				if (SmedAction.panelMain.mark.getCategory() == cat)
-					radarCatBox.setSelectedIndex(item);
-			}
-			chLabel.setVisible(true);
-			chBox.setVisible(true);
-		}
-		for (Obj obj : objects.keySet()) {
-			JRadioButton button = objects.get(obj);
-			button.setBorderPainted(SmedAction.panelMain.mark.getObject() == obj);
-		}
-		SmedAction.panelMain.mark.testValid();
-	}
-	
-	private void addLCItem(String str, Cat cat) {
-		landCats.put(cat, landCatBox.getItemCount());
-		landCatBox.addItem(str);
-	}
-
-	private void addTCItem(String str, Cat cat) {
-		trafficCats.put(cat, trafficCatBox.getItemCount());
-		trafficCatBox.addItem(str);
-	}
-
-	private void addWCItem(String str, Cat cat) {
-		warningCats.put(cat, warningCatBox.getItemCount());
-		warningCatBox.addItem(str);
-	}
-
-	private void addPLItem(String str, Cat cat) {
-		platformCats.put(cat, platformCatBox.getItemCount());
-		platformCatBox.addItem(str);
-	}
-
-	private void addPTItem(String str, Cat cat) {
-		pilotCats.put(cat, pilotCatBox.getItemCount());
-		pilotCatBox.addItem(str);
-	}
-
-	private void addRSItem(String str, Cat cat) {
-		rescueCats.put(cat, rescueCatBox.getItemCount());
-		rescueCatBox.addItem(str);
-	}
-
-	private void addROItem(String str, Cat cat) {
-		radioCats.put(cat, radioCatBox.getItemCount());
-		radioCatBox.addItem(str);
-	}
-
-	private void addRAItem(String str, Cat cat) {
-		radarCats.put(cat, radarCatBox.getItemCount());
-		radarCatBox.addItem(str);
-	}
-
-	private void addLFItem(String str, Fnc fnc) {
-		functions.put(fnc, functionBox.getItemCount());
-		functionBox.addItem(str);
-	}
-
-	private JRadioButton getObjButton(JRadioButton button, int x, int y, int w, int h, String tip, Obj obj) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alObj);
-		objButtons.add(button);
-		objects.put(obj, button);
-		return button;
-	}
+    private SmedAction dlg;
+
+    public JLabel categoryLabel;
+
+    public JComboBox<String> landCatBox;
+    public EnumMap<Cat, Integer> landCats = new EnumMap<>(Cat.class);
+    private ActionListener alLandCatBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cat cat : landCats.keySet()) {
+                int idx = landCats.get(cat);
+                if (dlg.node != null && (idx == landCatBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setCategory(cat);
+                    SmedAction.panelMain.mark.testValid();
+                }
+            }
+        }
+    };
+    public JComboBox<String> trafficCatBox;
+    public EnumMap<Cat, Integer> trafficCats = new EnumMap<>(Cat.class);
+    private ActionListener alTrafficCatBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cat cat : trafficCats.keySet()) {
+                int idx = trafficCats.get(cat);
+                if (dlg.node != null && (idx == trafficCatBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setCategory(cat);
+                    SmedAction.panelMain.mark.testValid();
+                }
+            }
+        }
+    };
+    public JComboBox<String> warningCatBox;
+    public EnumMap<Cat, Integer> warningCats = new EnumMap<>(Cat.class);
+    private ActionListener alWarningCatBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cat cat : warningCats.keySet()) {
+                int idx = warningCats.get(cat);
+                if (dlg.node != null && (idx == warningCatBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setCategory(cat);
+                    SmedAction.panelMain.mark.testValid();
+                }
+            }
+        }
+    };
+    public JComboBox<String> platformCatBox;
+    public EnumMap<Cat, Integer> platformCats = new EnumMap<>(Cat.class);
+    private ActionListener alPlatformCatBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cat cat : platformCats.keySet()) {
+                int idx = platformCats.get(cat);
+                if (dlg.node != null && (idx == platformCatBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setCategory(cat);
+                    SmedAction.panelMain.mark.testValid();
+                }
+            }
+        }
+    };
+    public JComboBox<String> pilotCatBox;
+    public EnumMap<Cat, Integer> pilotCats = new EnumMap<>(Cat.class);
+    private ActionListener alPilotCatBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cat cat : pilotCats.keySet()) {
+                int idx = pilotCats.get(cat);
+                if (dlg.node != null && (idx == pilotCatBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setCategory(cat);
+                    SmedAction.panelMain.mark.testValid();
+                }
+            }
+        }
+    };
+    public JComboBox<String> rescueCatBox;
+    public EnumMap<Cat, Integer> rescueCats = new EnumMap<>(Cat.class);
+    private ActionListener alRescueCatBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cat cat : rescueCats.keySet()) {
+                int idx = rescueCats.get(cat);
+                if (dlg.node != null && (idx == rescueCatBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setCategory(cat);
+                    SmedAction.panelMain.mark.testValid();
+                }
+            }
+        }
+    };
+    public JComboBox<String> radioCatBox;
+    public EnumMap<Cat, Integer> radioCats = new EnumMap<>(Cat.class);
+    private ActionListener alRadioCatBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cat cat : radioCats.keySet()) {
+                int idx = radioCats.get(cat);
+                if (dlg.node != null && (idx == radioCatBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setCategory(cat);
+                    SmedAction.panelMain.mark.testValid();
+                }
+            }
+        }
+    };
+    public JComboBox<String> radarCatBox;
+    public EnumMap<Cat, Integer> radarCats = new EnumMap<>(Cat.class);
+    private ActionListener alRadarCatBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cat cat : radarCats.keySet()) {
+                int idx = radarCats.get(cat);
+                if (dlg.node != null && (idx == radarCatBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setCategory(cat);
+                    SmedAction.panelMain.mark.testValid();
+                }
+            }
+        }
+    };
+    public JLabel functionLabel;
+    public JComboBox<String> functionBox;
+    public EnumMap<Fnc, Integer> functions = new EnumMap<>(Fnc.class);
+    private ActionListener alfunctionBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Fnc fnc : functions.keySet()) {
+                int idx = functions.get(fnc);
+                if (dlg.node != null && (idx == functionBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setFunc(fnc);
+                    SmedAction.panelMain.mark.testValid();
+                }
+            }
+        }
+    };
+    private ButtonGroup objButtons = new ButtonGroup();
+    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")));
+    public JRadioButton landButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LandmarkButton.png")));
+    public JRadioButton trafficButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TrafficButton.png")));
+    public JRadioButton warningButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WarningButton.png")));
+    public JRadioButton platformButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PlatformButton.png")));
+    public JRadioButton coastguardButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CoastguardButton.png")));
+    public JRadioButton pilotButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PilotButton.png")));
+    public JRadioButton rescueButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RescueButton.png")));
+    public JRadioButton radioButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadioStationButton.png")));
+    public JRadioButton radarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarStationButton.png")));
+    public EnumMap<Obj, JRadioButton> objects = new EnumMap<>(Obj.class);
+    private ActionListener alObj = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Obj obj : objects.keySet()) {
+                JRadioButton button = objects.get(obj);
+                if (button.isSelected()) {
+                    SmedAction.panelMain.mark.setObject(obj);
+                    button.setBorderPainted(true);
+                } else {
+                    button.setBorderPainted(false);
+                }
+            }
+            if (SmedAction.panelMain.mark.getObject() == Obj.LITVES) {
+                SmedAction.panelMain.mark.setShape(Shp.SUPER);
+            } else if (SmedAction.panelMain.mark.getObject() == Obj.LITFLT) {
+                SmedAction.panelMain.mark.setShape(Shp.FLOAT);
+            } else {
+                SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
+            }
+            functionLabel.setVisible(false);
+            categoryLabel.setVisible(false);
+            functionLabel.setVisible(false);
+            functionBox.setVisible(false);
+            landCatBox.setVisible(false);
+            trafficCatBox.setVisible(false);
+            warningCatBox.setVisible(false);
+            platformCatBox.setVisible(false);
+            pilotCatBox.setVisible(false);
+            rescueCatBox.setVisible(false);
+            radioCatBox.setVisible(false);
+            radarCatBox.setVisible(false);
+            chLabel.setVisible(false);
+            chBox.setVisible(false);
+            SmedAction.panelMain.mark.setCategory(Cat.NOCAT);
+            if (landButton.isSelected()) {
+                functionLabel.setVisible(true);
+                categoryLabel.setVisible(true);
+                functionBox.setVisible(true);
+                landCatBox.setVisible(true);
+                alLandCatBox.actionPerformed(null);
+            } else if (trafficButton.isSelected()) {
+                categoryLabel.setVisible(true);
+                trafficCatBox.setVisible(true);
+                chLabel.setVisible(true);
+                chBox.setVisible(true);
+                alTrafficCatBox.actionPerformed(null);
+            } else if (warningButton.isSelected()) {
+                categoryLabel.setVisible(true);
+                warningCatBox.setVisible(true);
+                chLabel.setVisible(true);
+                chBox.setVisible(true);
+                alWarningCatBox.actionPerformed(null);
+            } else if (platformButton.isSelected()) {
+                categoryLabel.setVisible(true);
+                platformCatBox.setVisible(true);
+                alPlatformCatBox.actionPerformed(null);
+            } else if (pilotButton.isSelected()) {
+                categoryLabel.setVisible(true);
+                pilotCatBox.setVisible(true);
+                chLabel.setVisible(true);
+                chBox.setVisible(true);
+                alPilotCatBox.actionPerformed(null);
+            } else if (rescueButton.isSelected()) {
+                categoryLabel.setVisible(true);
+                rescueCatBox.setVisible(true);
+                alRescueCatBox.actionPerformed(null);
+            } else if (radioButton.isSelected()) {
+                categoryLabel.setVisible(true);
+                radioCatBox.setVisible(true);
+                chLabel.setVisible(true);
+                chBox.setVisible(true);
+                alRadioCatBox.actionPerformed(null);
+            } else if (radarButton.isSelected()) {
+                categoryLabel.setVisible(true);
+                radarCatBox.setVisible(true);
+                chLabel.setVisible(true);
+                chBox.setVisible(true);
+                alRadarCatBox.actionPerformed(null);
+            }
+            SmedAction.panelMain.mark.testValid();
+        }
+    };
+    public JLabel chLabel;
+    public JTextField chBox;
+    private FocusListener flCh = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setChannel(chBox.getText());
+        }
+    };
+
+    public PanelLights(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        add(getObjButton(houseButton, 0, 0, 34, 32, "Lighthouse", Obj.LITHSE));
+        add(getObjButton(majorButton, 34, 0, 34, 32, "MajorLight", Obj.LITMAJ));
+        add(getObjButton(minorButton, 68, 0, 34, 32, "MinorLight", Obj.LITMIN));
+        add(getObjButton(landButton, 102, 0, 34, 32, "Landmark", Obj.LNDMRK));
+        add(getObjButton(platformButton, 136, 0, 34, 32, "Platform", Obj.OFSPLF));
+        add(getObjButton(vesselButton, 0, 32, 34, 32, "LightVessel", Obj.LITVES));
+        add(getObjButton(floatButton, 34, 32, 34, 32, "LightFloat", Obj.LITFLT));
+        add(getObjButton(trafficButton, 68, 32, 34, 32, "SSTraffic", Obj.SISTAT));
+        add(getObjButton(warningButton, 102, 32, 34, 32, "SSWarning", Obj.SISTAW));
+        add(getObjButton(coastguardButton, 0, 64, 34, 32, "CoastguardStation", Obj.CGUSTA));
+        add(getObjButton(pilotButton, 34, 64, 34, 32, "PilotBoarding", Obj.PILBOP));
+        add(getObjButton(rescueButton, 68, 64, 34, 32, "RescueStation", Obj.RSCSTA));
+        add(getObjButton(radioButton, 102, 64, 34, 32, "RadioStation", Obj.RDOSTA));
+        add(getObjButton(radarButton, 136, 64, 34, 32, "RadarStation", Obj.RADSTA));
+
+        functionLabel = new JLabel(Messages.getString("Function"), SwingConstants.CENTER);
+        functionLabel.setBounds(new Rectangle(5, 94, 160, 18));
+        add(functionLabel);
+        functionLabel.setVisible(false);
+
+        functionBox = new JComboBox<>();
+        functionBox.setBounds(new Rectangle(5, 110, 160, 18));
+        add(functionBox);
+        functionBox.addActionListener(alfunctionBox);
+        addLFItem("", Fnc.UNKFNC);
+        addLFItem(Messages.getString("Church"), Fnc.CHCH);
+        addLFItem(Messages.getString("Chapel"), Fnc.CHPL);
+        addLFItem(Messages.getString("Temple"), Fnc.TMPL);
+        addLFItem(Messages.getString("Pagoda"), Fnc.PGDA);
+        addLFItem(Messages.getString("ShintoShrine"), Fnc.SHSH);
+        addLFItem(Messages.getString("BuddhistTemple"), Fnc.BTMP);
+        addLFItem(Messages.getString("Mosque"), Fnc.MOSQ);
+        addLFItem(Messages.getString("Marabout"), Fnc.MRBT);
+        functionBox.setVisible(false);
+
+        categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER);
+        categoryLabel.setBounds(new Rectangle(5, 125, 160, 18));
+        add(categoryLabel);
+        categoryLabel.setVisible(false);
+
+        landCatBox = new JComboBox<>();
+        landCatBox.setBounds(new Rectangle(5, 142, 160, 18));
+        add(landCatBox);
+        landCatBox.addActionListener(alLandCatBox);
+        addLCItem("", Cat.NOCAT);
+        addLCItem(Messages.getString("Tower"), Cat.LMK_TOWR);
+        addLCItem(Messages.getString("WaterTower"), Cat.LMK_WTRT);
+        addLCItem(Messages.getString("Chimney"), Cat.LMK_CHMY);
+        addLCItem(Messages.getString("Mast"), Cat.LMK_MAST);
+        addLCItem(Messages.getString("Column"), Cat.LMK_CLMN);
+        addLCItem(Messages.getString("DishAerial"), Cat.LMK_DSHA);
+        addLCItem(Messages.getString("Flagstaff"), Cat.LMK_FLGS);
+        addLCItem(Messages.getString("FlareStack"), Cat.LMK_FLRS);
+        addLCItem(Messages.getString("Monument"), Cat.LMK_MNMT);
+        addLCItem(Messages.getString("WindMotor"), Cat.LMK_WNDM);
+        addLCItem(Messages.getString("WindSock"), Cat.LMK_WNDS);
+        addLCItem(Messages.getString("Obelisk"), Cat.LMK_OBLK);
+        addLCItem(Messages.getString("Statue"), Cat.LMK_STAT);
+        addLCItem(Messages.getString("Cross"), Cat.LMK_CROS);
+        addLCItem(Messages.getString("Dome"), Cat.LMK_DOME);
+        addLCItem(Messages.getString("RadarScanner"), Cat.LMK_SCNR);
+        addLCItem(Messages.getString("Windmill"), Cat.LMK_WNDL);
+        addLCItem(Messages.getString("Spire"), Cat.LMK_SPIR);
+        addLCItem(Messages.getString("Minaret"), Cat.LMK_MNRT);
+        addLCItem(Messages.getString("Cairn"), Cat.LMK_CARN);
+        landCatBox.setVisible(false);
+
+        trafficCatBox = new JComboBox<>();
+        trafficCatBox.setBounds(new Rectangle(5, 140, 160, 20));
+        add(trafficCatBox);
+        trafficCatBox.addActionListener(alTrafficCatBox);
+        addTCItem("", Cat.NOCAT);
+        addTCItem(Messages.getString("Traffic"), Cat.SIS_TRFC);
+        addTCItem(Messages.getString("PortControl"), Cat.SIS_PTCL);
+        addTCItem(Messages.getString("PortEntry"), Cat.SIS_PTED);
+        addTCItem(Messages.getString("IPT"), Cat.SIS_IPT);
+        addTCItem(Messages.getString("Berthing"), Cat.SIS_BRTH);
+        addTCItem(Messages.getString("Dock"), Cat.SIS_DOCK);
+        addTCItem(Messages.getString("Lock"), Cat.SIS_LOCK);
+        addTCItem(Messages.getString("Barrage"), Cat.SIS_FBAR);
+        addTCItem(Messages.getString("Bridge"), Cat.SIS_BRDG);
+        addTCItem(Messages.getString("Dredging"), Cat.SIS_DRDG);
+        trafficCatBox.setVisible(false);
+
+        warningCatBox = new JComboBox<>();
+        warningCatBox.setBounds(new Rectangle(5, 140, 160, 20));
+        add(warningCatBox);
+        warningCatBox.addActionListener(alWarningCatBox);
+        addWCItem("", Cat.NOCAT);
+        addWCItem(Messages.getString("Danger"), Cat.SIS_DNGR);
+        addWCItem(Messages.getString("Storm"), Cat.SIS_STRM);
+        addWCItem(Messages.getString("Weather"), Cat.SIS_WTHR);
+        addWCItem(Messages.getString("Obstruction"), Cat.SIS_OBST);
+        addWCItem(Messages.getString("Cable"), Cat.SIS_CABL);
+        addWCItem(Messages.getString("Distress"), Cat.SIS_DSTR);
+        addWCItem(Messages.getString("Time"), Cat.SIS_TIME);
+        addWCItem(Messages.getString("Tide"), Cat.SIS_TIDE);
+        addWCItem(Messages.getString("TidalStream"), Cat.SIS_TSTM);
+        addWCItem(Messages.getString("TideGauge"), Cat.SIS_TGAG);
+        addWCItem(Messages.getString("TideScale"), Cat.SIS_TSCL);
+        addWCItem(Messages.getString("Diving"), Cat.SIS_DIVE);
+        addWCItem(Messages.getString("Ice"), Cat.SIS_ICE);
+        addWCItem(Messages.getString("LevelGauge"), Cat.SIS_LGAG);
+        addWCItem(Messages.getString("Military"), Cat.SIS_MILY);
+        warningCatBox.setVisible(false);
+
+        platformCatBox = new JComboBox<>();
+        platformCatBox.setBounds(new Rectangle(5, 140, 160, 20));
+        add(platformCatBox);
+        platformCatBox.addActionListener(alPlatformCatBox);
+        addPLItem("", Cat.NOCAT);
+        addPLItem(Messages.getString("Oil"), Cat.OFP_OIL);
+        addPLItem(Messages.getString("Production"), Cat.OFP_PRD);
+        addPLItem(Messages.getString("Observation"), Cat.OFP_OBS);
+        addPLItem(Messages.getString("ALP"), Cat.OFP_ALP);
+        addPLItem(Messages.getString("SALM"), Cat.OFP_SALM);
+        addPLItem(Messages.getString("MooringTower"), Cat.OFP_MOR);
+        addPLItem(Messages.getString("ArtificialIsland"), Cat.OFP_ISL);
+        addPLItem(Messages.getString("FPSO"), Cat.OFP_FPSO);
+        addPLItem(Messages.getString("Accommodation"), Cat.OFP_ACC);
+        addPLItem(Messages.getString("NCCB"), Cat.OFP_NCCB);
+        platformCatBox.setVisible(false);
+
+        pilotCatBox = new JComboBox<>();
+        pilotCatBox.setBounds(new Rectangle(5, 140, 160, 20));
+        add(pilotCatBox);
+        pilotCatBox.addActionListener(alPilotCatBox);
+        addPTItem("", Cat.NOCAT);
+        addPTItem(Messages.getString("CruisingVessel"), Cat.PIL_VESS);
+        addPTItem(Messages.getString("Helicopter"), Cat.PIL_HELI);
+        addPTItem(Messages.getString("FromShore"), Cat.PIL_SHORE);
+        pilotCatBox.setVisible(false);
+
+        rescueCatBox = new JComboBox<>();
+        rescueCatBox.setBounds(new Rectangle(5, 140, 160, 20));
+        add(rescueCatBox);
+        rescueCatBox.addActionListener(alRescueCatBox);
+        addRSItem("", Cat.NOCAT);
+        addRSItem(Messages.getString("Lifeboat"), Cat.RSC_LFB);
+        addRSItem(Messages.getString("Rocket"), Cat.RSC_RKT);
+        addRSItem(Messages.getString("ShipwreckedRefuge"), Cat.RSC_RSW);
+        addRSItem(Messages.getString("IntertidalRefuge"), Cat.RSC_RIT);
+        addRSItem(Messages.getString("MooredLifeboat"), Cat.RSC_MLB);
+        addRSItem(Messages.getString("Radio"), Cat.RSC_RAD);
+        addRSItem(Messages.getString("FirstAid"), Cat.RSC_FAE);
+        addRSItem(Messages.getString("Seaplane"), Cat.RSC_SPL);
+        addRSItem(Messages.getString("Aircraft"), Cat.RSC_AIR);
+        addRSItem(Messages.getString("Tug"), Cat.RSC_TUG);
+        rescueCatBox.setVisible(false);
+
+        radioCatBox = new JComboBox<>();
+        radioCatBox.setBounds(new Rectangle(5, 140, 160, 20));
+        add(radioCatBox);
+        radioCatBox.addActionListener(alRadioCatBox);
+        addROItem("", Cat.NOCAT);
+        addROItem(Messages.getString("CircularBeacon"), Cat.ROS_OMNI);
+        addROItem(Messages.getString("DirectionalBeacon"), Cat.ROS_DIRL);
+        addROItem(Messages.getString("RotatingBeacon"), Cat.ROS_ROTP);
+        addROItem(Messages.getString("ConsolBeacon"), Cat.ROS_CNSL);
+        addROItem(Messages.getString("DirectionFinding"), Cat.ROS_RDF);
+        addROItem(Messages.getString("QTGService"), Cat.ROS_QTG);
+        addROItem(Messages.getString("AeronaticalBeacon"), Cat.ROS_AERO);
+        addROItem(Messages.getString("Decca"), Cat.ROS_DECA);
+        addROItem(Messages.getString("LoranC"), Cat.ROS_LORN);
+        addROItem(Messages.getString("DGPS"), Cat.ROS_DGPS);
+        addROItem(Messages.getString("Toran"), Cat.ROS_TORN);
+        addROItem(Messages.getString("Omega"), Cat.ROS_OMGA);
+        addROItem(Messages.getString("Syledis"), Cat.ROS_SYLD);
+        addROItem(Messages.getString("Chiaka"), Cat.ROS_CHKA);
+        addROItem(Messages.getString("PublicCommunication"), Cat.ROS_PCOM);
+        addROItem(Messages.getString("CommercialBroadcast"), Cat.ROS_COMB);
+        addROItem(Messages.getString("Facsimile"), Cat.ROS_FACS);
+        addROItem(Messages.getString("TimeSignal"), Cat.ROS_TIME);
+        addROItem(Messages.getString("AIS"), Cat.ROS_PAIS);
+        addROItem(Messages.getString("S-AIS"), Cat.ROS_SAIS);
+        addROItem(Messages.getString("V-AIS"), Cat.ROS_VAIS);
+        addROItem(Messages.getString("V-AISNC"), Cat.ROS_VANC);
+        addROItem(Messages.getString("V-AISSC"), Cat.ROS_VASC);
+        addROItem(Messages.getString("V-AISEC"), Cat.ROS_VAEC);
+        addROItem(Messages.getString("V-AISWC"), Cat.ROS_VAWC);
+        addROItem(Messages.getString("V-AISPL"), Cat.ROS_VAPL);
+        addROItem(Messages.getString("V-AISSL"), Cat.ROS_VASL);
+        addROItem(Messages.getString("V-AISID"), Cat.ROS_VAID);
+        addROItem(Messages.getString("V-AISSW"), Cat.ROS_VASW);
+        addROItem(Messages.getString("V-AISSP"), Cat.ROS_VASP);
+        addROItem(Messages.getString("V-AISWK"), Cat.ROS_VAWK);
+        radioCatBox.setVisible(false);
+
+        radarCatBox = new JComboBox<>();
+        radarCatBox.setBounds(new Rectangle(5, 140, 160, 20));
+        add(radarCatBox);
+        radarCatBox.addActionListener(alRadarCatBox);
+        addRAItem("", Cat.NOCAT);
+        addRAItem(Messages.getString("Surveillance"), Cat.RAS_SRV);
+        addRAItem(Messages.getString("CoastRadar"), Cat.RAS_CST);
+        radarCatBox.setVisible(false);
+
+        chLabel = new JLabel("Ch:", SwingConstants.CENTER);
+        chLabel.setBounds(new Rectangle(140, 32, 30, 15));
+        add(chLabel);
+        chBox = new JTextField();
+        chBox.setBounds(new Rectangle(140, 45, 30, 20));
+        chBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(chBox);
+        chBox.addFocusListener(flCh);
+    }
+
+    public void syncPanel() {
+        functionLabel.setVisible(false);
+        functionBox.setVisible(false);
+        categoryLabel.setVisible(false);
+        landCatBox.setVisible(false);
+        trafficCatBox.setVisible(false);
+        warningCatBox.setVisible(false);
+        platformCatBox.setVisible(false);
+        pilotCatBox.setVisible(false);
+        rescueCatBox.setVisible(false);
+        radioCatBox.setVisible(false);
+        radarCatBox.setVisible(false);
+        chLabel.setVisible(false);
+        chBox.setVisible(false);
+        chBox.setText(SmedAction.panelMain.mark.getChannel());
+        if ((SmedAction.panelMain.mark.getObject() == Obj.LNDMRK) && ((SmedAction.panelMain.mark.getCategory() != Cat.NOCAT) || (SmedAction.panelMain.mark.getFunc() != Fnc.UNKFNC))) {
+            functionLabel.setVisible(true);
+            categoryLabel.setVisible(true);
+            functionBox.setVisible(true);
+            landCatBox.setVisible(true);
+            for (Fnc fnc : functions.keySet()) {
+                int item = functions.get(fnc);
+                if (SmedAction.panelMain.mark.getFunc() == fnc) {
+                    functionBox.setSelectedIndex(item);
+                }
+            }
+            for (Cat cat : landCats.keySet()) {
+                int item = landCats.get(cat);
+                if (SmedAction.panelMain.mark.getCategory() == cat) {
+                    landCatBox.setSelectedIndex(item);
+                }
+            }
+        } else if (SmedAction.panelMain.mark.getObject() == Obj.SISTAT) {
+            categoryLabel.setVisible(true);
+            trafficCatBox.setVisible(true);
+            for (Cat cat : trafficCats.keySet()) {
+                int item = trafficCats.get(cat);
+                if (SmedAction.panelMain.mark.getCategory() == cat) {
+                    trafficCatBox.setSelectedIndex(item);
+                }
+            }
+            chLabel.setVisible(true);
+            chBox.setVisible(true);
+        } else if (SmedAction.panelMain.mark.getObject() == Obj.SISTAW) {
+            categoryLabel.setVisible(true);
+            warningCatBox.setVisible(true);
+            for (Cat cat : warningCats.keySet()) {
+                int item = warningCats.get(cat);
+                if (SmedAction.panelMain.mark.getCategory() == cat) {
+                    warningCatBox.setSelectedIndex(item);
+                }
+            }
+            chLabel.setVisible(true);
+            chBox.setVisible(true);
+        } else if (SmedAction.panelMain.mark.getObject() == Obj.OFSPLF) {
+            categoryLabel.setVisible(true);
+            platformCatBox.setVisible(true);
+            for (Cat cat : platformCats.keySet()) {
+                int item = platformCats.get(cat);
+                if (SmedAction.panelMain.mark.getCategory() == cat) {
+                    platformCatBox.setSelectedIndex(item);
+                }
+            }
+        } else if (SmedAction.panelMain.mark.getObject() == Obj.PILBOP) {
+            categoryLabel.setVisible(true);
+            pilotCatBox.setVisible(true);
+            for (Cat cat : pilotCats.keySet()) {
+                int item = pilotCats.get(cat);
+                if (SmedAction.panelMain.mark.getCategory() == cat) {
+                    pilotCatBox.setSelectedIndex(item);
+                }
+            }
+            chLabel.setVisible(true);
+            chBox.setVisible(true);
+        } else if (SmedAction.panelMain.mark.getObject() == Obj.RSCSTA) {
+            categoryLabel.setVisible(true);
+            rescueCatBox.setVisible(true);
+            for (Cat cat : rescueCats.keySet()) {
+                int item = rescueCats.get(cat);
+                if (SmedAction.panelMain.mark.getCategory() == cat) {
+                    rescueCatBox.setSelectedIndex(item);
+                }
+            }
+        } else if (SmedAction.panelMain.mark.getObject() == Obj.RDOSTA) {
+            categoryLabel.setVisible(true);
+            radioCatBox.setVisible(true);
+            for (Cat cat : radioCats.keySet()) {
+                int item = radioCats.get(cat);
+                if (SmedAction.panelMain.mark.getCategory() == cat) {
+                    radioCatBox.setSelectedIndex(item);
+                }
+            }
+            chLabel.setVisible(true);
+            chBox.setVisible(true);
+        } else if (SmedAction.panelMain.mark.getObject() == Obj.RADSTA) {
+            categoryLabel.setVisible(true);
+            radarCatBox.setVisible(true);
+            for (Cat cat : radarCats.keySet()) {
+                int item = radarCats.get(cat);
+                if (SmedAction.panelMain.mark.getCategory() == cat) {
+                    radarCatBox.setSelectedIndex(item);
+                }
+            }
+            chLabel.setVisible(true);
+            chBox.setVisible(true);
+        }
+        for (Obj obj : objects.keySet()) {
+            JRadioButton button = objects.get(obj);
+            button.setBorderPainted(SmedAction.panelMain.mark.getObject() == obj);
+        }
+        SmedAction.panelMain.mark.testValid();
+    }
+
+    private void addLCItem(String str, Cat cat) {
+        landCats.put(cat, landCatBox.getItemCount());
+        landCatBox.addItem(str);
+    }
+
+    private void addTCItem(String str, Cat cat) {
+        trafficCats.put(cat, trafficCatBox.getItemCount());
+        trafficCatBox.addItem(str);
+    }
+
+    private void addWCItem(String str, Cat cat) {
+        warningCats.put(cat, warningCatBox.getItemCount());
+        warningCatBox.addItem(str);
+    }
+
+    private void addPLItem(String str, Cat cat) {
+        platformCats.put(cat, platformCatBox.getItemCount());
+        platformCatBox.addItem(str);
+    }
+
+    private void addPTItem(String str, Cat cat) {
+        pilotCats.put(cat, pilotCatBox.getItemCount());
+        pilotCatBox.addItem(str);
+    }
+
+    private void addRSItem(String str, Cat cat) {
+        rescueCats.put(cat, rescueCatBox.getItemCount());
+        rescueCatBox.addItem(str);
+    }
+
+    private void addROItem(String str, Cat cat) {
+        radioCats.put(cat, radioCatBox.getItemCount());
+        radioCatBox.addItem(str);
+    }
+
+    private void addRAItem(String str, Cat cat) {
+        radarCats.put(cat, radarCatBox.getItemCount());
+        radarCatBox.addItem(str);
+    }
+
+    private void addLFItem(String str, Fnc fnc) {
+        functions.put(fnc, functionBox.getItemCount());
+        functionBox.addItem(str);
+    }
+
+    private JRadioButton getObjButton(JRadioButton button, int x, int y, int w, int h, String tip, Obj obj) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alObj);
+        objButtons.add(button);
+        objects.put(obj, button);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelLit.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelLit.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelLit.java	(revision 32767)
@@ -1,351 +1,388 @@
 package panels;
 
-import javax.swing.*;
-
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
 import java.util.EnumMap;
 
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import javax.swing.SwingConstants;
+
 import messages.Messages;
+import seamarks.SeaMark.Att;
+import seamarks.SeaMark.Ent;
+import seamarks.SeaMark.Exh;
+import seamarks.SeaMark.Lit;
+import seamarks.SeaMark.Vis;
 import smed.SmedAction;
-import seamarks.SeaMark.*;
 
 public class PanelLit extends JPanel {
 
-	private SmedAction dlg;
-	public PanelSectors panelSector;
-	public PanelCol panelCol;
-	public PanelChr panelChr;
-	public JLabel groupLabel;
-	public JTextField groupBox;
-	private FocusListener flGroup = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, groupBox.getText());
-		}
-	};
-	public JLabel periodLabel;
-	public JTextField periodBox;
-	private FocusListener flPeriod = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setLightAtt(Att.PER, 0, periodBox.getText());
-		}
-	};
-	public JLabel sequenceLabel;
-	public JTextField sequenceBox;
-	private FocusListener flSequence = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setLightAtt(Att.SEQ, 0, sequenceBox.getText());
-		}
-	};
-	public JLabel visibilityLabel;
-	public JComboBox<String> visibilityBox;
-	public EnumMap<Vis, Integer> visibilities = new EnumMap<>(Vis.class);
-	private ActionListener alVisibility = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Vis vis : visibilities.keySet()) {
-				int idx = visibilities.get(vis);
-				if (idx == visibilityBox.getSelectedIndex())
-					SmedAction.panelMain.mark.setLightAtt(Att.VIS, 0, vis);
-			}
-		}
-	};
-	public JLabel heightLabel;
-	public JTextField heightBox;
-	private FocusListener flHeight = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setLightAtt(Att.HGT, 0, heightBox.getText());
-		}
-	};
-	public JLabel rangeLabel;
-	public JTextField rangeBox;
-	private FocusListener flRange = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setLightAtt(Att.RNG, 0, rangeBox.getText());
-		}
-	};
-	public JLabel orientationLabel;
-	public JTextField orientationBox;
-	private FocusListener flOrientation = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, orientationBox.getText());
-		}
-	};
-	public JLabel multipleLabel;
-	public JTextField multipleBox;
-	private FocusListener flMultiple = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, multipleBox.getText());
-		}
-	};
-	public JLabel categoryLabel;
-	public JComboBox<String> categoryBox;
-	public EnumMap<Lit, Integer> categories = new EnumMap<>(Lit.class);
-	private ActionListener alCategory = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Lit lit : categories.keySet()) {
-				int idx = categories.get(lit);
-				if (idx == categoryBox.getSelectedIndex())
-					SmedAction.panelMain.mark.setLightAtt(Att.LIT, 0, lit);
-			}
-			if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR) {
-				SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, "");
-				multipleBox.setText("");
-				orientationLabel.setVisible(true);
-				orientationBox.setVisible(true);
-				multipleLabel.setVisible(false);
-				multipleBox.setVisible(false);
-			} else if ((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)) {
-				SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, "");
-				orientationBox.setText("");
-				orientationLabel.setVisible(false);
-				orientationBox.setVisible(false);
-				multipleLabel.setVisible(true);
-				multipleBox.setVisible(true);
-			} else {
-				SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, "");
-				multipleBox.setText("");
-				SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, "");
-				orientationBox.setText("");
-				orientationLabel.setVisible(false);
-				orientationBox.setVisible(false);
-				multipleLabel.setVisible(false);
-				multipleBox.setVisible(false);
-			}
-		}
-	};
-	public JLabel exhibitionLabel;
-	public JComboBox<String> exhibitionBox;
-	public EnumMap<Exh, Integer> exhibitions = new EnumMap<>(Exh.class);
-	private ActionListener alExhibition = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Exh exh : exhibitions.keySet()) {
-				int idx = exhibitions.get(exh);
-				if (idx == exhibitionBox.getSelectedIndex())
-					SmedAction.panelMain.mark.setLightAtt(Att.EXH, 0, exh);
-			}
-		}
-	};
-	private ButtonGroup typeButtons;
-	public JRadioButton singleButton;
-	public JRadioButton sectorButton;
-	private ActionListener alType = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			singleButton.setBorderPainted(singleButton.isSelected());
-			sectorButton.setBorderPainted(sectorButton.isSelected());
-			if (sectorButton.isSelected()) {
-				panelSector.setVisible(true);
-			} else {
-				panelSector.setVisible(false);
-				while (SmedAction.panelMain.mark.getSectorCount() > 1)
-					SmedAction.panelMain.mark.delLight(1);
-			}
-		}
-	};
-
-	public PanelLit(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		panelCol = new PanelCol(dlg, Ent.LIGHT);
-		panelCol.setBounds(new Rectangle(0, 0, 34, 160));
-		panelChr = new PanelChr(dlg);
-		panelChr.setBounds(new Rectangle(34, 0, 88, 160));
-		add(panelChr);
-		add(panelCol);
-		panelSector = new PanelSectors(dlg);
-		panelSector.setVisible(false);
-
-		typeButtons = new ButtonGroup();
-		singleButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SingleButton.png")));
-		add(getTypeButton(singleButton, 280, 125, 34, 30, "Single"));
-		sectorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SectorButton.png")));
-		add(getTypeButton(sectorButton, 315, 125, 34, 30, "Sectored"));
-
-		groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER);
-		groupLabel.setBounds(new Rectangle(123, 0, 65, 20));
-		add(groupLabel);
-		groupBox = new JTextField();
-		groupBox.setBounds(new Rectangle(135, 20, 40, 20));
-		groupBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(groupBox);
-		groupBox.addFocusListener(flGroup);
-
-		periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER);
-		periodLabel.setBounds(new Rectangle(123, 40, 65, 20));
-		add(periodLabel);
-		periodBox = new JTextField();
-		periodBox.setBounds(new Rectangle(135, 60, 40, 20));
-		periodBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(periodBox);
-		periodBox.addFocusListener(flPeriod);
-
-		heightLabel = new JLabel(Messages.getString("Height"), SwingConstants.CENTER);
-		heightLabel.setBounds(new Rectangle(123, 80, 65, 20));
-		add(heightLabel);
-		heightBox = new JTextField();
-		heightBox.setBounds(new Rectangle(135, 100, 40, 20));
-		heightBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(heightBox);
-		heightBox.addFocusListener(flHeight);
-
-		rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER);
-		rangeLabel.setBounds(new Rectangle(123, 120, 65, 20));
-		add(rangeLabel);
-		rangeBox = new JTextField();
-		rangeBox.setBounds(new Rectangle(135, 140, 40, 20));
-		rangeBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(rangeBox);
-		rangeBox.addFocusListener(flRange);
-
-		sequenceLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER);
-		sequenceLabel.setBounds(new Rectangle(188, 120, 80, 20));
-		add(sequenceLabel);
-		sequenceBox = new JTextField();
-		sequenceBox.setBounds(new Rectangle(183, 140, 90, 20));
-		sequenceBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(sequenceBox);
-		sequenceBox.addFocusListener(flSequence);
-
-		categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER);
-		categoryLabel.setBounds(new Rectangle(185, 0, 165, 20));
-		add(categoryLabel);
-		categoryBox = new JComboBox<>();
-		categoryBox.setBounds(new Rectangle(185, 20, 165, 20));
-		add(categoryBox);
-		addCatItem("", Lit.UNKLIT);
-		addCatItem(Messages.getString("VertDisp"), Lit.VERT);
-		addCatItem(Messages.getString("HorizDisp"), Lit.HORIZ);
-		addCatItem(Messages.getString("Directional"), Lit.DIR);
-		addCatItem(Messages.getString("Upper"), Lit.UPPER);
-		addCatItem(Messages.getString("Lower"), Lit.LOWER);
-		addCatItem(Messages.getString("Rear"), Lit.REAR);
-		addCatItem(Messages.getString("Front"), Lit.FRONT);
-		addCatItem(Messages.getString("Aero"), Lit.AERO);
-		addCatItem(Messages.getString("AirObstruction"), Lit.AIROBS);
-		addCatItem(Messages.getString("FogDetector"), Lit.FOGDET);
-		addCatItem(Messages.getString("Floodlight"), Lit.FLOOD);
-		addCatItem(Messages.getString("Striplight"), Lit.STRIP);
-		addCatItem(Messages.getString("Subsidiary"), Lit.SUBS);
-		addCatItem(Messages.getString("Spotlight"), Lit.SPOT);
-		addCatItem(Messages.getString("MoireEffect"), Lit.MOIRE);
-		addCatItem(Messages.getString("Emergency"), Lit.EMERG);
-		addCatItem(Messages.getString("Bearing"), Lit.BEAR);
-		categoryBox.addActionListener(alCategory);
-
-		visibilityLabel = new JLabel(Messages.getString("Visibility"), SwingConstants.CENTER);
-		visibilityLabel.setBounds(new Rectangle(185, 40, 165, 20));
-		add(visibilityLabel);
-		visibilityBox = new JComboBox<>();
-		visibilityBox.setBounds(new Rectangle(185, 60, 165, 20));
-		add(visibilityBox);
-		addVisibItem("", Vis.UNKVIS);
-		addVisibItem(Messages.getString("Intensified"), Vis.INTEN);
-		addVisibItem(Messages.getString("Unintensified"), Vis.UNINTEN);
-		addVisibItem(Messages.getString("PartiallyObscured"), Vis.PARTOBS);
-		visibilityBox.addActionListener(alVisibility);
-
-		exhibitionLabel = new JLabel(Messages.getString("Exhibition"), SwingConstants.CENTER);
-		exhibitionLabel.setBounds(new Rectangle(280, 80, 70, 20));
-		add(exhibitionLabel);
-		exhibitionBox = new JComboBox<>();
-		exhibitionBox.setBounds(new Rectangle(280, 100, 70, 20));
-		add(exhibitionBox);
-		addExhibItem("", Exh.UNKEXH);
-		addExhibItem(Messages.getString("24h"), Exh.H24);
-		addExhibItem(Messages.getString("Day"), Exh.DAY);
-		addExhibItem(Messages.getString("Night"), Exh.NIGHT);
-		addExhibItem(Messages.getString("Fog"), Exh.FOG);
-		exhibitionBox.addActionListener(alExhibition);
-
-		orientationLabel = new JLabel(Messages.getString("Orientation"), SwingConstants.CENTER);
-		orientationLabel.setBounds(new Rectangle(188, 80, 80, 20));
-		orientationLabel.setVisible(false);
-		add(orientationLabel);
-		orientationBox = new JTextField();
-		orientationBox.setBounds(new Rectangle(208, 100, 40, 20));
-		orientationBox.setHorizontalAlignment(SwingConstants.CENTER);
-		orientationBox.setVisible(false);
-		add(orientationBox);
-		orientationBox.addFocusListener(flOrientation);
-
-		multipleLabel = new JLabel(Messages.getString("Multiplicity"), SwingConstants.CENTER);
-		multipleLabel.setBounds(new Rectangle(188, 80, 80, 20));
-		multipleLabel.setVisible(false);
-		add(multipleLabel);
-		multipleBox = new JTextField();
-		multipleBox.setBounds(new Rectangle(208, 100, 40, 20));
-		multipleBox.setHorizontalAlignment(SwingConstants.CENTER);
-		multipleBox.setVisible(false);
-		add(multipleBox);
-		multipleBox.addFocusListener(flMultiple);
-	}
-
-	public void syncPanel() {
-		orientationLabel.setVisible(false);
-		orientationBox.setVisible(false);
-		multipleLabel.setVisible(false);
-		multipleBox.setVisible(false);
-		groupBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.GRP, 0));
-		periodBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.PER, 0));
-		sequenceBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.SEQ, 0));
-		heightBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.HGT, 0));
-		rangeBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.RNG, 0));
-		orientationBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.ORT, 0));
-		orientationBox.setVisible(SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR);
-		multipleBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.MLT, 0));
-		multipleBox.setVisible((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ));
-		for (Vis vis : visibilities.keySet()) {
-			int item = visibilities.get(vis);
-			if (SmedAction.panelMain.mark.getLightAtt(Att.VIS, 0) == vis)
-				visibilityBox.setSelectedIndex(item);
-		}
-		for (Lit lit : categories.keySet()) {
-			int item = categories.get(lit);
-			if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == lit)
-				categoryBox.setSelectedIndex(item);
-		}
-		for (Exh exh : exhibitions.keySet()) {
-			int item = exhibitions.get(exh);
-			if (SmedAction.panelMain.mark.getLightAtt(Att.EXH, 0) == exh)
-				exhibitionBox.setSelectedIndex(item);
-		}
-		if (SmedAction.panelMain.mark.isSectored()) {
-			singleButton.setBorderPainted(false);
-			sectorButton.setBorderPainted(true);
-			if (isVisible()) panelSector.setVisible(true);
-		} else {
-			singleButton.setBorderPainted(true);
-			sectorButton.setBorderPainted(false);
-			panelSector.setVisible(false);
-			while (SmedAction.panelMain.mark.getSectorCount() > 1)
-				SmedAction.panelMain.mark.delLight(SmedAction.panelMain.mark.getSectorCount() - 1);
-		}
-		panelCol.syncPanel();
-		panelChr.syncPanel();
-		panelSector.syncPanel();
-	}
-
-	private void addCatItem(String str, Lit lit) {
-		categories.put(lit, categoryBox.getItemCount());
-		categoryBox.addItem(str);
-	}
-
-	private void addVisibItem(String str, Vis vis) {
-		visibilities.put(vis, visibilityBox.getItemCount());
-		visibilityBox.addItem(str);
-	}
-
-	private void addExhibItem(String str, Exh exh) {
-		exhibitions.put(exh, exhibitionBox.getItemCount());
-		exhibitionBox.addItem(str);
-	}
-
-	private JRadioButton getTypeButton(JRadioButton button, int x, int y, int w, int h, String tip) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alType);
-		typeButtons.add(button);
-		return button;
-	}
+    private SmedAction dlg;
+    public PanelSectors panelSector;
+    public PanelCol panelCol;
+    public PanelChr panelChr;
+    public JLabel groupLabel;
+    public JTextField groupBox;
+    private FocusListener flGroup = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, groupBox.getText());
+        }
+    };
+    public JLabel periodLabel;
+    public JTextField periodBox;
+    private FocusListener flPeriod = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setLightAtt(Att.PER, 0, periodBox.getText());
+        }
+    };
+    public JLabel sequenceLabel;
+    public JTextField sequenceBox;
+    private FocusListener flSequence = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setLightAtt(Att.SEQ, 0, sequenceBox.getText());
+        }
+    };
+    public JLabel visibilityLabel;
+    public JComboBox<String> visibilityBox;
+    public EnumMap<Vis, Integer> visibilities = new EnumMap<>(Vis.class);
+    private ActionListener alVisibility = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Vis vis : visibilities.keySet()) {
+                int idx = visibilities.get(vis);
+                if (idx == visibilityBox.getSelectedIndex()) {
+                    SmedAction.panelMain.mark.setLightAtt(Att.VIS, 0, vis);
+                }
+            }
+        }
+    };
+    public JLabel heightLabel;
+    public JTextField heightBox;
+    private FocusListener flHeight = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setLightAtt(Att.HGT, 0, heightBox.getText());
+        }
+    };
+    public JLabel rangeLabel;
+    public JTextField rangeBox;
+    private FocusListener flRange = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setLightAtt(Att.RNG, 0, rangeBox.getText());
+        }
+    };
+    public JLabel orientationLabel;
+    public JTextField orientationBox;
+    private FocusListener flOrientation = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, orientationBox.getText());
+        }
+    };
+    public JLabel multipleLabel;
+    public JTextField multipleBox;
+    private FocusListener flMultiple = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, multipleBox.getText());
+        }
+    };
+    public JLabel categoryLabel;
+    public JComboBox<String> categoryBox;
+    public EnumMap<Lit, Integer> categories = new EnumMap<>(Lit.class);
+    private ActionListener alCategory = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Lit lit : categories.keySet()) {
+                int idx = categories.get(lit);
+                if (idx == categoryBox.getSelectedIndex()) {
+                    SmedAction.panelMain.mark.setLightAtt(Att.LIT, 0, lit);
+                }
+            }
+            if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR) {
+                SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, "");
+                multipleBox.setText("");
+                orientationLabel.setVisible(true);
+                orientationBox.setVisible(true);
+                multipleLabel.setVisible(false);
+                multipleBox.setVisible(false);
+            } else if ((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)) {
+                SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, "");
+                orientationBox.setText("");
+                orientationLabel.setVisible(false);
+                orientationBox.setVisible(false);
+                multipleLabel.setVisible(true);
+                multipleBox.setVisible(true);
+            } else {
+                SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, "");
+                multipleBox.setText("");
+                SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, "");
+                orientationBox.setText("");
+                orientationLabel.setVisible(false);
+                orientationBox.setVisible(false);
+                multipleLabel.setVisible(false);
+                multipleBox.setVisible(false);
+            }
+        }
+    };
+    public JLabel exhibitionLabel;
+    public JComboBox<String> exhibitionBox;
+    public EnumMap<Exh, Integer> exhibitions = new EnumMap<>(Exh.class);
+    private ActionListener alExhibition = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Exh exh : exhibitions.keySet()) {
+                int idx = exhibitions.get(exh);
+                if (idx == exhibitionBox.getSelectedIndex()) {
+                    SmedAction.panelMain.mark.setLightAtt(Att.EXH, 0, exh);
+                }
+            }
+        }
+    };
+    private ButtonGroup typeButtons;
+    public JRadioButton singleButton;
+    public JRadioButton sectorButton;
+    private ActionListener alType = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            singleButton.setBorderPainted(singleButton.isSelected());
+            sectorButton.setBorderPainted(sectorButton.isSelected());
+            if (sectorButton.isSelected()) {
+                panelSector.setVisible(true);
+            } else {
+                panelSector.setVisible(false);
+                while (SmedAction.panelMain.mark.getSectorCount() > 1) {
+                    SmedAction.panelMain.mark.delLight(1);
+                }
+            }
+        }
+    };
+
+    public PanelLit(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        panelCol = new PanelCol(dlg, Ent.LIGHT);
+        panelCol.setBounds(new Rectangle(0, 0, 34, 160));
+        panelChr = new PanelChr(dlg);
+        panelChr.setBounds(new Rectangle(34, 0, 88, 160));
+        add(panelChr);
+        add(panelCol);
+        panelSector = new PanelSectors(dlg);
+        panelSector.setVisible(false);
+
+        typeButtons = new ButtonGroup();
+        singleButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SingleButton.png")));
+        add(getTypeButton(singleButton, 280, 125, 34, 30, "Single"));
+        sectorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SectorButton.png")));
+        add(getTypeButton(sectorButton, 315, 125, 34, 30, "Sectored"));
+
+        groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER);
+        groupLabel.setBounds(new Rectangle(123, 0, 65, 20));
+        add(groupLabel);
+        groupBox = new JTextField();
+        groupBox.setBounds(new Rectangle(135, 20, 40, 20));
+        groupBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(groupBox);
+        groupBox.addFocusListener(flGroup);
+
+        periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER);
+        periodLabel.setBounds(new Rectangle(123, 40, 65, 20));
+        add(periodLabel);
+        periodBox = new JTextField();
+        periodBox.setBounds(new Rectangle(135, 60, 40, 20));
+        periodBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(periodBox);
+        periodBox.addFocusListener(flPeriod);
+
+        heightLabel = new JLabel(Messages.getString("Height"), SwingConstants.CENTER);
+        heightLabel.setBounds(new Rectangle(123, 80, 65, 20));
+        add(heightLabel);
+        heightBox = new JTextField();
+        heightBox.setBounds(new Rectangle(135, 100, 40, 20));
+        heightBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(heightBox);
+        heightBox.addFocusListener(flHeight);
+
+        rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER);
+        rangeLabel.setBounds(new Rectangle(123, 120, 65, 20));
+        add(rangeLabel);
+        rangeBox = new JTextField();
+        rangeBox.setBounds(new Rectangle(135, 140, 40, 20));
+        rangeBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(rangeBox);
+        rangeBox.addFocusListener(flRange);
+
+        sequenceLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER);
+        sequenceLabel.setBounds(new Rectangle(188, 120, 80, 20));
+        add(sequenceLabel);
+        sequenceBox = new JTextField();
+        sequenceBox.setBounds(new Rectangle(183, 140, 90, 20));
+        sequenceBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(sequenceBox);
+        sequenceBox.addFocusListener(flSequence);
+
+        categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER);
+        categoryLabel.setBounds(new Rectangle(185, 0, 165, 20));
+        add(categoryLabel);
+        categoryBox = new JComboBox<>();
+        categoryBox.setBounds(new Rectangle(185, 20, 165, 20));
+        add(categoryBox);
+        addCatItem("", Lit.UNKLIT);
+        addCatItem(Messages.getString("VertDisp"), Lit.VERT);
+        addCatItem(Messages.getString("HorizDisp"), Lit.HORIZ);
+        addCatItem(Messages.getString("Directional"), Lit.DIR);
+        addCatItem(Messages.getString("Upper"), Lit.UPPER);
+        addCatItem(Messages.getString("Lower"), Lit.LOWER);
+        addCatItem(Messages.getString("Rear"), Lit.REAR);
+        addCatItem(Messages.getString("Front"), Lit.FRONT);
+        addCatItem(Messages.getString("Aero"), Lit.AERO);
+        addCatItem(Messages.getString("AirObstruction"), Lit.AIROBS);
+        addCatItem(Messages.getString("FogDetector"), Lit.FOGDET);
+        addCatItem(Messages.getString("Floodlight"), Lit.FLOOD);
+        addCatItem(Messages.getString("Striplight"), Lit.STRIP);
+        addCatItem(Messages.getString("Subsidiary"), Lit.SUBS);
+        addCatItem(Messages.getString("Spotlight"), Lit.SPOT);
+        addCatItem(Messages.getString("MoireEffect"), Lit.MOIRE);
+        addCatItem(Messages.getString("Emergency"), Lit.EMERG);
+        addCatItem(Messages.getString("Bearing"), Lit.BEAR);
+        categoryBox.addActionListener(alCategory);
+
+        visibilityLabel = new JLabel(Messages.getString("Visibility"), SwingConstants.CENTER);
+        visibilityLabel.setBounds(new Rectangle(185, 40, 165, 20));
+        add(visibilityLabel);
+        visibilityBox = new JComboBox<>();
+        visibilityBox.setBounds(new Rectangle(185, 60, 165, 20));
+        add(visibilityBox);
+        addVisibItem("", Vis.UNKVIS);
+        addVisibItem(Messages.getString("Intensified"), Vis.INTEN);
+        addVisibItem(Messages.getString("Unintensified"), Vis.UNINTEN);
+        addVisibItem(Messages.getString("PartiallyObscured"), Vis.PARTOBS);
+        visibilityBox.addActionListener(alVisibility);
+
+        exhibitionLabel = new JLabel(Messages.getString("Exhibition"), SwingConstants.CENTER);
+        exhibitionLabel.setBounds(new Rectangle(280, 80, 70, 20));
+        add(exhibitionLabel);
+        exhibitionBox = new JComboBox<>();
+        exhibitionBox.setBounds(new Rectangle(280, 100, 70, 20));
+        add(exhibitionBox);
+        addExhibItem("", Exh.UNKEXH);
+        addExhibItem(Messages.getString("24h"), Exh.H24);
+        addExhibItem(Messages.getString("Day"), Exh.DAY);
+        addExhibItem(Messages.getString("Night"), Exh.NIGHT);
+        addExhibItem(Messages.getString("Fog"), Exh.FOG);
+        exhibitionBox.addActionListener(alExhibition);
+
+        orientationLabel = new JLabel(Messages.getString("Orientation"), SwingConstants.CENTER);
+        orientationLabel.setBounds(new Rectangle(188, 80, 80, 20));
+        orientationLabel.setVisible(false);
+        add(orientationLabel);
+        orientationBox = new JTextField();
+        orientationBox.setBounds(new Rectangle(208, 100, 40, 20));
+        orientationBox.setHorizontalAlignment(SwingConstants.CENTER);
+        orientationBox.setVisible(false);
+        add(orientationBox);
+        orientationBox.addFocusListener(flOrientation);
+
+        multipleLabel = new JLabel(Messages.getString("Multiplicity"), SwingConstants.CENTER);
+        multipleLabel.setBounds(new Rectangle(188, 80, 80, 20));
+        multipleLabel.setVisible(false);
+        add(multipleLabel);
+        multipleBox = new JTextField();
+        multipleBox.setBounds(new Rectangle(208, 100, 40, 20));
+        multipleBox.setHorizontalAlignment(SwingConstants.CENTER);
+        multipleBox.setVisible(false);
+        add(multipleBox);
+        multipleBox.addFocusListener(flMultiple);
+    }
+
+    public void syncPanel() {
+        orientationLabel.setVisible(false);
+        orientationBox.setVisible(false);
+        multipleLabel.setVisible(false);
+        multipleBox.setVisible(false);
+        groupBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.GRP, 0));
+        periodBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.PER, 0));
+        sequenceBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.SEQ, 0));
+        heightBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.HGT, 0));
+        rangeBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.RNG, 0));
+        orientationBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.ORT, 0));
+        orientationBox.setVisible(SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR);
+        multipleBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.MLT, 0));
+        multipleBox.setVisible((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ));
+        for (Vis vis : visibilities.keySet()) {
+            int item = visibilities.get(vis);
+            if (SmedAction.panelMain.mark.getLightAtt(Att.VIS, 0) == vis) {
+                visibilityBox.setSelectedIndex(item);
+            }
+        }
+        for (Lit lit : categories.keySet()) {
+            int item = categories.get(lit);
+            if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == lit) {
+                categoryBox.setSelectedIndex(item);
+            }
+        }
+        for (Exh exh : exhibitions.keySet()) {
+            int item = exhibitions.get(exh);
+            if (SmedAction.panelMain.mark.getLightAtt(Att.EXH, 0) == exh) {
+                exhibitionBox.setSelectedIndex(item);
+            }
+        }
+        if (SmedAction.panelMain.mark.isSectored()) {
+            singleButton.setBorderPainted(false);
+            sectorButton.setBorderPainted(true);
+            if (isVisible()) {
+                panelSector.setVisible(true);
+            }
+        } else {
+            singleButton.setBorderPainted(true);
+            sectorButton.setBorderPainted(false);
+            panelSector.setVisible(false);
+            while (SmedAction.panelMain.mark.getSectorCount() > 1) {
+                SmedAction.panelMain.mark.delLight(SmedAction.panelMain.mark.getSectorCount() - 1);
+            }
+        }
+        panelCol.syncPanel();
+        panelChr.syncPanel();
+        panelSector.syncPanel();
+    }
+
+    private void addCatItem(String str, Lit lit) {
+        categories.put(lit, categoryBox.getItemCount());
+        categoryBox.addItem(str);
+    }
+
+    private void addVisibItem(String str, Vis vis) {
+        visibilities.put(vis, visibilityBox.getItemCount());
+        visibilityBox.addItem(str);
+    }
+
+    private void addExhibItem(String str, Exh exh) {
+        exhibitions.put(exh, exhibitionBox.getItemCount());
+        exhibitionBox.addItem(str);
+    }
+
+    private JRadioButton getTypeButton(JRadioButton button, int x, int y, int w, int h, String tip) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alType);
+        typeButtons.add(button);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelMain.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelMain.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelMain.java	(revision 32767)
@@ -3,343 +3,363 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
+import java.awt.Color;
+import java.awt.Insets;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import javax.swing.SwingConstants;
 
 import messages.Messages;
+import seamarks.SeaMark;
 import smed.SmedAction;
-import seamarks.SeaMark;
 
 public class PanelMain extends JPanel {
 
-	private SmedAction dlg;
-	public SeaMark mark = null;
-	public PanelChan panelChan = null;
-	public PanelHaz panelHaz = null;
-	public PanelSpec panelSpec = null;
-	public PanelLights panelLights = null;
-	public PanelMore panelMore = null;
-	public PanelTop panelTop = null;
-	public PanelFog panelFog = null;
-	public PanelRadar panelRadar = null;
-	public PanelLit panelLit = null;
-	public JLabel nameLabel = null;
-	public JTextField nameBox = null;
-	public static JTextField messageBar = null;
-	private FocusListener flName = new FocusListener() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			mark.setName(nameBox.getText());
-		}
-		public void focusGained(java.awt.event.FocusEvent e) {
-		}
-	};
-	public JButton saveButton = null;
-	private ActionListener alSave = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			mark.saveSign(dlg.node);
-		}
-	};
-	public JButton moreButton = null;
-	private ActionListener alMore = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (panelMore.isVisible()) {
-				moreButton.setText(">>");
-				panelMore.setVisible(false);
-				topButton.setEnabled(true);
-				radButton.setEnabled(true);
-				fogButton.setEnabled(true);
-				litButton.setEnabled(true);
-			} else {
-				panelMore.setVisible(true);
-				moreButton.setText("<<");
-				miscButtons.clearSelection();
-				panelTop.setVisible(false);
-				topButton.setBorderPainted(false);
-				topButton.setEnabled(false);
-				panelRadar.setVisible(false);
-				radButton.setBorderPainted(false);
-				radButton.setEnabled(false);
-				panelFog.setVisible(false);
-				fogButton.setBorderPainted(false);
-				fogButton.setEnabled(false);
-				panelLit.setVisible(false);
-				litButton.setBorderPainted(false);
-				litButton.setEnabled(false);
-			}
-		}
-	};
-	public ButtonGroup typeButtons = null;
-	public JRadioButton chanButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ChanButton.png")));
-	public JRadioButton hazButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HazButton.png")));
-	public JRadioButton specButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SpecButton.png")));
-	public JRadioButton lightsButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightsButton.png")));
-	private ActionListener alType = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (chanButton.isSelected()) {
-				chanButton.setBorderPainted(true);
-				panelChan.syncPanel();
-				panelChan.setVisible(true);
-			} else {
-				chanButton.setBorderPainted(false);
-				panelChan.setVisible(false);
-			}
-			if (hazButton.isSelected()) {
-				hazButton.setBorderPainted(true);
-				panelHaz.syncPanel();
-				panelHaz.setVisible(true);
-			} else {
-				hazButton.setBorderPainted(false);
-				panelHaz.setVisible(false);
-			}
-			if (specButton.isSelected()) {
-				specButton.setBorderPainted(true);
-				panelSpec.syncPanel();
-				panelSpec.setVisible(true);
-			} else {
-				specButton.setBorderPainted(false);
-				panelSpec.setVisible(false);
-			}
-			if (lightsButton.isSelected()) {
-				lightsButton.setBorderPainted(true);
-				panelLights.syncPanel();
-				panelLights.setVisible(true);
-			} else {
-				lightsButton.setBorderPainted(false);
-				panelLights.setVisible(false);
-			}
-		}
-	};
-	private ButtonGroup miscButtons = null;
-	public JRadioButton topButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TopButton.png")));
-	public JRadioButton fogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogButton.png")));
-	public JRadioButton radButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png")));
-	public JRadioButton litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png")));
-	private ActionListener alMisc = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (topButton.isSelected()) {
-				moreButton.setText(">>");
-				panelMore.setVisible(false);
-				topButton.setBorderPainted(true);
-				panelTop.setVisible(true);
-				panelTop.syncPanel();
-			} else {
-				topButton.setBorderPainted(false);
-				panelTop.setVisible(false);
-			}
-			if (fogButton.isSelected()) {
-				moreButton.setText(">>");
-				panelMore.setVisible(false);
-				fogButton.setBorderPainted(true);
-				panelFog.setVisible(true);
-				panelFog.syncPanel();
-			} else {
-				fogButton.setBorderPainted(false);
-				panelFog.setVisible(false);
-			}
-			if (radButton.isSelected()) {
-				moreButton.setText(">>");
-				panelMore.setVisible(false);
-				radButton.setBorderPainted(true);
-				panelRadar.setVisible(true);
-				panelRadar.syncPanel();
-			} else {
-				radButton.setBorderPainted(false);
-				panelRadar.setVisible(false);
-			}
-			if (litButton.isSelected()) {
-				moreButton.setText(">>");
-				panelMore.setVisible(false);
-				litButton.setBorderPainted(true);
-				panelLit.setVisible(true);
-				panelLit.syncPanel();
-			} else {
-				litButton.setBorderPainted(false);
-				panelLit.setVisible(false);
-			}
-		}
-	};
-	
-	public PanelMain(SmedAction dia) {
-
-		dlg = dia;
-		setLayout(null);
-		mark = new SeaMark(dlg);
-		mark.setBounds(new Rectangle(235, 0, 165, 160));
-		add(mark);
-		panelChan = new PanelChan(dlg);
-		panelChan.setBounds(new Rectangle(65, 0, 170, 160));
-		panelChan.setVisible(false);
-		add(panelChan);
-		panelHaz = new PanelHaz(dlg);
-		panelHaz.setBounds(new Rectangle(65, 0, 170, 160));
-		panelHaz.setVisible(false);
-		add(panelHaz);
-		panelSpec = new PanelSpec(dlg);
-		panelSpec.setBounds(new Rectangle(65, 0, 170, 160));
-		panelSpec.setVisible(false);
-		add(panelSpec);
-		panelLights = new PanelLights(dlg);
-		panelLights.setBounds(new Rectangle(65, 0, 170, 160));
-		panelLights.setVisible(false);
-		add(panelLights);
-		panelMore = new PanelMore(dlg);
-		panelMore.setBounds(new Rectangle(40, 165, 360, 160));
-		panelMore.setVisible(false);
-		add(panelMore);
-		panelTop = new PanelTop(dlg);
-		panelTop.setBounds(new Rectangle(40, 165, 360, 160));
-		panelTop.setVisible(false);
-		add(panelTop);
-		panelFog = new PanelFog(dlg);
-		panelFog.setBounds(new Rectangle(40, 165, 360, 160));
-		panelFog.setVisible(false);
-		add(panelFog);
-		panelRadar = new PanelRadar(dlg);
-		panelRadar.setBounds(new Rectangle(40, 165, 360, 160));
-		panelRadar.setVisible(false);
-		add(panelRadar);
-		panelLit = new PanelLit(dlg);
-		panelLit.setBounds(new Rectangle(40, 165, 360, 160));
-		panelLit.setVisible(false);
-		add(panelLit);
-
-		add(getButton(chanButton, 0, 0, 62, 40, "Chan"), null);
-		add(getButton(hazButton, 0, 40, 62, 40, "Haz"), null);
-		add(getButton(specButton, 0, 80, 62, 40, "Spec"), null);
-		add(getButton(lightsButton, 0, 120, 62, 40, "Lights"), null);
-		typeButtons = new ButtonGroup();
-		typeButtons.add(chanButton);
-		typeButtons.add(hazButton);
-		typeButtons.add(specButton);
-		typeButtons.add(lightsButton);
-		chanButton.addActionListener(alType);
-		hazButton.addActionListener(alType);
-		specButton.addActionListener(alType);
-		lightsButton.addActionListener(alType);
-
-		add(getButton(topButton, 0, 185, 34, 32, "Topmarks"));
-		add(getButton(fogButton, 0, 220, 34, 32, "FogSignals"));
-		add(getButton(radButton, 0, 255, 34, 32, "Radar"));
-		add(getButton(litButton, 0, 290, 34, 32, "Lit"));
-		miscButtons = new ButtonGroup();
-		miscButtons.add(topButton);
-		miscButtons.add(fogButton);
-		miscButtons.add(radButton);
-		miscButtons.add(litButton);
-		topButton.addActionListener(alMisc);
-		fogButton.addActionListener(alMisc);
-		radButton.addActionListener(alMisc);
-		litButton.addActionListener(alMisc);
-
-		nameLabel = new JLabel();
-		nameLabel.setBounds(new Rectangle(5, 329, 60, 20));
-		nameLabel.setText(tr("Name:"));
-		add(nameLabel);
-		nameBox = new JTextField();
-		nameBox.setBounds(new Rectangle(60, 330, 200, 20));
-		nameBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(nameBox);
-		nameBox.addFocusListener(flName);
-
-		saveButton = new JButton();
-		saveButton.setBounds(new Rectangle(285, 330, 100, 20));
-		saveButton.setText(tr("Save"));
-		add(saveButton);
-		saveButton.addActionListener(alSave);
-
-		moreButton = new JButton();
-		moreButton.setBounds(new Rectangle(0, 165, 34, 15));
-		moreButton.setMargin(new Insets(0, 0, 0, 0));
-		moreButton.setText(">>");
-		add(moreButton);
-		moreButton.addActionListener(alMore);
-
-	    messageBar = new JTextField();
-	    messageBar.setBounds(10, 355, 380, 20);
-	    messageBar.setEditable(false);
-	    messageBar.setBackground(Color.WHITE);
-	    add(messageBar);
-	}
-
-	public void syncPanel() {
-		typeButtons.clearSelection();
-		chanButton.setBorderPainted(false);
-		chanButton.setEnabled(false);
-		hazButton.setBorderPainted(false);
-		hazButton.setEnabled(false);
-		specButton.setBorderPainted(false);
-		specButton.setEnabled(false);
-		lightsButton.setBorderPainted(false);
-		lightsButton.setEnabled(false);
-		miscButtons.clearSelection();
-		topButton.setEnabled(false);
-		topButton.setBorderPainted(false);
-		fogButton.setEnabled(false);
-		fogButton.setBorderPainted(false);
-		radButton.setEnabled(false);
-		radButton.setBorderPainted(false);
-		litButton.setEnabled(false);
-		litButton.setBorderPainted(false);
-		saveButton.setEnabled(false);
-		moreButton.setVisible(false);
-		moreButton.setText(">>");
-		moreButton.setSelected(false);
-		panelChan.setVisible(false);
-		panelHaz.setVisible(false);
-		panelSpec.setVisible(false);
-		panelLights.setVisible(false);
-		panelMore.setVisible(false);
-		panelTop.setVisible(false);
-		panelFog.setVisible(false);
-		panelRadar.setVisible(false);
-		panelLit.setVisible(false);
-		nameBox.setEnabled(false);
-		if (mark != null) {
-			nameBox.setEnabled(true);
-			chanButton.setEnabled(true);
-			hazButton.setEnabled(true);
-			specButton.setEnabled(true);
-			lightsButton.setEnabled(true);
-			nameBox.setText(mark.getName());
-			switch (SeaMark.GrpMAP.get(mark.getObject())) {
-			case LAT:
-			case SAW:
-				chanButton.setBorderPainted(true);
-				panelChan.setVisible(true);
-				panelChan.syncPanel();
-				break;
-			case CAR:
-			case ISD:
-				hazButton.setBorderPainted(true);
-				panelHaz.setVisible(true);
-				panelHaz.syncPanel();
-				break;
-			case SPP:
-				specButton.setBorderPainted(true);
-				panelSpec.setVisible(true);
-				panelSpec.syncPanel();
-				break;
-			case LGT:
-			case STN:
-			case PLF:
-				lightsButton.setBorderPainted(true);
-				panelLights.setVisible(true);
-				panelLights.syncPanel();
-				break;
-			}
-			panelMore.syncPanel();
-			panelTop.syncPanel();
-			panelFog.syncPanel();
-			panelRadar.syncPanel();
-			panelLit.syncPanel();
-		}
-	}
-
-	private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		return button;
-	}
+    private SmedAction dlg;
+    public SeaMark mark = null;
+    public PanelChan panelChan = null;
+    public PanelHaz panelHaz = null;
+    public PanelSpec panelSpec = null;
+    public PanelLights panelLights = null;
+    public PanelMore panelMore = null;
+    public PanelTop panelTop = null;
+    public PanelFog panelFog = null;
+    public PanelRadar panelRadar = null;
+    public PanelLit panelLit = null;
+    public JLabel nameLabel = null;
+    public JTextField nameBox = null;
+    public static JTextField messageBar = null;
+    private FocusListener flName = new FocusListener() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            mark.setName(nameBox.getText());
+        }
+        @Override
+        public void focusGained(FocusEvent e) {
+        }
+    };
+    public JButton saveButton = null;
+    private ActionListener alSave = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            mark.saveSign(dlg.node);
+        }
+    };
+    public JButton moreButton = null;
+    private ActionListener alMore = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if (panelMore.isVisible()) {
+                moreButton.setText(">>");
+                panelMore.setVisible(false);
+                topButton.setEnabled(true);
+                radButton.setEnabled(true);
+                fogButton.setEnabled(true);
+                litButton.setEnabled(true);
+            } else {
+                panelMore.setVisible(true);
+                moreButton.setText("<<");
+                miscButtons.clearSelection();
+                panelTop.setVisible(false);
+                topButton.setBorderPainted(false);
+                topButton.setEnabled(false);
+                panelRadar.setVisible(false);
+                radButton.setBorderPainted(false);
+                radButton.setEnabled(false);
+                panelFog.setVisible(false);
+                fogButton.setBorderPainted(false);
+                fogButton.setEnabled(false);
+                panelLit.setVisible(false);
+                litButton.setBorderPainted(false);
+                litButton.setEnabled(false);
+            }
+        }
+    };
+    public ButtonGroup typeButtons = null;
+    public JRadioButton chanButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ChanButton.png")));
+    public JRadioButton hazButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HazButton.png")));
+    public JRadioButton specButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SpecButton.png")));
+    public JRadioButton lightsButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightsButton.png")));
+    private ActionListener alType = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if (chanButton.isSelected()) {
+                chanButton.setBorderPainted(true);
+                panelChan.syncPanel();
+                panelChan.setVisible(true);
+            } else {
+                chanButton.setBorderPainted(false);
+                panelChan.setVisible(false);
+            }
+            if (hazButton.isSelected()) {
+                hazButton.setBorderPainted(true);
+                panelHaz.syncPanel();
+                panelHaz.setVisible(true);
+            } else {
+                hazButton.setBorderPainted(false);
+                panelHaz.setVisible(false);
+            }
+            if (specButton.isSelected()) {
+                specButton.setBorderPainted(true);
+                panelSpec.syncPanel();
+                panelSpec.setVisible(true);
+            } else {
+                specButton.setBorderPainted(false);
+                panelSpec.setVisible(false);
+            }
+            if (lightsButton.isSelected()) {
+                lightsButton.setBorderPainted(true);
+                panelLights.syncPanel();
+                panelLights.setVisible(true);
+            } else {
+                lightsButton.setBorderPainted(false);
+                panelLights.setVisible(false);
+            }
+        }
+    };
+    private ButtonGroup miscButtons = null;
+    public JRadioButton topButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TopButton.png")));
+    public JRadioButton fogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogButton.png")));
+    public JRadioButton radButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png")));
+    public JRadioButton litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png")));
+    private ActionListener alMisc = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if (topButton.isSelected()) {
+                moreButton.setText(">>");
+                panelMore.setVisible(false);
+                topButton.setBorderPainted(true);
+                panelTop.setVisible(true);
+                panelTop.syncPanel();
+            } else {
+                topButton.setBorderPainted(false);
+                panelTop.setVisible(false);
+            }
+            if (fogButton.isSelected()) {
+                moreButton.setText(">>");
+                panelMore.setVisible(false);
+                fogButton.setBorderPainted(true);
+                panelFog.setVisible(true);
+                panelFog.syncPanel();
+            } else {
+                fogButton.setBorderPainted(false);
+                panelFog.setVisible(false);
+            }
+            if (radButton.isSelected()) {
+                moreButton.setText(">>");
+                panelMore.setVisible(false);
+                radButton.setBorderPainted(true);
+                panelRadar.setVisible(true);
+                panelRadar.syncPanel();
+            } else {
+                radButton.setBorderPainted(false);
+                panelRadar.setVisible(false);
+            }
+            if (litButton.isSelected()) {
+                moreButton.setText(">>");
+                panelMore.setVisible(false);
+                litButton.setBorderPainted(true);
+                panelLit.setVisible(true);
+                panelLit.syncPanel();
+            } else {
+                litButton.setBorderPainted(false);
+                panelLit.setVisible(false);
+            }
+        }
+    };
+
+    public PanelMain(SmedAction dia) {
+
+        dlg = dia;
+        setLayout(null);
+        mark = new SeaMark(dlg);
+        mark.setBounds(new Rectangle(235, 0, 165, 160));
+        add(mark);
+        panelChan = new PanelChan(dlg);
+        panelChan.setBounds(new Rectangle(65, 0, 170, 160));
+        panelChan.setVisible(false);
+        add(panelChan);
+        panelHaz = new PanelHaz(dlg);
+        panelHaz.setBounds(new Rectangle(65, 0, 170, 160));
+        panelHaz.setVisible(false);
+        add(panelHaz);
+        panelSpec = new PanelSpec(dlg);
+        panelSpec.setBounds(new Rectangle(65, 0, 170, 160));
+        panelSpec.setVisible(false);
+        add(panelSpec);
+        panelLights = new PanelLights(dlg);
+        panelLights.setBounds(new Rectangle(65, 0, 170, 160));
+        panelLights.setVisible(false);
+        add(panelLights);
+        panelMore = new PanelMore(dlg);
+        panelMore.setBounds(new Rectangle(40, 165, 360, 160));
+        panelMore.setVisible(false);
+        add(panelMore);
+        panelTop = new PanelTop(dlg);
+        panelTop.setBounds(new Rectangle(40, 165, 360, 160));
+        panelTop.setVisible(false);
+        add(panelTop);
+        panelFog = new PanelFog(dlg);
+        panelFog.setBounds(new Rectangle(40, 165, 360, 160));
+        panelFog.setVisible(false);
+        add(panelFog);
+        panelRadar = new PanelRadar(dlg);
+        panelRadar.setBounds(new Rectangle(40, 165, 360, 160));
+        panelRadar.setVisible(false);
+        add(panelRadar);
+        panelLit = new PanelLit(dlg);
+        panelLit.setBounds(new Rectangle(40, 165, 360, 160));
+        panelLit.setVisible(false);
+        add(panelLit);
+
+        add(getButton(chanButton, 0, 0, 62, 40, "Chan"), null);
+        add(getButton(hazButton, 0, 40, 62, 40, "Haz"), null);
+        add(getButton(specButton, 0, 80, 62, 40, "Spec"), null);
+        add(getButton(lightsButton, 0, 120, 62, 40, "Lights"), null);
+        typeButtons = new ButtonGroup();
+        typeButtons.add(chanButton);
+        typeButtons.add(hazButton);
+        typeButtons.add(specButton);
+        typeButtons.add(lightsButton);
+        chanButton.addActionListener(alType);
+        hazButton.addActionListener(alType);
+        specButton.addActionListener(alType);
+        lightsButton.addActionListener(alType);
+
+        add(getButton(topButton, 0, 185, 34, 32, "Topmarks"));
+        add(getButton(fogButton, 0, 220, 34, 32, "FogSignals"));
+        add(getButton(radButton, 0, 255, 34, 32, "Radar"));
+        add(getButton(litButton, 0, 290, 34, 32, "Lit"));
+        miscButtons = new ButtonGroup();
+        miscButtons.add(topButton);
+        miscButtons.add(fogButton);
+        miscButtons.add(radButton);
+        miscButtons.add(litButton);
+        topButton.addActionListener(alMisc);
+        fogButton.addActionListener(alMisc);
+        radButton.addActionListener(alMisc);
+        litButton.addActionListener(alMisc);
+
+        nameLabel = new JLabel();
+        nameLabel.setBounds(new Rectangle(5, 329, 60, 20));
+        nameLabel.setText(tr("Name:"));
+        add(nameLabel);
+        nameBox = new JTextField();
+        nameBox.setBounds(new Rectangle(60, 330, 200, 20));
+        nameBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(nameBox);
+        nameBox.addFocusListener(flName);
+
+        saveButton = new JButton();
+        saveButton.setBounds(new Rectangle(285, 330, 100, 20));
+        saveButton.setText(tr("Save"));
+        add(saveButton);
+        saveButton.addActionListener(alSave);
+
+        moreButton = new JButton();
+        moreButton.setBounds(new Rectangle(0, 165, 34, 15));
+        moreButton.setMargin(new Insets(0, 0, 0, 0));
+        moreButton.setText(">>");
+        add(moreButton);
+        moreButton.addActionListener(alMore);
+
+        messageBar = new JTextField();
+        messageBar.setBounds(10, 355, 380, 20);
+        messageBar.setEditable(false);
+        messageBar.setBackground(Color.WHITE);
+        add(messageBar);
+    }
+
+    public void syncPanel() {
+        typeButtons.clearSelection();
+        chanButton.setBorderPainted(false);
+        chanButton.setEnabled(false);
+        hazButton.setBorderPainted(false);
+        hazButton.setEnabled(false);
+        specButton.setBorderPainted(false);
+        specButton.setEnabled(false);
+        lightsButton.setBorderPainted(false);
+        lightsButton.setEnabled(false);
+        miscButtons.clearSelection();
+        topButton.setEnabled(false);
+        topButton.setBorderPainted(false);
+        fogButton.setEnabled(false);
+        fogButton.setBorderPainted(false);
+        radButton.setEnabled(false);
+        radButton.setBorderPainted(false);
+        litButton.setEnabled(false);
+        litButton.setBorderPainted(false);
+        saveButton.setEnabled(false);
+        moreButton.setVisible(false);
+        moreButton.setText(">>");
+        moreButton.setSelected(false);
+        panelChan.setVisible(false);
+        panelHaz.setVisible(false);
+        panelSpec.setVisible(false);
+        panelLights.setVisible(false);
+        panelMore.setVisible(false);
+        panelTop.setVisible(false);
+        panelFog.setVisible(false);
+        panelRadar.setVisible(false);
+        panelLit.setVisible(false);
+        nameBox.setEnabled(false);
+        if (mark != null) {
+            nameBox.setEnabled(true);
+            chanButton.setEnabled(true);
+            hazButton.setEnabled(true);
+            specButton.setEnabled(true);
+            lightsButton.setEnabled(true);
+            nameBox.setText(mark.getName());
+            switch (SeaMark.GrpMAP.get(mark.getObject())) {
+            case LAT:
+            case SAW:
+                chanButton.setBorderPainted(true);
+                panelChan.setVisible(true);
+                panelChan.syncPanel();
+                break;
+            case CAR:
+            case ISD:
+                hazButton.setBorderPainted(true);
+                panelHaz.setVisible(true);
+                panelHaz.syncPanel();
+                break;
+            case SPP:
+                specButton.setBorderPainted(true);
+                panelSpec.setVisible(true);
+                panelSpec.syncPanel();
+                break;
+            case LGT:
+            case STN:
+            case PLF:
+                lightsButton.setBorderPainted(true);
+                panelLights.setVisible(true);
+                panelLights.syncPanel();
+                break;
+            }
+            panelMore.syncPanel();
+            panelTop.syncPanel();
+            panelFog.syncPanel();
+            panelRadar.syncPanel();
+            panelLit.syncPanel();
+        }
+    }
+
+    private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelMore.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelMore.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelMore.java	(revision 32767)
@@ -1,363 +1,397 @@
 package panels;
 
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.*;
-
-import java.util.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.util.EnumMap;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import javax.swing.SwingConstants;
 
 import messages.Messages;
+import seamarks.SeaMark.Cns;
+import seamarks.SeaMark.Col;
+import seamarks.SeaMark.Con;
+import seamarks.SeaMark.Ent;
+import seamarks.SeaMark.Pat;
+import seamarks.SeaMark.Reg;
+import seamarks.SeaMark.Sts;
 import smed.SmedAction;
-import seamarks.SeaMark.*;
 
 public class PanelMore extends JPanel {
 
-	private SmedAction dlg;
-	public JLabel infoLabel;
-	public JTextField infoBox;
-	private FocusListener flInfo = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setInfo(infoBox.getText());
-		}
-	};
-	public JLabel sourceLabel;
-	public JTextField sourceBox;
-	private FocusListener flSource = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setSource(sourceBox.getText());
-		}
-	};
-	public JLabel elevLabel;
-	public JTextField elevBox;
-	private FocusListener flElev = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setElevation(elevBox.getText());
-		}
-	};
-	public JLabel heightLabel;
-	public JTextField heightBox;
-	private FocusListener flHeight = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setObjectHeight(heightBox.getText());
-		}
-	};
-	public JLabel statusLabel;
-	public JComboBox<String> statusBox;
-	public EnumMap<Sts, Integer> statuses = new EnumMap<>(Sts.class);
-	private ActionListener alStatus = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Sts sts : statuses.keySet()) {
-				int idx = statuses.get(sts);
-				if (SmedAction.panelMain.mark != null && (idx == statusBox.getSelectedIndex()))
-					SmedAction.panelMain.mark.setStatus(sts);
-			}
-		}
-	};
-	public JLabel constrLabel;
-	public JComboBox<String> constrBox;
-	public EnumMap<Cns, Integer> constructions = new EnumMap<>(Cns.class);
-	private ActionListener alConstr = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cns cns : constructions.keySet()) {
-				int idx = constructions.get(cns);
-				if (SmedAction.panelMain.mark != null && (idx == constrBox.getSelectedIndex()))
-					SmedAction.panelMain.mark.setConstr(cns);
-			}
-		}
-	};
-	public JLabel conLabel;
-	public JComboBox<String> conBox;
-	public EnumMap<Con, Integer> conspicuities = new EnumMap<>(Con.class);
-	private ActionListener alCon = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Con con : conspicuities.keySet()) {
-				int idx = conspicuities.get(con);
-				if (SmedAction.panelMain.mark != null && (idx == conBox.getSelectedIndex()))
-					SmedAction.panelMain.mark.setConsp(con);
-			}
-		}
-	};
-	public JLabel reflLabel;
-	public JComboBox<String> reflBox;
-	public EnumMap<Con, Integer> reflectivities = new EnumMap<>(Con.class);
-	private ActionListener alRefl = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Con con : reflectivities.keySet()) {
-				int idx = reflectivities.get(con);
-				if (SmedAction.panelMain.mark != null && (idx == reflBox.getSelectedIndex()))
-					SmedAction.panelMain.mark.setRefl(con);
-			}
-		}
-	};
-	public PanelPat panelPat;
-	private ButtonGroup regionButtons = new ButtonGroup();
-	public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
-	public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
-	public JRadioButton regionCButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionCButton.png")));
-	private ActionListener alRegion = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (regionAButton.isSelected()) {
-				SmedAction.panelMain.mark.setRegion(Reg.A);
-				switch (dlg.panelMain.mark.getCategory()) {
-				case LAM_PORT:
-					dlg.panelMain.mark.setObjColour(Col.RED);
-					dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
-					break;
-				case LAM_PPORT:
-					dlg.panelMain.mark.setObjColour(Col.RED);
-					dlg.panelMain.mark.addObjColour(Col.GREEN);
-					dlg.panelMain.mark.addObjColour(Col.RED);
-					dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
-					break;
-				case LAM_STBD:
-					dlg.panelMain.mark.setObjColour(Col.GREEN);
-					dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
-					break;
-				case LAM_PSTBD:
-					dlg.panelMain.mark.setObjColour(Col.GREEN);
-					dlg.panelMain.mark.addObjColour(Col.RED);
-					dlg.panelMain.mark.addObjColour(Col.GREEN);
-					dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
-					break;
-				}
-				regionAButton.setBorderPainted(true);
-			} else {
-				regionAButton.setBorderPainted(false);
-			}
-			if (regionBButton.isSelected()) {
-				dlg.panelMain.mark.setRegion(Reg.B);
-				switch (dlg.panelMain.mark.getCategory()) {
-				case LAM_PORT:
-					dlg.panelMain.mark.setObjColour(Col.GREEN);
-					dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
-					break;
-				case LAM_PPORT:
-					dlg.panelMain.mark.setObjColour(Col.GREEN);
-					dlg.panelMain.mark.addObjColour(Col.RED);
-					dlg.panelMain.mark.addObjColour(Col.GREEN);
-					dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
-					break;
-				case LAM_STBD:
-					dlg.panelMain.mark.setObjColour(Col.RED);
-					dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
-					break;
-				case LAM_PSTBD:
-					dlg.panelMain.mark.setObjColour(Col.RED);
-					dlg.panelMain.mark.addObjColour(Col.GREEN);
-					dlg.panelMain.mark.addObjColour(Col.RED);
-					dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
-					break;
-				}
-				regionBButton.setBorderPainted(true);
-			} else {
-				regionBButton.setBorderPainted(false);
-			}
-			if (regionCButton.isSelected()) {
-				dlg.panelMain.mark.setRegion(Reg.C);
-				dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
-				switch (dlg.panelMain.mark.getCategory()) {
-				case LAM_PORT:
-					dlg.panelMain.mark.setObjColour(Col.RED);
-					dlg.panelMain.mark.addObjColour(Col.WHITE);
-					dlg.panelMain.mark.addObjColour(Col.RED);
-					dlg.panelMain.mark.addObjColour(Col.WHITE);
-					break;
-				case LAM_PPORT:
-				case LAM_PSTBD:
-					dlg.panelMain.mark.setObjColour(Col.RED);
-					dlg.panelMain.mark.addObjColour(Col.GREEN);
-					dlg.panelMain.mark.addObjColour(Col.RED);
-					dlg.panelMain.mark.addObjColour(Col.GREEN);
-					break;
-				case LAM_STBD:
-					dlg.panelMain.mark.setObjColour(Col.GREEN);
-					dlg.panelMain.mark.addObjColour(Col.WHITE);
-					dlg.panelMain.mark.addObjColour(Col.GREEN);
-					dlg.panelMain.mark.addObjColour(Col.WHITE);
-					break;
-				}
-				regionCButton.setBorderPainted(true);
-			} else {
-				regionCButton.setBorderPainted(false);
-			}
-			panelPat.syncPanel();
-		}
-	};
-
-	public PanelMore(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		panelPat = new PanelPat(dlg, Ent.BODY);
-		panelPat.setBounds(new Rectangle(0, 0, 110, 160));
-		add(panelPat);
-		add(getRegionButton(regionAButton, 110, 0, 34, 30, "RegionA"));
-		add(getRegionButton(regionBButton, 110, 32, 34, 30, "RegionB"));
-		add(getRegionButton(regionCButton, 110, 64, 34, 30, "RegionC"));
-
-		elevLabel = new JLabel(Messages.getString("Elevation"), SwingConstants.CENTER);
-		elevLabel.setBounds(new Rectangle(140, 0, 90, 20));
-		add(elevLabel);
-		elevBox = new JTextField();
-		elevBox.setBounds(new Rectangle(160, 20, 50, 20));
-		elevBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(elevBox);
-		elevBox.addFocusListener(flElev);
-
-		heightLabel = new JLabel(Messages.getString("Height"), SwingConstants.CENTER);
-		heightLabel.setBounds(new Rectangle(140, 40, 90, 20));
-		add(heightLabel);
-		heightBox = new JTextField();
-		heightBox.setBounds(new Rectangle(160, 60, 50, 20));
-		heightBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(heightBox);
-		heightBox.addFocusListener(flHeight);
-
-		sourceLabel = new JLabel(Messages.getString("Source"), SwingConstants.CENTER);
-		sourceLabel.setBounds(new Rectangle(110, 80, 130, 20));
-		add(sourceLabel);
-		sourceBox = new JTextField();
-		sourceBox.setBounds(new Rectangle(110, 100, 130, 20));
-		sourceBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(sourceBox);
-		sourceBox.addFocusListener(flSource);
-
-		infoLabel = new JLabel(Messages.getString("Information"), SwingConstants.CENTER);
-		infoLabel.setBounds(new Rectangle(110, 120, 130, 20));
-		add(infoLabel);
-		infoBox = new JTextField();
-		infoBox.setBounds(new Rectangle(110, 140, 130, 20));
-		infoBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(infoBox);
-		infoBox.addFocusListener(flInfo);
-
-		statusLabel = new JLabel(Messages.getString("Status"), SwingConstants.CENTER);
-		statusLabel.setBounds(new Rectangle(250, 0, 100, 20));
-		add(statusLabel);
-		statusBox = new JComboBox<>();
-		statusBox.setBounds(new Rectangle(250, 20, 100, 20));
-		addStsItem("", Sts.UNKSTS);
-		addStsItem(Messages.getString("Permanent"), Sts.PERM);
-		addStsItem(Messages.getString("Occasional"), Sts.OCC);
-		addStsItem(Messages.getString("Recommended"), Sts.REC);
-		addStsItem(Messages.getString("NotInUse"), Sts.NIU);
-		addStsItem(Messages.getString("Intermittent"), Sts.INT);
-		addStsItem(Messages.getString("Reserved"), Sts.RESV);
-		addStsItem(Messages.getString("Temporary"), Sts.TEMP);
-		addStsItem(Messages.getString("Private"), Sts.PRIV);
-		addStsItem(Messages.getString("Mandatory"), Sts.MAND);
-		addStsItem(Messages.getString("Destroyed"), Sts.DEST);
-		addStsItem(Messages.getString("Extinguished"), Sts.EXT);
-		addStsItem(Messages.getString("Illuminated"), Sts.ILLUM);
-		addStsItem(Messages.getString("Historic"), Sts.HIST);
-		addStsItem(Messages.getString("Public"), Sts.PUB);
-		addStsItem(Messages.getString("Synchronized"), Sts.SYNC);
-		addStsItem(Messages.getString("Watched"), Sts.WATCH);
-		addStsItem(Messages.getString("UnWatched"), Sts.UNWAT);
-		addStsItem(Messages.getString("Doubtful"), Sts.DOUBT);
-		add(statusBox);
-		statusBox.addActionListener(alStatus);
-
-		constrLabel = new JLabel(Messages.getString("Construction"), SwingConstants.CENTER);
-		constrLabel.setBounds(new Rectangle(250, 40, 100, 20));
-		add(constrLabel);
-		constrBox = new JComboBox<>();
-		constrBox.setBounds(new Rectangle(250, 60, 100, 20));
-		addCnsItem("", Cns.UNKCNS);
-		addCnsItem(Messages.getString("Masonry"), Cns.BRICK);
-		addCnsItem(Messages.getString("Concreted"), Cns.CONC);
-		addCnsItem(Messages.getString("Boulders"), Cns.BOULD);
-		addCnsItem(Messages.getString("HardSurfaced"), Cns.HSURF);
-		addCnsItem(Messages.getString("Unsurfaced"), Cns.USURF);
-		addCnsItem(Messages.getString("Wooden"), Cns.WOOD);
-		addCnsItem(Messages.getString("Metal"), Cns.METAL);
-		addCnsItem(Messages.getString("GRP"), Cns.GLAS);
-		addCnsItem(Messages.getString("Painted"), Cns.PAINT);
-		add(constrBox);
-		constrBox.addActionListener(alConstr);
-
-		conLabel = new JLabel(Messages.getString("Conspicuity"), SwingConstants.CENTER);
-		conLabel.setBounds(new Rectangle(250, 80, 100, 20));
-		add(conLabel);
-		conBox = new JComboBox<>();
-		conBox.setBounds(new Rectangle(250, 100, 100, 20));
-		addConItem("", Con.UNKCON);
-		addConItem(Messages.getString("Conspicuous"), Con.CONSP);
-		addConItem(Messages.getString("NotConspicuous"), Con.NCONS);
-		add(conBox);
-		conBox.addActionListener(alCon);
-
-		reflLabel = new JLabel(Messages.getString("Reflectivity"), SwingConstants.CENTER);
-		reflLabel.setBounds(new Rectangle(250, 120, 100, 20));
-		add(reflLabel);
-		reflBox = new JComboBox<>();
-		reflBox.setBounds(new Rectangle(250, 140, 100, 20));
-		addReflItem("", Con.UNKCON);
-		addReflItem(Messages.getString("Conspicuous"), Con.CONSP);
-		addReflItem(Messages.getString("NotConspicuous"), Con.NCONS);
-		addReflItem(Messages.getString("Reflector"), Con.REFL);
-		add(reflBox);
-		reflBox.addActionListener(alRefl);
-
-	}
-
-	public void syncPanel() {
-		panelPat.syncPanel();
-		regionAButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.A);
-		regionBButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.B);
-		regionCButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.C);
-		elevBox.setText(dlg.panelMain.mark.getElevation());
-		heightBox.setText(dlg.panelMain.mark.getObjectHeight());
-		sourceBox.setText(dlg.panelMain.mark.getSource());
-		infoBox.setText(dlg.panelMain.mark.getInfo());
-		for (Sts sts : statuses.keySet()) {
-			int item = statuses.get(sts);
-			if (dlg.panelMain.mark.getStatus() == sts)
-				statusBox.setSelectedIndex(item);
-		}
-		for (Cns cns : constructions.keySet()) {
-			int item = constructions.get(cns);
-			if (dlg.panelMain.mark.getConstr() == cns)
-				constrBox.setSelectedIndex(item);
-		}
-		for (Con con : conspicuities.keySet()) {
-			int item = conspicuities.get(con);
-			if (dlg.panelMain.mark.getConsp() == con)
-				conBox.setSelectedIndex(item);
-		}
-		for (Con con : reflectivities.keySet()) {
-			int item = reflectivities.get(con);
-			if (dlg.panelMain.mark.getRefl() == con)
-				reflBox.setSelectedIndex(item);
-		}
-	}
-
-	private void addStsItem(String str, Sts sts) {
-		statuses.put(sts, statusBox.getItemCount());
-		statusBox.addItem(str);
-	}
-
-	private void addCnsItem(String str, Cns cns) {
-		constructions.put(cns, constrBox.getItemCount());
-		constrBox.addItem(str);
-	}
-
-	private void addConItem(String str, Con con) {
-		conspicuities.put(con, conBox.getItemCount());
-		conBox.addItem(str);
-	}
-
-	private void addReflItem(String str, Con con) {
-		reflectivities.put(con, reflBox.getItemCount());
-		reflBox.addItem(str);
-	}
-
-	private JRadioButton getRegionButton(JRadioButton button, int x, int y, int w, int h, String tip) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alRegion);
-		regionButtons.add(button);
-		return button;
-	}
+    private SmedAction dlg;
+    public JLabel infoLabel;
+    public JTextField infoBox;
+    private FocusListener flInfo = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setInfo(infoBox.getText());
+        }
+    };
+    public JLabel sourceLabel;
+    public JTextField sourceBox;
+    private FocusListener flSource = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setSource(sourceBox.getText());
+        }
+    };
+    public JLabel elevLabel;
+    public JTextField elevBox;
+    private FocusListener flElev = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setElevation(elevBox.getText());
+        }
+    };
+    public JLabel heightLabel;
+    public JTextField heightBox;
+    private FocusListener flHeight = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setObjectHeight(heightBox.getText());
+        }
+    };
+    public JLabel statusLabel;
+    public JComboBox<String> statusBox;
+    public EnumMap<Sts, Integer> statuses = new EnumMap<>(Sts.class);
+    private ActionListener alStatus = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Sts sts : statuses.keySet()) {
+                int idx = statuses.get(sts);
+                if (SmedAction.panelMain.mark != null && (idx == statusBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setStatus(sts);
+                }
+            }
+        }
+    };
+    public JLabel constrLabel;
+    public JComboBox<String> constrBox;
+    public EnumMap<Cns, Integer> constructions = new EnumMap<>(Cns.class);
+    private ActionListener alConstr = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cns cns : constructions.keySet()) {
+                int idx = constructions.get(cns);
+                if (SmedAction.panelMain.mark != null && (idx == constrBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setConstr(cns);
+                }
+            }
+        }
+    };
+    public JLabel conLabel;
+    public JComboBox<String> conBox;
+    public EnumMap<Con, Integer> conspicuities = new EnumMap<>(Con.class);
+    private ActionListener alCon = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Con con : conspicuities.keySet()) {
+                int idx = conspicuities.get(con);
+                if (SmedAction.panelMain.mark != null && (idx == conBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setConsp(con);
+                }
+            }
+        }
+    };
+    public JLabel reflLabel;
+    public JComboBox<String> reflBox;
+    public EnumMap<Con, Integer> reflectivities = new EnumMap<>(Con.class);
+    private ActionListener alRefl = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Con con : reflectivities.keySet()) {
+                int idx = reflectivities.get(con);
+                if (SmedAction.panelMain.mark != null && (idx == reflBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setRefl(con);
+                }
+            }
+        }
+    };
+    public PanelPat panelPat;
+    private ButtonGroup regionButtons = new ButtonGroup();
+    public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
+    public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
+    public JRadioButton regionCButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionCButton.png")));
+    private ActionListener alRegion = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if (regionAButton.isSelected()) {
+                SmedAction.panelMain.mark.setRegion(Reg.A);
+                switch (dlg.panelMain.mark.getCategory()) {
+                case LAM_PORT:
+                    dlg.panelMain.mark.setObjColour(Col.RED);
+                    dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
+                    break;
+                case LAM_PPORT:
+                    dlg.panelMain.mark.setObjColour(Col.RED);
+                    dlg.panelMain.mark.addObjColour(Col.GREEN);
+                    dlg.panelMain.mark.addObjColour(Col.RED);
+                    dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
+                    break;
+                case LAM_STBD:
+                    dlg.panelMain.mark.setObjColour(Col.GREEN);
+                    dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
+                    break;
+                case LAM_PSTBD:
+                    dlg.panelMain.mark.setObjColour(Col.GREEN);
+                    dlg.panelMain.mark.addObjColour(Col.RED);
+                    dlg.panelMain.mark.addObjColour(Col.GREEN);
+                    dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
+                    break;
+                }
+                regionAButton.setBorderPainted(true);
+            } else {
+                regionAButton.setBorderPainted(false);
+            }
+            if (regionBButton.isSelected()) {
+                dlg.panelMain.mark.setRegion(Reg.B);
+                switch (dlg.panelMain.mark.getCategory()) {
+                case LAM_PORT:
+                    dlg.panelMain.mark.setObjColour(Col.GREEN);
+                    dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
+                    break;
+                case LAM_PPORT:
+                    dlg.panelMain.mark.setObjColour(Col.GREEN);
+                    dlg.panelMain.mark.addObjColour(Col.RED);
+                    dlg.panelMain.mark.addObjColour(Col.GREEN);
+                    dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
+                    break;
+                case LAM_STBD:
+                    dlg.panelMain.mark.setObjColour(Col.RED);
+                    dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
+                    break;
+                case LAM_PSTBD:
+                    dlg.panelMain.mark.setObjColour(Col.RED);
+                    dlg.panelMain.mark.addObjColour(Col.GREEN);
+                    dlg.panelMain.mark.addObjColour(Col.RED);
+                    dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
+                    break;
+                }
+                regionBButton.setBorderPainted(true);
+            } else {
+                regionBButton.setBorderPainted(false);
+            }
+            if (regionCButton.isSelected()) {
+                dlg.panelMain.mark.setRegion(Reg.C);
+                dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
+                switch (dlg.panelMain.mark.getCategory()) {
+                case LAM_PORT:
+                    dlg.panelMain.mark.setObjColour(Col.RED);
+                    dlg.panelMain.mark.addObjColour(Col.WHITE);
+                    dlg.panelMain.mark.addObjColour(Col.RED);
+                    dlg.panelMain.mark.addObjColour(Col.WHITE);
+                    break;
+                case LAM_PPORT:
+                case LAM_PSTBD:
+                    dlg.panelMain.mark.setObjColour(Col.RED);
+                    dlg.panelMain.mark.addObjColour(Col.GREEN);
+                    dlg.panelMain.mark.addObjColour(Col.RED);
+                    dlg.panelMain.mark.addObjColour(Col.GREEN);
+                    break;
+                case LAM_STBD:
+                    dlg.panelMain.mark.setObjColour(Col.GREEN);
+                    dlg.panelMain.mark.addObjColour(Col.WHITE);
+                    dlg.panelMain.mark.addObjColour(Col.GREEN);
+                    dlg.panelMain.mark.addObjColour(Col.WHITE);
+                    break;
+                }
+                regionCButton.setBorderPainted(true);
+            } else {
+                regionCButton.setBorderPainted(false);
+            }
+            panelPat.syncPanel();
+        }
+    };
+
+    public PanelMore(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        panelPat = new PanelPat(dlg, Ent.BODY);
+        panelPat.setBounds(new Rectangle(0, 0, 110, 160));
+        add(panelPat);
+        add(getRegionButton(regionAButton, 110, 0, 34, 30, "RegionA"));
+        add(getRegionButton(regionBButton, 110, 32, 34, 30, "RegionB"));
+        add(getRegionButton(regionCButton, 110, 64, 34, 30, "RegionC"));
+
+        elevLabel = new JLabel(Messages.getString("Elevation"), SwingConstants.CENTER);
+        elevLabel.setBounds(new Rectangle(140, 0, 90, 20));
+        add(elevLabel);
+        elevBox = new JTextField();
+        elevBox.setBounds(new Rectangle(160, 20, 50, 20));
+        elevBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(elevBox);
+        elevBox.addFocusListener(flElev);
+
+        heightLabel = new JLabel(Messages.getString("Height"), SwingConstants.CENTER);
+        heightLabel.setBounds(new Rectangle(140, 40, 90, 20));
+        add(heightLabel);
+        heightBox = new JTextField();
+        heightBox.setBounds(new Rectangle(160, 60, 50, 20));
+        heightBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(heightBox);
+        heightBox.addFocusListener(flHeight);
+
+        sourceLabel = new JLabel(Messages.getString("Source"), SwingConstants.CENTER);
+        sourceLabel.setBounds(new Rectangle(110, 80, 130, 20));
+        add(sourceLabel);
+        sourceBox = new JTextField();
+        sourceBox.setBounds(new Rectangle(110, 100, 130, 20));
+        sourceBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(sourceBox);
+        sourceBox.addFocusListener(flSource);
+
+        infoLabel = new JLabel(Messages.getString("Information"), SwingConstants.CENTER);
+        infoLabel.setBounds(new Rectangle(110, 120, 130, 20));
+        add(infoLabel);
+        infoBox = new JTextField();
+        infoBox.setBounds(new Rectangle(110, 140, 130, 20));
+        infoBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(infoBox);
+        infoBox.addFocusListener(flInfo);
+
+        statusLabel = new JLabel(Messages.getString("Status"), SwingConstants.CENTER);
+        statusLabel.setBounds(new Rectangle(250, 0, 100, 20));
+        add(statusLabel);
+        statusBox = new JComboBox<>();
+        statusBox.setBounds(new Rectangle(250, 20, 100, 20));
+        addStsItem("", Sts.UNKSTS);
+        addStsItem(Messages.getString("Permanent"), Sts.PERM);
+        addStsItem(Messages.getString("Occasional"), Sts.OCC);
+        addStsItem(Messages.getString("Recommended"), Sts.REC);
+        addStsItem(Messages.getString("NotInUse"), Sts.NIU);
+        addStsItem(Messages.getString("Intermittent"), Sts.INT);
+        addStsItem(Messages.getString("Reserved"), Sts.RESV);
+        addStsItem(Messages.getString("Temporary"), Sts.TEMP);
+        addStsItem(Messages.getString("Private"), Sts.PRIV);
+        addStsItem(Messages.getString("Mandatory"), Sts.MAND);
+        addStsItem(Messages.getString("Destroyed"), Sts.DEST);
+        addStsItem(Messages.getString("Extinguished"), Sts.EXT);
+        addStsItem(Messages.getString("Illuminated"), Sts.ILLUM);
+        addStsItem(Messages.getString("Historic"), Sts.HIST);
+        addStsItem(Messages.getString("Public"), Sts.PUB);
+        addStsItem(Messages.getString("Synchronized"), Sts.SYNC);
+        addStsItem(Messages.getString("Watched"), Sts.WATCH);
+        addStsItem(Messages.getString("UnWatched"), Sts.UNWAT);
+        addStsItem(Messages.getString("Doubtful"), Sts.DOUBT);
+        add(statusBox);
+        statusBox.addActionListener(alStatus);
+
+        constrLabel = new JLabel(Messages.getString("Construction"), SwingConstants.CENTER);
+        constrLabel.setBounds(new Rectangle(250, 40, 100, 20));
+        add(constrLabel);
+        constrBox = new JComboBox<>();
+        constrBox.setBounds(new Rectangle(250, 60, 100, 20));
+        addCnsItem("", Cns.UNKCNS);
+        addCnsItem(Messages.getString("Masonry"), Cns.BRICK);
+        addCnsItem(Messages.getString("Concreted"), Cns.CONC);
+        addCnsItem(Messages.getString("Boulders"), Cns.BOULD);
+        addCnsItem(Messages.getString("HardSurfaced"), Cns.HSURF);
+        addCnsItem(Messages.getString("Unsurfaced"), Cns.USURF);
+        addCnsItem(Messages.getString("Wooden"), Cns.WOOD);
+        addCnsItem(Messages.getString("Metal"), Cns.METAL);
+        addCnsItem(Messages.getString("GRP"), Cns.GLAS);
+        addCnsItem(Messages.getString("Painted"), Cns.PAINT);
+        add(constrBox);
+        constrBox.addActionListener(alConstr);
+
+        conLabel = new JLabel(Messages.getString("Conspicuity"), SwingConstants.CENTER);
+        conLabel.setBounds(new Rectangle(250, 80, 100, 20));
+        add(conLabel);
+        conBox = new JComboBox<>();
+        conBox.setBounds(new Rectangle(250, 100, 100, 20));
+        addConItem("", Con.UNKCON);
+        addConItem(Messages.getString("Conspicuous"), Con.CONSP);
+        addConItem(Messages.getString("NotConspicuous"), Con.NCONS);
+        add(conBox);
+        conBox.addActionListener(alCon);
+
+        reflLabel = new JLabel(Messages.getString("Reflectivity"), SwingConstants.CENTER);
+        reflLabel.setBounds(new Rectangle(250, 120, 100, 20));
+        add(reflLabel);
+        reflBox = new JComboBox<>();
+        reflBox.setBounds(new Rectangle(250, 140, 100, 20));
+        addReflItem("", Con.UNKCON);
+        addReflItem(Messages.getString("Conspicuous"), Con.CONSP);
+        addReflItem(Messages.getString("NotConspicuous"), Con.NCONS);
+        addReflItem(Messages.getString("Reflector"), Con.REFL);
+        add(reflBox);
+        reflBox.addActionListener(alRefl);
+
+    }
+
+    public void syncPanel() {
+        panelPat.syncPanel();
+        regionAButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.A);
+        regionBButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.B);
+        regionCButton.setBorderPainted(dlg.panelMain.mark.getRegion() == Reg.C);
+        elevBox.setText(dlg.panelMain.mark.getElevation());
+        heightBox.setText(dlg.panelMain.mark.getObjectHeight());
+        sourceBox.setText(dlg.panelMain.mark.getSource());
+        infoBox.setText(dlg.panelMain.mark.getInfo());
+        for (Sts sts : statuses.keySet()) {
+            int item = statuses.get(sts);
+            if (dlg.panelMain.mark.getStatus() == sts) {
+                statusBox.setSelectedIndex(item);
+            }
+        }
+        for (Cns cns : constructions.keySet()) {
+            int item = constructions.get(cns);
+            if (dlg.panelMain.mark.getConstr() == cns) {
+                constrBox.setSelectedIndex(item);
+            }
+        }
+        for (Con con : conspicuities.keySet()) {
+            int item = conspicuities.get(con);
+            if (dlg.panelMain.mark.getConsp() == con) {
+                conBox.setSelectedIndex(item);
+            }
+        }
+        for (Con con : reflectivities.keySet()) {
+            int item = reflectivities.get(con);
+            if (dlg.panelMain.mark.getRefl() == con) {
+                reflBox.setSelectedIndex(item);
+            }
+        }
+    }
+
+    private void addStsItem(String str, Sts sts) {
+        statuses.put(sts, statusBox.getItemCount());
+        statusBox.addItem(str);
+    }
+
+    private void addCnsItem(String str, Cns cns) {
+        constructions.put(cns, constrBox.getItemCount());
+        constrBox.addItem(str);
+    }
+
+    private void addConItem(String str, Con con) {
+        conspicuities.put(con, conBox.getItemCount());
+        conBox.addItem(str);
+    }
+
+    private void addReflItem(String str, Con con) {
+        reflectivities.put(con, reflBox.getItemCount());
+        reflBox.addItem(str);
+    }
+
+    private JRadioButton getRegionButton(JRadioButton button, int x, int y, int w, int h, String tip) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alRegion);
+        regionButtons.add(button);
+        return button;
+    }
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelPat.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelPat.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelPat.java	(revision 32767)
@@ -1,94 +1,102 @@
 package panels;
 
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.EnumMap;
 
-import javax.swing.*;
-
-import java.util.*;
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
 
 import messages.Messages;
+import seamarks.SeaMark.Ent;
+import seamarks.SeaMark.Pat;
 import smed.SmedAction;
-import seamarks.SeaMark.*;
 
 public class PanelPat extends JPanel {
 
-	private SmedAction dlg;
-	private Ent ent;
-	public PanelCol panelCol;
+    private SmedAction dlg;
+    private Ent ent;
+    public PanelCol panelCol;
 
-	private ButtonGroup patButtons = new ButtonGroup();
-	public JRadioButton noneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NoneButton.png")));
-	public JRadioButton horizButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HorizontalButton.png")));
-	public JRadioButton vertButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/VerticalButton.png")));
-	public JRadioButton diagButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DiagonalButton.png")));
-	public JRadioButton squareButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquaredButton.png")));
-	public JRadioButton borderButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BorderButton.png")));
-	public EnumMap<Pat, JRadioButton> patterns = new EnumMap<>(Pat.class);
-	private ActionListener alPat = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Pat pat : patterns.keySet()) {
-				JRadioButton button = patterns.get(pat);
-				if (button.isSelected()) {
-					SmedAction.panelMain.mark.setPattern(ent, pat);
-					button.setBorderPainted(true);
-				} else
-					button.setBorderPainted(false);
-			}
-			switch (SmedAction.panelMain.mark.getPattern(ent)) {
-			case NOPAT:
-				panelCol.trimStack(1);
-				break;
-			case HSTRP:
-			case VSTRP:
-			case DIAG:
-				break;
-			case SQUARED:
-				panelCol.trimStack(4);
-				break;
-			case BORDER:
-			case CROSS:
-				panelCol.trimStack(2);
-				break;
-			}
-		}
-	};
+    private ButtonGroup patButtons = new ButtonGroup();
+    public JRadioButton noneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NoneButton.png")));
+    public JRadioButton horizButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HorizontalButton.png")));
+    public JRadioButton vertButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/VerticalButton.png")));
+    public JRadioButton diagButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DiagonalButton.png")));
+    public JRadioButton squareButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquaredButton.png")));
+    public JRadioButton borderButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BorderButton.png")));
+    public EnumMap<Pat, JRadioButton> patterns = new EnumMap<>(Pat.class);
+    private ActionListener alPat = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Pat pat : patterns.keySet()) {
+                JRadioButton button = patterns.get(pat);
+                if (button.isSelected()) {
+                    SmedAction.panelMain.mark.setPattern(ent, pat);
+                    button.setBorderPainted(true);
+                } else {
+                    button.setBorderPainted(false);
+                }
+            }
+            switch (SmedAction.panelMain.mark.getPattern(ent)) {
+            case NOPAT:
+                panelCol.trimStack(1);
+                break;
+            case HSTRP:
+            case VSTRP:
+            case DIAG:
+                break;
+            case SQUARED:
+                panelCol.trimStack(4);
+                break;
+            case BORDER:
+            case CROSS:
+                panelCol.trimStack(2);
+                break;
+            }
+        }
+    };
 
-	public PanelPat(SmedAction dia, Ent entity) {
-		dlg = dia;
-		ent = entity;
-		setLayout(null);
-		panelCol = new PanelCol(dlg, ent);
-		panelCol.setBounds(new Rectangle(0, 0, 72, 160));
-		add(panelCol);
-		add(getPatButton(noneButton, 76, 0, 27, 27, "NoPat", Pat.NOPAT));
-		add(getPatButton(horizButton, 76, 26, 27, 27, "HorizPat", Pat.HSTRP));
-		add(getPatButton(vertButton, 76, 52, 27, 27, "VertPat", Pat.VSTRP));
-		add(getPatButton(diagButton, 76, 78, 27, 27, "DiagPat", Pat.DIAG));
-		add(getPatButton(squareButton, 76, 104, 27, 27, "SquarePat", Pat.SQUARED));
-		add(getPatButton(borderButton, 76, 130, 27, 27, "BorderPat", Pat.BORDER));
+    public PanelPat(SmedAction dia, Ent entity) {
+        dlg = dia;
+        ent = entity;
+        setLayout(null);
+        panelCol = new PanelCol(dlg, ent);
+        panelCol.setBounds(new Rectangle(0, 0, 72, 160));
+        add(panelCol);
+        add(getPatButton(noneButton, 76, 0, 27, 27, "NoPat", Pat.NOPAT));
+        add(getPatButton(horizButton, 76, 26, 27, 27, "HorizPat", Pat.HSTRP));
+        add(getPatButton(vertButton, 76, 52, 27, 27, "VertPat", Pat.VSTRP));
+        add(getPatButton(diagButton, 76, 78, 27, 27, "DiagPat", Pat.DIAG));
+        add(getPatButton(squareButton, 76, 104, 27, 27, "SquarePat", Pat.SQUARED));
+        add(getPatButton(borderButton, 76, 130, 27, 27, "BorderPat", Pat.BORDER));
 
-	}
+    }
 
-	public void syncPanel() {
-		for (Pat pat : patterns.keySet()) {
-			JRadioButton button = patterns.get(pat);
-			if (SmedAction.panelMain.mark.getPattern(ent) == pat) {
-				button.setBorderPainted(true);
-			} else
-				button.setBorderPainted(false);
-		}
-		panelCol.syncPanel();
-	}
+    public void syncPanel() {
+        for (Pat pat : patterns.keySet()) {
+            JRadioButton button = patterns.get(pat);
+            if (SmedAction.panelMain.mark.getPattern(ent) == pat) {
+                button.setBorderPainted(true);
+            } else {
+                button.setBorderPainted(false);
+            }
+        }
+        panelCol.syncPanel();
+    }
 
-	private JRadioButton getPatButton(JRadioButton button, int x, int y, int w, int h, String tip, Pat pat) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alPat);
-		patButtons.add(button);
-		patterns.put(pat, button);
-		return button;
-	}
+    private JRadioButton getPatButton(JRadioButton button, int x, int y, int w, int h, String tip, Pat pat) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alPat);
+        patButtons.add(button);
+        patterns.put(pat, button);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelPort.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelPort.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelPort.java	(revision 32767)
@@ -1,124 +1,136 @@
 package panels;
 
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.EnumMap;
 
-import java.util.*;
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
 
 import messages.Messages;
+import seamarks.SeaMark.Cat;
+import seamarks.SeaMark.Col;
+import seamarks.SeaMark.Obj;
+import seamarks.SeaMark.Pat;
+import seamarks.SeaMark.Shp;
 import smed.SmedAction;
-import seamarks.SeaMark.*;
 
 public class PanelPort extends JPanel {
 
-	private SmedAction dlg;
-	public ButtonGroup shapeButtons = new ButtonGroup();
-	public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
-	public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
-	public JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
-	public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
-	public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
-	public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
-	public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
-	public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchPButton.png")));
-	public JRadioButton stakeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StakeButton.png")));
-	public EnumMap<Shp, JRadioButton> shapes = new EnumMap<>(Shp.class);
-	public EnumMap<Shp, Obj> objects = new EnumMap<>(Shp.class);
-	public ActionListener alShape = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Shp shp : shapes.keySet()) {
-				JRadioButton button = shapes.get(shp);
-				if (button.isSelected()) {
-					SmedAction.panelMain.mark.setShape(shp);
-					SmedAction.panelMain.mark.setObject(objects.get(shp));
-					button.setBorderPainted(true);
-				} else
-					button.setBorderPainted(false);
-			}
-			if (SmedAction.panelMain.mark.testValid()) {
-				SmedAction.panelMain.panelChan.topmarkButton.setVisible(true);
-				SmedAction.panelMain.panelChan.lightButton.setVisible(true);
-				if (SmedAction.panelMain.mark.getCategory() == Cat.LAM_PORT) {
-					switch (SmedAction.panelMain.mark.getRegion()) {
-					case A:
-						SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
-						SmedAction.panelMain.mark.setObjColour(Col.RED);
-						break;
-					case B:
-						SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
-						SmedAction.panelMain.mark.setObjColour(Col.GREEN);
-						break;
-					case C:
-						SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP);
-						SmedAction.panelMain.mark.setObjColour(Col.RED);
-						SmedAction.panelMain.mark.addObjColour(Col.WHITE);
-						SmedAction.panelMain.mark.addObjColour(Col.RED);
-						SmedAction.panelMain.mark.addObjColour(Col.WHITE);
-						break;
-					}
-				} else {
-					SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP);
-					switch (SmedAction.panelMain.mark.getRegion()) {
-					case A:
-						SmedAction.panelMain.mark.setObjColour(Col.RED);
-						SmedAction.panelMain.mark.addObjColour(Col.GREEN);
-						SmedAction.panelMain.mark.addObjColour(Col.RED);
-						break;
-					case B:
-						SmedAction.panelMain.mark.setObjColour(Col.GREEN);
-						SmedAction.panelMain.mark.addObjColour(Col.RED);
-						SmedAction.panelMain.mark.addObjColour(Col.GREEN);
-						break;
-					case C:
-						SmedAction.panelMain.mark.setObjColour(Col.RED);
-						SmedAction.panelMain.mark.addObjColour(Col.GREEN);
-						SmedAction.panelMain.mark.addObjColour(Col.RED);
-						SmedAction.panelMain.mark.addObjColour(Col.GREEN);
-						break;
-					}
-				}
-				SmedAction.panelMain.panelMore.syncPanel();
-			} else {
-				SmedAction.panelMain.panelChan.topmarkButton.setVisible(false);
-				SmedAction.panelMain.panelChan.lightButton.setVisible(false);
-			}
-		}
-	};
+    private SmedAction dlg;
+    public ButtonGroup shapeButtons = new ButtonGroup();
+    public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
+    public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
+    public JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
+    public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
+    public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
+    public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
+    public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
+    public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchPButton.png")));
+    public JRadioButton stakeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StakeButton.png")));
+    public EnumMap<Shp, JRadioButton> shapes = new EnumMap<>(Shp.class);
+    public EnumMap<Shp, Obj> objects = new EnumMap<>(Shp.class);
+    public ActionListener alShape = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Shp shp : shapes.keySet()) {
+                JRadioButton button = shapes.get(shp);
+                if (button.isSelected()) {
+                    SmedAction.panelMain.mark.setShape(shp);
+                    SmedAction.panelMain.mark.setObject(objects.get(shp));
+                    button.setBorderPainted(true);
+                } else {
+                    button.setBorderPainted(false);
+                }
+            }
+            if (SmedAction.panelMain.mark.testValid()) {
+                SmedAction.panelMain.panelChan.topmarkButton.setVisible(true);
+                SmedAction.panelMain.panelChan.lightButton.setVisible(true);
+                if (SmedAction.panelMain.mark.getCategory() == Cat.LAM_PORT) {
+                    switch (SmedAction.panelMain.mark.getRegion()) {
+                    case A:
+                        SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
+                        SmedAction.panelMain.mark.setObjColour(Col.RED);
+                        break;
+                    case B:
+                        SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
+                        SmedAction.panelMain.mark.setObjColour(Col.GREEN);
+                        break;
+                    case C:
+                        SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP);
+                        SmedAction.panelMain.mark.setObjColour(Col.RED);
+                        SmedAction.panelMain.mark.addObjColour(Col.WHITE);
+                        SmedAction.panelMain.mark.addObjColour(Col.RED);
+                        SmedAction.panelMain.mark.addObjColour(Col.WHITE);
+                        break;
+                    }
+                } else {
+                    SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP);
+                    switch (SmedAction.panelMain.mark.getRegion()) {
+                    case A:
+                        SmedAction.panelMain.mark.setObjColour(Col.RED);
+                        SmedAction.panelMain.mark.addObjColour(Col.GREEN);
+                        SmedAction.panelMain.mark.addObjColour(Col.RED);
+                        break;
+                    case B:
+                        SmedAction.panelMain.mark.setObjColour(Col.GREEN);
+                        SmedAction.panelMain.mark.addObjColour(Col.RED);
+                        SmedAction.panelMain.mark.addObjColour(Col.GREEN);
+                        break;
+                    case C:
+                        SmedAction.panelMain.mark.setObjColour(Col.RED);
+                        SmedAction.panelMain.mark.addObjColour(Col.GREEN);
+                        SmedAction.panelMain.mark.addObjColour(Col.RED);
+                        SmedAction.panelMain.mark.addObjColour(Col.GREEN);
+                        break;
+                    }
+                }
+                SmedAction.panelMain.panelMore.syncPanel();
+            } else {
+                SmedAction.panelMain.panelChan.topmarkButton.setVisible(false);
+                SmedAction.panelMain.panelChan.lightButton.setVisible(false);
+            }
+        }
+    };
 
-	public PanelPort(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYLAT));
-		add(getShapeButton(sparButton, 0, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYLAT));
-		add(getShapeButton(canButton, 0, 64, 34, 32, "Can", Shp.CAN, Obj.BOYLAT));
-		add(getShapeButton(sphereButton, 0, 96, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYLAT));
-		add(getShapeButton(floatButton, 0, 128, 34, 32, "Float", Shp.FLOAT, Obj.FLTLAT));
-		add(getShapeButton(beaconButton, 35, 0, 34, 32, "Beacon", Shp.BEACON, Obj.BCNLAT));
-		add(getShapeButton(towerButton, 35, 32, 34, 32, "TowerB", Shp.TOWER, Obj.BCNLAT));
-		add(getShapeButton(perchButton, 35, 64, 34, 32, "Perch", Shp.PERCH, Obj.BCNLAT));
-		add(getShapeButton(stakeButton, 35, 96, 34, 32, "Stake", Shp.STAKE, Obj.BCNLAT));
-	}
+    public PanelPort(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYLAT));
+        add(getShapeButton(sparButton, 0, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYLAT));
+        add(getShapeButton(canButton, 0, 64, 34, 32, "Can", Shp.CAN, Obj.BOYLAT));
+        add(getShapeButton(sphereButton, 0, 96, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYLAT));
+        add(getShapeButton(floatButton, 0, 128, 34, 32, "Float", Shp.FLOAT, Obj.FLTLAT));
+        add(getShapeButton(beaconButton, 35, 0, 34, 32, "Beacon", Shp.BEACON, Obj.BCNLAT));
+        add(getShapeButton(towerButton, 35, 32, 34, 32, "TowerB", Shp.TOWER, Obj.BCNLAT));
+        add(getShapeButton(perchButton, 35, 64, 34, 32, "Perch", Shp.PERCH, Obj.BCNLAT));
+        add(getShapeButton(stakeButton, 35, 96, 34, 32, "Stake", Shp.STAKE, Obj.BCNLAT));
+    }
 
-	public void syncPanel() {
-		for (Shp shp : shapes.keySet()) {
-			JRadioButton button = shapes.get(shp);
-			if (SmedAction.panelMain.mark.getShape() == shp) {
-				button.setBorderPainted(true);
-			} else
-				button.setBorderPainted(false);
-		}
-	}
+    public void syncPanel() {
+        for (Shp shp : shapes.keySet()) {
+            JRadioButton button = shapes.get(shp);
+            if (SmedAction.panelMain.mark.getShape() == shp) {
+                button.setBorderPainted(true);
+            } else {
+                button.setBorderPainted(false);
+            }
+        }
+    }
 
-	private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alShape);
-		shapeButtons.add(button);
-		shapes.put(shp, button);
-		objects.put(shp, obj);
-		return button;
-	}
+    private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alShape);
+        shapeButtons.add(button);
+        shapes.put(shp, button);
+        objects.put(shp, obj);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelRadar.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelRadar.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelRadar.java	(revision 32767)
@@ -1,248 +1,270 @@
 package panels;
 
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.*;
-
-import java.util.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.util.EnumMap;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import javax.swing.JToggleButton;
+import javax.swing.SwingConstants;
 
 import messages.Messages;
+import seamarks.SeaMark.Cat;
+import seamarks.SeaMark.Rtb;
 import smed.SmedAction;
-import seamarks.SeaMark.*;
 
 public class PanelRadar extends JPanel {
 
-	private SmedAction dlg;
-	private JToggleButton aisButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/AISButton.png")));
-	private ActionListener alAis = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (aisButton.isSelected()) {
-				radioCatBox.setVisible(true);
-				aisButton.setBorderPainted(true);
-			} else {
-				radioCatBox.setSelectedIndex(0);
-				radioCatBox.setVisible(false);
-				aisButton.setBorderPainted(false);
-			}
-		}
-	};
-	private JComboBox<String> radioCatBox;
-	private EnumMap<Cat, Integer> radioCats = new EnumMap<>(Cat.class);
-	private ActionListener alRadioCatBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cat cat : radioCats.keySet()) {
-				int idx = radioCats.get(cat);
-				if (dlg.node != null && (idx == radioCatBox.getSelectedIndex())) {
-					SmedAction.panelMain.mark.setRadio(cat);
-				}
-			}
-		}
-	};
-	private ButtonGroup radarButtons = new ButtonGroup();
-	public JRadioButton noRadButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png")));
-	public JRadioButton reflButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarReflectorButton.png")));
-	public JRadioButton ramarkButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RamarkButton.png")));
-	public JRadioButton raconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RaconButton.png")));
-	public JRadioButton leadingButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LeadingRaconButton.png")));
-	private EnumMap<Rtb, JRadioButton> rads = new EnumMap<>(Rtb.class);
-	private ActionListener alRad = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Rtb rtb : rads.keySet()) {
-				JRadioButton button = rads.get(rtb);
-				if (button.isSelected()) {
-					SmedAction.panelMain.mark.setRadar(rtb);
-				}
-			}
-			syncPanel();
-		}
-	};
-	public JLabel groupLabel;
-	public JTextField groupBox;
-	private FocusListener flGroup = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setRaconGroup(groupBox.getText());
-		}
-	};
-	public JLabel periodLabel;
-	public JTextField periodBox;
-	private FocusListener flPeriod = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setRaconPeriod(periodBox.getText());
-		}
-	};
-	public JLabel seqLabel;
-	public JTextField seqBox;
-	private FocusListener flSeq = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setRaconSequence(seqBox.getText());
-		}
-	};
-	public JLabel rangeLabel;
-	public JTextField rangeBox;
-	private FocusListener flRange = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setRaconRange(rangeBox.getText());
-		}
-	};
-	public JLabel sector1Label;
-	public JTextField sector1Box;
-	private FocusListener flSector1 = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setRaconSector1(sector1Box.getText());
-		}
-	};
-	public JLabel sector2Label;
-	public JTextField sector2Box;
-	private FocusListener flSector2 = new FocusAdapter() {
-		public void focusLost(java.awt.event.FocusEvent e) {
-			SmedAction.panelMain.mark.setRaconSector2(sector2Box.getText());
-		}
-	};
-	public JLabel sectorsLabel;
-
-	public PanelRadar(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		add(getRadButton(noRadButton, 0, 3, 27, 27, "NoRadar", Rtb.NORTB));
-		add(getRadButton(reflButton, 0, 33, 27, 27, "RadarReflector", Rtb.REFLECTOR));
-		add(getRadButton(ramarkButton, 0, 63, 27, 27, "Ramark", Rtb.RAMARK));
-		add(getRadButton(raconButton, 0, 93, 27, 27, "Racon", Rtb.RACON));
-		add(getRadButton(leadingButton, 0, 123, 27, 27, "LeadingRacon", Rtb.LEADING));
-		
-		groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER);
-		groupLabel.setBounds(new Rectangle(30, 0, 100, 20));
-		add(groupLabel);
-		groupBox = new JTextField();
-		groupBox.setBounds(new Rectangle(55, 20, 50, 20));
-		groupBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(groupBox);
-		groupBox.addFocusListener(flGroup);
-
-		periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER);
-		periodLabel.setBounds(new Rectangle(130, 0, 100, 20));
-		add(periodLabel);
-		periodBox = new JTextField();
-		periodBox.setBounds(new Rectangle(155, 20, 50, 20));
-		periodBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(periodBox);
-		periodBox.addFocusListener(flPeriod);
-
-		seqLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER);
-		seqLabel.setBounds(new Rectangle(30, 40, 100, 20));
-		add(seqLabel);
-		seqBox = new JTextField();
-		seqBox.setBounds(new Rectangle(55, 60, 50, 20));
-		seqBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(seqBox);
-		seqBox.addFocusListener(flSeq);
-
-		rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER);
-		rangeLabel.setBounds(new Rectangle(130, 40, 100, 20));
-		add(rangeLabel);
-		rangeBox = new JTextField();
-		rangeBox.setBounds(new Rectangle(155, 60, 50, 20));
-		rangeBox.setHorizontalAlignment(SwingConstants.CENTER);
-		add(rangeBox);
-		rangeBox.addFocusListener(flRange);
-		
-		sectorsLabel = new JLabel(Messages.getString("VisibleSector"), SwingConstants.CENTER);
-		sectorsLabel.setBounds(new Rectangle(75, 85, 100, 20));
-		add(sectorsLabel);
-
-		sector1Label = new JLabel(Messages.getString("Start"), SwingConstants.CENTER);
-		sector1Label.setBounds(new Rectangle(30, 100, 100, 20));
-		add(sector1Label);
-		sector1Box = new JTextField();
-		sector1Box.setBounds(new Rectangle(55, 120, 50, 20));
-		sector1Box.setHorizontalAlignment(SwingConstants.CENTER);
-		add(sector1Box);
-		sector1Box.addFocusListener(flSector1);
-
-		sector2Label = new JLabel(Messages.getString("End"), SwingConstants.CENTER);
-		sector2Label.setBounds(new Rectangle(130, 100, 100, 20));
-		add(sector2Label);
-		sector2Box = new JTextField();
-		sector2Box.setBounds(new Rectangle(155, 120, 50, 20));
-		sector2Box.setHorizontalAlignment(SwingConstants.CENTER);
-		add(sector2Box);
-		sector2Box.addFocusListener(flSector2);
-
-		aisButton.setBounds(new Rectangle(270, 3, 27, 27));
-		aisButton.setBorder(BorderFactory.createLoweredBevelBorder());
-		aisButton.setToolTipText("AIS");
-		aisButton.addActionListener(alAis);
-		add(aisButton);
-
-		radioCatBox = new JComboBox<>();
-		radioCatBox.setBounds(new Rectangle(210, 40, 150, 20));
-		add(radioCatBox);
-		radioCatBox.addActionListener(alRadioCatBox);
-		addROItem("", Cat.NOROS);
-		addROItem(Messages.getString("CircularBeacon"), Cat.ROS_OMNI);
-		addROItem(Messages.getString("DirectionalBeacon"), Cat.ROS_DIRL);
-		addROItem(Messages.getString("RotatingBeacon"), Cat.ROS_ROTP);
-		addROItem(Messages.getString("ConsolBeacon"), Cat.ROS_CNSL);
-		addROItem(Messages.getString("DirectionFinding"), Cat.ROS_RDF);
-		addROItem(Messages.getString("QTGService"), Cat.ROS_QTG);
-		addROItem(Messages.getString("AeronaticalBeacon"), Cat.ROS_AERO);
-		addROItem(Messages.getString("Decca"), Cat.ROS_DECA);
-		addROItem(Messages.getString("LoranC"), Cat.ROS_LORN);
-		addROItem(Messages.getString("DGPS"), Cat.ROS_DGPS);
-		addROItem(Messages.getString("Toran"), Cat.ROS_TORN);
-		addROItem(Messages.getString("Omega"), Cat.ROS_OMGA);
-		addROItem(Messages.getString("Syledis"), Cat.ROS_SYLD);
-		addROItem(Messages.getString("Chiaka"), Cat.ROS_CHKA);
-		addROItem(Messages.getString("PublicCommunication"), Cat.ROS_PCOM);
-		addROItem(Messages.getString("CommercialBroadcast"), Cat.ROS_COMB);
-		addROItem(Messages.getString("Facsimile"), Cat.ROS_FACS);
-		addROItem(Messages.getString("TimeSignal"), Cat.ROS_TIME);
-		addROItem(Messages.getString("AIS"), Cat.ROS_PAIS);
-		addROItem(Messages.getString("S-AIS"), Cat.ROS_SAIS);
-		radioCatBox.setVisible(false);
-	}
-
-	public void syncPanel() {
-		boolean rad = ((SmedAction.panelMain.mark.getRadar() != Rtb.NORTB) && (SmedAction.panelMain.mark.getRadar() != Rtb.REFLECTOR));
-		groupLabel.setVisible(rad);
-		groupBox.setVisible(rad);
-		periodLabel.setVisible(rad);
-		periodBox.setVisible(rad);
-		seqLabel.setVisible(rad);
-		seqBox.setVisible(rad);
-		rangeLabel.setVisible(rad);
-		rangeBox.setVisible(rad);
-		sector1Label.setVisible(rad);
-		sector1Box.setVisible(rad);
-		sector2Label.setVisible(rad);
-		sector2Box.setVisible(rad);
-		sectorsLabel.setVisible(rad);
-		for (Rtb rtb : rads.keySet()) {
-			rads.get(rtb).setBorderPainted(SmedAction.panelMain.mark.getRadar() == rtb);
-		}
-		groupBox.setText(SmedAction.panelMain.mark.getRaconGroup());
-		seqBox.setText(SmedAction.panelMain.mark.getRaconSequence());
-		periodBox.setText(SmedAction.panelMain.mark.getRaconPeriod());
-		rangeBox.setText(SmedAction.panelMain.mark.getRaconRange());
-		sector1Box.setText(SmedAction.panelMain.mark.getRaconSector1());
-		sector2Box.setText(SmedAction.panelMain.mark.getRaconSector2());
-		aisButton.setSelected(SmedAction.panelMain.mark.getRadio() != Cat.NOROS);
-		aisButton.setBorderPainted(aisButton.isSelected());
-		radioCatBox.setVisible(SmedAction.panelMain.mark.getRadio() != Cat.NOROS);
-	}
-
-	private JRadioButton getRadButton(JRadioButton button, int x, int y, int w, int h, String tip, Rtb rtb) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alRad);
-		radarButtons.add(button);
-		rads.put(rtb, button);
-		return button;
-	}
-
-	private void addROItem(String str, Cat cat) {
-		radioCats.put(cat, radioCatBox.getItemCount());
-		radioCatBox.addItem(str);
-	}
+    private SmedAction dlg;
+    private JToggleButton aisButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/AISButton.png")));
+    private ActionListener alAis = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if (aisButton.isSelected()) {
+                radioCatBox.setVisible(true);
+                aisButton.setBorderPainted(true);
+            } else {
+                radioCatBox.setSelectedIndex(0);
+                radioCatBox.setVisible(false);
+                aisButton.setBorderPainted(false);
+            }
+        }
+    };
+    private JComboBox<String> radioCatBox;
+    private EnumMap<Cat, Integer> radioCats = new EnumMap<>(Cat.class);
+    private ActionListener alRadioCatBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cat cat : radioCats.keySet()) {
+                int idx = radioCats.get(cat);
+                if (dlg.node != null && (idx == radioCatBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setRadio(cat);
+                }
+            }
+        }
+    };
+    private ButtonGroup radarButtons = new ButtonGroup();
+    public JRadioButton noRadButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png")));
+    public JRadioButton reflButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarReflectorButton.png")));
+    public JRadioButton ramarkButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RamarkButton.png")));
+    public JRadioButton raconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RaconButton.png")));
+    public JRadioButton leadingButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LeadingRaconButton.png")));
+    private EnumMap<Rtb, JRadioButton> rads = new EnumMap<>(Rtb.class);
+    private ActionListener alRad = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Rtb rtb : rads.keySet()) {
+                JRadioButton button = rads.get(rtb);
+                if (button.isSelected()) {
+                    SmedAction.panelMain.mark.setRadar(rtb);
+                }
+            }
+            syncPanel();
+        }
+    };
+    public JLabel groupLabel;
+    public JTextField groupBox;
+    private FocusListener flGroup = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setRaconGroup(groupBox.getText());
+        }
+    };
+    public JLabel periodLabel;
+    public JTextField periodBox;
+    private FocusListener flPeriod = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setRaconPeriod(periodBox.getText());
+        }
+    };
+    public JLabel seqLabel;
+    public JTextField seqBox;
+    private FocusListener flSeq = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setRaconSequence(seqBox.getText());
+        }
+    };
+    public JLabel rangeLabel;
+    public JTextField rangeBox;
+    private FocusListener flRange = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setRaconRange(rangeBox.getText());
+        }
+    };
+    public JLabel sector1Label;
+    public JTextField sector1Box;
+    private FocusListener flSector1 = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setRaconSector1(sector1Box.getText());
+        }
+    };
+    public JLabel sector2Label;
+    public JTextField sector2Box;
+    private FocusListener flSector2 = new FocusAdapter() {
+        @Override
+        public void focusLost(FocusEvent e) {
+            SmedAction.panelMain.mark.setRaconSector2(sector2Box.getText());
+        }
+    };
+    public JLabel sectorsLabel;
+
+    public PanelRadar(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        add(getRadButton(noRadButton, 0, 3, 27, 27, "NoRadar", Rtb.NORTB));
+        add(getRadButton(reflButton, 0, 33, 27, 27, "RadarReflector", Rtb.REFLECTOR));
+        add(getRadButton(ramarkButton, 0, 63, 27, 27, "Ramark", Rtb.RAMARK));
+        add(getRadButton(raconButton, 0, 93, 27, 27, "Racon", Rtb.RACON));
+        add(getRadButton(leadingButton, 0, 123, 27, 27, "LeadingRacon", Rtb.LEADING));
+
+        groupLabel = new JLabel(Messages.getString("Group"), SwingConstants.CENTER);
+        groupLabel.setBounds(new Rectangle(30, 0, 100, 20));
+        add(groupLabel);
+        groupBox = new JTextField();
+        groupBox.setBounds(new Rectangle(55, 20, 50, 20));
+        groupBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(groupBox);
+        groupBox.addFocusListener(flGroup);
+
+        periodLabel = new JLabel(Messages.getString("Period"), SwingConstants.CENTER);
+        periodLabel.setBounds(new Rectangle(130, 0, 100, 20));
+        add(periodLabel);
+        periodBox = new JTextField();
+        periodBox.setBounds(new Rectangle(155, 20, 50, 20));
+        periodBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(periodBox);
+        periodBox.addFocusListener(flPeriod);
+
+        seqLabel = new JLabel(Messages.getString("Sequence"), SwingConstants.CENTER);
+        seqLabel.setBounds(new Rectangle(30, 40, 100, 20));
+        add(seqLabel);
+        seqBox = new JTextField();
+        seqBox.setBounds(new Rectangle(55, 60, 50, 20));
+        seqBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(seqBox);
+        seqBox.addFocusListener(flSeq);
+
+        rangeLabel = new JLabel(Messages.getString("Range"), SwingConstants.CENTER);
+        rangeLabel.setBounds(new Rectangle(130, 40, 100, 20));
+        add(rangeLabel);
+        rangeBox = new JTextField();
+        rangeBox.setBounds(new Rectangle(155, 60, 50, 20));
+        rangeBox.setHorizontalAlignment(SwingConstants.CENTER);
+        add(rangeBox);
+        rangeBox.addFocusListener(flRange);
+
+        sectorsLabel = new JLabel(Messages.getString("VisibleSector"), SwingConstants.CENTER);
+        sectorsLabel.setBounds(new Rectangle(75, 85, 100, 20));
+        add(sectorsLabel);
+
+        sector1Label = new JLabel(Messages.getString("Start"), SwingConstants.CENTER);
+        sector1Label.setBounds(new Rectangle(30, 100, 100, 20));
+        add(sector1Label);
+        sector1Box = new JTextField();
+        sector1Box.setBounds(new Rectangle(55, 120, 50, 20));
+        sector1Box.setHorizontalAlignment(SwingConstants.CENTER);
+        add(sector1Box);
+        sector1Box.addFocusListener(flSector1);
+
+        sector2Label = new JLabel(Messages.getString("End"), SwingConstants.CENTER);
+        sector2Label.setBounds(new Rectangle(130, 100, 100, 20));
+        add(sector2Label);
+        sector2Box = new JTextField();
+        sector2Box.setBounds(new Rectangle(155, 120, 50, 20));
+        sector2Box.setHorizontalAlignment(SwingConstants.CENTER);
+        add(sector2Box);
+        sector2Box.addFocusListener(flSector2);
+
+        aisButton.setBounds(new Rectangle(270, 3, 27, 27));
+        aisButton.setBorder(BorderFactory.createLoweredBevelBorder());
+        aisButton.setToolTipText("AIS");
+        aisButton.addActionListener(alAis);
+        add(aisButton);
+
+        radioCatBox = new JComboBox<>();
+        radioCatBox.setBounds(new Rectangle(210, 40, 150, 20));
+        add(radioCatBox);
+        radioCatBox.addActionListener(alRadioCatBox);
+        addROItem("", Cat.NOROS);
+        addROItem(Messages.getString("CircularBeacon"), Cat.ROS_OMNI);
+        addROItem(Messages.getString("DirectionalBeacon"), Cat.ROS_DIRL);
+        addROItem(Messages.getString("RotatingBeacon"), Cat.ROS_ROTP);
+        addROItem(Messages.getString("ConsolBeacon"), Cat.ROS_CNSL);
+        addROItem(Messages.getString("DirectionFinding"), Cat.ROS_RDF);
+        addROItem(Messages.getString("QTGService"), Cat.ROS_QTG);
+        addROItem(Messages.getString("AeronaticalBeacon"), Cat.ROS_AERO);
+        addROItem(Messages.getString("Decca"), Cat.ROS_DECA);
+        addROItem(Messages.getString("LoranC"), Cat.ROS_LORN);
+        addROItem(Messages.getString("DGPS"), Cat.ROS_DGPS);
+        addROItem(Messages.getString("Toran"), Cat.ROS_TORN);
+        addROItem(Messages.getString("Omega"), Cat.ROS_OMGA);
+        addROItem(Messages.getString("Syledis"), Cat.ROS_SYLD);
+        addROItem(Messages.getString("Chiaka"), Cat.ROS_CHKA);
+        addROItem(Messages.getString("PublicCommunication"), Cat.ROS_PCOM);
+        addROItem(Messages.getString("CommercialBroadcast"), Cat.ROS_COMB);
+        addROItem(Messages.getString("Facsimile"), Cat.ROS_FACS);
+        addROItem(Messages.getString("TimeSignal"), Cat.ROS_TIME);
+        addROItem(Messages.getString("AIS"), Cat.ROS_PAIS);
+        addROItem(Messages.getString("S-AIS"), Cat.ROS_SAIS);
+        radioCatBox.setVisible(false);
+    }
+
+    public void syncPanel() {
+        boolean rad = ((SmedAction.panelMain.mark.getRadar() != Rtb.NORTB) && (SmedAction.panelMain.mark.getRadar() != Rtb.REFLECTOR));
+        groupLabel.setVisible(rad);
+        groupBox.setVisible(rad);
+        periodLabel.setVisible(rad);
+        periodBox.setVisible(rad);
+        seqLabel.setVisible(rad);
+        seqBox.setVisible(rad);
+        rangeLabel.setVisible(rad);
+        rangeBox.setVisible(rad);
+        sector1Label.setVisible(rad);
+        sector1Box.setVisible(rad);
+        sector2Label.setVisible(rad);
+        sector2Box.setVisible(rad);
+        sectorsLabel.setVisible(rad);
+        for (Rtb rtb : rads.keySet()) {
+            rads.get(rtb).setBorderPainted(SmedAction.panelMain.mark.getRadar() == rtb);
+        }
+        groupBox.setText(SmedAction.panelMain.mark.getRaconGroup());
+        seqBox.setText(SmedAction.panelMain.mark.getRaconSequence());
+        periodBox.setText(SmedAction.panelMain.mark.getRaconPeriod());
+        rangeBox.setText(SmedAction.panelMain.mark.getRaconRange());
+        sector1Box.setText(SmedAction.panelMain.mark.getRaconSector1());
+        sector2Box.setText(SmedAction.panelMain.mark.getRaconSector2());
+        aisButton.setSelected(SmedAction.panelMain.mark.getRadio() != Cat.NOROS);
+        aisButton.setBorderPainted(aisButton.isSelected());
+        radioCatBox.setVisible(SmedAction.panelMain.mark.getRadio() != Cat.NOROS);
+    }
+
+    private JRadioButton getRadButton(JRadioButton button, int x, int y, int w, int h, String tip, Rtb rtb) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alRad);
+        radarButtons.add(button);
+        rads.put(rtb, button);
+        return button;
+    }
+
+    private void addROItem(String str, Cat cat) {
+        radioCats.put(cat, radioCatBox.getItemCount());
+        radioCatBox.addItem(str);
+    }
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelSaw.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelSaw.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelSaw.java	(revision 32767)
@@ -1,79 +1,90 @@
 package panels;
 
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.EnumMap;
 
-import java.util.*;
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
 
 import messages.Messages;
+import seamarks.SeaMark.Col;
+import seamarks.SeaMark.Obj;
+import seamarks.SeaMark.Pat;
+import seamarks.SeaMark.Shp;
 import smed.SmedAction;
-import seamarks.SeaMark.*;
 
 public class PanelSaw extends JPanel {
 
-	private SmedAction dlg;
-	public ButtonGroup shapeButtons = new ButtonGroup();
-	public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
-	public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
-	public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
-	public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
-	public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
-	public EnumMap<Shp, JRadioButton> shapes = new EnumMap<>(Shp.class);
-	public EnumMap<Shp, Obj> objects = new EnumMap<>(Shp.class);
-	public ActionListener alShape = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Shp shp : shapes.keySet()) {
-				JRadioButton button = shapes.get(shp);
-				if (button.isSelected()) {
-					SmedAction.panelMain.mark.setShape(shp);
-					SmedAction.panelMain.mark.setObject(objects.get(shp));
-					button.setBorderPainted(true);
-				} else
-					button.setBorderPainted(false);
-			}
-			if (SmedAction.panelMain.mark.testValid()) {
-				SmedAction.panelMain.panelChan.topmarkButton.setVisible(true);
-				SmedAction.panelMain.mark.setObjPattern(Pat.VSTRP);
-				SmedAction.panelMain.mark.setObjColour(Col.RED);
-				SmedAction.panelMain.mark.addObjColour(Col.WHITE);
-			} else {
-				SmedAction.panelMain.panelChan.topmarkButton.setVisible(false);
-			}
-			SmedAction.panelMain.panelMore.syncPanel();
-		}
-	};
+    private SmedAction dlg;
+    public ButtonGroup shapeButtons = new ButtonGroup();
+    public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
+    public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
+    public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
+    public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
+    public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
+    public EnumMap<Shp, JRadioButton> shapes = new EnumMap<>(Shp.class);
+    public EnumMap<Shp, Obj> objects = new EnumMap<>(Shp.class);
+    public ActionListener alShape = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Shp shp : shapes.keySet()) {
+                JRadioButton button = shapes.get(shp);
+                if (button.isSelected()) {
+                    SmedAction.panelMain.mark.setShape(shp);
+                    SmedAction.panelMain.mark.setObject(objects.get(shp));
+                    button.setBorderPainted(true);
+                } else {
+                    button.setBorderPainted(false);
+                }
+            }
+            if (SmedAction.panelMain.mark.testValid()) {
+                SmedAction.panelMain.panelChan.topmarkButton.setVisible(true);
+                SmedAction.panelMain.mark.setObjPattern(Pat.VSTRP);
+                SmedAction.panelMain.mark.setObjColour(Col.RED);
+                SmedAction.panelMain.mark.addObjColour(Col.WHITE);
+            } else {
+                SmedAction.panelMain.panelChan.topmarkButton.setVisible(false);
+            }
+            SmedAction.panelMain.panelMore.syncPanel();
+        }
+    };
 
-	public PanelSaw(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYSAW));
-		add(getShapeButton(sparButton, 0, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYSAW));
-		add(getShapeButton(sphereButton, 0, 64, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYSAW));
-		add(getShapeButton(floatButton, 0, 96, 34, 32, "Float", Shp.FLOAT, Obj.FLTSAW));
-		add(getShapeButton(beaconButton, 0, 128, 34, 32, "Beacon", Shp.BEACON, Obj.BCNSAW));
-	}
+    public PanelSaw(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYSAW));
+        add(getShapeButton(sparButton, 0, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYSAW));
+        add(getShapeButton(sphereButton, 0, 64, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYSAW));
+        add(getShapeButton(floatButton, 0, 96, 34, 32, "Float", Shp.FLOAT, Obj.FLTSAW));
+        add(getShapeButton(beaconButton, 0, 128, 34, 32, "Beacon", Shp.BEACON, Obj.BCNSAW));
+    }
 
-	public void syncPanel() {
-		for (Shp shp : shapes.keySet()) {
-			JRadioButton button = shapes.get(shp);
-			if (SmedAction.panelMain.mark.getShape() == shp) {
-				button.setBorderPainted(true);
-			} else
-				button.setBorderPainted(false);
-		}
-		SmedAction.panelMain.mark.testValid();
-	}
-	
-	private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alShape);
-		shapeButtons.add(button);
-		shapes.put(shp, button);
-		objects.put(shp, obj);
-		return button;
-	}
+    public void syncPanel() {
+        for (Shp shp : shapes.keySet()) {
+            JRadioButton button = shapes.get(shp);
+            if (SmedAction.panelMain.mark.getShape() == shp) {
+                button.setBorderPainted(true);
+            } else {
+                button.setBorderPainted(false);
+            }
+        }
+        SmedAction.panelMain.mark.testValid();
+    }
+
+    private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alShape);
+        shapeButtons.add(button);
+        shapes.put(shp, button);
+        objects.put(shp, obj);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelSectors.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelSectors.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelSectors.java	(revision 32767)
@@ -1,324 +1,356 @@
 package panels;
 
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.util.EnumMap;
 
-import javax.swing.*;
-import javax.swing.table.*;
+import javax.swing.DefaultCellEditor;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.SwingConstants;
+import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableModel;
 
 import messages.Messages;
+import seamarks.SeaMark;
+import seamarks.SeaMark.Att;
+import seamarks.SeaMark.Col;
+import seamarks.SeaMark.Exh;
+import seamarks.SeaMark.Lit;
+import seamarks.SeaMark.Vis;
 import smed.SmedAction;
-import seamarks.SeaMark;
-import seamarks.SeaMark.*;
 
 public class PanelSectors extends JFrame {
 
-	private SmedAction dlg;
-	private JPanel panel;
-	private TableModel model;
-	private JTable table;
-
-	public JButton minusButton;
-	private ActionListener alMinusButton = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if ((getSectorCount() > 1) && (table.getSelectedRow() != 0))
-				deleteSector(table.getSelectedRow());
-		}
-	};
-	public JButton plusButton;
-	private ActionListener alPlusButton = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (table.getSelectedRow() < 0)
-				addSector(table.getRowCount());
-			else
-				addSector(table.getSelectedRow()+1);
-		}
-	};
-	public JComboBox<ImageIcon> colourBox;
-	public EnumMap<Col, ImageIcon> colours = new EnumMap<>(Col.class);
-	public JComboBox<String> visibilityBox;
-	public EnumMap<Vis, String> visibilities = new EnumMap<>(Vis.class);
-	public JComboBox<String> exhibitionBox;
-	public EnumMap<Exh, String> exhibitions = new EnumMap<>(Exh.class);
-
-	public PanelSectors(SmedAction dia) {
-		super(Messages.getString("SectorTable"));
-		dlg = dia;
-		setLayout(null);
-		setSize(900, 100);
-		setAlwaysOnTop(true);
-		setLocation(450, 0);
-		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
-		minusButton = new JButton(new ImageIcon(getClass().getResource("/images/MinusButton.png")));
-		minusButton.setBounds(0, 0, 32, 34);
-		minusButton.addActionListener(alMinusButton);
-		add(minusButton);
-		plusButton = new JButton(new ImageIcon(getClass().getResource("/images/PlusButton.png")));
-		plusButton.setBounds(0, 34, 32, 34);
-		plusButton.addActionListener(alPlusButton);
-		add(plusButton);
-		panel = new JPanel(new BorderLayout());
-		panel.setBounds(40, 0, 860, 512);
-		model = new SectorTable();
-		table = new JTable(model);
-		table.setBounds(0, 0, 860, 34);
-		table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
-		panel.add(new JScrollPane(table));
-		getContentPane().add(panel);
-
-		table.setSize(860, ((table.getRowCount() * 16) + 28));
-		
-		table.setDefaultRenderer(String.class, new CentreRenderer());
-		table.getColumnModel().getColumn(1).setCellRenderer(new ColourCellRenderer());
-
-		TableColumn colColumn = table.getColumnModel().getColumn(1);
-		colourBox = new JComboBox<>();
-		addColItem(new ImageIcon(getClass().getResource("/images/DelButton.png")), Col.UNKCOL);
-		addColItem(new ImageIcon(getClass().getResource("/images/WhiteButton.png")), Col.WHITE);
-		addColItem(new ImageIcon(getClass().getResource("/images/RedButton.png")), Col.RED);
-		addColItem(new ImageIcon(getClass().getResource("/images/GreenButton.png")), Col.GREEN);
-		addColItem(new ImageIcon(getClass().getResource("/images/YellowButton.png")), Col.YELLOW);
-		addColItem(new ImageIcon(getClass().getResource("/images/OrangeButton.png")), Col.ORANGE);
-		addColItem(new ImageIcon(getClass().getResource("/images/AmberButton.png")), Col.AMBER);
-		addColItem(new ImageIcon(getClass().getResource("/images/BlueButton.png")), Col.BLUE);
-		addColItem(new ImageIcon(getClass().getResource("/images/VioletButton.png")), Col.VIOLET);
-		colColumn.setCellEditor(new DefaultCellEditor(colourBox));
-		
-		TableColumn visColumn = table.getColumnModel().getColumn(12);
-		visibilityBox = new JComboBox<>();
-		addVisibItem("", Vis.UNKVIS);
-		addVisibItem(Messages.getString("Intensified"), Vis.INTEN);
-		addVisibItem(Messages.getString("Unintensified"), Vis.UNINTEN);
-		addVisibItem(Messages.getString("PartiallyObscured"), Vis.PARTOBS);
-		visColumn.setCellEditor(new DefaultCellEditor(visibilityBox));
-		
-		TableColumn exhColumn = table.getColumnModel().getColumn(13);
-		exhibitionBox = new JComboBox<>();
-		addExhibItem("", Exh.UNKEXH);
-		addExhibItem(Messages.getString("24h"), Exh.H24);
-		addExhibItem(Messages.getString("Day"), Exh.DAY);
-		addExhibItem(Messages.getString("Night"), Exh.NIGHT);
-		addExhibItem(Messages.getString("Fog"), Exh.FOG);
-		exhColumn.setCellEditor(new DefaultCellEditor(exhibitionBox));
-	}
-
-	private class SectorTable extends AbstractTableModel {
-
-		private String[] headings = { Messages.getString("Sector"), Messages.getString("Colour"), Messages.getString("Character"),
-				Messages.getString("Group"), Messages.getString("Sequence"), Messages.getString("Period"), Messages.getString("Directional"),
-				Messages.getString("Start"), Messages.getString("End"), Messages.getString("Radius"), Messages.getString("Height"),
-				Messages.getString("Range"), Messages.getString("Visibility"), Messages.getString("Exhibition") };
-
-		public SectorTable() {
-		}
-
-		public String getColumnName(int col) {
-			return headings[col];
-		}
-
-		public int getColumnCount() {
-			return headings.length;
-		}
-
-		public int getRowCount() {
-			if (SmedAction.panelMain == null)
-				return 1;
-			else
-				return SmedAction.panelMain.mark.getSectorCount();
-		}
-
-		public boolean isCellEditable(int row, int col) {
-			return ((col > 0) && (row > 0));
-		}
-
-		public Class getColumnClass(int col) {
-			switch (col) {
-			case 1:
-				return Col.class;
-			case 6:
-				return Boolean.class;
-			default:
-				return String.class;
-			}
-		}
-
-		public Object getValueAt(int row, int col) {
-			switch (col) {
-			case 0:
-				if (row == 0)
-					return Messages.getString("Default");
-				else
-					return row;
-			case 1:
-				if (((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) {
-					if (SmedAction.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL) {
-						return Col.UNKCOL;
-					} else {
-						return SmedAction.panelMain.mark.getLightAtt(Att.ALT, row);
-					}
-				} else {
-					return SmedAction.panelMain.mark.getLightAtt(Att.COL, row);
-				}
-			case 6:
-				return (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR);
-			case 7:
-			case 8:
-				if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR)
-					return SmedAction.panelMain.mark.getLightAtt(Att.ORT, row);
-				else
-					return SmedAction.panelMain.mark.getLightAtt(col - 1, row);
-			case 12:
-				return visibilities.get(SmedAction.panelMain.mark.getLightAtt(Att.VIS, row));
-			case 13:
-				return exhibitions.get(SmedAction.panelMain.mark.getLightAtt(Att.EXH, row));
-			default:
-				return SmedAction.panelMain.mark.getLightAtt(col - 1, row);
-			}
-		}
-
-		public void setValueAt(Object value, int row, int col) {
-			switch (col) {
-			case 1:
-				for (Col colour : colours.keySet()) {
-					ImageIcon img = colours.get(colour);
-					if (img == value)
-						if (((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) {
-							if (((colour == Col.UNKCOL) && (SmedAction.panelMain.mark.getLightAtt(Att.ALT, row) == Col.UNKCOL))
-									|| (SmedAction.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL)) {
-								SmedAction.panelMain.mark.setLightAtt(Att.COL, row, colour);
-							} else {
-								SmedAction.panelMain.mark.setLightAtt(Att.ALT, row, colour);
-							}
-						} else {
-							SmedAction.panelMain.mark.setLightAtt(Att.COL, row, colour);
-						}
-				}
-				break;
-			case 5:
-			case 9:
-			case 10:
-			case 11:
-				SmedAction.panelMain.mark.setLightAtt(col - 1, row, value);
-				break;
-			case 6:
-				if ((Boolean) value == true) {
-					SmedAction.panelMain.mark.setLightAtt(Att.LIT, row, Lit.DIR);
-					SmedAction.panelMain.mark.setLightAtt(Att.BEG, row, "");
-					SmedAction.panelMain.mark.setLightAtt(Att.END, row, "");
-				} else {
-					SmedAction.panelMain.mark.setLightAtt(Att.LIT, row, Lit.UNKLIT);
-					SmedAction.panelMain.mark.setLightAtt(Att.ORT, row, "");
-				}
-				break;
-			case 7:
-			case 8:
-				if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR) {
-					SmedAction.panelMain.mark.setLightAtt(Att.ORT, row, value);
-				} else {
-					SmedAction.panelMain.mark.setLightAtt(col - 1, row, value);
-				}
-				break;
-			case 12:
-				for (Vis vis : visibilities.keySet()) {
-					String str = visibilities.get(vis);
-					if (str.equals(value))
-						SmedAction.panelMain.mark.setLightAtt(Att.VIS, row, vis);
-				}
-				break;
-			case 13:
-				for (Exh exh : exhibitions.keySet()) {
-					String str = exhibitions.get(exh);
-					if (str.equals(value))
-						SmedAction.panelMain.mark.setLightAtt(Att.EXH, row, exh);
-				}
-				break;
-			default:
-				SmedAction.panelMain.mark.setLightAtt(col - 1, row, value);
-			}
-		}
-	}
-
-	static class CentreRenderer extends DefaultTableCellRenderer {
-		public CentreRenderer() {
-			super();
-			setHorizontalAlignment(SwingConstants.CENTER);
-		}
-	}
-
-	public class ColourCellRenderer extends JPanel implements TableCellRenderer {
-		private JLabel col1Label;
-		private JLabel col2Label;
-		public ColourCellRenderer() {
-			super();
-			setLayout(new GridLayout(1, 2, 0, 0));
-			col1Label = new JLabel();
-			col1Label.setOpaque(true);
-			add(col1Label);
-			col2Label = new JLabel();
-			col2Label.setOpaque(true);
-			add(col2Label);
-		}
-		public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) {
-			if (!((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, rowIndex)).contains("Al")) {
-				col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, rowIndex)));
-			} else {
-				col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, rowIndex)));
-			}
-			col1Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, rowIndex)));
-			return this;
-		}
-	}
-
-	public int getSectorCount() {
-		return model.getRowCount();
-	}
-
-	public void addSector(int idx) {
-		SmedAction.panelMain.mark.addLight(idx);
-		table.setSize(860, ((table.getRowCount() * 16) + 28));
-		if (table.getRowCount() > 3) {
-			setSize(900, ((table.getRowCount() * 16) + 48));
-		} else {
-			setSize(900, 100);
-		}
-	}
-
-	public void deleteSector(int idx) {
-		if (idx > 0) {
-			SmedAction.panelMain.mark.delLight(idx);
-			table.setSize(860, ((table.getRowCount() * 16) + 28));
-			if (table.getRowCount() > 3) {
-				setSize(900, ((table.getRowCount() * 16) + 48));
-			} else {
-				setSize(900, 100);
-			}
-		}
-	}
-	
-	public void syncPanel() {
-		table.updateUI();
-		table.setSize(860, ((table.getRowCount() * 16) + 28));
-		if (table.getRowCount() > 3) {
-			setSize(900, ((table.getRowCount() * 16) + 48));
-		} else {
-			setSize(900, 100);
-		}
-	}
-
-	private void addColItem(ImageIcon img, Col col) {
-		colours.put(col, img);
-		colourBox.addItem(img);
-	}
-
-	private void addVisibItem(String str, Vis vis) {
-		visibilities.put(vis, str);
-		visibilityBox.addItem(str);
-	}
-
-	private void addExhibItem(String str, Exh exh) {
-		exhibitions.put(exh, str);
-		exhibitionBox.addItem(str);
-	}
+    private SmedAction dlg;
+    private JPanel panel;
+    private TableModel model;
+    private JTable table;
+
+    public JButton minusButton;
+    private ActionListener alMinusButton = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if ((getSectorCount() > 1) && (table.getSelectedRow() != 0)) {
+                deleteSector(table.getSelectedRow());
+            }
+        }
+    };
+    public JButton plusButton;
+    private ActionListener alPlusButton = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if (table.getSelectedRow() < 0) {
+                addSector(table.getRowCount());
+            } else {
+                addSector(table.getSelectedRow()+1);
+            }
+        }
+    };
+    public JComboBox<ImageIcon> colourBox;
+    public EnumMap<Col, ImageIcon> colours = new EnumMap<>(Col.class);
+    public JComboBox<String> visibilityBox;
+    public EnumMap<Vis, String> visibilities = new EnumMap<>(Vis.class);
+    public JComboBox<String> exhibitionBox;
+    public EnumMap<Exh, String> exhibitions = new EnumMap<>(Exh.class);
+
+    public PanelSectors(SmedAction dia) {
+        super(Messages.getString("SectorTable"));
+        dlg = dia;
+        setLayout(null);
+        setSize(900, 100);
+        setAlwaysOnTop(true);
+        setLocation(450, 0);
+        setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
+        minusButton = new JButton(new ImageIcon(getClass().getResource("/images/MinusButton.png")));
+        minusButton.setBounds(0, 0, 32, 34);
+        minusButton.addActionListener(alMinusButton);
+        add(minusButton);
+        plusButton = new JButton(new ImageIcon(getClass().getResource("/images/PlusButton.png")));
+        plusButton.setBounds(0, 34, 32, 34);
+        plusButton.addActionListener(alPlusButton);
+        add(plusButton);
+        panel = new JPanel(new BorderLayout());
+        panel.setBounds(40, 0, 860, 512);
+        model = new SectorTable();
+        table = new JTable(model);
+        table.setBounds(0, 0, 860, 34);
+        table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
+        panel.add(new JScrollPane(table));
+        getContentPane().add(panel);
+
+        table.setSize(860, ((table.getRowCount() * 16) + 28));
+
+        table.setDefaultRenderer(String.class, new CentreRenderer());
+        table.getColumnModel().getColumn(1).setCellRenderer(new ColourCellRenderer());
+
+        TableColumn colColumn = table.getColumnModel().getColumn(1);
+        colourBox = new JComboBox<>();
+        addColItem(new ImageIcon(getClass().getResource("/images/DelButton.png")), Col.UNKCOL);
+        addColItem(new ImageIcon(getClass().getResource("/images/WhiteButton.png")), Col.WHITE);
+        addColItem(new ImageIcon(getClass().getResource("/images/RedButton.png")), Col.RED);
+        addColItem(new ImageIcon(getClass().getResource("/images/GreenButton.png")), Col.GREEN);
+        addColItem(new ImageIcon(getClass().getResource("/images/YellowButton.png")), Col.YELLOW);
+        addColItem(new ImageIcon(getClass().getResource("/images/OrangeButton.png")), Col.ORANGE);
+        addColItem(new ImageIcon(getClass().getResource("/images/AmberButton.png")), Col.AMBER);
+        addColItem(new ImageIcon(getClass().getResource("/images/BlueButton.png")), Col.BLUE);
+        addColItem(new ImageIcon(getClass().getResource("/images/VioletButton.png")), Col.VIOLET);
+        colColumn.setCellEditor(new DefaultCellEditor(colourBox));
+
+        TableColumn visColumn = table.getColumnModel().getColumn(12);
+        visibilityBox = new JComboBox<>();
+        addVisibItem("", Vis.UNKVIS);
+        addVisibItem(Messages.getString("Intensified"), Vis.INTEN);
+        addVisibItem(Messages.getString("Unintensified"), Vis.UNINTEN);
+        addVisibItem(Messages.getString("PartiallyObscured"), Vis.PARTOBS);
+        visColumn.setCellEditor(new DefaultCellEditor(visibilityBox));
+
+        TableColumn exhColumn = table.getColumnModel().getColumn(13);
+        exhibitionBox = new JComboBox<>();
+        addExhibItem("", Exh.UNKEXH);
+        addExhibItem(Messages.getString("24h"), Exh.H24);
+        addExhibItem(Messages.getString("Day"), Exh.DAY);
+        addExhibItem(Messages.getString("Night"), Exh.NIGHT);
+        addExhibItem(Messages.getString("Fog"), Exh.FOG);
+        exhColumn.setCellEditor(new DefaultCellEditor(exhibitionBox));
+    }
+
+    private class SectorTable extends AbstractTableModel {
+
+        private String[] headings = { Messages.getString("Sector"), Messages.getString("Colour"), Messages.getString("Character"),
+                Messages.getString("Group"), Messages.getString("Sequence"), Messages.getString("Period"), Messages.getString("Directional"),
+                Messages.getString("Start"), Messages.getString("End"), Messages.getString("Radius"), Messages.getString("Height"),
+                Messages.getString("Range"), Messages.getString("Visibility"), Messages.getString("Exhibition") };
+
+        public SectorTable() {
+        }
+
+        @Override
+        public String getColumnName(int col) {
+            return headings[col];
+        }
+
+        @Override
+        public int getColumnCount() {
+            return headings.length;
+        }
+
+        @Override
+        public int getRowCount() {
+            if (SmedAction.panelMain == null)
+                return 1;
+            else
+                return SmedAction.panelMain.mark.getSectorCount();
+        }
+
+        @Override
+        public boolean isCellEditable(int row, int col) {
+            return ((col > 0) && (row > 0));
+        }
+
+        @Override
+        public Class getColumnClass(int col) {
+            switch (col) {
+            case 1:
+                return Col.class;
+            case 6:
+                return Boolean.class;
+            default:
+                return String.class;
+            }
+        }
+
+        @Override
+        public Object getValueAt(int row, int col) {
+            switch (col) {
+            case 0:
+                if (row == 0)
+                    return Messages.getString("Default");
+                else
+                    return row;
+            case 1:
+                if (((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) {
+                    if (SmedAction.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL)
+                        return Col.UNKCOL;
+                    else
+                        return SmedAction.panelMain.mark.getLightAtt(Att.ALT, row);
+                } else
+                    return SmedAction.panelMain.mark.getLightAtt(Att.COL, row);
+            case 6:
+                return (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR);
+            case 7:
+            case 8:
+                if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR)
+                    return SmedAction.panelMain.mark.getLightAtt(Att.ORT, row);
+                else
+                    return SmedAction.panelMain.mark.getLightAtt(col - 1, row);
+            case 12:
+                return visibilities.get(SmedAction.panelMain.mark.getLightAtt(Att.VIS, row));
+            case 13:
+                return exhibitions.get(SmedAction.panelMain.mark.getLightAtt(Att.EXH, row));
+            default:
+                return SmedAction.panelMain.mark.getLightAtt(col - 1, row);
+            }
+        }
+
+        @Override
+        public void setValueAt(Object value, int row, int col) {
+            switch (col) {
+            case 1:
+                for (Col colour : colours.keySet()) {
+                    ImageIcon img = colours.get(colour);
+                    if (img == value)
+                        if (((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) {
+                            if (((colour == Col.UNKCOL) && (SmedAction.panelMain.mark.getLightAtt(Att.ALT, row) == Col.UNKCOL))
+                                    || (SmedAction.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL)) {
+                                SmedAction.panelMain.mark.setLightAtt(Att.COL, row, colour);
+                            } else {
+                                SmedAction.panelMain.mark.setLightAtt(Att.ALT, row, colour);
+                            }
+                        } else {
+                            SmedAction.panelMain.mark.setLightAtt(Att.COL, row, colour);
+                        }
+                }
+                break;
+            case 5:
+            case 9:
+            case 10:
+            case 11:
+                SmedAction.panelMain.mark.setLightAtt(col - 1, row, value);
+                break;
+            case 6:
+                if ((Boolean) value == true) {
+                    SmedAction.panelMain.mark.setLightAtt(Att.LIT, row, Lit.DIR);
+                    SmedAction.panelMain.mark.setLightAtt(Att.BEG, row, "");
+                    SmedAction.panelMain.mark.setLightAtt(Att.END, row, "");
+                } else {
+                    SmedAction.panelMain.mark.setLightAtt(Att.LIT, row, Lit.UNKLIT);
+                    SmedAction.panelMain.mark.setLightAtt(Att.ORT, row, "");
+                }
+                break;
+            case 7:
+            case 8:
+                if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR) {
+                    SmedAction.panelMain.mark.setLightAtt(Att.ORT, row, value);
+                } else {
+                    SmedAction.panelMain.mark.setLightAtt(col - 1, row, value);
+                }
+                break;
+            case 12:
+                for (Vis vis : visibilities.keySet()) {
+                    String str = visibilities.get(vis);
+                    if (str.equals(value)) {
+                        SmedAction.panelMain.mark.setLightAtt(Att.VIS, row, vis);
+                    }
+                }
+                break;
+            case 13:
+                for (Exh exh : exhibitions.keySet()) {
+                    String str = exhibitions.get(exh);
+                    if (str.equals(value)) {
+                        SmedAction.panelMain.mark.setLightAtt(Att.EXH, row, exh);
+                    }
+                }
+                break;
+            default:
+                SmedAction.panelMain.mark.setLightAtt(col - 1, row, value);
+            }
+        }
+    }
+
+    static class CentreRenderer extends DefaultTableCellRenderer {
+        public CentreRenderer() {
+            super();
+            setHorizontalAlignment(SwingConstants.CENTER);
+        }
+    }
+
+    public class ColourCellRenderer extends JPanel implements TableCellRenderer {
+        private JLabel col1Label;
+        private JLabel col2Label;
+        public ColourCellRenderer() {
+            super();
+            setLayout(new GridLayout(1, 2, 0, 0));
+            col1Label = new JLabel();
+            col1Label.setOpaque(true);
+            add(col1Label);
+            col2Label = new JLabel();
+            col2Label.setOpaque(true);
+            add(col2Label);
+        }
+        @Override
+        public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) {
+            if (!((String)SmedAction.panelMain.mark.getLightAtt(Att.CHR, rowIndex)).contains("Al")) {
+                col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, rowIndex)));
+            } else {
+                col2Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.ALT, rowIndex)));
+            }
+            col1Label.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getLightAtt(Att.COL, rowIndex)));
+            return this;
+        }
+    }
+
+    public int getSectorCount() {
+        return model.getRowCount();
+    }
+
+    public void addSector(int idx) {
+        SmedAction.panelMain.mark.addLight(idx);
+        table.setSize(860, ((table.getRowCount() * 16) + 28));
+        if (table.getRowCount() > 3) {
+            setSize(900, ((table.getRowCount() * 16) + 48));
+        } else {
+            setSize(900, 100);
+        }
+    }
+
+    public void deleteSector(int idx) {
+        if (idx > 0) {
+            SmedAction.panelMain.mark.delLight(idx);
+            table.setSize(860, ((table.getRowCount() * 16) + 28));
+            if (table.getRowCount() > 3) {
+                setSize(900, ((table.getRowCount() * 16) + 48));
+            } else {
+                setSize(900, 100);
+            }
+        }
+    }
+
+    public void syncPanel() {
+        table.updateUI();
+        table.setSize(860, ((table.getRowCount() * 16) + 28));
+        if (table.getRowCount() > 3) {
+            setSize(900, ((table.getRowCount() * 16) + 48));
+        } else {
+            setSize(900, 100);
+        }
+    }
+
+    private void addColItem(ImageIcon img, Col col) {
+        colours.put(col, img);
+        colourBox.addItem(img);
+    }
+
+    private void addVisibItem(String str, Vis vis) {
+        visibilities.put(vis, str);
+        visibilityBox.addItem(str);
+    }
+
+    private void addExhibItem(String str, Exh exh) {
+        exhibitions.put(exh, str);
+        exhibitionBox.addItem(str);
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelSpec.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelSpec.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelSpec.java	(revision 32767)
@@ -1,305 +1,333 @@
 package panels;
 
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.*;
-
-import java.util.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.EnumMap;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JToggleButton;
+import javax.swing.SwingConstants;
 
 import messages.Messages;
+import seamarks.SeaMark;
+import seamarks.SeaMark.Cat;
+import seamarks.SeaMark.Col;
+import seamarks.SeaMark.Ent;
+import seamarks.SeaMark.Obj;
+import seamarks.SeaMark.Pat;
+import seamarks.SeaMark.Shp;
+import seamarks.SeaMark.Top;
 import smed.SmedAction;
-import seamarks.SeaMark;
-import seamarks.SeaMark.*;
 
 public class PanelSpec extends JPanel {
 
-	private SmedAction dlg;
-	public JLabel categoryLabel;
-	public JComboBox<String> categoryBox;
-	public EnumMap<Cat, Integer> categories = new EnumMap<>(Cat.class);
-	private ActionListener alCategoryBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cat cat : categories.keySet()) {
-				int idx = categories.get(cat);
-				if (dlg.node != null && (idx == categoryBox.getSelectedIndex()))
-					SmedAction.panelMain.mark.setCategory(cat);
-			}
-		}
-	};
-	public JComboBox<String> mooringBox;
-	public EnumMap<Cat, Integer> moorings = new EnumMap<>(Cat.class);
-	private ActionListener alMooringBox = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Cat cat : moorings.keySet()) {
-				int idx = moorings.get(cat);
-				if (dlg.node != null && (idx == mooringBox.getSelectedIndex())) {
-					SmedAction.panelMain.mark.setCategory(cat);
-					if ((cat == Cat.INB_CALM) || (cat == Cat.INB_SBM)) {
-						SmedAction.panelMain.mark.setObject(Obj.BOYINB);
-						SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
-					} else {
-						SmedAction.panelMain.mark.setObject(Obj.MORFAC);
-						if (cat != Cat.MOR_BUOY)
-							SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
-					}
-				}
-			}
-			if (dlg.node != null) syncPanel();
-		}
-	};
-	public ButtonGroup shapeButtons = new ButtonGroup();
-	public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
-	public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
-	public JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
-	public JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
-	public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
-	public JRadioButton barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png")));
-	public JRadioButton superButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SuperButton.png")));
-	public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
-	public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
-	public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
-	public JRadioButton stakeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StakeButton.png")));
-	public JRadioButton cairnButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CairnButton.png")));
-	public EnumMap<Shp, JRadioButton> shapes = new EnumMap<>(Shp.class);
-	public EnumMap<Shp, Obj> objects = new EnumMap<>(Shp.class);
-	public ActionListener alShape = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if ((SmedAction.panelMain.mark.getObject() != Obj.MORFAC) || (SmedAction.panelMain.mark.getCategory() == Cat.MOR_BUOY)) {
-				for (Shp shp : shapes.keySet()) {
-					JRadioButton button = shapes.get(shp);
-					if (button.isSelected()) {
-						SmedAction.panelMain.mark.setShape(shp);
-						if (SeaMark.EntMAP.get(SmedAction.panelMain.mark.getObject()) != Ent.MOORING) {
-							SmedAction.panelMain.mark.setObject(objects.get(shp));
-							if (SmedAction.panelMain.mark.getObjColour(0) == Col.UNKCOL) {
-								SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
-								SmedAction.panelMain.mark.setObjColour(Col.YELLOW);
-							}
-							if (button == cairnButton) {
-								SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
-								SmedAction.panelMain.mark.setObjColour(Col.UNKCOL);
-							}
-							topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
-						}
-						button.setBorderPainted(true);
-					} else
-						button.setBorderPainted(false);
-				}
-				SmedAction.panelMain.panelMore.syncPanel();
-			}
-		}
-	};
-	public JToggleButton topmarkButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/SpecTopButton.png")));
-	private ActionListener alTop = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			if (topmarkButton.isSelected()) {
-				SmedAction.panelMain.mark.setTopmark(Top.X_SHAPE);
-				SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT);
-				SmedAction.panelMain.mark.setTopColour(Col.YELLOW);
-				topmarkButton.setBorderPainted(true);
-			} else {
-				SmedAction.panelMain.mark.setTopmark(Top.NOTOP);
-				SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT);
-				SmedAction.panelMain.mark.setTopColour(Col.UNKCOL);
-				topmarkButton.setBorderPainted(false);
-			}
-			SmedAction.panelMain.panelTop.syncPanel();
-		}
-	};
-	public JToggleButton noticeButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/NoticeButton.png")));
-	private ActionListener alNotice = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			SmedAction.panelMain.mark.clrMark();
-			if (noticeButton.isSelected()) {
-				SmedAction.panelMain.mark.setObject(Obj.NOTMRK);
-				noticeButton.setBorderPainted(true);
-			} else {
-				SmedAction.panelMain.mark.setObject(Obj.UNKOBJ);
-				noticeButton.setBorderPainted(false);
-			}
-			SmedAction.panelMain.syncPanel();
-		}
-	};
-	public JToggleButton mooringButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/MooringButton.png")));
-	private ActionListener alMooring = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			SmedAction.panelMain.mark.setObject(Obj.UNKOBJ);
-			SmedAction.panelMain.mark.setCategory(Cat.NOCAT);
-			SmedAction.panelMain.mark.setTopmark(Top.NOTOP);
-			if (mooringButton.isSelected()) {
-				SmedAction.panelMain.mark.setObject(Obj.MORFAC);
-				categoryBox.setVisible(false);
-				mooringBox.setVisible(true);
-				pillarButton.setEnabled(false);
-				sparButton.setEnabled(false);
-				beaconButton.setEnabled(false);
-				towerButton.setEnabled(false);
-				stakeButton.setEnabled(false);
-				cairnButton.setEnabled(false);
-				mooringButton.setBorderPainted(true);
-			} else {
-				mooringBox.setVisible(false);
-				categoryBox.setVisible(true);
-				pillarButton.setEnabled(true);
-				sparButton.setEnabled(true);
-				beaconButton.setEnabled(true);
-				towerButton.setEnabled(true);
-				stakeButton.setEnabled(true);
-				cairnButton.setEnabled(true);
-				mooringButton.setBorderPainted(false);
-			}
-			syncPanel();
-		}
-	};
-
-	public PanelSpec(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYSPP));
-		add(getShapeButton(sparButton, 34, 0, 34, 32, "Spar", Shp.SPAR, Obj.BOYSPP));
-		add(getShapeButton(canButton, 68, 0, 34, 32, "Can", Shp.CAN, Obj.BOYSPP));
-		add(getShapeButton(coneButton, 102, 0, 34, 32, "Cone", Shp.CONI, Obj.BOYSPP));
-		add(getShapeButton(sphereButton, 0, 32, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYSPP));
-		add(getShapeButton(barrelButton, 34, 32, 34, 32, "Barrel", Shp.BARREL, Obj.BOYSPP));
-		add(getShapeButton(superButton, 68, 32, 34, 32, "Super", Shp.SUPER, Obj.BOYSPP));
-		add(getShapeButton(floatButton, 102, 32, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT));
-		add(getShapeButton(beaconButton, 0, 64, 34, 32, "Beacon", Shp.BEACON, Obj.BCNSPP));
-		add(getShapeButton(towerButton, 34, 64, 34, 32, "TowerB", Shp.TOWER, Obj.BCNSPP));
-		add(getShapeButton(stakeButton, 68, 64, 34, 32, "Stake", Shp.STAKE, Obj.BCNSPP));
-		add(getShapeButton(cairnButton, 102, 64, 34, 32, "CairnB", Shp.CAIRN, Obj.BCNSPP));
-
-		categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER);
-		categoryLabel.setBounds(new Rectangle(5, 125, 160, 18));
-		add(categoryLabel);
-		categoryBox = new JComboBox<>();
-		categoryBox.setBounds(new Rectangle(5, 142, 160, 18));
-		add(categoryBox);
-		categoryBox.setVisible(true);
-		categoryBox.addActionListener(alCategoryBox);
-		addCatItem("", Cat.NOCAT);
-		addCatItem(Messages.getString("UKPurpose"), Cat.SPM_UNKN);
-		addCatItem(Messages.getString("Warning"), Cat.SPM_WARN);
-		addCatItem(Messages.getString("ChanSeparation"), Cat.SPM_CHBF);
-		addCatItem(Messages.getString("Yachting"), Cat.SPM_YCHT);
-		addCatItem(Messages.getString("Cable"), Cat.SPM_CABL);
-		addCatItem(Messages.getString("Outfall"), Cat.SPM_OFAL);
-		addCatItem(Messages.getString("ODAS"), Cat.SPM_ODAS);
-		addCatItem(Messages.getString("RecreationZone"), Cat.SPM_RECN);
-		addCatItem(Messages.getString("Mooring"), Cat.SPM_MOOR);
-		addCatItem(Messages.getString("LANBY"), Cat.SPM_LNBY);
-		addCatItem(Messages.getString("Leading"), Cat.SPM_LDNG);
-		addCatItem(Messages.getString("Notice"), Cat.SPM_NOTC);
-		addCatItem(Messages.getString("TSS"), Cat.SPM_TSS);
-		addCatItem(Messages.getString("FoulGround"), Cat.SPM_FOUL);
-		addCatItem(Messages.getString("Diving"), Cat.SPM_DIVE);
-		addCatItem(Messages.getString("FerryCross"), Cat.SPM_FRRY);
-		addCatItem(Messages.getString("Anchorage"), Cat.SPM_ANCH);
-		mooringBox = new JComboBox<>();
-		mooringBox.setBounds(new Rectangle(5, 142, 160, 18));
-		add(mooringBox);
-		mooringBox.setVisible(false);
-		mooringBox.addActionListener(alMooringBox);
-		addMorItem("", Cat.NOCAT);
-		addMorItem(Messages.getString("Dolphin"), Cat.MOR_DLPN);
-		addMorItem(Messages.getString("DevDolphin"), Cat.MOR_DDPN);
-		addMorItem(Messages.getString("Bollard"), Cat.MOR_BLRD);
-		addMorItem(Messages.getString("Wall"), Cat.MOR_WALL);
-		addMorItem(Messages.getString("Post"), Cat.MOR_POST);
-		addMorItem(Messages.getString("Chain"), Cat.MOR_CHWR);
-		addMorItem(Messages.getString("Rope"), Cat.MOR_ROPE);
-		addMorItem(Messages.getString("Automatic"), Cat.MOR_AUTO);
-		addMorItem(Messages.getString("MooringBuoy"), Cat.MOR_BUOY);
-		addMorItem(Messages.getString("CALM"), Cat.INB_CALM);
-		addMorItem(Messages.getString("SBM"), Cat.INB_SBM);
-
-		topmarkButton.setBounds(new Rectangle(136, 0, 34, 32));
-		topmarkButton.setToolTipText(Messages.getString("Topmark"));
-		topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder());
-		topmarkButton.addActionListener(alTop);
-		add(topmarkButton);
-
-//		noticeButton.setBounds(new Rectangle(136, 32, 34, 32));
-//		noticeButton.setToolTipText(Messages.getString("Notice"));
-//		noticeButton.setBorder(BorderFactory.createLoweredBevelBorder());
-//		noticeButton.addActionListener(alNotice);
-//		add(noticeButton);
-
-		mooringButton.setBounds(new Rectangle(136, 64, 34, 32));
-		mooringButton.setToolTipText(Messages.getString("Mooring"));
-		mooringButton.setBorder(BorderFactory.createLoweredBevelBorder());
-		mooringButton.addActionListener(alMooring);
-		add(mooringButton);
-	}
-
-	public void syncPanel() {
-		if (SeaMark.EntMAP.get(SmedAction.panelMain.mark.getObject()) == Ent.MOORING) {
-			mooringButton.setBorderPainted(true);
-			categoryBox.setVisible(false);
-			mooringBox.setVisible(true);
-			pillarButton.setEnabled(false);
-			sparButton.setEnabled(false);
-			beaconButton.setEnabled(false);
-			towerButton.setEnabled(false);
-			stakeButton.setEnabled(false);
-			cairnButton.setEnabled(false);
-			noticeButton.setEnabled(false);
-			topmarkButton.setVisible(false);
-			for (Cat cat : moorings.keySet()) {
-				int item = moorings.get(cat);
-				if (SmedAction.panelMain.mark.getCategory() == cat)
-					mooringBox.setSelectedIndex(item);
-			}
-		} else {
-			mooringButton.setBorderPainted(false);
-			mooringBox.setVisible(false);
-			categoryBox.setVisible(true);
-			pillarButton.setEnabled(true);
-			sparButton.setEnabled(true);
-			beaconButton.setEnabled(true);
-			towerButton.setEnabled(true);
-			stakeButton.setEnabled(true);
-			cairnButton.setEnabled(true);
-			noticeButton.setEnabled(true);
-			topmarkButton.setBorderPainted(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP);
-			topmarkButton.setSelected(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP);
-			topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
-			for (Cat cat : categories.keySet()) {
-				int item = categories.get(cat);
-				if (SmedAction.panelMain.mark.getCategory() == cat)
-					categoryBox.setSelectedIndex(item);
-			}
-		}
-		for (Shp shp : shapes.keySet()) {
-			JRadioButton button = shapes.get(shp);
-			if (SmedAction.panelMain.mark.getShape() == shp) {
-				button.setBorderPainted(true);
-			} else
-				button.setBorderPainted(false);
-		}
-		noticeButton.setBorderPainted(false);
-		SmedAction.panelMain.mark.testValid();
-	}
-
-	private void addCatItem(String str, Cat cat) {
-		categories.put(cat, categoryBox.getItemCount());
-		categoryBox.addItem(str);
-	}
-
-	private void addMorItem(String str, Cat cat) {
-		moorings.put(cat, mooringBox.getItemCount());
-		mooringBox.addItem(str);
-	}
-
-	private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alShape);
-		shapeButtons.add(button);
-		shapes.put(shp, button);
-		objects.put(shp, obj);
-		return button;
-	}
+    private SmedAction dlg;
+    public JLabel categoryLabel;
+    public JComboBox<String> categoryBox;
+    public EnumMap<Cat, Integer> categories = new EnumMap<>(Cat.class);
+    private ActionListener alCategoryBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cat cat : categories.keySet()) {
+                int idx = categories.get(cat);
+                if (dlg.node != null && (idx == categoryBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setCategory(cat);
+                }
+            }
+        }
+    };
+    public JComboBox<String> mooringBox;
+    public EnumMap<Cat, Integer> moorings = new EnumMap<>(Cat.class);
+    private ActionListener alMooringBox = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Cat cat : moorings.keySet()) {
+                int idx = moorings.get(cat);
+                if (dlg.node != null && (idx == mooringBox.getSelectedIndex())) {
+                    SmedAction.panelMain.mark.setCategory(cat);
+                    if ((cat == Cat.INB_CALM) || (cat == Cat.INB_SBM)) {
+                        SmedAction.panelMain.mark.setObject(Obj.BOYINB);
+                        SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
+                    } else {
+                        SmedAction.panelMain.mark.setObject(Obj.MORFAC);
+                        if (cat != Cat.MOR_BUOY) {
+                            SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
+                        }
+                    }
+                }
+            }
+            if (dlg.node != null) {
+                syncPanel();
+            }
+        }
+    };
+    public ButtonGroup shapeButtons = new ButtonGroup();
+    public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
+    public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
+    public JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
+    public JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
+    public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
+    public JRadioButton barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png")));
+    public JRadioButton superButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SuperButton.png")));
+    public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
+    public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
+    public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
+    public JRadioButton stakeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StakeButton.png")));
+    public JRadioButton cairnButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CairnButton.png")));
+    public EnumMap<Shp, JRadioButton> shapes = new EnumMap<>(Shp.class);
+    public EnumMap<Shp, Obj> objects = new EnumMap<>(Shp.class);
+    public ActionListener alShape = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if ((SmedAction.panelMain.mark.getObject() != Obj.MORFAC) || (SmedAction.panelMain.mark.getCategory() == Cat.MOR_BUOY)) {
+                for (Shp shp : shapes.keySet()) {
+                    JRadioButton button = shapes.get(shp);
+                    if (button.isSelected()) {
+                        SmedAction.panelMain.mark.setShape(shp);
+                        if (SeaMark.EntMAP.get(SmedAction.panelMain.mark.getObject()) != Ent.MOORING) {
+                            SmedAction.panelMain.mark.setObject(objects.get(shp));
+                            if (SmedAction.panelMain.mark.getObjColour(0) == Col.UNKCOL) {
+                                SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
+                                SmedAction.panelMain.mark.setObjColour(Col.YELLOW);
+                            }
+                            if (button == cairnButton) {
+                                SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
+                                SmedAction.panelMain.mark.setObjColour(Col.UNKCOL);
+                            }
+                            topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
+                        }
+                        button.setBorderPainted(true);
+                    } else {
+                        button.setBorderPainted(false);
+                    }
+                }
+                SmedAction.panelMain.panelMore.syncPanel();
+            }
+        }
+    };
+    public JToggleButton topmarkButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/SpecTopButton.png")));
+    private ActionListener alTop = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            if (topmarkButton.isSelected()) {
+                SmedAction.panelMain.mark.setTopmark(Top.X_SHAPE);
+                SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT);
+                SmedAction.panelMain.mark.setTopColour(Col.YELLOW);
+                topmarkButton.setBorderPainted(true);
+            } else {
+                SmedAction.panelMain.mark.setTopmark(Top.NOTOP);
+                SmedAction.panelMain.mark.setTopPattern(Pat.NOPAT);
+                SmedAction.panelMain.mark.setTopColour(Col.UNKCOL);
+                topmarkButton.setBorderPainted(false);
+            }
+            SmedAction.panelMain.panelTop.syncPanel();
+        }
+    };
+    public JToggleButton noticeButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/NoticeButton.png")));
+    private ActionListener alNotice = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            SmedAction.panelMain.mark.clrMark();
+            if (noticeButton.isSelected()) {
+                SmedAction.panelMain.mark.setObject(Obj.NOTMRK);
+                noticeButton.setBorderPainted(true);
+            } else {
+                SmedAction.panelMain.mark.setObject(Obj.UNKOBJ);
+                noticeButton.setBorderPainted(false);
+            }
+            SmedAction.panelMain.syncPanel();
+        }
+    };
+    public JToggleButton mooringButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/MooringButton.png")));
+    private ActionListener alMooring = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            SmedAction.panelMain.mark.setObject(Obj.UNKOBJ);
+            SmedAction.panelMain.mark.setCategory(Cat.NOCAT);
+            SmedAction.panelMain.mark.setTopmark(Top.NOTOP);
+            if (mooringButton.isSelected()) {
+                SmedAction.panelMain.mark.setObject(Obj.MORFAC);
+                categoryBox.setVisible(false);
+                mooringBox.setVisible(true);
+                pillarButton.setEnabled(false);
+                sparButton.setEnabled(false);
+                beaconButton.setEnabled(false);
+                towerButton.setEnabled(false);
+                stakeButton.setEnabled(false);
+                cairnButton.setEnabled(false);
+                mooringButton.setBorderPainted(true);
+            } else {
+                mooringBox.setVisible(false);
+                categoryBox.setVisible(true);
+                pillarButton.setEnabled(true);
+                sparButton.setEnabled(true);
+                beaconButton.setEnabled(true);
+                towerButton.setEnabled(true);
+                stakeButton.setEnabled(true);
+                cairnButton.setEnabled(true);
+                mooringButton.setBorderPainted(false);
+            }
+            syncPanel();
+        }
+    };
+
+    public PanelSpec(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYSPP));
+        add(getShapeButton(sparButton, 34, 0, 34, 32, "Spar", Shp.SPAR, Obj.BOYSPP));
+        add(getShapeButton(canButton, 68, 0, 34, 32, "Can", Shp.CAN, Obj.BOYSPP));
+        add(getShapeButton(coneButton, 102, 0, 34, 32, "Cone", Shp.CONI, Obj.BOYSPP));
+        add(getShapeButton(sphereButton, 0, 32, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYSPP));
+        add(getShapeButton(barrelButton, 34, 32, 34, 32, "Barrel", Shp.BARREL, Obj.BOYSPP));
+        add(getShapeButton(superButton, 68, 32, 34, 32, "Super", Shp.SUPER, Obj.BOYSPP));
+        add(getShapeButton(floatButton, 102, 32, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT));
+        add(getShapeButton(beaconButton, 0, 64, 34, 32, "Beacon", Shp.BEACON, Obj.BCNSPP));
+        add(getShapeButton(towerButton, 34, 64, 34, 32, "TowerB", Shp.TOWER, Obj.BCNSPP));
+        add(getShapeButton(stakeButton, 68, 64, 34, 32, "Stake", Shp.STAKE, Obj.BCNSPP));
+        add(getShapeButton(cairnButton, 102, 64, 34, 32, "CairnB", Shp.CAIRN, Obj.BCNSPP));
+
+        categoryLabel = new JLabel(Messages.getString("Category"), SwingConstants.CENTER);
+        categoryLabel.setBounds(new Rectangle(5, 125, 160, 18));
+        add(categoryLabel);
+        categoryBox = new JComboBox<>();
+        categoryBox.setBounds(new Rectangle(5, 142, 160, 18));
+        add(categoryBox);
+        categoryBox.setVisible(true);
+        categoryBox.addActionListener(alCategoryBox);
+        addCatItem("", Cat.NOCAT);
+        addCatItem(Messages.getString("UKPurpose"), Cat.SPM_UNKN);
+        addCatItem(Messages.getString("Warning"), Cat.SPM_WARN);
+        addCatItem(Messages.getString("ChanSeparation"), Cat.SPM_CHBF);
+        addCatItem(Messages.getString("Yachting"), Cat.SPM_YCHT);
+        addCatItem(Messages.getString("Cable"), Cat.SPM_CABL);
+        addCatItem(Messages.getString("Outfall"), Cat.SPM_OFAL);
+        addCatItem(Messages.getString("ODAS"), Cat.SPM_ODAS);
+        addCatItem(Messages.getString("RecreationZone"), Cat.SPM_RECN);
+        addCatItem(Messages.getString("Mooring"), Cat.SPM_MOOR);
+        addCatItem(Messages.getString("LANBY"), Cat.SPM_LNBY);
+        addCatItem(Messages.getString("Leading"), Cat.SPM_LDNG);
+        addCatItem(Messages.getString("Notice"), Cat.SPM_NOTC);
+        addCatItem(Messages.getString("TSS"), Cat.SPM_TSS);
+        addCatItem(Messages.getString("FoulGround"), Cat.SPM_FOUL);
+        addCatItem(Messages.getString("Diving"), Cat.SPM_DIVE);
+        addCatItem(Messages.getString("FerryCross"), Cat.SPM_FRRY);
+        addCatItem(Messages.getString("Anchorage"), Cat.SPM_ANCH);
+        mooringBox = new JComboBox<>();
+        mooringBox.setBounds(new Rectangle(5, 142, 160, 18));
+        add(mooringBox);
+        mooringBox.setVisible(false);
+        mooringBox.addActionListener(alMooringBox);
+        addMorItem("", Cat.NOCAT);
+        addMorItem(Messages.getString("Dolphin"), Cat.MOR_DLPN);
+        addMorItem(Messages.getString("DevDolphin"), Cat.MOR_DDPN);
+        addMorItem(Messages.getString("Bollard"), Cat.MOR_BLRD);
+        addMorItem(Messages.getString("Wall"), Cat.MOR_WALL);
+        addMorItem(Messages.getString("Post"), Cat.MOR_POST);
+        addMorItem(Messages.getString("Chain"), Cat.MOR_CHWR);
+        addMorItem(Messages.getString("Rope"), Cat.MOR_ROPE);
+        addMorItem(Messages.getString("Automatic"), Cat.MOR_AUTO);
+        addMorItem(Messages.getString("MooringBuoy"), Cat.MOR_BUOY);
+        addMorItem(Messages.getString("CALM"), Cat.INB_CALM);
+        addMorItem(Messages.getString("SBM"), Cat.INB_SBM);
+
+        topmarkButton.setBounds(new Rectangle(136, 0, 34, 32));
+        topmarkButton.setToolTipText(Messages.getString("Topmark"));
+        topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder());
+        topmarkButton.addActionListener(alTop);
+        add(topmarkButton);
+
+        //        noticeButton.setBounds(new Rectangle(136, 32, 34, 32));
+        //        noticeButton.setToolTipText(Messages.getString("Notice"));
+        //        noticeButton.setBorder(BorderFactory.createLoweredBevelBorder());
+        //        noticeButton.addActionListener(alNotice);
+        //        add(noticeButton);
+
+        mooringButton.setBounds(new Rectangle(136, 64, 34, 32));
+        mooringButton.setToolTipText(Messages.getString("Mooring"));
+        mooringButton.setBorder(BorderFactory.createLoweredBevelBorder());
+        mooringButton.addActionListener(alMooring);
+        add(mooringButton);
+    }
+
+    public void syncPanel() {
+        if (SeaMark.EntMAP.get(SmedAction.panelMain.mark.getObject()) == Ent.MOORING) {
+            mooringButton.setBorderPainted(true);
+            categoryBox.setVisible(false);
+            mooringBox.setVisible(true);
+            pillarButton.setEnabled(false);
+            sparButton.setEnabled(false);
+            beaconButton.setEnabled(false);
+            towerButton.setEnabled(false);
+            stakeButton.setEnabled(false);
+            cairnButton.setEnabled(false);
+            noticeButton.setEnabled(false);
+            topmarkButton.setVisible(false);
+            for (Cat cat : moorings.keySet()) {
+                int item = moorings.get(cat);
+                if (SmedAction.panelMain.mark.getCategory() == cat) {
+                    mooringBox.setSelectedIndex(item);
+                }
+            }
+        } else {
+            mooringButton.setBorderPainted(false);
+            mooringBox.setVisible(false);
+            categoryBox.setVisible(true);
+            pillarButton.setEnabled(true);
+            sparButton.setEnabled(true);
+            beaconButton.setEnabled(true);
+            towerButton.setEnabled(true);
+            stakeButton.setEnabled(true);
+            cairnButton.setEnabled(true);
+            noticeButton.setEnabled(true);
+            topmarkButton.setBorderPainted(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP);
+            topmarkButton.setSelected(SmedAction.panelMain.mark.getTopmark() != Top.NOTOP);
+            topmarkButton.setVisible(SmedAction.panelMain.mark.testValid());
+            for (Cat cat : categories.keySet()) {
+                int item = categories.get(cat);
+                if (SmedAction.panelMain.mark.getCategory() == cat) {
+                    categoryBox.setSelectedIndex(item);
+                }
+            }
+        }
+        for (Shp shp : shapes.keySet()) {
+            JRadioButton button = shapes.get(shp);
+            if (SmedAction.panelMain.mark.getShape() == shp) {
+                button.setBorderPainted(true);
+            } else {
+                button.setBorderPainted(false);
+            }
+        }
+        noticeButton.setBorderPainted(false);
+        SmedAction.panelMain.mark.testValid();
+    }
+
+    private void addCatItem(String str, Cat cat) {
+        categories.put(cat, categoryBox.getItemCount());
+        categoryBox.addItem(str);
+    }
+
+    private void addMorItem(String str, Cat cat) {
+        moorings.put(cat, mooringBox.getItemCount());
+        mooringBox.addItem(str);
+    }
+
+    private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alShape);
+        shapeButtons.add(button);
+        shapes.put(shp, button);
+        objects.put(shp, obj);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelStbd.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelStbd.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelStbd.java	(revision 32767)
@@ -1,124 +1,136 @@
 package panels;
 
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.EnumMap;
 
-import java.util.*;
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
 
 import messages.Messages;
+import seamarks.SeaMark.Cat;
+import seamarks.SeaMark.Col;
+import seamarks.SeaMark.Obj;
+import seamarks.SeaMark.Pat;
+import seamarks.SeaMark.Shp;
 import smed.SmedAction;
-import seamarks.SeaMark.*;
 
 public class PanelStbd extends JPanel {
 
-	private SmedAction dlg;
-	public ButtonGroup shapeButtons = new ButtonGroup();
-	public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
-	public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
-	public JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
-	public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
-	public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
-	public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
-	public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
-	public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchSButton.png")));
-	public JRadioButton stakeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StakeButton.png")));
-	public EnumMap<Shp, JRadioButton> shapes = new EnumMap<>(Shp.class);
-	public EnumMap<Shp, Obj> objects = new EnumMap<>(Shp.class);
-	public ActionListener alShape = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Shp shp : shapes.keySet()) {
-				JRadioButton button = shapes.get(shp);
-				if (button.isSelected()) {
-					SmedAction.panelMain.mark.setShape(shp);
-					SmedAction.panelMain.mark.setObject(objects.get(shp));
-					button.setBorderPainted(true);
-				} else
-					button.setBorderPainted(false);
-			}
-			if (SmedAction.panelMain.mark.testValid()) {
-				SmedAction.panelMain.panelChan.topmarkButton.setVisible(true);
-				SmedAction.panelMain.panelChan.lightButton.setVisible(true);
-				if (SmedAction.panelMain.mark.getCategory() == Cat.LAM_STBD) {
-					switch (SmedAction.panelMain.mark.getRegion()) {
-					case A:
-						SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
-						SmedAction.panelMain.mark.setObjColour(Col.GREEN);
-						break;
-					case B:
-						SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
-						SmedAction.panelMain.mark.setObjColour(Col.RED);
-						break;
-					case C:
-						SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP);
-						SmedAction.panelMain.mark.setObjColour(Col.GREEN);
-						SmedAction.panelMain.mark.addObjColour(Col.WHITE);
-						SmedAction.panelMain.mark.addObjColour(Col.GREEN);
-						SmedAction.panelMain.mark.addObjColour(Col.WHITE);
-						break;
-					}
-				} else {
-					SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP);
-					switch (SmedAction.panelMain.mark.getRegion()) {
-					case A:
-						SmedAction.panelMain.mark.setObjColour(Col.GREEN);
-						SmedAction.panelMain.mark.addObjColour(Col.RED);
-						SmedAction.panelMain.mark.addObjColour(Col.GREEN);
-						break;
-					case B:
-						SmedAction.panelMain.mark.setObjColour(Col.RED);
-						SmedAction.panelMain.mark.addObjColour(Col.GREEN);
-						SmedAction.panelMain.mark.addObjColour(Col.RED);
-						break;
-					case C:
-						SmedAction.panelMain.mark.setObjColour(Col.RED);
-						SmedAction.panelMain.mark.addObjColour(Col.GREEN);
-						SmedAction.panelMain.mark.addObjColour(Col.RED);
-						SmedAction.panelMain.mark.addObjColour(Col.GREEN);
-						break;
-					}
-				}
-				SmedAction.panelMain.panelMore.syncPanel();
-			} else {
-				SmedAction.panelMain.panelChan.topmarkButton.setVisible(false);
-				SmedAction.panelMain.panelChan.lightButton.setVisible(false);
-			}
-		}
-	};
+    private SmedAction dlg;
+    public ButtonGroup shapeButtons = new ButtonGroup();
+    public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
+    public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
+    public JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
+    public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
+    public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
+    public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
+    public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
+    public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchSButton.png")));
+    public JRadioButton stakeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StakeButton.png")));
+    public EnumMap<Shp, JRadioButton> shapes = new EnumMap<>(Shp.class);
+    public EnumMap<Shp, Obj> objects = new EnumMap<>(Shp.class);
+    public ActionListener alShape = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Shp shp : shapes.keySet()) {
+                JRadioButton button = shapes.get(shp);
+                if (button.isSelected()) {
+                    SmedAction.panelMain.mark.setShape(shp);
+                    SmedAction.panelMain.mark.setObject(objects.get(shp));
+                    button.setBorderPainted(true);
+                } else {
+                    button.setBorderPainted(false);
+                }
+            }
+            if (SmedAction.panelMain.mark.testValid()) {
+                SmedAction.panelMain.panelChan.topmarkButton.setVisible(true);
+                SmedAction.panelMain.panelChan.lightButton.setVisible(true);
+                if (SmedAction.panelMain.mark.getCategory() == Cat.LAM_STBD) {
+                    switch (SmedAction.panelMain.mark.getRegion()) {
+                    case A:
+                        SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
+                        SmedAction.panelMain.mark.setObjColour(Col.GREEN);
+                        break;
+                    case B:
+                        SmedAction.panelMain.mark.setObjPattern(Pat.NOPAT);
+                        SmedAction.panelMain.mark.setObjColour(Col.RED);
+                        break;
+                    case C:
+                        SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP);
+                        SmedAction.panelMain.mark.setObjColour(Col.GREEN);
+                        SmedAction.panelMain.mark.addObjColour(Col.WHITE);
+                        SmedAction.panelMain.mark.addObjColour(Col.GREEN);
+                        SmedAction.panelMain.mark.addObjColour(Col.WHITE);
+                        break;
+                    }
+                } else {
+                    SmedAction.panelMain.mark.setObjPattern(Pat.HSTRP);
+                    switch (SmedAction.panelMain.mark.getRegion()) {
+                    case A:
+                        SmedAction.panelMain.mark.setObjColour(Col.GREEN);
+                        SmedAction.panelMain.mark.addObjColour(Col.RED);
+                        SmedAction.panelMain.mark.addObjColour(Col.GREEN);
+                        break;
+                    case B:
+                        SmedAction.panelMain.mark.setObjColour(Col.RED);
+                        SmedAction.panelMain.mark.addObjColour(Col.GREEN);
+                        SmedAction.panelMain.mark.addObjColour(Col.RED);
+                        break;
+                    case C:
+                        SmedAction.panelMain.mark.setObjColour(Col.RED);
+                        SmedAction.panelMain.mark.addObjColour(Col.GREEN);
+                        SmedAction.panelMain.mark.addObjColour(Col.RED);
+                        SmedAction.panelMain.mark.addObjColour(Col.GREEN);
+                        break;
+                    }
+                }
+                SmedAction.panelMain.panelMore.syncPanel();
+            } else {
+                SmedAction.panelMain.panelChan.topmarkButton.setVisible(false);
+                SmedAction.panelMain.panelChan.lightButton.setVisible(false);
+            }
+        }
+    };
 
-	public PanelStbd(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYLAT));
-		add(getShapeButton(sparButton, 0, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYLAT));
-		add(getShapeButton(coneButton, 0, 64, 34, 32, "Cone", Shp.CONI, Obj.BOYLAT));
-		add(getShapeButton(sphereButton, 0, 96, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYLAT));
-		add(getShapeButton(floatButton, 0, 128, 34, 32, "Float", Shp.FLOAT, Obj.FLTLAT));
-		add(getShapeButton(beaconButton, 35, 0, 34, 32, "Beacon", Shp.BEACON, Obj.BCNLAT));
-		add(getShapeButton(towerButton, 35, 32, 34, 32, "TowerB", Shp.TOWER, Obj.BCNLAT));
-		add(getShapeButton(perchButton, 35, 64, 34, 32, "Perch", Shp.PERCH, Obj.BCNLAT));
-		add(getShapeButton(stakeButton, 35, 96, 34, 32, "Stake", Shp.STAKE, Obj.BCNLAT));
-	}
+    public PanelStbd(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        add(getShapeButton(pillarButton, 0, 0, 34, 32, "Pillar", Shp.PILLAR, Obj.BOYLAT));
+        add(getShapeButton(sparButton, 0, 32, 34, 32, "Spar", Shp.SPAR, Obj.BOYLAT));
+        add(getShapeButton(coneButton, 0, 64, 34, 32, "Cone", Shp.CONI, Obj.BOYLAT));
+        add(getShapeButton(sphereButton, 0, 96, 34, 32, "Sphere", Shp.SPHERI, Obj.BOYLAT));
+        add(getShapeButton(floatButton, 0, 128, 34, 32, "Float", Shp.FLOAT, Obj.FLTLAT));
+        add(getShapeButton(beaconButton, 35, 0, 34, 32, "Beacon", Shp.BEACON, Obj.BCNLAT));
+        add(getShapeButton(towerButton, 35, 32, 34, 32, "TowerB", Shp.TOWER, Obj.BCNLAT));
+        add(getShapeButton(perchButton, 35, 64, 34, 32, "Perch", Shp.PERCH, Obj.BCNLAT));
+        add(getShapeButton(stakeButton, 35, 96, 34, 32, "Stake", Shp.STAKE, Obj.BCNLAT));
+    }
 
-	public void syncPanel() {
-		for (Shp shp : shapes.keySet()) {
-			JRadioButton button = shapes.get(shp);
-			if (SmedAction.panelMain.mark.getShape() == shp) {
-				button.setBorderPainted(true);
-			} else
-				button.setBorderPainted(false);
-		}
-	}
+    public void syncPanel() {
+        for (Shp shp : shapes.keySet()) {
+            JRadioButton button = shapes.get(shp);
+            if (SmedAction.panelMain.mark.getShape() == shp) {
+                button.setBorderPainted(true);
+            } else {
+                button.setBorderPainted(false);
+            }
+        }
+    }
 
-	private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alShape);
-		shapeButtons.add(button);
-		shapes.put(shp, button);
-		objects.put(shp, obj);
-		return button;
-	}
+    private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp, Obj obj) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alShape);
+        shapeButtons.add(button);
+        shapes.put(shp, button);
+        objects.put(shp, obj);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/panels/PanelTop.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/panels/PanelTop.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/panels/PanelTop.java	(revision 32767)
@@ -1,99 +1,108 @@
 package panels;
 
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
+import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.EnumMap;
 
-import java.util.*;
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
 
 import messages.Messages;
+import seamarks.SeaMark.Ent;
+import seamarks.SeaMark.Top;
 import smed.SmedAction;
-import seamarks.SeaMark.*;
 
 public class PanelTop extends JPanel {
 
-	private SmedAction dlg;
-	public PanelPat panelPat = null;
-	private ButtonGroup topButtons = new ButtonGroup();
-	public JRadioButton noTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png")));
-	public JRadioButton canTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanTopButton.png")));
-	public JRadioButton coneTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeTopButton.png")));
-	public JRadioButton sphereTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereTopButton.png")));
-	public JRadioButton XTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/XTopButton.png")));
-	public JRadioButton northTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NorthTopButton.png")));
-	public JRadioButton southTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SouthTopButton.png")));
-	public JRadioButton eastTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/EastTopButton.png")));
-	public JRadioButton westTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WestTopButton.png")));
-	public JRadioButton spheres2TopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/Spheres2TopButton.png")));
-	public JRadioButton boardDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BoardDayButton.png")));
-	public JRadioButton rhombusDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DiamondDayButton.png")));
-	public JRadioButton triangleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleDayButton.png")));
-	public JRadioButton triangleInvDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleInvDayButton.png")));
-	public JRadioButton squareDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquareDayButton.png")));
-	public JRadioButton circleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CircleDayButton.png")));
-	private EnumMap<Top, JRadioButton> tops = new EnumMap<>(Top.class);
-	private ActionListener alTop = new ActionListener() {
-		public void actionPerformed(java.awt.event.ActionEvent e) {
-			for (Top top : tops.keySet()) {
-				JRadioButton button = tops.get(top);
-				if (button.isSelected()) {
-					SmedAction.panelMain.mark.setTopmark(top);
-					button.setBorderPainted(true);
-				} else
-					button.setBorderPainted(false);
-			}
-		}
-	};
+    private SmedAction dlg;
+    public PanelPat panelPat = null;
+    private ButtonGroup topButtons = new ButtonGroup();
+    public JRadioButton noTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png")));
+    public JRadioButton canTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanTopButton.png")));
+    public JRadioButton coneTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeTopButton.png")));
+    public JRadioButton sphereTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereTopButton.png")));
+    public JRadioButton XTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/XTopButton.png")));
+    public JRadioButton northTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NorthTopButton.png")));
+    public JRadioButton southTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SouthTopButton.png")));
+    public JRadioButton eastTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/EastTopButton.png")));
+    public JRadioButton westTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WestTopButton.png")));
+    public JRadioButton spheres2TopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/Spheres2TopButton.png")));
+    public JRadioButton boardDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BoardDayButton.png")));
+    public JRadioButton rhombusDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DiamondDayButton.png")));
+    public JRadioButton triangleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleDayButton.png")));
+    public JRadioButton triangleInvDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleInvDayButton.png")));
+    public JRadioButton squareDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquareDayButton.png")));
+    public JRadioButton circleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CircleDayButton.png")));
+    private EnumMap<Top, JRadioButton> tops = new EnumMap<>(Top.class);
+    private ActionListener alTop = new ActionListener() {
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            for (Top top : tops.keySet()) {
+                JRadioButton button = tops.get(top);
+                if (button.isSelected()) {
+                    SmedAction.panelMain.mark.setTopmark(top);
+                    button.setBorderPainted(true);
+                } else {
+                    button.setBorderPainted(false);
+                }
+            }
+        }
+    };
 
-	public PanelTop(SmedAction dia) {
-		dlg = dia;
-		setLayout(null);
-		panelPat = new PanelPat(dlg, Ent.TOPMARK);
-		panelPat.setBounds(new Rectangle(160, 0, 110, 160));
-		add(panelPat);
-		add(getTopButton(noTopButton, 0, 5, 27, 27, "NoTop", Top.NOTOP));
-		add(getTopButton(canTopButton, 30, 5, 27, 27, "CanTop", Top.CYL));
-		add(getTopButton(coneTopButton, 60, 5, 27, 27, "ConeTop", Top.CONE));
-		add(getTopButton(sphereTopButton, 90, 5, 27, 27, "SphereTop", Top.SPHERE));
-		add(getTopButton(XTopButton, 120, 5, 27, 27, "XTop", Top.X_SHAPE));
-		add(getTopButton(northTopButton, 0, 35, 27, 27, "NorthTop", Top.NORTH));
-		add(getTopButton(southTopButton, 30, 35, 27, 27, "SouthTop", Top.SOUTH));
-		add(getTopButton(eastTopButton, 60, 35, 27, 27, "EastTop", Top.EAST));
-		add(getTopButton(westTopButton, 90, 35, 27, 27, "WestTop", Top.WEST));
-		add(getTopButton(spheres2TopButton, 120, 35, 27, 27, "Spheres2Top", Top.SPHERES2));
-		add(getTopButton(boardDayButton, 0, 65, 27, 27, "BoardDay", Top.BOARD));
-		add(getTopButton(rhombusDayButton, 30, 65, 27, 27, "DiamondDay", Top.RHOMBUS));
-		add(getTopButton(triangleDayButton, 60, 65, 27, 27, "TriangleDay", Top.TRIANGLE));
-		add(getTopButton(triangleInvDayButton, 90, 65, 27, 27, "TriangleInvDay", Top.TRIANGLE_INV));
-		add(getTopButton(squareDayButton, 120, 65, 27, 27, "SquareDay", Top.SQUARE));
-		add(getTopButton(circleDayButton, 120, 95, 27, 27, "CircleDay", Top.CIRCLE));
-	}
+    public PanelTop(SmedAction dia) {
+        dlg = dia;
+        setLayout(null);
+        panelPat = new PanelPat(dlg, Ent.TOPMARK);
+        panelPat.setBounds(new Rectangle(160, 0, 110, 160));
+        add(panelPat);
+        add(getTopButton(noTopButton, 0, 5, 27, 27, "NoTop", Top.NOTOP));
+        add(getTopButton(canTopButton, 30, 5, 27, 27, "CanTop", Top.CYL));
+        add(getTopButton(coneTopButton, 60, 5, 27, 27, "ConeTop", Top.CONE));
+        add(getTopButton(sphereTopButton, 90, 5, 27, 27, "SphereTop", Top.SPHERE));
+        add(getTopButton(XTopButton, 120, 5, 27, 27, "XTop", Top.X_SHAPE));
+        add(getTopButton(northTopButton, 0, 35, 27, 27, "NorthTop", Top.NORTH));
+        add(getTopButton(southTopButton, 30, 35, 27, 27, "SouthTop", Top.SOUTH));
+        add(getTopButton(eastTopButton, 60, 35, 27, 27, "EastTop", Top.EAST));
+        add(getTopButton(westTopButton, 90, 35, 27, 27, "WestTop", Top.WEST));
+        add(getTopButton(spheres2TopButton, 120, 35, 27, 27, "Spheres2Top", Top.SPHERES2));
+        add(getTopButton(boardDayButton, 0, 65, 27, 27, "BoardDay", Top.BOARD));
+        add(getTopButton(rhombusDayButton, 30, 65, 27, 27, "DiamondDay", Top.RHOMBUS));
+        add(getTopButton(triangleDayButton, 60, 65, 27, 27, "TriangleDay", Top.TRIANGLE));
+        add(getTopButton(triangleInvDayButton, 90, 65, 27, 27, "TriangleInvDay", Top.TRIANGLE_INV));
+        add(getTopButton(squareDayButton, 120, 65, 27, 27, "SquareDay", Top.SQUARE));
+        add(getTopButton(circleDayButton, 120, 95, 27, 27, "CircleDay", Top.CIRCLE));
+    }
 
-	public void enableAll(boolean state) {
-		for (JRadioButton button : tops.values()) {
-			button.setEnabled(state);
-		}
-	}
+    public void enableAll(boolean state) {
+        for (JRadioButton button : tops.values()) {
+            button.setEnabled(state);
+        }
+    }
 
-	public void syncPanel() {
-		for (Top top : tops.keySet()) {
-			JRadioButton button = tops.get(top);
-			if (SmedAction.panelMain.mark.getTopmark() == top) {
-				button.setBorderPainted(true);
-			} else
-				button.setBorderPainted(false);
-		}
-		panelPat.syncPanel();
-	}
+    public void syncPanel() {
+        for (Top top : tops.keySet()) {
+            JRadioButton button = tops.get(top);
+            if (SmedAction.panelMain.mark.getTopmark() == top) {
+                button.setBorderPainted(true);
+            } else {
+                button.setBorderPainted(false);
+            }
+        }
+        panelPat.syncPanel();
+    }
 
-	private JRadioButton getTopButton(JRadioButton button, int x, int y, int w, int h, String tip, Top top) {
-		button.setBounds(new Rectangle(x, y, w, h));
-		button.setBorder(BorderFactory.createLoweredBevelBorder());
-		button.setToolTipText(Messages.getString(tip));
-		button.addActionListener(alTop);
-		topButtons.add(button);
-		tops.put(top, button);
-		return button;
-	}
+    private JRadioButton getTopButton(JRadioButton button, int x, int y, int w, int h, String tip, Top top) {
+        button.setBounds(new Rectangle(x, y, w, h));
+        button.setBorder(BorderFactory.createLoweredBevelBorder());
+        button.setToolTipText(Messages.getString(tip));
+        button.addActionListener(alTop);
+        topButtons.add(button);
+        tops.put(top, button);
+        return button;
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/seamarks/SeaMark.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/seamarks/SeaMark.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/seamarks/SeaMark.java	(revision 32767)
@@ -1,2798 +1,2805 @@
 package seamarks;
 
-import javax.swing.*;
-
-import java.awt.*;
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
 import java.awt.geom.Arc2D;
-
-import java.util.*;
+import java.util.ArrayList;
+import java.util.EnumMap;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
 
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.osm.*;
 import org.openstreetmap.josm.command.ChangePropertyCommand;
-
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+
+import messages.Messages;
 import panels.PanelMain;
-
-import messages.Messages;
 import smed.SmedAction;
 
 public class SeaMark extends JPanel {
 
-	public SmedAction dlg = null;
-
-	public SeaMark(SmedAction dia) {
-		dlg = dia;
-		clrLight();
-	}
-
-	public enum Reg {
-		A, B, C, R, X
-	}
-
-	public static final EnumMap<Reg, String> RegSTR = new EnumMap<>(Reg.class);
-	static {
-		RegSTR.put(Reg.A, "iala-a");
-		RegSTR.put(Reg.B, "iala-b");
-		RegSTR.put(Reg.C, "cevni");
-		RegSTR.put(Reg.R, "riwr");
-		RegSTR.put(Reg.X, "other");
-	}
-
-	private Reg region = Reg.A;
-
-	public Reg getRegion() {
-		return region;
-	}
-
-	public void setRegion(Reg reg) {
-		region = reg;
-	}
-
-	private String name = "";
-
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String str) {
-		name = str.trim();
-		repaint();
-	}
-	
-	public enum Obj {
-		UNKOBJ, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP,
-		BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, NOTMRK,
-		FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP,
-		LITMAJ, LITMIN, LITFLT, LITVES, LITHSE, LNDMRK,
-		MORFAC, BOYINB, SISTAW, SISTAT, OFSPLF,
-		CGUSTA, PILBOP, RSCSTA, RDOSTA, RADSTA
-	}
-
-	public static final EnumMap<Obj, String> ObjSTR = new EnumMap<>(Obj.class);
-	static {
-		ObjSTR.put(Obj.BCNCAR, "beacon_cardinal");
-		ObjSTR.put(Obj.BCNISD, "beacon_isolated_danger");
-		ObjSTR.put(Obj.BCNLAT, "beacon_lateral");
-		ObjSTR.put(Obj.BCNSAW, "beacon_safe_water");
-		ObjSTR.put(Obj.BCNSPP, "beacon_special_purpose");
-		ObjSTR.put(Obj.BOYCAR, "buoy_cardinal");
-		ObjSTR.put(Obj.BOYISD, "buoy_isolated_danger");
-		ObjSTR.put(Obj.BOYLAT, "buoy_lateral");
-		ObjSTR.put(Obj.BOYSAW, "buoy_safe_water");
-		ObjSTR.put(Obj.BOYSPP, "buoy_special_purpose");
-		ObjSTR.put(Obj.FLTCAR, "light_float");
-		ObjSTR.put(Obj.FLTLAT, "light_float");
-		ObjSTR.put(Obj.FLTSAW, "light_float");
-		ObjSTR.put(Obj.FLTISD, "light_float");
-		ObjSTR.put(Obj.FLTSPP, "light_float");
-		ObjSTR.put(Obj.LITMAJ, "light_major");
-		ObjSTR.put(Obj.LITMIN, "light_minor");
-		ObjSTR.put(Obj.LITFLT, "light_float");
-		ObjSTR.put(Obj.LITVES, "light_vessel");
-		ObjSTR.put(Obj.NOTMRK, "notice");
-		ObjSTR.put(Obj.LNDMRK, "landmark");
-		ObjSTR.put(Obj.LITHSE, "landmark");
-		ObjSTR.put(Obj.MORFAC, "mooring");
-		ObjSTR.put(Obj.BOYINB, "buoy_installation");
-		ObjSTR.put(Obj.OFSPLF, "platform");
-		ObjSTR.put(Obj.SISTAW, "signal_station_warning");
-		ObjSTR.put(Obj.SISTAT, "signal_station_traffic");
-		ObjSTR.put(Obj.CGUSTA, "coastguard_station");
-		ObjSTR.put(Obj.PILBOP, "pilot_boarding");
-		ObjSTR.put(Obj.RSCSTA, "rescue_station");
-		ObjSTR.put(Obj.RDOSTA, "radio_station");
-		ObjSTR.put(Obj.RADSTA, "radar_station");
-	}
-
-	private Obj object = Obj.UNKOBJ;
-
-	public Obj getObject() {
-		return object;
-	}
-
-	public void setObject(Obj obj) {
-		object = obj;
-		if (obj == Obj.UNKOBJ) {
-			setCategory(Cat.NOCAT);
-			setFunc(Fnc.UNKFNC);
-			setShape(Shp.UNKSHP);
-			setColour(Ent.BODY, Col.UNKCOL);
-			setPattern(Ent.BODY, Pat.NOPAT);
-			setTopmark(Top.NOTOP);
-			setColour(Ent.TOPMARK, Col.UNKCOL);
-			setPattern(Ent.TOPMARK, Pat.NOPAT);
-		}
-		repaint();
-	}
-
-	public enum Ent {
-		BODY, BUOY, BEACON, LFLOAT, TOPMARK, LIGHT, MOORING, STATION, PLATFORM, NOTICE
-	}
-
-	public static final EnumMap<Obj, Ent> EntMAP = new EnumMap<>(Obj.class);
-	static {
-		EntMAP.put(Obj.BCNCAR, Ent.BEACON);
-		EntMAP.put(Obj.BCNISD, Ent.BEACON);
-		EntMAP.put(Obj.BCNLAT, Ent.BEACON);
-		EntMAP.put(Obj.BCNSAW, Ent.BEACON);
-		EntMAP.put(Obj.BCNSPP, Ent.BEACON);
-		EntMAP.put(Obj.BOYCAR, Ent.BUOY);
-		EntMAP.put(Obj.BOYISD, Ent.BUOY);
-		EntMAP.put(Obj.BOYLAT, Ent.BUOY);
-		EntMAP.put(Obj.BOYSAW, Ent.BUOY);
-		EntMAP.put(Obj.BOYSPP, Ent.BUOY);
-		EntMAP.put(Obj.LITMAJ, Ent.LIGHT);
-		EntMAP.put(Obj.LITMIN, Ent.LIGHT);
-		EntMAP.put(Obj.LITFLT, Ent.LFLOAT);
-		EntMAP.put(Obj.FLTCAR, Ent.LFLOAT);
-		EntMAP.put(Obj.FLTLAT, Ent.LFLOAT);
-		EntMAP.put(Obj.FLTSAW, Ent.LFLOAT);
-		EntMAP.put(Obj.FLTISD, Ent.LFLOAT);
-		EntMAP.put(Obj.FLTSPP, Ent.LFLOAT);
-		EntMAP.put(Obj.LITVES, Ent.LFLOAT);
-		EntMAP.put(Obj.LITHSE, Ent.LIGHT);
-		EntMAP.put(Obj.LNDMRK, Ent.LIGHT);
-		EntMAP.put(Obj.MORFAC, Ent.MOORING);
-		EntMAP.put(Obj.BOYINB, Ent.MOORING);
-		EntMAP.put(Obj.OFSPLF, Ent.PLATFORM);
-		EntMAP.put(Obj.SISTAW, Ent.STATION);
-		EntMAP.put(Obj.SISTAT, Ent.STATION);
-		EntMAP.put(Obj.CGUSTA, Ent.STATION);
-		EntMAP.put(Obj.PILBOP, Ent.STATION);
-		EntMAP.put(Obj.RSCSTA, Ent.STATION);
-		EntMAP.put(Obj.RDOSTA, Ent.STATION);
-		EntMAP.put(Obj.RADSTA, Ent.STATION);
-		EntMAP.put(Obj.NOTMRK, Ent.NOTICE);
-	}
-
-	public enum Grp {
-		NUL, LAT, CAR, SAW, ISD, SPP, LGT, STN, PLF, NTC
-	}
-
-	public static final EnumMap<Obj, Grp> GrpMAP = new EnumMap<>(Obj.class);
-	static {
-		GrpMAP.put(Obj.UNKOBJ, Grp.NUL);
-		GrpMAP.put(Obj.BCNCAR, Grp.CAR);
-		GrpMAP.put(Obj.BCNISD, Grp.ISD);
-		GrpMAP.put(Obj.BCNLAT, Grp.LAT);
-		GrpMAP.put(Obj.BCNSAW, Grp.SAW);
-		GrpMAP.put(Obj.BCNSPP, Grp.SPP);
-		GrpMAP.put(Obj.BOYCAR, Grp.CAR);
-		GrpMAP.put(Obj.BOYISD, Grp.ISD);
-		GrpMAP.put(Obj.BOYLAT, Grp.LAT);
-		GrpMAP.put(Obj.BOYSAW, Grp.SAW);
-		GrpMAP.put(Obj.BOYSPP, Grp.SPP);
-		GrpMAP.put(Obj.FLTCAR, Grp.CAR);
-		GrpMAP.put(Obj.FLTLAT, Grp.LAT);
-		GrpMAP.put(Obj.FLTSAW, Grp.SAW);
-		GrpMAP.put(Obj.FLTISD, Grp.ISD);
-		GrpMAP.put(Obj.FLTSPP, Grp.SPP);
-		GrpMAP.put(Obj.LITFLT, Grp.LGT);
-		GrpMAP.put(Obj.LITMAJ, Grp.LGT);
-		GrpMAP.put(Obj.LITMIN, Grp.LGT);
-		GrpMAP.put(Obj.LITVES, Grp.LGT);
-		GrpMAP.put(Obj.LITHSE, Grp.LGT);
-		GrpMAP.put(Obj.LNDMRK, Grp.LGT);
-		GrpMAP.put(Obj.MORFAC, Grp.SPP);
-		GrpMAP.put(Obj.BOYINB, Grp.SPP);
-		GrpMAP.put(Obj.OFSPLF, Grp.PLF);
-		GrpMAP.put(Obj.SISTAW, Grp.STN);
-		GrpMAP.put(Obj.SISTAT, Grp.STN);
-		GrpMAP.put(Obj.CGUSTA, Grp.STN);
-		GrpMAP.put(Obj.PILBOP, Grp.STN);
-		GrpMAP.put(Obj.RSCSTA, Grp.STN);
-		GrpMAP.put(Obj.RDOSTA, Grp.STN);
-		GrpMAP.put(Obj.RADSTA, Grp.STN);
-		GrpMAP.put(Obj.NOTMRK, Grp.NTC);
-	}
-
-	public enum Cat {
-		NOCAT, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST,
-		ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM,
-		SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, SPM_MOOR, SPM_LNBY,
-		SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY, SPM_ANCH,
-		MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_ROPE, MOR_AUTO, MOR_BUOY, INB_CALM, INB_SBM,
-		SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC,
-		SIS_DNGR, SIS_OBST, SIS_CABL, SIS_MILY, SIS_DSTR, SIS_WTHR, SIS_STRM, SIS_ICE, SIS_TIME, SIS_TIDE,
-		SIS_TSTM, SIS_TGAG, SIS_TSCL, SIS_DIVE, SIS_LGAG, LIT_DIRF, LIT_LEDG,
-		LMK_CHMY, LMK_CARN, LMK_DSHA, LMK_FLGS, LMK_FLRS, LMK_MNMT, LMK_TOWR, LMK_WNDM, LMK_WTRT, LMK_MNRT,
-		LMK_MAST, LMK_WNDS, LMK_CLMN, LMK_OBLK, LMK_STAT, LMK_CROS, LMK_DOME, LMK_SCNR, LMK_WNDL, LMK_SPIR,
-		OFP_OIL, OFP_PRD, OFP_OBS, OFP_ALP, OFP_SALM, OFP_MOR, OFP_ISL, OFP_FPSO, OFP_ACC, OFP_NCCB,
-		RSC_LFB, RSC_RKT, RSC_RSW, RSC_RIT, RSC_MLB, RSC_RAD, RSC_FAE, RSC_SPL, RSC_AIR, RSC_TUG,
-		RAS_SRV, RAS_CST, PIL_VESS, PIL_HELI, PIL_SHORE,
-		NTC_A1, NTC_A1a, NTC_A2, NTC_A3, NTC_A4, NTC_A4_1, NTC_A5, NTC_A5_1, NTC_A6, NTC_A7, NTC_A8, NTC_A9,
-		NTC_A10a, NTC_A10b, NTC_A12, NTC_A13, NTC_A14, NTC_A15, NTC_A16, NTC_A17, NTC_A18, NTC_A19, NTC_A20,
-		NTC_B1a, NTC_B1b, NTC_B2a, NTC_B2b, NTC_B3a, NTC_B3b, NTC_B4a, NTC_B4b, NTC_B5, NTC_B6, NTC_B7, NTC_B8, NTC_B9a, NTC_B9b, NTC_B11,
-		NTC_C1, NTC_C2, NTC_C3, NTC_C4, NTC_C5a, NTC_C5b, NTC_D1a, NTC_D1b, NTC_D2a, NTC_D2b, NTC_D3a, NTC_D3b,
-		NOROS, ROS_UNKN, ROS_OMNI, ROS_DIRL, ROS_ROTP, ROS_CNSL, ROS_RDF, ROS_QTG, ROS_AERO, ROS_DECA, ROS_LORN, ROS_DGPS, ROS_TORN, ROS_OMGA, ROS_SYLD, ROS_CHKA,
-		ROS_PCOM, ROS_COMB, ROS_FACS, ROS_TIME, ROS_PAIS, ROS_SAIS, ROS_VAIS, ROS_VANC, ROS_VASC, ROS_VAEC, ROS_VAWC, ROS_VAPL, ROS_VASL, ROS_VAID, ROS_VASW, ROS_VASP, ROS_VAWK
-	}
-		 
-	public static final EnumMap<Cat, String> CatSTR = new EnumMap<>(Cat.class);
-	static {
-		CatSTR.put(Cat.LAM_PORT, "port");
-		CatSTR.put(Cat.LAM_STBD, "starboard");
-		CatSTR.put(Cat.LAM_PPORT, "preferred_channel_port");
-		CatSTR.put(Cat.LAM_PSTBD, "preferred_channel_starboard");
-		CatSTR.put(Cat.CAM_NORTH, "north");
-		CatSTR.put(Cat.CAM_EAST, "east");
-		CatSTR.put(Cat.CAM_SOUTH, "south");
-		CatSTR.put(Cat.CAM_WEST, "west");
-		CatSTR.put(Cat.SPM_UNKN, "unknown_purpose");
-		CatSTR.put(Cat.SPM_WARN, "warning");
-		CatSTR.put(Cat.SPM_CHBF, "channel_separation");
-		CatSTR.put(Cat.SPM_YCHT, "yachting");
-		CatSTR.put(Cat.SPM_CABL, "cable");
-		CatSTR.put(Cat.SPM_OFAL, "outfall");
-		CatSTR.put(Cat.SPM_ODAS, "odas");
-		CatSTR.put(Cat.SPM_RECN, "recreation_zone");
-		CatSTR.put(Cat.SPM_MOOR, "mooring");
-		CatSTR.put(Cat.SPM_LNBY, "lanby");
-		CatSTR.put(Cat.SPM_LDNG, "leading");
-		CatSTR.put(Cat.SPM_NOTC, "notice");
-		CatSTR.put(Cat.SPM_TSS, "tss");
-		CatSTR.put(Cat.SPM_FOUL, "foul_ground");
-		CatSTR.put(Cat.SPM_DIVE, "diving");
-		CatSTR.put(Cat.SPM_FRRY, "ferry_crossing");
-		CatSTR.put(Cat.SPM_ANCH, "anchorage");
-		CatSTR.put(Cat.MOR_DLPN, "dolphin");
-		CatSTR.put(Cat.MOR_DDPN, "deviation_dolphin");
-		CatSTR.put(Cat.MOR_BLRD, "bollard");
-		CatSTR.put(Cat.MOR_WALL, "wall");
-		CatSTR.put(Cat.MOR_POST, "post");
-		CatSTR.put(Cat.MOR_CHWR, "chain");
-		CatSTR.put(Cat.MOR_ROPE, "shore_rope");
-		CatSTR.put(Cat.MOR_AUTO, "automatic");
-		CatSTR.put(Cat.MOR_BUOY, "buoy");
-		CatSTR.put(Cat.INB_CALM, "calm");
-		CatSTR.put(Cat.INB_SBM, "sbm");
-		CatSTR.put(Cat.SIS_PTCL, "port_control");
-		CatSTR.put(Cat.SIS_PTED, "port_entry");
-		CatSTR.put(Cat.SIS_IPT, "ipt");
-		CatSTR.put(Cat.SIS_BRTH, "berthing");
-		CatSTR.put(Cat.SIS_DOCK, "dock");
-		CatSTR.put(Cat.SIS_LOCK, "lock");
-		CatSTR.put(Cat.SIS_FBAR, "barrage");
-		CatSTR.put(Cat.SIS_BRDG, "bridge");
-		CatSTR.put(Cat.SIS_DRDG, "dredging");
-		CatSTR.put(Cat.SIS_TRFC, "traffic");
-		CatSTR.put(Cat.SIS_DNGR, "danger");
-		CatSTR.put(Cat.SIS_OBST, "obstruction");
-		CatSTR.put(Cat.SIS_CABL, "cable");
-		CatSTR.put(Cat.SIS_MILY, "military");
-		CatSTR.put(Cat.SIS_DSTR, "distress");
-		CatSTR.put(Cat.SIS_WTHR, "weather");
-		CatSTR.put(Cat.SIS_STRM, "storm");
-		CatSTR.put(Cat.SIS_ICE, "ice");
-		CatSTR.put(Cat.SIS_TIME, "time");
-		CatSTR.put(Cat.SIS_TIDE, "tide");
-		CatSTR.put(Cat.SIS_TSTM, "stream");
-		CatSTR.put(Cat.SIS_TGAG, "gauge");
-		CatSTR.put(Cat.SIS_TSCL, "scale");
-		CatSTR.put(Cat.SIS_DIVE, "diving");
-		CatSTR.put(Cat.SIS_LGAG, "level");
-		CatSTR.put(Cat.LMK_CHMY, "chimney");
-		CatSTR.put(Cat.LMK_CARN, "cairn");
-		CatSTR.put(Cat.LMK_DSHA, "dish_aerial");
-		CatSTR.put(Cat.LMK_FLGS, "flagstaff");
-		CatSTR.put(Cat.LMK_FLRS, "flare_stack");
-		CatSTR.put(Cat.LMK_MNMT, "monument");
-		CatSTR.put(Cat.LMK_TOWR, "tower");
-		CatSTR.put(Cat.LMK_WNDM, "windmotor");
-		CatSTR.put(Cat.LMK_WTRT, "water_tower");
-		CatSTR.put(Cat.LMK_MAST, "mast");
-		CatSTR.put(Cat.LMK_WNDS, "windsock");
-		CatSTR.put(Cat.LMK_CLMN, "column");
-		CatSTR.put(Cat.LMK_OBLK, "obelisk");
-		CatSTR.put(Cat.LMK_STAT, "statue");
-		CatSTR.put(Cat.LMK_CROS, "cross");
-		CatSTR.put(Cat.LMK_DOME, "dome");
-		CatSTR.put(Cat.LMK_SCNR, "radar_scanner");
-		CatSTR.put(Cat.LMK_WNDL, "windmill");
-		CatSTR.put(Cat.LMK_SPIR, "spire");
-		CatSTR.put(Cat.LMK_MNRT, "minaret");
-		CatSTR.put(Cat.OFP_OIL, "oil");
-		CatSTR.put(Cat.OFP_PRD,  "production");
-		CatSTR.put(Cat.OFP_OBS, "observation"); 
-		CatSTR.put(Cat.OFP_ALP, "alp");
-		CatSTR.put(Cat.OFP_SALM, "salm");
-		CatSTR.put(Cat.OFP_MOR, "mooring");
-		CatSTR.put(Cat.OFP_ISL, "island");
-		CatSTR.put(Cat.OFP_FPSO, "fpso");
-		CatSTR.put(Cat.OFP_ACC, "accommodation");
-		CatSTR.put(Cat.OFP_NCCB, "nccb");
-		CatSTR.put(Cat.PIL_VESS, "cruising_vessel");
-		CatSTR.put(Cat.PIL_HELI, "helicopter");
-		CatSTR.put(Cat.PIL_SHORE, "from_shore");
-		CatSTR.put(Cat.RSC_LFB, "lifeboat");
-		CatSTR.put(Cat.RSC_RKT, "rocket");
-		CatSTR.put(Cat.RSC_RSW, "refuge_shipwrecked");
-		CatSTR.put(Cat.RSC_RIT, "refuge_intertidal");
-		CatSTR.put(Cat.RSC_MLB, "lifeboat_moored");
-		CatSTR.put(Cat.RSC_RAD, "radio");
-		CatSTR.put(Cat.RSC_FAE, "firstaid");
-		CatSTR.put(Cat.RSC_SPL, "seaplane");
-		CatSTR.put(Cat.RSC_AIR, "aircraft");
-		CatSTR.put(Cat.RSC_TUG, "tug");
-		CatSTR.put(Cat.RAS_SRV, "surveillance");
-		CatSTR.put(Cat.RAS_CST, "coast");
-		CatSTR.put(Cat.ROS_OMNI, "omnidirectional");
-		CatSTR.put(Cat.ROS_DIRL, "directional");
-		CatSTR.put(Cat.ROS_ROTP, "rotating_pattern");
-		CatSTR.put(Cat.ROS_CNSL, "consol");
-		CatSTR.put(Cat.ROS_RDF, "rdf");
-		CatSTR.put(Cat.ROS_QTG, "qtg");
-		CatSTR.put(Cat.ROS_AERO, "aeronautical");
-		CatSTR.put(Cat.ROS_DECA, "decca");
-		CatSTR.put(Cat.ROS_LORN, "loran");
-		CatSTR.put(Cat.ROS_DGPS, "dgps");
-		CatSTR.put(Cat.ROS_TORN, "toran");
-		CatSTR.put(Cat.ROS_OMGA, "omega");
-		CatSTR.put(Cat.ROS_SYLD, "syledis");
-		CatSTR.put(Cat.ROS_CHKA, "chiaka");
-		CatSTR.put(Cat.ROS_PCOM, "public_communication");
-		CatSTR.put(Cat.ROS_COMB, "commercial_broadcast");
-		CatSTR.put(Cat.ROS_FACS, "facsimile");
-		CatSTR.put(Cat.ROS_TIME, "time_signal");
-		CatSTR.put(Cat.ROS_PAIS, "ais");
-		CatSTR.put(Cat.ROS_SAIS, "s-ais");
-		CatSTR.put(Cat.ROS_VAIS, "v-ais");
-		CatSTR.put(Cat.ROS_VANC, "v-ais_north_cardinal");
-		CatSTR.put(Cat.ROS_VASC, "v-ais_south_cardinal");
-		CatSTR.put(Cat.ROS_VAEC, "v-ais_east_cardinal");
-		CatSTR.put(Cat.ROS_VAWC, "v-ais_west_cardinal");
-		CatSTR.put(Cat.ROS_VAPL, "v-ais_port_lateral");
-		CatSTR.put(Cat.ROS_VASL, "v-ais_starboard_lateral");
-		CatSTR.put(Cat.ROS_VAID, "v-ais_isolated_danger");
-		CatSTR.put(Cat.ROS_VASW, "v-ais_safe_water");
-		CatSTR.put(Cat.ROS_VASP, "v-ais_special_purpose");
-		CatSTR.put(Cat.ROS_VAWK, "v-ais_wreck"); 
-		CatSTR.put(Cat.NTC_A1, "no_entry");
-		CatSTR.put(Cat.NTC_A1a, "closed_area");
-		CatSTR.put(Cat.NTC_A2, "no_overtaking");
-		CatSTR.put(Cat.NTC_A3, "no_convoy_overtaking");
-		CatSTR.put(Cat.NTC_A4, "no_passing");
-		CatSTR.put(Cat.NTC_A4, "no_convoy_passing");
-		CatSTR.put(Cat.NTC_A5, "no_berthing");
-		CatSTR.put(Cat.NTC_A5_1, "no_berthing_lateral_limit");
-		CatSTR.put(Cat.NTC_A6, "no_anchoring");
-		CatSTR.put(Cat.NTC_A7, "no_mooring");
-		CatSTR.put(Cat.NTC_A8, "no_turning");
-		CatSTR.put(Cat.NTC_A9, "no_wash");
-		CatSTR.put(Cat.NTC_A10a, "no_passage_left");
-		CatSTR.put(Cat.NTC_A10b, "no_passage_right");
-		CatSTR.put(Cat.NTC_A12, "no_motor_craft");
-		CatSTR.put(Cat.NTC_A13, "no_sport_craft");
-		CatSTR.put(Cat.NTC_A14, "no_waterskiing");
-		CatSTR.put(Cat.NTC_A15, "no_sailing_craft");
-		CatSTR.put(Cat.NTC_A16, "no_unpowered_craft");
-		CatSTR.put(Cat.NTC_A17, "no_sailboards");
-		CatSTR.put(Cat.NTC_A18, "no_high_speeds");
-		CatSTR.put(Cat.NTC_A19, "no_launching_beaching");
-		CatSTR.put(Cat.NTC_A20, "no_waterbikes");
-		CatSTR.put(Cat.NTC_B1a, "");
-		CatSTR.put(Cat.NTC_B1b, "");
-		CatSTR.put(Cat.NTC_B2a, "");
-		CatSTR.put(Cat.NTC_B2a, "");
-		CatSTR.put(Cat.NTC_B3a, "");
-		CatSTR.put(Cat.NTC_B3a, "");
-		CatSTR.put(Cat.NTC_B4a, "");
-		CatSTR.put(Cat.NTC_B4a, "");
-		CatSTR.put(Cat.NTC_B5, "");
-		CatSTR.put(Cat.NTC_B6, "");
-		CatSTR.put(Cat.NTC_B7, "");
-		CatSTR.put(Cat.NTC_B8, "");
-		CatSTR.put(Cat.NTC_B9a, "");
-		CatSTR.put(Cat.NTC_B9b, "");
-		CatSTR.put(Cat.NTC_B11, "");
-		CatSTR.put(Cat.NTC_C1, "");
-		CatSTR.put(Cat.NTC_C2, "");
-		CatSTR.put(Cat.NTC_C3, "");
-		CatSTR.put(Cat.NTC_C4, "");
-		CatSTR.put(Cat.NTC_C5a, "");
-		CatSTR.put(Cat.NTC_C5b, "");
-		CatSTR.put(Cat.NTC_D1a, "");
-		CatSTR.put(Cat.NTC_D1b, "");
-		CatSTR.put(Cat.NTC_D2a, "");
-		CatSTR.put(Cat.NTC_D2b, "");
-		CatSTR.put(Cat.NTC_D3a, "");
-		CatSTR.put(Cat.NTC_D3b, "");
-	}
-
-	private Cat category = Cat.NOCAT;
-
-	public Cat getCategory() {
-		return category;
-	}
-
-	public void setCategory(Cat cat) {
-		category = cat;
-		repaint();
-	}
-
-	public enum Shp {
-		UNKSHP, PILLAR, SPAR, CAN, CONI, SPHERI, BARREL, FLOAT, SUPER, BUOYANT, CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON
-	}
-
-	public static final EnumMap<Shp, String> ShpSTR = new EnumMap<>(Shp.class);
-	static {
-		ShpSTR.put(Shp.PILLAR, "pillar");
-		ShpSTR.put(Shp.SPAR, "spar");
-		ShpSTR.put(Shp.CAN, "can");
-		ShpSTR.put(Shp.CONI, "conical");
-		ShpSTR.put(Shp.SPHERI, "spherical");
-		ShpSTR.put(Shp.BARREL, "barrel");
-		ShpSTR.put(Shp.FLOAT, "float");
-		ShpSTR.put(Shp.SUPER, "super-buoy");
-		ShpSTR.put(Shp.BUOYANT, "buoyant");
-		ShpSTR.put(Shp.CAIRN, "cairn");
-		ShpSTR.put(Shp.PILE, "pile");
-		ShpSTR.put(Shp.LATTICE, "lattice");
-		ShpSTR.put(Shp.TOWER, "tower");
-		ShpSTR.put(Shp.STAKE, "stake");
-		ShpSTR.put(Shp.PERCH, "perch");
-	}
-
-	private Shp shape = Shp.UNKSHP;
-
-	public Shp getShape() {
-		return shape;
-	}
-
-	public void setShape(Shp shp) {
-		shape = shp;
-		repaint();
-	}
-
-	public enum Col {
-		UNKCOL, BLANK, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, GREY, BROWN, MAGENTA, PINK
-	}
-
-	public static final EnumMap<Col, Color> ColMAP = new EnumMap<>(Col.class);
-	static {
-		ColMAP.put(Col.UNKCOL, new Color(0xc0c0c0));
-		ColMAP.put(Col.WHITE, Color.WHITE);
-		ColMAP.put(Col.RED, Color.RED);
-		ColMAP.put(Col.ORANGE, Color.ORANGE);
-		ColMAP.put(Col.AMBER, new Color(0xfbf00f));
-		ColMAP.put(Col.YELLOW, Color.YELLOW);
-		ColMAP.put(Col.GREEN, Color.GREEN);
-		ColMAP.put(Col.BLUE, Color.BLUE);
-		ColMAP.put(Col.VIOLET, new Color(0x8f00ff));
-		ColMAP.put(Col.BLACK, Color.BLACK);
-		ColMAP.put(Col.GREY, Color.GRAY);
-		ColMAP.put(Col.BROWN, new Color(0xa45a58));
-		ColMAP.put(Col.MAGENTA, Color.MAGENTA);
-		ColMAP.put(Col.PINK, Color.PINK);
-	}
-
-	public static final EnumMap<Col, String> ColSTR = new EnumMap<>(Col.class);
-	static {
-		ColSTR.put(Col.WHITE, "white");
-		ColSTR.put(Col.RED, "red");
-		ColSTR.put(Col.ORANGE, "orange");
-		ColSTR.put(Col.AMBER, "amber");
-		ColSTR.put(Col.YELLOW, "yellow");
-		ColSTR.put(Col.GREEN, "green");
-		ColSTR.put(Col.BLUE, "blue");
-		ColSTR.put(Col.VIOLET, "violet");
-		ColSTR.put(Col.BLACK, "black");
-		ColSTR.put(Col.GREY, "grey");
-		ColSTR.put(Col.BROWN, "brown");
-		ColSTR.put(Col.MAGENTA, "magenta");
-		ColSTR.put(Col.PINK, "pink");
-	}
-
-	public Col getColour(Ent ent, int idx) {
-		if (ent == Ent.BODY)
-			return getObjColour(idx);
-		else
-			return getTopColour(idx);
-	}
-
-	public void setColour(Ent ent, Col col) {
-		if (ent == Ent.BODY)
-			setObjColour(col);
-		else
-			setTopColour(col);
-	}
-
-	public void setColour(Ent ent, int idx, Col col) {
-		if (ent == Ent.BODY)
-			setObjColour(idx, col);
-		else
-			setTopColour(idx, col);
-	}
-
-	public void addColour(Ent ent, int idx, Col col) {
-		if (ent == Ent.BODY)
-			addObjColour(idx, col);
-		else
-			addTopColour(idx, col);
-	}
-
-	public void subColour(Ent ent, int idx) {
-		if (ent == Ent.BODY)
-			subObjColour(idx);
-		else
-			subTopColour(idx);
-	}
-
-	private ArrayList<Col> bodyColour = new ArrayList<>();
-
-	public Col getObjColour(int i) {
-		if (i < bodyColour.size())
-			return bodyColour.get(i);
-		else
-			return Col.UNKCOL;
-	}
-
-	public void setObjColour(Col col) {
-		bodyColour.clear();
-		bodyColour.add(col);
-		repaint();
-	}
-
-	public void setObjColour(int i, Col col) {
-		if (i < bodyColour.size())
-			bodyColour.set(i, col);
-		repaint();
-	}
-
-	public void addObjColour(int i, Col col) {
-		if (bodyColour.size() >= i)
-			bodyColour.add(i, col);
-		repaint();
-	}
-
-	public void addObjColour(Col col) {
-		bodyColour.add(col);
-		repaint();
-	}
-
-	public void subObjColour(int i) {
-		if (bodyColour.size() > i)
-			bodyColour.remove(i);
-		repaint();
-	}
-
-	private ArrayList<Col> topmarkColour = new ArrayList<>();
-
-	public Col getTopColour(int i) {
-		if (i < topmarkColour.size())
-			return topmarkColour.get(i);
-		else
-			return Col.UNKCOL;
-	}
-
-	public void setTopColour(Col col) {
-		topmarkColour.clear();
-		topmarkColour.add(col);
-		repaint();
-	}
-
-	public void setTopColour(int i, Col col) {
-		if (topmarkColour.size() > i)
-			topmarkColour.set(i, col);
-		repaint();
-	}
-
-	public void addTopColour(int i, Col col) {
-		if (topmarkColour.size() >= i)
-			topmarkColour.add(i, col);
-		repaint();
-	}
-
-	public void addTopColour(Col col) {
-		topmarkColour.add(col);
-		repaint();
-	}
-
-	public void subTopColour(int i) {
-		if (topmarkColour.size() > i)
-			topmarkColour.remove(i);
-		repaint();
-	}
-
-	public enum Chr {
-		UNKCHR, FIXED, FLASH, LFLASH, QUICK, VQUICK, UQUICK, ISOPHASED, OCCULTING, MORSE, ALTERNATING, IQUICK, IVQUICK, IUQUICK
-	}
-
-	public static final Map<EnumSet<Chr>, String> ChrMAP = new HashMap<>();
-	static {
-		ChrMAP.put(EnumSet.of(Chr.FIXED), "F");
-		ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl");
-		ChrMAP.put(EnumSet.of(Chr.LFLASH), "LFl");
-		ChrMAP.put(EnumSet.of(Chr.QUICK), "Q");
-		ChrMAP.put(EnumSet.of(Chr.VQUICK), "VQ");
-		ChrMAP.put(EnumSet.of(Chr.UQUICK), "UQ");
-		ChrMAP.put(EnumSet.of(Chr.ISOPHASED), "Iso");
-		ChrMAP.put(EnumSet.of(Chr.OCCULTING), "Oc");
-		ChrMAP.put(EnumSet.of(Chr.IQUICK), "IQ");
-		ChrMAP.put(EnumSet.of(Chr.IVQUICK), "IVQ");
-		ChrMAP.put(EnumSet.of(Chr.IUQUICK), "IUQ");
-		ChrMAP.put(EnumSet.of(Chr.MORSE), "Mo");
-		ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.FLASH), "FFl");
-		ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LFLASH), "FlLFl");
-		ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.OCCULTING), "FOc");
-		ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LFLASH), "FLFl");
-		ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl");
-		ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LFLASH), "Q+LFl");
-		ChrMAP.put(EnumSet.of(Chr.VQUICK, Chr.LFLASH), "VQ+LFl");
-		ChrMAP.put(EnumSet.of(Chr.UQUICK, Chr.LFLASH), "UQ+LFl");
-		ChrMAP.put(EnumSet.of(Chr.ALTERNATING), "Al");
-		ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc");
-		ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LFLASH), "Al.LFl");
-		ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl");
-		ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED), "Al.F");
-		ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "Al.FFl");
-		ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso");
-	}
-
-	public enum Vis {
-		UNKVIS, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS
-	}
-
-	public static final EnumMap<Vis, String> VisSTR = new EnumMap<>(Vis.class);
-	static {
-		VisSTR.put(Vis.HIGH, "high");
-		VisSTR.put(Vis.LOW, "low");
-		VisSTR.put(Vis.FAINT, "faint");
-		VisSTR.put(Vis.INTEN, "intensified");
-		VisSTR.put(Vis.UNINTEN, "unintensified");
-		VisSTR.put(Vis.REST, "restricted");
-		VisSTR.put(Vis.OBS, "obscured");
-		VisSTR.put(Vis.PARTOBS, "part_obscured");
-	}
-
-	public enum Lit {
-		UNKLIT, VERT, HORIZ, DIR, UPPER, LOWER, LEAD, REAR, FRONT, AERO, AIROBS, FOGDET, FLOOD, STRIP, SUBS, SPOT, MOIRE, EMERG, BEAR
-	}
-
-	public static final EnumMap<Lit, String> LitSTR = new EnumMap<>(Lit.class);
-	static {
-		LitSTR.put(Lit.VERT, "vertical");
-		LitSTR.put(Lit.HORIZ, "horizontal");
-		LitSTR.put(Lit.DIR, "directional");
-		LitSTR.put(Lit.UPPER, "upper");
-		LitSTR.put(Lit.LOWER, "lower");
-		LitSTR.put(Lit.LEAD, "leading");
-		LitSTR.put(Lit.REAR, "rear");
-		LitSTR.put(Lit.FRONT, "front");
-		LitSTR.put(Lit.AERO, "aero");
-		LitSTR.put(Lit.AIROBS, "air_obstruction");
-		LitSTR.put(Lit.FOGDET, "fog_detector");
-		LitSTR.put(Lit.FLOOD, "floodlight");
-		LitSTR.put(Lit.STRIP, "striplight");
-		LitSTR.put(Lit.SUBS, "subsidairy");
-		LitSTR.put(Lit.SPOT, "spotlight");
-		LitSTR.put(Lit.MOIRE, "moire");
-		LitSTR.put(Lit.EMERG, "emergency");
-		LitSTR.put(Lit.BEAR, "bearing");
-	}
-
-	public enum Exh {
-		UNKEXH, H24, DAY, NIGHT, FOG, WARN, STORM
-	}
-
-	public static final EnumMap<Exh, String> ExhSTR = new EnumMap<>(Exh.class);
-	static {
-		ExhSTR.put(Exh.H24, "24h");
-		ExhSTR.put(Exh.DAY, "day");
-		ExhSTR.put(Exh.NIGHT, "night");
-		ExhSTR.put(Exh.FOG, "fog");
-		ExhSTR.put(Exh.WARN, "warning");
-		ExhSTR.put(Exh.STORM, "storm");
-	}
-
-	public enum Att {
-		COL, CHR, GRP, SEQ, PER, LIT, BEG, END, RAD, HGT, RNG, VIS, EXH, ORT, MLT, ALT
-	}
-
-	public Object[] sector = { Col.UNKCOL, "", "", "", "", Lit.UNKLIT, "", "",
-			"", "", "", Vis.UNKVIS, Exh.UNKEXH, "", "", Col.UNKCOL };
-
-	private ArrayList<Object[]> sectors = new ArrayList<>();
-
-	public int getSectorCount() {
-		return sectors.size();
-	}
-
-	public boolean isSectored() {
-		return (sectors.size() > 1);
-	}
-
-	public Object getLightAtt(Att att, int i) {
-		return getLightAtt(att.ordinal(), i);
-	}
-
-	public Object getLightAtt(int att, int i) {
-		if (i < sectors.size())
-			return sectors.get(i)[att];
-		else
-			return null;
-	}
-
-	public void setLightAtt(Att att, int i, Object obj) {
-		setLightAtt(att.ordinal(), i, obj);
-	}
-
-	public void setLightAtt(int att, int i, Object obj) {
-		if (sectors.size() == i)
-			addLight(i);
-		if (sectors.size() > i)
-			switch (att) {
-			case 4:
-			case 8:
-			case 9:
-			case 10:
-				sectors.get(i)[att] = validDecimal((String)obj);
-				break;
-			case 6:
-			case 7:
-			case 13:
-				sectors.get(i)[att] = validDecimal((String)obj, 360);
-				break;
-			default:
-				sectors.get(i)[att] = obj;
-			}
-		repaint();
-	}
-
-	public void addLight(int i) {
-		if (sectors.size() >= i) {
-			if (sectors.size() == 0)
-				sectors.add(sector.clone());
-			else
-				sectors.add(i, sectors.get(0).clone());
-		}
-	}
-
-	public void nulLight(int i) {
-		if (i == 0) {
-			clrLight();
-		} else {
-			sectors.add(i, sector.clone());
-		}
-	}
-
-	public void addLight() {
-		if (sectors.size() == 0)
-			sectors.add(sector.clone());
-		else
-			sectors.add(sectors.get(0).clone());
-	}
-
-	public void delLight(int i) {
-		if (sectors.size() > i)
-			sectors.remove(i);
-		repaint();
-	}
-
-	public void clrLight() {
-		sectors.clear();
-		addLight();
-		setLightRef("");
-		repaint();
-	}
-
-	public enum Pat {
-		NOPAT, HSTRP, VSTRP, DIAG, SQUARED, BORDER, CROSS, SALTIRE
-	}
-
-	public static final EnumMap<Pat, String> PatSTR = new EnumMap<>(Pat.class);
-	static {
-		PatSTR.put(Pat.HSTRP, "horizontal");
-		PatSTR.put(Pat.VSTRP, "vertical");
-		PatSTR.put(Pat.DIAG, "diagonal");
-		PatSTR.put(Pat.SQUARED, "squared");
-		PatSTR.put(Pat.BORDER, "border");
-		PatSTR.put(Pat.CROSS, "cross");
-		PatSTR.put(Pat.SALTIRE, "saltire");
-	}
-
-	public Pat getPattern(Ent ent) {
-		if (ent == Ent.BODY)
-			return getObjPattern();
-		else
-			return getTopPattern();
-	}
-
-	public void setPattern(Ent ent, Pat pat) {
-		if (ent == Ent.BODY)
-			setObjPattern(pat);
-		else
-			setTopPattern(pat);
-	}
-
-	private Pat bodyPattern = Pat.NOPAT;
-
-	public Pat getObjPattern() {
-		return bodyPattern;
-	}
-
-	public void setObjPattern(Pat pat) {
-		bodyPattern = pat;
-	}
-
-	private Pat topPattern = Pat.NOPAT;
-
-	public Pat getTopPattern() {
-		return topPattern;
-	}
-
-	public void setTopPattern(Pat pat) {
-		topPattern = pat;
-	}
-
-	public enum Top {
-		NOTOP, CYL, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2, BOARD, RHOMBUS, CIRCLE, TRIANGLE, TRIANGLE_INV, SQUARE
-	}
-
-	public static final EnumMap<Top, String> TopSTR = new EnumMap<>(Top.class);
-	static {
-		TopSTR.put(Top.CYL, "cylinder");
-		TopSTR.put(Top.CONE, "cone, point up");
-		TopSTR.put(Top.SPHERE, "sphere");
-		TopSTR.put(Top.X_SHAPE, "x-shape");
-		TopSTR.put(Top.NORTH, "2 cones up");
-		TopSTR.put(Top.SOUTH, "2 cones down");
-		TopSTR.put(Top.EAST, "2 cones base together");
-		TopSTR.put(Top.WEST, "2 cones point together");
-		TopSTR.put(Top.SPHERES2, "2 spheres");
-		TopSTR.put(Top.BOARD, "board");
-		TopSTR.put(Top.RHOMBUS, "rhombus");
-		TopSTR.put(Top.CIRCLE, "circle");
-		TopSTR.put(Top.TRIANGLE, "triangle, point up");
-		TopSTR.put(Top.TRIANGLE_INV, "triangle, point down");
-		TopSTR.put(Top.SQUARE, "square");
-	}
-
-	private Top topShape = Top.NOTOP;
-
-	public Top getTopmark() {
-		return topShape;
-	}
-
-	public void setTopmark(Top top) {
-		topShape = top;
-		repaint();
-	}
-
-	private Cat RoType = Cat.NOROS;
-
-	public Cat getRadio() {
-		return RoType;
-	}
-
-	public void setRadio(Cat type) {
-		RoType = type;
-		repaint();
-	}
-
-	public enum Rtb {
-		NORTB, REFLECTOR, RACON, RAMARK, LEADING
-	}
-
-	public static final EnumMap<Rtb, String> RtbSTR = new EnumMap<>(Rtb.class);
-	static {
-		RtbSTR.put(Rtb.RACON, "racon");
-		RtbSTR.put(Rtb.RAMARK, "ramark");
-		RtbSTR.put(Rtb.LEADING, "leading");
-	}
-
-	private Rtb RaType = Rtb.NORTB;
-
-	public Rtb getRadar() {
-		return RaType;
-	}
-
-	public void setRadar(Rtb type) {
-		RaType = type;
-		if (type == Rtb.NORTB) {
-			setRaconGroup("");
-			setRaconSequence("");
-			setRaconPeriod("");
-			setRaconRange("");
-			setRaconSector1("");
-			setRaconSector2("");
-		}
-		repaint();
-	}
-
-	private String raconGroup = "";
-
-	public String getRaconGroup() {
-		return raconGroup;
-	}
-
-	public void setRaconGroup(String grp) {
-		raconGroup = grp;
-		repaint();
-	}
-
-	private String raconSequence = "";
-
-	public String getRaconSequence() {
-		return raconSequence;
-	}
-
-	public void setRaconSequence(String seq) {
-		raconSequence = seq;
-		repaint();
-	}
-
-	private String raconPeriod = "";
-
-	public String getRaconPeriod() {
-		return raconPeriod;
-	}
-
-	public void setRaconPeriod(String per) {
-		raconPeriod = validDecimal(per);
-		repaint();
-	}
-
-	private String raconRange = "";
-
-	public String getRaconRange() {
-		return raconRange;
-	}
-
-	public void setRaconRange(String rng) {
-		raconRange = validDecimal(rng);
-		repaint();
-	}
-
-	private String raconSector1 = "";
-
-	public String getRaconSector1() {
-		return raconSector1;
-	}
-
-	public void setRaconSector1(String sec) {
-		raconSector1 = validDecimal(sec);
-		repaint();
-	}
-
-	private String raconSector2 = "";
-
-	public String getRaconSector2() {
-		return raconSector2;
-	}
-
-	public void setRaconSector2(String sec) {
-		raconSector2 = validDecimal(sec);
-		repaint();
-	}
-
-	public enum Fog {
-		NOFOG, FOGSIG, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS
-	}
-
-	public static final EnumMap<Fog, String> FogSTR = new EnumMap<>(Fog.class);
-	static {
-		FogSTR.put(Fog.FOGSIG, "yes");
-		FogSTR.put(Fog.HORN, "horn");
-		FogSTR.put(Fog.SIREN, "siren");
-		FogSTR.put(Fog.DIA, "diaphone");
-		FogSTR.put(Fog.BELL, "bell");
-		FogSTR.put(Fog.WHIS, "whistle");
-		FogSTR.put(Fog.GONG, "gong");
-		FogSTR.put(Fog.EXPLOS, "explosion");
-	}
-
-	private Fog fogSound = Fog.NOFOG;
-
-	public Fog getFogSound() {
-		return fogSound;
-	}
-
-	public void setFogSound(Fog sound) {
-		fogSound = sound;
-		if (sound == Fog.NOFOG) {
-			setFogGroup("");
-			setFogSequence("");
-			setFogPeriod("");
-			setFogRange("");
-		}
-		repaint();
-	}
-
-	private String fogGroup = "";
-
-	public String getFogGroup() {
-		return fogGroup;
-	}
-
-	public void setFogGroup(String grp) {
-		fogGroup = grp;
-		repaint();
-	}
-
-	private String fogSequence = "";
-
-	public String getFogSequence() {
-		return fogSequence;
-	}
-
-	public void setFogSequence(String seq) {
-		fogSequence = seq;
-		repaint();
-	}
-
-	private String fogRange = "";
-
-	public String getFogRange() {
-		return fogRange;
-	}
-
-	public void setFogRange(String rng) {
-		fogRange = validDecimal(rng);
-		repaint();
-	}
-
-	private String fogPeriod = "";
-
-	public String getFogPeriod() {
-		return fogPeriod;
-	}
-
-	public void setFogPeriod(String per) {
-		fogPeriod = validDecimal(per);
-		repaint();
-	}
-
-	public enum Sts {
-		UNKSTS, PERM, OCC, REC, NIU, INT, RESV, TEMP, PRIV, MAND, DEST, EXT, ILLUM, HIST, PUB, SYNC, WATCH, UNWAT, DOUBT
-	}
-
-	public static final EnumMap<Sts, String> StsSTR = new EnumMap<>(Sts.class);
-	static {
-		StsSTR.put(Sts.PERM, "permanent");
-		StsSTR.put(Sts.OCC, "occasional");
-		StsSTR.put(Sts.REC, "recommended");
-		StsSTR.put(Sts.NIU, "not_in_use");
-		StsSTR.put(Sts.INT, "intermittent");
-		StsSTR.put(Sts.RESV, "reserved");
-		StsSTR.put(Sts.TEMP, "tempory");
-		StsSTR.put(Sts.PRIV, "private");
-		StsSTR.put(Sts.MAND, "mandatory");
-		StsSTR.put(Sts.DEST, "destroyed");
-		StsSTR.put(Sts.EXT, "extinguished");
-		StsSTR.put(Sts.ILLUM, "illuminated");
-		StsSTR.put(Sts.HIST, "historic");
-		StsSTR.put(Sts.PUB, "public");
-		StsSTR.put(Sts.SYNC, "synchronized");
-		StsSTR.put(Sts.WATCH, "watched");
-		StsSTR.put(Sts.UNWAT, "unwatched");
-		StsSTR.put(Sts.DOUBT, "existence_doubtful");
-	}
-
-	private Sts status = Sts.UNKSTS;
-
-	public Sts getStatus() {
-		return status;
-	}
-
-	public void setStatus(Sts sts) {
-		status = sts;
-	}
-
-	public enum Cns {
-		UNKCNS, BRICK, CONC, BOULD, HSURF, USURF, WOOD, METAL, GLAS, PAINT
-	}
-
-	public static final EnumMap<Cns, String> CnsSTR = new EnumMap<>(Cns.class);
-	static {
-		CnsSTR.put(Cns.BRICK, "masonry");
-		CnsSTR.put(Cns.CONC, "concreted");
-		CnsSTR.put(Cns.BOULD, "boulders");
-		CnsSTR.put(Cns.HSURF, "hard_surfaced");
-		CnsSTR.put(Cns.USURF, "unsurfaced");
-		CnsSTR.put(Cns.WOOD, "wooden");
-		CnsSTR.put(Cns.METAL, "metal");
-		CnsSTR.put(Cns.GLAS, "grp");
-		CnsSTR.put(Cns.PAINT, "painted");
-	}
-
-	private Cns construction = Cns.UNKCNS;
-
-	public Cns getConstr() {
-		return construction;
-	}
-
-	public void setConstr(Cns cns) {
-		construction = cns;
-	}
-
-	public enum Con {
-		UNKCON, CONSP, NCONS, REFL
-	}
-
-	public static final EnumMap<Con, String> ConSTR = new EnumMap<>(Con.class);
-	static {
-		ConSTR.put(Con.CONSP, "conspicuous");
-		ConSTR.put(Con.NCONS, "not_conspicuous");
-		ConSTR.put(Con.REFL, "reflector");
-	}
-
-	private Con conspicuity = Con.UNKCON;
-
-	public Con getConsp() {
-		return conspicuity;
-	}
-
-	public void setConsp(Con con) {
-		conspicuity = con;
-	}
-
-	private Con reflectivity = Con.UNKCON;
-
-	public Con getRefl() {
-		return reflectivity;
-	}
-
-	public void setRefl(Con con) {
-		reflectivity = con;
-	}
-
-	public enum Fnc {
-	  UNKFNC, HMO, CSTM, HLTH, HOSP, POFF, HOTEL, RWSTA, POLICE, WPOL, PILO, PILL, BANK, DCHQ, TRNS, FACT, PWRS, ADMIN, EDUC, CHCH, CHPL,
-	  TMPL, PGDA, SHSH, BTMP, MOSQ, MRBT, LOOK, COMS, TV, RADO, RADR, LSUP, MWAV, COOL, OBSV, TIMB, CLK, CTRL, AMOR, STAD, BUSS,
-	  PRHB, RGLN, RSTN, RCMD, INFO
-	}
-
-	public static final EnumMap<Fnc, String> FncSTR = new EnumMap<>(Fnc.class);
-	static {
-		FncSTR.put(Fnc.UNKFNC, "");
-		FncSTR.put(Fnc.HMO, "harbour-master");
-		FncSTR.put(Fnc.CSTM, "customs");
-		FncSTR.put(Fnc.HLTH, "health");
-		FncSTR.put(Fnc.HOSP, "hospital");
-		FncSTR.put(Fnc.POFF, "post_office");
-		FncSTR.put(Fnc.HOTEL, "hotel");
-		FncSTR.put(Fnc.RWSTA, "railway_station");
-		FncSTR.put(Fnc.POLICE, "police_station");
-		FncSTR.put(Fnc.WPOL, "water-police_station");
-		FncSTR.put(Fnc.PILO, "pilot_office");
-		FncSTR.put(Fnc.PILL, "pilot_lookout");
-		FncSTR.put(Fnc.BANK, "bank");
-		FncSTR.put(Fnc.DCHQ, "district_control");
-		FncSTR.put(Fnc.TRNS, "transit_shed");
-		FncSTR.put(Fnc.FACT, "factory");
-		FncSTR.put(Fnc.PWRS, "power_station");
-		FncSTR.put(Fnc.ADMIN, "administrative");
-		FncSTR.put(Fnc.EDUC, "educational");
-		FncSTR.put(Fnc.CHCH, "church");
-		FncSTR.put(Fnc.CHPL, "chapel");
-		FncSTR.put(Fnc.TMPL, "temple");
-		FncSTR.put(Fnc.PGDA, "pagoda");
-		FncSTR.put(Fnc.SHSH, "shinto_shrine");
-		FncSTR.put(Fnc.BTMP, "buddhist_temple");
-		FncSTR.put(Fnc.MOSQ, "mosque");
-		FncSTR.put(Fnc.MRBT, "marabout");
-		FncSTR.put(Fnc.LOOK, "lookout");
-		FncSTR.put(Fnc.COMS, "communication");
-		FncSTR.put(Fnc.TV, "television");
-		FncSTR.put(Fnc.RADO, "radio");
-		FncSTR.put(Fnc.RADR, "radar");
-		FncSTR.put(Fnc.LSUP, "light_support");
-		FncSTR.put(Fnc.MWAV, "microwave");
-		FncSTR.put(Fnc.COOL, "cooling");
-		FncSTR.put(Fnc.OBSV, "observation");
-		FncSTR.put(Fnc.TIMB, "time_ball");
-		FncSTR.put(Fnc.CLK, "clock");
-		FncSTR.put(Fnc.CTRL, "control");
-		FncSTR.put(Fnc.AMOR, "airship_mooring");
-		FncSTR.put(Fnc.STAD, "stadium");
-		FncSTR.put(Fnc.BUSS, "bus_station");
-		FncSTR.put(Fnc.PRHB, "prohibition");
-		FncSTR.put(Fnc.RGLN, "regulation");
-		FncSTR.put(Fnc.RSTN, "restriction");
-		FncSTR.put(Fnc.RCMD, "recommendation");
-		FncSTR.put(Fnc.INFO, "information");
-	}
-
-	private Fnc function = Fnc.UNKFNC;
-
-	public Fnc getFunc() {
-		return function;
-	}
-
-	public void setFunc(Fnc fnc) {
-		function = fnc;
-		repaint();
-	}
-
-	public String information = "";
-
-	public String getInfo() {
-		return information;
-	}
-
-	public void setInfo(String str) {
-		information = str.trim();
-	}
-
-	public String source = "";
-
-	public String getSource() {
-		return source;
-	}
-
-	public void setSource(String str) {
-		source = str.trim();
-	}
-
-	public String elevation = "";
-
-	public String getElevation() {
-		return elevation;
-	}
-
-	public void setElevation(String str) {
-		elevation = validDecimal(str);
-	}
-
-	public String height = "";
-
-	public String getObjectHeight() {
-		return height;
-	}
-
-	public void setObjectHeight(String str) {
-		height = validDecimal(str);
-	}
-
-	private String channel = "";
-
-	public String getChannel() {
-		return channel;
-	}
-
-	public void setChannel(String per) {
-		channel = validDecimal(per);
-		repaint();
-	}
-
-	public String ref = "";
-
-	public String getRef() {
-		return ref;
-	}
-
-	public void setRef(String str) {
-		ref = str;
-	}
-
-	public String lightRef = "";
-
-	public String getLightRef() {
-		return lightRef;
-	}
-
-	public void setLightRef(String str) {
-		lightRef = str;
-	}
-
-	public String fixme = "";
-
-	public String getFixme() {
-		return fixme;
-	}
-
-	public void setFixme(String str) {
-		fixme = str;
-	}
-
-	public boolean testValid() {
-		if (dlg.node == null) return false;
-		boolean tmp = false;
-		PanelMain.messageBar.setText("");
-		switch (getObject()) {
-		case BCNCAR:
-		case BCNLAT:
-		case BOYCAR:
-		case BOYLAT:
-			if ((getCategory() != Cat.NOCAT) && (getShape() != Shp.UNKSHP))
-				tmp = true;
-			break;
-		case BCNISD:
-		case BCNSAW:
-		case BCNSPP:
-		case BOYISD:
-		case BOYSAW:
-		case BOYSPP:
-			if (getShape() != Shp.UNKSHP)
-				tmp = true;
-			break;
-		case FLTCAR:
-		case FLTISD:
-		case FLTLAT:
-		case FLTSAW:
-		case FLTSPP:
-			if (getObjColour(0) != Col.UNKCOL)
-				tmp = true;
-			break;
-		case LITMAJ:
-		case LITMIN:
-		case LITFLT:
-		case LITVES:
-		case LITHSE:
-		case SISTAW:
-		case SISTAT:
-		case OFSPLF:
-		case MORFAC:
-		case BOYINB:
-		case PILBOP:
-		case RSCSTA:
-		case RDOSTA:
-		case RADSTA:
- 			tmp = true;
-			break;
-		case NOTMRK:
-			if (getCategory() != Cat.NOCAT) 
-				tmp = true;
-		case LNDMRK:
-			if ((getCategory() != Cat.NOCAT) || (getFunc() != Fnc.UNKFNC))
-				tmp = true;
-			break;
-		}
-		if (tmp) {
-			SmedAction.panelMain.moreButton.setVisible(true);
-			SmedAction.panelMain.saveButton.setEnabled(true);
-			SmedAction.panelMain.topButton.setEnabled(true);
-			SmedAction.panelMain.fogButton.setEnabled(true);
-			SmedAction.panelMain.radButton.setEnabled(true);
-			SmedAction.panelMain.litButton.setEnabled(true);
-			return true;
-		} else {
-			SmedAction.panelMain.moreButton.setVisible(false);
-			SmedAction.panelMain.moreButton.setText(">>");
-			SmedAction.panelMain.topButton.setEnabled(false);
-			SmedAction.panelMain.fogButton.setEnabled(false);
-			SmedAction.panelMain.radButton.setEnabled(false);
-			SmedAction.panelMain.litButton.setEnabled(false);
-			PanelMain.messageBar.setText("Seamark not recognised");
-			return false;
-		}
-	}
-
-	public void clrMark() {
-		setName("");
-		setObject(Obj.UNKOBJ);
-		clrLight();
-		setFogSound(Fog.NOFOG);
-		setRadar(Rtb.NORTB);
-		setRadio(Cat.NOROS);
-		setStatus(Sts.UNKSTS);
-		setConstr(Cns.UNKCNS);
-		setConsp(Con.UNKCON);
-		setRefl(Con.UNKCON);
-		setRef("");
-		setObjectHeight("");
-		setElevation("");
-		setChannel("");
-		setInfo("");
-		setSource("");
-		setFixme("");
-		SmedAction.panelMain.syncPanel();
-		repaint();
-	}
-
-	public String validDecimal(String str) {
-		str = str.trim().replace(',', '.');
-		if (!(str.isEmpty()) && !(str.matches("^[+-]??\\d+(\\.\\d+)??$"))) {
-			PanelMain.messageBar.setText(Messages.getString("NotDecimal"));
-			return "";
-		} else {
-			PanelMain.messageBar.setText("");
-			return str;
-		}
-	}
-
-	public String validDecimal(String str, float max) {
-		str = validDecimal(str);
-		if (!(str.isEmpty()) && (new Float(str) > max)) {
-			PanelMain.messageBar.setText(Messages.getString("TooBig") + " (" + max + ")");
-			return "";
-		} else {
-			PanelMain.messageBar.setText("");
-			return str;
-		}
-	}
-
-	public void parseMark(OsmPrimitive node) {
-		PanelMain.messageBar.setText("");
-		String str = Main.pref.get("smedplugin.IALA");
-		if (str.equals("C"))
-			setRegion(Reg.C);
-		else if (str.equals("B"))
-			setRegion(Reg.B);
-		else
-			setRegion(Reg.A);
-
-		Map<String, String> keys = node.getKeys();
-
-		str = "";
-		if (keys.containsKey("seamark:type"))
-			str = keys.get("seamark:type");
-
-		clrMark();
-		for (Obj obj : ObjSTR.keySet()) {
-			if (ObjSTR.get(obj).equals(str)) {
-				setObject(obj);
-			}
-		}
-
-		if (str.equals("")) {
-			PanelMain.messageBar.setText("No seamark");
-		}
-		if (getObject() == Obj.UNKOBJ) {
-			PanelMain.messageBar.setText("Seamark not recognised");
-		}
-
-		setName("");
-		for (Obj obj : ObjSTR.keySet()) {
-			if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":name")) {
-				str = keys.get("seamark:" + ObjSTR.get(obj) + ":name");
-				setName(str);
-			}
-		}
-		if (keys.containsKey("seamark:name")) {
-			str = keys.get("seamark:name");
-			setName(str);
-		}
-		
-		for (Obj obj : ObjSTR.keySet()) {
-			if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":category")) {
-				str = keys.get("seamark:" + ObjSTR.get(obj) + ":category");
-				if (obj == getObject()) {
-					setCategory(Cat.NOCAT);
-					for (Cat cat : CatSTR.keySet()) {
-						if (CatSTR.get(cat).equals(str)) {
-							setCategory(cat);
-						}
-					}
-				}
-			}
-		}
-
-		for (Obj obj : ObjSTR.keySet()) {
-			if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":shape")) {
-				str = keys.get("seamark:" + ObjSTR.get(obj) + ":shape");
-				setShape(Shp.UNKSHP);
-				for (Shp shp : ShpSTR.keySet()) {
-					if (ShpSTR.get(shp).equals(str)) {
-						setShape(shp);
-					}
-				}
-			}
-		}
-		if (getShape() == Shp.UNKSHP) {
-			if (EntMAP.get(getObject()) == Ent.BUOY)
-				setShape(Shp.BUOY);
-			if (EntMAP.get(getObject()) == Ent.BEACON)
-				setShape(Shp.BEACON);
-			if (EntMAP.get(getObject()) == Ent.LFLOAT)
-				if (getObject() == Obj.LITVES)
-					setShape(Shp.SUPER);
-				else
-					setShape(Shp.FLOAT);
-		}
-
-		for (Obj obj : ObjSTR.keySet()) {
-			if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":colour")) {
-				str = keys.get("seamark:" + ObjSTR.get(obj) + ":colour");
-				bodyColour.clear();
-				for (String item : str.split(";")) {
-					for (Col col : ColSTR.keySet()) {
-						if (ColSTR.get(col).equals(item)) {
-							bodyColour.add(col);
-						}
-					}
-				}
-			}
-		}
-
-		for (Obj obj : ObjSTR.keySet()) {
-			if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":colour_pattern")) {
-				str = keys.get("seamark:" + ObjSTR.get(obj) + ":colour_pattern");
-				setObjPattern(Pat.NOPAT);
-				for (Pat pat : PatSTR.keySet()) {
-					if (PatSTR.get(pat).equals(str)) {
-						setObjPattern(pat);
-					}
-				}
-			}
-
-			if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":height")) {
-				setObjectHeight(keys.get("seamark:" + ObjSTR.get(obj) + ":height"));
-			}
-			if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":elevation")) {
-				setElevation(keys.get("seamark:" + ObjSTR.get(obj) + ":elevation"));
-			}
-			if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":channel")) {
-				setChannel(keys.get("seamark:" + ObjSTR.get(obj) + ":channel"));
-			}
-		}
-
-		for (Obj obj : ObjSTR.keySet()) {
-			if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":function")) {
-				str = keys.get("seamark:" + ObjSTR.get(obj) + ":function");
-				setFunc(Fnc.UNKFNC);
-				for (Fnc fnc : FncSTR.keySet()) {
-					if (FncSTR.get(fnc).equals(str)) {
-						setFunc(fnc);
-					}
-				}
-			}
-		}
-
-		if ((getObject() == Obj.LNDMRK) && (getCategory() == Cat.NOCAT) && (getFunc() == Fnc.UNKFNC)) {
-			setObject(Obj.LITHSE);
-		}
-
-		if (getObject() == Obj.LITFLT) {
-			switch (getObjColour(0)) {
-			case RED:
-				if ((getObjColour(1) == Col.WHITE) && (getObjColour(2) == Col.UNKCOL)) {
-					setObject(Obj.FLTSAW);
-					setCategory(Cat.NOCAT);
-				} else if (getObjColour(1) == Col.UNKCOL) {
-					setObject(Obj.FLTLAT);
-					if (getRegion() == Reg.B) {
-						setCategory(Cat.LAM_STBD);
-					} else {
-						setCategory(Cat.LAM_PORT);
-					}
-				} else if ((getObjColour(1) == Col.GREEN)
-						&& (getObjColour(2) == Col.RED)) {
-					setObject(Obj.FLTLAT);
-					if (getRegion() == Reg.B) {
-						setCategory(Cat.LAM_PSTBD);
-					} else {
-						setCategory(Cat.LAM_PPORT);
-					}
-				} else if ((getObjColour(1) == Col.WHITE)
-						&& (getObjColour(2) == Col.RED)) {
-					setObject(Obj.FLTLAT);
-					setCategory(Cat.LAM_PORT);
-				} else {
-					setObject(Obj.FLTSPP);
-					setCategory(Cat.NOCAT);
-				}
-				break;
-			case GREEN:
-				if (getObjColour(1) == Col.UNKCOL) {
-					setObject(Obj.FLTLAT);
-					if (getRegion() == Reg.B) {
-						setCategory(Cat.LAM_PORT);
-					} else {
-						setCategory(Cat.LAM_STBD);
-					}
-				} else if ((getObjColour(1) == Col.RED)
-						&& (getObjColour(2) == Col.GREEN)) {
-					setObject(Obj.FLTLAT);
-					if (getRegion() == Reg.B) {
-						setCategory(Cat.LAM_PPORT);
-					} else {
-						setCategory(Cat.LAM_PSTBD);
-					}
-				} else if ((getObjColour(1) == Col.WHITE)
-						&& (getObjColour(2) == Col.GREEN)) {
-					setObject(Obj.FLTLAT);
-					setCategory(Cat.LAM_STBD);
-				} else {
-					setObject(Obj.FLTSPP);
-					setCategory(Cat.NOCAT);
-				}
-				break;
-			case YELLOW:
-				if (getObjColour(1) == Col.BLACK) {
-					setObject(Obj.FLTCAR);
-					if (getObjColour(2) == Col.YELLOW) {
-						setCategory(Cat.CAM_WEST);
-					} else {
-						setCategory(Cat.CAM_SOUTH);
-					}
-				} else {
-					setObject(Obj.FLTSPP);
-					setCategory(Cat.NOCAT);
-				}
-				break;
-			case BLACK:
-				if (getObjColour(1) == Col.RED) {
-					setObject(Obj.FLTISD);
-					setCategory(Cat.NOCAT);
-				} else if (getObjColour(1) == Col.YELLOW) {
-					setObject(Obj.FLTCAR);
-					if (getObjColour(2) == Col.BLACK) {
-						setCategory(Cat.CAM_EAST);
-					} else {
-						setCategory(Cat.CAM_NORTH);
-					}
-				} else {
-					setObject(Obj.FLTSPP);
-					setCategory(Cat.NOCAT);
-				}
-				break;
-			default:
-				setCategory(Cat.NOCAT);
-			}
-		}
-
-		for (Obj obj : ObjSTR.keySet()) {
-			if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":system")) {
-				str = keys.get("seamark:" + ObjSTR.get(obj) + ":system");
-				if (str.equals("iala-a"))
-					setRegion(Reg.A);
-				else if (str.equals("iala-b"))
-					setRegion(Reg.B);
-				else
-					setRegion(Reg.C);
-			} else if (GrpMAP.get(object) == Grp.LAT) {
-				switch (getCategory()) {
-				case LAM_PORT:
-					if (getObjColour(0) == Col.RED) {
-						if (getObjColour(1) == Col.WHITE)
-							setRegion(Reg.C);
-						else
-							setRegion(Reg.A);
-					}
-					if (getObjColour(0) == Col.GREEN)
-						setRegion(Reg.B);
-					break;
-				case LAM_PPORT:
-					if (getObjColour(0) == Col.RED) {
-						if (getObjColour(3) == Col.GREEN)
-							setRegion(Reg.C);
-						else
-							setRegion(Reg.B);
-					}
-					if (getObjColour(0) == Col.GREEN)
-						setRegion(Reg.A);
-					break;
-				case LAM_STBD:
-					if (getObjColour(0) == Col.GREEN) {
-						if (getObjColour(1) == Col.WHITE)
-							setRegion(Reg.C);
-						else
-							setRegion(Reg.A);
-					}
-					if (getObjColour(0) == Col.RED)
-						setRegion(Reg.B);
-					break;
-				case LAM_PSTBD:
-					if (getObjColour(0) == Col.GREEN)
-						setRegion(Reg.B);
-					if (getObjColour(0) == Col.RED) {
-						if (getObjColour(3) == Col.GREEN)
-							setRegion(Reg.C);
-						else
-							setRegion(Reg.A);
-					}
-					break;
-				}
-			}
-		}
-
-		if (keys.containsKey("seamark:topmark:shape")) {
-			str = keys.get("seamark:topmark:shape");
-			setTopmark(Top.NOTOP);
-			for (Top top : TopSTR.keySet()) {
-				if (TopSTR.get(top).equals(str)) {
-					setTopmark(top);
-				}
-			}
-		}
-		if (keys.containsKey("seamark:topmark:colour")) {
-			str = keys.get("seamark:topmark:colour");
-			setTopColour(Col.UNKCOL);
-			for (Col col : ColSTR.keySet()) {
-				if (ColSTR.get(col).equals(str)) {
-					setTopColour(col);
-				}
-			}
-		}
-		if (keys.containsKey("seamark:topmark:colour_pattern")) {
-			str = keys.get("seamark:topmark:colour_pattern");
-			setTopPattern(Pat.NOPAT);
-			for (Pat pat : PatSTR.keySet()) {
-				if (PatSTR.get(pat).equals(str)) {
-					setTopPattern(pat);
-				}
-			}
-		}
-
-		clrLight();
-		for (int i = 0; i < 30; i++) {
-			String secStr = (i == 0) ? "" : (":" + Integer.toString(i));
-			if (keys.containsKey("seamark:light" + secStr + ":colour")) {
-				nulLight(i);
-				str = keys.get("seamark:light" + secStr + ":colour");
-				if (str.contains(";")) {
-					String strs[] = str.split(";");
-					for (Col col : ColSTR.keySet())
-						if ((strs.length > 1) && ColSTR.get(col).equals(strs[1]))
-							setLightAtt(Att.ALT, i, col);
-					str = strs[0];
-				}
-				for (Col col : ColSTR.keySet())
-					if (ColSTR.get(col).equals(str))
-						setLightAtt(Att.COL, i, col);
-			}
-			if (keys.containsKey("seamark:light" + secStr + ":character")) {
-				str = keys.get("seamark:light" + secStr + ":character");
-				if (str.contains("(") && str.contains(")")) {
-					int i1 = str.indexOf("(");
-					int i2 = str.indexOf(")");
-					setLightAtt(Att.GRP, i, str.substring((i1+1), i2));
-					str = str.substring(0, i1) + str.substring((i2+1), str.length());
-					}
-				setLightAtt(Att.CHR, i, str);
-			}
-			if (keys.containsKey("seamark:light" + secStr + ":group"))
-				setLightAtt(Att.GRP, i, keys.get("seamark:light" + secStr + ":group"));
-			if (keys.containsKey("seamark:light" + secStr + ":sequence"))
-				setLightAtt(Att.SEQ, i, keys.get("seamark:light" + secStr + ":sequence"));
-			if (keys.containsKey("seamark:light" + secStr + ":period"))
-				setLightAtt(Att.PER, i, keys.get("seamark:light" + secStr + ":period"));
-			if (keys.containsKey("seamark:light" + secStr + ":category")) {
-				str = keys.get("seamark:light" + secStr + ":category");
-				if (str.equals("vert"))
-					str = "vertical";
-				if (str.equals("horiz"))
-					str = "horizontal";
-				for (Lit lit : LitSTR.keySet())
-					if (LitSTR.get(lit).equals(str))
-						setLightAtt(Att.LIT, i, lit);
-			}
-			if (keys.containsKey("seamark:light" + secStr + ":sector_start"))
-				setLightAtt(Att.BEG, i, keys.get("seamark:light" + secStr + ":sector_start"));
-			if (keys.containsKey("seamark:light" + secStr + ":sector_end"))
-				setLightAtt(Att.END, i, keys.get("seamark:light" + secStr + ":sector_end"));
-			if (keys.containsKey("seamark:light" + secStr + ":radius"))
-				setLightAtt(Att.RAD, i, keys.get("seamark:light" + secStr + ":radius"));
-			if (keys.containsKey("seamark:light" + secStr + ":height"))
-				setLightAtt(Att.HGT, i, keys.get("seamark:light" + secStr + ":height"));
-			if (keys.containsKey("seamark:light" + secStr + ":range"))
-				setLightAtt(Att.RNG, i, keys.get("seamark:light" + secStr + ":range"));
-			if (keys.containsKey("seamark:light" + secStr + ":visibility")) {
-				str = keys.get("seamark:light" + secStr + ":visibility");
-				for (Vis vis : VisSTR.keySet())
-					if (VisSTR.get(vis).equals(str))
-						setLightAtt(Att.VIS, i, vis);
-			}
-			if (keys.containsKey("seamark:light" + secStr + ":exhibition")) {
-				str = keys.get("seamark:light" + secStr + ":exhibition");
-				for (Exh exh : ExhSTR.keySet())
-					if (ExhSTR.get(exh).equals(str))
-						setLightAtt(Att.EXH, i, exh);
-			}
-			if (keys.containsKey("seamark:light" + secStr + ":orientation"))
-				setLightAtt(Att.ORT, i, keys.get("seamark:light" + secStr + ":orientation"));
-			if (keys.containsKey("seamark:light" + secStr + ":multiple"))
-				setLightAtt(Att.MLT, i, keys.get("seamark:light" + secStr + ":multiple"));
-			
-			if (sectors.size() == i)
-				break;
-		}
-
-		if (keys.containsKey("seamark:fog_signal")) {
-			setFogSound(Fog.FOGSIG);
-		}
-		if (keys.containsKey("seamark:fog_signal:category")) {
-			str = keys.get("seamark:fog_signal:category");
-			setFogSound(Fog.NOFOG);
-			for (Fog fog : FogSTR.keySet()) {
-				if (FogSTR.get(fog).equals(str)) {
-					setFogSound(fog);
-				}
-			}
-		}
-		if (keys.containsKey("seamark:fog_signal:group")) {
-			setFogGroup(keys.get("seamark:fog_signal:group"));
-		}
-		if (keys.containsKey("seamark:fog_signal:period")) {
-			setFogPeriod(keys.get("seamark:fog_signal:period"));
-		}
-		if (keys.containsKey("seamark:fog_signal:sequence")) {
-			setFogSequence(keys.get("seamark:fog_signal:sequence"));
-		}
-		if (keys.containsKey("seamark:fog_signal:range")) {
-			setFogRange(keys.get("seamark:fog_signal:range"));
-		}
-
-		if (keys.containsKey("seamark:radio_station:category")) {
-			str = keys.get("seamark:radio_station:category");
-			setRadio(Cat.NOROS);
-			for (Cat rdo : CatSTR.keySet()) {
-				if (CatSTR.get(rdo).equals(str)) {
-					setRadio(rdo);
-				}
-			}
-		}
-
-		if (keys.containsKey("seamark:radar_reflector")) {
-			setRadar(Rtb.REFLECTOR);
-		}
-		if (keys.containsKey("seamark:radar_transponder:category")) {
-			str = keys.get("seamark:radar_transponder:category");
-			setRadar(Rtb.NORTB);
-			for (Rtb rtb : RtbSTR.keySet()) {
-				if (RtbSTR.get(rtb).equals(str)) {
-					setRadar(rtb);
-				}
-			}
-		}
-		if (keys.containsKey("seamark:radar_transponder:group")) {
-			setRaconGroup(keys.get("seamark:radar_transponder:group"));
-		}
-		if (keys.containsKey("seamark:radar_transponder:period")) {
-			setRaconPeriod(keys.get("seamark:radar_transponder:period"));
-		}
-		if (keys.containsKey("seamark:radar_transponder:sequence")) {
-			setRaconSequence(keys.get("seamark:radar_transponder:sequence"));
-		}
-		if (keys.containsKey("seamark:radar_transponder:range")) {
-			setRaconRange(keys.get("seamark:radar_transponder:range"));
-		}
-		if (keys.containsKey("seamark:radar_transponder:sector_start")) {
-			setRaconSector1(keys.get("seamark:radar_transponder:sector_start"));
-		}
-		if (keys.containsKey("seamark:radar_transponder:sector_end")) {
-			setRaconSector2(keys.get("seamark:radar_transponder:sector_end"));
-		}
-
-		if (keys.containsKey("seamark:information")) {
-			setInfo(keys.get("seamark:information"));
-		}
-		if (keys.containsKey("seamark:light:information")) {
-			setInfo(getInfo() + keys.get("seamark:light:information"));
-		}
-		if (keys.containsKey("seamark:" + ObjSTR.get(getObject()) + "information")) {
-			setInfo(getInfo() + keys.get("seamark:" + ObjSTR.get(getObject()) + "information"));
-		}
-		if (keys.containsKey("seamark:source")) {
-			setSource(keys.get("seamark:source"));
-		}
-		if (keys.containsKey("seamark:light:source")) {
-			setSource(getSource() + keys.get("seamark:light:source"));
-		}
-		if (keys.containsKey("seamark:" + ObjSTR.get(getObject()) + "source")) {
-			setSource(getSource() + keys.get("seamark:" + ObjSTR.get(getObject()) + "source"));
-		}
-		if (keys.containsKey("seamark:height")) {
-			setObjectHeight(keys.get("seamark:height"));
-		}
-		if (keys.containsKey("seamark:elevation")) {
-			setElevation(keys.get("seamark:elevation"));
-		}
-		if (keys.containsKey("seamark:status")) {
-			str = keys.get("seamark:status");
-			setStatus(Sts.UNKSTS);
-			for (Sts sts : StsSTR.keySet()) {
-				if (StsSTR.get(sts).equals(str)) {
-					setStatus(sts);
-				}
-			}
-		}
-		if (keys.containsKey("seamark:construction")) {
-			str = keys.get("seamark:construction");
-			setConstr(Cns.UNKCNS);
-			for (Cns cns : CnsSTR.keySet()) {
-				if (CnsSTR.get(cns).equals(str)) {
-					setConstr(cns);
-				}
-			}
-		}
-		if (keys.containsKey("seamark:conspicuity")) {
-			str = keys.get("seamark:conspicuity");
-			setConsp(Con.UNKCON);
-			for (Con con : ConSTR.keySet()) {
-				if (ConSTR.get(con).equals(str)) {
-					setConsp(con);
-				}
-			}
-		}
-		if (keys.containsKey("seamark:reflectivity")) {
-			str = keys.get("seamark:reflectivity");
-			setRefl(Con.UNKCON);
-			for (Con con : ConSTR.keySet()) {
-				if (ConSTR.get(con).equals(str)) {
-					setRefl(con);
-				}
-			}
-		}
-
-		if (keys.containsKey("seamark:ref")) {
-			setRef(keys.get("seamark:ref"));
-		}
-		if (keys.containsKey("seamark:reference")) {
-			setRef(keys.get("seamark:reference"));
-		}
-		if (keys.containsKey("seamark:light:ref")) {
-			setLightRef(keys.get("seamark:light:ref"));
-		}
-		if (keys.containsKey("seamark:light:reference")) {
-			setLightRef(keys.get("seamark:light:reference"));
-		}
-		if (keys.containsKey("seamark:fixme")) {
-			setFixme(keys.get("seamark:fixme"));
-		}
-
-		dlg.panelMain.syncPanel();
-	}
-
-	public void paintComponent(Graphics g) {
-		super.paintComponent(g);
-		
-		if (dlg.node == null) return;
-		
+    public SmedAction dlg = null;
+
+    public SeaMark(SmedAction dia) {
+        dlg = dia;
+        clrLight();
+    }
+
+    public enum Reg {
+        A, B, C, R, X
+    }
+
+    public static final EnumMap<Reg, String> RegSTR = new EnumMap<>(Reg.class);
+    static {
+        RegSTR.put(Reg.A, "iala-a");
+        RegSTR.put(Reg.B, "iala-b");
+        RegSTR.put(Reg.C, "cevni");
+        RegSTR.put(Reg.R, "riwr");
+        RegSTR.put(Reg.X, "other");
+    }
+
+    private Reg region = Reg.A;
+
+    public Reg getRegion() {
+        return region;
+    }
+
+    public void setRegion(Reg reg) {
+        region = reg;
+    }
+
+    private String name = "";
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String str) {
+        name = str.trim();
+        repaint();
+    }
+    
+    public enum Obj {
+        UNKOBJ, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP,
+        BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, NOTMRK,
+        FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP,
+        LITMAJ, LITMIN, LITFLT, LITVES, LITHSE, LNDMRK,
+        MORFAC, BOYINB, SISTAW, SISTAT, OFSPLF,
+        CGUSTA, PILBOP, RSCSTA, RDOSTA, RADSTA
+    }
+
+    public static final EnumMap<Obj, String> ObjSTR = new EnumMap<>(Obj.class);
+    static {
+        ObjSTR.put(Obj.BCNCAR, "beacon_cardinal");
+        ObjSTR.put(Obj.BCNISD, "beacon_isolated_danger");
+        ObjSTR.put(Obj.BCNLAT, "beacon_lateral");
+        ObjSTR.put(Obj.BCNSAW, "beacon_safe_water");
+        ObjSTR.put(Obj.BCNSPP, "beacon_special_purpose");
+        ObjSTR.put(Obj.BOYCAR, "buoy_cardinal");
+        ObjSTR.put(Obj.BOYISD, "buoy_isolated_danger");
+        ObjSTR.put(Obj.BOYLAT, "buoy_lateral");
+        ObjSTR.put(Obj.BOYSAW, "buoy_safe_water");
+        ObjSTR.put(Obj.BOYSPP, "buoy_special_purpose");
+        ObjSTR.put(Obj.FLTCAR, "light_float");
+        ObjSTR.put(Obj.FLTLAT, "light_float");
+        ObjSTR.put(Obj.FLTSAW, "light_float");
+        ObjSTR.put(Obj.FLTISD, "light_float");
+        ObjSTR.put(Obj.FLTSPP, "light_float");
+        ObjSTR.put(Obj.LITMAJ, "light_major");
+        ObjSTR.put(Obj.LITMIN, "light_minor");
+        ObjSTR.put(Obj.LITFLT, "light_float");
+        ObjSTR.put(Obj.LITVES, "light_vessel");
+        ObjSTR.put(Obj.NOTMRK, "notice");
+        ObjSTR.put(Obj.LNDMRK, "landmark");
+        ObjSTR.put(Obj.LITHSE, "landmark");
+        ObjSTR.put(Obj.MORFAC, "mooring");
+        ObjSTR.put(Obj.BOYINB, "buoy_installation");
+        ObjSTR.put(Obj.OFSPLF, "platform");
+        ObjSTR.put(Obj.SISTAW, "signal_station_warning");
+        ObjSTR.put(Obj.SISTAT, "signal_station_traffic");
+        ObjSTR.put(Obj.CGUSTA, "coastguard_station");
+        ObjSTR.put(Obj.PILBOP, "pilot_boarding");
+        ObjSTR.put(Obj.RSCSTA, "rescue_station");
+        ObjSTR.put(Obj.RDOSTA, "radio_station");
+        ObjSTR.put(Obj.RADSTA, "radar_station");
+    }
+
+    private Obj object = Obj.UNKOBJ;
+
+    public Obj getObject() {
+        return object;
+    }
+
+    public void setObject(Obj obj) {
+        object = obj;
+        if (obj == Obj.UNKOBJ) {
+            setCategory(Cat.NOCAT);
+            setFunc(Fnc.UNKFNC);
+            setShape(Shp.UNKSHP);
+            setColour(Ent.BODY, Col.UNKCOL);
+            setPattern(Ent.BODY, Pat.NOPAT);
+            setTopmark(Top.NOTOP);
+            setColour(Ent.TOPMARK, Col.UNKCOL);
+            setPattern(Ent.TOPMARK, Pat.NOPAT);
+        }
+        repaint();
+    }
+
+    public enum Ent {
+        BODY, BUOY, BEACON, LFLOAT, TOPMARK, LIGHT, MOORING, STATION, PLATFORM, NOTICE
+    }
+
+    public static final EnumMap<Obj, Ent> EntMAP = new EnumMap<>(Obj.class);
+    static {
+        EntMAP.put(Obj.BCNCAR, Ent.BEACON);
+        EntMAP.put(Obj.BCNISD, Ent.BEACON);
+        EntMAP.put(Obj.BCNLAT, Ent.BEACON);
+        EntMAP.put(Obj.BCNSAW, Ent.BEACON);
+        EntMAP.put(Obj.BCNSPP, Ent.BEACON);
+        EntMAP.put(Obj.BOYCAR, Ent.BUOY);
+        EntMAP.put(Obj.BOYISD, Ent.BUOY);
+        EntMAP.put(Obj.BOYLAT, Ent.BUOY);
+        EntMAP.put(Obj.BOYSAW, Ent.BUOY);
+        EntMAP.put(Obj.BOYSPP, Ent.BUOY);
+        EntMAP.put(Obj.LITMAJ, Ent.LIGHT);
+        EntMAP.put(Obj.LITMIN, Ent.LIGHT);
+        EntMAP.put(Obj.LITFLT, Ent.LFLOAT);
+        EntMAP.put(Obj.FLTCAR, Ent.LFLOAT);
+        EntMAP.put(Obj.FLTLAT, Ent.LFLOAT);
+        EntMAP.put(Obj.FLTSAW, Ent.LFLOAT);
+        EntMAP.put(Obj.FLTISD, Ent.LFLOAT);
+        EntMAP.put(Obj.FLTSPP, Ent.LFLOAT);
+        EntMAP.put(Obj.LITVES, Ent.LFLOAT);
+        EntMAP.put(Obj.LITHSE, Ent.LIGHT);
+        EntMAP.put(Obj.LNDMRK, Ent.LIGHT);
+        EntMAP.put(Obj.MORFAC, Ent.MOORING);
+        EntMAP.put(Obj.BOYINB, Ent.MOORING);
+        EntMAP.put(Obj.OFSPLF, Ent.PLATFORM);
+        EntMAP.put(Obj.SISTAW, Ent.STATION);
+        EntMAP.put(Obj.SISTAT, Ent.STATION);
+        EntMAP.put(Obj.CGUSTA, Ent.STATION);
+        EntMAP.put(Obj.PILBOP, Ent.STATION);
+        EntMAP.put(Obj.RSCSTA, Ent.STATION);
+        EntMAP.put(Obj.RDOSTA, Ent.STATION);
+        EntMAP.put(Obj.RADSTA, Ent.STATION);
+        EntMAP.put(Obj.NOTMRK, Ent.NOTICE);
+    }
+
+    public enum Grp {
+        NUL, LAT, CAR, SAW, ISD, SPP, LGT, STN, PLF, NTC
+    }
+
+    public static final EnumMap<Obj, Grp> GrpMAP = new EnumMap<>(Obj.class);
+    static {
+        GrpMAP.put(Obj.UNKOBJ, Grp.NUL);
+        GrpMAP.put(Obj.BCNCAR, Grp.CAR);
+        GrpMAP.put(Obj.BCNISD, Grp.ISD);
+        GrpMAP.put(Obj.BCNLAT, Grp.LAT);
+        GrpMAP.put(Obj.BCNSAW, Grp.SAW);
+        GrpMAP.put(Obj.BCNSPP, Grp.SPP);
+        GrpMAP.put(Obj.BOYCAR, Grp.CAR);
+        GrpMAP.put(Obj.BOYISD, Grp.ISD);
+        GrpMAP.put(Obj.BOYLAT, Grp.LAT);
+        GrpMAP.put(Obj.BOYSAW, Grp.SAW);
+        GrpMAP.put(Obj.BOYSPP, Grp.SPP);
+        GrpMAP.put(Obj.FLTCAR, Grp.CAR);
+        GrpMAP.put(Obj.FLTLAT, Grp.LAT);
+        GrpMAP.put(Obj.FLTSAW, Grp.SAW);
+        GrpMAP.put(Obj.FLTISD, Grp.ISD);
+        GrpMAP.put(Obj.FLTSPP, Grp.SPP);
+        GrpMAP.put(Obj.LITFLT, Grp.LGT);
+        GrpMAP.put(Obj.LITMAJ, Grp.LGT);
+        GrpMAP.put(Obj.LITMIN, Grp.LGT);
+        GrpMAP.put(Obj.LITVES, Grp.LGT);
+        GrpMAP.put(Obj.LITHSE, Grp.LGT);
+        GrpMAP.put(Obj.LNDMRK, Grp.LGT);
+        GrpMAP.put(Obj.MORFAC, Grp.SPP);
+        GrpMAP.put(Obj.BOYINB, Grp.SPP);
+        GrpMAP.put(Obj.OFSPLF, Grp.PLF);
+        GrpMAP.put(Obj.SISTAW, Grp.STN);
+        GrpMAP.put(Obj.SISTAT, Grp.STN);
+        GrpMAP.put(Obj.CGUSTA, Grp.STN);
+        GrpMAP.put(Obj.PILBOP, Grp.STN);
+        GrpMAP.put(Obj.RSCSTA, Grp.STN);
+        GrpMAP.put(Obj.RDOSTA, Grp.STN);
+        GrpMAP.put(Obj.RADSTA, Grp.STN);
+        GrpMAP.put(Obj.NOTMRK, Grp.NTC);
+    }
+
+    public enum Cat {
+        NOCAT, LAM_PORT, LAM_STBD, LAM_PPORT, LAM_PSTBD, CAM_NORTH, CAM_EAST, CAM_SOUTH, CAM_WEST,
+        ACH_URST, ACH_DEEP, ACH_TANK, ACH_EXPL, ACH_QUAR, ACH_SPLN, ACH_SCAN, ACH_SCMO, ACH_T24H, ACH_TLIM,
+        SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, SPM_MOOR, SPM_LNBY,
+        SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY, SPM_ANCH,
+        MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_ROPE, MOR_AUTO, MOR_BUOY, INB_CALM, INB_SBM,
+        SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC,
+        SIS_DNGR, SIS_OBST, SIS_CABL, SIS_MILY, SIS_DSTR, SIS_WTHR, SIS_STRM, SIS_ICE, SIS_TIME, SIS_TIDE,
+        SIS_TSTM, SIS_TGAG, SIS_TSCL, SIS_DIVE, SIS_LGAG, LIT_DIRF, LIT_LEDG,
+        LMK_CHMY, LMK_CARN, LMK_DSHA, LMK_FLGS, LMK_FLRS, LMK_MNMT, LMK_TOWR, LMK_WNDM, LMK_WTRT, LMK_MNRT,
+        LMK_MAST, LMK_WNDS, LMK_CLMN, LMK_OBLK, LMK_STAT, LMK_CROS, LMK_DOME, LMK_SCNR, LMK_WNDL, LMK_SPIR,
+        OFP_OIL, OFP_PRD, OFP_OBS, OFP_ALP, OFP_SALM, OFP_MOR, OFP_ISL, OFP_FPSO, OFP_ACC, OFP_NCCB,
+        RSC_LFB, RSC_RKT, RSC_RSW, RSC_RIT, RSC_MLB, RSC_RAD, RSC_FAE, RSC_SPL, RSC_AIR, RSC_TUG,
+        RAS_SRV, RAS_CST, PIL_VESS, PIL_HELI, PIL_SHORE,
+        NTC_A1, NTC_A1a, NTC_A2, NTC_A3, NTC_A4, NTC_A4_1, NTC_A5, NTC_A5_1, NTC_A6, NTC_A7, NTC_A8, NTC_A9,
+        NTC_A10a, NTC_A10b, NTC_A12, NTC_A13, NTC_A14, NTC_A15, NTC_A16, NTC_A17, NTC_A18, NTC_A19, NTC_A20,
+        NTC_B1a, NTC_B1b, NTC_B2a, NTC_B2b, NTC_B3a, NTC_B3b, NTC_B4a, NTC_B4b, NTC_B5, NTC_B6, NTC_B7, NTC_B8, NTC_B9a, NTC_B9b, NTC_B11,
+        NTC_C1, NTC_C2, NTC_C3, NTC_C4, NTC_C5a, NTC_C5b, NTC_D1a, NTC_D1b, NTC_D2a, NTC_D2b, NTC_D3a, NTC_D3b,
+        NOROS, ROS_UNKN, ROS_OMNI, ROS_DIRL, ROS_ROTP, ROS_CNSL, ROS_RDF, ROS_QTG, ROS_AERO, ROS_DECA, ROS_LORN, ROS_DGPS, ROS_TORN, ROS_OMGA, ROS_SYLD, ROS_CHKA,
+        ROS_PCOM, ROS_COMB, ROS_FACS, ROS_TIME, ROS_PAIS, ROS_SAIS, ROS_VAIS, ROS_VANC, ROS_VASC, ROS_VAEC, ROS_VAWC, ROS_VAPL, ROS_VASL, ROS_VAID, ROS_VASW, ROS_VASP, ROS_VAWK
+    }
+         
+    public static final EnumMap<Cat, String> CatSTR = new EnumMap<>(Cat.class);
+    static {
+        CatSTR.put(Cat.LAM_PORT, "port");
+        CatSTR.put(Cat.LAM_STBD, "starboard");
+        CatSTR.put(Cat.LAM_PPORT, "preferred_channel_port");
+        CatSTR.put(Cat.LAM_PSTBD, "preferred_channel_starboard");
+        CatSTR.put(Cat.CAM_NORTH, "north");
+        CatSTR.put(Cat.CAM_EAST, "east");
+        CatSTR.put(Cat.CAM_SOUTH, "south");
+        CatSTR.put(Cat.CAM_WEST, "west");
+        CatSTR.put(Cat.SPM_UNKN, "unknown_purpose");
+        CatSTR.put(Cat.SPM_WARN, "warning");
+        CatSTR.put(Cat.SPM_CHBF, "channel_separation");
+        CatSTR.put(Cat.SPM_YCHT, "yachting");
+        CatSTR.put(Cat.SPM_CABL, "cable");
+        CatSTR.put(Cat.SPM_OFAL, "outfall");
+        CatSTR.put(Cat.SPM_ODAS, "odas");
+        CatSTR.put(Cat.SPM_RECN, "recreation_zone");
+        CatSTR.put(Cat.SPM_MOOR, "mooring");
+        CatSTR.put(Cat.SPM_LNBY, "lanby");
+        CatSTR.put(Cat.SPM_LDNG, "leading");
+        CatSTR.put(Cat.SPM_NOTC, "notice");
+        CatSTR.put(Cat.SPM_TSS, "tss");
+        CatSTR.put(Cat.SPM_FOUL, "foul_ground");
+        CatSTR.put(Cat.SPM_DIVE, "diving");
+        CatSTR.put(Cat.SPM_FRRY, "ferry_crossing");
+        CatSTR.put(Cat.SPM_ANCH, "anchorage");
+        CatSTR.put(Cat.MOR_DLPN, "dolphin");
+        CatSTR.put(Cat.MOR_DDPN, "deviation_dolphin");
+        CatSTR.put(Cat.MOR_BLRD, "bollard");
+        CatSTR.put(Cat.MOR_WALL, "wall");
+        CatSTR.put(Cat.MOR_POST, "post");
+        CatSTR.put(Cat.MOR_CHWR, "chain");
+        CatSTR.put(Cat.MOR_ROPE, "shore_rope");
+        CatSTR.put(Cat.MOR_AUTO, "automatic");
+        CatSTR.put(Cat.MOR_BUOY, "buoy");
+        CatSTR.put(Cat.INB_CALM, "calm");
+        CatSTR.put(Cat.INB_SBM, "sbm");
+        CatSTR.put(Cat.SIS_PTCL, "port_control");
+        CatSTR.put(Cat.SIS_PTED, "port_entry");
+        CatSTR.put(Cat.SIS_IPT, "ipt");
+        CatSTR.put(Cat.SIS_BRTH, "berthing");
+        CatSTR.put(Cat.SIS_DOCK, "dock");
+        CatSTR.put(Cat.SIS_LOCK, "lock");
+        CatSTR.put(Cat.SIS_FBAR, "barrage");
+        CatSTR.put(Cat.SIS_BRDG, "bridge");
+        CatSTR.put(Cat.SIS_DRDG, "dredging");
+        CatSTR.put(Cat.SIS_TRFC, "traffic");
+        CatSTR.put(Cat.SIS_DNGR, "danger");
+        CatSTR.put(Cat.SIS_OBST, "obstruction");
+        CatSTR.put(Cat.SIS_CABL, "cable");
+        CatSTR.put(Cat.SIS_MILY, "military");
+        CatSTR.put(Cat.SIS_DSTR, "distress");
+        CatSTR.put(Cat.SIS_WTHR, "weather");
+        CatSTR.put(Cat.SIS_STRM, "storm");
+        CatSTR.put(Cat.SIS_ICE, "ice");
+        CatSTR.put(Cat.SIS_TIME, "time");
+        CatSTR.put(Cat.SIS_TIDE, "tide");
+        CatSTR.put(Cat.SIS_TSTM, "stream");
+        CatSTR.put(Cat.SIS_TGAG, "gauge");
+        CatSTR.put(Cat.SIS_TSCL, "scale");
+        CatSTR.put(Cat.SIS_DIVE, "diving");
+        CatSTR.put(Cat.SIS_LGAG, "level");
+        CatSTR.put(Cat.LMK_CHMY, "chimney");
+        CatSTR.put(Cat.LMK_CARN, "cairn");
+        CatSTR.put(Cat.LMK_DSHA, "dish_aerial");
+        CatSTR.put(Cat.LMK_FLGS, "flagstaff");
+        CatSTR.put(Cat.LMK_FLRS, "flare_stack");
+        CatSTR.put(Cat.LMK_MNMT, "monument");
+        CatSTR.put(Cat.LMK_TOWR, "tower");
+        CatSTR.put(Cat.LMK_WNDM, "windmotor");
+        CatSTR.put(Cat.LMK_WTRT, "water_tower");
+        CatSTR.put(Cat.LMK_MAST, "mast");
+        CatSTR.put(Cat.LMK_WNDS, "windsock");
+        CatSTR.put(Cat.LMK_CLMN, "column");
+        CatSTR.put(Cat.LMK_OBLK, "obelisk");
+        CatSTR.put(Cat.LMK_STAT, "statue");
+        CatSTR.put(Cat.LMK_CROS, "cross");
+        CatSTR.put(Cat.LMK_DOME, "dome");
+        CatSTR.put(Cat.LMK_SCNR, "radar_scanner");
+        CatSTR.put(Cat.LMK_WNDL, "windmill");
+        CatSTR.put(Cat.LMK_SPIR, "spire");
+        CatSTR.put(Cat.LMK_MNRT, "minaret");
+        CatSTR.put(Cat.OFP_OIL, "oil");
+        CatSTR.put(Cat.OFP_PRD,  "production");
+        CatSTR.put(Cat.OFP_OBS, "observation"); 
+        CatSTR.put(Cat.OFP_ALP, "alp");
+        CatSTR.put(Cat.OFP_SALM, "salm");
+        CatSTR.put(Cat.OFP_MOR, "mooring");
+        CatSTR.put(Cat.OFP_ISL, "island");
+        CatSTR.put(Cat.OFP_FPSO, "fpso");
+        CatSTR.put(Cat.OFP_ACC, "accommodation");
+        CatSTR.put(Cat.OFP_NCCB, "nccb");
+        CatSTR.put(Cat.PIL_VESS, "cruising_vessel");
+        CatSTR.put(Cat.PIL_HELI, "helicopter");
+        CatSTR.put(Cat.PIL_SHORE, "from_shore");
+        CatSTR.put(Cat.RSC_LFB, "lifeboat");
+        CatSTR.put(Cat.RSC_RKT, "rocket");
+        CatSTR.put(Cat.RSC_RSW, "refuge_shipwrecked");
+        CatSTR.put(Cat.RSC_RIT, "refuge_intertidal");
+        CatSTR.put(Cat.RSC_MLB, "lifeboat_moored");
+        CatSTR.put(Cat.RSC_RAD, "radio");
+        CatSTR.put(Cat.RSC_FAE, "firstaid");
+        CatSTR.put(Cat.RSC_SPL, "seaplane");
+        CatSTR.put(Cat.RSC_AIR, "aircraft");
+        CatSTR.put(Cat.RSC_TUG, "tug");
+        CatSTR.put(Cat.RAS_SRV, "surveillance");
+        CatSTR.put(Cat.RAS_CST, "coast");
+        CatSTR.put(Cat.ROS_OMNI, "omnidirectional");
+        CatSTR.put(Cat.ROS_DIRL, "directional");
+        CatSTR.put(Cat.ROS_ROTP, "rotating_pattern");
+        CatSTR.put(Cat.ROS_CNSL, "consol");
+        CatSTR.put(Cat.ROS_RDF, "rdf");
+        CatSTR.put(Cat.ROS_QTG, "qtg");
+        CatSTR.put(Cat.ROS_AERO, "aeronautical");
+        CatSTR.put(Cat.ROS_DECA, "decca");
+        CatSTR.put(Cat.ROS_LORN, "loran");
+        CatSTR.put(Cat.ROS_DGPS, "dgps");
+        CatSTR.put(Cat.ROS_TORN, "toran");
+        CatSTR.put(Cat.ROS_OMGA, "omega");
+        CatSTR.put(Cat.ROS_SYLD, "syledis");
+        CatSTR.put(Cat.ROS_CHKA, "chiaka");
+        CatSTR.put(Cat.ROS_PCOM, "public_communication");
+        CatSTR.put(Cat.ROS_COMB, "commercial_broadcast");
+        CatSTR.put(Cat.ROS_FACS, "facsimile");
+        CatSTR.put(Cat.ROS_TIME, "time_signal");
+        CatSTR.put(Cat.ROS_PAIS, "ais");
+        CatSTR.put(Cat.ROS_SAIS, "s-ais");
+        CatSTR.put(Cat.ROS_VAIS, "v-ais");
+        CatSTR.put(Cat.ROS_VANC, "v-ais_north_cardinal");
+        CatSTR.put(Cat.ROS_VASC, "v-ais_south_cardinal");
+        CatSTR.put(Cat.ROS_VAEC, "v-ais_east_cardinal");
+        CatSTR.put(Cat.ROS_VAWC, "v-ais_west_cardinal");
+        CatSTR.put(Cat.ROS_VAPL, "v-ais_port_lateral");
+        CatSTR.put(Cat.ROS_VASL, "v-ais_starboard_lateral");
+        CatSTR.put(Cat.ROS_VAID, "v-ais_isolated_danger");
+        CatSTR.put(Cat.ROS_VASW, "v-ais_safe_water");
+        CatSTR.put(Cat.ROS_VASP, "v-ais_special_purpose");
+        CatSTR.put(Cat.ROS_VAWK, "v-ais_wreck"); 
+        CatSTR.put(Cat.NTC_A1, "no_entry");
+        CatSTR.put(Cat.NTC_A1a, "closed_area");
+        CatSTR.put(Cat.NTC_A2, "no_overtaking");
+        CatSTR.put(Cat.NTC_A3, "no_convoy_overtaking");
+        CatSTR.put(Cat.NTC_A4, "no_passing");
+        CatSTR.put(Cat.NTC_A4, "no_convoy_passing");
+        CatSTR.put(Cat.NTC_A5, "no_berthing");
+        CatSTR.put(Cat.NTC_A5_1, "no_berthing_lateral_limit");
+        CatSTR.put(Cat.NTC_A6, "no_anchoring");
+        CatSTR.put(Cat.NTC_A7, "no_mooring");
+        CatSTR.put(Cat.NTC_A8, "no_turning");
+        CatSTR.put(Cat.NTC_A9, "no_wash");
+        CatSTR.put(Cat.NTC_A10a, "no_passage_left");
+        CatSTR.put(Cat.NTC_A10b, "no_passage_right");
+        CatSTR.put(Cat.NTC_A12, "no_motor_craft");
+        CatSTR.put(Cat.NTC_A13, "no_sport_craft");
+        CatSTR.put(Cat.NTC_A14, "no_waterskiing");
+        CatSTR.put(Cat.NTC_A15, "no_sailing_craft");
+        CatSTR.put(Cat.NTC_A16, "no_unpowered_craft");
+        CatSTR.put(Cat.NTC_A17, "no_sailboards");
+        CatSTR.put(Cat.NTC_A18, "no_high_speeds");
+        CatSTR.put(Cat.NTC_A19, "no_launching_beaching");
+        CatSTR.put(Cat.NTC_A20, "no_waterbikes");
+        CatSTR.put(Cat.NTC_B1a, "");
+        CatSTR.put(Cat.NTC_B1b, "");
+        CatSTR.put(Cat.NTC_B2a, "");
+        CatSTR.put(Cat.NTC_B2a, "");
+        CatSTR.put(Cat.NTC_B3a, "");
+        CatSTR.put(Cat.NTC_B3a, "");
+        CatSTR.put(Cat.NTC_B4a, "");
+        CatSTR.put(Cat.NTC_B4a, "");
+        CatSTR.put(Cat.NTC_B5, "");
+        CatSTR.put(Cat.NTC_B6, "");
+        CatSTR.put(Cat.NTC_B7, "");
+        CatSTR.put(Cat.NTC_B8, "");
+        CatSTR.put(Cat.NTC_B9a, "");
+        CatSTR.put(Cat.NTC_B9b, "");
+        CatSTR.put(Cat.NTC_B11, "");
+        CatSTR.put(Cat.NTC_C1, "");
+        CatSTR.put(Cat.NTC_C2, "");
+        CatSTR.put(Cat.NTC_C3, "");
+        CatSTR.put(Cat.NTC_C4, "");
+        CatSTR.put(Cat.NTC_C5a, "");
+        CatSTR.put(Cat.NTC_C5b, "");
+        CatSTR.put(Cat.NTC_D1a, "");
+        CatSTR.put(Cat.NTC_D1b, "");
+        CatSTR.put(Cat.NTC_D2a, "");
+        CatSTR.put(Cat.NTC_D2b, "");
+        CatSTR.put(Cat.NTC_D3a, "");
+        CatSTR.put(Cat.NTC_D3b, "");
+    }
+
+    private Cat category = Cat.NOCAT;
+
+    public Cat getCategory() {
+        return category;
+    }
+
+    public void setCategory(Cat cat) {
+        category = cat;
+        repaint();
+    }
+
+    public enum Shp {
+        UNKSHP, PILLAR, SPAR, CAN, CONI, SPHERI, BARREL, FLOAT, SUPER, BUOYANT, CAIRN, PILE, LATTICE, TOWER, STAKE, POLE, POST, PERCH, BUOY, BEACON
+    }
+
+    public static final EnumMap<Shp, String> ShpSTR = new EnumMap<>(Shp.class);
+    static {
+        ShpSTR.put(Shp.PILLAR, "pillar");
+        ShpSTR.put(Shp.SPAR, "spar");
+        ShpSTR.put(Shp.CAN, "can");
+        ShpSTR.put(Shp.CONI, "conical");
+        ShpSTR.put(Shp.SPHERI, "spherical");
+        ShpSTR.put(Shp.BARREL, "barrel");
+        ShpSTR.put(Shp.FLOAT, "float");
+        ShpSTR.put(Shp.SUPER, "super-buoy");
+        ShpSTR.put(Shp.BUOYANT, "buoyant");
+        ShpSTR.put(Shp.CAIRN, "cairn");
+        ShpSTR.put(Shp.PILE, "pile");
+        ShpSTR.put(Shp.LATTICE, "lattice");
+        ShpSTR.put(Shp.TOWER, "tower");
+        ShpSTR.put(Shp.STAKE, "stake");
+        ShpSTR.put(Shp.PERCH, "perch");
+    }
+
+    private Shp shape = Shp.UNKSHP;
+
+    public Shp getShape() {
+        return shape;
+    }
+
+    public void setShape(Shp shp) {
+        shape = shp;
+        repaint();
+    }
+
+    public enum Col {
+        UNKCOL, BLANK, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, GREY, BROWN, MAGENTA, PINK
+    }
+
+    public static final EnumMap<Col, Color> ColMAP = new EnumMap<>(Col.class);
+    static {
+        ColMAP.put(Col.UNKCOL, new Color(0xc0c0c0));
+        ColMAP.put(Col.WHITE, Color.WHITE);
+        ColMAP.put(Col.RED, Color.RED);
+        ColMAP.put(Col.ORANGE, Color.ORANGE);
+        ColMAP.put(Col.AMBER, new Color(0xfbf00f));
+        ColMAP.put(Col.YELLOW, Color.YELLOW);
+        ColMAP.put(Col.GREEN, Color.GREEN);
+        ColMAP.put(Col.BLUE, Color.BLUE);
+        ColMAP.put(Col.VIOLET, new Color(0x8f00ff));
+        ColMAP.put(Col.BLACK, Color.BLACK);
+        ColMAP.put(Col.GREY, Color.GRAY);
+        ColMAP.put(Col.BROWN, new Color(0xa45a58));
+        ColMAP.put(Col.MAGENTA, Color.MAGENTA);
+        ColMAP.put(Col.PINK, Color.PINK);
+    }
+
+    public static final EnumMap<Col, String> ColSTR = new EnumMap<>(Col.class);
+    static {
+        ColSTR.put(Col.WHITE, "white");
+        ColSTR.put(Col.RED, "red");
+        ColSTR.put(Col.ORANGE, "orange");
+        ColSTR.put(Col.AMBER, "amber");
+        ColSTR.put(Col.YELLOW, "yellow");
+        ColSTR.put(Col.GREEN, "green");
+        ColSTR.put(Col.BLUE, "blue");
+        ColSTR.put(Col.VIOLET, "violet");
+        ColSTR.put(Col.BLACK, "black");
+        ColSTR.put(Col.GREY, "grey");
+        ColSTR.put(Col.BROWN, "brown");
+        ColSTR.put(Col.MAGENTA, "magenta");
+        ColSTR.put(Col.PINK, "pink");
+    }
+
+    public Col getColour(Ent ent, int idx) {
+        if (ent == Ent.BODY)
+            return getObjColour(idx);
+        else
+            return getTopColour(idx);
+    }
+
+    public void setColour(Ent ent, Col col) {
+        if (ent == Ent.BODY)
+            setObjColour(col);
+        else
+            setTopColour(col);
+    }
+
+    public void setColour(Ent ent, int idx, Col col) {
+        if (ent == Ent.BODY)
+            setObjColour(idx, col);
+        else
+            setTopColour(idx, col);
+    }
+
+    public void addColour(Ent ent, int idx, Col col) {
+        if (ent == Ent.BODY)
+            addObjColour(idx, col);
+        else
+            addTopColour(idx, col);
+    }
+
+    public void subColour(Ent ent, int idx) {
+        if (ent == Ent.BODY)
+            subObjColour(idx);
+        else
+            subTopColour(idx);
+    }
+
+    private ArrayList<Col> bodyColour = new ArrayList<>();
+
+    public Col getObjColour(int i) {
+        if (i < bodyColour.size())
+            return bodyColour.get(i);
+        else
+            return Col.UNKCOL;
+    }
+
+    public void setObjColour(Col col) {
+        bodyColour.clear();
+        bodyColour.add(col);
+        repaint();
+    }
+
+    public void setObjColour(int i, Col col) {
+        if (i < bodyColour.size())
+            bodyColour.set(i, col);
+        repaint();
+    }
+
+    public void addObjColour(int i, Col col) {
+        if (bodyColour.size() >= i)
+            bodyColour.add(i, col);
+        repaint();
+    }
+
+    public void addObjColour(Col col) {
+        bodyColour.add(col);
+        repaint();
+    }
+
+    public void subObjColour(int i) {
+        if (bodyColour.size() > i)
+            bodyColour.remove(i);
+        repaint();
+    }
+
+    private ArrayList<Col> topmarkColour = new ArrayList<>();
+
+    public Col getTopColour(int i) {
+        if (i < topmarkColour.size())
+            return topmarkColour.get(i);
+        else
+            return Col.UNKCOL;
+    }
+
+    public void setTopColour(Col col) {
+        topmarkColour.clear();
+        topmarkColour.add(col);
+        repaint();
+    }
+
+    public void setTopColour(int i, Col col) {
+        if (topmarkColour.size() > i)
+            topmarkColour.set(i, col);
+        repaint();
+    }
+
+    public void addTopColour(int i, Col col) {
+        if (topmarkColour.size() >= i)
+            topmarkColour.add(i, col);
+        repaint();
+    }
+
+    public void addTopColour(Col col) {
+        topmarkColour.add(col);
+        repaint();
+    }
+
+    public void subTopColour(int i) {
+        if (topmarkColour.size() > i)
+            topmarkColour.remove(i);
+        repaint();
+    }
+
+    public enum Chr {
+        UNKCHR, FIXED, FLASH, LFLASH, QUICK, VQUICK, UQUICK, ISOPHASED, OCCULTING, MORSE, ALTERNATING, IQUICK, IVQUICK, IUQUICK
+    }
+
+    public static final Map<EnumSet<Chr>, String> ChrMAP = new HashMap<>();
+    static {
+        ChrMAP.put(EnumSet.of(Chr.FIXED), "F");
+        ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl");
+        ChrMAP.put(EnumSet.of(Chr.LFLASH), "LFl");
+        ChrMAP.put(EnumSet.of(Chr.QUICK), "Q");
+        ChrMAP.put(EnumSet.of(Chr.VQUICK), "VQ");
+        ChrMAP.put(EnumSet.of(Chr.UQUICK), "UQ");
+        ChrMAP.put(EnumSet.of(Chr.ISOPHASED), "Iso");
+        ChrMAP.put(EnumSet.of(Chr.OCCULTING), "Oc");
+        ChrMAP.put(EnumSet.of(Chr.IQUICK), "IQ");
+        ChrMAP.put(EnumSet.of(Chr.IVQUICK), "IVQ");
+        ChrMAP.put(EnumSet.of(Chr.IUQUICK), "IUQ");
+        ChrMAP.put(EnumSet.of(Chr.MORSE), "Mo");
+        ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.FLASH), "FFl");
+        ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LFLASH), "FlLFl");
+        ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.OCCULTING), "FOc");
+        ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LFLASH), "FLFl");
+        ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl");
+        ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LFLASH), "Q+LFl");
+        ChrMAP.put(EnumSet.of(Chr.VQUICK, Chr.LFLASH), "VQ+LFl");
+        ChrMAP.put(EnumSet.of(Chr.UQUICK, Chr.LFLASH), "UQ+LFl");
+        ChrMAP.put(EnumSet.of(Chr.ALTERNATING), "Al");
+        ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc");
+        ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LFLASH), "Al.LFl");
+        ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl");
+        ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED), "Al.F");
+        ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "Al.FFl");
+        ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso");
+    }
+
+    public enum Vis {
+        UNKVIS, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS
+    }
+
+    public static final EnumMap<Vis, String> VisSTR = new EnumMap<>(Vis.class);
+    static {
+        VisSTR.put(Vis.HIGH, "high");
+        VisSTR.put(Vis.LOW, "low");
+        VisSTR.put(Vis.FAINT, "faint");
+        VisSTR.put(Vis.INTEN, "intensified");
+        VisSTR.put(Vis.UNINTEN, "unintensified");
+        VisSTR.put(Vis.REST, "restricted");
+        VisSTR.put(Vis.OBS, "obscured");
+        VisSTR.put(Vis.PARTOBS, "part_obscured");
+    }
+
+    public enum Lit {
+        UNKLIT, VERT, HORIZ, DIR, UPPER, LOWER, LEAD, REAR, FRONT, AERO, AIROBS, FOGDET, FLOOD, STRIP, SUBS, SPOT, MOIRE, EMERG, BEAR
+    }
+
+    public static final EnumMap<Lit, String> LitSTR = new EnumMap<>(Lit.class);
+    static {
+        LitSTR.put(Lit.VERT, "vertical");
+        LitSTR.put(Lit.HORIZ, "horizontal");
+        LitSTR.put(Lit.DIR, "directional");
+        LitSTR.put(Lit.UPPER, "upper");
+        LitSTR.put(Lit.LOWER, "lower");
+        LitSTR.put(Lit.LEAD, "leading");
+        LitSTR.put(Lit.REAR, "rear");
+        LitSTR.put(Lit.FRONT, "front");
+        LitSTR.put(Lit.AERO, "aero");
+        LitSTR.put(Lit.AIROBS, "air_obstruction");
+        LitSTR.put(Lit.FOGDET, "fog_detector");
+        LitSTR.put(Lit.FLOOD, "floodlight");
+        LitSTR.put(Lit.STRIP, "striplight");
+        LitSTR.put(Lit.SUBS, "subsidairy");
+        LitSTR.put(Lit.SPOT, "spotlight");
+        LitSTR.put(Lit.MOIRE, "moire");
+        LitSTR.put(Lit.EMERG, "emergency");
+        LitSTR.put(Lit.BEAR, "bearing");
+    }
+
+    public enum Exh {
+        UNKEXH, H24, DAY, NIGHT, FOG, WARN, STORM
+    }
+
+    public static final EnumMap<Exh, String> ExhSTR = new EnumMap<>(Exh.class);
+    static {
+        ExhSTR.put(Exh.H24, "24h");
+        ExhSTR.put(Exh.DAY, "day");
+        ExhSTR.put(Exh.NIGHT, "night");
+        ExhSTR.put(Exh.FOG, "fog");
+        ExhSTR.put(Exh.WARN, "warning");
+        ExhSTR.put(Exh.STORM, "storm");
+    }
+
+    public enum Att {
+        COL, CHR, GRP, SEQ, PER, LIT, BEG, END, RAD, HGT, RNG, VIS, EXH, ORT, MLT, ALT
+    }
+
+    public Object[] sector = { Col.UNKCOL, "", "", "", "", Lit.UNKLIT, "", "",
+            "", "", "", Vis.UNKVIS, Exh.UNKEXH, "", "", Col.UNKCOL };
+
+    private ArrayList<Object[]> sectors = new ArrayList<>();
+
+    public int getSectorCount() {
+        return sectors.size();
+    }
+
+    public boolean isSectored() {
+        return (sectors.size() > 1);
+    }
+
+    public Object getLightAtt(Att att, int i) {
+        return getLightAtt(att.ordinal(), i);
+    }
+
+    public Object getLightAtt(int att, int i) {
+        if (i < sectors.size())
+            return sectors.get(i)[att];
+        else
+            return null;
+    }
+
+    public void setLightAtt(Att att, int i, Object obj) {
+        setLightAtt(att.ordinal(), i, obj);
+    }
+
+    public void setLightAtt(int att, int i, Object obj) {
+        if (sectors.size() == i)
+            addLight(i);
+        if (sectors.size() > i)
+            switch (att) {
+            case 4:
+            case 8:
+            case 9:
+            case 10:
+                sectors.get(i)[att] = validDecimal((String)obj);
+                break;
+            case 6:
+            case 7:
+            case 13:
+                sectors.get(i)[att] = validDecimal((String)obj, 360);
+                break;
+            default:
+                sectors.get(i)[att] = obj;
+            }
+        repaint();
+    }
+
+    public void addLight(int i) {
+        if (sectors.size() >= i) {
+            if (sectors.size() == 0)
+                sectors.add(sector.clone());
+            else
+                sectors.add(i, sectors.get(0).clone());
+        }
+    }
+
+    public void nulLight(int i) {
+        if (i == 0) {
+            clrLight();
+        } else {
+            sectors.add(i, sector.clone());
+        }
+    }
+
+    public void addLight() {
+        if (sectors.size() == 0)
+            sectors.add(sector.clone());
+        else
+            sectors.add(sectors.get(0).clone());
+    }
+
+    public void delLight(int i) {
+        if (sectors.size() > i)
+            sectors.remove(i);
+        repaint();
+    }
+
+    public void clrLight() {
+        sectors.clear();
+        addLight();
+        setLightRef("");
+        repaint();
+    }
+
+    public enum Pat {
+        NOPAT, HSTRP, VSTRP, DIAG, SQUARED, BORDER, CROSS, SALTIRE
+    }
+
+    public static final EnumMap<Pat, String> PatSTR = new EnumMap<>(Pat.class);
+    static {
+        PatSTR.put(Pat.HSTRP, "horizontal");
+        PatSTR.put(Pat.VSTRP, "vertical");
+        PatSTR.put(Pat.DIAG, "diagonal");
+        PatSTR.put(Pat.SQUARED, "squared");
+        PatSTR.put(Pat.BORDER, "border");
+        PatSTR.put(Pat.CROSS, "cross");
+        PatSTR.put(Pat.SALTIRE, "saltire");
+    }
+
+    public Pat getPattern(Ent ent) {
+        if (ent == Ent.BODY)
+            return getObjPattern();
+        else
+            return getTopPattern();
+    }
+
+    public void setPattern(Ent ent, Pat pat) {
+        if (ent == Ent.BODY)
+            setObjPattern(pat);
+        else
+            setTopPattern(pat);
+    }
+
+    private Pat bodyPattern = Pat.NOPAT;
+
+    public Pat getObjPattern() {
+        return bodyPattern;
+    }
+
+    public void setObjPattern(Pat pat) {
+        bodyPattern = pat;
+    }
+
+    private Pat topPattern = Pat.NOPAT;
+
+    public Pat getTopPattern() {
+        return topPattern;
+    }
+
+    public void setTopPattern(Pat pat) {
+        topPattern = pat;
+    }
+
+    public enum Top {
+        NOTOP, CYL, CONE, SPHERE, X_SHAPE, NORTH, SOUTH, EAST, WEST, SPHERES2, BOARD, RHOMBUS, CIRCLE, TRIANGLE, TRIANGLE_INV, SQUARE
+    }
+
+    public static final EnumMap<Top, String> TopSTR = new EnumMap<>(Top.class);
+    static {
+        TopSTR.put(Top.CYL, "cylinder");
+        TopSTR.put(Top.CONE, "cone, point up");
+        TopSTR.put(Top.SPHERE, "sphere");
+        TopSTR.put(Top.X_SHAPE, "x-shape");
+        TopSTR.put(Top.NORTH, "2 cones up");
+        TopSTR.put(Top.SOUTH, "2 cones down");
+        TopSTR.put(Top.EAST, "2 cones base together");
+        TopSTR.put(Top.WEST, "2 cones point together");
+        TopSTR.put(Top.SPHERES2, "2 spheres");
+        TopSTR.put(Top.BOARD, "board");
+        TopSTR.put(Top.RHOMBUS, "rhombus");
+        TopSTR.put(Top.CIRCLE, "circle");
+        TopSTR.put(Top.TRIANGLE, "triangle, point up");
+        TopSTR.put(Top.TRIANGLE_INV, "triangle, point down");
+        TopSTR.put(Top.SQUARE, "square");
+    }
+
+    private Top topShape = Top.NOTOP;
+
+    public Top getTopmark() {
+        return topShape;
+    }
+
+    public void setTopmark(Top top) {
+        topShape = top;
+        repaint();
+    }
+
+    private Cat RoType = Cat.NOROS;
+
+    public Cat getRadio() {
+        return RoType;
+    }
+
+    public void setRadio(Cat type) {
+        RoType = type;
+        repaint();
+    }
+
+    public enum Rtb {
+        NORTB, REFLECTOR, RACON, RAMARK, LEADING
+    }
+
+    public static final EnumMap<Rtb, String> RtbSTR = new EnumMap<>(Rtb.class);
+    static {
+        RtbSTR.put(Rtb.RACON, "racon");
+        RtbSTR.put(Rtb.RAMARK, "ramark");
+        RtbSTR.put(Rtb.LEADING, "leading");
+    }
+
+    private Rtb RaType = Rtb.NORTB;
+
+    public Rtb getRadar() {
+        return RaType;
+    }
+
+    public void setRadar(Rtb type) {
+        RaType = type;
+        if (type == Rtb.NORTB) {
+            setRaconGroup("");
+            setRaconSequence("");
+            setRaconPeriod("");
+            setRaconRange("");
+            setRaconSector1("");
+            setRaconSector2("");
+        }
+        repaint();
+    }
+
+    private String raconGroup = "";
+
+    public String getRaconGroup() {
+        return raconGroup;
+    }
+
+    public void setRaconGroup(String grp) {
+        raconGroup = grp;
+        repaint();
+    }
+
+    private String raconSequence = "";
+
+    public String getRaconSequence() {
+        return raconSequence;
+    }
+
+    public void setRaconSequence(String seq) {
+        raconSequence = seq;
+        repaint();
+    }
+
+    private String raconPeriod = "";
+
+    public String getRaconPeriod() {
+        return raconPeriod;
+    }
+
+    public void setRaconPeriod(String per) {
+        raconPeriod = validDecimal(per);
+        repaint();
+    }
+
+    private String raconRange = "";
+
+    public String getRaconRange() {
+        return raconRange;
+    }
+
+    public void setRaconRange(String rng) {
+        raconRange = validDecimal(rng);
+        repaint();
+    }
+
+    private String raconSector1 = "";
+
+    public String getRaconSector1() {
+        return raconSector1;
+    }
+
+    public void setRaconSector1(String sec) {
+        raconSector1 = validDecimal(sec);
+        repaint();
+    }
+
+    private String raconSector2 = "";
+
+    public String getRaconSector2() {
+        return raconSector2;
+    }
+
+    public void setRaconSector2(String sec) {
+        raconSector2 = validDecimal(sec);
+        repaint();
+    }
+
+    public enum Fog {
+        NOFOG, FOGSIG, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS
+    }
+
+    public static final EnumMap<Fog, String> FogSTR = new EnumMap<>(Fog.class);
+    static {
+        FogSTR.put(Fog.FOGSIG, "yes");
+        FogSTR.put(Fog.HORN, "horn");
+        FogSTR.put(Fog.SIREN, "siren");
+        FogSTR.put(Fog.DIA, "diaphone");
+        FogSTR.put(Fog.BELL, "bell");
+        FogSTR.put(Fog.WHIS, "whistle");
+        FogSTR.put(Fog.GONG, "gong");
+        FogSTR.put(Fog.EXPLOS, "explosion");
+    }
+
+    private Fog fogSound = Fog.NOFOG;
+
+    public Fog getFogSound() {
+        return fogSound;
+    }
+
+    public void setFogSound(Fog sound) {
+        fogSound = sound;
+        if (sound == Fog.NOFOG) {
+            setFogGroup("");
+            setFogSequence("");
+            setFogPeriod("");
+            setFogRange("");
+        }
+        repaint();
+    }
+
+    private String fogGroup = "";
+
+    public String getFogGroup() {
+        return fogGroup;
+    }
+
+    public void setFogGroup(String grp) {
+        fogGroup = grp;
+        repaint();
+    }
+
+    private String fogSequence = "";
+
+    public String getFogSequence() {
+        return fogSequence;
+    }
+
+    public void setFogSequence(String seq) {
+        fogSequence = seq;
+        repaint();
+    }
+
+    private String fogRange = "";
+
+    public String getFogRange() {
+        return fogRange;
+    }
+
+    public void setFogRange(String rng) {
+        fogRange = validDecimal(rng);
+        repaint();
+    }
+
+    private String fogPeriod = "";
+
+    public String getFogPeriod() {
+        return fogPeriod;
+    }
+
+    public void setFogPeriod(String per) {
+        fogPeriod = validDecimal(per);
+        repaint();
+    }
+
+    public enum Sts {
+        UNKSTS, PERM, OCC, REC, NIU, INT, RESV, TEMP, PRIV, MAND, DEST, EXT, ILLUM, HIST, PUB, SYNC, WATCH, UNWAT, DOUBT
+    }
+
+    public static final EnumMap<Sts, String> StsSTR = new EnumMap<>(Sts.class);
+    static {
+        StsSTR.put(Sts.PERM, "permanent");
+        StsSTR.put(Sts.OCC, "occasional");
+        StsSTR.put(Sts.REC, "recommended");
+        StsSTR.put(Sts.NIU, "not_in_use");
+        StsSTR.put(Sts.INT, "intermittent");
+        StsSTR.put(Sts.RESV, "reserved");
+        StsSTR.put(Sts.TEMP, "tempory");
+        StsSTR.put(Sts.PRIV, "private");
+        StsSTR.put(Sts.MAND, "mandatory");
+        StsSTR.put(Sts.DEST, "destroyed");
+        StsSTR.put(Sts.EXT, "extinguished");
+        StsSTR.put(Sts.ILLUM, "illuminated");
+        StsSTR.put(Sts.HIST, "historic");
+        StsSTR.put(Sts.PUB, "public");
+        StsSTR.put(Sts.SYNC, "synchronized");
+        StsSTR.put(Sts.WATCH, "watched");
+        StsSTR.put(Sts.UNWAT, "unwatched");
+        StsSTR.put(Sts.DOUBT, "existence_doubtful");
+    }
+
+    private Sts status = Sts.UNKSTS;
+
+    public Sts getStatus() {
+        return status;
+    }
+
+    public void setStatus(Sts sts) {
+        status = sts;
+    }
+
+    public enum Cns {
+        UNKCNS, BRICK, CONC, BOULD, HSURF, USURF, WOOD, METAL, GLAS, PAINT
+    }
+
+    public static final EnumMap<Cns, String> CnsSTR = new EnumMap<>(Cns.class);
+    static {
+        CnsSTR.put(Cns.BRICK, "masonry");
+        CnsSTR.put(Cns.CONC, "concreted");
+        CnsSTR.put(Cns.BOULD, "boulders");
+        CnsSTR.put(Cns.HSURF, "hard_surfaced");
+        CnsSTR.put(Cns.USURF, "unsurfaced");
+        CnsSTR.put(Cns.WOOD, "wooden");
+        CnsSTR.put(Cns.METAL, "metal");
+        CnsSTR.put(Cns.GLAS, "grp");
+        CnsSTR.put(Cns.PAINT, "painted");
+    }
+
+    private Cns construction = Cns.UNKCNS;
+
+    public Cns getConstr() {
+        return construction;
+    }
+
+    public void setConstr(Cns cns) {
+        construction = cns;
+    }
+
+    public enum Con {
+        UNKCON, CONSP, NCONS, REFL
+    }
+
+    public static final EnumMap<Con, String> ConSTR = new EnumMap<>(Con.class);
+    static {
+        ConSTR.put(Con.CONSP, "conspicuous");
+        ConSTR.put(Con.NCONS, "not_conspicuous");
+        ConSTR.put(Con.REFL, "reflector");
+    }
+
+    private Con conspicuity = Con.UNKCON;
+
+    public Con getConsp() {
+        return conspicuity;
+    }
+
+    public void setConsp(Con con) {
+        conspicuity = con;
+    }
+
+    private Con reflectivity = Con.UNKCON;
+
+    public Con getRefl() {
+        return reflectivity;
+    }
+
+    public void setRefl(Con con) {
+        reflectivity = con;
+    }
+
+    public enum Fnc {
+      UNKFNC, HMO, CSTM, HLTH, HOSP, POFF, HOTEL, RWSTA, POLICE, WPOL, PILO, PILL, BANK, DCHQ, TRNS, FACT, PWRS, ADMIN, EDUC, CHCH, CHPL,
+      TMPL, PGDA, SHSH, BTMP, MOSQ, MRBT, LOOK, COMS, TV, RADO, RADR, LSUP, MWAV, COOL, OBSV, TIMB, CLK, CTRL, AMOR, STAD, BUSS,
+      PRHB, RGLN, RSTN, RCMD, INFO
+    }
+
+    public static final EnumMap<Fnc, String> FncSTR = new EnumMap<>(Fnc.class);
+    static {
+        FncSTR.put(Fnc.UNKFNC, "");
+        FncSTR.put(Fnc.HMO, "harbour-master");
+        FncSTR.put(Fnc.CSTM, "customs");
+        FncSTR.put(Fnc.HLTH, "health");
+        FncSTR.put(Fnc.HOSP, "hospital");
+        FncSTR.put(Fnc.POFF, "post_office");
+        FncSTR.put(Fnc.HOTEL, "hotel");
+        FncSTR.put(Fnc.RWSTA, "railway_station");
+        FncSTR.put(Fnc.POLICE, "police_station");
+        FncSTR.put(Fnc.WPOL, "water-police_station");
+        FncSTR.put(Fnc.PILO, "pilot_office");
+        FncSTR.put(Fnc.PILL, "pilot_lookout");
+        FncSTR.put(Fnc.BANK, "bank");
+        FncSTR.put(Fnc.DCHQ, "district_control");
+        FncSTR.put(Fnc.TRNS, "transit_shed");
+        FncSTR.put(Fnc.FACT, "factory");
+        FncSTR.put(Fnc.PWRS, "power_station");
+        FncSTR.put(Fnc.ADMIN, "administrative");
+        FncSTR.put(Fnc.EDUC, "educational");
+        FncSTR.put(Fnc.CHCH, "church");
+        FncSTR.put(Fnc.CHPL, "chapel");
+        FncSTR.put(Fnc.TMPL, "temple");
+        FncSTR.put(Fnc.PGDA, "pagoda");
+        FncSTR.put(Fnc.SHSH, "shinto_shrine");
+        FncSTR.put(Fnc.BTMP, "buddhist_temple");
+        FncSTR.put(Fnc.MOSQ, "mosque");
+        FncSTR.put(Fnc.MRBT, "marabout");
+        FncSTR.put(Fnc.LOOK, "lookout");
+        FncSTR.put(Fnc.COMS, "communication");
+        FncSTR.put(Fnc.TV, "television");
+        FncSTR.put(Fnc.RADO, "radio");
+        FncSTR.put(Fnc.RADR, "radar");
+        FncSTR.put(Fnc.LSUP, "light_support");
+        FncSTR.put(Fnc.MWAV, "microwave");
+        FncSTR.put(Fnc.COOL, "cooling");
+        FncSTR.put(Fnc.OBSV, "observation");
+        FncSTR.put(Fnc.TIMB, "time_ball");
+        FncSTR.put(Fnc.CLK, "clock");
+        FncSTR.put(Fnc.CTRL, "control");
+        FncSTR.put(Fnc.AMOR, "airship_mooring");
+        FncSTR.put(Fnc.STAD, "stadium");
+        FncSTR.put(Fnc.BUSS, "bus_station");
+        FncSTR.put(Fnc.PRHB, "prohibition");
+        FncSTR.put(Fnc.RGLN, "regulation");
+        FncSTR.put(Fnc.RSTN, "restriction");
+        FncSTR.put(Fnc.RCMD, "recommendation");
+        FncSTR.put(Fnc.INFO, "information");
+    }
+
+    private Fnc function = Fnc.UNKFNC;
+
+    public Fnc getFunc() {
+        return function;
+    }
+
+    public void setFunc(Fnc fnc) {
+        function = fnc;
+        repaint();
+    }
+
+    public String information = "";
+
+    public String getInfo() {
+        return information;
+    }
+
+    public void setInfo(String str) {
+        information = str.trim();
+    }
+
+    public String source = "";
+
+    public String getSource() {
+        return source;
+    }
+
+    public void setSource(String str) {
+        source = str.trim();
+    }
+
+    public String elevation = "";
+
+    public String getElevation() {
+        return elevation;
+    }
+
+    public void setElevation(String str) {
+        elevation = validDecimal(str);
+    }
+
+    public String height = "";
+
+    public String getObjectHeight() {
+        return height;
+    }
+
+    public void setObjectHeight(String str) {
+        height = validDecimal(str);
+    }
+
+    private String channel = "";
+
+    public String getChannel() {
+        return channel;
+    }
+
+    public void setChannel(String per) {
+        channel = validDecimal(per);
+        repaint();
+    }
+
+    public String ref = "";
+
+    public String getRef() {
+        return ref;
+    }
+
+    public void setRef(String str) {
+        ref = str;
+    }
+
+    public String lightRef = "";
+
+    public String getLightRef() {
+        return lightRef;
+    }
+
+    public void setLightRef(String str) {
+        lightRef = str;
+    }
+
+    public String fixme = "";
+
+    public String getFixme() {
+        return fixme;
+    }
+
+    public void setFixme(String str) {
+        fixme = str;
+    }
+
+    public boolean testValid() {
+        if (dlg.node == null) return false;
+        boolean tmp = false;
+        PanelMain.messageBar.setText("");
+        switch (getObject()) {
+        case BCNCAR:
+        case BCNLAT:
+        case BOYCAR:
+        case BOYLAT:
+            if ((getCategory() != Cat.NOCAT) && (getShape() != Shp.UNKSHP))
+                tmp = true;
+            break;
+        case BCNISD:
+        case BCNSAW:
+        case BCNSPP:
+        case BOYISD:
+        case BOYSAW:
+        case BOYSPP:
+            if (getShape() != Shp.UNKSHP)
+                tmp = true;
+            break;
+        case FLTCAR:
+        case FLTISD:
+        case FLTLAT:
+        case FLTSAW:
+        case FLTSPP:
+            if (getObjColour(0) != Col.UNKCOL)
+                tmp = true;
+            break;
+        case LITMAJ:
+        case LITMIN:
+        case LITFLT:
+        case LITVES:
+        case LITHSE:
+        case SISTAW:
+        case SISTAT:
+        case OFSPLF:
+        case MORFAC:
+        case BOYINB:
+        case PILBOP:
+        case RSCSTA:
+        case RDOSTA:
+        case RADSTA:
+             tmp = true;
+            break;
+        case NOTMRK:
+            if (getCategory() != Cat.NOCAT) 
+                tmp = true;
+        case LNDMRK:
+            if ((getCategory() != Cat.NOCAT) || (getFunc() != Fnc.UNKFNC))
+                tmp = true;
+            break;
+        }
+        if (tmp) {
+            SmedAction.panelMain.moreButton.setVisible(true);
+            SmedAction.panelMain.saveButton.setEnabled(true);
+            SmedAction.panelMain.topButton.setEnabled(true);
+            SmedAction.panelMain.fogButton.setEnabled(true);
+            SmedAction.panelMain.radButton.setEnabled(true);
+            SmedAction.panelMain.litButton.setEnabled(true);
+            return true;
+        } else {
+            SmedAction.panelMain.moreButton.setVisible(false);
+            SmedAction.panelMain.moreButton.setText(">>");
+            SmedAction.panelMain.topButton.setEnabled(false);
+            SmedAction.panelMain.fogButton.setEnabled(false);
+            SmedAction.panelMain.radButton.setEnabled(false);
+            SmedAction.panelMain.litButton.setEnabled(false);
+            PanelMain.messageBar.setText("Seamark not recognised");
+            return false;
+        }
+    }
+
+    public void clrMark() {
+        setName("");
+        setObject(Obj.UNKOBJ);
+        clrLight();
+        setFogSound(Fog.NOFOG);
+        setRadar(Rtb.NORTB);
+        setRadio(Cat.NOROS);
+        setStatus(Sts.UNKSTS);
+        setConstr(Cns.UNKCNS);
+        setConsp(Con.UNKCON);
+        setRefl(Con.UNKCON);
+        setRef("");
+        setObjectHeight("");
+        setElevation("");
+        setChannel("");
+        setInfo("");
+        setSource("");
+        setFixme("");
+        SmedAction.panelMain.syncPanel();
+        repaint();
+    }
+
+    public String validDecimal(String str) {
+        str = str.trim().replace(',', '.');
+        if (!(str.isEmpty()) && !(str.matches("^[+-]??\\d+(\\.\\d+)??$"))) {
+            PanelMain.messageBar.setText(Messages.getString("NotDecimal"));
+            return "";
+        } else {
+            PanelMain.messageBar.setText("");
+            return str;
+        }
+    }
+
+    public String validDecimal(String str, float max) {
+        str = validDecimal(str);
+        if (!(str.isEmpty()) && (new Float(str) > max)) {
+            PanelMain.messageBar.setText(Messages.getString("TooBig") + " (" + max + ")");
+            return "";
+        } else {
+            PanelMain.messageBar.setText("");
+            return str;
+        }
+    }
+
+    public void parseMark(OsmPrimitive node) {
+        PanelMain.messageBar.setText("");
+        String str = Main.pref.get("smedplugin.IALA");
+        if (str.equals("C"))
+            setRegion(Reg.C);
+        else if (str.equals("B"))
+            setRegion(Reg.B);
+        else
+            setRegion(Reg.A);
+
+        Map<String, String> keys = node.getKeys();
+
+        str = "";
+        if (keys.containsKey("seamark:type"))
+            str = keys.get("seamark:type");
+
+        clrMark();
+        for (Obj obj : ObjSTR.keySet()) {
+            if (ObjSTR.get(obj).equals(str)) {
+                setObject(obj);
+            }
+        }
+
+        if (str.equals("")) {
+            PanelMain.messageBar.setText("No seamark");
+        }
+        if (getObject() == Obj.UNKOBJ) {
+            PanelMain.messageBar.setText("Seamark not recognised");
+        }
+
+        setName("");
+        for (Obj obj : ObjSTR.keySet()) {
+            if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":name")) {
+                str = keys.get("seamark:" + ObjSTR.get(obj) + ":name");
+                setName(str);
+            }
+        }
+        if (keys.containsKey("seamark:name")) {
+            str = keys.get("seamark:name");
+            setName(str);
+        }
+        
+        for (Obj obj : ObjSTR.keySet()) {
+            if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":category")) {
+                str = keys.get("seamark:" + ObjSTR.get(obj) + ":category");
+                if (obj == getObject()) {
+                    setCategory(Cat.NOCAT);
+                    for (Cat cat : CatSTR.keySet()) {
+                        if (CatSTR.get(cat).equals(str)) {
+                            setCategory(cat);
+                        }
+                    }
+                }
+            }
+        }
+
+        for (Obj obj : ObjSTR.keySet()) {
+            if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":shape")) {
+                str = keys.get("seamark:" + ObjSTR.get(obj) + ":shape");
+                setShape(Shp.UNKSHP);
+                for (Shp shp : ShpSTR.keySet()) {
+                    if (ShpSTR.get(shp).equals(str)) {
+                        setShape(shp);
+                    }
+                }
+            }
+        }
+        if (getShape() == Shp.UNKSHP) {
+            if (EntMAP.get(getObject()) == Ent.BUOY)
+                setShape(Shp.BUOY);
+            if (EntMAP.get(getObject()) == Ent.BEACON)
+                setShape(Shp.BEACON);
+            if (EntMAP.get(getObject()) == Ent.LFLOAT)
+                if (getObject() == Obj.LITVES)
+                    setShape(Shp.SUPER);
+                else
+                    setShape(Shp.FLOAT);
+        }
+
+        for (Obj obj : ObjSTR.keySet()) {
+            if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":colour")) {
+                str = keys.get("seamark:" + ObjSTR.get(obj) + ":colour");
+                bodyColour.clear();
+                for (String item : str.split(";")) {
+                    for (Col col : ColSTR.keySet()) {
+                        if (ColSTR.get(col).equals(item)) {
+                            bodyColour.add(col);
+                        }
+                    }
+                }
+            }
+        }
+
+        for (Obj obj : ObjSTR.keySet()) {
+            if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":colour_pattern")) {
+                str = keys.get("seamark:" + ObjSTR.get(obj) + ":colour_pattern");
+                setObjPattern(Pat.NOPAT);
+                for (Pat pat : PatSTR.keySet()) {
+                    if (PatSTR.get(pat).equals(str)) {
+                        setObjPattern(pat);
+                    }
+                }
+            }
+
+            if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":height")) {
+                setObjectHeight(keys.get("seamark:" + ObjSTR.get(obj) + ":height"));
+            }
+            if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":elevation")) {
+                setElevation(keys.get("seamark:" + ObjSTR.get(obj) + ":elevation"));
+            }
+            if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":channel")) {
+                setChannel(keys.get("seamark:" + ObjSTR.get(obj) + ":channel"));
+            }
+        }
+
+        for (Obj obj : ObjSTR.keySet()) {
+            if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":function")) {
+                str = keys.get("seamark:" + ObjSTR.get(obj) + ":function");
+                setFunc(Fnc.UNKFNC);
+                for (Fnc fnc : FncSTR.keySet()) {
+                    if (FncSTR.get(fnc).equals(str)) {
+                        setFunc(fnc);
+                    }
+                }
+            }
+        }
+
+        if ((getObject() == Obj.LNDMRK) && (getCategory() == Cat.NOCAT) && (getFunc() == Fnc.UNKFNC)) {
+            setObject(Obj.LITHSE);
+        }
+
+        if (getObject() == Obj.LITFLT) {
+            switch (getObjColour(0)) {
+            case RED:
+                if ((getObjColour(1) == Col.WHITE) && (getObjColour(2) == Col.UNKCOL)) {
+                    setObject(Obj.FLTSAW);
+                    setCategory(Cat.NOCAT);
+                } else if (getObjColour(1) == Col.UNKCOL) {
+                    setObject(Obj.FLTLAT);
+                    if (getRegion() == Reg.B) {
+                        setCategory(Cat.LAM_STBD);
+                    } else {
+                        setCategory(Cat.LAM_PORT);
+                    }
+                } else if ((getObjColour(1) == Col.GREEN)
+                        && (getObjColour(2) == Col.RED)) {
+                    setObject(Obj.FLTLAT);
+                    if (getRegion() == Reg.B) {
+                        setCategory(Cat.LAM_PSTBD);
+                    } else {
+                        setCategory(Cat.LAM_PPORT);
+                    }
+                } else if ((getObjColour(1) == Col.WHITE)
+                        && (getObjColour(2) == Col.RED)) {
+                    setObject(Obj.FLTLAT);
+                    setCategory(Cat.LAM_PORT);
+                } else {
+                    setObject(Obj.FLTSPP);
+                    setCategory(Cat.NOCAT);
+                }
+                break;
+            case GREEN:
+                if (getObjColour(1) == Col.UNKCOL) {
+                    setObject(Obj.FLTLAT);
+                    if (getRegion() == Reg.B) {
+                        setCategory(Cat.LAM_PORT);
+                    } else {
+                        setCategory(Cat.LAM_STBD);
+                    }
+                } else if ((getObjColour(1) == Col.RED)
+                        && (getObjColour(2) == Col.GREEN)) {
+                    setObject(Obj.FLTLAT);
+                    if (getRegion() == Reg.B) {
+                        setCategory(Cat.LAM_PPORT);
+                    } else {
+                        setCategory(Cat.LAM_PSTBD);
+                    }
+                } else if ((getObjColour(1) == Col.WHITE)
+                        && (getObjColour(2) == Col.GREEN)) {
+                    setObject(Obj.FLTLAT);
+                    setCategory(Cat.LAM_STBD);
+                } else {
+                    setObject(Obj.FLTSPP);
+                    setCategory(Cat.NOCAT);
+                }
+                break;
+            case YELLOW:
+                if (getObjColour(1) == Col.BLACK) {
+                    setObject(Obj.FLTCAR);
+                    if (getObjColour(2) == Col.YELLOW) {
+                        setCategory(Cat.CAM_WEST);
+                    } else {
+                        setCategory(Cat.CAM_SOUTH);
+                    }
+                } else {
+                    setObject(Obj.FLTSPP);
+                    setCategory(Cat.NOCAT);
+                }
+                break;
+            case BLACK:
+                if (getObjColour(1) == Col.RED) {
+                    setObject(Obj.FLTISD);
+                    setCategory(Cat.NOCAT);
+                } else if (getObjColour(1) == Col.YELLOW) {
+                    setObject(Obj.FLTCAR);
+                    if (getObjColour(2) == Col.BLACK) {
+                        setCategory(Cat.CAM_EAST);
+                    } else {
+                        setCategory(Cat.CAM_NORTH);
+                    }
+                } else {
+                    setObject(Obj.FLTSPP);
+                    setCategory(Cat.NOCAT);
+                }
+                break;
+            default:
+                setCategory(Cat.NOCAT);
+            }
+        }
+
+        for (Obj obj : ObjSTR.keySet()) {
+            if (keys.containsKey("seamark:" + ObjSTR.get(obj) + ":system")) {
+                str = keys.get("seamark:" + ObjSTR.get(obj) + ":system");
+                if (str.equals("iala-a"))
+                    setRegion(Reg.A);
+                else if (str.equals("iala-b"))
+                    setRegion(Reg.B);
+                else
+                    setRegion(Reg.C);
+            } else if (GrpMAP.get(object) == Grp.LAT) {
+                switch (getCategory()) {
+                case LAM_PORT:
+                    if (getObjColour(0) == Col.RED) {
+                        if (getObjColour(1) == Col.WHITE)
+                            setRegion(Reg.C);
+                        else
+                            setRegion(Reg.A);
+                    }
+                    if (getObjColour(0) == Col.GREEN)
+                        setRegion(Reg.B);
+                    break;
+                case LAM_PPORT:
+                    if (getObjColour(0) == Col.RED) {
+                        if (getObjColour(3) == Col.GREEN)
+                            setRegion(Reg.C);
+                        else
+                            setRegion(Reg.B);
+                    }
+                    if (getObjColour(0) == Col.GREEN)
+                        setRegion(Reg.A);
+                    break;
+                case LAM_STBD:
+                    if (getObjColour(0) == Col.GREEN) {
+                        if (getObjColour(1) == Col.WHITE)
+                            setRegion(Reg.C);
+                        else
+                            setRegion(Reg.A);
+                    }
+                    if (getObjColour(0) == Col.RED)
+                        setRegion(Reg.B);
+                    break;
+                case LAM_PSTBD:
+                    if (getObjColour(0) == Col.GREEN)
+                        setRegion(Reg.B);
+                    if (getObjColour(0) == Col.RED) {
+                        if (getObjColour(3) == Col.GREEN)
+                            setRegion(Reg.C);
+                        else
+                            setRegion(Reg.A);
+                    }
+                    break;
+                }
+            }
+        }
+
+        if (keys.containsKey("seamark:topmark:shape")) {
+            str = keys.get("seamark:topmark:shape");
+            setTopmark(Top.NOTOP);
+            for (Top top : TopSTR.keySet()) {
+                if (TopSTR.get(top).equals(str)) {
+                    setTopmark(top);
+                }
+            }
+        }
+        if (keys.containsKey("seamark:topmark:colour")) {
+            str = keys.get("seamark:topmark:colour");
+            setTopColour(Col.UNKCOL);
+            for (Col col : ColSTR.keySet()) {
+                if (ColSTR.get(col).equals(str)) {
+                    setTopColour(col);
+                }
+            }
+        }
+        if (keys.containsKey("seamark:topmark:colour_pattern")) {
+            str = keys.get("seamark:topmark:colour_pattern");
+            setTopPattern(Pat.NOPAT);
+            for (Pat pat : PatSTR.keySet()) {
+                if (PatSTR.get(pat).equals(str)) {
+                    setTopPattern(pat);
+                }
+            }
+        }
+
+        clrLight();
+        for (int i = 0; i < 30; i++) {
+            String secStr = (i == 0) ? "" : (":" + Integer.toString(i));
+            if (keys.containsKey("seamark:light" + secStr + ":colour")) {
+                nulLight(i);
+                str = keys.get("seamark:light" + secStr + ":colour");
+                if (str.contains(";")) {
+                    String strs[] = str.split(";");
+                    for (Col col : ColSTR.keySet())
+                        if ((strs.length > 1) && ColSTR.get(col).equals(strs[1]))
+                            setLightAtt(Att.ALT, i, col);
+                    str = strs[0];
+                }
+                for (Col col : ColSTR.keySet())
+                    if (ColSTR.get(col).equals(str))
+                        setLightAtt(Att.COL, i, col);
+            }
+            if (keys.containsKey("seamark:light" + secStr + ":character")) {
+                str = keys.get("seamark:light" + secStr + ":character");
+                if (str.contains("(") && str.contains(")")) {
+                    int i1 = str.indexOf("(");
+                    int i2 = str.indexOf(")");
+                    setLightAtt(Att.GRP, i, str.substring((i1+1), i2));
+                    str = str.substring(0, i1) + str.substring((i2+1), str.length());
+                    }
+                setLightAtt(Att.CHR, i, str);
+            }
+            if (keys.containsKey("seamark:light" + secStr + ":group"))
+                setLightAtt(Att.GRP, i, keys.get("seamark:light" + secStr + ":group"));
+            if (keys.containsKey("seamark:light" + secStr + ":sequence"))
+                setLightAtt(Att.SEQ, i, keys.get("seamark:light" + secStr + ":sequence"));
+            if (keys.containsKey("seamark:light" + secStr + ":period"))
+                setLightAtt(Att.PER, i, keys.get("seamark:light" + secStr + ":period"));
+            if (keys.containsKey("seamark:light" + secStr + ":category")) {
+                str = keys.get("seamark:light" + secStr + ":category");
+                if (str.equals("vert"))
+                    str = "vertical";
+                if (str.equals("horiz"))
+                    str = "horizontal";
+                for (Lit lit : LitSTR.keySet())
+                    if (LitSTR.get(lit).equals(str))
+                        setLightAtt(Att.LIT, i, lit);
+            }
+            if (keys.containsKey("seamark:light" + secStr + ":sector_start"))
+                setLightAtt(Att.BEG, i, keys.get("seamark:light" + secStr + ":sector_start"));
+            if (keys.containsKey("seamark:light" + secStr + ":sector_end"))
+                setLightAtt(Att.END, i, keys.get("seamark:light" + secStr + ":sector_end"));
+            if (keys.containsKey("seamark:light" + secStr + ":radius"))
+                setLightAtt(Att.RAD, i, keys.get("seamark:light" + secStr + ":radius"));
+            if (keys.containsKey("seamark:light" + secStr + ":height"))
+                setLightAtt(Att.HGT, i, keys.get("seamark:light" + secStr + ":height"));
+            if (keys.containsKey("seamark:light" + secStr + ":range"))
+                setLightAtt(Att.RNG, i, keys.get("seamark:light" + secStr + ":range"));
+            if (keys.containsKey("seamark:light" + secStr + ":visibility")) {
+                str = keys.get("seamark:light" + secStr + ":visibility");
+                for (Vis vis : VisSTR.keySet())
+                    if (VisSTR.get(vis).equals(str))
+                        setLightAtt(Att.VIS, i, vis);
+            }
+            if (keys.containsKey("seamark:light" + secStr + ":exhibition")) {
+                str = keys.get("seamark:light" + secStr + ":exhibition");
+                for (Exh exh : ExhSTR.keySet())
+                    if (ExhSTR.get(exh).equals(str))
+                        setLightAtt(Att.EXH, i, exh);
+            }
+            if (keys.containsKey("seamark:light" + secStr + ":orientation"))
+                setLightAtt(Att.ORT, i, keys.get("seamark:light" + secStr + ":orientation"));
+            if (keys.containsKey("seamark:light" + secStr + ":multiple"))
+                setLightAtt(Att.MLT, i, keys.get("seamark:light" + secStr + ":multiple"));
+            
+            if (sectors.size() == i)
+                break;
+        }
+
+        if (keys.containsKey("seamark:fog_signal")) {
+            setFogSound(Fog.FOGSIG);
+        }
+        if (keys.containsKey("seamark:fog_signal:category")) {
+            str = keys.get("seamark:fog_signal:category");
+            setFogSound(Fog.NOFOG);
+            for (Fog fog : FogSTR.keySet()) {
+                if (FogSTR.get(fog).equals(str)) {
+                    setFogSound(fog);
+                }
+            }
+        }
+        if (keys.containsKey("seamark:fog_signal:group")) {
+            setFogGroup(keys.get("seamark:fog_signal:group"));
+        }
+        if (keys.containsKey("seamark:fog_signal:period")) {
+            setFogPeriod(keys.get("seamark:fog_signal:period"));
+        }
+        if (keys.containsKey("seamark:fog_signal:sequence")) {
+            setFogSequence(keys.get("seamark:fog_signal:sequence"));
+        }
+        if (keys.containsKey("seamark:fog_signal:range")) {
+            setFogRange(keys.get("seamark:fog_signal:range"));
+        }
+
+        if (keys.containsKey("seamark:radio_station:category")) {
+            str = keys.get("seamark:radio_station:category");
+            setRadio(Cat.NOROS);
+            for (Cat rdo : CatSTR.keySet()) {
+                if (CatSTR.get(rdo).equals(str)) {
+                    setRadio(rdo);
+                }
+            }
+        }
+
+        if (keys.containsKey("seamark:radar_reflector")) {
+            setRadar(Rtb.REFLECTOR);
+        }
+        if (keys.containsKey("seamark:radar_transponder:category")) {
+            str = keys.get("seamark:radar_transponder:category");
+            setRadar(Rtb.NORTB);
+            for (Rtb rtb : RtbSTR.keySet()) {
+                if (RtbSTR.get(rtb).equals(str)) {
+                    setRadar(rtb);
+                }
+            }
+        }
+        if (keys.containsKey("seamark:radar_transponder:group")) {
+            setRaconGroup(keys.get("seamark:radar_transponder:group"));
+        }
+        if (keys.containsKey("seamark:radar_transponder:period")) {
+            setRaconPeriod(keys.get("seamark:radar_transponder:period"));
+        }
+        if (keys.containsKey("seamark:radar_transponder:sequence")) {
+            setRaconSequence(keys.get("seamark:radar_transponder:sequence"));
+        }
+        if (keys.containsKey("seamark:radar_transponder:range")) {
+            setRaconRange(keys.get("seamark:radar_transponder:range"));
+        }
+        if (keys.containsKey("seamark:radar_transponder:sector_start")) {
+            setRaconSector1(keys.get("seamark:radar_transponder:sector_start"));
+        }
+        if (keys.containsKey("seamark:radar_transponder:sector_end")) {
+            setRaconSector2(keys.get("seamark:radar_transponder:sector_end"));
+        }
+
+        if (keys.containsKey("seamark:information")) {
+            setInfo(keys.get("seamark:information"));
+        }
+        if (keys.containsKey("seamark:light:information")) {
+            setInfo(getInfo() + keys.get("seamark:light:information"));
+        }
+        if (keys.containsKey("seamark:" + ObjSTR.get(getObject()) + "information")) {
+            setInfo(getInfo() + keys.get("seamark:" + ObjSTR.get(getObject()) + "information"));
+        }
+        if (keys.containsKey("seamark:source")) {
+            setSource(keys.get("seamark:source"));
+        }
+        if (keys.containsKey("seamark:light:source")) {
+            setSource(getSource() + keys.get("seamark:light:source"));
+        }
+        if (keys.containsKey("seamark:" + ObjSTR.get(getObject()) + "source")) {
+            setSource(getSource() + keys.get("seamark:" + ObjSTR.get(getObject()) + "source"));
+        }
+        if (keys.containsKey("seamark:height")) {
+            setObjectHeight(keys.get("seamark:height"));
+        }
+        if (keys.containsKey("seamark:elevation")) {
+            setElevation(keys.get("seamark:elevation"));
+        }
+        if (keys.containsKey("seamark:status")) {
+            str = keys.get("seamark:status");
+            setStatus(Sts.UNKSTS);
+            for (Sts sts : StsSTR.keySet()) {
+                if (StsSTR.get(sts).equals(str)) {
+                    setStatus(sts);
+                }
+            }
+        }
+        if (keys.containsKey("seamark:construction")) {
+            str = keys.get("seamark:construction");
+            setConstr(Cns.UNKCNS);
+            for (Cns cns : CnsSTR.keySet()) {
+                if (CnsSTR.get(cns).equals(str)) {
+                    setConstr(cns);
+                }
+            }
+        }
+        if (keys.containsKey("seamark:conspicuity")) {
+            str = keys.get("seamark:conspicuity");
+            setConsp(Con.UNKCON);
+            for (Con con : ConSTR.keySet()) {
+                if (ConSTR.get(con).equals(str)) {
+                    setConsp(con);
+                }
+            }
+        }
+        if (keys.containsKey("seamark:reflectivity")) {
+            str = keys.get("seamark:reflectivity");
+            setRefl(Con.UNKCON);
+            for (Con con : ConSTR.keySet()) {
+                if (ConSTR.get(con).equals(str)) {
+                    setRefl(con);
+                }
+            }
+        }
+
+        if (keys.containsKey("seamark:ref")) {
+            setRef(keys.get("seamark:ref"));
+        }
+        if (keys.containsKey("seamark:reference")) {
+            setRef(keys.get("seamark:reference"));
+        }
+        if (keys.containsKey("seamark:light:ref")) {
+            setLightRef(keys.get("seamark:light:ref"));
+        }
+        if (keys.containsKey("seamark:light:reference")) {
+            setLightRef(keys.get("seamark:light:reference"));
+        }
+        if (keys.containsKey("seamark:fixme")) {
+            setFixme(keys.get("seamark:fixme"));
+        }
+
+        dlg.panelMain.syncPanel();
+    }
+
+    public void paintComponent(Graphics g) {
+        super.paintComponent(g);
+        
+        if (dlg.node == null) return;
+        
     Graphics2D g2 = (Graphics2D) g;
     
     String colStr;
-		String lblStr;
-		String imgStr = "/images/";
-		if (getShape() != Shp.UNKSHP) {
-			switch (getShape()) {
-			case TOWER:
-				imgStr += "Tower";
-				break;
-			case BUOY:
-			case PILLAR:
-				imgStr += "Pillar";
-				break;
-			case SPAR:
-				imgStr += "Spar";
-				break;
-			case CAN:
-				imgStr += "Can";
-				break;
-			case CONI:
-				imgStr += "Cone";
-				break;
-			case SPHERI:
-				imgStr += "Sphere";
-				break;
-			case BARREL:
-				imgStr += "Barrel";
-				break;
-			case CAIRN:
-				imgStr += "Cairn";
-				break;
-			case FLOAT:
-				imgStr += "Float";
-				break;
-			case BEACON:
-			case PILE:
-			case LATTICE:
-			case BUOYANT:
-				imgStr += "Beacon";
-				break;
-			case SUPER:
-				imgStr += "Super";
-				break;
-			case STAKE:
-			case POLE:
-			case POST:
-				imgStr += "Stake";
-				break;
-			case PERCH:
-				if (getCategory() == Cat.LAM_PORT) {
-					imgStr += "Perch_Port";
-				} else {
-					imgStr += "Perch_Starboard";
-				}
-				break;
-			}
-			colStr = imgStr;
-			lblStr = "";
-			for (Col col : bodyColour) {
-				switch (col) {
-				case WHITE:
-					colStr += "_White";
-					lblStr += "W";
-					break;
-				case RED:
-					colStr += "_Red";
-					lblStr += "R";
-					break;
-				case ORANGE:
-					colStr += "_Orange";
-					lblStr += "Or";
-					break;
-				case AMBER:
-					colStr += "_Amber";
-					lblStr += "Am";
-					break;
-				case YELLOW:
-					colStr += "_Yellow";
-					lblStr += "Y";
-					break;
-				case GREEN:
-					colStr += "_Green";
-					lblStr += "G";
-					break;
-				case BLUE:
-					colStr += "_Blue";
-					lblStr += "Bu";
-					break;
-				case VIOLET:
-					colStr += "_Violet";
-					lblStr += "Vi";
-					break;
-				case BLACK:
-					colStr += "_Black";
-					lblStr += "B";
-					break;
-				case GREY:
-					colStr += "_Grey";
-					lblStr += "Gr";
-					break;
-				case BROWN:
-					colStr += "_Brown";
-					lblStr += "Br";
-					break;
-				case MAGENTA:
-					colStr += "_Magenta";
-					lblStr += "Mg";
-					break;
-				case PINK:
-					colStr += "_Pink";
-					lblStr += "Pk";
-					break;
-				}
-			}
-			if (!imgStr.equals("/images/")) {
-				colStr += ".png";
-				if (getClass().getResource(colStr) == null) {
-					System.out.println("Missing image1: " + colStr);
-					imgStr += ".png";
-					if (getClass().getResource(imgStr) == null) {
-						System.out.println("Missing image2: " + imgStr);
-					} else {
-						g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
-						g2.drawString(lblStr, 75, 110);
-					}
-				} else {
-					g2.drawImage(new ImageIcon(getClass().getResource(colStr)).getImage(), 7, -15, null);
-				}
-			}
-		} else if (getObject() != Obj.UNKOBJ) {
-			switch (getObject()) {
-			case LNDMRK:
-				switch (getCategory()) {
-				case LMK_CHMY:
-					imgStr += "Chimney";
-					break;
-				case LMK_CARN:
-					imgStr += "Cairn";
-					break;
-				case LMK_DSHA:
-					imgStr += "DishAerial";
-					break;
-				case LMK_FLGS:
-					imgStr += "Flagstaff";
-					break;
-				case LMK_FLRS:
-					imgStr += "FlareStack";
-					break;
-				case LMK_MNMT:
-				case LMK_CLMN:
-				case LMK_OBLK:
-				case LMK_STAT:
-					imgStr += "Monument";
-					break;
-				case LMK_MAST:
-					imgStr += "RadioMast";
-					break;
-				case LMK_TOWR:
-					if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL))
-						imgStr += "ChurchTower";
-					else
-						imgStr += "LandTower";
-					break;
-				case LMK_WNDM:
-					imgStr += "Wind_Motor";
-					break;
-				case LMK_WTRT:
-					imgStr += "WaterTower";
-					break;
-				case LMK_DOME:
-					if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL))
-						imgStr += "ChurchDome";
-					else
-						imgStr += "Dome";
-					break;
-				case LMK_SPIR:
-					if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL))
-						imgStr += "ChurchSpire";
-					else
-						imgStr += "Spire";
-					break;
-				case LMK_MNRT:
-					imgStr += "Minaret";
-					break;
-				case LMK_WNDS:
-					imgStr += "Windsock";
-					break;
-				case LMK_CROS:
-					imgStr += "Cross";
-					break;
-				case LMK_SCNR:
-					imgStr += "Signal_Station";
-					break;
-				case LMK_WNDL:
-					imgStr += "Windmill";
-					break;
-				case NOCAT:
-					switch (getFunc()) {
-					case CHCH:
-					case CHPL:
-						imgStr += "Church";
-						break;
-					case TMPL:
-					case PGDA:
-					case SHSH:
-					case BTMP:
-						imgStr += "Temple";
-						break;
-					case MOSQ:
-						imgStr += "Minaret";
-						break;
-					case MRBT:
-						imgStr += "Spire";
-						break;
-					}
-				}
-				break;
-			case LITHSE:
-				imgStr += "Light_House";
-				break;
-			case LITMAJ:
-				imgStr += "Light_Major";
-				break;
-			case LITMIN:
-				imgStr += "Light_Minor";
-				break;
-			case LITFLT:
-				imgStr += "Float";
-				break;
-			case LITVES:
-				imgStr += "Super";
-				break;
-			case SISTAW:
-				imgStr += "Signal_Station";
-				break;
-			case SISTAT:
-				imgStr += "Signal_Station";
-				break;
-			case OFSPLF:
-				if (getCategory() == Cat.OFP_FPSO)
-					imgStr += "Storage";
-				else
-					imgStr += "Platform";
-				break;
-			case MORFAC:
-				switch (getCategory()) {
-				case MOR_DLPN:
-					imgStr += "Dolphin";
-					break;
-				case MOR_DDPN:
-					imgStr += "DeviationDolphin";
-					break;
-				case MOR_POST:
-					imgStr += "Post";
-					break;
-				case MOR_BUOY:
-					imgStr += "Sphere";
-					break;
-				}
-				break;
-			case BOYINB:
-				imgStr += "Super";
-				break;
-			case CGUSTA:
-				imgStr += "Signal_Station";
-				break;
-			case PILBOP:
-				imgStr += "Pilot";
-				break;
-			case RSCSTA:
-				imgStr += "Rescue";
-				break;
-			case RDOSTA:
-			case RADSTA:
-				imgStr += "Signal_Station";
-				g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null);
-				break;
-			}
-			if (!imgStr.equals("/images/")) {
-				imgStr += ".png";
-				if (getClass().getResource(imgStr) == null) {
-					System.out.println("Missing image3: " + imgStr);
-				} else {
-					g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
-				}
-			}
-		}
-
-		if (getTopmark() != Top.NOTOP) {
-			imgStr = "/images/Top_";
-			switch (getTopmark()) {
-			case CYL:
-				imgStr += "Can";
-				break;
-			case CONE:
-				imgStr += "Cone";
-				break;
-			case SPHERE:
-				imgStr += "Sphere";
-				break;
-			case X_SHAPE:
-				imgStr += "X";
-				break;
-			case NORTH:
-				imgStr += "North";
-				break;
-			case SOUTH:
-				imgStr += "South";
-				break;
-			case EAST:
-				imgStr += "East";
-				break;
-			case WEST:
-				imgStr += "West";
-				break;
-			case SPHERES2:
-				imgStr += "Isol";
-				break;
-			}
-			colStr = imgStr;
-			for (Col col : topmarkColour) {
-				switch (col) {
-				case WHITE:
-					colStr += "_White";
-					break;
-				case RED:
-					colStr += "_Red";
-					break;
-				case ORANGE:
-					colStr += "_Orange";
-					break;
-				case AMBER:
-					colStr += "_Amber";
-					break;
-				case YELLOW:
-					colStr += "_Yellow";
-					break;
-				case GREEN:
-					colStr += "_Green";
-					break;
-				case BLUE:
-					colStr += "_Blue";
-					break;
-				case VIOLET:
-					colStr += "_Violet";
-					break;
-				case BLACK:
-					colStr += "_Black";
-					break;
-				}
-			}
-			switch (getShape()) {
-			case CAN:
-			case CONI:
-			case SPHERI:
-			case BARREL:
-				imgStr += "_Buoy_Small";
-				colStr += "_Buoy_Small";
-				break;
-			case PILLAR:
-			case SPAR:
-				imgStr += "_Buoy";
-				colStr += "_Buoy";
-				break;
-			case FLOAT:
-			case SUPER:
-				imgStr += "_Float";
-				colStr += "_Float";
-				break;
-			case BUOYANT:
-			case CAIRN:
-			case PILE:
-			case LATTICE:
-			case TOWER:
-			case STAKE:
-			case POLE:
-			case POST:
-			case BEACON:
-				imgStr += "_Beacon";
-				colStr += "_Beacon";
-				break;
-			}
-			colStr += ".png";
-			if (getClass().getResource(colStr) == null) {
-				System.out.println("Missing image4: " + colStr);
-				imgStr += ".png";
-				if (getClass().getResource(imgStr) == null) {
-					System.out.println("Missing image5: " + imgStr);
-					return;
-				} else {
-					g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
-				}
-			} else {
-				g2.drawImage(new ImageIcon(getClass().getResource(colStr)).getImage(), 7, -15, null);
-			}
-		} else {
-			if ((getObject() == Obj.BOYINB) || ((getObject() == Obj.MORFAC) && (getCategory() == Cat.MOR_BUOY))) {
-				imgStr = "/images/Top_Mooring";
-				switch (getShape()) {
-				case CAN:
-				case CONI:
-				case SPHERI:
-				case BARREL:
-					imgStr += "_Buoy_Small";
-					break;
-				case FLOAT:
-				case SUPER:
-					imgStr += "_Float";
-					break;
-				default:
-					if (getObject() == Obj.MORFAC) {
-						imgStr += "_Buoy_Small";
-					} else {
-						imgStr += "_Float";
-					}
-					break;
-				}
-				imgStr += ".png";
-				if (getClass().getResource(imgStr) == null) {
-					System.out.println("Missing image6: " + imgStr);
-					return;
-				} else {
-					g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
-				}
-			}
-		}
-
-		for (int i = 1; i < sectors.size(); i++) {
-	    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-	    g2.setStroke(new BasicStroke(6.0f));
-	    if (!((String)getLightAtt(Att.BEG, i)).isEmpty() && !((String)getLightAtt(Att.END, i)).isEmpty()) {
-				if (getLightAtt(Att.COL, i) != Col.UNKCOL) {
-					g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i)));
-					Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.BEG, i));
-					Double da = 270 - Double.parseDouble((String)getLightAtt(Att.END, i)) - a0;
-					da -= da > 0 ? 360 : 0;
-					g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN));
-				}
-				if (getLightAtt(Att.ALT, i) != Col.UNKCOL) {
-					g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i)));
-					Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.BEG, i));
-					Double da = 270 - Double.parseDouble((String)getLightAtt(Att.END, i)) - a0;
-					da -= da > 0 ? 360 : 0;
-					g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN));
-				}
-	    } else if ((getLightAtt(Att.LIT, i) == Lit.DIR) && !((String)getLightAtt(Att.ORT, i)).isEmpty()) {
-				if (getLightAtt(Att.COL, i) != Col.UNKCOL) {
-					g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i)));
-					Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.ORT, i)) + 2.0;
-					Double da = -4.0;
-					g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN));
-				}
-				if (getLightAtt(Att.ALT, i) != Col.UNKCOL) {
-					g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i)));
-					Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.ORT, i)) + 2.0;
-					Double da = -4.0;
-					g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN));
-				}
-	    }
-		}
+        String lblStr;
+        String imgStr = "/images/";
+        if (getShape() != Shp.UNKSHP) {
+            switch (getShape()) {
+            case TOWER:
+                imgStr += "Tower";
+                break;
+            case BUOY:
+            case PILLAR:
+                imgStr += "Pillar";
+                break;
+            case SPAR:
+                imgStr += "Spar";
+                break;
+            case CAN:
+                imgStr += "Can";
+                break;
+            case CONI:
+                imgStr += "Cone";
+                break;
+            case SPHERI:
+                imgStr += "Sphere";
+                break;
+            case BARREL:
+                imgStr += "Barrel";
+                break;
+            case CAIRN:
+                imgStr += "Cairn";
+                break;
+            case FLOAT:
+                imgStr += "Float";
+                break;
+            case BEACON:
+            case PILE:
+            case LATTICE:
+            case BUOYANT:
+                imgStr += "Beacon";
+                break;
+            case SUPER:
+                imgStr += "Super";
+                break;
+            case STAKE:
+            case POLE:
+            case POST:
+                imgStr += "Stake";
+                break;
+            case PERCH:
+                if (getCategory() == Cat.LAM_PORT) {
+                    imgStr += "Perch_Port";
+                } else {
+                    imgStr += "Perch_Starboard";
+                }
+                break;
+            }
+            colStr = imgStr;
+            lblStr = "";
+            for (Col col : bodyColour) {
+                switch (col) {
+                case WHITE:
+                    colStr += "_White";
+                    lblStr += "W";
+                    break;
+                case RED:
+                    colStr += "_Red";
+                    lblStr += "R";
+                    break;
+                case ORANGE:
+                    colStr += "_Orange";
+                    lblStr += "Or";
+                    break;
+                case AMBER:
+                    colStr += "_Amber";
+                    lblStr += "Am";
+                    break;
+                case YELLOW:
+                    colStr += "_Yellow";
+                    lblStr += "Y";
+                    break;
+                case GREEN:
+                    colStr += "_Green";
+                    lblStr += "G";
+                    break;
+                case BLUE:
+                    colStr += "_Blue";
+                    lblStr += "Bu";
+                    break;
+                case VIOLET:
+                    colStr += "_Violet";
+                    lblStr += "Vi";
+                    break;
+                case BLACK:
+                    colStr += "_Black";
+                    lblStr += "B";
+                    break;
+                case GREY:
+                    colStr += "_Grey";
+                    lblStr += "Gr";
+                    break;
+                case BROWN:
+                    colStr += "_Brown";
+                    lblStr += "Br";
+                    break;
+                case MAGENTA:
+                    colStr += "_Magenta";
+                    lblStr += "Mg";
+                    break;
+                case PINK:
+                    colStr += "_Pink";
+                    lblStr += "Pk";
+                    break;
+                }
+            }
+            if (!imgStr.equals("/images/")) {
+                colStr += ".png";
+                if (getClass().getResource(colStr) == null) {
+                    System.out.println("Missing image1: " + colStr);
+                    imgStr += ".png";
+                    if (getClass().getResource(imgStr) == null) {
+                        System.out.println("Missing image2: " + imgStr);
+                    } else {
+                        g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
+                        g2.drawString(lblStr, 75, 110);
+                    }
+                } else {
+                    g2.drawImage(new ImageIcon(getClass().getResource(colStr)).getImage(), 7, -15, null);
+                }
+            }
+        } else if (getObject() != Obj.UNKOBJ) {
+            switch (getObject()) {
+            case LNDMRK:
+                switch (getCategory()) {
+                case LMK_CHMY:
+                    imgStr += "Chimney";
+                    break;
+                case LMK_CARN:
+                    imgStr += "Cairn";
+                    break;
+                case LMK_DSHA:
+                    imgStr += "DishAerial";
+                    break;
+                case LMK_FLGS:
+                    imgStr += "Flagstaff";
+                    break;
+                case LMK_FLRS:
+                    imgStr += "FlareStack";
+                    break;
+                case LMK_MNMT:
+                case LMK_CLMN:
+                case LMK_OBLK:
+                case LMK_STAT:
+                    imgStr += "Monument";
+                    break;
+                case LMK_MAST:
+                    imgStr += "RadioMast";
+                    break;
+                case LMK_TOWR:
+                    if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL))
+                        imgStr += "ChurchTower";
+                    else
+                        imgStr += "LandTower";
+                    break;
+                case LMK_WNDM:
+                    imgStr += "Wind_Motor";
+                    break;
+                case LMK_WTRT:
+                    imgStr += "WaterTower";
+                    break;
+                case LMK_DOME:
+                    if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL))
+                        imgStr += "ChurchDome";
+                    else
+                        imgStr += "Dome";
+                    break;
+                case LMK_SPIR:
+                    if ((getFunc() == Fnc.CHCH) || (getFunc() == Fnc.CHPL))
+                        imgStr += "ChurchSpire";
+                    else
+                        imgStr += "Spire";
+                    break;
+                case LMK_MNRT:
+                    imgStr += "Minaret";
+                    break;
+                case LMK_WNDS:
+                    imgStr += "Windsock";
+                    break;
+                case LMK_CROS:
+                    imgStr += "Cross";
+                    break;
+                case LMK_SCNR:
+                    imgStr += "Signal_Station";
+                    break;
+                case LMK_WNDL:
+                    imgStr += "Windmill";
+                    break;
+                case NOCAT:
+                    switch (getFunc()) {
+                    case CHCH:
+                    case CHPL:
+                        imgStr += "Church";
+                        break;
+                    case TMPL:
+                    case PGDA:
+                    case SHSH:
+                    case BTMP:
+                        imgStr += "Temple";
+                        break;
+                    case MOSQ:
+                        imgStr += "Minaret";
+                        break;
+                    case MRBT:
+                        imgStr += "Spire";
+                        break;
+                    }
+                }
+                break;
+            case LITHSE:
+                imgStr += "Light_House";
+                break;
+            case LITMAJ:
+                imgStr += "Light_Major";
+                break;
+            case LITMIN:
+                imgStr += "Light_Minor";
+                break;
+            case LITFLT:
+                imgStr += "Float";
+                break;
+            case LITVES:
+                imgStr += "Super";
+                break;
+            case SISTAW:
+                imgStr += "Signal_Station";
+                break;
+            case SISTAT:
+                imgStr += "Signal_Station";
+                break;
+            case OFSPLF:
+                if (getCategory() == Cat.OFP_FPSO)
+                    imgStr += "Storage";
+                else
+                    imgStr += "Platform";
+                break;
+            case MORFAC:
+                switch (getCategory()) {
+                case MOR_DLPN:
+                    imgStr += "Dolphin";
+                    break;
+                case MOR_DDPN:
+                    imgStr += "DeviationDolphin";
+                    break;
+                case MOR_POST:
+                    imgStr += "Post";
+                    break;
+                case MOR_BUOY:
+                    imgStr += "Sphere";
+                    break;
+                }
+                break;
+            case BOYINB:
+                imgStr += "Super";
+                break;
+            case CGUSTA:
+                imgStr += "Signal_Station";
+                break;
+            case PILBOP:
+                imgStr += "Pilot";
+                break;
+            case RSCSTA:
+                imgStr += "Rescue";
+                break;
+            case RDOSTA:
+            case RADSTA:
+                imgStr += "Signal_Station";
+                g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null);
+                break;
+            }
+            if (!imgStr.equals("/images/")) {
+                imgStr += ".png";
+                if (getClass().getResource(imgStr) == null) {
+                    System.out.println("Missing image3: " + imgStr);
+                } else {
+                    g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
+                }
+            }
+        }
+
+        if (getTopmark() != Top.NOTOP) {
+            imgStr = "/images/Top_";
+            switch (getTopmark()) {
+            case CYL:
+                imgStr += "Can";
+                break;
+            case CONE:
+                imgStr += "Cone";
+                break;
+            case SPHERE:
+                imgStr += "Sphere";
+                break;
+            case X_SHAPE:
+                imgStr += "X";
+                break;
+            case NORTH:
+                imgStr += "North";
+                break;
+            case SOUTH:
+                imgStr += "South";
+                break;
+            case EAST:
+                imgStr += "East";
+                break;
+            case WEST:
+                imgStr += "West";
+                break;
+            case SPHERES2:
+                imgStr += "Isol";
+                break;
+            }
+            colStr = imgStr;
+            for (Col col : topmarkColour) {
+                switch (col) {
+                case WHITE:
+                    colStr += "_White";
+                    break;
+                case RED:
+                    colStr += "_Red";
+                    break;
+                case ORANGE:
+                    colStr += "_Orange";
+                    break;
+                case AMBER:
+                    colStr += "_Amber";
+                    break;
+                case YELLOW:
+                    colStr += "_Yellow";
+                    break;
+                case GREEN:
+                    colStr += "_Green";
+                    break;
+                case BLUE:
+                    colStr += "_Blue";
+                    break;
+                case VIOLET:
+                    colStr += "_Violet";
+                    break;
+                case BLACK:
+                    colStr += "_Black";
+                    break;
+                }
+            }
+            switch (getShape()) {
+            case CAN:
+            case CONI:
+            case SPHERI:
+            case BARREL:
+                imgStr += "_Buoy_Small";
+                colStr += "_Buoy_Small";
+                break;
+            case PILLAR:
+            case SPAR:
+                imgStr += "_Buoy";
+                colStr += "_Buoy";
+                break;
+            case FLOAT:
+            case SUPER:
+                imgStr += "_Float";
+                colStr += "_Float";
+                break;
+            case BUOYANT:
+            case CAIRN:
+            case PILE:
+            case LATTICE:
+            case TOWER:
+            case STAKE:
+            case POLE:
+            case POST:
+            case BEACON:
+                imgStr += "_Beacon";
+                colStr += "_Beacon";
+                break;
+            }
+            colStr += ".png";
+            if (getClass().getResource(colStr) == null) {
+                System.out.println("Missing image4: " + colStr);
+                imgStr += ".png";
+                if (getClass().getResource(imgStr) == null) {
+                    System.out.println("Missing image5: " + imgStr);
+                    return;
+                } else {
+                    g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
+                }
+            } else {
+                g2.drawImage(new ImageIcon(getClass().getResource(colStr)).getImage(), 7, -15, null);
+            }
+        } else {
+            if ((getObject() == Obj.BOYINB) || ((getObject() == Obj.MORFAC) && (getCategory() == Cat.MOR_BUOY))) {
+                imgStr = "/images/Top_Mooring";
+                switch (getShape()) {
+                case CAN:
+                case CONI:
+                case SPHERI:
+                case BARREL:
+                    imgStr += "_Buoy_Small";
+                    break;
+                case FLOAT:
+                case SUPER:
+                    imgStr += "_Float";
+                    break;
+                default:
+                    if (getObject() == Obj.MORFAC) {
+                        imgStr += "_Buoy_Small";
+                    } else {
+                        imgStr += "_Float";
+                    }
+                    break;
+                }
+                imgStr += ".png";
+                if (getClass().getResource(imgStr) == null) {
+                    System.out.println("Missing image6: " + imgStr);
+                    return;
+                } else {
+                    g2.drawImage(new ImageIcon(getClass().getResource(imgStr)).getImage(), 7, -15, null);
+                }
+            }
+        }
+
+        for (int i = 1; i < sectors.size(); i++) {
+        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+        g2.setStroke(new BasicStroke(6.0f));
+        if (!((String)getLightAtt(Att.BEG, i)).isEmpty() && !((String)getLightAtt(Att.END, i)).isEmpty()) {
+                if (getLightAtt(Att.COL, i) != Col.UNKCOL) {
+                    g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i)));
+                    Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.BEG, i));
+                    Double da = 270 - Double.parseDouble((String)getLightAtt(Att.END, i)) - a0;
+                    da -= da > 0 ? 360 : 0;
+                    g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN));
+                }
+                if (getLightAtt(Att.ALT, i) != Col.UNKCOL) {
+                    g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i)));
+                    Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.BEG, i));
+                    Double da = 270 - Double.parseDouble((String)getLightAtt(Att.END, i)) - a0;
+                    da -= da > 0 ? 360 : 0;
+                    g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN));
+                }
+        } else if ((getLightAtt(Att.LIT, i) == Lit.DIR) && !((String)getLightAtt(Att.ORT, i)).isEmpty()) {
+                if (getLightAtt(Att.COL, i) != Col.UNKCOL) {
+                    g2.setPaint(ColMAP.get(getLightAtt(Att.COL, i)));
+                    Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.ORT, i)) + 2.0;
+                    Double da = -4.0;
+                    g2.draw(new Arc2D.Double(12, 15, 140, 140, a0, da, Arc2D.OPEN));
+                }
+                if (getLightAtt(Att.ALT, i) != Col.UNKCOL) {
+                    g2.setPaint(ColMAP.get(getLightAtt(Att.ALT, i)));
+                    Double a0 = 270 - Double.parseDouble((String)getLightAtt(Att.ORT, i)) + 2.0;
+                    Double da = -4.0;
+                    g2.draw(new Arc2D.Double(17, 20, 130, 130, a0, da, Arc2D.OPEN));
+                }
+        }
+        }
     g2.setPaint(Color.BLACK);
-		if ((getLightAtt(Att.COL, 0) != Col.UNKCOL) || !(((String)getLightAtt(Att.CHR, 0)).isEmpty())) {
-			if (sectors.size() == 1) {
-				if (((String) getLightAtt(Att.CHR, 0)).contains("Al")) {
-					g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")).getImage(), 7, -15, null);
-				} else {
-					switch ((Col) getLightAtt(Att.COL, 0)) {
-					case RED:
-						g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Red_120.png")).getImage(), 7, -15, null);
-						break;
-					case GREEN:
-						g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Green_120.png")).getImage(), 7, -15, null);
-						break;
-					case WHITE:
-					case YELLOW:
-						g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_White_120.png")).getImage(), 7, -15, null);
-						break;
-					default:
-						g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")).getImage(), 7, -15, null);
-					}
-				}
-			}
-			String c = (String) getLightAtt(Att.CHR, 0);
-			String tmp = "";
-			if (c.contains("+")) {
-				int i1 = c.indexOf("+");
-				tmp = c.substring(i1, c.length());
-				c = c.substring(0, i1);
-				if (!((String) getLightAtt(Att.GRP, 0)).isEmpty()) {
-					c += "(" + (String) getLightAtt(Att.GRP, 0) + ")";
-				}
-				if (tmp != null)
-					c += tmp;
-			} else if (!((String) getLightAtt(Att.GRP, 0)).isEmpty())
-				c += "(" + (String) getLightAtt(Att.GRP, 0) + ")";
-			switch ((Col) getLightAtt(Att.COL, 0)) {
-			case WHITE:
-				c += ".W";
-				break;
-			case YELLOW:
-				c += ".Y";
-				break;
-			case RED:
-				c += ".R";
-				break;
-			case GREEN:
-				c += ".G";
-				break;
-			case AMBER:
-				c += ".Am";
-				break;
-			case ORANGE:
-				c += ".Or";
-				break;
-			case BLUE:
-				c += ".Bu";
-				break;
-			case VIOLET:
-				c += ".Vi";
-				break;
-			}
-			switch ((Col) getLightAtt(Att.ALT, 0)) {
-			case WHITE:
-				c += "W";
-				break;
-			case YELLOW:
-				c += "Y";
-				break;
-			case RED:
-				c += "R";
-				break;
-			case GREEN:
-				c += "G";
-				break;
-			case AMBER:
-				c += "Am";
-				break;
-			case ORANGE:
-				c += "Or";
-				break;
-			case BLUE:
-				c += "Bu";
-				break;
-			case VIOLET:
-				c += "Vi";
-				break;
-			}
-			tmp = (String) getLightAtt(Att.MLT, 0);
-			if (!tmp.isEmpty())
-				c = tmp + c;
-			if (getLightAtt(Att.LIT, 0) != Lit.UNKLIT) {
-				switch ((Lit)getLightAtt(Att.LIT, 0)) {
-				case VERT:
-					c += "(Vert)";
-					break;
-				case HORIZ:
-						c += "(Horiz)";
-						break;
-				}
-			}
-			tmp = (String) getLightAtt(Att.PER, 0);
-			if (!tmp.isEmpty())
-				c += " " + tmp + "s";
-			g2.drawString(c, 100, 70);
-		}
-
-		if (getFogSound() != Fog.NOFOG) {
-			g2.drawImage(new ImageIcon(getClass().getResource("/images/Fog_Signal.png")).getImage(), 7, -15, null);
-			String str = "";
-			if (getFogSound() != Fog.FOGSIG)
-				switch (getFogSound()) {
-				case HORN:
-					str = "Horn";
-					break;
-				case SIREN:
-					str = "Siren";
-					break;
-				case DIA:
-					str = "Dia";
-					break;
-				case BELL:
-					str = "Bell";
-					break;
-				case WHIS:
-					str = "Whis";
-					break;
-				case GONG:
-					str = "Gong";
-					break;
-				case EXPLOS:
-					str = "Explos";
-					break;
-				}
-			if (!getFogGroup().isEmpty())
-				str += ("(" + getFogGroup() + ")");
-			else
-				str += " ";
-			if (!getFogPeriod().isEmpty())
-				str += getFogPeriod() + "s";
-			g2.drawString(str, 0, 70);
-		}
-
-		if (RaType != Rtb.NORTB) {
-			if (getRadar() == Rtb.REFLECTOR) {
-				g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png")).getImage(), 7, -15, null);
-			} else {
-				g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null);
-				String str = "";
-				if (getRadar() == Rtb.RAMARK)
-					str += "Ramark";
-				else
-					str += "Racon";
-				if (!getRaconGroup().isEmpty())
-					str += ("(" + getRaconGroup() + ")");
-				else
-					str += " ";
-				if (!getRaconPeriod().isEmpty())
-					str += getRaconPeriod() + "s";
-				g2.drawString(str, 0, 50);
-			}
-		}
-
-		if (RoType != Cat.NOROS) {
-			g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null);
-			g2.drawString("AIS", 0, 30);
-		}
-	}
-
-	public void saveSign(OsmPrimitive node) {
-		
-		if (getObject() != Obj.UNKOBJ) {
-
-			Main.pref.put("smedplugin.IALA", getRegion() == Reg.C ? "C" : (getRegion() == Reg.B ? "B" : "A"));
-
-			for (String str : node.getKeys().keySet()) {
-				if (str.trim().matches("^seamark:\\S+"))
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, str, null));
-			}
-
-			if (!getName().isEmpty())
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:name", getName()));
-
-			String objStr = ObjSTR.get(object);
-			if (objStr != null) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:type", objStr));
-
-				if (getShape() != Shp.FLOAT) {
-					String str = CatSTR.get(getCategory());
-					if (str != null)
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":category", str));
-					if ((getShape() != Shp.BUOY) && (getShape() != Shp.BEACON))
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":shape", ShpSTR.get(getShape())));
-				}
-
-				if ((getObjColour(0) != Col.UNKCOL) && getShape() != Shp.PERCH) {
-					String str = ColSTR.get(getObjColour(0));
-					for (int i = 1; bodyColour.size() > i; i++) {
-						str += (";" + ColSTR.get(getObjColour(i)));
-					}
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour", str));
-				}
-
-				if (getObjPattern() != Pat.NOPAT) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatSTR.get(getObjPattern())));
-				}
-
-				if (getFunc() != Fnc.UNKFNC) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":function", FncSTR.get(getFunc())));
-				}
-
-				if ((GrpMAP.get(object) == Grp.LAT) && (getShape() != Shp.PERCH)
-						|| (getObject() == Obj.FLTLAT)) {
-					switch (region) {
-					case A:
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-a"));
-						break;
-					case B:
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-b"));
-						break;
-					case C:
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "other"));
-						break;
-					}
-				}
-				if (!getObjectHeight().isEmpty()) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":height", getObjectHeight()));
-				}
-				if (!getElevation().isEmpty()) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":elevation", getElevation()));
-				}
-				if (!getChannel().isEmpty()) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":channel", getChannel()));
-				}
-			}
-			if (getTopmark() != Top.NOTOP) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:shape", TopSTR.get(getTopmark())));
-				if (getTopPattern() != Pat.NOPAT)
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour_pattern", PatSTR.get(getTopPattern())));
-				if (getTopColour(0) != Col.UNKCOL) {
-					String str = ColSTR.get(getTopColour(0));
-					for (int i = 1; topmarkColour.size() > i; i++) {
-						str += (";" + ColSTR.get(getTopColour(i)));
-					}
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour", str));
-				}
-			}
-
-			for (int i = (sectors.size() > 1 ? 1 : 0); i < sectors.size(); i++) {
-				String secStr = (i == 0) ? "" : (":" + Integer.toString(i));
-				if (sectors.get(i)[0] != Col.UNKCOL)
-					if ((sectors.get(i)[15] != Col.UNKCOL) && ((String)sectors.get(i)[1]).contains("Al"))
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", (ColSTR.get(sectors.get(i)[0])) + ";" + ColSTR.get(sectors.get(i)[15])));
-					else
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", ColSTR.get(sectors.get(i)[0])));
-				if (!((String) sectors.get(i)[1]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(i)[1]));
-				else if (!((String) sectors.get(0)[1]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(0)[1]));
-				if (!((String) sectors.get(i)[2]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(i)[2]));
-				else if (!((String) sectors.get(0)[2]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(0)[2]));
-				if (!((String) sectors.get(i)[3]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(i)[3]));
-				else if (!((String) sectors.get(0)[3]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(0)[3]));
-				if (!((String) sectors.get(i)[4]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(i)[4]));
-				else if (!((String) sectors.get(0)[4]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(0)[4]));
-				if (sectors.get(i)[5] != Lit.UNKLIT)
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", LitSTR.get(sectors.get(i)[5])));
-				else if (sectors.get(0)[5] != Lit.UNKLIT)
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", LitSTR.get(sectors.get(0)[5])));
-				if (!((String) sectors.get(i)[6]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_start", (String) sectors.get(i)[6]));
-				if (!((String) sectors.get(i)[7]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_end", (String) sectors.get(i)[7]));
-				if (!((String) sectors.get(i)[8]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(i)[8]));
-				else if (!((String) sectors.get(0)[8]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(0)[8]));
-				if (!((String) sectors.get(i)[9]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(i)[9]));
-				else if (!((String) sectors.get(0)[9]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(0)[9]));
-				if (!((String) sectors.get(i)[10]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(i)[10]));
-				else if (!((String) sectors.get(0)[10]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(0)[10]));
-				if (sectors.get(i)[11] != Vis.UNKVIS)
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", VisSTR.get(sectors.get(i)[11])));
-				else if (sectors.get(0)[11] != Vis.UNKVIS)
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", VisSTR.get(sectors.get(0)[11])));
-				if (sectors.get(i)[12] != Exh.UNKEXH)
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors.get(i)[12])));
-				else if (sectors.get(0)[12] != Exh.UNKEXH)
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors.get(0)[12])));
-				if (!((String) sectors.get(i)[13]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation", (String) sectors.get(i)[13]));
-				if (!((String) sectors.get(i)[14]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(i)[14]));
-				else if (!((String) sectors.get(0)[14]).isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(0)[14]));
-			}
-
-			if (getFogSound() != Fog.NOFOG) {
-				if (getFogSound() == Fog.FOGSIG)
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal", "yes"));
-				else
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:category", FogSTR.get(getFogSound())));
-				if (!getFogGroup().isEmpty()) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:group", getFogGroup()));
-				}
-				if (!getFogPeriod().isEmpty()) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:period", getFogPeriod()));
-				}
-				if (!getFogSequence().isEmpty()) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:sequence", getFogSequence()));
-				}
-				if (!getFogRange().isEmpty()) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:range", getFogRange()));
-				}
-			}
-
-			if (RoType != Cat.NOROS) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radio_station:category", CatSTR.get(getRadio())));
-			}
-
-			if (RaType != Rtb.NORTB) {
-				if (getRadar() == Rtb.REFLECTOR) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes"));
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:category", RtbSTR.get(getRadar())));
-					if (!getRaconGroup().isEmpty()) {
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:group", getRaconGroup()));
-					}
-					if (!getRaconPeriod().isEmpty()) {
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:period", getRaconPeriod()));
-					}
-					if (!getRaconSequence().isEmpty()) {
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sequence", getRaconSequence()));
-					}
-					if (!getRaconRange().isEmpty()) {
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:range", getRaconRange()));
-					}
-					if ((!getRaconSector1().isEmpty()) && (!getRaconSector2().isEmpty())) {
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_start", getRaconSector1()));
-						Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_end", getRaconSector2()));
-					}
-				}
-			}
-
-			if (!getInfo().isEmpty()) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:information", getInfo()));
-			}
-			if (!getSource().isEmpty()) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:source", getSource()));
-			}
-			if (getStatus() != Sts.UNKSTS) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:status", StsSTR.get(getStatus())));
-			}
-			if (getConstr() != Cns.UNKCNS) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:construction", CnsSTR.get(getConstr())));
-			}
-			if (getConsp() != Con.UNKCON) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:conspicuity", ConSTR.get(getConsp())));
-			}
-			if (getRefl() != Con.UNKCON) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", ConSTR.get(getRefl())));
-			}
-			if (!getRef().isEmpty()) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reference", getRef()));
-			}
-			if (!getLightRef().isEmpty()) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:reference", getLightRef()));
-			}
-			if (!getFixme().isEmpty()) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fixme", getFixme()));
-			}
-		}
-	}
+        if ((getLightAtt(Att.COL, 0) != Col.UNKCOL) || !(((String)getLightAtt(Att.CHR, 0)).isEmpty())) {
+            if (sectors.size() == 1) {
+                if (((String) getLightAtt(Att.CHR, 0)).contains("Al")) {
+                    g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")).getImage(), 7, -15, null);
+                } else {
+                    switch ((Col) getLightAtt(Att.COL, 0)) {
+                    case RED:
+                        g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Red_120.png")).getImage(), 7, -15, null);
+                        break;
+                    case GREEN:
+                        g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Green_120.png")).getImage(), 7, -15, null);
+                        break;
+                    case WHITE:
+                    case YELLOW:
+                        g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_White_120.png")).getImage(), 7, -15, null);
+                        break;
+                    default:
+                        g2.drawImage(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")).getImage(), 7, -15, null);
+                    }
+                }
+            }
+            String c = (String) getLightAtt(Att.CHR, 0);
+            String tmp = "";
+            if (c.contains("+")) {
+                int i1 = c.indexOf("+");
+                tmp = c.substring(i1, c.length());
+                c = c.substring(0, i1);
+                if (!((String) getLightAtt(Att.GRP, 0)).isEmpty()) {
+                    c += "(" + (String) getLightAtt(Att.GRP, 0) + ")";
+                }
+                if (tmp != null)
+                    c += tmp;
+            } else if (!((String) getLightAtt(Att.GRP, 0)).isEmpty())
+                c += "(" + (String) getLightAtt(Att.GRP, 0) + ")";
+            switch ((Col) getLightAtt(Att.COL, 0)) {
+            case WHITE:
+                c += ".W";
+                break;
+            case YELLOW:
+                c += ".Y";
+                break;
+            case RED:
+                c += ".R";
+                break;
+            case GREEN:
+                c += ".G";
+                break;
+            case AMBER:
+                c += ".Am";
+                break;
+            case ORANGE:
+                c += ".Or";
+                break;
+            case BLUE:
+                c += ".Bu";
+                break;
+            case VIOLET:
+                c += ".Vi";
+                break;
+            }
+            switch ((Col) getLightAtt(Att.ALT, 0)) {
+            case WHITE:
+                c += "W";
+                break;
+            case YELLOW:
+                c += "Y";
+                break;
+            case RED:
+                c += "R";
+                break;
+            case GREEN:
+                c += "G";
+                break;
+            case AMBER:
+                c += "Am";
+                break;
+            case ORANGE:
+                c += "Or";
+                break;
+            case BLUE:
+                c += "Bu";
+                break;
+            case VIOLET:
+                c += "Vi";
+                break;
+            }
+            tmp = (String) getLightAtt(Att.MLT, 0);
+            if (!tmp.isEmpty())
+                c = tmp + c;
+            if (getLightAtt(Att.LIT, 0) != Lit.UNKLIT) {
+                switch ((Lit)getLightAtt(Att.LIT, 0)) {
+                case VERT:
+                    c += "(Vert)";
+                    break;
+                case HORIZ:
+                        c += "(Horiz)";
+                        break;
+                }
+            }
+            tmp = (String) getLightAtt(Att.PER, 0);
+            if (!tmp.isEmpty())
+                c += " " + tmp + "s";
+            g2.drawString(c, 100, 70);
+        }
+
+        if (getFogSound() != Fog.NOFOG) {
+            g2.drawImage(new ImageIcon(getClass().getResource("/images/Fog_Signal.png")).getImage(), 7, -15, null);
+            String str = "";
+            if (getFogSound() != Fog.FOGSIG)
+                switch (getFogSound()) {
+                case HORN:
+                    str = "Horn";
+                    break;
+                case SIREN:
+                    str = "Siren";
+                    break;
+                case DIA:
+                    str = "Dia";
+                    break;
+                case BELL:
+                    str = "Bell";
+                    break;
+                case WHIS:
+                    str = "Whis";
+                    break;
+                case GONG:
+                    str = "Gong";
+                    break;
+                case EXPLOS:
+                    str = "Explos";
+                    break;
+                }
+            if (!getFogGroup().isEmpty())
+                str += ("(" + getFogGroup() + ")");
+            else
+                str += " ";
+            if (!getFogPeriod().isEmpty())
+                str += getFogPeriod() + "s";
+            g2.drawString(str, 0, 70);
+        }
+
+        if (RaType != Rtb.NORTB) {
+            if (getRadar() == Rtb.REFLECTOR) {
+                g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png")).getImage(), 7, -15, null);
+            } else {
+                g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null);
+                String str = "";
+                if (getRadar() == Rtb.RAMARK)
+                    str += "Ramark";
+                else
+                    str += "Racon";
+                if (!getRaconGroup().isEmpty())
+                    str += ("(" + getRaconGroup() + ")");
+                else
+                    str += " ";
+                if (!getRaconPeriod().isEmpty())
+                    str += getRaconPeriod() + "s";
+                g2.drawString(str, 0, 50);
+            }
+        }
+
+        if (RoType != Cat.NOROS) {
+            g2.drawImage(new ImageIcon(getClass().getResource("/images/Radar_Station.png")).getImage(), 7, -15, null);
+            g2.drawString("AIS", 0, 30);
+        }
+    }
+
+    public void saveSign(OsmPrimitive node) {
+        
+        if (getObject() != Obj.UNKOBJ) {
+
+            Main.pref.put("smedplugin.IALA", getRegion() == Reg.C ? "C" : (getRegion() == Reg.B ? "B" : "A"));
+
+            for (String str : node.getKeys().keySet()) {
+                if (str.trim().matches("^seamark:\\S+"))
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, str, null));
+            }
+
+            if (!getName().isEmpty())
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:name", getName()));
+
+            String objStr = ObjSTR.get(object);
+            if (objStr != null) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:type", objStr));
+
+                if (getShape() != Shp.FLOAT) {
+                    String str = CatSTR.get(getCategory());
+                    if (str != null)
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":category", str));
+                    if ((getShape() != Shp.BUOY) && (getShape() != Shp.BEACON))
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":shape", ShpSTR.get(getShape())));
+                }
+
+                if ((getObjColour(0) != Col.UNKCOL) && getShape() != Shp.PERCH) {
+                    String str = ColSTR.get(getObjColour(0));
+                    for (int i = 1; bodyColour.size() > i; i++) {
+                        str += (";" + ColSTR.get(getObjColour(i)));
+                    }
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour", str));
+                }
+
+                if (getObjPattern() != Pat.NOPAT) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", PatSTR.get(getObjPattern())));
+                }
+
+                if (getFunc() != Fnc.UNKFNC) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":function", FncSTR.get(getFunc())));
+                }
+
+                if ((GrpMAP.get(object) == Grp.LAT) && (getShape() != Shp.PERCH)
+                        || (getObject() == Obj.FLTLAT)) {
+                    switch (region) {
+                    case A:
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-a"));
+                        break;
+                    case B:
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-b"));
+                        break;
+                    case C:
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "other"));
+                        break;
+                    }
+                }
+                if (!getObjectHeight().isEmpty()) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":height", getObjectHeight()));
+                }
+                if (!getElevation().isEmpty()) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":elevation", getElevation()));
+                }
+                if (!getChannel().isEmpty()) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":channel", getChannel()));
+                }
+            }
+            if (getTopmark() != Top.NOTOP) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:shape", TopSTR.get(getTopmark())));
+                if (getTopPattern() != Pat.NOPAT)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour_pattern", PatSTR.get(getTopPattern())));
+                if (getTopColour(0) != Col.UNKCOL) {
+                    String str = ColSTR.get(getTopColour(0));
+                    for (int i = 1; topmarkColour.size() > i; i++) {
+                        str += (";" + ColSTR.get(getTopColour(i)));
+                    }
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour", str));
+                }
+            }
+
+            for (int i = (sectors.size() > 1 ? 1 : 0); i < sectors.size(); i++) {
+                String secStr = (i == 0) ? "" : (":" + Integer.toString(i));
+                if (sectors.get(i)[0] != Col.UNKCOL)
+                    if ((sectors.get(i)[15] != Col.UNKCOL) && ((String)sectors.get(i)[1]).contains("Al"))
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", (ColSTR.get(sectors.get(i)[0])) + ";" + ColSTR.get(sectors.get(i)[15])));
+                    else
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", ColSTR.get(sectors.get(i)[0])));
+                if (!((String) sectors.get(i)[1]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(i)[1]));
+                else if (!((String) sectors.get(0)[1]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(0)[1]));
+                if (!((String) sectors.get(i)[2]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(i)[2]));
+                else if (!((String) sectors.get(0)[2]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(0)[2]));
+                if (!((String) sectors.get(i)[3]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(i)[3]));
+                else if (!((String) sectors.get(0)[3]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(0)[3]));
+                if (!((String) sectors.get(i)[4]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(i)[4]));
+                else if (!((String) sectors.get(0)[4]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(0)[4]));
+                if (sectors.get(i)[5] != Lit.UNKLIT)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", LitSTR.get(sectors.get(i)[5])));
+                else if (sectors.get(0)[5] != Lit.UNKLIT)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", LitSTR.get(sectors.get(0)[5])));
+                if (!((String) sectors.get(i)[6]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_start", (String) sectors.get(i)[6]));
+                if (!((String) sectors.get(i)[7]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_end", (String) sectors.get(i)[7]));
+                if (!((String) sectors.get(i)[8]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(i)[8]));
+                else if (!((String) sectors.get(0)[8]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(0)[8]));
+                if (!((String) sectors.get(i)[9]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(i)[9]));
+                else if (!((String) sectors.get(0)[9]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(0)[9]));
+                if (!((String) sectors.get(i)[10]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(i)[10]));
+                else if (!((String) sectors.get(0)[10]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(0)[10]));
+                if (sectors.get(i)[11] != Vis.UNKVIS)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", VisSTR.get(sectors.get(i)[11])));
+                else if (sectors.get(0)[11] != Vis.UNKVIS)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", VisSTR.get(sectors.get(0)[11])));
+                if (sectors.get(i)[12] != Exh.UNKEXH)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors.get(i)[12])));
+                else if (sectors.get(0)[12] != Exh.UNKEXH)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", ExhSTR.get(sectors.get(0)[12])));
+                if (!((String) sectors.get(i)[13]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation", (String) sectors.get(i)[13]));
+                if (!((String) sectors.get(i)[14]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(i)[14]));
+                else if (!((String) sectors.get(0)[14]).isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(0)[14]));
+            }
+
+            if (getFogSound() != Fog.NOFOG) {
+                if (getFogSound() == Fog.FOGSIG)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal", "yes"));
+                else
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:category", FogSTR.get(getFogSound())));
+                if (!getFogGroup().isEmpty()) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:group", getFogGroup()));
+                }
+                if (!getFogPeriod().isEmpty()) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:period", getFogPeriod()));
+                }
+                if (!getFogSequence().isEmpty()) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:sequence", getFogSequence()));
+                }
+                if (!getFogRange().isEmpty()) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:range", getFogRange()));
+                }
+            }
+
+            if (RoType != Cat.NOROS) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radio_station:category", CatSTR.get(getRadio())));
+            }
+
+            if (RaType != Rtb.NORTB) {
+                if (getRadar() == Rtb.REFLECTOR) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes"));
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:category", RtbSTR.get(getRadar())));
+                    if (!getRaconGroup().isEmpty()) {
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:group", getRaconGroup()));
+                    }
+                    if (!getRaconPeriod().isEmpty()) {
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:period", getRaconPeriod()));
+                    }
+                    if (!getRaconSequence().isEmpty()) {
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sequence", getRaconSequence()));
+                    }
+                    if (!getRaconRange().isEmpty()) {
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:range", getRaconRange()));
+                    }
+                    if ((!getRaconSector1().isEmpty()) && (!getRaconSector2().isEmpty())) {
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_start", getRaconSector1()));
+                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_end", getRaconSector2()));
+                    }
+                }
+            }
+
+            if (!getInfo().isEmpty()) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:information", getInfo()));
+            }
+            if (!getSource().isEmpty()) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:source", getSource()));
+            }
+            if (getStatus() != Sts.UNKSTS) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:status", StsSTR.get(getStatus())));
+            }
+            if (getConstr() != Cns.UNKCNS) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:construction", CnsSTR.get(getConstr())));
+            }
+            if (getConsp() != Con.UNKCON) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:conspicuity", ConSTR.get(getConsp())));
+            }
+            if (getRefl() != Con.UNKCON) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", ConSTR.get(getRefl())));
+            }
+            if (!getRef().isEmpty()) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reference", getRef()));
+            }
+            if (!getLightRef().isEmpty()) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:reference", getLightRef()));
+            }
+            if (!getFixme().isEmpty()) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fixme", getFixme()));
+            }
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/smed/Smed.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/Smed.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/smed/Smed.java	(revision 32767)
@@ -9,15 +9,15 @@
 public class Smed extends Plugin {
 
-	SmedAction dialog = new SmedAction();
-	
-	public Smed(PluginInformation info) {
-		super(info);
-		MainMenu.add(Main.main.menu.toolsMenu, dialog);
-	}
-	
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if (newFrame == null) {
-			dialog.closeDialog();
-		}
-	}
+    SmedAction dialog = new SmedAction();
+    
+    public Smed(PluginInformation info) {
+        super(info);
+        MainMenu.add(Main.main.menu.toolsMenu, dialog);
+    }
+    
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (newFrame == null) {
+            dialog.closeDialog();
+        }
+    }
 }
Index: /applications/editors/josm/plugins/smed/src/smed/SmedAction.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/SmedAction.java	(revision 32766)
+++ /applications/editors/josm/plugins/smed/src/smed/SmedAction.java	(revision 32767)
@@ -10,103 +10,106 @@
 package smed;
 
-import java.awt.*;
-import java.awt.event.*;
-import java.util.*;
+import static org.openstreetmap.josm.tools.I18n.tr;
 
-import javax.swing.*;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.util.Collection;
 
-import static org.openstreetmap.josm.tools.I18n.tr;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
+
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.SelectionChangedListener;
-import org.openstreetmap.josm.data.osm.*;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 
 import messages.Messages;
-
 import panels.PanelMain;
 
 public class SmedAction extends JosmAction implements SelectionChangedListener {
 
-	private static final long serialVersionUID = 1L;
-	private static String editor = tr("SeaMap Editor");
-	public static JFrame editFrame = null;
-	private boolean isOpen = false;
-	public static PanelMain panelMain = null;
+    private static final long serialVersionUID = 1L;
+    private static String editor = tr("SeaMap Editor");
+    public static JFrame editFrame = null;
+    private boolean isOpen = false;
+    public static PanelMain panelMain = null;
 
-	public OsmPrimitive node = null;
-	private Collection<? extends OsmPrimitive> selection = null;
+    public OsmPrimitive node = null;
+    private Collection<? extends OsmPrimitive> selection = null;
 
-	public SmedAction() {
-		super(editor, "Smed", editor, null, true);
-	}
+    public SmedAction() {
+        super(editor, "Smed", editor, null, true);
+    }
 
-	@Override
-	public void actionPerformed(ActionEvent arg0) {
-		SwingUtilities.invokeLater(new Runnable() {
-			public void run() {
-				if (!isOpen)
-					createFrame();
-				else
-					editFrame.toFront();
-				isOpen = true;
-			}
-		});
-	}
+    @Override
+    public void actionPerformed(ActionEvent arg0) {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                if (!isOpen)
+                    createFrame();
+                else
+                    editFrame.toFront();
+                isOpen = true;
+            }
+        });
+    }
 
-	protected void createFrame() {
-		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();
-			}
-		});
-		editFrame.setSize(new Dimension(420, 430));
-		editFrame.setLocation(100, 200);
-		editFrame.setResizable(true);
-		editFrame.setAlwaysOnTop(true);
-		editFrame.setVisible(true);
-		editFrame.setLayout(null);
-		panelMain = new PanelMain(this);
-		panelMain.setBounds(10, 10, 400, 400);
-		node = null;
-		panelMain.syncPanel();
-		editFrame.add(panelMain);
-		DataSet.addSelectionListener(this);
+    protected void createFrame() {
+        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();
+            }
+        });
+        editFrame.setSize(new Dimension(420, 430));
+        editFrame.setLocation(100, 200);
+        editFrame.setResizable(true);
+        editFrame.setAlwaysOnTop(true);
+        editFrame.setVisible(true);
+        editFrame.setLayout(null);
+        panelMain = new PanelMain(this);
+        panelMain.setBounds(10, 10, 400, 400);
+        node = null;
+        panelMain.syncPanel();
+        editFrame.add(panelMain);
+        DataSet.addSelectionListener(this);
 
-		// System.out.println("hello");
-	}
+        // System.out.println("hello");
+    }
 
-	public void closeDialog() {
-		if (isOpen) {
-			editFrame.setVisible(false);
-			editFrame.dispose();
-		}
-		isOpen = false;
-	}
+    public void closeDialog() {
+        if (isOpen) {
+            editFrame.setVisible(false);
+            editFrame.dispose();
+        }
+        isOpen = false;
+    }
 
-	@Override
-	public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-		OsmPrimitive nextNode = null;
-		selection = newSelection;
+    @Override
+    public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
+        OsmPrimitive nextNode = null;
+        selection = newSelection;
 
-		for (OsmPrimitive osm : selection) {
-			nextNode = (OsmPrimitive) osm;
-			if (selection.size() == 1) {
-				if (nextNode.compareTo(node) != 0) {
-					node = nextNode;
-					panelMain.mark.parseMark(node);
-				}
-			} else {
-				node = null;
-				panelMain.mark.clrMark();
-				PanelMain.messageBar.setText(Messages.getString("OneNode"));
-			}
-		}
-		if (nextNode == null) {
-			node = null;
-			panelMain.mark.clrMark();
-			PanelMain.messageBar.setText(Messages.getString("SelectNode"));
-		}
-	}
+        for (OsmPrimitive osm : selection) {
+            nextNode = (OsmPrimitive) osm;
+            if (selection.size() == 1) {
+                if (nextNode.compareTo(node) != 0) {
+                    node = nextNode;
+                    panelMain.mark.parseMark(node);
+                }
+            } else {
+                node = null;
+                panelMain.mark.clrMark();
+                PanelMain.messageBar.setText(Messages.getString("OneNode"));
+            }
+        }
+        if (nextNode == null) {
+            node = null;
+            panelMain.mark.clrMark();
+            PanelMain.messageBar.setText(Messages.getString("SelectNode"));
+        }
+    }
 
 }
