Index: applications/editors/josm/plugins/smed/src/panels/PanelChan.java
===================================================================
--- applications/editors/josm/plugins/smed/src/panels/PanelChan.java	(revision 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelChan.java	(revision 29894)
@@ -0,0 +1,317 @@
+package panels;
+
+import javax.swing.*;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import messages.Messages;
+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);
+			dlg.panelMain.moreButton.setVisible(false);
+			dlg.panelMain.saveButton.setEnabled(false);
+			topmarkButton.setVisible(false);
+			lightButton.setVisible(false);
+			Shp shp = dlg.panelMain.mark.getShape();
+			if (portButton.isSelected()) {
+				dlg.panelMain.mark.setCategory(Cat.LAM_PORT);
+				if (panelPort.shapes.containsKey(shp)) {
+					panelPort.shapes.get(shp).setSelected(true);
+				} else {
+					panelPort.shapeButtons.clearSelection();
+					dlg.panelMain.mark.setShape(Shp.UNKSHP);
+				}
+				panelPort.alShape.actionPerformed(null);
+				panelPort.setVisible(true);
+				portButton.setBorderPainted(true);
+			} else {
+				portButton.setBorderPainted(false);
+			}
+			if (stbdButton.isSelected()) {
+				dlg.panelMain.mark.setCategory(Cat.LAM_STBD);
+				if (panelStbd.shapes.containsKey(shp)) {
+					panelStbd.shapes.get(shp).setSelected(true);
+				} else {
+					panelStbd.shapeButtons.clearSelection();
+					dlg.panelMain.mark.setShape(Shp.UNKSHP);
+				}
+				panelStbd.alShape.actionPerformed(null);
+				panelStbd.setVisible(true);
+				stbdButton.setBorderPainted(true);
+			} else {
+				stbdButton.setBorderPainted(false);
+			}
+			if (prefStbdButton.isSelected()) {
+				dlg.panelMain.mark.setCategory(Cat.LAM_PSTBD);
+				if (panelPort.shapes.containsKey(shp)) {
+					panelPort.shapes.get(shp).setSelected(true);
+				} else {
+					panelPort.shapeButtons.clearSelection();
+					dlg.panelMain.mark.setShape(Shp.UNKSHP);
+				}
+				panelPort.alShape.actionPerformed(null);
+				panelPort.setVisible(true);
+				prefStbdButton.setBorderPainted(true);
+			} else {
+				prefStbdButton.setBorderPainted(false);
+			}
+			if (prefPortButton.isSelected()) {
+				dlg.panelMain.mark.setCategory(Cat.LAM_PPORT);
+				if (panelStbd.shapes.containsKey(shp)) {
+					panelStbd.shapes.get(shp).setSelected(true);
+				} else {
+					panelStbd.shapeButtons.clearSelection();
+					dlg.panelMain.mark.setShape(Shp.UNKSHP);
+				}
+				panelStbd.alShape.actionPerformed(null);
+				panelStbd.setVisible(true);
+				prefPortButton.setBorderPainted(true);
+			} else {
+				prefPortButton.setBorderPainted(false);
+			}
+			if (safeWaterButton.isSelected()) {
+				dlg.panelMain.mark.setCategory(Cat.NOCAT);
+				panelSaw.setVisible(true);
+				if (panelSaw.shapes.containsKey(shp)) {
+					panelSaw.shapes.get(shp).setSelected(true);
+				} else {
+					panelSaw.shapeButtons.clearSelection();
+					dlg.panelMain.mark.setShape(Shp.UNKSHP);
+				}
+				panelSaw.alShape.actionPerformed(null);
+				panelSaw.setVisible(true);
+				safeWaterButton.setBorderPainted(true);
+			} else {
+				safeWaterButton.setBorderPainted(false);
+			}
+			topmarkButton.setVisible(dlg.panelMain.mark.testValid());
+			lightButton.setVisible(dlg.panelMain.mark.testValid());
+			dlg.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(dlg.panelMain.mark.getObject()) == Grp.SAW) {
+					dlg.panelMain.mark.setTopmark(Top.SPHERE);
+					dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
+					dlg.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;
+	}
+
+}
Index: applications/editors/josm/plugins/smed/src/panels/PanelChr.java
===================================================================
--- applications/editors/josm/plugins/smed/src/panels/PanelChr.java	(revision 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelChr.java	(revision 29894)
@@ -0,0 +1,180 @@
+package panels;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+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, JToggleButton>(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();
+			dlg.panelMain.mark.setLightAtt(Att.CHR, 0, str);
+			if (!str.contains("Al")) {
+				col2Label.setBackground(SeaMark.ColMAP.get(dlg.panelMain.mark.getLightAtt(Att.COL, 0)));
+				dlg.panelMain.mark.setLightAtt(Att.ALT, 0, Col.UNKCOL);
+			} else {
+				col2Label.setBackground(SeaMark.ColMAP.get(dlg.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();
+			dlg.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(dlg.panelMain.mark.getLightAtt(Att.COL, 0)));
+				dlg.panelMain.mark.setLightAtt(Att.ALT, 0, Col.UNKCOL);
+			} else {
+				col2Label.setBackground(SeaMark.ColMAP.get(dlg.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 void syncPanel() {
+		String str = (String)dlg.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(dlg.panelMain.mark.getLightAtt(Att.COL, 0)));
+		} else {
+			col2Label.setBackground(SeaMark.ColMAP.get(dlg.panelMain.mark.getLightAtt(Att.ALT, 0)));
+		}
+		col1Label.setBackground(SeaMark.ColMAP.get(dlg.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;
+	}
+
+}
Index: applications/editors/josm/plugins/smed/src/panels/PanelCol.java
===================================================================
--- applications/editors/josm/plugins/smed/src/panels/PanelCol.java	(revision 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelCol.java	(revision 29894)
@@ -0,0 +1,208 @@
+package panels;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+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, JRadioButton>(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) dlg.panelMain.mark.getLightAtt(Att.CHR, 0)).contains("Al")) {
+							if (((button == delButton) && (dlg.panelMain.mark.getLightAtt(Att.ALT, 0) == Col.UNKCOL))
+									|| (dlg.panelMain.mark.getLightAtt(Att.COL, 0) == Col.UNKCOL)) {
+								dlg.panelMain.mark.setLightAtt(Att.COL, 0, col);
+								dlg.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));
+							} else {
+								dlg.panelMain.mark.setLightAtt(Att.ALT, 0, col);
+								dlg.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));
+							}
+						} else {
+							dlg.panelMain.mark.setLightAtt(Att.COL, 0, col);
+							dlg.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));
+							dlg.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));
+						}
+						button.setBorderPainted(true);
+					} else {
+						if (button == delButton) {
+							dlg.panelMain.mark.subColour(ent, stackIdx);
+						} else if (button == addButton) {
+							if (stackCol.size() != 0)
+								stackIdx++;
+							if (stackCol.size() == 0)
+								dlg.panelMain.mark.setColour(ent, col);
+							else
+								switch (dlg.panelMain.mark.getPattern(ent)) {
+								case NOPAT:
+									break;
+								case BORDER:
+								case CROSS:
+									if (stackCol.size() < 2)
+										dlg.panelMain.mark.addColour(ent, stackIdx, col);
+									break;
+								case SQUARED:
+									if (stackCol.size() < 4)
+										dlg.panelMain.mark.addColour(ent, stackIdx, col);
+									break;
+								default:
+									dlg.panelMain.mark.addColour(ent, stackIdx, col);
+									break;
+								}
+						} else {
+							dlg.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<JRadioButton>();
+	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 (dlg.panelMain.mark.getLightAtt(Att.COL, 0) == col) {
+					button.setBorderPainted(true);
+				} else
+					button.setBorderPainted(false);
+			}
+		} else {
+			int idx;
+			for (idx = 0; dlg.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(dlg.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 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelFog.java	(revision 29894)
@@ -0,0 +1,140 @@
+package panels;
+
+import javax.swing.*;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.EnumMap;
+
+import messages.Messages;
+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, JRadioButton>(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()) {
+					dlg.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) {
+			dlg.panelMain.mark.setFogGroup(groupBox.getText());
+		}
+	};
+	public JLabel periodLabel;
+	public JTextField periodBox;
+	private FocusListener flPeriod = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.panelMain.mark.setFogPeriod(periodBox.getText());
+		}
+	};
+	public JLabel seqLabel;
+	public JTextField seqBox;
+	private FocusListener flSeq = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.panelMain.mark.setFogSequence(seqBox.getText());
+		}
+	};
+	public JLabel rangeLabel;
+	public JTextField rangeBox;
+	private FocusListener flRange = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.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));
+
+		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);
+
+		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);
+
+	}
+
+	public void syncPanel() {
+		for (Fog fog : fogs.keySet()) {
+			JRadioButton button = fogs.get(fog);
+			button.setBorderPainted(dlg.panelMain.mark.getFogSound() == fog);
+		}
+		groupBox.setText(dlg.panelMain.mark.getFogGroup());
+		seqBox.setText(dlg.panelMain.mark.getFogSequence());
+		periodBox.setText(dlg.panelMain.mark.getFogPeriod());
+		rangeBox.setText(dlg.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;
+	}
+
+}
Index: applications/editors/josm/plugins/smed/src/panels/PanelHaz.java
===================================================================
--- applications/editors/josm/plugins/smed/src/panels/PanelHaz.java	(revision 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelHaz.java	(revision 29894)
@@ -0,0 +1,246 @@
+package panels;
+
+import java.awt.event.*;
+import java.awt.*;
+
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+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) {
+			dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
+			if (northButton.isSelected()) {
+				dlg.panelMain.mark.setCategory(Cat.CAM_NORTH);
+				dlg.panelMain.mark.setObjColour(Col.BLACK);
+				dlg.panelMain.mark.addObjColour(Col.YELLOW);
+				northButton.setBorderPainted(true);
+			} else {
+				northButton.setBorderPainted(false);
+			}
+			if (southButton.isSelected()) {
+				dlg.panelMain.mark.setCategory(Cat.CAM_SOUTH);
+				dlg.panelMain.mark.setObjColour(Col.YELLOW);
+				dlg.panelMain.mark.addObjColour(Col.BLACK);
+				southButton.setBorderPainted(true);
+			} else {
+				southButton.setBorderPainted(false);
+			}
+			if (eastButton.isSelected()) {
+				dlg.panelMain.mark.setCategory(Cat.CAM_EAST);
+				dlg.panelMain.mark.setObjColour(Col.BLACK);
+				dlg.panelMain.mark.addObjColour(Col.YELLOW);
+				dlg.panelMain.mark.addObjColour(Col.BLACK);
+				eastButton.setBorderPainted(true);
+			} else {
+				eastButton.setBorderPainted(false);
+			}
+			if (westButton.isSelected()) {
+				dlg.panelMain.mark.setCategory(Cat.CAM_WEST);
+				dlg.panelMain.mark.setObjColour(Col.YELLOW);
+				dlg.panelMain.mark.addObjColour(Col.BLACK);
+				dlg.panelMain.mark.addObjColour(Col.YELLOW);
+				westButton.setBorderPainted(true);
+			} else {
+				westButton.setBorderPainted(false);
+			}
+			if (isolButton.isSelected()) {
+				dlg.panelMain.mark.setCategory(Cat.NOCAT);
+				dlg.panelMain.mark.setObjColour(Col.BLACK);
+				dlg.panelMain.mark.addObjColour(Col.RED);
+				dlg.panelMain.mark.addObjColour(Col.BLACK);
+				isolButton.setBorderPainted(true);
+			} else {
+				isolButton.setBorderPainted(false);
+			}
+			topmarkButton.setVisible(dlg.panelMain.mark.testValid());
+			lightButton.setVisible(dlg.panelMain.mark.testValid());
+			dlg.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, JRadioButton>(Shp.class);
+	public EnumMap<Shp, Obj> carObjects = new EnumMap<Shp, Obj>(Shp.class);
+	public EnumMap<Shp, Obj> isdObjects = new EnumMap<Shp, Obj>(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()) {
+					dlg.panelMain.mark.setShape(shp);
+					if (isolButton.isSelected())
+						dlg.panelMain.mark.setObject(isdObjects.get(shp));
+					else
+						dlg.panelMain.mark.setObject(carObjects.get(shp));
+					button.setBorderPainted(true);
+				} else
+					button.setBorderPainted(false);
+			}
+			topmarkButton.setVisible(dlg.panelMain.mark.testValid());
+			lightButton.setVisible(dlg.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()) {
+				dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
+				dlg.panelMain.mark.setTopColour(Col.BLACK);
+				switch (dlg.panelMain.mark.getCategory()) {
+				case CAM_NORTH:
+					dlg.panelMain.mark.setTopmark(Top.NORTH);
+					break;
+				case CAM_SOUTH:
+					dlg.panelMain.mark.setTopmark(Top.SOUTH);
+					break;
+				case CAM_EAST:
+					dlg.panelMain.mark.setTopmark(Top.EAST);
+					break;
+				case CAM_WEST:
+					dlg.panelMain.mark.setTopmark(Top.WEST);
+					break;
+				default:
+					dlg.panelMain.mark.setTopmark(Top.SPHERES2);
+					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()) {
+				dlg.panelMain.mark.setLightAtt(Att.COL, 0, Col.WHITE);
+				switch (dlg.panelMain.mark.getCategory()) {
+				case CAM_NORTH:
+					dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");
+					dlg.panelMain.mark.setLightAtt(Att.GRP, 0, "");
+					break;
+				case CAM_SOUTH:
+					dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Q+LFl");
+					dlg.panelMain.mark.setLightAtt(Att.GRP, 0, "6");
+					break;
+				case CAM_EAST:
+					dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");
+					dlg.panelMain.mark.setLightAtt(Att.GRP, 0, "3");
+					break;
+				case CAM_WEST:
+					dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Q");
+					dlg.panelMain.mark.setLightAtt(Att.GRP, 0, "9");
+					break;
+				default:
+					dlg.panelMain.mark.setLightAtt(Att.CHR, 0, "Fl");
+					dlg.panelMain.mark.setLightAtt(Att.GRP, 0, "2");
+					break;
+				}
+				lightButton.setBorderPainted(true);
+			} else {
+				dlg.panelMain.mark.clrLight();
+				lightButton.setBorderPainted(false);
+			}
+			dlg.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(dlg.panelMain.mark.getCategory() == Cat.CAM_NORTH);
+		southButton.setBorderPainted(dlg.panelMain.mark.getCategory() == Cat.CAM_SOUTH);
+		eastButton.setBorderPainted(dlg.panelMain.mark.getCategory() == Cat.CAM_EAST);
+		westButton.setBorderPainted(dlg.panelMain.mark.getCategory() == Cat.CAM_WEST);
+		isolButton.setBorderPainted(SeaMark.GrpMAP.get(dlg.panelMain.mark.getObject()) == Grp.ISD);
+		for (Shp shp : shapes.keySet()) {
+			JRadioButton button = shapes.get(shp);
+			button.setBorderPainted(dlg.panelMain.mark.getShape() == shp);
+		}
+		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());
+	}
+
+	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 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelLights.java	(revision 29894)
@@ -0,0 +1,609 @@
+package panels;
+
+import java.awt.event.*;
+import java.awt.*;
+
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+import smed.SmedAction;
+import seamarks.SeaMark.*;
+
+public class PanelLights extends JPanel {
+
+	private SmedAction dlg;
+
+	public JLabel categoryLabel;
+
+	public JComboBox landCatBox;
+	public EnumMap<Cat, Integer> landCats = new EnumMap<Cat, Integer>(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())) {
+					dlg.panelMain.mark.setCategory(cat);
+					dlg.panelMain.mark.testValid();
+				}
+			}
+		}
+	};
+	public JComboBox trafficCatBox;
+	public EnumMap<Cat, Integer> trafficCats = new EnumMap<Cat, Integer>(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())) {
+					dlg.panelMain.mark.setCategory(cat);
+					dlg.panelMain.mark.testValid();
+				}
+			}
+		}
+	};
+	public JComboBox warningCatBox;
+	public EnumMap<Cat, Integer> warningCats = new EnumMap<Cat, Integer>(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())) {
+					dlg.panelMain.mark.setCategory(cat);
+					dlg.panelMain.mark.testValid();
+				}
+			}
+		}
+	};
+	public JComboBox platformCatBox;
+	public EnumMap<Cat, Integer> platformCats = new EnumMap<Cat, Integer>(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())) {
+					dlg.panelMain.mark.setCategory(cat);
+					dlg.panelMain.mark.testValid();
+				}
+			}
+		}
+	};
+	public JComboBox pilotCatBox;
+	public EnumMap<Cat, Integer> pilotCats = new EnumMap<Cat, Integer>(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())) {
+					dlg.panelMain.mark.setCategory(cat);
+					dlg.panelMain.mark.testValid();
+				}
+			}
+		}
+	};
+	public JComboBox rescueCatBox;
+	public EnumMap<Cat, Integer> rescueCats = new EnumMap<Cat, Integer>(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())) {
+					dlg.panelMain.mark.setCategory(cat);
+					dlg.panelMain.mark.testValid();
+				}
+			}
+		}
+	};
+	public JComboBox radioCatBox;
+	public EnumMap<Cat, Integer> radioCats = new EnumMap<Cat, Integer>(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())) {
+					dlg.panelMain.mark.setCategory(cat);
+					dlg.panelMain.mark.testValid();
+				}
+			}
+		}
+	};
+	public JComboBox radarCatBox;
+	public EnumMap<Cat, Integer> radarCats = new EnumMap<Cat, Integer>(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())) {
+					dlg.panelMain.mark.setCategory(cat);
+					dlg.panelMain.mark.testValid();
+				}
+			}
+		}
+	};
+	public JLabel functionLabel;
+	public JComboBox functionBox;
+	public EnumMap<Fnc, Integer> functions = new EnumMap<Fnc, Integer>(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())) {
+					dlg.panelMain.mark.setFunc(fnc);
+					dlg.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, JRadioButton>(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()) {
+					dlg.panelMain.mark.setObject(obj);
+					button.setBorderPainted(true);
+				} else
+					button.setBorderPainted(false);
+			}
+			if (dlg.panelMain.mark.getObject() == Obj.LITVES)
+				dlg.panelMain.mark.setShape(Shp.SUPER);
+			else if (dlg.panelMain.mark.getObject() == Obj.LITFLT)
+				dlg.panelMain.mark.setShape(Shp.FLOAT);
+			else dlg.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);
+			dlg.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);
+			}
+			dlg.panelMain.mark.testValid();
+		}
+	};
+	public JLabel chLabel;
+	public JTextField chBox;
+	private FocusListener flCh = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.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(dlg.panelMain.mark.getChannel());
+		if ((dlg.panelMain.mark.getObject() == Obj.LNDMRK) && ((dlg.panelMain.mark.getCategory() != Cat.NOCAT) || (dlg.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 (dlg.panelMain.mark.getFunc() == fnc)
+					functionBox.setSelectedIndex(item);
+			}
+			for (Cat cat : landCats.keySet()) {
+				int item = landCats.get(cat);
+				if (dlg.panelMain.mark.getCategory() == cat)
+					landCatBox.setSelectedIndex(item);
+			}
+		} else if (dlg.panelMain.mark.getObject() == Obj.SISTAT) {
+				categoryLabel.setVisible(true);
+				trafficCatBox.setVisible(true);
+				for (Cat cat : trafficCats.keySet()) {
+					int item = trafficCats.get(cat);
+					if (dlg.panelMain.mark.getCategory() == cat)
+						trafficCatBox.setSelectedIndex(item);
+				}
+				chLabel.setVisible(true);
+				chBox.setVisible(true);
+		} else if (dlg.panelMain.mark.getObject() == Obj.SISTAW) {
+			categoryLabel.setVisible(true);
+			warningCatBox.setVisible(true);
+			for (Cat cat : warningCats.keySet()) {
+				int item = warningCats.get(cat);
+				if (dlg.panelMain.mark.getCategory() == cat)
+					warningCatBox.setSelectedIndex(item);
+			}
+			chLabel.setVisible(true);
+			chBox.setVisible(true);
+		} else if (dlg.panelMain.mark.getObject() == Obj.OFSPLF) {
+			categoryLabel.setVisible(true);
+			platformCatBox.setVisible(true);
+			for (Cat cat : platformCats.keySet()) {
+				int item = platformCats.get(cat);
+				if (dlg.panelMain.mark.getCategory() == cat)
+					platformCatBox.setSelectedIndex(item);
+			}
+		} else if (dlg.panelMain.mark.getObject() == Obj.PILBOP) {
+			categoryLabel.setVisible(true);
+			pilotCatBox.setVisible(true);
+			for (Cat cat : pilotCats.keySet()) {
+				int item = pilotCats.get(cat);
+				if (dlg.panelMain.mark.getCategory() == cat)
+					pilotCatBox.setSelectedIndex(item);
+			}
+			chLabel.setVisible(true);
+			chBox.setVisible(true);
+		} else if (dlg.panelMain.mark.getObject() == Obj.RSCSTA) {
+			categoryLabel.setVisible(true);
+			rescueCatBox.setVisible(true);
+			for (Cat cat : rescueCats.keySet()) {
+				int item = rescueCats.get(cat);
+				if (dlg.panelMain.mark.getCategory() == cat)
+					rescueCatBox.setSelectedIndex(item);
+			}
+		} else if (dlg.panelMain.mark.getObject() == Obj.RDOSTA) {
+			categoryLabel.setVisible(true);
+			radioCatBox.setVisible(true);
+			for (Cat cat : radioCats.keySet()) {
+				int item = radioCats.get(cat);
+				if (dlg.panelMain.mark.getCategory() == cat)
+					radioCatBox.setSelectedIndex(item);
+			}
+			chLabel.setVisible(true);
+			chBox.setVisible(true);
+		} else if (dlg.panelMain.mark.getObject() == Obj.RADSTA) {
+			categoryLabel.setVisible(true);
+			radarCatBox.setVisible(true);
+			for (Cat cat : radarCats.keySet()) {
+				int item = radarCats.get(cat);
+				if (dlg.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(dlg.panelMain.mark.getObject() == obj);
+		}
+		dlg.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 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelLit.java	(revision 29894)
@@ -0,0 +1,351 @@
+package panels;
+
+import javax.swing.*;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.EnumMap;
+
+import messages.Messages;
+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) {
+			dlg.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) {
+			dlg.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) {
+			dlg.panelMain.mark.setLightAtt(Att.SEQ, 0, sequenceBox.getText());
+		}
+	};
+	public JLabel visibilityLabel;
+	public JComboBox visibilityBox;
+	public EnumMap<Vis, Integer> visibilities = new EnumMap<Vis, Integer>(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())
+					dlg.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) {
+			dlg.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) {
+			dlg.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) {
+			dlg.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) {
+			dlg.panelMain.mark.setLightAtt(Att.MLT, 0, multipleBox.getText());
+		}
+	};
+	public JLabel categoryLabel;
+	public JComboBox categoryBox;
+	public EnumMap<Lit, Integer> categories = new EnumMap<Lit, Integer>(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())
+					dlg.panelMain.mark.setLightAtt(Att.LIT, 0, lit);
+			}
+			if (dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR) {
+				dlg.panelMain.mark.setLightAtt(Att.MLT, 0, "");
+				multipleBox.setText("");
+				orientationLabel.setVisible(true);
+				orientationBox.setVisible(true);
+				multipleLabel.setVisible(false);
+				multipleBox.setVisible(false);
+			} else if ((dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)) {
+				dlg.panelMain.mark.setLightAtt(Att.ORT, 0, "");
+				orientationBox.setText("");
+				orientationLabel.setVisible(false);
+				orientationBox.setVisible(false);
+				multipleLabel.setVisible(true);
+				multipleBox.setVisible(true);
+			} else {
+				dlg.panelMain.mark.setLightAtt(Att.MLT, 0, "");
+				multipleBox.setText("");
+				dlg.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 exhibitionBox;
+	public EnumMap<Exh, Integer> exhibitions = new EnumMap<Exh, Integer>(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())
+					dlg.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 (dlg.panelMain.mark.getSectorCount() > 1)
+					dlg.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)dlg.panelMain.mark.getLightAtt(Att.GRP, 0));
+		periodBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.PER, 0));
+		sequenceBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.SEQ, 0));
+		heightBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.HGT, 0));
+		rangeBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.RNG, 0));
+		orientationBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.ORT, 0));
+		orientationBox.setVisible(dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR);
+		multipleBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.MLT, 0));
+		multipleBox.setVisible((dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ));
+		for (Vis vis : visibilities.keySet()) {
+			int item = visibilities.get(vis);
+			if (dlg.panelMain.mark.getLightAtt(Att.VIS, 0) == vis)
+				visibilityBox.setSelectedIndex(item);
+		}
+		for (Lit lit : categories.keySet()) {
+			int item = categories.get(lit);
+			if (dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == lit)
+				categoryBox.setSelectedIndex(item);
+		}
+		for (Exh exh : exhibitions.keySet()) {
+			int item = exhibitions.get(exh);
+			if (dlg.panelMain.mark.getLightAtt(Att.EXH, 0) == exh)
+				exhibitionBox.setSelectedIndex(item);
+		}
+		if (dlg.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 (dlg.panelMain.mark.getSectorCount() > 1)
+				dlg.panelMain.mark.delLight(dlg.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 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelMain.java	(revision 29894)
@@ -0,0 +1,340 @@
+package panels;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+import messages.Messages;
+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);
+
+	}
+
+	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 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelMore.java	(revision 29894)
@@ -0,0 +1,364 @@
+package panels;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+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) {
+			dlg.panelMain.mark.setInfo(infoBox.getText());
+		}
+	};
+	public JLabel sourceLabel;
+	public JTextField sourceBox;
+	private FocusListener flSource = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.panelMain.mark.setSource(sourceBox.getText());
+		}
+	};
+	public JLabel elevLabel;
+	public JTextField elevBox;
+	private FocusListener flElev = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.panelMain.mark.setElevation(elevBox.getText());
+		}
+	};
+	public JLabel heightLabel;
+	public JTextField heightBox;
+	private FocusListener flHeight = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.panelMain.mark.setObjectHeight(heightBox.getText());
+		}
+	};
+	public JLabel statusLabel;
+	public JComboBox statusBox;
+	public EnumMap<Sts, Integer> statuses = new EnumMap<Sts, Integer>(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 (dlg.panelMain.mark != null && (idx == statusBox.getSelectedIndex()))
+					dlg.panelMain.mark.setStatus(sts);
+			}
+		}
+	};
+	public JLabel constrLabel;
+	public JComboBox constrBox;
+	public EnumMap<Cns, Integer> constructions = new EnumMap<Cns, Integer>(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 (dlg.panelMain.mark != null && (idx == constrBox.getSelectedIndex()))
+					dlg.panelMain.mark.setConstr(cns);
+			}
+		}
+	};
+	public JLabel conLabel;
+	public JComboBox conBox;
+	public EnumMap<Con, Integer> conspicuities = new EnumMap<Con, Integer>(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 (dlg.panelMain.mark != null && (idx == conBox.getSelectedIndex()))
+					dlg.panelMain.mark.setConsp(con);
+			}
+		}
+	};
+	public JLabel reflLabel;
+	public JComboBox reflBox;
+	public EnumMap<Con, Integer> reflectivities = new EnumMap<Con, Integer>(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 (dlg.panelMain.mark != null && (idx == reflBox.getSelectedIndex()))
+					dlg.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()) {
+				dlg.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 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelPat.java	(revision 29894)
@@ -0,0 +1,94 @@
+package panels;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+import smed.SmedAction;
+import seamarks.SeaMark.*;
+
+public class PanelPat extends JPanel {
+
+	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, JRadioButton>(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()) {
+					dlg.panelMain.mark.setPattern(ent, pat);
+					button.setBorderPainted(true);
+				} else
+					button.setBorderPainted(false);
+			}
+			switch (dlg.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 void syncPanel() {
+		for (Pat pat : patterns.keySet()) {
+			JRadioButton button = patterns.get(pat);
+			if (dlg.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;
+	}
+
+}
Index: applications/editors/josm/plugins/smed/src/panels/PanelPort.java
===================================================================
--- applications/editors/josm/plugins/smed/src/panels/PanelPort.java	(revision 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelPort.java	(revision 29894)
@@ -0,0 +1,124 @@
+package panels;
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+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, JRadioButton>(Shp.class);
+	public EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(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()) {
+					dlg.panelMain.mark.setShape(shp);
+					dlg.panelMain.mark.setObject(objects.get(shp));
+					button.setBorderPainted(true);
+				} else
+					button.setBorderPainted(false);
+			}
+			if (dlg.panelMain.mark.testValid()) {
+				dlg.panelMain.panelChan.topmarkButton.setVisible(true);
+				dlg.panelMain.panelChan.lightButton.setVisible(true);
+				if (dlg.panelMain.mark.getCategory() == Cat.LAM_PORT) {
+					switch (dlg.panelMain.mark.getRegion()) {
+					case A:
+						dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
+						dlg.panelMain.mark.setObjColour(Col.RED);
+						break;
+					case B:
+						dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
+						dlg.panelMain.mark.setObjColour(Col.GREEN);
+						break;
+					case C:
+						dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
+						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;
+					}
+				} else {
+					dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
+					switch (dlg.panelMain.mark.getRegion()) {
+					case A:
+						dlg.panelMain.mark.setObjColour(Col.RED);
+						dlg.panelMain.mark.addObjColour(Col.GREEN);
+						dlg.panelMain.mark.addObjColour(Col.RED);
+						break;
+					case B:
+						dlg.panelMain.mark.setObjColour(Col.GREEN);
+						dlg.panelMain.mark.addObjColour(Col.RED);
+						dlg.panelMain.mark.addObjColour(Col.GREEN);
+						break;
+					case C:
+						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;
+					}
+				}
+				dlg.panelMain.panelMore.syncPanel();
+			} else {
+				dlg.panelMain.panelChan.topmarkButton.setVisible(false);
+				dlg.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 void syncPanel() {
+		for (Shp shp : shapes.keySet()) {
+			JRadioButton button = shapes.get(shp);
+			if (dlg.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;
+	}
+
+}
Index: applications/editors/josm/plugins/smed/src/panels/PanelRadar.java
===================================================================
--- applications/editors/josm/plugins/smed/src/panels/PanelRadar.java	(revision 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelRadar.java	(revision 29894)
@@ -0,0 +1,248 @@
+package panels;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+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 radioCatBox;
+	private EnumMap<Cat, Integer> radioCats = new EnumMap<Cat, Integer>(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())) {
+					dlg.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, JRadioButton>(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()) {
+					dlg.panelMain.mark.setRadar(rtb);
+				}
+			}
+			syncPanel();
+		}
+	};
+	public JLabel groupLabel;
+	public JTextField groupBox;
+	private FocusListener flGroup = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.panelMain.mark.setRaconGroup(groupBox.getText());
+		}
+	};
+	public JLabel periodLabel;
+	public JTextField periodBox;
+	private FocusListener flPeriod = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.panelMain.mark.setRaconPeriod(periodBox.getText());
+		}
+	};
+	public JLabel seqLabel;
+	public JTextField seqBox;
+	private FocusListener flSeq = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.panelMain.mark.setRaconSequence(seqBox.getText());
+		}
+	};
+	public JLabel rangeLabel;
+	public JTextField rangeBox;
+	private FocusListener flRange = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.panelMain.mark.setRaconRange(rangeBox.getText());
+		}
+	};
+	public JLabel sector1Label;
+	public JTextField sector1Box;
+	private FocusListener flSector1 = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.panelMain.mark.setRaconSector1(sector1Box.getText());
+		}
+	};
+	public JLabel sector2Label;
+	public JTextField sector2Box;
+	private FocusListener flSector2 = new FocusAdapter() {
+		public void focusLost(java.awt.event.FocusEvent e) {
+			dlg.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 = ((dlg.panelMain.mark.getRadar() != Rtb.NORTB) && (dlg.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(dlg.panelMain.mark.getRadar() == rtb);
+		}
+		groupBox.setText(dlg.panelMain.mark.getRaconGroup());
+		seqBox.setText(dlg.panelMain.mark.getRaconSequence());
+		periodBox.setText(dlg.panelMain.mark.getRaconPeriod());
+		rangeBox.setText(dlg.panelMain.mark.getRaconRange());
+		sector1Box.setText(dlg.panelMain.mark.getRaconSector1());
+		sector2Box.setText(dlg.panelMain.mark.getRaconSector2());
+		aisButton.setSelected(dlg.panelMain.mark.getRadio() != Cat.NOROS);
+		aisButton.setBorderPainted(aisButton.isSelected());
+		radioCatBox.setVisible(dlg.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 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelSaw.java	(revision 29894)
@@ -0,0 +1,79 @@
+package panels;
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+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, JRadioButton>(Shp.class);
+	public EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(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()) {
+					dlg.panelMain.mark.setShape(shp);
+					dlg.panelMain.mark.setObject(objects.get(shp));
+					button.setBorderPainted(true);
+				} else
+					button.setBorderPainted(false);
+			}
+			if (dlg.panelMain.mark.testValid()) {
+				dlg.panelMain.panelChan.topmarkButton.setVisible(true);
+				dlg.panelMain.mark.setObjPattern(Pat.VSTRP);
+				dlg.panelMain.mark.setObjColour(Col.RED);
+				dlg.panelMain.mark.addObjColour(Col.WHITE);
+			} else {
+				dlg.panelMain.panelChan.topmarkButton.setVisible(false);
+			}
+			dlg.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 void syncPanel() {
+		for (Shp shp : shapes.keySet()) {
+			JRadioButton button = shapes.get(shp);
+			if (dlg.panelMain.mark.getShape() == shp) {
+				button.setBorderPainted(true);
+			} else
+				button.setBorderPainted(false);
+		}
+		dlg.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 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelSectors.java	(revision 29894)
@@ -0,0 +1,324 @@
+package panels;
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.EnumMap;
+
+import javax.swing.*;
+import javax.swing.table.*;
+
+import messages.Messages;
+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 colourBox;
+	public EnumMap<Col, ImageIcon> colours = new EnumMap<Col, ImageIcon>(Col.class);
+	public JComboBox visibilityBox;
+	public EnumMap<Vis, String> visibilities = new EnumMap<Vis, String>(Vis.class);
+	public JComboBox exhibitionBox;
+	public EnumMap<Exh, String> exhibitions = new EnumMap<Exh, String>(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 (dlg.panelMain == null)
+				return 1;
+			else
+				return dlg.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)dlg.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) {
+					if (dlg.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL) {
+						return Col.UNKCOL;
+					} else {
+						return dlg.panelMain.mark.getLightAtt(Att.ALT, row);
+					}
+				} else {
+					return dlg.panelMain.mark.getLightAtt(Att.COL, row);
+				}
+			case 6:
+				return (dlg.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR);
+			case 7:
+			case 8:
+				if (dlg.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR)
+					return dlg.panelMain.mark.getLightAtt(Att.ORT, row);
+				else
+					return dlg.panelMain.mark.getLightAtt(col - 1, row);
+			case 12:
+				return visibilities.get(dlg.panelMain.mark.getLightAtt(Att.VIS, row));
+			case 13:
+				return exhibitions.get(dlg.panelMain.mark.getLightAtt(Att.EXH, row));
+			default:
+				return dlg.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)dlg.panelMain.mark.getLightAtt(Att.CHR, row)).contains("Al")) {
+							if (((colour == Col.UNKCOL) && (dlg.panelMain.mark.getLightAtt(Att.ALT, row) == Col.UNKCOL))
+									|| (dlg.panelMain.mark.getLightAtt(Att.COL, row) == Col.UNKCOL)) {
+								dlg.panelMain.mark.setLightAtt(Att.COL, row, colour);
+							} else {
+								dlg.panelMain.mark.setLightAtt(Att.ALT, row, colour);
+							}
+						} else {
+							dlg.panelMain.mark.setLightAtt(Att.COL, row, colour);
+						}
+				}
+				break;
+			case 5:
+			case 9:
+			case 10:
+			case 11:
+				dlg.panelMain.mark.setLightAtt(col - 1, row, value);
+				break;
+			case 6:
+				if ((Boolean) value == true) {
+					dlg.panelMain.mark.setLightAtt(Att.LIT, row, Lit.DIR);
+					dlg.panelMain.mark.setLightAtt(Att.BEG, row, "");
+					dlg.panelMain.mark.setLightAtt(Att.END, row, "");
+				} else {
+					dlg.panelMain.mark.setLightAtt(Att.LIT, row, Lit.UNKLIT);
+					dlg.panelMain.mark.setLightAtt(Att.ORT, row, "");
+				}
+				break;
+			case 7:
+			case 8:
+				if (dlg.panelMain.mark.getLightAtt(Att.LIT, row) == Lit.DIR) {
+					dlg.panelMain.mark.setLightAtt(Att.ORT, row, value);
+				} else {
+					dlg.panelMain.mark.setLightAtt(col - 1, row, value);
+				}
+				break;
+			case 12:
+				for (Vis vis : visibilities.keySet()) {
+					String str = visibilities.get(vis);
+					if (str.equals(value))
+						dlg.panelMain.mark.setLightAtt(Att.VIS, row, vis);
+				}
+				break;
+			case 13:
+				for (Exh exh : exhibitions.keySet()) {
+					String str = exhibitions.get(exh);
+					if (str.equals(value))
+						dlg.panelMain.mark.setLightAtt(Att.EXH, row, exh);
+				}
+				break;
+			default:
+				dlg.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)dlg.panelMain.mark.getLightAtt(Att.CHR, rowIndex)).contains("Al")) {
+				col2Label.setBackground(SeaMark.ColMAP.get(dlg.panelMain.mark.getLightAtt(Att.COL, rowIndex)));
+			} else {
+				col2Label.setBackground(SeaMark.ColMAP.get(dlg.panelMain.mark.getLightAtt(Att.ALT, rowIndex)));
+			}
+			col1Label.setBackground(SeaMark.ColMAP.get(dlg.panelMain.mark.getLightAtt(Att.COL, rowIndex)));
+			return this;
+		}
+	}
+
+	public int getSectorCount() {
+		return model.getRowCount();
+	}
+
+	public void addSector(int idx) {
+		dlg.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) {
+			dlg.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 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelSpec.java	(revision 29894)
@@ -0,0 +1,305 @@
+package panels;
+
+import java.awt.*;
+import java.awt.event.*;
+
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+import smed.SmedAction;
+import seamarks.SeaMark;
+import seamarks.SeaMark.*;
+
+public class PanelSpec extends JPanel {
+
+	private SmedAction dlg;
+	public JLabel categoryLabel;
+	public JComboBox categoryBox;
+	public EnumMap<Cat, Integer> categories = new EnumMap<Cat, Integer>(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()))
+					dlg.panelMain.mark.setCategory(cat);
+			}
+		}
+	};
+	public JComboBox mooringBox;
+	public EnumMap<Cat, Integer> moorings = new EnumMap<Cat, Integer>(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())) {
+					dlg.panelMain.mark.setCategory(cat);
+					if ((cat == Cat.INB_CALM) || (cat == Cat.INB_SBM)) {
+						dlg.panelMain.mark.setObject(Obj.BOYINB);
+						dlg.panelMain.mark.setShape(Shp.UNKSHP);
+					} else {
+						dlg.panelMain.mark.setObject(Obj.MORFAC);
+						if (cat != Cat.MOR_BUOY)
+							dlg.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, JRadioButton>(Shp.class);
+	public EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class);
+	public ActionListener alShape = new ActionListener() {
+		public void actionPerformed(java.awt.event.ActionEvent e) {
+			if ((dlg.panelMain.mark.getObject() != Obj.MORFAC) || (dlg.panelMain.mark.getCategory() == Cat.MOR_BUOY)) {
+				for (Shp shp : shapes.keySet()) {
+					JRadioButton button = shapes.get(shp);
+					if (button.isSelected()) {
+						dlg.panelMain.mark.setShape(shp);
+						if (SeaMark.EntMAP.get(dlg.panelMain.mark.getObject()) != Ent.MOORING) {
+							dlg.panelMain.mark.setObject(objects.get(shp));
+							if (dlg.panelMain.mark.getObjColour(0) == Col.UNKCOL) {
+								dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
+								dlg.panelMain.mark.setObjColour(Col.YELLOW);
+							}
+							if (button == cairnButton) {
+								dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
+								dlg.panelMain.mark.setObjColour(Col.UNKCOL);
+							}
+							topmarkButton.setVisible(dlg.panelMain.mark.testValid());
+						}
+						button.setBorderPainted(true);
+					} else
+						button.setBorderPainted(false);
+				}
+				dlg.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()) {
+				dlg.panelMain.mark.setTopmark(Top.X_SHAPE);
+				dlg.panelMain.mark.setTopPattern(Pat.NOPAT);
+				dlg.panelMain.mark.setTopColour(Col.YELLOW);
+				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 noticeButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/NoticeButton.png")));
+	private ActionListener alNotice = new ActionListener() {
+		public void actionPerformed(java.awt.event.ActionEvent e) {
+			dlg.panelMain.mark.clrMark();
+			if (noticeButton.isSelected()) {
+				dlg.panelMain.mark.setObject(Obj.NOTMRK);
+				noticeButton.setBorderPainted(true);
+			} else {
+				dlg.panelMain.mark.setObject(Obj.UNKOBJ);
+				noticeButton.setBorderPainted(false);
+			}
+			dlg.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) {
+			dlg.panelMain.mark.setObject(Obj.UNKOBJ);
+			dlg.panelMain.mark.setCategory(Cat.NOCAT);
+			dlg.panelMain.mark.setTopmark(Top.NOTOP);
+			if (mooringButton.isSelected()) {
+				dlg.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(dlg.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 (dlg.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(dlg.panelMain.mark.getTopmark() != Top.NOTOP);
+			topmarkButton.setSelected(dlg.panelMain.mark.getTopmark() != Top.NOTOP);
+			topmarkButton.setVisible(dlg.panelMain.mark.testValid());
+			for (Cat cat : categories.keySet()) {
+				int item = categories.get(cat);
+				if (dlg.panelMain.mark.getCategory() == cat)
+					categoryBox.setSelectedIndex(item);
+			}
+		}
+		for (Shp shp : shapes.keySet()) {
+			JRadioButton button = shapes.get(shp);
+			if (dlg.panelMain.mark.getShape() == shp) {
+				button.setBorderPainted(true);
+			} else
+				button.setBorderPainted(false);
+		}
+		noticeButton.setBorderPainted(false);
+		dlg.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 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelStbd.java	(revision 29894)
@@ -0,0 +1,124 @@
+package panels;
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+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, JRadioButton>(Shp.class);
+	public EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(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()) {
+					dlg.panelMain.mark.setShape(shp);
+					dlg.panelMain.mark.setObject(objects.get(shp));
+					button.setBorderPainted(true);
+				} else
+					button.setBorderPainted(false);
+			}
+			if (dlg.panelMain.mark.testValid()) {
+				dlg.panelMain.panelChan.topmarkButton.setVisible(true);
+				dlg.panelMain.panelChan.lightButton.setVisible(true);
+				if (dlg.panelMain.mark.getCategory() == Cat.LAM_STBD) {
+					switch (dlg.panelMain.mark.getRegion()) {
+					case A:
+						dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
+						dlg.panelMain.mark.setObjColour(Col.GREEN);
+						break;
+					case B:
+						dlg.panelMain.mark.setObjPattern(Pat.NOPAT);
+						dlg.panelMain.mark.setObjColour(Col.RED);
+						break;
+					case C:
+						dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
+						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;
+					}
+				} else {
+					dlg.panelMain.mark.setObjPattern(Pat.HSTRP);
+					switch (dlg.panelMain.mark.getRegion()) {
+					case A:
+						dlg.panelMain.mark.setObjColour(Col.GREEN);
+						dlg.panelMain.mark.addObjColour(Col.RED);
+						dlg.panelMain.mark.addObjColour(Col.GREEN);
+						break;
+					case B:
+						dlg.panelMain.mark.setObjColour(Col.RED);
+						dlg.panelMain.mark.addObjColour(Col.GREEN);
+						dlg.panelMain.mark.addObjColour(Col.RED);
+						break;
+					case C:
+						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;
+					}
+				}
+				dlg.panelMain.panelMore.syncPanel();
+			} else {
+				dlg.panelMain.panelChan.topmarkButton.setVisible(false);
+				dlg.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 void syncPanel() {
+		for (Shp shp : shapes.keySet()) {
+			JRadioButton button = shapes.get(shp);
+			if (dlg.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;
+	}
+
+}
Index: applications/editors/josm/plugins/smed/src/panels/PanelTop.java
===================================================================
--- applications/editors/josm/plugins/smed/src/panels/PanelTop.java	(revision 29894)
+++ applications/editors/josm/plugins/smed/src/panels/PanelTop.java	(revision 29894)
@@ -0,0 +1,99 @@
+package panels;
+
+import java.awt.*;
+import java.awt.event.*;
+import javax.swing.*;
+
+import java.util.*;
+
+import messages.Messages;
+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, JRadioButton>(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()) {
+					dlg.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 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 (dlg.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;
+	}
+
+}
