Index: /applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementPlugin.java
===================================================================
--- /applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementPlugin.java	(revision 23192)
+++ /applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementPlugin.java	(revision 23193)
@@ -20,5 +20,5 @@
 
     public MeasurementPlugin(PluginInformation info) {
-    	super(info);
+        super(info);
         mode = new MeasurementMode(Main.map, "measurement", tr("measurement mode"));
         btn = new IconToggleButton(mode);
@@ -47,6 +47,6 @@
                 }
                 public void layerRemoved(final Layer oldLayer) {
-                	if (oldLayer != null && oldLayer == currentLayer)
-                		MapView.removeLayerChangeListener(this);
+                    if (oldLayer != null && oldLayer == currentLayer)
+                        MapView.removeLayerChangeListener(this);
                 }
             });
Index: /applications/editors/josm/plugins/michigan_left/src/MichiganLeft/MichiganLeft.java
===================================================================
--- /applications/editors/josm/plugins/michigan_left/src/MichiganLeft/MichiganLeft.java	(revision 23192)
+++ /applications/editors/josm/plugins/michigan_left/src/MichiganLeft/MichiganLeft.java	(revision 23193)
@@ -41,6 +41,6 @@
   private class MichiganLeftAction extends JosmAction {
     /**
-		 * 
-		 */
+         *
+         */
     private static final long serialVersionUID = 1L;
     private LinkedList<Command> cmds = new LinkedList<Command>();
@@ -57,7 +57,7 @@
       Collection<OsmPrimitive> mainSelection = Main.main.getCurrentDataSet()
           .getSelected();
-      
+
       ArrayList<OsmPrimitive> selection = new ArrayList<OsmPrimitive>();
-      
+
       for (OsmPrimitive prim: mainSelection) selection.add(prim);
 
Index: /applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaAction.java
===================================================================
--- /applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaAction.java	(revision 23192)
+++ /applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaAction.java	(revision 23193)
@@ -36,289 +36,289 @@
 public class SimplifyAreaAction extends JosmAction {
 
-	private static final long serialVersionUID = 6854238214548011750L;
-
-	public SimplifyAreaAction() {
-		super(tr("Simplify Area"), "simplify", tr("Delete unnecessary nodes from an area."),
-				Shortcut.registerShortcut("tools:simplifyArea", tr("Tool: {0}", tr("Simplify Area")), KeyEvent.VK_A, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
-	}
-
-
-	private List<Bounds> getCurrentEditBounds() {
-		final LinkedList<Bounds> bounds = new LinkedList<Bounds>();
-		final OsmDataLayer dataLayer = Main.map.mapView.getEditLayer();
-		for (final DataSource ds : dataLayer.data.dataSources) {
-			if (ds.bounds != null) {
-				bounds.add(ds.bounds);
-			}
-		}
-		return bounds;
-	}
-
-
-	private boolean isInBounds(final Node node, final List<Bounds> bounds) {
-		for (final Bounds b : bounds) {
-			if (b.contains(node.getCoor())) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-
-	private boolean confirmWayWithNodesOutsideBoundingBox() {
-		final ButtonSpec[] options = new ButtonSpec[] { new ButtonSpec(tr("Yes, delete nodes"), ImageProvider.get("ok"), tr("Delete nodes outside of downloaded data regions"), null),
-				new ButtonSpec(tr("No, abort"), ImageProvider.get("cancel"), tr("Cancel operation"), null) };
-		final int ret = HelpAwareOptionPane.showOptionDialog(
-				Main.parent,
-				"<html>" + trn("The selected way has nodes outside of the downloaded data region.", "The selected ways have nodes outside of the downloaded data region.", getCurrentDataSet().getSelectedWays().size())
-						+ "<br>" + tr("This can lead to nodes being deleted accidentally.") + "<br>" + tr("Do you want to delete them anyway?") + "</html>",
-				tr("Delete nodes outside of data regions?"), JOptionPane.WARNING_MESSAGE, null, // no special icon
-				options, options[0], null);
-		return ret == 0;
-	}
-
-
-	private void alertSelectAtLeastOneWay() {
-		HelpAwareOptionPane.showOptionDialog(Main.parent, tr("Please select at least one way to simplify."), tr("Warning"), JOptionPane.WARNING_MESSAGE, null);
-	}
-
-
-	private boolean confirmSimplifyManyWays(final int numWays) {
-		final ButtonSpec[] options = new ButtonSpec[] { new ButtonSpec(tr("Yes"), ImageProvider.get("ok"), tr("Simplify all selected ways"), null),
-				new ButtonSpec(tr("Cancel"), ImageProvider.get("cancel"), tr("Cancel operation"), null) };
-		final int ret = HelpAwareOptionPane.showOptionDialog(Main.parent, tr("The selection contains {0} ways. Are you sure you want to simplify them all?", numWays), tr("Simplify ways?"),
-				JOptionPane.WARNING_MESSAGE, null, // no special icon
-				options, options[0], null);
-		return ret == 0;
-	}
-
-
-	@Override
-	public void actionPerformed(final ActionEvent e) {
-		final Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected();
-
-		final List<Bounds> bounds = getCurrentEditBounds();
-		for (final OsmPrimitive prim : selection) {
-			if (prim instanceof Way && bounds.size() > 0) {
-				final Way way = (Way) prim;
-				// We check if each node of each way is at least in one download
-				// bounding box. Otherwise nodes may get deleted that are necessary by
-				// unloaded ways (see Ticket #1594)
-				for (final Node node : way.getNodes()) {
-					if (!isInBounds(node, bounds)) {
-						if (!confirmWayWithNodesOutsideBoundingBox()) {
-							return;
-						}
-						break;
-					}
-				}
-			}
-		}
-		final List<Way> ways = OsmPrimitive.getFilteredList(selection, Way.class);
-		if (ways.isEmpty()) {
-			alertSelectAtLeastOneWay();
-			return;
-		} else if (ways.size() > 10) {
-			if (!confirmSimplifyManyWays(ways.size())) {
-				return;
-			}
-		}
-
-		final Collection<Command> allCommands = new LinkedList<Command>();
-		for (final Way way : ways) {
-			final SequenceCommand simplifyCommand = simplifyWay(way);
-			if (simplifyCommand == null) {
-				continue;
-			}
-			allCommands.add(simplifyCommand);
-		}
-
-		if (!allCommands.isEmpty()) {
-			final SequenceCommand rootCommand = new SequenceCommand(trn("Simplify {0} way", "Simplify {0} ways", allCommands.size(), allCommands.size()), allCommands);
-			Main.main.undoRedo.add(rootCommand);
-			Main.map.repaint();
-		}
-	}
-
-
-	/**
-	 * Replies true if <code>node</code> is a required node which can't be removed in order to simplify the way.
-	 *
-	 * @param way
-	 *            the way to be simplified
-	 * @param node
-	 *            the node to check
-	 * @return true if <code>node</code> is a required node which can't be removed in order to simplify the way.
-	 */
-	private boolean isRequiredNode(final Way way, final Node node) {
-		final List<OsmPrimitive> parents = new LinkedList<OsmPrimitive>(node.getReferrers());
-		parents.remove(way);
-		return !parents.isEmpty() || node.isTagged();
-	}
-
-
-	/**
-	 * Simplifies a way
-	 *
-	 * @param w
-	 *            the way to simplify
-	 */
-	private SequenceCommand simplifyWay(final Way w) {
-		final double angleThreshold = Double.parseDouble(Main.pref.get("simplify-area.angle", "10.0"));
-		final double distanceTreshold = Double.parseDouble(Main.pref.get("simplify-area.distance", "0.2"));
-		final double areaTreshold = Double.parseDouble(Main.pref.get("simplify-area.area", "5.0"));
-
-		final List<Node> nodes = w.getNodes();
-		final int size = nodes.size();
-
-		if (size == 0) {
-			return null;
-		}
-
-		final List<MoveCommand> moveCommandList = new ArrayList<MoveCommand>();
-
-		final boolean closed = nodes.get(0).equals(nodes.get(size - 1));
-
-		final List<Node> newNodes = new ArrayList<Node>(size);
-
-		if (closed) {
-			nodes.remove(size - 1); // remove end node ( = start node)
-		}
-
-		{
-			// remove near nodes
-			for (int i = 0; i < size; i++) {
-				final boolean closing = closed && i == size - 1;
-				final Node n1 = closing ? nodes.get(0) : nodes.get(i);
-
-				if (newNodes.isEmpty()) {
-					newNodes.add(n1);
-					continue;
-				}
-
-				final Node n2 = newNodes.get(newNodes.size() - 1);
-
-				final LatLon coord1 = n1.getCoor();
-				final LatLon coord2 = n2.getCoor();
-
-				if (isRequiredNode(w, n1) || isRequiredNode(w, n2) || computeDistance(coord1, coord2) > distanceTreshold) {
-					if (!closing) {
-						newNodes.add(n1);
-					}
-				} else {
-					moveCommandList.add(new MoveCommand(n2, new LatLon((coord1.lat() + coord2.lat()) / 2.0, (coord1.lon() + coord2.lon()) / 2.0)));
-					if (closing) {
-						newNodes.remove(0);
-					}
-				}
-			}
-		}
-
-		final int size2 = newNodes.size();
-
-		final List<Node> newNodes2 = new ArrayList<Node>(size2);
-
-		Node prevNode = null;
-		LatLon coord1 = null;
-		LatLon coord2 = null;
-
-		for (int i = 0, len = size2 + 1 + (closed ? 1 : 0); i < len; i++) {
-			final Node n = newNodes.get(i % size2);
-			final LatLon coord3 = n.getCoor();
-
-			if (coord1 != null) {
-				if (isRequiredNode(w, prevNode) ||
-						Math.abs(computeBearing(coord2, coord3) - computeBearing(coord1, coord2)) > angleThreshold ||
-						computeArea(coord1, coord2, coord3) > areaTreshold) {
-					newNodes2.add(prevNode);
-				} else {
-					coord2 = coord1; // at the end of the iteration preserve coord1
-				}
-			} else if (!closed && prevNode != null) {
-				newNodes2.add(prevNode);
-			}
-
-			coord1 = coord2;
-			coord2 = coord3;
-			prevNode = n;
-		}
-
-		if (closed) {
-			newNodes2.add(newNodes2.get(0)); // set end node ( = start node)
-		}
-
-		final HashSet<Node> delNodes = new HashSet<Node>();
-		delNodes.addAll(nodes);
-		delNodes.removeAll(newNodes2);
-
-		if (delNodes.isEmpty()) {
-			return null;
-		}
-
-		final Collection<Command> cmds = new LinkedList<Command>();
-		final Way newWay = new Way(w);
-		newWay.setNodes(newNodes2);
-
-		cmds.addAll(moveCommandList);
-		cmds.add(new ChangeCommand(w, newWay));
-		cmds.add(new DeleteCommand(delNodes));
-		return new SequenceCommand(trn("Simplify Way (remove {0} node)", "Simplify Way (remove {0} nodes)", delNodes.size(), delNodes.size()), cmds);
-	}
-
-
-	private double computeBearing(final LatLon coord1, final LatLon coord2) {
-		final double lon1 = Math.toRadians(coord1.getX());
-		final double lat1 = Math.toRadians(coord1.getY());
-
-		final double lon2 = Math.toRadians(coord2.getX());
-		final double lat2 = Math.toRadians(coord2.getY());
-
-		final double dLon = lon2 - lon1;
-		final double y = Math.sin(dLon) * Math.cos(lat2);
-		final double x = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(dLon);
-		return Math.toDegrees(Math.atan2(y, x));
-	}
-
-
-	private double computeDistance(final LatLon coord1, final LatLon coord2) {
-		final double lon1 = Math.toRadians(coord1.getX());
-		final double lon2 = Math.toRadians(coord2.getX());
-		final double lat1 = Math.toRadians(coord1.getY());
-		final double lat2 = Math.toRadians(coord2.getY());
-
-		final double R = 6378137d; // m
-		final double dLon = lon2 - lon1;
-		final double dLat = lat2 - lat1;
-		final double a = Math.sin(dLat / 2d) * Math.sin(dLat / 2d) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(dLon / 2d) * Math.sin(dLon / 2d);
-		final double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
-		return R * c;
-	}
-
-
-	private double computeArea(final LatLon coord1, final LatLon coord2, final LatLon coord3) {
-		final double a = computeDistance(coord1, coord2);
-		final double b = computeDistance(coord2, coord3);
-		final double c = computeDistance(coord3, coord1);
-
-		final double p = (a + b + c) / 2.0;
-
-		return Math.sqrt(p * (p - a) * (p - b) * (p - c));
-	}
-
-
-	@Override
-	protected void updateEnabledState() {
-		if (getCurrentDataSet() == null) {
-			setEnabled(false);
-		} else {
-			updateEnabledState(getCurrentDataSet().getSelected());
-		}
-	}
-
-
-	@Override
-	protected void updateEnabledState(final Collection<? extends OsmPrimitive> selection) {
-		setEnabled(selection != null && !selection.isEmpty());
-	}
+    private static final long serialVersionUID = 6854238214548011750L;
+
+    public SimplifyAreaAction() {
+        super(tr("Simplify Area"), "simplify", tr("Delete unnecessary nodes from an area."),
+                Shortcut.registerShortcut("tools:simplifyArea", tr("Tool: {0}", tr("Simplify Area")), KeyEvent.VK_A, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
+    }
+
+
+    private List<Bounds> getCurrentEditBounds() {
+        final LinkedList<Bounds> bounds = new LinkedList<Bounds>();
+        final OsmDataLayer dataLayer = Main.map.mapView.getEditLayer();
+        for (final DataSource ds : dataLayer.data.dataSources) {
+            if (ds.bounds != null) {
+                bounds.add(ds.bounds);
+            }
+        }
+        return bounds;
+    }
+
+
+    private boolean isInBounds(final Node node, final List<Bounds> bounds) {
+        for (final Bounds b : bounds) {
+            if (b.contains(node.getCoor())) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+
+    private boolean confirmWayWithNodesOutsideBoundingBox() {
+        final ButtonSpec[] options = new ButtonSpec[] { new ButtonSpec(tr("Yes, delete nodes"), ImageProvider.get("ok"), tr("Delete nodes outside of downloaded data regions"), null),
+                new ButtonSpec(tr("No, abort"), ImageProvider.get("cancel"), tr("Cancel operation"), null) };
+        final int ret = HelpAwareOptionPane.showOptionDialog(
+                Main.parent,
+                "<html>" + trn("The selected way has nodes outside of the downloaded data region.", "The selected ways have nodes outside of the downloaded data region.", getCurrentDataSet().getSelectedWays().size())
+                        + "<br>" + tr("This can lead to nodes being deleted accidentally.") + "<br>" + tr("Do you want to delete them anyway?") + "</html>",
+                tr("Delete nodes outside of data regions?"), JOptionPane.WARNING_MESSAGE, null, // no special icon
+                options, options[0], null);
+        return ret == 0;
+    }
+
+
+    private void alertSelectAtLeastOneWay() {
+        HelpAwareOptionPane.showOptionDialog(Main.parent, tr("Please select at least one way to simplify."), tr("Warning"), JOptionPane.WARNING_MESSAGE, null);
+    }
+
+
+    private boolean confirmSimplifyManyWays(final int numWays) {
+        final ButtonSpec[] options = new ButtonSpec[] { new ButtonSpec(tr("Yes"), ImageProvider.get("ok"), tr("Simplify all selected ways"), null),
+                new ButtonSpec(tr("Cancel"), ImageProvider.get("cancel"), tr("Cancel operation"), null) };
+        final int ret = HelpAwareOptionPane.showOptionDialog(Main.parent, tr("The selection contains {0} ways. Are you sure you want to simplify them all?", numWays), tr("Simplify ways?"),
+                JOptionPane.WARNING_MESSAGE, null, // no special icon
+                options, options[0], null);
+        return ret == 0;
+    }
+
+
+    @Override
+    public void actionPerformed(final ActionEvent e) {
+        final Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected();
+
+        final List<Bounds> bounds = getCurrentEditBounds();
+        for (final OsmPrimitive prim : selection) {
+            if (prim instanceof Way && bounds.size() > 0) {
+                final Way way = (Way) prim;
+                // We check if each node of each way is at least in one download
+                // bounding box. Otherwise nodes may get deleted that are necessary by
+                // unloaded ways (see Ticket #1594)
+                for (final Node node : way.getNodes()) {
+                    if (!isInBounds(node, bounds)) {
+                        if (!confirmWayWithNodesOutsideBoundingBox()) {
+                            return;
+                        }
+                        break;
+                    }
+                }
+            }
+        }
+        final List<Way> ways = OsmPrimitive.getFilteredList(selection, Way.class);
+        if (ways.isEmpty()) {
+            alertSelectAtLeastOneWay();
+            return;
+        } else if (ways.size() > 10) {
+            if (!confirmSimplifyManyWays(ways.size())) {
+                return;
+            }
+        }
+
+        final Collection<Command> allCommands = new LinkedList<Command>();
+        for (final Way way : ways) {
+            final SequenceCommand simplifyCommand = simplifyWay(way);
+            if (simplifyCommand == null) {
+                continue;
+            }
+            allCommands.add(simplifyCommand);
+        }
+
+        if (!allCommands.isEmpty()) {
+            final SequenceCommand rootCommand = new SequenceCommand(trn("Simplify {0} way", "Simplify {0} ways", allCommands.size(), allCommands.size()), allCommands);
+            Main.main.undoRedo.add(rootCommand);
+            Main.map.repaint();
+        }
+    }
+
+
+    /**
+     * Replies true if <code>node</code> is a required node which can't be removed in order to simplify the way.
+     *
+     * @param way
+     *            the way to be simplified
+     * @param node
+     *            the node to check
+     * @return true if <code>node</code> is a required node which can't be removed in order to simplify the way.
+     */
+    private boolean isRequiredNode(final Way way, final Node node) {
+        final List<OsmPrimitive> parents = new LinkedList<OsmPrimitive>(node.getReferrers());
+        parents.remove(way);
+        return !parents.isEmpty() || node.isTagged();
+    }
+
+
+    /**
+     * Simplifies a way
+     *
+     * @param w
+     *            the way to simplify
+     */
+    private SequenceCommand simplifyWay(final Way w) {
+        final double angleThreshold = Double.parseDouble(Main.pref.get("simplify-area.angle", "10.0"));
+        final double distanceTreshold = Double.parseDouble(Main.pref.get("simplify-area.distance", "0.2"));
+        final double areaTreshold = Double.parseDouble(Main.pref.get("simplify-area.area", "5.0"));
+
+        final List<Node> nodes = w.getNodes();
+        final int size = nodes.size();
+
+        if (size == 0) {
+            return null;
+        }
+
+        final List<MoveCommand> moveCommandList = new ArrayList<MoveCommand>();
+
+        final boolean closed = nodes.get(0).equals(nodes.get(size - 1));
+
+        final List<Node> newNodes = new ArrayList<Node>(size);
+
+        if (closed) {
+            nodes.remove(size - 1); // remove end node ( = start node)
+        }
+
+        {
+            // remove near nodes
+            for (int i = 0; i < size; i++) {
+                final boolean closing = closed && i == size - 1;
+                final Node n1 = closing ? nodes.get(0) : nodes.get(i);
+
+                if (newNodes.isEmpty()) {
+                    newNodes.add(n1);
+                    continue;
+                }
+
+                final Node n2 = newNodes.get(newNodes.size() - 1);
+
+                final LatLon coord1 = n1.getCoor();
+                final LatLon coord2 = n2.getCoor();
+
+                if (isRequiredNode(w, n1) || isRequiredNode(w, n2) || computeDistance(coord1, coord2) > distanceTreshold) {
+                    if (!closing) {
+                        newNodes.add(n1);
+                    }
+                } else {
+                    moveCommandList.add(new MoveCommand(n2, new LatLon((coord1.lat() + coord2.lat()) / 2.0, (coord1.lon() + coord2.lon()) / 2.0)));
+                    if (closing) {
+                        newNodes.remove(0);
+                    }
+                }
+            }
+        }
+
+        final int size2 = newNodes.size();
+
+        final List<Node> newNodes2 = new ArrayList<Node>(size2);
+
+        Node prevNode = null;
+        LatLon coord1 = null;
+        LatLon coord2 = null;
+
+        for (int i = 0, len = size2 + 1 + (closed ? 1 : 0); i < len; i++) {
+            final Node n = newNodes.get(i % size2);
+            final LatLon coord3 = n.getCoor();
+
+            if (coord1 != null) {
+                if (isRequiredNode(w, prevNode) ||
+                        Math.abs(computeBearing(coord2, coord3) - computeBearing(coord1, coord2)) > angleThreshold ||
+                        computeArea(coord1, coord2, coord3) > areaTreshold) {
+                    newNodes2.add(prevNode);
+                } else {
+                    coord2 = coord1; // at the end of the iteration preserve coord1
+                }
+            } else if (!closed && prevNode != null) {
+                newNodes2.add(prevNode);
+            }
+
+            coord1 = coord2;
+            coord2 = coord3;
+            prevNode = n;
+        }
+
+        if (closed) {
+            newNodes2.add(newNodes2.get(0)); // set end node ( = start node)
+        }
+
+        final HashSet<Node> delNodes = new HashSet<Node>();
+        delNodes.addAll(nodes);
+        delNodes.removeAll(newNodes2);
+
+        if (delNodes.isEmpty()) {
+            return null;
+        }
+
+        final Collection<Command> cmds = new LinkedList<Command>();
+        final Way newWay = new Way(w);
+        newWay.setNodes(newNodes2);
+
+        cmds.addAll(moveCommandList);
+        cmds.add(new ChangeCommand(w, newWay));
+        cmds.add(new DeleteCommand(delNodes));
+        return new SequenceCommand(trn("Simplify Way (remove {0} node)", "Simplify Way (remove {0} nodes)", delNodes.size(), delNodes.size()), cmds);
+    }
+
+
+    private double computeBearing(final LatLon coord1, final LatLon coord2) {
+        final double lon1 = Math.toRadians(coord1.getX());
+        final double lat1 = Math.toRadians(coord1.getY());
+
+        final double lon2 = Math.toRadians(coord2.getX());
+        final double lat2 = Math.toRadians(coord2.getY());
+
+        final double dLon = lon2 - lon1;
+        final double y = Math.sin(dLon) * Math.cos(lat2);
+        final double x = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(dLon);
+        return Math.toDegrees(Math.atan2(y, x));
+    }
+
+
+    private double computeDistance(final LatLon coord1, final LatLon coord2) {
+        final double lon1 = Math.toRadians(coord1.getX());
+        final double lon2 = Math.toRadians(coord2.getX());
+        final double lat1 = Math.toRadians(coord1.getY());
+        final double lat2 = Math.toRadians(coord2.getY());
+
+        final double R = 6378137d; // m
+        final double dLon = lon2 - lon1;
+        final double dLat = lat2 - lat1;
+        final double a = Math.sin(dLat / 2d) * Math.sin(dLat / 2d) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(dLon / 2d) * Math.sin(dLon / 2d);
+        final double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
+        return R * c;
+    }
+
+
+    private double computeArea(final LatLon coord1, final LatLon coord2, final LatLon coord3) {
+        final double a = computeDistance(coord1, coord2);
+        final double b = computeDistance(coord2, coord3);
+        final double c = computeDistance(coord3, coord1);
+
+        final double p = (a + b + c) / 2.0;
+
+        return Math.sqrt(p * (p - a) * (p - b) * (p - c));
+    }
+
+
+    @Override
+    protected void updateEnabledState() {
+        if (getCurrentDataSet() == null) {
+            setEnabled(false);
+        } else {
+            updateEnabledState(getCurrentDataSet().getSelected());
+        }
+    }
+
+
+    @Override
+    protected void updateEnabledState(final Collection<? extends OsmPrimitive> selection) {
+        setEnabled(selection != null && !selection.isEmpty());
+    }
 
 }
Index: /applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaPlugin.java
===================================================================
--- /applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaPlugin.java	(revision 23192)
+++ /applications/editors/josm/plugins/simplifyarea/src/sk/zdila/josm/plugin/simplify/SimplifyAreaPlugin.java	(revision 23193)
@@ -8,8 +8,8 @@
 public class SimplifyAreaPlugin extends Plugin {
 
-	public SimplifyAreaPlugin(final PluginInformation info) {
-		super(info);
-		MainMenu.add(Main.main.menu.toolsMenu, new SimplifyAreaAction());
-	}
+    public SimplifyAreaPlugin(final PluginInformation info) {
+        super(info);
+        MainMenu.add(Main.main.menu.toolsMenu, new SimplifyAreaAction());
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/smed/Smed.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/Smed.java	(revision 23192)
+++ /applications/editors/josm/plugins/smed/src/smed/Smed.java	(revision 23193)
@@ -26,93 +26,93 @@
 
 public class Smed extends Plugin{
-	
-	private JMenuItem item;
-	private SmedTabAction SmedTab;
-	
-	public Smed(PluginInformation info) {
-		super(info);
-		
-		String os = "";
-		String userHome = "";
-				
-		File pluginDir = Main.pref.getPluginsDirectory();
-		String pluginDirName = pluginDir.getAbsolutePath();
-		File splug = new File(pluginDirName + "/splug");
-		if(!splug.exists()) splug.mkdir();
-		
-		// build smed_ifc.jar from smed.jar
-		JarEntry ent = null;
-		BufferedInputStream inp = null;
-		String entName = null;
-		byte[] buffer = new byte[16384];
-		int len;
 
-		try {
-			JarFile file = new JarFile(pluginDirName  + "/smed.jar");			
-			FileOutputStream fos = new FileOutputStream(pluginDirName + "/splug/smed_ifc.jar");			
-			JarOutputStream jos = new JarOutputStream(fos);
-			BufferedOutputStream oos = new BufferedOutputStream( jos);
+    private JMenuItem item;
+    private SmedTabAction SmedTab;
 
-			ent = file.getJarEntry("smed/plug/ifc/SmedPluggable.class");
-			inp = new BufferedInputStream(file.getInputStream( ent ));
-			entName = ent.getName();
+    public Smed(PluginInformation info) {
+        super(info);
 
-			jos.putNextEntry(new JarEntry(entName));
-			
-		    while ((len = inp.read(buffer)) > 0) {
-		    	oos.write(buffer, 0, len);
+        String os = "";
+        String userHome = "";
+
+        File pluginDir = Main.pref.getPluginsDirectory();
+        String pluginDirName = pluginDir.getAbsolutePath();
+        File splug = new File(pluginDirName + "/splug");
+        if(!splug.exists()) splug.mkdir();
+
+        // build smed_ifc.jar from smed.jar
+        JarEntry ent = null;
+        BufferedInputStream inp = null;
+        String entName = null;
+        byte[] buffer = new byte[16384];
+        int len;
+
+        try {
+            JarFile file = new JarFile(pluginDirName  + "/smed.jar");
+            FileOutputStream fos = new FileOutputStream(pluginDirName + "/splug/smed_ifc.jar");
+            JarOutputStream jos = new JarOutputStream(fos);
+            BufferedOutputStream oos = new BufferedOutputStream( jos);
+
+            ent = file.getJarEntry("smed/plug/ifc/SmedPluggable.class");
+            inp = new BufferedInputStream(file.getInputStream( ent ));
+            entName = ent.getName();
+
+            jos.putNextEntry(new JarEntry(entName));
+
+            while ((len = inp.read(buffer)) > 0) {
+                oos.write(buffer, 0, len);
             }
 
-		    oos.flush();
-		    inp.close();
-	    
-		    ent = file.getJarEntry("smed/plug/ifc/SmedPluginManager.class");
-		    inp = new BufferedInputStream(file.getInputStream( ent ));
-		    entName = ent.getName();
-		    jos.putNextEntry(new JarEntry(entName));
-		    
-		    while ((len = inp.read(buffer)) > 0) {
-		    	oos.write(buffer, 0, len);
+            oos.flush();
+            inp.close();
+
+            ent = file.getJarEntry("smed/plug/ifc/SmedPluginManager.class");
+            inp = new BufferedInputStream(file.getInputStream( ent ));
+            entName = ent.getName();
+            jos.putNextEntry(new JarEntry(entName));
+
+            while ((len = inp.read(buffer)) > 0) {
+                oos.write(buffer, 0, len);
             }
 
-			oos.flush();
-			oos.close();
-		    fos.flush();
-		    fos.close();
-		    inp.close();
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-		} 
+            oos.flush();
+            oos.close();
+            fos.flush();
+            fos.close();
+            inp.close();
 
-		
-		// add smed_ifc.jar to classpath (josm need this archive, or perhaps only the interface)
-		File f = new java.io.File(pluginDirName + "/splug/smed_ifc.jar");
-		ClassLoader myClassLoader = Thread.currentThread().getContextClassLoader();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 
-		try {
-			Method addUrlMethod = URLClassLoader.class.getDeclaredMethod("addURL", new Class[]{URL.class});
-			addUrlMethod.setAccessible(true);
-			addUrlMethod.invoke(myClassLoader, f.toURI().toURL());
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		
-		SmedTab = new SmedTabAction();
-		item = Main.main.menu.toolsMenu.add(SmedTab);
-		
-		item.setEnabled(false);
 
-	}
-	
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if (oldFrame == null && newFrame != null) {
-			item.setEnabled(true);
-		} else {
-			item.setEnabled(false);
-			// SmpDialog.CloseDialog();
-		}
-	}
+        // add smed_ifc.jar to classpath (josm need this archive, or perhaps only the interface)
+        File f = new java.io.File(pluginDirName + "/splug/smed_ifc.jar");
+        ClassLoader myClassLoader = Thread.currentThread().getContextClassLoader();
+
+        try {
+            Method addUrlMethod = URLClassLoader.class.getDeclaredMethod("addURL", new Class[]{URL.class});
+            addUrlMethod.setAccessible(true);
+            addUrlMethod.invoke(myClassLoader, f.toURI().toURL());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        SmedTab = new SmedTabAction();
+        item = Main.main.menu.toolsMenu.add(SmedTab);
+
+        item.setEnabled(false);
+
+    }
+
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (oldFrame == null && newFrame != null) {
+            item.setEnabled(true);
+        } else {
+            item.setEnabled(false);
+            // SmpDialog.CloseDialog();
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/smed/plug/SmedPluginApp.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/plug/SmedPluginApp.java	(revision 23192)
+++ /applications/editors/josm/plugins/smed/src/smed/plug/SmedPluginApp.java	(revision 23193)
@@ -12,19 +12,19 @@
 public class SmedPluginApp implements Runnable {
 
-	@Override
-	public void run() {
-		try {
-			runPlugins();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
+    @Override
+    public void run() {
+        try {
+            runPlugins();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
 
-	public static void runPlugins() throws IOException {
-		String pluginDirName = Main.pref.getPluginsDirectory().getAbsolutePath();
-		
-		List<SmedPluggable> plugins = SmedPluginLoader.loadPlugins(new File(pluginDirName + "/splug"));
-		
-	}
+    public static void runPlugins() throws IOException {
+        String pluginDirName = Main.pref.getPluginsDirectory().getAbsolutePath();
+        
+        List<SmedPluggable> plugins = SmedPluginLoader.loadPlugins(new File(pluginDirName + "/splug"));
+        
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluggable.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluggable.java	(revision 23192)
+++ /applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluggable.java	(revision 23193)
@@ -6,10 +6,10 @@
 public interface SmedPluggable {
 
-	boolean start();
-	boolean start(JComponent panel);
-	boolean stop();
-	String getName();
-	
-	void setPluginManager(SmedPluginManager manager);
+    boolean start();
+    boolean start(JComponent panel);
+    boolean stop();
+    String getName();
+    
+    void setPluginManager(SmedPluginManager manager);
 }
 
Index: /applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluginManager.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluginManager.java	(revision 23192)
+++ /applications/editors/josm/plugins/smed/src/smed/plug/ifc/SmedPluginManager.java	(revision 23193)
@@ -2,4 +2,4 @@
 
 public interface SmedPluginManager {
-	void showVisualMessage(String message);
+    void showVisualMessage(String message);
 }
Index: /applications/editors/josm/plugins/smed/src/smed/plug/util/JARFileFilter.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/plug/util/JARFileFilter.java	(revision 23192)
+++ /applications/editors/josm/plugins/smed/src/smed/plug/util/JARFileFilter.java	(revision 23193)
@@ -6,8 +6,8 @@
 public class JARFileFilter implements FileFilter {
 
-	@Override
-	public boolean accept(File f) {
-		return f.getName().toLowerCase().endsWith(".jar");
-	}
+    @Override
+    public boolean accept(File f) {
+        return f.getName().toLowerCase().endsWith(".jar");
+    }
 
 }
Index: /applications/editors/josm/plugins/smed/src/smed/plug/util/SmedPluginLoader.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/plug/util/SmedPluginLoader.java	(revision 23192)
+++ /applications/editors/josm/plugins/smed/src/smed/plug/util/SmedPluginLoader.java	(revision 23193)
@@ -19,90 +19,90 @@
 public class SmedPluginLoader {
 
-	public static List<SmedPluggable> loadPlugins(File plugDir) throws IOException {
-		File[] plugJars = plugDir.listFiles(new JARFileFilter());
-		
-		URL[] urls = fileArrayToURLArray(plugJars);
-		if(urls == null) return null;
-		
-		ClassLoader cl = new URLClassLoader(urls);
-		List<Class<SmedPluggable>> plugClasses = extractClassesFromJARs(plugJars, cl);
-		
-		if(plugClasses == null) return null;
-		else return createPluggableObjects(plugClasses);
-	}
+    public static List<SmedPluggable> loadPlugins(File plugDir) throws IOException {
+        File[] plugJars = plugDir.listFiles(new JARFileFilter());
+        
+        URL[] urls = fileArrayToURLArray(plugJars);
+        if(urls == null) return null;
+        
+        ClassLoader cl = new URLClassLoader(urls);
+        List<Class<SmedPluggable>> plugClasses = extractClassesFromJARs(plugJars, cl);
+        
+        if(plugClasses == null) return null;
+        else return createPluggableObjects(plugClasses);
+    }
 
-	private static List<SmedPluggable> createPluggableObjects(List<Class<SmedPluggable>> pluggables) {
-		List<SmedPluggable> plugs = new ArrayList<SmedPluggable>(pluggables.size());
-		for(Class<SmedPluggable> plug : pluggables) {
-			try {
-				plugs.add(plug.newInstance());
-			} catch (InstantiationException e) {
-				System.err.println("Can't instantiate plugin: " + plug.getName());
-				e.printStackTrace();
-			} catch (IllegalAccessException e) {
-				System.err.println("IllegalAccess for plugin: " + plug.getName());
-				e.printStackTrace();
-			}
-		}
-		
-		return plugs;
-	}
+    private static List<SmedPluggable> createPluggableObjects(List<Class<SmedPluggable>> pluggables) {
+        List<SmedPluggable> plugs = new ArrayList<SmedPluggable>(pluggables.size());
+        for(Class<SmedPluggable> plug : pluggables) {
+            try {
+                plugs.add(plug.newInstance());
+            } catch (InstantiationException e) {
+                System.err.println("Can't instantiate plugin: " + plug.getName());
+                e.printStackTrace();
+            } catch (IllegalAccessException e) {
+                System.err.println("IllegalAccess for plugin: " + plug.getName());
+                e.printStackTrace();
+            }
+        }
+        
+        return plugs;
+    }
 
-	private static List<Class<SmedPluggable>> extractClassesFromJARs(File[] jars, ClassLoader cl) throws FileNotFoundException, IOException {
-		List<Class<SmedPluggable>> classes = new ArrayList<Class<SmedPluggable>>();
-		
-		for(File jar : jars) {
-			classes.addAll(extractClassesFromJAR(jar, cl));
-		}
+    private static List<Class<SmedPluggable>> extractClassesFromJARs(File[] jars, ClassLoader cl) throws FileNotFoundException, IOException {
+        List<Class<SmedPluggable>> classes = new ArrayList<Class<SmedPluggable>>();
+        
+        for(File jar : jars) {
+            classes.addAll(extractClassesFromJAR(jar, cl));
+        }
 
-		if(classes.isEmpty()) return null;
-		else return classes;
-	}
+        if(classes.isEmpty()) return null;
+        else return classes;
+    }
 
-	@SuppressWarnings("unchecked")
-	private static Collection<? extends Class<SmedPluggable>> extractClassesFromJAR (File jar, ClassLoader cl) throws FileNotFoundException, IOException {
-		List<Class<SmedPluggable>> classes = new ArrayList<Class<SmedPluggable>>();
-		JarInputStream jaris = new JarInputStream(new FileInputStream(jar));
-		JarEntry ent = null;
-		
-		while ((ent = jaris.getNextJarEntry()) != null) {
-			String entName = ent.getName(); //.toLowerCase();
-			
-			if (entName.endsWith(".class")) {
-				try {
-					Class<?> cls = cl.loadClass(entName.substring(0, entName.length()- 6).replace('/', '.'));
-					if(isPluggableSmedClass(cls)) classes.add((Class<SmedPluggable>) cls);
-				} catch (ClassNotFoundException e) {
-					System.err.println("Can't load Class" + entName);
-					e.printStackTrace();
-				}
-			}
-		}
-		
-		jaris.close();
-		
-		return classes;
-	}
+    @SuppressWarnings("unchecked")
+    private static Collection<? extends Class<SmedPluggable>> extractClassesFromJAR (File jar, ClassLoader cl) throws FileNotFoundException, IOException {
+        List<Class<SmedPluggable>> classes = new ArrayList<Class<SmedPluggable>>();
+        JarInputStream jaris = new JarInputStream(new FileInputStream(jar));
+        JarEntry ent = null;
+        
+        while ((ent = jaris.getNextJarEntry()) != null) {
+            String entName = ent.getName(); //.toLowerCase();
+            
+            if (entName.endsWith(".class")) {
+                try {
+                    Class<?> cls = cl.loadClass(entName.substring(0, entName.length()- 6).replace('/', '.'));
+                    if(isPluggableSmedClass(cls)) classes.add((Class<SmedPluggable>) cls);
+                } catch (ClassNotFoundException e) {
+                    System.err.println("Can't load Class" + entName);
+                    e.printStackTrace();
+                }
+            }
+        }
+        
+        jaris.close();
+        
+        return classes;
+    }
 
-	private static boolean isPluggableSmedClass(Class<?> cls) {
-		for (Class<?> i: cls.getInterfaces()) {
-			if (i.equals(SmedPluggable.class)) return true;
-		}
-		
-		return false;
-	}
+    private static boolean isPluggableSmedClass(Class<?> cls) {
+        for (Class<?> i: cls.getInterfaces()) {
+            if (i.equals(SmedPluggable.class)) return true;
+        }
+        
+        return false;
+    }
 
-	private static URL[] fileArrayToURLArray(File[] files) throws MalformedURLException {
-		// splug contains at least smed_ifc.jar, but smed_ifc.jar isn't pluggable
-		if(files.length <= 1) return null;
-		
-		URL[] urls = new URL[files.length];
-		
-		
-		for(int i = 0; i < files.length; i++) {
-			urls[i] = files[i].toURI().toURL();
-		}
-		
-		return urls;
-	}
+    private static URL[] fileArrayToURLArray(File[] files) throws MalformedURLException {
+        // splug contains at least smed_ifc.jar, but smed_ifc.jar isn't pluggable
+        if(files.length <= 1) return null;
+        
+        URL[] urls = new URL[files.length];
+        
+        
+        for(int i = 0; i < files.length; i++) {
+            urls[i] = files[i].toURI().toURL();
+        }
+        
+        return urls;
+    }
 }
Index: /applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabAction.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabAction.java	(revision 23192)
+++ /applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabAction.java	(revision 23193)
@@ -17,34 +17,34 @@
 public class SmedTabAction extends JosmAction {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-	
-	public SmedTabAction() {
-		super( "Seekarten Editor", "Smed","Seekarten Editor", Shortcut.registerShortcut(
-								"tools:Semmaps",
-								tr("Tool: {0}", "Seekarten Editor"), KeyEvent.VK_K, //$NON-NLS-1$ //$NON-NLS-2$
-								Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
+    /**
+     *
+     */
+    private static final long serialVersionUID = 1L;
 
-		try {
-			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-		} catch (Exception e) {
-			e.printStackTrace();
-		} 
-	}
+    public SmedTabAction() {
+        super( "Seekarten Editor", "Smed","Seekarten Editor", Shortcut.registerShortcut(
+                                "tools:Semmaps",
+                                tr("Tool: {0}", "Seekarten Editor"), KeyEvent.VK_K, //$NON-NLS-1$ //$NON-NLS-2$
+                                Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
 
-	
-	@Override
-	public void actionPerformed(ActionEvent e) {
-		SwingUtilities.invokeLater(new Runnable() {
-			public void run() {
-				createAndShowTabs();
-			}
-		});
-	}
+        try {
+            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
 
 
-	protected void createAndShowTabs() {
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                createAndShowTabs();
+            }
+        });
+    }
+
+
+    protected void createAndShowTabs() {
         //Create and set up the window.
         JFrame frame = new JFrame("TabbedPaneDemo");
@@ -52,5 +52,5 @@
         // frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
         frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
-        
+
         //Add content to the window.
         frame.add(new SmedTabbedPane(), BorderLayout.CENTER);
@@ -59,5 +59,5 @@
         frame.pack();
         frame.setVisible(true);
-	}
+    }
 
 
Index: /applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java
===================================================================
--- /applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java	(revision 23192)
+++ /applications/editors/josm/plugins/smed/src/smed/tabs/SmedTabbedPane.java	(revision 23193)
@@ -21,65 +21,65 @@
 public class SmedTabbedPane extends JPanel {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
+    /**
+     *
+     */
+    private static final long serialVersionUID = 1L;
 
-	@SuppressWarnings("null")
-	public SmedTabbedPane() {
-		super(new GridLayout(1, 1));
-		
-		List<SmedPluggable> plugins = null;
-		String pluginDirName = Main.pref.getPluginsDirectory().getAbsolutePath();
-		try {
-			plugins = SmedPluginLoader.loadPlugins(new File(pluginDirName + "/splug"));
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		
+    @SuppressWarnings("null")
+    public SmedTabbedPane() {
+        super(new GridLayout(1, 1));
+
+        List<SmedPluggable> plugins = null;
+        String pluginDirName = Main.pref.getPluginsDirectory().getAbsolutePath();
+        try {
+            plugins = SmedPluginLoader.loadPlugins(new File(pluginDirName + "/splug"));
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
         Icon icon = null;
-		JTabbedPane tabbedPane = new JTabbedPane();
+        JTabbedPane tabbedPane = new JTabbedPane();
 
-		JComponent panel1;
-		if(plugins == null) {
-        	panel1 = makeTextPanel("Panel #1");
-        	tabbedPane.addTab("Tab 1", icon , panel1, "Does nothing");
+        JComponent panel1;
+        if(plugins == null) {
+            panel1 = makeTextPanel("Panel #1");
+            tabbedPane.addTab("Tab 1", icon , panel1, "Does nothing");
         } else {
-        	panel1 = new JPanel();
-        	plugins.get(0).start(panel1);
-        	tabbedPane.addTab(plugins.get(0).getName(), icon , panel1, "say hello");
+            panel1 = new JPanel();
+            plugins.get(0).start(panel1);
+            tabbedPane.addTab(plugins.get(0).getName(), icon , panel1, "say hello");
         }
-    	
-    	tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
 
-		
+        tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
+
+
         JComponent panel2 = makeTextPanel("Panel #2");
         tabbedPane.addTab("Tab 2", icon, panel2, "Does twice as much nothing");
         tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
-        
+
         JComponent panel3 = makeTextPanel("Panel #3");
         tabbedPane.addTab("Tab 3", icon, panel3, "Still does nothing");
         tabbedPane.setMnemonicAt(2, KeyEvent.VK_3);
-        
+
         JComponent panel4 = makeTextPanel( "Panel #4 (has a preferred size of 410 x 50).");
         panel4.setPreferredSize(new Dimension(410, 50));
         tabbedPane.addTab("Tab 4", icon, panel4, "Does nothing at all");
         tabbedPane.setMnemonicAt(3, KeyEvent.VK_4);
-		
+
         //Add the tabbed pane to this panel.
         add(tabbedPane);
-		
+
         //The following line enables to use scrolling tabs.
         tabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
-	}
+    }
 
-	private JComponent makeTextPanel(String text) {
-		JPanel panel = new JPanel(false);
-		JLabel filler = new JLabel(text);
-		filler.setHorizontalAlignment(JLabel.CENTER);
-		panel.setLayout(new GridLayout(1, 1));
+    private JComponent makeTextPanel(String text) {
+        JPanel panel = new JPanel(false);
+        JLabel filler = new JLabel(text);
+        filler.setHorizontalAlignment(JLabel.CENTER);
+        panel.setLayout(new GridLayout(1, 1));
         panel.add(filler);
-        
-		return panel;
-	}
+
+        return panel;
+    }
 }
Index: /applications/editors/josm/plugins/toms/src/toms/Messages.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/Messages.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/Messages.java	(revision 23193)
@@ -5,18 +5,18 @@
 
 public class Messages {
-	private static final String BUNDLE_NAME = "toms.msg.messages"; //$NON-NLS-1$
+    private static final String BUNDLE_NAME = "toms.msg.messages"; //$NON-NLS-1$
 
-	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
-			.getBundle(BUNDLE_NAME);
+    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+            .getBundle(BUNDLE_NAME);
 
-	private Messages() {
-	}
+    private Messages() {
+    }
 
-	public static String getString(String key) {
-		try {
-			return RESOURCE_BUNDLE.getString(key);
-		} catch (MissingResourceException e) {
-			return '!' + key + '!';
-		}
-	}
+    public static String getString(String key) {
+        try {
+            return RESOURCE_BUNDLE.getString(key);
+        } catch (MissingResourceException e) {
+            return '!' + key + '!';
+        }
+    }
 }
Index: /applications/editors/josm/plugins/toms/src/toms/Toms.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/Toms.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/Toms.java	(revision 23193)
@@ -53,104 +53,104 @@
 public class Toms extends Plugin {
 
-	private JMenuItem Smp;
-	private SmpDialogAction SmpDialog;
+    private JMenuItem Smp;
+    private SmpDialogAction SmpDialog;
 
-	public Toms(PluginInformation info) {
-		super(info);
+    public Toms(PluginInformation info) {
+        super(info);
 
-		String os = ""; //$NON-NLS-1$
-		String userHome = ""; //$NON-NLS-1$
+        String os = ""; //$NON-NLS-1$
+        String userHome = ""; //$NON-NLS-1$
 
-		SmpDialog = new SmpDialogAction();
-		Smp = Main.main.menu.toolsMenu.add(SmpDialog);
-		// Smp = MainMenu.add(Main.main.menu.toolsMenu, SmpDialog);
+        SmpDialog = new SmpDialogAction();
+        Smp = Main.main.menu.toolsMenu.add(SmpDialog);
+        // Smp = MainMenu.add(Main.main.menu.toolsMenu, SmpDialog);
 
-		SmpDialog.setSmpItem(Smp);
-		SmpDialog.setOs(os);
-		SmpDialog.setUserHome(userHome);
-		Smp.setEnabled(false);
+        SmpDialog.setSmpItem(Smp);
+        SmpDialog.setOs(os);
+        SmpDialog.setUserHome(userHome);
+        Smp.setEnabled(false);
 
-		File pluginDir = Main.pref.getPluginsDirectory();
-		String pluginDirName = pluginDir.getAbsolutePath();
-		File tplug = new File(pluginDirName + "/tplug");
-		if(!tplug.exists()) tplug.mkdir();
-		
-		// build ifc.jar from toms.jar
-		JarEntry ent = null;
-		BufferedInputStream inp = null;
-		String entName = null;
-		byte[] buffer = new byte[16384];
-		int len;
+        File pluginDir = Main.pref.getPluginsDirectory();
+        String pluginDirName = pluginDir.getAbsolutePath();
+        File tplug = new File(pluginDirName + "/tplug");
+        if(!tplug.exists()) tplug.mkdir();
+        
+        // build ifc.jar from toms.jar
+        JarEntry ent = null;
+        BufferedInputStream inp = null;
+        String entName = null;
+        byte[] buffer = new byte[16384];
+        int len;
 
-		try {
-			JarFile file = new JarFile(pluginDirName  + "/toms.jar");			
-			FileOutputStream fos = new FileOutputStream(pluginDirName + "/tplug/ifc.jar");			
-			JarOutputStream jos = new JarOutputStream(fos);
-			BufferedOutputStream oos = new BufferedOutputStream( jos);
+        try {
+            JarFile file = new JarFile(pluginDirName  + "/toms.jar");           
+            FileOutputStream fos = new FileOutputStream(pluginDirName + "/tplug/ifc.jar");          
+            JarOutputStream jos = new JarOutputStream(fos);
+            BufferedOutputStream oos = new BufferedOutputStream( jos);
 
-			ent = file.getJarEntry("toms/plug/ifc/Pluggable.class");
-			inp = new BufferedInputStream(file.getInputStream( ent ));
-			entName = ent.getName();
+            ent = file.getJarEntry("toms/plug/ifc/Pluggable.class");
+            inp = new BufferedInputStream(file.getInputStream( ent ));
+            entName = ent.getName();
 
-			jos.putNextEntry(new JarEntry(entName));
-			
-		    while ((len = inp.read(buffer)) > 0) {
-		    	oos.write(buffer, 0, len);
+            jos.putNextEntry(new JarEntry(entName));
+            
+            while ((len = inp.read(buffer)) > 0) {
+                oos.write(buffer, 0, len);
             }
 
-		    oos.flush();
-		    inp.close();
-	    
-		    ent = file.getJarEntry("toms/plug/ifc/PluginManager.class");
-		    inp = new BufferedInputStream(file.getInputStream( ent ));
-		    entName = ent.getName();
-		    jos.putNextEntry(new JarEntry(entName));
-		    
-		    while ((len = inp.read(buffer)) > 0) {
-		    	oos.write(buffer, 0, len);
+            oos.flush();
+            inp.close();
+        
+            ent = file.getJarEntry("toms/plug/ifc/PluginManager.class");
+            inp = new BufferedInputStream(file.getInputStream( ent ));
+            entName = ent.getName();
+            jos.putNextEntry(new JarEntry(entName));
+            
+            while ((len = inp.read(buffer)) > 0) {
+                oos.write(buffer, 0, len);
             }
 
-			oos.flush();
-			oos.close();
-		    fos.flush();
-		    fos.close();
-		    inp.close();
-			
-		} catch (Exception e) {
-			e.printStackTrace();
-		} 
-		
-		
-		// add ifc.jar to classpath (josm need this archive, or perhaps only the interface)
-		File f = new java.io.File(pluginDirName + "/tplug/ifc.jar");
-		ClassLoader myClassLoader = Thread.currentThread().getContextClassLoader();
+            oos.flush();
+            oos.close();
+            fos.flush();
+            fos.close();
+            inp.close();
+            
+        } catch (Exception e) {
+            e.printStackTrace();
+        } 
+        
+        
+        // add ifc.jar to classpath (josm need this archive, or perhaps only the interface)
+        File f = new java.io.File(pluginDirName + "/tplug/ifc.jar");
+        ClassLoader myClassLoader = Thread.currentThread().getContextClassLoader();
 
-		try {
-			Method addUrlMethod = URLClassLoader.class.getDeclaredMethod("addURL", new Class[]{URL.class});
-			addUrlMethod.setAccessible(true);
-			addUrlMethod.invoke(myClassLoader, f.toURI().toURL());
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
+        try {
+            Method addUrlMethod = URLClassLoader.class.getDeclaredMethod("addURL", new Class[]{URL.class});
+            addUrlMethod.setAccessible(true);
+            addUrlMethod.invoke(myClassLoader, f.toURI().toURL());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 
-		
-		try {
-			PluginApp.runPlugins();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
+        
+        try {
+            PluginApp.runPlugins();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 
-	}
+    }
 
 
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if (oldFrame == null && newFrame != null) {
-			Smp.setEnabled(true);
-		} else {
-			Smp.setEnabled(false);
-			SmpDialog.CloseDialog();
-		}
-	}
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (oldFrame == null && newFrame != null) {
+            Smp.setEnabled(true);
+        } else {
+            Smp.setEnabled(false);
+            SmpDialog.CloseDialog();
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java	(revision 23193)
@@ -62,1343 +62,1343 @@
 
 public class SmpDialogAction extends JosmAction {
-	private static final long serialVersionUID = -2976230949744302905L;
-
-	/**
-	 * lokale Variable, private
-	 */
-	private SmpDialogAction dia = null; // Variable für den Handle von
-																			// SmpDialogAction
-	private Buoy buoy = null; // Variable für Objekte des Typs "Tonne" //
-														// @jve:decl-index=0:
-	private boolean isOpen = false; // zeigt den Status des Dialogs an
-	private Node onode = null; // gemerkter Knoten
-	private Buoy obuoy = null; // gemerkte Tonne // @jve:decl-index=0:
-	private JMenuItem SmpItem = null; // Info über item in der Werkzeugleiste
-	private String smt = ""; // value vom key "seamark:type" // @jve:decl-index=0: //$NON-NLS-1$
-	private String smb = ""; // value vom key "seamark" // @jve:decl-index=0: //$NON-NLS-1$
-	private Collection<? extends OsmPrimitive> Selection = null; // @jve:decl-index=0:
-	private OsmPrimitive SelNode = null;
-	private String Os = ""; // @jve:decl-index=0: //$NON-NLS-1$
-	private String UserHome = ""; // @jve:decl-index=0: //$NON-NLS-1$
-
-	// SelectionChangedListner der in die Eventqueue von josm eingehängt wird
-	private SelectionChangedListener SmpListener = new SelectionChangedListener() {
-		public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-			Node node;
-			Selection = newSelection;
-
-			// System.out.println("hello");
-			for (OsmPrimitive osm : Selection) {
-				if (osm instanceof Node) {
-					node = (Node) osm;
-					if (Selection.size() == 1)
-						// Absicherung gegen Doppelevents
-						if (node.compareTo(SelNode) != 0) {
-							SelNode = node;
-							parseSeaMark();
-							buoy.paintSign();
-						}
-				}
-			}
-
-			Selection = null;
-
-		}
-	};
-
-	/**
-	 * lokale Variable der Maske
-	 */
-	private JDialog dM01SeaMap = null;
-	private JPanel pM01SeaMap = null;
-	private JLabel lM01Head = null;
-	private JLabel lM01Region = null;
-	private JLabel lM02Region = null;
-	public ButtonGroup bgM01Region = null;
-	public JRadioButton rbM01RegionA = null;
-	public JRadioButton rbM01RegionB = null;
-	public JLabel lM01Icon = null; // Shape
-	public JLabel lM02Icon = null; // Light
-	public JLabel lM03Icon = null; // Reflector
-	public JLabel lM04Icon = null; // Racon
-	public JLabel lM05Icon = null; // Fog
-	public JLabel lM01FireMark = null;
-	private JLabel lM01TypeOfMark = null;
-	public JComboBox cbM01TypeOfMark = null;
-	public JLabel lM01CatOfMark = null;
-	public JComboBox cbM01CatOfMark = null;
-	public JLabel lM01StyleOfMark = null;
-	public JComboBox cbM01StyleOfMark = null;
-	private JLabel lM01Name = null;
-	public JTextField tfM01Name = null;
-	private JLabel lM01Props02 = null;
-	public JCheckBox cM01TopMark = null;
-	public JComboBox cbM01TopMark = null;
-	public JCheckBox cM01Radar = null;
-	public JCheckBox cM01Racon = null;
-	public JComboBox cbM01Racon = null;
-	public JTextField tfM01Racon = null;
-	public JLabel lM01Racon = null;
-	public JCheckBox cM01Fog = null;
-	public JComboBox cbM01Fog = null;
-	public JLabel lM01FogGroup = null;
-	public JTextField tfM01FogGroup = null;
-	public JLabel lM01FogPeriod = null;
-	public JTextField tfM01FogPeriod = null;
-	public JCheckBox cM01Fired = null;
-	public ButtonGroup bgM01Fired = null;
-	public JRadioButton rbM01Fired1 = null;
-	public JRadioButton rbM01FiredN = null;
-	public JLabel lM01Kennung = null;
-	public JComboBox cbM01Kennung = null;
-	public JLabel lM01Height = null;
-	public JTextField tfM01Height = null;
-	public JLabel lM01Range = null;
-	public JTextField tfM01Range = null;
-	public JLabel lM01Group = null;
-	public JTextField tfM01Group = null;
-	public JLabel lM01RepeatTime = null;
-	public JTextField tfM01RepeatTime = null;
-	public JLabel lM01Sector = null;
-	public JComboBox cbM01Sector = null;
-	public JLabel lM01Colour = null;
-	public JComboBox cbM01Colour = null;
-	public JLabel lM01Bearing = null;
-	public JTextField tfM01Bearing = null;
-	public JTextField tfM02Bearing = null;
-	public JTextField tfM01Radius = null;
-	public JButton bM01Save = null;
-	public JButton bM01Close = null;
-	public JCheckBox cM01IconVisible = null;
-	public JTextField sM01StatusBar = null;
-
-	public boolean paintlock = false;
-
-	public JMenuItem getSmpItem() {
-		return SmpItem;
-	}
-
-	public void setSmpItem(JMenuItem smpItem) {
-		SmpItem = smpItem;
-	}
-
-	public boolean isOpen() {
-		return isOpen;
-	}
-
-	public void setOpen(boolean isOpen) {
-		this.isOpen = isOpen;
-	}
-
-	public String getOs() {
-		return Os;
-	}
-
-	public void setOs(String os) {
-		Os = os;
-	}
-
-	public String getUserHome() {
-		return UserHome;
-	}
-
-	public void setUserHome(String userHome) {
-		UserHome = userHome;
-	}
-
-	public SmpDialogAction() {
-		super(
-				Messages.getString("SmpDialogAction.4"), "Smp", Messages.getString("SmpDialogAction.0"), Shortcut //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-						.registerShortcut(
-								"tools:Semarks", //$NON-NLS-1$
-								tr("Tool: {0}", Messages.getString("SmpDialogAction.9")), KeyEvent.VK_S, //$NON-NLS-1$ //$NON-NLS-2$
-								Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
-
-		dia = this;
-		String str = Main.pref.get("mappaint.style.sources"); //$NON-NLS-1$
-		if (!str.contains("dev.openseamap.org")) { //$NON-NLS-1$
-			if (!str.isEmpty()) //$NON-NLS-1$
-				str += new String(new char[] { 0x1e });
-			Main.pref.put("mappaint.style.sources", str //$NON-NLS-1$
-					+ "http://dev.openseamap.org/josm/seamark_styles.xml"); //$NON-NLS-1$
-		}
-		str = Main.pref.get("color.background"); //$NON-NLS-1$
-		if (str.equals("#000000") || str.isEmpty()) //$NON-NLS-1$ //$NON-NLS-2$
-			Main.pref.put("color.background", "#606060"); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	public void CloseDialog() {
-		onode = null;
-		DataSet.removeSelectionListener(SmpListener);
-		Selection = null;
-
-		if (isOpen)
-			dM01SeaMap.dispose();
-		isOpen = false;
-
-	}
-
-	public void actionPerformed(ActionEvent e) {
-
-		/*
-		 * int option = JOptionPane.showConfirmDialog(Main.parent,
-		 * tr("THIS IS EXPERIMENTAL. Save your work and verify before uploading.\n"
-		 * + "Are you really sure to continue?"),
-		 * tr("Please abort if you are not sure"), JOptionPane.YES_NO_OPTION,
-		 * JOptionPane.WARNING_MESSAGE);
-		 * 
-		 * if (option != JOptionPane.YES_OPTION) { return; }
-		 */
-
-		onode = null;
-		obuoy = null;
-
-		SwingUtilities.invokeLater(new Runnable() {
-			public void run() {
-				JDialog dialog = getDM01SeaMap();
-
-				if (SmpItem == null) {
-				}
-				dialog.setVisible(true);
-			}
-		});
-		
-		setOpen(true);
-
-		if (SmpItem == null) {
-			return;
-		}
-		SmpItem.setEnabled(false);
-
-		// Ausprobe: Möglichkeit der Benachrichtigung, wenn etwas neu
-		// selektiert wird (ueber SelectionChangedListener)
-		// private Collection<? extends OsmPrimitive> sel;
-		// siehe org.openstreetmap.josm.plugins.osb -> OsbLayer.java
-		// Einhängen des Listeners in die Eventqueue von josm
-		DataSet.addSelectionListener(SmpListener);
-	}
-
-	private void PicRebuild() {
-
-		DataSet ds = Main.main.getCurrentDataSet();
-
-		if (obuoy == null) {
-			return;
-		}
-
-		Node n = obuoy.getNode();
-
-		if (n != null) {
-			Command c;
-
-			if (smb != "") { //$NON-NLS-1$
-
-				c = new ChangePropertyCommand(n, "seamark", smb); //$NON-NLS-1$
-				c.executeCommand();
-				ds.fireSelectionChanged();
-
-				smb = ""; //$NON-NLS-1$
-			}
-
-			if (smt != "") { //$NON-NLS-1$
-
-				c = new ChangePropertyCommand(n, "seamark:type", smt); //$NON-NLS-1$
-				c.executeCommand();
-				ds.fireSelectionChanged();
-
-				smt = ""; //$NON-NLS-1$
-			}
-		}
-
-		obuoy = null;
-
-	}
-
-	private void parseSeaMark() {
-
-		int nodes = 0;
-		Node node = null;
-		Collection<Node> selection = null;
-		Map<String, String> keys;
-		DataSet ds;
-
-		ds = Main.main.getCurrentDataSet();
-
-		if (ds == null) {
-			buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.26")); //$NON-NLS-1$
-			buoy.setNode(null);
-			return;
-		}
-
-		selection = ds.getSelectedNodes();
-		nodes = selection.size();
-
-		if (nodes == 0) {
-			buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.27")); //$NON-NLS-1$
-			buoy.setNode(null);
-			return;
-		}
-
-		if (nodes > 1) {
-			buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.28")); //$NON-NLS-1$
-			buoy.setNode(null);
-			return;
-		}
-
-		Iterator<Node> it = selection.iterator();
-		node = it.next();
-
-		if (onode != null)
-			if (node.equals(onode))
-				return;
-
-		// Knoten wurde gewechselt -> die alten tags (benutzt zum Ausblenden der
-		// Pictogramme) wiederherstellen
-		if (obuoy != null)
-			PicRebuild();
-
-		onode = node;
-
-		cM01IconVisible.setEnabled(true);
-		cM01IconVisible.setIcon(new ImageIcon(getClass().getResource(
-				"/images/Auge.png"))); //$NON-NLS-1$
-
-		cbM01TypeOfMark.setEnabled(true);
-
-		// Soweit das Vorspiel. Ab hier beginnt das Parsen
-		String type = ""; //$NON-NLS-1$
-		String str = ""; //$NON-NLS-1$
-
-		keys = node.getKeys();
-
-		// vorsorglich den Namen holen und verwenden, wenn es ein
-		// Seezeichen ist. Name kann durch die weiteren Tags ueber-
-		// schrieben werden
-
-		if (keys.containsKey("seamark:type")) //$NON-NLS-1$
-			type = keys.get("seamark:type"); //$NON-NLS-1$
-
-		if (type.equals("buoy_lateral") || type.equals("beacon_lateral") //$NON-NLS-1$ //$NON-NLS-2$
-				|| keys.containsKey("seamark:buoy_lateral:category") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_lateral:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_lateral:colour") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_lateral:category") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_lateral:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_lateral:colour")) { //$NON-NLS-1$
-			buoy = new BuoyLat(this, node);
-			return;
-
-		} else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal") //$NON-NLS-1$ //$NON-NLS-2$
-				|| keys.containsKey("seamark:buoy_cardinal:category") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_cardinal:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_cardinal:colour") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_cardinal:category") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_cardinal:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_cardinal:colour")) { //$NON-NLS-1$
-			buoy = new BuoyCard(this, node);
-			return;
-
-		} else if (type.equals("buoy_safe_water") //$NON-NLS-1$
-				|| type.equals("beacon_safe_water") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_safe_water:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_safe_water:colour") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_safe_water:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_safe_water:colour")) { //$NON-NLS-1$
-			buoy = new BuoySaw(this, node);
-			return;
-
-		} else if (type.equals("buoy_special_purpose") //$NON-NLS-1$
-				|| type.equals("beacon_special_purpose") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_special_purpose:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_special_purpose:colour") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_special_purpose:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_special_purpose:colour")) { //$NON-NLS-1$
-			buoy = new BuoySpec(this, node);
-			return;
-
-		} else if (type.equals("buoy_isolated_danger") //$NON-NLS-1$
-				|| type.equals("beacon_isolated_danger") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_isolated_danger:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:buoy_isolated_danger:colour") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_isolated_danger:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_isolated_danger:colour")) { //$NON-NLS-1$
-			buoy = new BuoyIsol(this, node);
-			return;
-
-		} else if (type.equals("landmark") || type.equals("light_vessel") //$NON-NLS-1$
-				|| type.equals("light_major") || type.equals("light_minor")) { //$NON-NLS-1$
-			buoy = new BuoyNota(this, node);
-			return;
-
-		} else if (type.equals("light_float")) { //$NON-NLS-1$
-			if (keys.containsKey("seamark:light_float:colour")) { //$NON-NLS-1$
-				str = keys.get("seamark:light_float:colour"); //$NON-NLS-1$
-				if (str.equals("red") || str.equals("green") //$NON-NLS-1$ //$NON-NLS-2$
-						|| str.equals("red;green;red") || str.equals("green;red;green")) { //$NON-NLS-1$ //$NON-NLS-2$
-					buoy = new BuoyLat(this, node);
-					return;
-				} else if (str.equals("black;yellow") //$NON-NLS-1$
-						|| str.equals("black;yellow;black") || str.equals("yellow;black") //$NON-NLS-1$ //$NON-NLS-2$
-						|| str.equals("yellow;black;yellow")) { //$NON-NLS-1$
-					buoy = new BuoyCard(this, node);
-					return;
-				} else if (str.equals("black;red;black")) { //$NON-NLS-1$
-					buoy = new BuoyIsol(this, node);
-					return;
-				} else if (str.equals("red;white")) { //$NON-NLS-1$
-					buoy = new BuoySaw(this, node);
-					return;
-				} else if (str.equals("yellow")) { //$NON-NLS-1$
-					buoy = new BuoySpec(this, node);
-					return;
-				}
-			} else if (keys.containsKey("seamark:light_float:topmark:shape")) { //$NON-NLS-1$
-				str = keys.get("seamark:light_float:topmark:shape"); //$NON-NLS-1$
-				if (str.equals("cylinder") || str.equals("cone, point up")) { //$NON-NLS-1$ //$NON-NLS-2$
-					buoy = new BuoyLat(this, node);
-					return;
-				}
-			} else if (keys.containsKey("seamark:light_float:topmark:colour")) { //$NON-NLS-1$
-				str = keys.get("seamark:light_float:topmark:colour"); //$NON-NLS-1$
-				if (str.equals("red") || str.equals("green")) { //$NON-NLS-1$ //$NON-NLS-2$
-					buoy = new BuoyLat(this, node);
-					return;
-				}
-			}
-		}
-
-		buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.91")); //$NON-NLS-1$
-		buoy.setNode(node);
-		return;
-	}
-
-	private JDialog getDM01SeaMap() {
-
-		if (dM01SeaMap == null) {
-			dM01SeaMap = new JDialog();
-			dM01SeaMap.setSize(new Dimension(400, 400));
-			dM01SeaMap.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
-			dM01SeaMap.setModal(false);
-			dM01SeaMap.setResizable(false);
-			dM01SeaMap.setContentPane(getPM01SeaMap());
-			dM01SeaMap.setTitle(Messages.getString("SmpDialogAction.9")); //$NON-NLS-1$
-			dM01SeaMap.setVisible(false);
-			dM01SeaMap.setAlwaysOnTop(true);
-			dM01SeaMap.addWindowListener(new java.awt.event.WindowAdapter() {
-				public void windowClosing(java.awt.event.WindowEvent e) {
-
-					// Pictogramme wiederherstellen und aufraeumen
-					if (obuoy != null)
-						PicRebuild();
-					// Deaktivierung des Listeners
-					DataSet.removeSelectionListener(SmpListener);
-					Selection = null;
-
-					SmpItem.setEnabled(true);
-				}
-
-				public void windowActivated(WindowEvent arg0) {
-					parseSeaMark();
-					buoy.paintSign();
-				}
-			});
-		}
-		return dM01SeaMap;
-	}
-
-	private JPanel getPM01SeaMap() {
-		if (pM01SeaMap == null) {
-
-			lM01Icon = new JLabel();
-			lM01Icon.setBounds(new Rectangle(210, 20, 150, 200));
-			lM01Icon.setIcon(null);
-			lM01Icon.setText(""); //$NON-NLS-1$
-
-			lM02Icon = new JLabel();
-			lM02Icon.setBounds(new Rectangle(210, 20, 150, 200));
-			lM02Icon.setIcon(null);
-			lM02Icon.setText(""); //$NON-NLS-1$
-
-			lM03Icon = new JLabel();
-			lM03Icon.setBounds(new Rectangle(210, -50, 150, 200));
-			lM03Icon.setIcon(null);
-			lM03Icon.setText(""); //$NON-NLS-1$
-
-			lM04Icon = new JLabel();
-			lM04Icon.setBounds(new Rectangle(210, 20, 150, 200));
-			lM04Icon.setIcon(null);
-			lM04Icon.setText(""); //$NON-NLS-1$
-
-			lM05Icon = new JLabel();
-			lM05Icon.setBounds(new Rectangle(210, 20, 150, 200));
-			lM05Icon.setIcon(null);
-			lM05Icon.setText(""); //$NON-NLS-1$
-
-			lM01FireMark = new JLabel();
-			lM01FireMark.setBounds(new Rectangle(300, 85, 95, 20));
-			lM01FireMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01FireMark.setText(""); //$NON-NLS-1$
-
-			lM01Head = new JLabel();
-			lM01Head.setBounds(new Rectangle(5, 3, 316, 16));
-			lM01Head.setText(Messages.getString("SmpDialogAction.97")); //$NON-NLS-1$
-
-			lM01Region = new JLabel();
-			lM01Region.setBounds(new Rectangle(220, 7, 120, 16));
-			lM01Region.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01Region.setText(Messages.getString("SmpDialogAction.99")); //$NON-NLS-1$
-
-			lM02Region = new JLabel();
-			lM02Region.setBounds(new Rectangle(270, 7, 120, 16));
-			lM02Region.setFont(new Font("Dialog", Font.BOLD, 12)); //$NON-NLS-1$
-			lM02Region.setText(Messages.getString("SmpDialogAction.101")); //$NON-NLS-1$
-
-			lM01TypeOfMark = new JLabel();
-			lM01TypeOfMark.setBounds(new Rectangle(5, 28, 120, 16));
-			lM01TypeOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01TypeOfMark.setText(Messages.getString("SmpDialogAction.103")); //$NON-NLS-1$
-
-			lM01CatOfMark = new JLabel();
-			lM01CatOfMark.setBounds(new Rectangle(5, 58, 120, 16));
-			lM01CatOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01CatOfMark.setText(Messages.getString("SmpDialogAction.1")); //$NON-NLS-1$
-
-			lM01StyleOfMark = new JLabel();
-			lM01StyleOfMark.setBounds(new Rectangle(5, 88, 148, 16));
-			lM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01StyleOfMark.setText(Messages.getString("SmpDialogAction.107")); //$NON-NLS-1$
-
-			lM01Name = new JLabel();
-			lM01Name.setBounds(new Rectangle(5, 120, 82, 16));
-			lM01Name.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01Name.setText(Messages.getString("SmpDialogAction.109")); //$NON-NLS-1$
-
-			lM01Props02 = new JLabel();
-			lM01Props02.setBounds(new Rectangle(5, 150, 172, 16));
-			lM01Props02.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01Props02.setText(Messages.getString("SmpDialogAction.111")); //$NON-NLS-1$
-
-			lM01Racon = new JLabel();
-			lM01Racon.setBounds(new Rectangle(335, 195, 65, 20));
-			lM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01Racon.setText(Messages.getString("SmpDialogAction.113")); //$NON-NLS-1$
-
-			lM01FogGroup = new JLabel();
-			lM01FogGroup.setBounds(new Rectangle(190, 220, 100, 20));
-			lM01FogGroup.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01FogGroup.setText(Messages.getString("SmpDialogAction.115")); //$NON-NLS-1$
-
-			lM01FogPeriod = new JLabel();
-			lM01FogPeriod.setBounds(new Rectangle(300, 220, 100, 20));
-			lM01FogPeriod.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01FogPeriod.setText(Messages.getString("SmpDialogAction.117")); //$NON-NLS-1$
-
-			lM01Kennung = new JLabel();
-			lM01Kennung.setBounds(new Rectangle(240, 245, 60, 20));
-			lM01Kennung.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01Kennung.setText(Messages.getString("SmpDialogAction.119")); //$NON-NLS-1$
-
-			lM01Height = new JLabel();
-			lM01Height.setBounds(new Rectangle(10, 270, 100, 20));
-			lM01Height.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01Height.setText(Messages.getString("SmpDialogAction.121")); //$NON-NLS-1$
-
-			lM01Range = new JLabel();
-			lM01Range.setBounds(new Rectangle(108, 270, 100, 20));
-			lM01Range.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01Range.setText(Messages.getString("SmpDialogAction.123")); //$NON-NLS-1$
-
-			lM01Group = new JLabel();
-			lM01Group.setBounds(new Rectangle(204, 270, 100, 20));
-			lM01Group.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01Group.setText(Messages.getString("SmpDialogAction.125")); //$NON-NLS-1$
-
-			lM01RepeatTime = new JLabel();
-			lM01RepeatTime.setBounds(new Rectangle(300, 270, 100, 20));
-			lM01RepeatTime.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01RepeatTime.setText(Messages.getString("SmpDialogAction.127")); //$NON-NLS-1$
-
-			lM01Sector = new JLabel();
-			lM01Sector.setBounds(new Rectangle(10, 295, 180, 20));
-			lM01Sector.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01Sector.setText(Messages.getString("SmpDialogAction.129")); //$NON-NLS-1$
-
-			lM01Colour = new JLabel();
-			lM01Colour.setBounds(new Rectangle(120, 295, 180, 20));
-			lM01Colour.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01Colour.setText(Messages.getString("SmpDialogAction.131")); //$NON-NLS-1$
-
-			lM01Bearing = new JLabel();
-			lM01Bearing.setBounds(new Rectangle(228, 295, 180, 20));
-			lM01Bearing.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			lM01Bearing.setText(Messages.getString("SmpDialogAction.133")); //$NON-NLS-1$
-
-			rbM01RegionA = new JRadioButton(
-					Messages.getString("SmpDialogAction.134"), Main.pref.get("tomsplugin.IALA") //$NON-NLS-1$ //$NON-NLS-2$
-							.equals("A")); //$NON-NLS-1$
-			rbM01RegionA.setBounds(new Rectangle(305, 0, 50, 30));
-			rbM01RegionB = new JRadioButton("-B", Main.pref.get("tomsplugin.IALA") //$NON-NLS-1$ //$NON-NLS-2$
-					.equals("B")); //$NON-NLS-1$
-			rbM01RegionB.setBounds(new Rectangle(352, 0, 50, 30));
-			bgM01Region = new ButtonGroup();
-			bgM01Region.add(rbM01RegionA);
-			bgM01Region.add(rbM01RegionB);
-
-			ActionListener alM01Region = new ActionListener() {
-				public void actionPerformed(java.awt.event.ActionEvent e) {
-					if (buoy instanceof BuoyLat) {
-						buoy.setRegion(rbM01RegionB.isSelected());
-						buoy.setLightColour();
-						buoy.paintSign();
-					}
-				}
-			};
-			rbM01RegionA.addActionListener(alM01Region);
-			rbM01RegionB.addActionListener(alM01Region);
-
-			rbM01Fired1 = new JRadioButton(
-					Messages.getString("SmpDialogAction.140"), true); //$NON-NLS-1$
-			rbM01Fired1.setBounds(new Rectangle(85, 240, 70, 30));
-			rbM01FiredN = new JRadioButton(
-					Messages.getString("SmpDialogAction.141"), false); //$NON-NLS-1$
-			rbM01FiredN.setBounds(new Rectangle(155, 240, 80, 30));
-			bgM01Fired = new ButtonGroup();
-			bgM01Fired.add(rbM01Fired1);
-			bgM01Fired.add(rbM01FiredN);
-
-			ActionListener alM01Fired = new ActionListener() {
-				public void actionPerformed(java.awt.event.ActionEvent e) {
-					buoy.setSectored(rbM01FiredN.isSelected());
-					cbM01Sector.setSelectedIndex(0);
-					buoy.setSectorIndex(0);
-					buoy.paintSign();
-				}
-			};
-			rbM01Fired1.addActionListener(alM01Fired);
-			rbM01FiredN.addActionListener(alM01Fired);
-
-			pM01SeaMap = new JPanel();
-			pM01SeaMap.setLayout(null);
-			pM01SeaMap.add(lM01Head, null);
-			pM01SeaMap.add(rbM01RegionA, null);
-			pM01SeaMap.add(rbM01RegionB, null);
-			pM01SeaMap.add(lM01Region, null);
-			pM01SeaMap.add(lM02Region, null);
-			pM01SeaMap.add(lM01Icon, null);
-			pM01SeaMap.add(lM02Icon, null);
-			pM01SeaMap.add(lM03Icon, null);
-			pM01SeaMap.add(lM04Icon, null);
-			pM01SeaMap.add(lM05Icon, null);
-			pM01SeaMap.add(getCbM01TypeOfMark(), null);
-			pM01SeaMap.add(lM01TypeOfMark, null);
-			pM01SeaMap.add(getCbM01CatOfMark(), null);
-			pM01SeaMap.add(lM01CatOfMark, null);
-			pM01SeaMap.add(getCbM01StyleOfMark(), null);
-			pM01SeaMap.add(lM01StyleOfMark, null);
-			pM01SeaMap.add(lM01Name, null);
-			pM01SeaMap.add(getTfM01Name(), null);
-			pM01SeaMap.add(lM01Props02, null);
-			pM01SeaMap.add(getCM01TopMark(), null);
-			pM01SeaMap.add(getCbM01TopMark(), null);
-			pM01SeaMap.add(getCM01Radar(), null);
-			pM01SeaMap.add(getCM01Racon(), null);
-			pM01SeaMap.add(getCbM01Racon(), null);
-			pM01SeaMap.add(getTfM01Racon(), null);
-			pM01SeaMap.add(lM01Racon, null);
-			pM01SeaMap.add(getCM01Fog(), null);
-			pM01SeaMap.add(getCbM01Fog(), null);
-			pM01SeaMap.add(getTfM01FogGroup(), null);
-			pM01SeaMap.add(lM01FogGroup, null);
-			pM01SeaMap.add(getTfM01FogPeriod(), null);
-			pM01SeaMap.add(lM01FogPeriod, null);
-			pM01SeaMap.add(getCM01Fired(), null);
-			pM01SeaMap.add(rbM01Fired1, null);
-			pM01SeaMap.add(rbM01FiredN, null);
-			pM01SeaMap.add(getTfM01RepeatTime(), null);
-			pM01SeaMap.add(lM01RepeatTime, null);
-			pM01SeaMap.add(getCbM01Kennung(), null);
-			pM01SeaMap.add(lM01Kennung, null);
-			pM01SeaMap.add(lM01Group, null);
-			pM01SeaMap.add(getTfM01Group(), null);
-			pM01SeaMap.add(lM01Sector, null);
-			pM01SeaMap.add(getCbM01Sector(), null);
-			pM01SeaMap.add(lM01Colour, null);
-			pM01SeaMap.add(getCbM01Colour(), null);
-			pM01SeaMap.add(lM01Bearing, null);
-			pM01SeaMap.add(getTfM01Bearing(), null);
-			pM01SeaMap.add(getTfM02Bearing(), null);
-			pM01SeaMap.add(getTfM01Radius(), null);
-			pM01SeaMap.add(lM01Height, null);
-			pM01SeaMap.add(getTfM01Height(), null);
-			pM01SeaMap.add(lM01Range, null);
-			pM01SeaMap.add(getTfM01Range(), null);
-			pM01SeaMap.add(lM01FireMark, null);
-			pM01SeaMap.add(getBM01Save(), null);
-			pM01SeaMap.add(getSM01StatusBar(), null);
-			pM01SeaMap.add(getBM01Close(), null);
-			pM01SeaMap.add(getCM01IconVisible(), null);
-		}
-		return pM01SeaMap;
-	}
-
-	private JComboBox getCbM01TypeOfMark() {
-
-		if (cbM01TypeOfMark == null) {
-
-			cbM01TypeOfMark = new JComboBox();
-
-			// Inhalt der ComboBox
-			cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.142")); //$NON-NLS-1$
-			cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.143")); //$NON-NLS-1$
-			cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.144")); //$NON-NLS-1$
-			cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.145")); //$NON-NLS-1$
-			cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.146")); //$NON-NLS-1$
-			cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.147")); //$NON-NLS-1$
-			cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.148")); //$NON-NLS-1$
-
-			cbM01TypeOfMark.setBounds(new Rectangle(45, 25, 165, 25));
-			// cbM01TypeOfMark.setEditable(false);
-			cbM01TypeOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cbM01TypeOfMark.setEnabled(true);
-
-			cbM01TypeOfMark.addActionListener(new ActionListener() {
-				public void actionPerformed(java.awt.event.ActionEvent e) {
-					int type = cbM01TypeOfMark.getSelectedIndex();
-
-					if (buoy == null) {
-						buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$
-						return;
-					}
-
-					Node n = buoy.getNode();
-					if (n == null)
-						return;
-
-					paintlock = true;
-					switch (type) {
-
-					case SeaMark.UNKNOWN_TYPE:
-						if (!(buoy instanceof BuoyUkn))
-							buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$
-						buoy.setBuoyIndex(type);
-						break;
-
-					case SeaMark.LATERAL:
-						if (!(buoy instanceof BuoyLat)) {
-							buoy = new BuoyLat(dia, n);
-							buoy.setBuoyIndex(0);
-						}
-						break;
-
-					case SeaMark.CARDINAL:
-						if (!(buoy instanceof BuoyCard)) {
-							buoy = new BuoyCard(dia, n);
-							buoy.setBuoyIndex(0);
-						}
-						break;
-
-					case SeaMark.SAFE_WATER:
-						if (!(buoy instanceof BuoySaw)) {
-							buoy = new BuoySaw(dia, n);
-						}
-						buoy.setBuoyIndex(type);
-						break;
-
-					case SeaMark.ISOLATED_DANGER:
-						if (!(buoy instanceof BuoyIsol)) {
-							buoy = new BuoyIsol(dia, n);
-						}
-						buoy.setBuoyIndex(type);
-						break;
-
-					case SeaMark.SPECIAL_PURPOSE:
-						if (!(buoy instanceof BuoySpec)) {
-							buoy = new BuoySpec(dia, n);
-						}
-						buoy.setBuoyIndex(type);
-						break;
-
-					case SeaMark.LIGHT:
-						if (!(buoy instanceof BuoyNota)) {
-							buoy = new BuoyNota(dia, n);
-							buoy.setBuoyIndex(0);
-						}
-						break;
-					}
-
-					buoy.refreshStyles();
-					buoy.refreshLights();
-					buoy.setLightColour();
-					paintlock = false;
-					buoy.paintSign();
-				}
-			});
-		}
-		return cbM01TypeOfMark;
-	}
-
-	private JComboBox getCbM01CatOfMark() {
-		if (cbM01CatOfMark == null) {
-			cbM01CatOfMark = new JComboBox();
-			cbM01CatOfMark.setBounds(new Rectangle(60, 55, 150, 25));
-			cbM01CatOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cbM01CatOfMark.setEnabled(true);
-
-			cbM01CatOfMark.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					int cat = cbM01CatOfMark.getSelectedIndex();
-
-					if (buoy == null) {
-						buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$
-						return;
-					}
-
-					Node n = buoy.getNode();
-					if (n == null)
-						return;
-
-					if (cbM01TypeOfMark.getSelectedIndex() == SeaMark.LATERAL) {
-						if (!(buoy instanceof BuoyLat))
-							buoy = new BuoyLat(dia, n);
-						buoy.setBuoyIndex(cat);
-					}
-					if (cbM01TypeOfMark.getSelectedIndex() == SeaMark.CARDINAL) {
-						if (!(buoy instanceof BuoyCard))
-							buoy = new BuoyCard(dia, n);
-						buoy.setBuoyIndex(cat);
-					}
-					if (cbM01TypeOfMark.getSelectedIndex() == SeaMark.LIGHT) {
-						if (!(buoy instanceof BuoyNota))
-							buoy = new BuoyNota(dia, n);
-						buoy.setBuoyIndex(cat);
-					}
-
-					buoy.refreshStyles();
-					buoy.refreshLights();
-					buoy.setLightColour();
-					buoy.paintSign();
-				}
-			});
-		}
-		return cbM01CatOfMark;
-	}
-
-	private JComboBox getCbM01StyleOfMark() {
-		if (cbM01StyleOfMark == null) {
-			cbM01StyleOfMark = new JComboBox();
-			cbM01StyleOfMark.setBounds(new Rectangle(45, 85, 165, 25));
-			cbM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cbM01StyleOfMark.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					int style = cbM01StyleOfMark.getSelectedIndex();
-					if (buoy != null && style != buoy.getStyleIndex()) {
-						buoy.setStyleIndex(style);
-						buoy.paintSign();
-					}
-				}
-			});
-		}
-		return cbM01StyleOfMark;
-	}
-
-	private JTextField getTfM01Name() {
-		if (tfM01Name == null) {
-			tfM01Name = new JTextField();
-			tfM01Name.setBounds(new Rectangle(50, 120, 150, 20));
-			tfM01Name.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					buoy.setName(tfM01Name.getText());
-				}
-			});
-		}
-		return tfM01Name;
-	}
-
-	private JCheckBox getCM01TopMark() {
-		if (cM01TopMark == null) {
-			cM01TopMark = new JCheckBox();
-			cM01TopMark.setBounds(new Rectangle(10, 170, 100, 20));
-			cM01TopMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cM01TopMark.setText(Messages.getString("SmpDialogAction.166")); //$NON-NLS-1$
-			cM01TopMark.addItemListener(new ItemListener() {
-				public void itemStateChanged(ItemEvent e) {
-					if (buoy == null) {
-						return;
-					}
-					buoy.setTopMark(cM01TopMark.isSelected());
-					buoy.paintSign();
-				}
-			});
-		}
-		return cM01TopMark;
-	}
-
-	private JComboBox getCbM01TopMark() {
-		if (cbM01TopMark == null) {
-			cbM01TopMark = new JComboBox();
-			cbM01TopMark.setBounds(new Rectangle(110, 170, 80, 20));
-			cbM01TopMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cbM01TopMark.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					int top = cbM01TopMark.getSelectedIndex();
-					buoy.paintSign();
-				}
-			});
-		}
-		return cbM01TopMark;
-	}
-
-	private JCheckBox getCM01Radar() {
-		if (cM01Radar == null) {
-			cM01Radar = new JCheckBox();
-			cM01Radar.setBounds(new Rectangle(10, 195, 120, 20));
-			cM01Radar.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cM01Radar.setText(Messages.getString("SmpDialogAction.169")); //$NON-NLS-1$
-			cM01Radar.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					if (cM01Radar.isSelected()) {
-						buoy.setRadar(true);
-						buoy.setRacon(false);
-						cM01Racon.setSelected(false);
-					} else {
-						buoy.setRadar(false);
-					}
-					buoy.paintSign();
-				}
-			});
-		}
-		return cM01Radar;
-	}
-
-	private JCheckBox getCM01Racon() {
-		if (cM01Racon == null) {
-			cM01Racon = new JCheckBox();
-			cM01Racon.setBounds(new Rectangle(130, 195, 110, 20));
-			cM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cM01Racon.setText(Messages.getString("SmpDialogAction.171")); //$NON-NLS-1$
-			cM01Racon.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					if (cM01Racon.isSelected()) {
-						buoy.setRacon(true);
-						buoy.setRadar(false);
-						cM01Radar.setSelected(false);
-					} else {
-						buoy.setRacon(false);
-					}
-					buoy.paintSign();
-				}
-			});
-		}
-		return cM01Racon;
-	}
-
-	private JComboBox getCbM01Racon() {
-		if (cbM01Racon == null) {
-			cbM01Racon = new JComboBox();
-			cbM01Racon.setBounds(new Rectangle(240, 195, 80, 20));
-			cbM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cbM01Racon.removeAllItems();
-			cbM01Racon.addItem("Any");
-			cbM01Racon.addItem("Racon");
-			cbM01Racon.addItem("Ramark");
-			cbM01Racon.addItem("Leading");
-			cbM01Racon.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					int rac = cbM01Racon.getSelectedIndex();
-					buoy.setRaType(rac);
-					buoy.paintSign();
-				}
-			});
-		}
-		return cbM01Racon;
-	}
-
-	private JTextField getTfM01Racon() {
-		if (tfM01Racon == null) {
-			tfM01Racon = new JTextField();
-			tfM01Racon.setBounds(new Rectangle(345, 195, 30, 20));
-			tfM01Racon.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					buoy.setRaconGroup(tfM01Racon.getText().trim());
-				}
-			});
-		}
-		return tfM01Racon;
-	}
-
-	private JCheckBox getCM01Fog() {
-		if (cM01Fog == null) {
-			cM01Fog = new JCheckBox();
-			cM01Fog.setBounds(new Rectangle(10, 220, 90, 20));
-			cM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cM01Fog.setText(Messages.getString("SmpDialogAction.174")); //$NON-NLS-1$
-			cM01Fog.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					buoy.setFog(cM01Fog.isSelected());
-					buoy.paintSign();
-				}
-			});
-		}
-		return cM01Fog;
-	}
-
-	private JComboBox getCbM01Fog() {
-		if (cbM01Fog == null) {
-			cbM01Fog = new JComboBox();
-			cbM01Fog.setBounds(new Rectangle(100, 220, 70, 20));
-			cbM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cbM01Fog.removeAllItems();
-			cbM01Fog.addItem("Any");
-			cbM01Fog.addItem("Horn");
-			cbM01Fog.addItem("Siren");
-			cbM01Fog.addItem("Dia");
-			cbM01Fog.addItem("Bell");
-			cbM01Fog.addItem("Whis");
-			cbM01Fog.addItem("Gong");
-			cbM01Fog.addItem("Explos");
-			cbM01Fog.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					if (cbM01Fog.getSelectedIndex() > 0)
-						buoy.setFogSound(cbM01Fog.getSelectedIndex());
-					else
-						buoy.setFogSound(0);
-					buoy.paintSign();
-				}
-			});
-		}
-		return cbM01Fog;
-	}
-
-	private JTextField getTfM01FogGroup() {
-		if (tfM01FogGroup == null) {
-			tfM01FogGroup = new JTextField();
-			tfM01FogGroup.setBounds(new Rectangle(243, 220, 30, 20));
-			tfM01FogGroup.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					buoy.setFogGroup(tfM01FogGroup.getText().trim());
-				}
-			});
-		}
-		return tfM01FogGroup;
-	}
-
-	private JTextField getTfM01FogPeriod() {
-		if (tfM01FogPeriod == null) {
-			tfM01FogPeriod = new JTextField();
-			tfM01FogPeriod.setBounds(new Rectangle(345, 220, 30, 20));
-			tfM01FogPeriod.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					buoy.setFogPeriod(tfM01FogPeriod.getText().trim());
-				}
-			});
-		}
-		return tfM01FogPeriod;
-	}
-
-	private JCheckBox getCM01Fired() {
-		if (cM01Fired == null) {
-			cM01Fired = new JCheckBox();
-			cM01Fired.setBounds(new Rectangle(10, 245, 75, 20));
-			cM01Fired.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cM01Fired.setText(Messages.getString("SmpDialogAction.177")); //$NON-NLS-1$
-			cM01Fired.addItemListener(new ItemListener() {
-				public void itemStateChanged(ItemEvent e) {
-					if (buoy == null) {
-						return;
-					}
-					buoy.setFired(cM01Fired.isSelected());
-					buoy.setLightColour();
-					buoy.paintSign();
-				}
-			});
-		}
-
-		return cM01Fired;
-	}
-
-	private JComboBox getCbM01Kennung() {
-		if (cbM01Kennung == null) {
-			cbM01Kennung = new JComboBox();
-			cbM01Kennung.setBounds(new Rectangle(305, 245, 70, 20));
-			cbM01Kennung.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					int i1, i2;
-					String c = ""; //$NON-NLS-1$ //$NON-NLS-2$
-					String it = (String) cbM01Kennung.getSelectedItem();
-
-					if (it == null)
-						return;
-					if (it.equals(Messages.getString("SmpDialogAction.212"))) //$NON-NLS-1$
-						return;
-					if (buoy == null)
-						return;
-
-					if (it.contains("(")) {
-						i1 = it.indexOf("(");
-						i2 = it.indexOf(")");
-						c = it.substring(i1+1, i2);
-						it = it.substring(0, i1) + it.substring(i2+1);
-					}
-					if (!c.isEmpty())
-						buoy.setLightGroup(c);;
-					buoy.setLightChar(it);
-					buoy.paintSign();
-				}
-			});
-		}
-		return cbM01Kennung;
-	}
-
-	private JTextField getTfM01Height() {
-		if (tfM01Height == null) {
-			tfM01Height = new JTextField();
-			tfM01Height.setBounds(new Rectangle(54, 270, 30, 20));
-			tfM01Height.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					buoy.setHeight(tfM01Height.getText().trim());
-				}
-			});
-		}
-		return tfM01Height;
-	}
-
-	private JTextField getTfM01Range() {
-		if (tfM01Range == null) {
-			tfM01Range = new JTextField();
-			tfM01Range.setBounds(new Rectangle(151, 270, 30, 20));
-			tfM01Range.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					buoy.setRange(tfM01Range.getText().trim());
-				}
-			});
-		}
-		return tfM01Range;
-	}
-
-	private JTextField getTfM01Group() {
-		if (tfM01Group == null) {
-			tfM01Group = new JTextField();
-			tfM01Group.setBounds(new Rectangle(255, 270, 30, 20));
-			tfM01Group.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					buoy.setLightGroup(tfM01Group.getText().trim());
-					buoy.paintSign();
-				}
-			});
-		}
-		return tfM01Group;
-	}
-
-	private JTextField getTfM01RepeatTime() {
-		if (tfM01RepeatTime == null) {
-			tfM01RepeatTime = new JTextField();
-			tfM01RepeatTime.setBounds(new Rectangle(345, 270, 30, 20));
-			tfM01RepeatTime.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					buoy.setLightPeriod(tfM01RepeatTime.getText().trim());
-					buoy.paintSign();
-				}
-			});
-
-			tfM01RepeatTime.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					buoy.setLightPeriod(tfM01RepeatTime.getText().trim());
-					buoy.paintSign();
-				}
-			});
-		}
-		return tfM01RepeatTime;
-	}
-
-	private JComboBox getCbM01Colour() {
-		if (cbM01Colour == null) {
-			cbM01Colour = new JComboBox();
-			cbM01Colour.setBounds(new Rectangle(165, 295, 40, 20));
-			cbM01Colour.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cbM01Colour.addItem(""); //$NON-NLS-1$
-			cbM01Colour.addItem(Messages.getString("SmpDialogAction.190")); //$NON-NLS-1$
-			cbM01Colour.addItem(Messages.getString("SmpDialogAction.191")); //$NON-NLS-1$
-			cbM01Colour.addItem(Messages.getString("SmpDialogAction.192")); //$NON-NLS-1$
-			cbM01Colour.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					buoy.setLightColour((String)cbM01Colour.getSelectedItem());
-					buoy.paintSign();
-				}
-			});
-		}
-		return cbM01Colour;
-	}
-
-	private JComboBox getCbM01Sector() {
-		if (cbM01Sector == null) {
-			cbM01Sector = new JComboBox();
-			cbM01Sector.setBounds(new Rectangle(55, 295, 50, 20));
-			cbM01Sector.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
-			cbM01Sector.addItem(Messages.getString("SmpDialogAction.194")); //$NON-NLS-1$
-			cbM01Sector.addItem(Messages.getString("SmpDialogAction.195")); //$NON-NLS-1$
-			cbM01Sector.addItem(Messages.getString("SmpDialogAction.196")); //$NON-NLS-1$
-			cbM01Sector.addItem(Messages.getString("SmpDialogAction.197")); //$NON-NLS-1$
-			cbM01Sector.addItem(Messages.getString("SmpDialogAction.198")); //$NON-NLS-1$
-			cbM01Sector.addItem(Messages.getString("SmpDialogAction.199")); //$NON-NLS-1$
-			cbM01Sector.addItem(Messages.getString("SmpDialogAction.200")); //$NON-NLS-1$
-			cbM01Sector.addItem(Messages.getString("SmpDialogAction.201")); //$NON-NLS-1$
-			cbM01Sector.addItem(Messages.getString("SmpDialogAction.202")); //$NON-NLS-1$
-			cbM01Sector.addItem(Messages.getString("SmpDialogAction.203")); //$NON-NLS-1$
-			cbM01Sector.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					buoy.setSectorIndex(cbM01Sector.getSelectedIndex());
-					buoy.paintSign();
-				}
-			});
-		}
-		return cbM01Sector;
-	}
-
-	private JTextField getTfM01Bearing() {
-		if (tfM01Bearing == null) {
-			tfM01Bearing = new JTextField();
-			tfM01Bearing.setBounds(new Rectangle(255, 295, 30, 20));
-			tfM01Bearing.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					buoy.setBearing1(tfM01Bearing.getText().trim());
-				}
-			});
-		}
-		return tfM01Bearing;
-	}
-
-	private JTextField getTfM02Bearing() {
-		if (tfM02Bearing == null) {
-			tfM02Bearing = new JTextField();
-			tfM02Bearing.setBounds(new Rectangle(300, 295, 30, 20));
-			tfM02Bearing.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					buoy.setBearing2(tfM02Bearing.getText().trim());
-				}
-			});
-		}
-		return tfM02Bearing;
-	}
-
-	private JTextField getTfM01Radius() {
-		if (tfM01Radius == null) {
-			tfM01Radius = new JTextField();
-			tfM01Radius.setBounds(new Rectangle(355, 295, 30, 20));
-			tfM01Radius.addFocusListener(new FocusAdapter() {
-				public void focusLost(FocusEvent e) {
-					buoy.setRadius(tfM01Radius.getText().trim());
-				}
-			});
-		}
-		return tfM01Radius;
-	}
-
-	private JButton getBM01Close() {
-		if (bM01Close == null) {
-			bM01Close = new JButton();
-			bM01Close.setBounds(new Rectangle(20, 325, 110, 20));
-			bM01Close.setText(tr("Close"));
-			bM01Close.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					// aufraeumen
-					if (obuoy != null)
-						PicRebuild();
-					// Deaktivierung des Listeners
-					DataSet.removeSelectionListener(SmpListener);
-					Selection = null;
-					SmpItem.setEnabled(true);
-					onode = null;
-
-					dM01SeaMap.dispose();
-				}
-			});
-		}
-
-		return bM01Close;
-	}
-
-	private JButton getBM01Save() {
-		if (bM01Save == null) {
-			bM01Save = new JButton();
-			bM01Save.setBounds(new Rectangle(150, 325, 110, 20));
-			bM01Save.setText(tr("Save"));
-			bM01Save.setEnabled(false);
-
-			bM01Save.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					cM01IconVisible.setIcon(new ImageIcon(getClass().getResource(
-							"/images/Auge.png"))); //$NON-NLS-1$
-					cM01IconVisible.setSelected(true);
-
-					buoy.saveSign();
-				}
-			});
-		}
-
-		return bM01Save;
-	}
-
-	private JCheckBox getCM01IconVisible() {
-		if (cM01IconVisible == null) {
-			cM01IconVisible = new JCheckBox();
-			cM01IconVisible.setBounds(new Rectangle(310, 325, 30, 21));
-			cM01IconVisible.setIcon(new ImageIcon(getClass().getResource(
-					"/images/AugeN.png"))); //$NON-NLS-1$
-			cM01IconVisible.setSelected(false);
-			cM01IconVisible.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					Command c;
-					Node n = null;
-					DataSet ds = Main.main.getCurrentDataSet();
-
-					if (buoy != null)
-						n = buoy.getNode();
-
-					if (cM01IconVisible.isSelected()) {
-						cM01IconVisible.setIcon(new ImageIcon(getClass().getResource(
-								"/images/AugeN.png"))); //$NON-NLS-1$
-						if (n != null) {
-							// seamark loeschen, wenn notwendig
-							if (n.getKeys().containsKey("seamark")) { //$NON-NLS-1$
-								smb = n.getKeys().get("seamark"); // smb merken //$NON-NLS-1$
-
-								c = new ChangePropertyCommand(n, "seamark", null); //$NON-NLS-1$
-								c.executeCommand();
-								ds.fireSelectionChanged();
-								obuoy = buoy;
-							}
-
-							// seamark:type loeschen, wenn notwendig
-							if (n.getKeys().containsKey("seamark:type")) { //$NON-NLS-1$
-								smt = n.getKeys().get("seamark:type"); // smt merken //$NON-NLS-1$
-
-								c = new ChangePropertyCommand(n, "seamark:type", null); //$NON-NLS-1$
-								c.executeCommand();
-								ds.fireSelectionChanged();
-								obuoy = buoy;
-							}
-
-						}
-					} else {
-						cM01IconVisible.setIcon(new ImageIcon(getClass().getResource(
-								"/images/Auge.png"))); //$NON-NLS-1$
-						PicRebuild();
-						obuoy = null;
-					}
-					buoy.paintSign();
-				}
-			});
-		}
-		return cM01IconVisible;
-	}
-
-	private JTextField getSM01StatusBar() {
-		if (sM01StatusBar == null) {
-			sM01StatusBar = new JTextField();
-			sM01StatusBar.setBounds(new Rectangle(7, 355, 385, 20));
-			sM01StatusBar.setBackground(SystemColor.activeCaptionBorder);
-		}
-		return sM01StatusBar;
-	}
+    private static final long serialVersionUID = -2976230949744302905L;
+
+    /**
+     * lokale Variable, private
+     */
+    private SmpDialogAction dia = null; // Variable für den Handle von
+                                                                            // SmpDialogAction
+    private Buoy buoy = null; // Variable für Objekte des Typs "Tonne" //
+                                                        // @jve:decl-index=0:
+    private boolean isOpen = false; // zeigt den Status des Dialogs an
+    private Node onode = null; // gemerkter Knoten
+    private Buoy obuoy = null; // gemerkte Tonne // @jve:decl-index=0:
+    private JMenuItem SmpItem = null; // Info über item in der Werkzeugleiste
+    private String smt = ""; // value vom key "seamark:type" // @jve:decl-index=0: //$NON-NLS-1$
+    private String smb = ""; // value vom key "seamark" // @jve:decl-index=0: //$NON-NLS-1$
+    private Collection<? extends OsmPrimitive> Selection = null; // @jve:decl-index=0:
+    private OsmPrimitive SelNode = null;
+    private String Os = ""; // @jve:decl-index=0: //$NON-NLS-1$
+    private String UserHome = ""; // @jve:decl-index=0: //$NON-NLS-1$
+
+    // SelectionChangedListner der in die Eventqueue von josm eingehängt wird
+    private SelectionChangedListener SmpListener = new SelectionChangedListener() {
+        public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
+            Node node;
+            Selection = newSelection;
+
+            // System.out.println("hello");
+            for (OsmPrimitive osm : Selection) {
+                if (osm instanceof Node) {
+                    node = (Node) osm;
+                    if (Selection.size() == 1)
+                        // Absicherung gegen Doppelevents
+                        if (node.compareTo(SelNode) != 0) {
+                            SelNode = node;
+                            parseSeaMark();
+                            buoy.paintSign();
+                        }
+                }
+            }
+
+            Selection = null;
+
+        }
+    };
+
+    /**
+     * lokale Variable der Maske
+     */
+    private JDialog dM01SeaMap = null;
+    private JPanel pM01SeaMap = null;
+    private JLabel lM01Head = null;
+    private JLabel lM01Region = null;
+    private JLabel lM02Region = null;
+    public ButtonGroup bgM01Region = null;
+    public JRadioButton rbM01RegionA = null;
+    public JRadioButton rbM01RegionB = null;
+    public JLabel lM01Icon = null; // Shape
+    public JLabel lM02Icon = null; // Light
+    public JLabel lM03Icon = null; // Reflector
+    public JLabel lM04Icon = null; // Racon
+    public JLabel lM05Icon = null; // Fog
+    public JLabel lM01FireMark = null;
+    private JLabel lM01TypeOfMark = null;
+    public JComboBox cbM01TypeOfMark = null;
+    public JLabel lM01CatOfMark = null;
+    public JComboBox cbM01CatOfMark = null;
+    public JLabel lM01StyleOfMark = null;
+    public JComboBox cbM01StyleOfMark = null;
+    private JLabel lM01Name = null;
+    public JTextField tfM01Name = null;
+    private JLabel lM01Props02 = null;
+    public JCheckBox cM01TopMark = null;
+    public JComboBox cbM01TopMark = null;
+    public JCheckBox cM01Radar = null;
+    public JCheckBox cM01Racon = null;
+    public JComboBox cbM01Racon = null;
+    public JTextField tfM01Racon = null;
+    public JLabel lM01Racon = null;
+    public JCheckBox cM01Fog = null;
+    public JComboBox cbM01Fog = null;
+    public JLabel lM01FogGroup = null;
+    public JTextField tfM01FogGroup = null;
+    public JLabel lM01FogPeriod = null;
+    public JTextField tfM01FogPeriod = null;
+    public JCheckBox cM01Fired = null;
+    public ButtonGroup bgM01Fired = null;
+    public JRadioButton rbM01Fired1 = null;
+    public JRadioButton rbM01FiredN = null;
+    public JLabel lM01Kennung = null;
+    public JComboBox cbM01Kennung = null;
+    public JLabel lM01Height = null;
+    public JTextField tfM01Height = null;
+    public JLabel lM01Range = null;
+    public JTextField tfM01Range = null;
+    public JLabel lM01Group = null;
+    public JTextField tfM01Group = null;
+    public JLabel lM01RepeatTime = null;
+    public JTextField tfM01RepeatTime = null;
+    public JLabel lM01Sector = null;
+    public JComboBox cbM01Sector = null;
+    public JLabel lM01Colour = null;
+    public JComboBox cbM01Colour = null;
+    public JLabel lM01Bearing = null;
+    public JTextField tfM01Bearing = null;
+    public JTextField tfM02Bearing = null;
+    public JTextField tfM01Radius = null;
+    public JButton bM01Save = null;
+    public JButton bM01Close = null;
+    public JCheckBox cM01IconVisible = null;
+    public JTextField sM01StatusBar = null;
+
+    public boolean paintlock = false;
+
+    public JMenuItem getSmpItem() {
+        return SmpItem;
+    }
+
+    public void setSmpItem(JMenuItem smpItem) {
+        SmpItem = smpItem;
+    }
+
+    public boolean isOpen() {
+        return isOpen;
+    }
+
+    public void setOpen(boolean isOpen) {
+        this.isOpen = isOpen;
+    }
+
+    public String getOs() {
+        return Os;
+    }
+
+    public void setOs(String os) {
+        Os = os;
+    }
+
+    public String getUserHome() {
+        return UserHome;
+    }
+
+    public void setUserHome(String userHome) {
+        UserHome = userHome;
+    }
+
+    public SmpDialogAction() {
+        super(
+                Messages.getString("SmpDialogAction.4"), "Smp", Messages.getString("SmpDialogAction.0"), Shortcut //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+                        .registerShortcut(
+                                "tools:Semarks", //$NON-NLS-1$
+                                tr("Tool: {0}", Messages.getString("SmpDialogAction.9")), KeyEvent.VK_S, //$NON-NLS-1$ //$NON-NLS-2$
+                                Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
+
+        dia = this;
+        String str = Main.pref.get("mappaint.style.sources"); //$NON-NLS-1$
+        if (!str.contains("dev.openseamap.org")) { //$NON-NLS-1$
+            if (!str.isEmpty()) //$NON-NLS-1$
+                str += new String(new char[] { 0x1e });
+            Main.pref.put("mappaint.style.sources", str //$NON-NLS-1$
+                    + "http://dev.openseamap.org/josm/seamark_styles.xml"); //$NON-NLS-1$
+        }
+        str = Main.pref.get("color.background"); //$NON-NLS-1$
+        if (str.equals("#000000") || str.isEmpty()) //$NON-NLS-1$ //$NON-NLS-2$
+            Main.pref.put("color.background", "#606060"); //$NON-NLS-1$ //$NON-NLS-2$
+    }
+
+    public void CloseDialog() {
+        onode = null;
+        DataSet.removeSelectionListener(SmpListener);
+        Selection = null;
+
+        if (isOpen)
+            dM01SeaMap.dispose();
+        isOpen = false;
+
+    }
+
+    public void actionPerformed(ActionEvent e) {
+
+        /*
+         * int option = JOptionPane.showConfirmDialog(Main.parent,
+         * tr("THIS IS EXPERIMENTAL. Save your work and verify before uploading.\n"
+         * + "Are you really sure to continue?"),
+         * tr("Please abort if you are not sure"), JOptionPane.YES_NO_OPTION,
+         * JOptionPane.WARNING_MESSAGE);
+         *
+         * if (option != JOptionPane.YES_OPTION) { return; }
+         */
+
+        onode = null;
+        obuoy = null;
+
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                JDialog dialog = getDM01SeaMap();
+
+                if (SmpItem == null) {
+                }
+                dialog.setVisible(true);
+            }
+        });
+
+        setOpen(true);
+
+        if (SmpItem == null) {
+            return;
+        }
+        SmpItem.setEnabled(false);
+
+        // Ausprobe: Möglichkeit der Benachrichtigung, wenn etwas neu
+        // selektiert wird (ueber SelectionChangedListener)
+        // private Collection<? extends OsmPrimitive> sel;
+        // siehe org.openstreetmap.josm.plugins.osb -> OsbLayer.java
+        // Einhängen des Listeners in die Eventqueue von josm
+        DataSet.addSelectionListener(SmpListener);
+    }
+
+    private void PicRebuild() {
+
+        DataSet ds = Main.main.getCurrentDataSet();
+
+        if (obuoy == null) {
+            return;
+        }
+
+        Node n = obuoy.getNode();
+
+        if (n != null) {
+            Command c;
+
+            if (smb != "") { //$NON-NLS-1$
+
+                c = new ChangePropertyCommand(n, "seamark", smb); //$NON-NLS-1$
+                c.executeCommand();
+                ds.fireSelectionChanged();
+
+                smb = ""; //$NON-NLS-1$
+            }
+
+            if (smt != "") { //$NON-NLS-1$
+
+                c = new ChangePropertyCommand(n, "seamark:type", smt); //$NON-NLS-1$
+                c.executeCommand();
+                ds.fireSelectionChanged();
+
+                smt = ""; //$NON-NLS-1$
+            }
+        }
+
+        obuoy = null;
+
+    }
+
+    private void parseSeaMark() {
+
+        int nodes = 0;
+        Node node = null;
+        Collection<Node> selection = null;
+        Map<String, String> keys;
+        DataSet ds;
+
+        ds = Main.main.getCurrentDataSet();
+
+        if (ds == null) {
+            buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.26")); //$NON-NLS-1$
+            buoy.setNode(null);
+            return;
+        }
+
+        selection = ds.getSelectedNodes();
+        nodes = selection.size();
+
+        if (nodes == 0) {
+            buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.27")); //$NON-NLS-1$
+            buoy.setNode(null);
+            return;
+        }
+
+        if (nodes > 1) {
+            buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.28")); //$NON-NLS-1$
+            buoy.setNode(null);
+            return;
+        }
+
+        Iterator<Node> it = selection.iterator();
+        node = it.next();
+
+        if (onode != null)
+            if (node.equals(onode))
+                return;
+
+        // Knoten wurde gewechselt -> die alten tags (benutzt zum Ausblenden der
+        // Pictogramme) wiederherstellen
+        if (obuoy != null)
+            PicRebuild();
+
+        onode = node;
+
+        cM01IconVisible.setEnabled(true);
+        cM01IconVisible.setIcon(new ImageIcon(getClass().getResource(
+                "/images/Auge.png"))); //$NON-NLS-1$
+
+        cbM01TypeOfMark.setEnabled(true);
+
+        // Soweit das Vorspiel. Ab hier beginnt das Parsen
+        String type = ""; //$NON-NLS-1$
+        String str = ""; //$NON-NLS-1$
+
+        keys = node.getKeys();
+
+        // vorsorglich den Namen holen und verwenden, wenn es ein
+        // Seezeichen ist. Name kann durch die weiteren Tags ueber-
+        // schrieben werden
+
+        if (keys.containsKey("seamark:type")) //$NON-NLS-1$
+            type = keys.get("seamark:type"); //$NON-NLS-1$
+
+        if (type.equals("buoy_lateral") || type.equals("beacon_lateral") //$NON-NLS-1$ //$NON-NLS-2$
+                || keys.containsKey("seamark:buoy_lateral:category") //$NON-NLS-1$
+                || keys.containsKey("seamark:buoy_lateral:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:buoy_lateral:colour") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_lateral:category") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_lateral:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_lateral:colour")) { //$NON-NLS-1$
+            buoy = new BuoyLat(this, node);
+            return;
+
+        } else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal") //$NON-NLS-1$ //$NON-NLS-2$
+                || keys.containsKey("seamark:buoy_cardinal:category") //$NON-NLS-1$
+                || keys.containsKey("seamark:buoy_cardinal:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:buoy_cardinal:colour") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_cardinal:category") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_cardinal:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_cardinal:colour")) { //$NON-NLS-1$
+            buoy = new BuoyCard(this, node);
+            return;
+
+        } else if (type.equals("buoy_safe_water") //$NON-NLS-1$
+                || type.equals("beacon_safe_water") //$NON-NLS-1$
+                || keys.containsKey("seamark:buoy_safe_water:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:buoy_safe_water:colour") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_safe_water:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_safe_water:colour")) { //$NON-NLS-1$
+            buoy = new BuoySaw(this, node);
+            return;
+
+        } else if (type.equals("buoy_special_purpose") //$NON-NLS-1$
+                || type.equals("beacon_special_purpose") //$NON-NLS-1$
+                || keys.containsKey("seamark:buoy_special_purpose:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:buoy_special_purpose:colour") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_special_purpose:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_special_purpose:colour")) { //$NON-NLS-1$
+            buoy = new BuoySpec(this, node);
+            return;
+
+        } else if (type.equals("buoy_isolated_danger") //$NON-NLS-1$
+                || type.equals("beacon_isolated_danger") //$NON-NLS-1$
+                || keys.containsKey("seamark:buoy_isolated_danger:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:buoy_isolated_danger:colour") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_isolated_danger:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_isolated_danger:colour")) { //$NON-NLS-1$
+            buoy = new BuoyIsol(this, node);
+            return;
+
+        } else if (type.equals("landmark") || type.equals("light_vessel") //$NON-NLS-1$
+                || type.equals("light_major") || type.equals("light_minor")) { //$NON-NLS-1$
+            buoy = new BuoyNota(this, node);
+            return;
+
+        } else if (type.equals("light_float")) { //$NON-NLS-1$
+            if (keys.containsKey("seamark:light_float:colour")) { //$NON-NLS-1$
+                str = keys.get("seamark:light_float:colour"); //$NON-NLS-1$
+                if (str.equals("red") || str.equals("green") //$NON-NLS-1$ //$NON-NLS-2$
+                        || str.equals("red;green;red") || str.equals("green;red;green")) { //$NON-NLS-1$ //$NON-NLS-2$
+                    buoy = new BuoyLat(this, node);
+                    return;
+                } else if (str.equals("black;yellow") //$NON-NLS-1$
+                        || str.equals("black;yellow;black") || str.equals("yellow;black") //$NON-NLS-1$ //$NON-NLS-2$
+                        || str.equals("yellow;black;yellow")) { //$NON-NLS-1$
+                    buoy = new BuoyCard(this, node);
+                    return;
+                } else if (str.equals("black;red;black")) { //$NON-NLS-1$
+                    buoy = new BuoyIsol(this, node);
+                    return;
+                } else if (str.equals("red;white")) { //$NON-NLS-1$
+                    buoy = new BuoySaw(this, node);
+                    return;
+                } else if (str.equals("yellow")) { //$NON-NLS-1$
+                    buoy = new BuoySpec(this, node);
+                    return;
+                }
+            } else if (keys.containsKey("seamark:light_float:topmark:shape")) { //$NON-NLS-1$
+                str = keys.get("seamark:light_float:topmark:shape"); //$NON-NLS-1$
+                if (str.equals("cylinder") || str.equals("cone, point up")) { //$NON-NLS-1$ //$NON-NLS-2$
+                    buoy = new BuoyLat(this, node);
+                    return;
+                }
+            } else if (keys.containsKey("seamark:light_float:topmark:colour")) { //$NON-NLS-1$
+                str = keys.get("seamark:light_float:topmark:colour"); //$NON-NLS-1$
+                if (str.equals("red") || str.equals("green")) { //$NON-NLS-1$ //$NON-NLS-2$
+                    buoy = new BuoyLat(this, node);
+                    return;
+                }
+            }
+        }
+
+        buoy = new BuoyUkn(this, Messages.getString("SmpDialogAction.91")); //$NON-NLS-1$
+        buoy.setNode(node);
+        return;
+    }
+
+    private JDialog getDM01SeaMap() {
+
+        if (dM01SeaMap == null) {
+            dM01SeaMap = new JDialog();
+            dM01SeaMap.setSize(new Dimension(400, 400));
+            dM01SeaMap.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+            dM01SeaMap.setModal(false);
+            dM01SeaMap.setResizable(false);
+            dM01SeaMap.setContentPane(getPM01SeaMap());
+            dM01SeaMap.setTitle(Messages.getString("SmpDialogAction.9")); //$NON-NLS-1$
+            dM01SeaMap.setVisible(false);
+            dM01SeaMap.setAlwaysOnTop(true);
+            dM01SeaMap.addWindowListener(new java.awt.event.WindowAdapter() {
+                public void windowClosing(java.awt.event.WindowEvent e) {
+
+                    // Pictogramme wiederherstellen und aufraeumen
+                    if (obuoy != null)
+                        PicRebuild();
+                    // Deaktivierung des Listeners
+                    DataSet.removeSelectionListener(SmpListener);
+                    Selection = null;
+
+                    SmpItem.setEnabled(true);
+                }
+
+                public void windowActivated(WindowEvent arg0) {
+                    parseSeaMark();
+                    buoy.paintSign();
+                }
+            });
+        }
+        return dM01SeaMap;
+    }
+
+    private JPanel getPM01SeaMap() {
+        if (pM01SeaMap == null) {
+
+            lM01Icon = new JLabel();
+            lM01Icon.setBounds(new Rectangle(210, 20, 150, 200));
+            lM01Icon.setIcon(null);
+            lM01Icon.setText(""); //$NON-NLS-1$
+
+            lM02Icon = new JLabel();
+            lM02Icon.setBounds(new Rectangle(210, 20, 150, 200));
+            lM02Icon.setIcon(null);
+            lM02Icon.setText(""); //$NON-NLS-1$
+
+            lM03Icon = new JLabel();
+            lM03Icon.setBounds(new Rectangle(210, -50, 150, 200));
+            lM03Icon.setIcon(null);
+            lM03Icon.setText(""); //$NON-NLS-1$
+
+            lM04Icon = new JLabel();
+            lM04Icon.setBounds(new Rectangle(210, 20, 150, 200));
+            lM04Icon.setIcon(null);
+            lM04Icon.setText(""); //$NON-NLS-1$
+
+            lM05Icon = new JLabel();
+            lM05Icon.setBounds(new Rectangle(210, 20, 150, 200));
+            lM05Icon.setIcon(null);
+            lM05Icon.setText(""); //$NON-NLS-1$
+
+            lM01FireMark = new JLabel();
+            lM01FireMark.setBounds(new Rectangle(300, 85, 95, 20));
+            lM01FireMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01FireMark.setText(""); //$NON-NLS-1$
+
+            lM01Head = new JLabel();
+            lM01Head.setBounds(new Rectangle(5, 3, 316, 16));
+            lM01Head.setText(Messages.getString("SmpDialogAction.97")); //$NON-NLS-1$
+
+            lM01Region = new JLabel();
+            lM01Region.setBounds(new Rectangle(220, 7, 120, 16));
+            lM01Region.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01Region.setText(Messages.getString("SmpDialogAction.99")); //$NON-NLS-1$
+
+            lM02Region = new JLabel();
+            lM02Region.setBounds(new Rectangle(270, 7, 120, 16));
+            lM02Region.setFont(new Font("Dialog", Font.BOLD, 12)); //$NON-NLS-1$
+            lM02Region.setText(Messages.getString("SmpDialogAction.101")); //$NON-NLS-1$
+
+            lM01TypeOfMark = new JLabel();
+            lM01TypeOfMark.setBounds(new Rectangle(5, 28, 120, 16));
+            lM01TypeOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01TypeOfMark.setText(Messages.getString("SmpDialogAction.103")); //$NON-NLS-1$
+
+            lM01CatOfMark = new JLabel();
+            lM01CatOfMark.setBounds(new Rectangle(5, 58, 120, 16));
+            lM01CatOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01CatOfMark.setText(Messages.getString("SmpDialogAction.1")); //$NON-NLS-1$
+
+            lM01StyleOfMark = new JLabel();
+            lM01StyleOfMark.setBounds(new Rectangle(5, 88, 148, 16));
+            lM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01StyleOfMark.setText(Messages.getString("SmpDialogAction.107")); //$NON-NLS-1$
+
+            lM01Name = new JLabel();
+            lM01Name.setBounds(new Rectangle(5, 120, 82, 16));
+            lM01Name.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01Name.setText(Messages.getString("SmpDialogAction.109")); //$NON-NLS-1$
+
+            lM01Props02 = new JLabel();
+            lM01Props02.setBounds(new Rectangle(5, 150, 172, 16));
+            lM01Props02.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01Props02.setText(Messages.getString("SmpDialogAction.111")); //$NON-NLS-1$
+
+            lM01Racon = new JLabel();
+            lM01Racon.setBounds(new Rectangle(335, 195, 65, 20));
+            lM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01Racon.setText(Messages.getString("SmpDialogAction.113")); //$NON-NLS-1$
+
+            lM01FogGroup = new JLabel();
+            lM01FogGroup.setBounds(new Rectangle(190, 220, 100, 20));
+            lM01FogGroup.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01FogGroup.setText(Messages.getString("SmpDialogAction.115")); //$NON-NLS-1$
+
+            lM01FogPeriod = new JLabel();
+            lM01FogPeriod.setBounds(new Rectangle(300, 220, 100, 20));
+            lM01FogPeriod.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01FogPeriod.setText(Messages.getString("SmpDialogAction.117")); //$NON-NLS-1$
+
+            lM01Kennung = new JLabel();
+            lM01Kennung.setBounds(new Rectangle(240, 245, 60, 20));
+            lM01Kennung.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01Kennung.setText(Messages.getString("SmpDialogAction.119")); //$NON-NLS-1$
+
+            lM01Height = new JLabel();
+            lM01Height.setBounds(new Rectangle(10, 270, 100, 20));
+            lM01Height.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01Height.setText(Messages.getString("SmpDialogAction.121")); //$NON-NLS-1$
+
+            lM01Range = new JLabel();
+            lM01Range.setBounds(new Rectangle(108, 270, 100, 20));
+            lM01Range.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01Range.setText(Messages.getString("SmpDialogAction.123")); //$NON-NLS-1$
+
+            lM01Group = new JLabel();
+            lM01Group.setBounds(new Rectangle(204, 270, 100, 20));
+            lM01Group.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01Group.setText(Messages.getString("SmpDialogAction.125")); //$NON-NLS-1$
+
+            lM01RepeatTime = new JLabel();
+            lM01RepeatTime.setBounds(new Rectangle(300, 270, 100, 20));
+            lM01RepeatTime.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01RepeatTime.setText(Messages.getString("SmpDialogAction.127")); //$NON-NLS-1$
+
+            lM01Sector = new JLabel();
+            lM01Sector.setBounds(new Rectangle(10, 295, 180, 20));
+            lM01Sector.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01Sector.setText(Messages.getString("SmpDialogAction.129")); //$NON-NLS-1$
+
+            lM01Colour = new JLabel();
+            lM01Colour.setBounds(new Rectangle(120, 295, 180, 20));
+            lM01Colour.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01Colour.setText(Messages.getString("SmpDialogAction.131")); //$NON-NLS-1$
+
+            lM01Bearing = new JLabel();
+            lM01Bearing.setBounds(new Rectangle(228, 295, 180, 20));
+            lM01Bearing.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            lM01Bearing.setText(Messages.getString("SmpDialogAction.133")); //$NON-NLS-1$
+
+            rbM01RegionA = new JRadioButton(
+                    Messages.getString("SmpDialogAction.134"), Main.pref.get("tomsplugin.IALA") //$NON-NLS-1$ //$NON-NLS-2$
+                            .equals("A")); //$NON-NLS-1$
+            rbM01RegionA.setBounds(new Rectangle(305, 0, 50, 30));
+            rbM01RegionB = new JRadioButton("-B", Main.pref.get("tomsplugin.IALA") //$NON-NLS-1$ //$NON-NLS-2$
+                    .equals("B")); //$NON-NLS-1$
+            rbM01RegionB.setBounds(new Rectangle(352, 0, 50, 30));
+            bgM01Region = new ButtonGroup();
+            bgM01Region.add(rbM01RegionA);
+            bgM01Region.add(rbM01RegionB);
+
+            ActionListener alM01Region = new ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent e) {
+                    if (buoy instanceof BuoyLat) {
+                        buoy.setRegion(rbM01RegionB.isSelected());
+                        buoy.setLightColour();
+                        buoy.paintSign();
+                    }
+                }
+            };
+            rbM01RegionA.addActionListener(alM01Region);
+            rbM01RegionB.addActionListener(alM01Region);
+
+            rbM01Fired1 = new JRadioButton(
+                    Messages.getString("SmpDialogAction.140"), true); //$NON-NLS-1$
+            rbM01Fired1.setBounds(new Rectangle(85, 240, 70, 30));
+            rbM01FiredN = new JRadioButton(
+                    Messages.getString("SmpDialogAction.141"), false); //$NON-NLS-1$
+            rbM01FiredN.setBounds(new Rectangle(155, 240, 80, 30));
+            bgM01Fired = new ButtonGroup();
+            bgM01Fired.add(rbM01Fired1);
+            bgM01Fired.add(rbM01FiredN);
+
+            ActionListener alM01Fired = new ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent e) {
+                    buoy.setSectored(rbM01FiredN.isSelected());
+                    cbM01Sector.setSelectedIndex(0);
+                    buoy.setSectorIndex(0);
+                    buoy.paintSign();
+                }
+            };
+            rbM01Fired1.addActionListener(alM01Fired);
+            rbM01FiredN.addActionListener(alM01Fired);
+
+            pM01SeaMap = new JPanel();
+            pM01SeaMap.setLayout(null);
+            pM01SeaMap.add(lM01Head, null);
+            pM01SeaMap.add(rbM01RegionA, null);
+            pM01SeaMap.add(rbM01RegionB, null);
+            pM01SeaMap.add(lM01Region, null);
+            pM01SeaMap.add(lM02Region, null);
+            pM01SeaMap.add(lM01Icon, null);
+            pM01SeaMap.add(lM02Icon, null);
+            pM01SeaMap.add(lM03Icon, null);
+            pM01SeaMap.add(lM04Icon, null);
+            pM01SeaMap.add(lM05Icon, null);
+            pM01SeaMap.add(getCbM01TypeOfMark(), null);
+            pM01SeaMap.add(lM01TypeOfMark, null);
+            pM01SeaMap.add(getCbM01CatOfMark(), null);
+            pM01SeaMap.add(lM01CatOfMark, null);
+            pM01SeaMap.add(getCbM01StyleOfMark(), null);
+            pM01SeaMap.add(lM01StyleOfMark, null);
+            pM01SeaMap.add(lM01Name, null);
+            pM01SeaMap.add(getTfM01Name(), null);
+            pM01SeaMap.add(lM01Props02, null);
+            pM01SeaMap.add(getCM01TopMark(), null);
+            pM01SeaMap.add(getCbM01TopMark(), null);
+            pM01SeaMap.add(getCM01Radar(), null);
+            pM01SeaMap.add(getCM01Racon(), null);
+            pM01SeaMap.add(getCbM01Racon(), null);
+            pM01SeaMap.add(getTfM01Racon(), null);
+            pM01SeaMap.add(lM01Racon, null);
+            pM01SeaMap.add(getCM01Fog(), null);
+            pM01SeaMap.add(getCbM01Fog(), null);
+            pM01SeaMap.add(getTfM01FogGroup(), null);
+            pM01SeaMap.add(lM01FogGroup, null);
+            pM01SeaMap.add(getTfM01FogPeriod(), null);
+            pM01SeaMap.add(lM01FogPeriod, null);
+            pM01SeaMap.add(getCM01Fired(), null);
+            pM01SeaMap.add(rbM01Fired1, null);
+            pM01SeaMap.add(rbM01FiredN, null);
+            pM01SeaMap.add(getTfM01RepeatTime(), null);
+            pM01SeaMap.add(lM01RepeatTime, null);
+            pM01SeaMap.add(getCbM01Kennung(), null);
+            pM01SeaMap.add(lM01Kennung, null);
+            pM01SeaMap.add(lM01Group, null);
+            pM01SeaMap.add(getTfM01Group(), null);
+            pM01SeaMap.add(lM01Sector, null);
+            pM01SeaMap.add(getCbM01Sector(), null);
+            pM01SeaMap.add(lM01Colour, null);
+            pM01SeaMap.add(getCbM01Colour(), null);
+            pM01SeaMap.add(lM01Bearing, null);
+            pM01SeaMap.add(getTfM01Bearing(), null);
+            pM01SeaMap.add(getTfM02Bearing(), null);
+            pM01SeaMap.add(getTfM01Radius(), null);
+            pM01SeaMap.add(lM01Height, null);
+            pM01SeaMap.add(getTfM01Height(), null);
+            pM01SeaMap.add(lM01Range, null);
+            pM01SeaMap.add(getTfM01Range(), null);
+            pM01SeaMap.add(lM01FireMark, null);
+            pM01SeaMap.add(getBM01Save(), null);
+            pM01SeaMap.add(getSM01StatusBar(), null);
+            pM01SeaMap.add(getBM01Close(), null);
+            pM01SeaMap.add(getCM01IconVisible(), null);
+        }
+        return pM01SeaMap;
+    }
+
+    private JComboBox getCbM01TypeOfMark() {
+
+        if (cbM01TypeOfMark == null) {
+
+            cbM01TypeOfMark = new JComboBox();
+
+            // Inhalt der ComboBox
+            cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.142")); //$NON-NLS-1$
+            cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.143")); //$NON-NLS-1$
+            cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.144")); //$NON-NLS-1$
+            cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.145")); //$NON-NLS-1$
+            cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.146")); //$NON-NLS-1$
+            cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.147")); //$NON-NLS-1$
+            cbM01TypeOfMark.addItem(Messages.getString("SmpDialogAction.148")); //$NON-NLS-1$
+
+            cbM01TypeOfMark.setBounds(new Rectangle(45, 25, 165, 25));
+            // cbM01TypeOfMark.setEditable(false);
+            cbM01TypeOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cbM01TypeOfMark.setEnabled(true);
+
+            cbM01TypeOfMark.addActionListener(new ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent e) {
+                    int type = cbM01TypeOfMark.getSelectedIndex();
+
+                    if (buoy == null) {
+                        buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$
+                        return;
+                    }
+
+                    Node n = buoy.getNode();
+                    if (n == null)
+                        return;
+
+                    paintlock = true;
+                    switch (type) {
+
+                    case SeaMark.UNKNOWN_TYPE:
+                        if (!(buoy instanceof BuoyUkn))
+                            buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$
+                        buoy.setBuoyIndex(type);
+                        break;
+
+                    case SeaMark.LATERAL:
+                        if (!(buoy instanceof BuoyLat)) {
+                            buoy = new BuoyLat(dia, n);
+                            buoy.setBuoyIndex(0);
+                        }
+                        break;
+
+                    case SeaMark.CARDINAL:
+                        if (!(buoy instanceof BuoyCard)) {
+                            buoy = new BuoyCard(dia, n);
+                            buoy.setBuoyIndex(0);
+                        }
+                        break;
+
+                    case SeaMark.SAFE_WATER:
+                        if (!(buoy instanceof BuoySaw)) {
+                            buoy = new BuoySaw(dia, n);
+                        }
+                        buoy.setBuoyIndex(type);
+                        break;
+
+                    case SeaMark.ISOLATED_DANGER:
+                        if (!(buoy instanceof BuoyIsol)) {
+                            buoy = new BuoyIsol(dia, n);
+                        }
+                        buoy.setBuoyIndex(type);
+                        break;
+
+                    case SeaMark.SPECIAL_PURPOSE:
+                        if (!(buoy instanceof BuoySpec)) {
+                            buoy = new BuoySpec(dia, n);
+                        }
+                        buoy.setBuoyIndex(type);
+                        break;
+
+                    case SeaMark.LIGHT:
+                        if (!(buoy instanceof BuoyNota)) {
+                            buoy = new BuoyNota(dia, n);
+                            buoy.setBuoyIndex(0);
+                        }
+                        break;
+                    }
+
+                    buoy.refreshStyles();
+                    buoy.refreshLights();
+                    buoy.setLightColour();
+                    paintlock = false;
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cbM01TypeOfMark;
+    }
+
+    private JComboBox getCbM01CatOfMark() {
+        if (cbM01CatOfMark == null) {
+            cbM01CatOfMark = new JComboBox();
+            cbM01CatOfMark.setBounds(new Rectangle(60, 55, 150, 25));
+            cbM01CatOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cbM01CatOfMark.setEnabled(true);
+
+            cbM01CatOfMark.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    int cat = cbM01CatOfMark.getSelectedIndex();
+
+                    if (buoy == null) {
+                        buoy = new BuoyUkn(dia, Messages.getString("SmpDialogAction.150")); //$NON-NLS-1$
+                        return;
+                    }
+
+                    Node n = buoy.getNode();
+                    if (n == null)
+                        return;
+
+                    if (cbM01TypeOfMark.getSelectedIndex() == SeaMark.LATERAL) {
+                        if (!(buoy instanceof BuoyLat))
+                            buoy = new BuoyLat(dia, n);
+                        buoy.setBuoyIndex(cat);
+                    }
+                    if (cbM01TypeOfMark.getSelectedIndex() == SeaMark.CARDINAL) {
+                        if (!(buoy instanceof BuoyCard))
+                            buoy = new BuoyCard(dia, n);
+                        buoy.setBuoyIndex(cat);
+                    }
+                    if (cbM01TypeOfMark.getSelectedIndex() == SeaMark.LIGHT) {
+                        if (!(buoy instanceof BuoyNota))
+                            buoy = new BuoyNota(dia, n);
+                        buoy.setBuoyIndex(cat);
+                    }
+
+                    buoy.refreshStyles();
+                    buoy.refreshLights();
+                    buoy.setLightColour();
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cbM01CatOfMark;
+    }
+
+    private JComboBox getCbM01StyleOfMark() {
+        if (cbM01StyleOfMark == null) {
+            cbM01StyleOfMark = new JComboBox();
+            cbM01StyleOfMark.setBounds(new Rectangle(45, 85, 165, 25));
+            cbM01StyleOfMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cbM01StyleOfMark.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    int style = cbM01StyleOfMark.getSelectedIndex();
+                    if (buoy != null && style != buoy.getStyleIndex()) {
+                        buoy.setStyleIndex(style);
+                        buoy.paintSign();
+                    }
+                }
+            });
+        }
+        return cbM01StyleOfMark;
+    }
+
+    private JTextField getTfM01Name() {
+        if (tfM01Name == null) {
+            tfM01Name = new JTextField();
+            tfM01Name.setBounds(new Rectangle(50, 120, 150, 20));
+            tfM01Name.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    buoy.setName(tfM01Name.getText());
+                }
+            });
+        }
+        return tfM01Name;
+    }
+
+    private JCheckBox getCM01TopMark() {
+        if (cM01TopMark == null) {
+            cM01TopMark = new JCheckBox();
+            cM01TopMark.setBounds(new Rectangle(10, 170, 100, 20));
+            cM01TopMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cM01TopMark.setText(Messages.getString("SmpDialogAction.166")); //$NON-NLS-1$
+            cM01TopMark.addItemListener(new ItemListener() {
+                public void itemStateChanged(ItemEvent e) {
+                    if (buoy == null) {
+                        return;
+                    }
+                    buoy.setTopMark(cM01TopMark.isSelected());
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cM01TopMark;
+    }
+
+    private JComboBox getCbM01TopMark() {
+        if (cbM01TopMark == null) {
+            cbM01TopMark = new JComboBox();
+            cbM01TopMark.setBounds(new Rectangle(110, 170, 80, 20));
+            cbM01TopMark.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cbM01TopMark.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    int top = cbM01TopMark.getSelectedIndex();
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cbM01TopMark;
+    }
+
+    private JCheckBox getCM01Radar() {
+        if (cM01Radar == null) {
+            cM01Radar = new JCheckBox();
+            cM01Radar.setBounds(new Rectangle(10, 195, 120, 20));
+            cM01Radar.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cM01Radar.setText(Messages.getString("SmpDialogAction.169")); //$NON-NLS-1$
+            cM01Radar.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    if (cM01Radar.isSelected()) {
+                        buoy.setRadar(true);
+                        buoy.setRacon(false);
+                        cM01Racon.setSelected(false);
+                    } else {
+                        buoy.setRadar(false);
+                    }
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cM01Radar;
+    }
+
+    private JCheckBox getCM01Racon() {
+        if (cM01Racon == null) {
+            cM01Racon = new JCheckBox();
+            cM01Racon.setBounds(new Rectangle(130, 195, 110, 20));
+            cM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cM01Racon.setText(Messages.getString("SmpDialogAction.171")); //$NON-NLS-1$
+            cM01Racon.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    if (cM01Racon.isSelected()) {
+                        buoy.setRacon(true);
+                        buoy.setRadar(false);
+                        cM01Radar.setSelected(false);
+                    } else {
+                        buoy.setRacon(false);
+                    }
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cM01Racon;
+    }
+
+    private JComboBox getCbM01Racon() {
+        if (cbM01Racon == null) {
+            cbM01Racon = new JComboBox();
+            cbM01Racon.setBounds(new Rectangle(240, 195, 80, 20));
+            cbM01Racon.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cbM01Racon.removeAllItems();
+            cbM01Racon.addItem("Any");
+            cbM01Racon.addItem("Racon");
+            cbM01Racon.addItem("Ramark");
+            cbM01Racon.addItem("Leading");
+            cbM01Racon.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    int rac = cbM01Racon.getSelectedIndex();
+                    buoy.setRaType(rac);
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cbM01Racon;
+    }
+
+    private JTextField getTfM01Racon() {
+        if (tfM01Racon == null) {
+            tfM01Racon = new JTextField();
+            tfM01Racon.setBounds(new Rectangle(345, 195, 30, 20));
+            tfM01Racon.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    buoy.setRaconGroup(tfM01Racon.getText().trim());
+                }
+            });
+        }
+        return tfM01Racon;
+    }
+
+    private JCheckBox getCM01Fog() {
+        if (cM01Fog == null) {
+            cM01Fog = new JCheckBox();
+            cM01Fog.setBounds(new Rectangle(10, 220, 90, 20));
+            cM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cM01Fog.setText(Messages.getString("SmpDialogAction.174")); //$NON-NLS-1$
+            cM01Fog.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    buoy.setFog(cM01Fog.isSelected());
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cM01Fog;
+    }
+
+    private JComboBox getCbM01Fog() {
+        if (cbM01Fog == null) {
+            cbM01Fog = new JComboBox();
+            cbM01Fog.setBounds(new Rectangle(100, 220, 70, 20));
+            cbM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cbM01Fog.removeAllItems();
+            cbM01Fog.addItem("Any");
+            cbM01Fog.addItem("Horn");
+            cbM01Fog.addItem("Siren");
+            cbM01Fog.addItem("Dia");
+            cbM01Fog.addItem("Bell");
+            cbM01Fog.addItem("Whis");
+            cbM01Fog.addItem("Gong");
+            cbM01Fog.addItem("Explos");
+            cbM01Fog.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    if (cbM01Fog.getSelectedIndex() > 0)
+                        buoy.setFogSound(cbM01Fog.getSelectedIndex());
+                    else
+                        buoy.setFogSound(0);
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cbM01Fog;
+    }
+
+    private JTextField getTfM01FogGroup() {
+        if (tfM01FogGroup == null) {
+            tfM01FogGroup = new JTextField();
+            tfM01FogGroup.setBounds(new Rectangle(243, 220, 30, 20));
+            tfM01FogGroup.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    buoy.setFogGroup(tfM01FogGroup.getText().trim());
+                }
+            });
+        }
+        return tfM01FogGroup;
+    }
+
+    private JTextField getTfM01FogPeriod() {
+        if (tfM01FogPeriod == null) {
+            tfM01FogPeriod = new JTextField();
+            tfM01FogPeriod.setBounds(new Rectangle(345, 220, 30, 20));
+            tfM01FogPeriod.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    buoy.setFogPeriod(tfM01FogPeriod.getText().trim());
+                }
+            });
+        }
+        return tfM01FogPeriod;
+    }
+
+    private JCheckBox getCM01Fired() {
+        if (cM01Fired == null) {
+            cM01Fired = new JCheckBox();
+            cM01Fired.setBounds(new Rectangle(10, 245, 75, 20));
+            cM01Fired.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cM01Fired.setText(Messages.getString("SmpDialogAction.177")); //$NON-NLS-1$
+            cM01Fired.addItemListener(new ItemListener() {
+                public void itemStateChanged(ItemEvent e) {
+                    if (buoy == null) {
+                        return;
+                    }
+                    buoy.setFired(cM01Fired.isSelected());
+                    buoy.setLightColour();
+                    buoy.paintSign();
+                }
+            });
+        }
+
+        return cM01Fired;
+    }
+
+    private JComboBox getCbM01Kennung() {
+        if (cbM01Kennung == null) {
+            cbM01Kennung = new JComboBox();
+            cbM01Kennung.setBounds(new Rectangle(305, 245, 70, 20));
+            cbM01Kennung.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    int i1, i2;
+                    String c = ""; //$NON-NLS-1$ //$NON-NLS-2$
+                    String it = (String) cbM01Kennung.getSelectedItem();
+
+                    if (it == null)
+                        return;
+                    if (it.equals(Messages.getString("SmpDialogAction.212"))) //$NON-NLS-1$
+                        return;
+                    if (buoy == null)
+                        return;
+
+                    if (it.contains("(")) {
+                        i1 = it.indexOf("(");
+                        i2 = it.indexOf(")");
+                        c = it.substring(i1+1, i2);
+                        it = it.substring(0, i1) + it.substring(i2+1);
+                    }
+                    if (!c.isEmpty())
+                        buoy.setLightGroup(c);;
+                    buoy.setLightChar(it);
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cbM01Kennung;
+    }
+
+    private JTextField getTfM01Height() {
+        if (tfM01Height == null) {
+            tfM01Height = new JTextField();
+            tfM01Height.setBounds(new Rectangle(54, 270, 30, 20));
+            tfM01Height.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    buoy.setHeight(tfM01Height.getText().trim());
+                }
+            });
+        }
+        return tfM01Height;
+    }
+
+    private JTextField getTfM01Range() {
+        if (tfM01Range == null) {
+            tfM01Range = new JTextField();
+            tfM01Range.setBounds(new Rectangle(151, 270, 30, 20));
+            tfM01Range.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    buoy.setRange(tfM01Range.getText().trim());
+                }
+            });
+        }
+        return tfM01Range;
+    }
+
+    private JTextField getTfM01Group() {
+        if (tfM01Group == null) {
+            tfM01Group = new JTextField();
+            tfM01Group.setBounds(new Rectangle(255, 270, 30, 20));
+            tfM01Group.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    buoy.setLightGroup(tfM01Group.getText().trim());
+                    buoy.paintSign();
+                }
+            });
+        }
+        return tfM01Group;
+    }
+
+    private JTextField getTfM01RepeatTime() {
+        if (tfM01RepeatTime == null) {
+            tfM01RepeatTime = new JTextField();
+            tfM01RepeatTime.setBounds(new Rectangle(345, 270, 30, 20));
+            tfM01RepeatTime.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    buoy.setLightPeriod(tfM01RepeatTime.getText().trim());
+                    buoy.paintSign();
+                }
+            });
+
+            tfM01RepeatTime.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    buoy.setLightPeriod(tfM01RepeatTime.getText().trim());
+                    buoy.paintSign();
+                }
+            });
+        }
+        return tfM01RepeatTime;
+    }
+
+    private JComboBox getCbM01Colour() {
+        if (cbM01Colour == null) {
+            cbM01Colour = new JComboBox();
+            cbM01Colour.setBounds(new Rectangle(165, 295, 40, 20));
+            cbM01Colour.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cbM01Colour.addItem(""); //$NON-NLS-1$
+            cbM01Colour.addItem(Messages.getString("SmpDialogAction.190")); //$NON-NLS-1$
+            cbM01Colour.addItem(Messages.getString("SmpDialogAction.191")); //$NON-NLS-1$
+            cbM01Colour.addItem(Messages.getString("SmpDialogAction.192")); //$NON-NLS-1$
+            cbM01Colour.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    buoy.setLightColour((String)cbM01Colour.getSelectedItem());
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cbM01Colour;
+    }
+
+    private JComboBox getCbM01Sector() {
+        if (cbM01Sector == null) {
+            cbM01Sector = new JComboBox();
+            cbM01Sector.setBounds(new Rectangle(55, 295, 50, 20));
+            cbM01Sector.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
+            cbM01Sector.addItem(Messages.getString("SmpDialogAction.194")); //$NON-NLS-1$
+            cbM01Sector.addItem(Messages.getString("SmpDialogAction.195")); //$NON-NLS-1$
+            cbM01Sector.addItem(Messages.getString("SmpDialogAction.196")); //$NON-NLS-1$
+            cbM01Sector.addItem(Messages.getString("SmpDialogAction.197")); //$NON-NLS-1$
+            cbM01Sector.addItem(Messages.getString("SmpDialogAction.198")); //$NON-NLS-1$
+            cbM01Sector.addItem(Messages.getString("SmpDialogAction.199")); //$NON-NLS-1$
+            cbM01Sector.addItem(Messages.getString("SmpDialogAction.200")); //$NON-NLS-1$
+            cbM01Sector.addItem(Messages.getString("SmpDialogAction.201")); //$NON-NLS-1$
+            cbM01Sector.addItem(Messages.getString("SmpDialogAction.202")); //$NON-NLS-1$
+            cbM01Sector.addItem(Messages.getString("SmpDialogAction.203")); //$NON-NLS-1$
+            cbM01Sector.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    buoy.setSectorIndex(cbM01Sector.getSelectedIndex());
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cbM01Sector;
+    }
+
+    private JTextField getTfM01Bearing() {
+        if (tfM01Bearing == null) {
+            tfM01Bearing = new JTextField();
+            tfM01Bearing.setBounds(new Rectangle(255, 295, 30, 20));
+            tfM01Bearing.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    buoy.setBearing1(tfM01Bearing.getText().trim());
+                }
+            });
+        }
+        return tfM01Bearing;
+    }
+
+    private JTextField getTfM02Bearing() {
+        if (tfM02Bearing == null) {
+            tfM02Bearing = new JTextField();
+            tfM02Bearing.setBounds(new Rectangle(300, 295, 30, 20));
+            tfM02Bearing.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    buoy.setBearing2(tfM02Bearing.getText().trim());
+                }
+            });
+        }
+        return tfM02Bearing;
+    }
+
+    private JTextField getTfM01Radius() {
+        if (tfM01Radius == null) {
+            tfM01Radius = new JTextField();
+            tfM01Radius.setBounds(new Rectangle(355, 295, 30, 20));
+            tfM01Radius.addFocusListener(new FocusAdapter() {
+                public void focusLost(FocusEvent e) {
+                    buoy.setRadius(tfM01Radius.getText().trim());
+                }
+            });
+        }
+        return tfM01Radius;
+    }
+
+    private JButton getBM01Close() {
+        if (bM01Close == null) {
+            bM01Close = new JButton();
+            bM01Close.setBounds(new Rectangle(20, 325, 110, 20));
+            bM01Close.setText(tr("Close"));
+            bM01Close.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    // aufraeumen
+                    if (obuoy != null)
+                        PicRebuild();
+                    // Deaktivierung des Listeners
+                    DataSet.removeSelectionListener(SmpListener);
+                    Selection = null;
+                    SmpItem.setEnabled(true);
+                    onode = null;
+
+                    dM01SeaMap.dispose();
+                }
+            });
+        }
+
+        return bM01Close;
+    }
+
+    private JButton getBM01Save() {
+        if (bM01Save == null) {
+            bM01Save = new JButton();
+            bM01Save.setBounds(new Rectangle(150, 325, 110, 20));
+            bM01Save.setText(tr("Save"));
+            bM01Save.setEnabled(false);
+
+            bM01Save.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    cM01IconVisible.setIcon(new ImageIcon(getClass().getResource(
+                            "/images/Auge.png"))); //$NON-NLS-1$
+                    cM01IconVisible.setSelected(true);
+
+                    buoy.saveSign();
+                }
+            });
+        }
+
+        return bM01Save;
+    }
+
+    private JCheckBox getCM01IconVisible() {
+        if (cM01IconVisible == null) {
+            cM01IconVisible = new JCheckBox();
+            cM01IconVisible.setBounds(new Rectangle(310, 325, 30, 21));
+            cM01IconVisible.setIcon(new ImageIcon(getClass().getResource(
+                    "/images/AugeN.png"))); //$NON-NLS-1$
+            cM01IconVisible.setSelected(false);
+            cM01IconVisible.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    Command c;
+                    Node n = null;
+                    DataSet ds = Main.main.getCurrentDataSet();
+
+                    if (buoy != null)
+                        n = buoy.getNode();
+
+                    if (cM01IconVisible.isSelected()) {
+                        cM01IconVisible.setIcon(new ImageIcon(getClass().getResource(
+                                "/images/AugeN.png"))); //$NON-NLS-1$
+                        if (n != null) {
+                            // seamark loeschen, wenn notwendig
+                            if (n.getKeys().containsKey("seamark")) { //$NON-NLS-1$
+                                smb = n.getKeys().get("seamark"); // smb merken //$NON-NLS-1$
+
+                                c = new ChangePropertyCommand(n, "seamark", null); //$NON-NLS-1$
+                                c.executeCommand();
+                                ds.fireSelectionChanged();
+                                obuoy = buoy;
+                            }
+
+                            // seamark:type loeschen, wenn notwendig
+                            if (n.getKeys().containsKey("seamark:type")) { //$NON-NLS-1$
+                                smt = n.getKeys().get("seamark:type"); // smt merken //$NON-NLS-1$
+
+                                c = new ChangePropertyCommand(n, "seamark:type", null); //$NON-NLS-1$
+                                c.executeCommand();
+                                ds.fireSelectionChanged();
+                                obuoy = buoy;
+                            }
+
+                        }
+                    } else {
+                        cM01IconVisible.setIcon(new ImageIcon(getClass().getResource(
+                                "/images/Auge.png"))); //$NON-NLS-1$
+                        PicRebuild();
+                        obuoy = null;
+                    }
+                    buoy.paintSign();
+                }
+            });
+        }
+        return cM01IconVisible;
+    }
+
+    private JTextField getSM01StatusBar() {
+        if (sM01StatusBar == null) {
+            sM01StatusBar = new JTextField();
+            sM01StatusBar.setBounds(new Rectangle(7, 355, 385, 20));
+            sM01StatusBar.setBackground(SystemColor.activeCaptionBorder);
+        }
+        return sM01StatusBar;
+    }
 
 }
Index: /applications/editors/josm/plugins/toms/src/toms/plug/PluginApp.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/plug/PluginApp.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/plug/PluginApp.java	(revision 23193)
@@ -13,36 +13,36 @@
 
 public class PluginApp implements Runnable {
-	
-	public static void runPlugins() throws IOException {
-		String pluginDirName = Main.pref.getPluginsDirectory().getAbsolutePath();
 
-//!!		List<Pluggable> plugins = PluginLoader.loadPlugins(new File(pluginDirName + "/tplug"));
+    public static void runPlugins() throws IOException {
+        String pluginDirName = Main.pref.getPluginsDirectory().getAbsolutePath();
 
-//!!		if(plugins == null) return;
-		
-//!!		PluginManager manager = new PluginManagerImpl();
-		
-//!!		for(Pluggable p : plugins) p.setPluginManager(manager);
-//!!		for(Pluggable p : plugins) p.start();
-		
-		// wait
-		try {
-			Thread.sleep(10000);
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-		}
-		
-//!!		for(Pluggable p: plugins) p.stop();
-	}
+//!!        List<Pluggable> plugins = PluginLoader.loadPlugins(new File(pluginDirName + "/tplug"));
 
-	@Override
-	public void run() {
-		try {
-			runPlugins();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		
-	}
+//!!        if(plugins == null) return;
+
+//!!        PluginManager manager = new PluginManagerImpl();
+
+//!!        for(Pluggable p : plugins) p.setPluginManager(manager);
+//!!        for(Pluggable p : plugins) p.start();
+
+        // wait
+        try {
+            Thread.sleep(10000);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+
+//!!        for(Pluggable p: plugins) p.stop();
+    }
+
+    @Override
+    public void run() {
+        try {
+            runPlugins();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
 
 }
Index: /applications/editors/josm/plugins/toms/src/toms/plug/ifc/Pluggable.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/plug/ifc/Pluggable.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/plug/ifc/Pluggable.java	(revision 23193)
@@ -3,7 +3,7 @@
 public interface Pluggable {
 
-	boolean start();
-	boolean stop();
-	
-	void setPluginManager(PluginManager manager);
+    boolean start();
+    boolean stop();
+
+    void setPluginManager(PluginManager manager);
 }
Index: /applications/editors/josm/plugins/toms/src/toms/plug/ifc/PluginManager.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/plug/ifc/PluginManager.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/plug/ifc/PluginManager.java	(revision 23193)
@@ -2,4 +2,4 @@
 
 public interface PluginManager {
-	void showVisualMessage(String message);
+    void showVisualMessage(String message);
 }
Index: /applications/editors/josm/plugins/toms/src/toms/plug/util/PluginLoader.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/plug/util/PluginLoader.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/plug/util/PluginLoader.java	(revision 23193)
@@ -19,88 +19,88 @@
 public class PluginLoader {
 
-//!!	public static List<Pluggable> loadPlugins(File plugDir) throws IOException {
-//!!		File[] plugJars = plugDir.listFiles(new JARFileFilter());
-//!!		ClassLoader cl = new URLClassLoader(PluginLoader.fileArrayToURLArray(plugJars));
-		
-//!!		if(cl == null) return null;
-		
-//!!		List<Class<Pluggable>> plugClasses = PluginLoader.extractClassesFromJARs(plugJars, cl);
-		
-//!!		return PluginLoader.createPluggableObjects(plugClasses);
-//!!	}
+//!!    public static List<Pluggable> loadPlugins(File plugDir) throws IOException {
+//!!        File[] plugJars = plugDir.listFiles(new JARFileFilter());
+//!!        ClassLoader cl = new URLClassLoader(PluginLoader.fileArrayToURLArray(plugJars));
 
-	private static List<Pluggable> createPluggableObjects(List<Class<Pluggable>> pluggables) {
-		List<Pluggable> plugs = new ArrayList<Pluggable>(pluggables.size());
-		for(Class<Pluggable> plug : pluggables) {
-			try {
-				plugs.add(plug.newInstance());
-			} catch (InstantiationException e) {
-				System.err.println("Can't instantiate plugin: " + plug.getName());
-				e.printStackTrace();
-			} catch (IllegalAccessException e) {
-				System.err.println("IllegalAccess for plugin: " + plug.getName());
-				e.printStackTrace();
-			}
-		}
-		
-		return plugs;
+//!!        if(cl == null) return null;
 
-	}
+//!!        List<Class<Pluggable>> plugClasses = PluginLoader.extractClassesFromJARs(plugJars, cl);
 
-	private static List<Class<Pluggable>> extractClassesFromJARs(	File[] jars, ClassLoader cl) throws FileNotFoundException, IOException {
-		List<Class<Pluggable>> classes = new ArrayList<Class<Pluggable>>();
-		
-		for(File jar : jars) {
-			classes.addAll(PluginLoader.extractClassesFromJAR(jar, cl));
-		}
+//!!        return PluginLoader.createPluggableObjects(plugClasses);
+//!!    }
 
-		return classes;
-	}
+    private static List<Pluggable> createPluggableObjects(List<Class<Pluggable>> pluggables) {
+        List<Pluggable> plugs = new ArrayList<Pluggable>(pluggables.size());
+        for(Class<Pluggable> plug : pluggables) {
+            try {
+                plugs.add(plug.newInstance());
+            } catch (InstantiationException e) {
+                System.err.println("Can't instantiate plugin: " + plug.getName());
+                e.printStackTrace();
+            } catch (IllegalAccessException e) {
+                System.err.println("IllegalAccess for plugin: " + plug.getName());
+                e.printStackTrace();
+            }
+        }
 
-	@SuppressWarnings("unchecked")
-	private static Collection<? extends Class<Pluggable>> extractClassesFromJAR(File jar, ClassLoader cl) throws FileNotFoundException, IOException {
-		List<Class<Pluggable>> classes = new ArrayList<Class<Pluggable>>();
-		JarInputStream jaris = new JarInputStream(new FileInputStream(jar));
-		JarEntry ent = null;
-		
-		while ((ent = jaris.getNextJarEntry()) != null) {
-			String entName = ent.getName(); //.toLowerCase();
-			
-			if (entName.endsWith(".class")) {
-				try {
-					Class<?> cls = cl.loadClass(entName.substring(0, entName.length()- 6).replace('/', '.'));
-					if (PluginLoader.isPluggableClass(cls)) classes.add((Class<Pluggable>) cls);
-				} catch (ClassNotFoundException e) {
-					System.err.println("Can't load Class" + entName);
-					e.printStackTrace();
-				}
-			}
-		}
-		
-		jaris.close();
-		
-		return classes;
-	}
+        return plugs;
 
-	private static boolean isPluggableClass(Class<?> cls) {
-		for (Class<?> i: cls.getInterfaces()) {
-			if (i.equals(Pluggable.class)) return true;
-		}
-		
-		return false;
+    }
 
-	}
+    private static List<Class<Pluggable>> extractClassesFromJARs(   File[] jars, ClassLoader cl) throws FileNotFoundException, IOException {
+        List<Class<Pluggable>> classes = new ArrayList<Class<Pluggable>>();
 
-	private static URL[] fileArrayToURLArray(File[] files) throws MalformedURLException {
-		URL[] urls = new URL[files.length];
-		
-		if(urls == null) return null;
-		
-		for(int i = 0; i < files.length; i++) {
-			urls[i] = files[i].toURI().toURL();
-		}
-		
-		return urls;
-	}
+        for(File jar : jars) {
+            classes.addAll(PluginLoader.extractClassesFromJAR(jar, cl));
+        }
+
+        return classes;
+    }
+
+    @SuppressWarnings("unchecked")
+    private static Collection<? extends Class<Pluggable>> extractClassesFromJAR(File jar, ClassLoader cl) throws FileNotFoundException, IOException {
+        List<Class<Pluggable>> classes = new ArrayList<Class<Pluggable>>();
+        JarInputStream jaris = new JarInputStream(new FileInputStream(jar));
+        JarEntry ent = null;
+
+        while ((ent = jaris.getNextJarEntry()) != null) {
+            String entName = ent.getName(); //.toLowerCase();
+
+            if (entName.endsWith(".class")) {
+                try {
+                    Class<?> cls = cl.loadClass(entName.substring(0, entName.length()- 6).replace('/', '.'));
+                    if (PluginLoader.isPluggableClass(cls)) classes.add((Class<Pluggable>) cls);
+                } catch (ClassNotFoundException e) {
+                    System.err.println("Can't load Class" + entName);
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        jaris.close();
+
+        return classes;
+    }
+
+    private static boolean isPluggableClass(Class<?> cls) {
+        for (Class<?> i: cls.getInterfaces()) {
+            if (i.equals(Pluggable.class)) return true;
+        }
+
+        return false;
+
+    }
+
+    private static URL[] fileArrayToURLArray(File[] files) throws MalformedURLException {
+        URL[] urls = new URL[files.length];
+
+        if(urls == null) return null;
+
+        for(int i = 0; i < files.length; i++) {
+            urls[i] = files[i].toURI().toURL();
+        }
+
+        return urls;
+    }
 
 }
Index: /applications/editors/josm/plugins/toms/src/toms/seamarks/SeaMark.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/seamarks/SeaMark.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/seamarks/SeaMark.java	(revision 23193)
@@ -14,191 +14,191 @@
 abstract public class SeaMark {
 
-	/**
-	 * CONSTANTS
-	 */
-
-	/**
-	 * Colours
-	 */
-
-	public final static int UNKNOWN_COLOUR = 0;
-	public final static int RED = 1;
-	public final static int GREEN = 2;
-	public final static int RED_GREEN_RED = 3;
-	public final static int GREEN_RED_GREEN = 4;
-	public final static int RED_WHITE = 5;
-	public final static int BLACK_YELLOW = 6;
-	public final static int BLACK_YELLOW_BLACK = 7;
-	public final static int YELLOW_BLACK = 8;
-	public final static int YELLOW_BLACK_YELLOW = 9;
-	public final static int BLACK_RED_BLACK = 10;
-	public final static int YELLOW = 11;
-	public final static int WHITE_LIGHT = 1;
-	public final static int RED_LIGHT = 2;
-	public final static int GREEN_LIGHT = 3;
-
-	/**
-	 * Types - correspond to TypeIndex
-	 */
-	public final static int UNKNOWN_TYPE = 0;
-	public final static int LATERAL = 1;
-	public final static int CARDINAL = 2;
-	public final static int SAFE_WATER = 3;
-	public final static int ISOLATED_DANGER = 4;
-	public final static int SPECIAL_PURPOSE = 5;
-	public final static int LIGHT = 6;
-
-	/**
-	 * Categories - correspond to CatIndex
-	 */
-	public final static int UNKNOWN_CAT = 0;
-	public final static int PORT_HAND = 1;
-	public final static int STARBOARD_HAND = 2;
-	public final static int PREF_PORT_HAND = 3;
-	public final static int PREF_STARBOARD_HAND = 4;
-	public final static int CARD_NORTH = 1;
-	public final static int CARD_EAST = 2;
-	public final static int CARD_SOUTH = 3;
-	public final static int CARD_WEST = 4;
-	public final static int LIGHT_HOUSE = 1;
-	public final static int LIGHT_MAJOR = 2;
-	public final static int LIGHT_MINOR = 3;
-	public final static int LIGHT_VESSEL = 4;
-
-	/**
-	 * Regions
-	 */
-	public final static boolean IALA_A = false;
-	public final static boolean IALA_B = true;
-
-	/**
-	 * Shapes - correspond to StyleIndex
-	 */
-	public final static int UNKNOWN_SHAPE = 0;
-	public final static int LAT_CAN = 1;
-	public final static int LAT_CONE = 1;
-	public final static int LAT_PILLAR = 2;
-	public final static int LAT_SPAR = 3;
-	public final static int LAT_BEACON = 4;
-	public final static int LAT_TOWER = 5;
-	public final static int LAT_FLOAT = 6;
-	public final static int LAT_PERCH = 7;
-	public final static int CARD_PILLAR = 1;
-	public final static int CARD_SPAR = 2;
-	public final static int CARD_BEACON = 3;
-	public final static int CARD_TOWER = 4;
-	public final static int CARD_FLOAT = 5;
-	public final static int SAFE_PILLAR = 1;
-	public final static int SAFE_SPAR = 2;
-	public final static int SAFE_SPHERE = 3;
-	public final static int SAFE_BEACON = 4;
-	public final static int SAFE_FLOAT = 5;
-	public final static int ISOL_PILLAR = 1;
-	public final static int ISOL_SPAR = 2;
-	public final static int ISOL_BEACON = 3;
-	public final static int ISOL_TOWER = 4;
-	public final static int ISOL_FLOAT = 5;
-	public final static int SPEC_PILLAR = 1;
-	public final static int SPEC_CAN = 2;
-	public final static int SPEC_CONE = 3;
-	public final static int SPEC_SPAR = 4;
-	public final static int SPEC_BEACON = 5;
-	public final static int SPEC_TOWER = 6;
-	public final static int SPEC_FLOAT = 7;
-	public final static int SPEC_SPHERE = 8;
-	public final static int SPEC_BARREL = 9;
-	
-	/**
-	 * Radar Beacons - correspond to Ratyp Index
-	 */
-	
-	public final static int UNKNOWN_RATYPE = 0;
-	public final static int RATYPE_RACON = 1;
-	public final static int RATYPE_RAMARK = 2;
-	public final static int RATYPE_LEADING = 3;
-
-	/**
-	 * Fog Signals - correspond to FogSound Index
-	 */
-	
-	public final static int UNKNOWN_FOG = 0;
-	public final static int FOG_HORN = 1;
-	public final static int FOG_SIREN = 2;
-	public final static int FOG_DIA = 3;
-	public final static int FOG_BELL = 4;
-	public final static int FOG_WHIS = 5;
-	public final static int FOG_GONG = 6;
-	public final static int FOG_EXPLOS = 7;
-
-	/**
-	 * Variables
-	 */
-
-	/**
-	 * private Variablen
-	 */
-
-	public abstract void paintSign();
-
-	public abstract void saveSign();
-
-	private int Colour = UNKNOWN_COLOUR;
-
-	public int getColour() {
-		return Colour;
-	}
-
-	public void setColour(int colour) {
-		if (colour < UNKNOWN_COLOUR || colour > RED_WHITE) {
-			return;
-		}
-		Colour = colour;
-
-	}
-
-	private String ErrMsg = null;
-
-	public String getErrMsg() {
-		return ErrMsg;
-	}
-
-	public void setErrMsg(String errMsg) {
-		ErrMsg = errMsg;
-	}
-
-	private String Name;
-
-	public String getName() {
-		return Name;
-	}
-
-	public void setName(String name) {
-		Name = name;
-	}
-
-	private boolean valid = true;
-
-	public boolean isValid() {
-		return valid;
-	}
-
-	public void setValid(boolean valid) {
-		this.valid = valid;
-
-	}
-
-	protected void delSeaMarkKeys(Node node) {
-		Iterator<String> it = node.getKeys().keySet().iterator();
-		String str;
-
-		while (it.hasNext()) {
-			str = it.next();
-
-			if (str.contains("seamark") == true)
-				if (str.compareTo("seamark") != 0) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node, str, null));
-				}
-		}
-	}
+    /**
+     * CONSTANTS
+     */
+
+    /**
+     * Colours
+     */
+
+    public final static int UNKNOWN_COLOUR = 0;
+    public final static int RED = 1;
+    public final static int GREEN = 2;
+    public final static int RED_GREEN_RED = 3;
+    public final static int GREEN_RED_GREEN = 4;
+    public final static int RED_WHITE = 5;
+    public final static int BLACK_YELLOW = 6;
+    public final static int BLACK_YELLOW_BLACK = 7;
+    public final static int YELLOW_BLACK = 8;
+    public final static int YELLOW_BLACK_YELLOW = 9;
+    public final static int BLACK_RED_BLACK = 10;
+    public final static int YELLOW = 11;
+    public final static int WHITE_LIGHT = 1;
+    public final static int RED_LIGHT = 2;
+    public final static int GREEN_LIGHT = 3;
+
+    /**
+     * Types - correspond to TypeIndex
+     */
+    public final static int UNKNOWN_TYPE = 0;
+    public final static int LATERAL = 1;
+    public final static int CARDINAL = 2;
+    public final static int SAFE_WATER = 3;
+    public final static int ISOLATED_DANGER = 4;
+    public final static int SPECIAL_PURPOSE = 5;
+    public final static int LIGHT = 6;
+
+    /**
+     * Categories - correspond to CatIndex
+     */
+    public final static int UNKNOWN_CAT = 0;
+    public final static int PORT_HAND = 1;
+    public final static int STARBOARD_HAND = 2;
+    public final static int PREF_PORT_HAND = 3;
+    public final static int PREF_STARBOARD_HAND = 4;
+    public final static int CARD_NORTH = 1;
+    public final static int CARD_EAST = 2;
+    public final static int CARD_SOUTH = 3;
+    public final static int CARD_WEST = 4;
+    public final static int LIGHT_HOUSE = 1;
+    public final static int LIGHT_MAJOR = 2;
+    public final static int LIGHT_MINOR = 3;
+    public final static int LIGHT_VESSEL = 4;
+
+    /**
+     * Regions
+     */
+    public final static boolean IALA_A = false;
+    public final static boolean IALA_B = true;
+
+    /**
+     * Shapes - correspond to StyleIndex
+     */
+    public final static int UNKNOWN_SHAPE = 0;
+    public final static int LAT_CAN = 1;
+    public final static int LAT_CONE = 1;
+    public final static int LAT_PILLAR = 2;
+    public final static int LAT_SPAR = 3;
+    public final static int LAT_BEACON = 4;
+    public final static int LAT_TOWER = 5;
+    public final static int LAT_FLOAT = 6;
+    public final static int LAT_PERCH = 7;
+    public final static int CARD_PILLAR = 1;
+    public final static int CARD_SPAR = 2;
+    public final static int CARD_BEACON = 3;
+    public final static int CARD_TOWER = 4;
+    public final static int CARD_FLOAT = 5;
+    public final static int SAFE_PILLAR = 1;
+    public final static int SAFE_SPAR = 2;
+    public final static int SAFE_SPHERE = 3;
+    public final static int SAFE_BEACON = 4;
+    public final static int SAFE_FLOAT = 5;
+    public final static int ISOL_PILLAR = 1;
+    public final static int ISOL_SPAR = 2;
+    public final static int ISOL_BEACON = 3;
+    public final static int ISOL_TOWER = 4;
+    public final static int ISOL_FLOAT = 5;
+    public final static int SPEC_PILLAR = 1;
+    public final static int SPEC_CAN = 2;
+    public final static int SPEC_CONE = 3;
+    public final static int SPEC_SPAR = 4;
+    public final static int SPEC_BEACON = 5;
+    public final static int SPEC_TOWER = 6;
+    public final static int SPEC_FLOAT = 7;
+    public final static int SPEC_SPHERE = 8;
+    public final static int SPEC_BARREL = 9;
+    
+    /**
+     * Radar Beacons - correspond to Ratyp Index
+     */
+    
+    public final static int UNKNOWN_RATYPE = 0;
+    public final static int RATYPE_RACON = 1;
+    public final static int RATYPE_RAMARK = 2;
+    public final static int RATYPE_LEADING = 3;
+
+    /**
+     * Fog Signals - correspond to FogSound Index
+     */
+    
+    public final static int UNKNOWN_FOG = 0;
+    public final static int FOG_HORN = 1;
+    public final static int FOG_SIREN = 2;
+    public final static int FOG_DIA = 3;
+    public final static int FOG_BELL = 4;
+    public final static int FOG_WHIS = 5;
+    public final static int FOG_GONG = 6;
+    public final static int FOG_EXPLOS = 7;
+
+    /**
+     * Variables
+     */
+
+    /**
+     * private Variablen
+     */
+
+    public abstract void paintSign();
+
+    public abstract void saveSign();
+
+    private int Colour = UNKNOWN_COLOUR;
+
+    public int getColour() {
+        return Colour;
+    }
+
+    public void setColour(int colour) {
+        if (colour < UNKNOWN_COLOUR || colour > RED_WHITE) {
+            return;
+        }
+        Colour = colour;
+
+    }
+
+    private String ErrMsg = null;
+
+    public String getErrMsg() {
+        return ErrMsg;
+    }
+
+    public void setErrMsg(String errMsg) {
+        ErrMsg = errMsg;
+    }
+
+    private String Name;
+
+    public String getName() {
+        return Name;
+    }
+
+    public void setName(String name) {
+        Name = name;
+    }
+
+    private boolean valid = true;
+
+    public boolean isValid() {
+        return valid;
+    }
+
+    public void setValid(boolean valid) {
+        this.valid = valid;
+
+    }
+
+    protected void delSeaMarkKeys(Node node) {
+        Iterator<String> it = node.getKeys().keySet().iterator();
+        String str;
+
+        while (it.hasNext()) {
+            str = it.next();
+
+            if (str.contains("seamark") == true)
+                if (str.compareTo("seamark") != 0) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node, str, null));
+                }
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java	(revision 23193)
@@ -23,1037 +23,1037 @@
 abstract public class Buoy extends SeaMark {
 
-	public abstract void setLightColour();
-
-	/**
-	 * private Variablen
-	 */
-
-	private int BuoyIndex = 0;
-
-	public int getBuoyIndex() {
-		return BuoyIndex;
-	}
-
-	public void setBuoyIndex(int buoyIndex) {
-		BuoyIndex = buoyIndex;
-	}
-
-	private int StyleIndex = 0;
-
-	public int getStyleIndex() {
-		return StyleIndex;
-	}
-
-	public void setStyleIndex(int styleIndex) {
-		StyleIndex = styleIndex;
-	}
-
-	private boolean Region = false;
-
-	public boolean getRegion() {
-		return Region;
-	}
-
-	public void setRegion(boolean region) {
-		Region = region;
-	}
-
-	private boolean Radar = false;
-
-	public boolean hasRadar() {
-		return Radar;
-	}
-
-	public void setRadar(boolean radar) {
-		Radar = radar;
-	}
-
-	private boolean Racon = false;
-
-	public boolean hasRacon() {
-		return Racon;
-	}
-
-	public void setRacon(boolean racon) {
-		Racon = racon;
-	}
-
-	private int RaType = 0;
-
-	public int getRaType() {
-		return RaType;
-	}
-
-	public void setRaType(int type) {
-		RaType = type;
-	}
-
-	private String RaconGroup = "";
-
-	public String getRaconGroup() {
-		return RaconGroup;
-	}
-
-	public void setRaconGroup(String raconGroup) {
-		RaconGroup = raconGroup;
-	}
-
-	private boolean Fog = false;
-
-	public boolean hasFog() {
-		return Fog;
-	}
-
-	public void setFog(boolean fog) {
-		Fog = fog;
-	}
-
-	private int FogSound = 0;
-
-	public int getFogSound() {
-		return FogSound;
-	}
-
-	public void setFogSound(int sound) {
-		FogSound = sound;
-	}
-
-	private String FogGroup = "";
-
-	public String getFogGroup() {
-		return FogGroup;
-	}
-
-	public void setFogGroup(String group) {
-		FogGroup = group;
-	}
-
-	private String FogPeriod = "";
-
-	public String getFogPeriod() {
-		return FogPeriod;
-	}
-
-	public void setFogPeriod(String period) {
-		FogPeriod = period;
-	}
-
-	private boolean Fired = false;
-
-	public boolean isFired() {
-		return Fired;
-	}
-
-	public void setFired(boolean fired) {
-		Fired = fired;
-	}
-
-	private boolean Sectored = false;
-
-	public boolean isSectored() {
-		return Sectored;
-	}
-
-	public void setSectored(boolean sectored) {
-		Sectored = sectored;
-	}
-
-	private int SectorIndex = 0;
-
-	public int getSectorIndex() {
-		return SectorIndex;
-	}
-
-	public void setSectorIndex(int sector) {
-		SectorIndex = sector;
-	}
-
-	private String[] LightChar = new String[10];
-
-	public String getLightChar() {
-		if (LightChar[SectorIndex] == null)
-			return (LightChar[0]);
-		return LightChar[SectorIndex];
-	}
-
-	public void setLightChar(String lightChar) {
-		if (SectorIndex == 0)
-			LightChar = new String[10];
-		LightChar[SectorIndex] = lightChar;
-	}
-
-	private String[] LightColour = new String[10];
-
-	public String getLightColour() {
-		if (LightColour[SectorIndex] == null)
-			return (LightColour[0]);
-		return LightColour[SectorIndex];
-	}
-
-	public void setLightColour(String lightColour) {
-		if (SectorIndex == 0)
-			LightColour = new String[10];
-		LightColour[SectorIndex] = lightColour;
-	}
-
-	private String[] LightGroup = new String[10];
-
-	public String getLightGroup() {
-		if (LightGroup[SectorIndex] == null)
-			return (LightGroup[0]);
-		return LightGroup[SectorIndex];
-	}
-
-	public void setLightGroup(String lightGroup) {
-		if (SectorIndex == 0)
-			LightGroup = new String[10];
-		LightGroup[SectorIndex] = lightGroup;
-	}
-
-	protected void setLightGroup(Map<String, String> k) {
-		String s = "";
-		if (k.containsKey("seamark:light:group")) {
-			s = k.get("seamark:light:group");
-			setLightGroup(s);
-		}
-	}
-
-	private String[] Height = new String[10];
-
-	public String getHeight() {
-		if (Height[SectorIndex] == null)
-			return (Height[0]);
-		return Height[SectorIndex];
-	}
-
-	public void setHeight(String height) {
-		if (SectorIndex == 0)
-			Height = new String[10];
-		Height[SectorIndex] = height;
-	}
-
-	private String[] Range = new String[10];
-
-	public String getRange() {
-		if (Range[SectorIndex] == null)
-			return (Range[0]);
-		return Range[SectorIndex];
-	}
-
-	public void setRange(String range) {
-		if (SectorIndex == 0)
-			Range = new String[10];
-		Range[SectorIndex] = range;
-	}
-
-	private String[] Bearing1 = new String[10];
-
-	public String getBearing1() {
-		if (Bearing1[SectorIndex] == null)
-			return (Bearing1[0]);
-		return Bearing1[SectorIndex];
-	}
-
-	public void setBearing1(String bearing) {
-		if (SectorIndex == 0)
-			Bearing1 = new String[10];
-		Bearing1[SectorIndex] = bearing;
-	}
-
-	private String[] Bearing2 = new String[10];
-
-	public String getBearing2() {
-		if (Bearing2[SectorIndex] == null)
-			return (Bearing2[0]);
-		return Bearing2[SectorIndex];
-	}
-
-	public void setBearing2(String bearing) {
-		if (SectorIndex == 0)
-			Bearing2 = new String[10];
-		Bearing2[SectorIndex] = bearing;
-	}
-
-	private String[] Radius = new String[10];
-
-	public String getRadius() {
-		if (Radius[SectorIndex] == null)
-			return (Radius[0]);
-		return Radius[SectorIndex];
-	}
-
-	public void setRadius(String radius) {
-		if (SectorIndex == 0)
-			Radius = new String[10];
-		Radius[SectorIndex] = radius;
-	}
-
-	private String[] LightPeriod = new String[10];
-
-	public String getLightPeriod() {
-		if (LightPeriod[SectorIndex] == null)
-			return (LightPeriod[0]);
-		return LightPeriod[SectorIndex];
-	}
-
-	public void setLightPeriod(String lightPeriod) {
-		String regex = "^[\\d\\s.]+$";
-
-		if (!lightPeriod.isEmpty()) {
-
-			Pattern pat = Pattern.compile(regex);
-			Matcher matcher = pat.matcher(lightPeriod);
-
-			if (matcher.find()) {
-				setErrMsg(null);
-			} else {
-				setErrMsg("Must be a number");
-				lightPeriod = "";
-				dlg.tfM01RepeatTime.requestFocus();
-			}
-		}
-		if (SectorIndex == 0)
-			LightPeriod = new String[10];
-		LightPeriod[SectorIndex] = lightPeriod;
-	}
-
-	private Node Node = null;
-
-	public Node getNode() {
-		return Node;
-	}
-
-	public void setNode(Node node) {
-		Node = node;
-	}
-
-	private boolean TopMark = false;
-
-	public boolean hasTopMark() {
-		return TopMark;
-	}
-
-	public void setTopMark(boolean topMark) {
-		TopMark = topMark;
-		/*
-		 * if (dlg.cM01TopMark == null) { return; }
-		 */
-		dlg.cM01TopMark.setSelected(topMark);
-	}
-
-	protected SmpDialogAction dlg = null; // hier wird der Dialog referenziert
-
-	public SmpDialogAction getDlg() {
-		return dlg;
-	}
-
-	public void setDlg(SmpDialogAction dlg) {
-		this.dlg = dlg;
-	}
-
-	protected Buoy(SmpDialogAction dia) {
-		dlg = dia;
-	}
-
-	public boolean isValid() {
-		return false;
-	}
-
-	public void parseLights(Map<String, String> k) {
-		setFired(false);
-		setSectored(false);
-		Iterator it = k.entrySet().iterator();
-		while (it.hasNext()) {
-			Map.Entry entry = (Map.Entry) it.next();
-			String key = (String) entry.getKey();
-			String value = ((String) entry.getValue()).trim();
-			if (key.contains("seamark:light:")) {
-				setFired(true);
-				int index = 0;
-				key = key.substring(14);
-				if (key.matches("^\\d:.*")) {
-					index = key.charAt(0) - '0';
-					key = key.substring(2);
-				} else if (key.matches("^\\d$")) {
-					index = key.charAt(0) - '0';
-					String values[] = value.split(":");
-					if (values[0].equals("red"))
-						LightColour[index] = "R";
-					else if (values[0].equals("green"))
-						LightColour[index] = "G";
-					else if (values[0].equals("white"))
-						LightColour[index] = "W";
-					Bearing1[index] = values[1];
-					Bearing2[index] = values[2];
-					Radius[index] = values[3];
-				} else {
-					index = 0;
-				}
-				if (index != 0)
-					setSectored(true);
-				if (key.equals("colour")) {
-					if (value.equals("red"))
-						LightColour[index] = "R";
-					else if (value.equals("green"))
-						LightColour[index] = "G";
-					else if (value.equals("white"))
-						LightColour[index] = "W";
-				} else if (key.equals("character")) {
-					LightChar[index] = value;
-				} else if (key.equals("group")) {
-					LightGroup[index] = value;
-				} else if (key.equals("period")) {
-					LightPeriod[index] = value;
-				} else if (key.equals("height")) {
-					Height[index] = value;
-				} else if (key.equals("range")) {
-					Range[index] = value;
-				}
-			}
-		}
-		setSectorIndex(0);
-		dlg.cbM01Sector.setSelectedIndex(0);
-		dlg.cM01Fired.setSelected(isFired());
-		dlg.rbM01Fired1.setSelected(!isSectored());
-		dlg.rbM01FiredN.setSelected(isSectored());
-		dlg.cbM01Kennung.setSelectedItem(getLightChar());
-		dlg.tfM01Height.setText(getHeight());
-		dlg.tfM01Range.setText(getRange());
-		dlg.tfM01Group.setText(getLightGroup());
-		dlg.tfM01RepeatTime.setText(getLightPeriod());
-		dlg.cbM01Colour.setSelectedItem(getLightColour());
-	}
-
-	public void parseFogRadar(Map<String, String> k) {
-		String str;
-		setFog(false);
-		setRadar(false);
-		setRacon(false);
-		if (k.containsKey("seamark:fog_signal")
-				|| k.containsKey("seamark:fog_signal:category")
-				|| k.containsKey("seamark:fog_signal:group")
-				|| k.containsKey("seamark:fog_signal:period")) {
-			setFog(true);
-			if (k.containsKey("seamark:fog_signal:category")) {
-				str = k.get("seamark:fog_signal:category");
-				if (str.equals("horn"))
-					setFogSound(FOG_HORN);
-				else if (str.equals("siren"))
-					setFogSound(FOG_SIREN);
-				else if (str.equals("diaphone"))
-					setFogSound(FOG_DIA);
-				else if (str.equals("bell"))
-					setFogSound(FOG_BELL);
-				else if (str.equals("whis"))
-					setFogSound(FOG_WHIS);
-				else if (str.equals("gong"))
-					setFogSound(FOG_GONG);
-				else if (str.equals("explosive"))
-					setFogSound(FOG_EXPLOS);
-				else
-					setFogSound(UNKNOWN_FOG);
-			}
-			if (k.containsKey("seamark:fog_signal:group"))
-				setFogGroup(k.get("seamark:fog_signal:group"));
-			if (k.containsKey("seamark:fog_signal:period"))
-				setFogPeriod(k.get("seamark:fog_signal:period"));
-		}
-		dlg.cM01Fog.setSelected(hasFog());
-		dlg.cbM01Fog.setSelectedIndex(getFogSound());
-		dlg.tfM01FogGroup.setText(getFogGroup());
-		dlg.tfM01FogPeriod.setText(getFogPeriod());
-
-		if (k.containsKey("seamark:radar_transponder")
-				|| k.containsKey("seamark:radar_transponder:category")
-				|| k.containsKey("seamark:radar_transponder:group")) {
-			setRacon(true);
-			if (k.containsKey("seamark:radar_transponder:category")) {
-				str = k.get("seamark:radar_transponder:category");
-				if (str.equals("racon"))
-					setRaType(RATYPE_RACON);
-				else if (str.equals("ramark"))
-					setRaType(RATYPE_RAMARK);
-				else if (str.equals("leading"))
-					setRaType(RATYPE_LEADING);
-				else
-					setRaType(UNKNOWN_RATYPE);
-			}
-			if (k.containsKey("seamark:radar_transponder:group"))
-				setRaconGroup(k.get("seamark:radar_transponder:group"));
-		} else if (k.containsKey("seamark:radar_reflector"))
-			setRadar(true);
-		dlg.cM01Radar.setSelected(hasRadar());
-		dlg.cM01Racon.setSelected(hasRacon());
-		dlg.cbM01Racon.setSelectedIndex(getRaType());
-		dlg.tfM01Racon.setText(getRaconGroup());
-	}
-
-	public void paintSign() {
-
-		if (dlg.paintlock)
-			return;
-		else
-			dlg.paintlock = true;
-
-		dlg.lM01Icon.setIcon(null);
-		dlg.lM02Icon.setIcon(null);
-		dlg.lM03Icon.setIcon(null);
-		dlg.lM04Icon.setIcon(null);
-		dlg.lM05Icon.setIcon(null);
-
-		dlg.rbM01RegionA.setSelected(!getRegion());
-		dlg.rbM01RegionB.setSelected(getRegion());
-
-		if (isValid()) {
-			dlg.bM01Save.setEnabled(true);
-
-			dlg.cM01TopMark.setSelected(hasTopMark());
-			dlg.cM01Fired.setSelected(isFired());
-
-			dlg.tfM01RepeatTime.setText(getLightPeriod());
-
-			dlg.tfM01Name.setText(getName());
-			dlg.tfM01Name.setEnabled(true);
-
-			if (hasRadar()) {
-				dlg.lM03Icon.setIcon(new ImageIcon(getClass().getResource(
-						"/images/Radar_Reflector.png")));
-			}
-
-			if (hasRacon()) {
-				dlg.lM04Icon.setIcon(new ImageIcon(getClass().getResource(
-						"/images/Radar_Station.png")));
-				dlg.cbM01Racon.setVisible(true);
-				if (getRaType() == RATYPE_RACON) {
-					dlg.lM01Racon.setVisible(true);
-					dlg.tfM01Racon.setVisible(true);
-					dlg.tfM01Racon.setEnabled(true);
-				} else {
-					dlg.lM01Racon.setVisible(false);
-					dlg.tfM01Racon.setVisible(false);
-				}
-			} else {
-				dlg.cbM01Racon.setVisible(false);
-				dlg.lM01Racon.setVisible(false);
-				dlg.tfM01Racon.setVisible(false);
-			}
-
-			if (hasFog()) {
-				dlg.lM05Icon.setIcon(new ImageIcon(getClass().getResource(
-						"/images/Fog_Signal.png")));
-				dlg.cbM01Fog.setVisible(true);
-				if (getFogSound() == 0) {
-					dlg.lM01FogGroup.setVisible(false);
-					dlg.tfM01FogGroup.setVisible(false);
-					dlg.lM01FogPeriod.setVisible(false);
-					dlg.tfM01FogPeriod.setVisible(false);
-				} else {
-					dlg.lM01FogGroup.setVisible(true);
-					dlg.tfM01FogGroup.setVisible(true);
-					dlg.lM01FogPeriod.setVisible(true);
-					dlg.tfM01FogPeriod.setVisible(true);
-				}
-			} else {
-				dlg.cbM01Fog.setVisible(false);
-				dlg.lM01FogGroup.setVisible(false);
-				dlg.tfM01FogGroup.setVisible(false);
-				dlg.lM01FogPeriod.setVisible(false);
-				dlg.tfM01FogPeriod.setVisible(false);
-			}
-
-			if (isFired()) {
-				String lp, c;
-				String tmp = null;
-				int i1;
-
-				String col = getLightColour();
-				if (col.equals("W")) {
-					dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
-							"/images/Light_White_120.png")));
-					dlg.cbM01Colour.setSelectedIndex(WHITE_LIGHT);
-				} else if (col.equals("R")) {
-					dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
-							"/images/Light_Red_120.png")));
-					dlg.cbM01Colour.setSelectedIndex(RED_LIGHT);
-				} else if (col.equals("G")) {
-					dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
-							"/images/Light_Green_120.png")));
-					dlg.cbM01Colour.setSelectedIndex(GREEN_LIGHT);
-				} else {
-					dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
-							"/images/Light_Magenta_120.png")));
-					dlg.cbM01Colour.setSelectedIndex(UNKNOWN_COLOUR);
-				}
-
-				c = getLightChar();
-				if (c.contains("+")) {
-					i1 = c.indexOf("+");
-					tmp = c.substring(i1, c.length());
-					c = c.substring(0, i1);
-					if (!getLightGroup().isEmpty()) {
-						c = c + "(" + getLightGroup() + ")";
-					}
-					if (tmp != null)
-						c = c + tmp;
-				}
-				dlg.cbM01Kennung.setSelectedItem(c);
-				if (((dlg.cbM01Kennung.getSelectedIndex() == 0) && !getLightGroup()
-						.isEmpty())
-						|| (((String) dlg.cbM01Kennung.getSelectedItem()).contains("("))
-						&& !(((String) dlg.cbM01Kennung.getSelectedItem()).contains("+"))) {
-					c = c + "(" + getLightGroup() + ")";
-					dlg.cbM01Kennung.setSelectedItem(c);
-				}
-				c = c + " " + getLightColour();
-				lp = getLightPeriod();
-				if (!lp.isEmpty())
-					c = c + " " + lp + "s";
-				dlg.lM01FireMark.setText(c);
-				dlg.cM01Fired.setVisible(true);
-				dlg.lM01Kennung.setVisible(true);
-				dlg.cbM01Kennung.setVisible(true);
-				if (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) {
-					dlg.tfM01Group.setVisible(false);
-					dlg.lM01Group.setVisible(false);
-				} else {
-					dlg.lM01Group.setVisible(true);
-					dlg.tfM01Group.setVisible(true);
-				}
-				dlg.tfM01Group.setText(getLightGroup());
-				dlg.lM01RepeatTime.setVisible(true);
-				dlg.tfM01RepeatTime.setVisible(true);
-				if (isSectored()) {
-					dlg.rbM01Fired1.setSelected(false);
-					dlg.rbM01FiredN.setSelected(true);
-					if ((getSectorIndex() != 0) && (!LightChar[0].isEmpty()))
-						dlg.cbM01Kennung.setEnabled(false);
-					else
-						dlg.cbM01Kennung.setEnabled(true);
-					dlg.cbM01Kennung.setSelectedItem(getLightChar());
-					if ((getSectorIndex() != 0) && (!LightGroup[0].isEmpty()))
-						dlg.tfM01Group.setEnabled(false);
-					else
-						dlg.tfM01Group.setEnabled(true);
-					dlg.tfM01Group.setText(getLightGroup());
-					if ((getSectorIndex() != 0) && (!LightPeriod[0].isEmpty()))
-						dlg.tfM01RepeatTime.setEnabled(false);
-					else
-						dlg.tfM01RepeatTime.setEnabled(true);
-					dlg.tfM01RepeatTime.setText(getLightPeriod());
-					if ((getSectorIndex() != 0) && (!Height[0].isEmpty()))
-						dlg.tfM01Height.setEnabled(false);
-					else
-						dlg.tfM01Height.setEnabled(true);
-					dlg.tfM01Height.setText(getHeight());
-					if ((getSectorIndex() != 0) && (!Range[0].isEmpty()))
-						dlg.tfM01Range.setEnabled(false);
-					else
-						dlg.tfM01Range.setEnabled(true);
-					dlg.tfM01Range.setText(getRange());
-					dlg.lM01Sector.setVisible(true);
-					dlg.cbM01Sector.setVisible(true);
-					if (getSectorIndex() == 0) {
-						dlg.lM01Colour.setVisible(false);
-						dlg.cbM01Colour.setVisible(false);
-						dlg.lM01Bearing.setVisible(false);
-						dlg.tfM01Bearing.setVisible(false);
-						dlg.tfM02Bearing.setVisible(false);
-						dlg.tfM01Radius.setVisible(false);
-					} else {
-						dlg.lM01Colour.setVisible(true);
-						dlg.cbM01Colour.setVisible(true);
-						dlg.lM01Bearing.setVisible(true);
-						dlg.tfM01Bearing.setVisible(true);
-						dlg.tfM01Bearing.setText(getBearing1());
-						dlg.tfM02Bearing.setVisible(true);
-						dlg.tfM02Bearing.setText(getBearing2());
-						dlg.tfM01Radius.setVisible(true);
-						dlg.tfM01Radius.setText(getRadius());
-					}
-				} else {
-					dlg.rbM01FiredN.setSelected(false);
-					dlg.rbM01Fired1.setSelected(true);
-					dlg.cbM01Kennung.setEnabled(true);
-					dlg.tfM01Group.setEnabled(true);
-					dlg.tfM01RepeatTime.setEnabled(true);
-					dlg.tfM01Height.setEnabled(true);
-					dlg.tfM01Range.setEnabled(true);
-					dlg.lM01Colour.setVisible(true);
-					dlg.cbM01Colour.setVisible(true);
-					dlg.lM01Sector.setVisible(false);
-					dlg.cbM01Sector.setVisible(false);
-					dlg.lM01Bearing.setVisible(false);
-					dlg.tfM01Bearing.setVisible(false);
-					dlg.tfM02Bearing.setVisible(false);
-					dlg.tfM01Radius.setVisible(false);
-				}
-			} else {
-				dlg.lM01FireMark.setText("");
-				dlg.rbM01Fired1.setVisible(false);
-				dlg.rbM01FiredN.setVisible(false);
-				dlg.cbM01Kennung.setVisible(false);
-				dlg.lM01Kennung.setVisible(false);
-				dlg.tfM01Height.setVisible(false);
-				dlg.lM01Height.setVisible(false);
-				dlg.tfM01Range.setVisible(false);
-				dlg.lM01Range.setVisible(false);
-				dlg.cbM01Colour.setVisible(false);
-				dlg.lM01Colour.setVisible(false);
-				dlg.cbM01Sector.setVisible(false);
-				dlg.lM01Sector.setVisible(false);
-				dlg.tfM01Group.setVisible(false);
-				dlg.lM01Group.setVisible(false);
-				dlg.tfM01RepeatTime.setVisible(false);
-				dlg.lM01RepeatTime.setVisible(false);
-				dlg.tfM01Bearing.setVisible(false);
-				dlg.lM01Bearing.setVisible(false);
-				dlg.tfM02Bearing.setVisible(false);
-				dlg.tfM01Radius.setVisible(false);
-			}
-		} else {
-			dlg.bM01Save.setEnabled(false);
-			dlg.tfM01Name.setEnabled(false);
-			dlg.cM01TopMark.setVisible(false);
-			dlg.cbM01TopMark.setVisible(false);
-			dlg.cM01Radar.setVisible(false);
-			dlg.cM01Racon.setVisible(false);
-			dlg.cbM01Racon.setVisible(false);
-			dlg.tfM01Racon.setVisible(false);
-			dlg.lM01Racon.setVisible(false);
-			dlg.cM01Fog.setVisible(false);
-			dlg.cbM01Fog.setVisible(false);
-			dlg.tfM01FogGroup.setVisible(false);
-			dlg.lM01FogGroup.setVisible(false);
-			dlg.tfM01FogPeriod.setVisible(false);
-			dlg.lM01FogPeriod.setVisible(false);
-			dlg.cM01Fired.setVisible(false);
-			dlg.rbM01Fired1.setVisible(false);
-			dlg.rbM01FiredN.setVisible(false);
-			dlg.cbM01Kennung.setVisible(false);
-			dlg.lM01Kennung.setVisible(false);
-			dlg.tfM01Height.setVisible(false);
-			dlg.lM01Height.setVisible(false);
-			dlg.tfM01Range.setVisible(false);
-			dlg.lM01Range.setVisible(false);
-			dlg.cbM01Colour.setVisible(false);
-			dlg.lM01Colour.setVisible(false);
-			dlg.cbM01Sector.setVisible(false);
-			dlg.lM01Sector.setVisible(false);
-			dlg.tfM01Group.setVisible(false);
-			dlg.lM01Group.setVisible(false);
-			dlg.tfM01RepeatTime.setVisible(false);
-			dlg.lM01RepeatTime.setVisible(false);
-			dlg.tfM01Bearing.setVisible(false);
-			dlg.lM01Bearing.setVisible(false);
-			dlg.tfM02Bearing.setVisible(false);
-			dlg.tfM01Radius.setVisible(false);
-		}
-		dlg.paintlock = false;
-	}
-
-	public void saveSign(String type) {
-		delSeaMarkKeys(Node);
-
-		String str = dlg.tfM01Name.getText();
-		if (!str.isEmpty())
-			Main.main.undoRedo.add(new ChangePropertyCommand(Node, "seamark:name",
-					str));
-		Main.main.undoRedo
-				.add(new ChangePropertyCommand(Node, "seamark:type", type));
-	}
-
-	protected void saveLightData() {
-		String colour;
-		if (dlg.cM01Fired.isSelected()) {
-			if (!(colour = LightColour[0]).isEmpty())
-				if (colour.equals("R")) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:light:colour", "red"));
-				} else if (colour.equals("G")) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:light:colour", "green"));
-				} else if (colour.equals("W")) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:light:colour", "white"));
-				}
-
-			if (!LightPeriod[0].isEmpty())
-				Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-						"seamark:light:period", LightPeriod[0]));
-
-			if (!LightChar[0].isEmpty())
-				Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-						"seamark:light:character", LightChar[0]));
-
-			if (!LightGroup[0].isEmpty())
-				Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-						"seamark:light:group", LightGroup[0]));
-
-			if (!Height[0].isEmpty())
-				Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-						"seamark:light:height", Height[0]));
-
-			if (!Range[0].isEmpty())
-				Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-						"seamark:light:range", Range[0]));
-
-			for (int i = 1; i < 10; i++) {
-				if ((colour = LightColour[i]) != null)
-					if (colour.equals("R")) {
-						Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-								"seamark:light:" + i + ":colour", "red"));
-						if ((Bearing1[i] != null) && (Bearing2[i] != null)
-								&& (Radius[i] != null))
-							Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-									"seamark:light:" + i, "red:" + Bearing1[i] + ":"
-											+ Bearing2[i] + ":" + Radius[i]));
-					} else if (colour.equals("G")) {
-						Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-								"seamark:light:" + i + ":colour", "green"));
-						if ((Bearing1[i] != null) && (Bearing2[i] != null)
-								&& (Radius[i] != null))
-							Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-									"seamark:light:" + i, "green:" + Bearing1[i] + ":"
-											+ Bearing2[i] + ":" + Radius[i]));
-					} else if (colour.equals("W")) {
-						Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-								"seamark:light:" + i + ":colour", "white"));
-						if ((Bearing1[i] != null) && (Bearing2[i] != null)
-								&& (Radius[i] != null))
-							Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-									"seamark:light:" + i, "white:" + Bearing1[i] + ":"
-											+ Bearing2[i] + ":" + Radius[i]));
-					}
-
-				if (LightPeriod[i] != null)
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:light:" + i + ":period", LightPeriod[i]));
-
-				if (LightChar[i] != null)
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:light:" + i + ":character", LightChar[i]));
-
-				if (LightGroup[i] != null)
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:light:" + i + ":group", LightGroup[i]));
-
-				if (Height[i] != null)
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:light:" + i + ":height", Height[i]));
-
-				if (Range[i] != null)
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:light:" + i + ":range", Range[i]));
-
-				if (Bearing1[i] != null)
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:light:" + i + ":sector_start", Bearing1[i]));
-
-				if (Bearing2[i] != null)
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:light:" + i + ":sector_end", Bearing2[i]));
-			}
-		}
-	}
-
-	protected void saveTopMarkData(String shape, String colour) {
-		if (dlg.cM01TopMark.isSelected()) {
-			Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-					"seamark:topmark:shape", shape));
-			Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-					"seamark:topmark:colour", colour));
-		}
-	}
-
-	protected void saveRadarFogData() {
-		if (hasRadar()) {
-			Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-					"seamark:radar_reflector", "yes"));
-		}
-		if (hasRacon()) {
-			switch (RaType) {
-			case RATYPE_RACON:
-				Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-						"seamark:radar_transponder:category", "racon"));
-				if (!getRaconGroup().isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:radar_transponder:group", getRaconGroup()));
-				break;
-			case RATYPE_RAMARK:
-				Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-						"seamark:radar_transponder:category", "ramark"));
-				break;
-			case RATYPE_LEADING:
-				Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-						"seamark:radar_transponder:category", "leading"));
-				break;
-			default:
-				Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-						"seamark:radar_transponder", "yes"));
-			}
-		}
-		if (hasFog()) {
-			if (getFogSound() == 0) {
-				Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-						"seamark:fog_signal", "yes"));
-			} else {
-				switch (getFogSound()) {
-				case FOG_HORN:
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:fog_signal:category", "horn"));
-					break;
-				case FOG_SIREN:
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:fog_signal:category", "siren"));
-					break;
-				case FOG_DIA:
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:fog_signal:category", "diaphone"));
-					break;
-				case FOG_BELL:
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:fog_signal:category", "bell"));
-					break;
-				case FOG_WHIS:
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:fog_signal:category", "whistle"));
-					break;
-				case FOG_GONG:
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:fog_signal:category", "gong"));
-					break;
-				case FOG_EXPLOS:
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:fog_signal:category", "explosive"));
-					break;
-				}
-				if (!getFogGroup().isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:fog_signal:group", getFogGroup()));
-				if (!getFogPeriod().isEmpty())
-					Main.main.undoRedo.add(new ChangePropertyCommand(Node,
-							"seamark:fog_signal:period", getFogPeriod()));
-			}
-		}
-	}
-
-	public void refreshStyles() {
-	}
-
-	public void refreshLights() {
-		dlg.cbM01Kennung.removeAllItems();
-		dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("Fl"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("LFl"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("Iso"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("F"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("FFl"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("IQ"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("VQ"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("IVQ"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("UQ"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("IUQ"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("Mo"); //$NON-NLS-1$
-		dlg.cbM01Kennung.setSelectedIndex(0);
-	}
-
-	public void resetMask() {
-		setRegion(Main.pref.get("tomsplugin.IALA").equals("B"));
-
-		dlg.lM01Icon.setIcon(null);
-		dlg.lM02Icon.setIcon(null);
-		dlg.lM03Icon.setIcon(null);
-		dlg.lM04Icon.setIcon(null);
-
-		dlg.rbM01RegionA.setEnabled(false);
-		dlg.rbM01RegionB.setEnabled(false);
-		dlg.lM01FireMark.setText("");
-		dlg.cbM01CatOfMark.removeAllItems();
-		dlg.cbM01CatOfMark.setVisible(false);
-		dlg.lM01CatOfMark.setVisible(false);
-		setBuoyIndex(0);
-		dlg.cbM01StyleOfMark.removeAllItems();
-		dlg.cbM01StyleOfMark.setVisible(false);
-		dlg.lM01StyleOfMark.setVisible(false);
-		setStyleIndex(0);
-		dlg.tfM01Name.setText("");
-		dlg.tfM01Name.setEnabled(false);
-		setName("");
-		dlg.cM01TopMark.setSelected(false);
-		dlg.cM01TopMark.setVisible(false);
-		dlg.cbM01TopMark.removeAllItems();
-		dlg.cbM01TopMark.setVisible(false);
-		setTopMark(false);
-		dlg.cM01Radar.setSelected(false);
-		dlg.cM01Radar.setVisible(false);
-		setRadar(false);
-		dlg.cM01Racon.setSelected(false);
-		dlg.cM01Racon.setVisible(false);
-		dlg.cbM01Racon.setVisible(false);
-		dlg.tfM01Racon.setText("");
-		dlg.tfM01Racon.setVisible(false);
-		dlg.lM01Racon.setVisible(false);
-		setRacon(false);
-		setRaType(0);
-		dlg.cM01Fog.setSelected(false);
-		dlg.cM01Fog.setVisible(false);
-		dlg.cbM01Fog.setVisible(false);
-		setFogSound(0);
-		dlg.tfM01FogGroup.setText("");
-		dlg.tfM01FogGroup.setVisible(false);
-		dlg.lM01FogGroup.setVisible(false);
-		dlg.tfM01FogPeriod.setText("");
-		dlg.tfM01FogPeriod.setVisible(false);
-		dlg.lM01FogPeriod.setVisible(false);
-		setFog(false);
-		dlg.cM01Fired.setSelected(false);
-		dlg.cM01Fired.setVisible(false);
-		setFired(false);
-		dlg.rbM01Fired1.setVisible(false);
-		dlg.rbM01Fired1.setSelected(true);
-		dlg.rbM01FiredN.setVisible(false);
-		dlg.rbM01FiredN.setSelected(false);
-		setSectored(false);
-		dlg.cbM01Kennung.removeAllItems();
-		dlg.cbM01Kennung.setVisible(false);
-		dlg.lM01Kennung.setVisible(false);
-		setLightChar("");
-		dlg.tfM01Height.setText("");
-		dlg.tfM01Height.setVisible(false);
-		dlg.lM01Height.setVisible(false);
-		setHeight("");
-		dlg.tfM01Range.setText("");
-		dlg.tfM01Range.setVisible(false);
-		dlg.lM01Range.setVisible(false);
-		setRange("");
-		dlg.cbM01Colour.setVisible(false);
-		dlg.lM01Colour.setVisible(false);
-		setLightColour("");
-		dlg.cbM01Sector.setVisible(false);
-		dlg.lM01Sector.setVisible(false);
-		setSectorIndex(0);
-		dlg.tfM01Group.setText("");
-		dlg.tfM01Group.setVisible(false);
-		dlg.lM01Group.setVisible(false);
-		setLightGroup("");
-		dlg.tfM01RepeatTime.setText("");
-		dlg.tfM01RepeatTime.setVisible(false);
-		dlg.lM01RepeatTime.setVisible(false);
-		setLightPeriod("");
-		dlg.tfM01Bearing.setText("");
-		dlg.tfM01Bearing.setVisible(false);
-		dlg.lM01Bearing.setVisible(false);
-		setBearing1("");
-		dlg.tfM02Bearing.setText("");
-		dlg.tfM02Bearing.setVisible(false);
-		setBearing2("");
-		dlg.tfM01Radius.setText("");
-		dlg.tfM01Radius.setVisible(false);
-		setRadius("");
-
-		dlg.bM01Save.setEnabled(false);
-	}
+    public abstract void setLightColour();
+
+    /**
+     * private Variablen
+     */
+
+    private int BuoyIndex = 0;
+
+    public int getBuoyIndex() {
+        return BuoyIndex;
+    }
+
+    public void setBuoyIndex(int buoyIndex) {
+        BuoyIndex = buoyIndex;
+    }
+
+    private int StyleIndex = 0;
+
+    public int getStyleIndex() {
+        return StyleIndex;
+    }
+
+    public void setStyleIndex(int styleIndex) {
+        StyleIndex = styleIndex;
+    }
+
+    private boolean Region = false;
+
+    public boolean getRegion() {
+        return Region;
+    }
+
+    public void setRegion(boolean region) {
+        Region = region;
+    }
+
+    private boolean Radar = false;
+
+    public boolean hasRadar() {
+        return Radar;
+    }
+
+    public void setRadar(boolean radar) {
+        Radar = radar;
+    }
+
+    private boolean Racon = false;
+
+    public boolean hasRacon() {
+        return Racon;
+    }
+
+    public void setRacon(boolean racon) {
+        Racon = racon;
+    }
+
+    private int RaType = 0;
+
+    public int getRaType() {
+        return RaType;
+    }
+
+    public void setRaType(int type) {
+        RaType = type;
+    }
+
+    private String RaconGroup = "";
+
+    public String getRaconGroup() {
+        return RaconGroup;
+    }
+
+    public void setRaconGroup(String raconGroup) {
+        RaconGroup = raconGroup;
+    }
+
+    private boolean Fog = false;
+
+    public boolean hasFog() {
+        return Fog;
+    }
+
+    public void setFog(boolean fog) {
+        Fog = fog;
+    }
+
+    private int FogSound = 0;
+
+    public int getFogSound() {
+        return FogSound;
+    }
+
+    public void setFogSound(int sound) {
+        FogSound = sound;
+    }
+
+    private String FogGroup = "";
+
+    public String getFogGroup() {
+        return FogGroup;
+    }
+
+    public void setFogGroup(String group) {
+        FogGroup = group;
+    }
+
+    private String FogPeriod = "";
+
+    public String getFogPeriod() {
+        return FogPeriod;
+    }
+
+    public void setFogPeriod(String period) {
+        FogPeriod = period;
+    }
+
+    private boolean Fired = false;
+
+    public boolean isFired() {
+        return Fired;
+    }
+
+    public void setFired(boolean fired) {
+        Fired = fired;
+    }
+
+    private boolean Sectored = false;
+
+    public boolean isSectored() {
+        return Sectored;
+    }
+
+    public void setSectored(boolean sectored) {
+        Sectored = sectored;
+    }
+
+    private int SectorIndex = 0;
+
+    public int getSectorIndex() {
+        return SectorIndex;
+    }
+
+    public void setSectorIndex(int sector) {
+        SectorIndex = sector;
+    }
+
+    private String[] LightChar = new String[10];
+
+    public String getLightChar() {
+        if (LightChar[SectorIndex] == null)
+            return (LightChar[0]);
+        return LightChar[SectorIndex];
+    }
+
+    public void setLightChar(String lightChar) {
+        if (SectorIndex == 0)
+            LightChar = new String[10];
+        LightChar[SectorIndex] = lightChar;
+    }
+
+    private String[] LightColour = new String[10];
+
+    public String getLightColour() {
+        if (LightColour[SectorIndex] == null)
+            return (LightColour[0]);
+        return LightColour[SectorIndex];
+    }
+
+    public void setLightColour(String lightColour) {
+        if (SectorIndex == 0)
+            LightColour = new String[10];
+        LightColour[SectorIndex] = lightColour;
+    }
+
+    private String[] LightGroup = new String[10];
+
+    public String getLightGroup() {
+        if (LightGroup[SectorIndex] == null)
+            return (LightGroup[0]);
+        return LightGroup[SectorIndex];
+    }
+
+    public void setLightGroup(String lightGroup) {
+        if (SectorIndex == 0)
+            LightGroup = new String[10];
+        LightGroup[SectorIndex] = lightGroup;
+    }
+
+    protected void setLightGroup(Map<String, String> k) {
+        String s = "";
+        if (k.containsKey("seamark:light:group")) {
+            s = k.get("seamark:light:group");
+            setLightGroup(s);
+        }
+    }
+
+    private String[] Height = new String[10];
+
+    public String getHeight() {
+        if (Height[SectorIndex] == null)
+            return (Height[0]);
+        return Height[SectorIndex];
+    }
+
+    public void setHeight(String height) {
+        if (SectorIndex == 0)
+            Height = new String[10];
+        Height[SectorIndex] = height;
+    }
+
+    private String[] Range = new String[10];
+
+    public String getRange() {
+        if (Range[SectorIndex] == null)
+            return (Range[0]);
+        return Range[SectorIndex];
+    }
+
+    public void setRange(String range) {
+        if (SectorIndex == 0)
+            Range = new String[10];
+        Range[SectorIndex] = range;
+    }
+
+    private String[] Bearing1 = new String[10];
+
+    public String getBearing1() {
+        if (Bearing1[SectorIndex] == null)
+            return (Bearing1[0]);
+        return Bearing1[SectorIndex];
+    }
+
+    public void setBearing1(String bearing) {
+        if (SectorIndex == 0)
+            Bearing1 = new String[10];
+        Bearing1[SectorIndex] = bearing;
+    }
+
+    private String[] Bearing2 = new String[10];
+
+    public String getBearing2() {
+        if (Bearing2[SectorIndex] == null)
+            return (Bearing2[0]);
+        return Bearing2[SectorIndex];
+    }
+
+    public void setBearing2(String bearing) {
+        if (SectorIndex == 0)
+            Bearing2 = new String[10];
+        Bearing2[SectorIndex] = bearing;
+    }
+
+    private String[] Radius = new String[10];
+
+    public String getRadius() {
+        if (Radius[SectorIndex] == null)
+            return (Radius[0]);
+        return Radius[SectorIndex];
+    }
+
+    public void setRadius(String radius) {
+        if (SectorIndex == 0)
+            Radius = new String[10];
+        Radius[SectorIndex] = radius;
+    }
+
+    private String[] LightPeriod = new String[10];
+
+    public String getLightPeriod() {
+        if (LightPeriod[SectorIndex] == null)
+            return (LightPeriod[0]);
+        return LightPeriod[SectorIndex];
+    }
+
+    public void setLightPeriod(String lightPeriod) {
+        String regex = "^[\\d\\s.]+$";
+
+        if (!lightPeriod.isEmpty()) {
+
+            Pattern pat = Pattern.compile(regex);
+            Matcher matcher = pat.matcher(lightPeriod);
+
+            if (matcher.find()) {
+                setErrMsg(null);
+            } else {
+                setErrMsg("Must be a number");
+                lightPeriod = "";
+                dlg.tfM01RepeatTime.requestFocus();
+            }
+        }
+        if (SectorIndex == 0)
+            LightPeriod = new String[10];
+        LightPeriod[SectorIndex] = lightPeriod;
+    }
+
+    private Node Node = null;
+
+    public Node getNode() {
+        return Node;
+    }
+
+    public void setNode(Node node) {
+        Node = node;
+    }
+
+    private boolean TopMark = false;
+
+    public boolean hasTopMark() {
+        return TopMark;
+    }
+
+    public void setTopMark(boolean topMark) {
+        TopMark = topMark;
+        /*
+         * if (dlg.cM01TopMark == null) { return; }
+         */
+        dlg.cM01TopMark.setSelected(topMark);
+    }
+
+    protected SmpDialogAction dlg = null; // hier wird der Dialog referenziert
+
+    public SmpDialogAction getDlg() {
+        return dlg;
+    }
+
+    public void setDlg(SmpDialogAction dlg) {
+        this.dlg = dlg;
+    }
+
+    protected Buoy(SmpDialogAction dia) {
+        dlg = dia;
+    }
+
+    public boolean isValid() {
+        return false;
+    }
+
+    public void parseLights(Map<String, String> k) {
+        setFired(false);
+        setSectored(false);
+        Iterator it = k.entrySet().iterator();
+        while (it.hasNext()) {
+            Map.Entry entry = (Map.Entry) it.next();
+            String key = (String) entry.getKey();
+            String value = ((String) entry.getValue()).trim();
+            if (key.contains("seamark:light:")) {
+                setFired(true);
+                int index = 0;
+                key = key.substring(14);
+                if (key.matches("^\\d:.*")) {
+                    index = key.charAt(0) - '0';
+                    key = key.substring(2);
+                } else if (key.matches("^\\d$")) {
+                    index = key.charAt(0) - '0';
+                    String values[] = value.split(":");
+                    if (values[0].equals("red"))
+                        LightColour[index] = "R";
+                    else if (values[0].equals("green"))
+                        LightColour[index] = "G";
+                    else if (values[0].equals("white"))
+                        LightColour[index] = "W";
+                    Bearing1[index] = values[1];
+                    Bearing2[index] = values[2];
+                    Radius[index] = values[3];
+                } else {
+                    index = 0;
+                }
+                if (index != 0)
+                    setSectored(true);
+                if (key.equals("colour")) {
+                    if (value.equals("red"))
+                        LightColour[index] = "R";
+                    else if (value.equals("green"))
+                        LightColour[index] = "G";
+                    else if (value.equals("white"))
+                        LightColour[index] = "W";
+                } else if (key.equals("character")) {
+                    LightChar[index] = value;
+                } else if (key.equals("group")) {
+                    LightGroup[index] = value;
+                } else if (key.equals("period")) {
+                    LightPeriod[index] = value;
+                } else if (key.equals("height")) {
+                    Height[index] = value;
+                } else if (key.equals("range")) {
+                    Range[index] = value;
+                }
+            }
+        }
+        setSectorIndex(0);
+        dlg.cbM01Sector.setSelectedIndex(0);
+        dlg.cM01Fired.setSelected(isFired());
+        dlg.rbM01Fired1.setSelected(!isSectored());
+        dlg.rbM01FiredN.setSelected(isSectored());
+        dlg.cbM01Kennung.setSelectedItem(getLightChar());
+        dlg.tfM01Height.setText(getHeight());
+        dlg.tfM01Range.setText(getRange());
+        dlg.tfM01Group.setText(getLightGroup());
+        dlg.tfM01RepeatTime.setText(getLightPeriod());
+        dlg.cbM01Colour.setSelectedItem(getLightColour());
+    }
+
+    public void parseFogRadar(Map<String, String> k) {
+        String str;
+        setFog(false);
+        setRadar(false);
+        setRacon(false);
+        if (k.containsKey("seamark:fog_signal")
+                || k.containsKey("seamark:fog_signal:category")
+                || k.containsKey("seamark:fog_signal:group")
+                || k.containsKey("seamark:fog_signal:period")) {
+            setFog(true);
+            if (k.containsKey("seamark:fog_signal:category")) {
+                str = k.get("seamark:fog_signal:category");
+                if (str.equals("horn"))
+                    setFogSound(FOG_HORN);
+                else if (str.equals("siren"))
+                    setFogSound(FOG_SIREN);
+                else if (str.equals("diaphone"))
+                    setFogSound(FOG_DIA);
+                else if (str.equals("bell"))
+                    setFogSound(FOG_BELL);
+                else if (str.equals("whis"))
+                    setFogSound(FOG_WHIS);
+                else if (str.equals("gong"))
+                    setFogSound(FOG_GONG);
+                else if (str.equals("explosive"))
+                    setFogSound(FOG_EXPLOS);
+                else
+                    setFogSound(UNKNOWN_FOG);
+            }
+            if (k.containsKey("seamark:fog_signal:group"))
+                setFogGroup(k.get("seamark:fog_signal:group"));
+            if (k.containsKey("seamark:fog_signal:period"))
+                setFogPeriod(k.get("seamark:fog_signal:period"));
+        }
+        dlg.cM01Fog.setSelected(hasFog());
+        dlg.cbM01Fog.setSelectedIndex(getFogSound());
+        dlg.tfM01FogGroup.setText(getFogGroup());
+        dlg.tfM01FogPeriod.setText(getFogPeriod());
+
+        if (k.containsKey("seamark:radar_transponder")
+                || k.containsKey("seamark:radar_transponder:category")
+                || k.containsKey("seamark:radar_transponder:group")) {
+            setRacon(true);
+            if (k.containsKey("seamark:radar_transponder:category")) {
+                str = k.get("seamark:radar_transponder:category");
+                if (str.equals("racon"))
+                    setRaType(RATYPE_RACON);
+                else if (str.equals("ramark"))
+                    setRaType(RATYPE_RAMARK);
+                else if (str.equals("leading"))
+                    setRaType(RATYPE_LEADING);
+                else
+                    setRaType(UNKNOWN_RATYPE);
+            }
+            if (k.containsKey("seamark:radar_transponder:group"))
+                setRaconGroup(k.get("seamark:radar_transponder:group"));
+        } else if (k.containsKey("seamark:radar_reflector"))
+            setRadar(true);
+        dlg.cM01Radar.setSelected(hasRadar());
+        dlg.cM01Racon.setSelected(hasRacon());
+        dlg.cbM01Racon.setSelectedIndex(getRaType());
+        dlg.tfM01Racon.setText(getRaconGroup());
+    }
+
+    public void paintSign() {
+
+        if (dlg.paintlock)
+            return;
+        else
+            dlg.paintlock = true;
+
+        dlg.lM01Icon.setIcon(null);
+        dlg.lM02Icon.setIcon(null);
+        dlg.lM03Icon.setIcon(null);
+        dlg.lM04Icon.setIcon(null);
+        dlg.lM05Icon.setIcon(null);
+
+        dlg.rbM01RegionA.setSelected(!getRegion());
+        dlg.rbM01RegionB.setSelected(getRegion());
+
+        if (isValid()) {
+            dlg.bM01Save.setEnabled(true);
+
+            dlg.cM01TopMark.setSelected(hasTopMark());
+            dlg.cM01Fired.setSelected(isFired());
+
+            dlg.tfM01RepeatTime.setText(getLightPeriod());
+
+            dlg.tfM01Name.setText(getName());
+            dlg.tfM01Name.setEnabled(true);
+
+            if (hasRadar()) {
+                dlg.lM03Icon.setIcon(new ImageIcon(getClass().getResource(
+                        "/images/Radar_Reflector.png")));
+            }
+
+            if (hasRacon()) {
+                dlg.lM04Icon.setIcon(new ImageIcon(getClass().getResource(
+                        "/images/Radar_Station.png")));
+                dlg.cbM01Racon.setVisible(true);
+                if (getRaType() == RATYPE_RACON) {
+                    dlg.lM01Racon.setVisible(true);
+                    dlg.tfM01Racon.setVisible(true);
+                    dlg.tfM01Racon.setEnabled(true);
+                } else {
+                    dlg.lM01Racon.setVisible(false);
+                    dlg.tfM01Racon.setVisible(false);
+                }
+            } else {
+                dlg.cbM01Racon.setVisible(false);
+                dlg.lM01Racon.setVisible(false);
+                dlg.tfM01Racon.setVisible(false);
+            }
+
+            if (hasFog()) {
+                dlg.lM05Icon.setIcon(new ImageIcon(getClass().getResource(
+                        "/images/Fog_Signal.png")));
+                dlg.cbM01Fog.setVisible(true);
+                if (getFogSound() == 0) {
+                    dlg.lM01FogGroup.setVisible(false);
+                    dlg.tfM01FogGroup.setVisible(false);
+                    dlg.lM01FogPeriod.setVisible(false);
+                    dlg.tfM01FogPeriod.setVisible(false);
+                } else {
+                    dlg.lM01FogGroup.setVisible(true);
+                    dlg.tfM01FogGroup.setVisible(true);
+                    dlg.lM01FogPeriod.setVisible(true);
+                    dlg.tfM01FogPeriod.setVisible(true);
+                }
+            } else {
+                dlg.cbM01Fog.setVisible(false);
+                dlg.lM01FogGroup.setVisible(false);
+                dlg.tfM01FogGroup.setVisible(false);
+                dlg.lM01FogPeriod.setVisible(false);
+                dlg.tfM01FogPeriod.setVisible(false);
+            }
+
+            if (isFired()) {
+                String lp, c;
+                String tmp = null;
+                int i1;
+
+                String col = getLightColour();
+                if (col.equals("W")) {
+                    dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
+                            "/images/Light_White_120.png")));
+                    dlg.cbM01Colour.setSelectedIndex(WHITE_LIGHT);
+                } else if (col.equals("R")) {
+                    dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
+                            "/images/Light_Red_120.png")));
+                    dlg.cbM01Colour.setSelectedIndex(RED_LIGHT);
+                } else if (col.equals("G")) {
+                    dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
+                            "/images/Light_Green_120.png")));
+                    dlg.cbM01Colour.setSelectedIndex(GREEN_LIGHT);
+                } else {
+                    dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
+                            "/images/Light_Magenta_120.png")));
+                    dlg.cbM01Colour.setSelectedIndex(UNKNOWN_COLOUR);
+                }
+
+                c = getLightChar();
+                if (c.contains("+")) {
+                    i1 = c.indexOf("+");
+                    tmp = c.substring(i1, c.length());
+                    c = c.substring(0, i1);
+                    if (!getLightGroup().isEmpty()) {
+                        c = c + "(" + getLightGroup() + ")";
+                    }
+                    if (tmp != null)
+                        c = c + tmp;
+                }
+                dlg.cbM01Kennung.setSelectedItem(c);
+                if (((dlg.cbM01Kennung.getSelectedIndex() == 0) && !getLightGroup()
+                        .isEmpty())
+                        || (((String) dlg.cbM01Kennung.getSelectedItem()).contains("("))
+                        && !(((String) dlg.cbM01Kennung.getSelectedItem()).contains("+"))) {
+                    c = c + "(" + getLightGroup() + ")";
+                    dlg.cbM01Kennung.setSelectedItem(c);
+                }
+                c = c + " " + getLightColour();
+                lp = getLightPeriod();
+                if (!lp.isEmpty())
+                    c = c + " " + lp + "s";
+                dlg.lM01FireMark.setText(c);
+                dlg.cM01Fired.setVisible(true);
+                dlg.lM01Kennung.setVisible(true);
+                dlg.cbM01Kennung.setVisible(true);
+                if (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) {
+                    dlg.tfM01Group.setVisible(false);
+                    dlg.lM01Group.setVisible(false);
+                } else {
+                    dlg.lM01Group.setVisible(true);
+                    dlg.tfM01Group.setVisible(true);
+                }
+                dlg.tfM01Group.setText(getLightGroup());
+                dlg.lM01RepeatTime.setVisible(true);
+                dlg.tfM01RepeatTime.setVisible(true);
+                if (isSectored()) {
+                    dlg.rbM01Fired1.setSelected(false);
+                    dlg.rbM01FiredN.setSelected(true);
+                    if ((getSectorIndex() != 0) && (!LightChar[0].isEmpty()))
+                        dlg.cbM01Kennung.setEnabled(false);
+                    else
+                        dlg.cbM01Kennung.setEnabled(true);
+                    dlg.cbM01Kennung.setSelectedItem(getLightChar());
+                    if ((getSectorIndex() != 0) && (!LightGroup[0].isEmpty()))
+                        dlg.tfM01Group.setEnabled(false);
+                    else
+                        dlg.tfM01Group.setEnabled(true);
+                    dlg.tfM01Group.setText(getLightGroup());
+                    if ((getSectorIndex() != 0) && (!LightPeriod[0].isEmpty()))
+                        dlg.tfM01RepeatTime.setEnabled(false);
+                    else
+                        dlg.tfM01RepeatTime.setEnabled(true);
+                    dlg.tfM01RepeatTime.setText(getLightPeriod());
+                    if ((getSectorIndex() != 0) && (!Height[0].isEmpty()))
+                        dlg.tfM01Height.setEnabled(false);
+                    else
+                        dlg.tfM01Height.setEnabled(true);
+                    dlg.tfM01Height.setText(getHeight());
+                    if ((getSectorIndex() != 0) && (!Range[0].isEmpty()))
+                        dlg.tfM01Range.setEnabled(false);
+                    else
+                        dlg.tfM01Range.setEnabled(true);
+                    dlg.tfM01Range.setText(getRange());
+                    dlg.lM01Sector.setVisible(true);
+                    dlg.cbM01Sector.setVisible(true);
+                    if (getSectorIndex() == 0) {
+                        dlg.lM01Colour.setVisible(false);
+                        dlg.cbM01Colour.setVisible(false);
+                        dlg.lM01Bearing.setVisible(false);
+                        dlg.tfM01Bearing.setVisible(false);
+                        dlg.tfM02Bearing.setVisible(false);
+                        dlg.tfM01Radius.setVisible(false);
+                    } else {
+                        dlg.lM01Colour.setVisible(true);
+                        dlg.cbM01Colour.setVisible(true);
+                        dlg.lM01Bearing.setVisible(true);
+                        dlg.tfM01Bearing.setVisible(true);
+                        dlg.tfM01Bearing.setText(getBearing1());
+                        dlg.tfM02Bearing.setVisible(true);
+                        dlg.tfM02Bearing.setText(getBearing2());
+                        dlg.tfM01Radius.setVisible(true);
+                        dlg.tfM01Radius.setText(getRadius());
+                    }
+                } else {
+                    dlg.rbM01FiredN.setSelected(false);
+                    dlg.rbM01Fired1.setSelected(true);
+                    dlg.cbM01Kennung.setEnabled(true);
+                    dlg.tfM01Group.setEnabled(true);
+                    dlg.tfM01RepeatTime.setEnabled(true);
+                    dlg.tfM01Height.setEnabled(true);
+                    dlg.tfM01Range.setEnabled(true);
+                    dlg.lM01Colour.setVisible(true);
+                    dlg.cbM01Colour.setVisible(true);
+                    dlg.lM01Sector.setVisible(false);
+                    dlg.cbM01Sector.setVisible(false);
+                    dlg.lM01Bearing.setVisible(false);
+                    dlg.tfM01Bearing.setVisible(false);
+                    dlg.tfM02Bearing.setVisible(false);
+                    dlg.tfM01Radius.setVisible(false);
+                }
+            } else {
+                dlg.lM01FireMark.setText("");
+                dlg.rbM01Fired1.setVisible(false);
+                dlg.rbM01FiredN.setVisible(false);
+                dlg.cbM01Kennung.setVisible(false);
+                dlg.lM01Kennung.setVisible(false);
+                dlg.tfM01Height.setVisible(false);
+                dlg.lM01Height.setVisible(false);
+                dlg.tfM01Range.setVisible(false);
+                dlg.lM01Range.setVisible(false);
+                dlg.cbM01Colour.setVisible(false);
+                dlg.lM01Colour.setVisible(false);
+                dlg.cbM01Sector.setVisible(false);
+                dlg.lM01Sector.setVisible(false);
+                dlg.tfM01Group.setVisible(false);
+                dlg.lM01Group.setVisible(false);
+                dlg.tfM01RepeatTime.setVisible(false);
+                dlg.lM01RepeatTime.setVisible(false);
+                dlg.tfM01Bearing.setVisible(false);
+                dlg.lM01Bearing.setVisible(false);
+                dlg.tfM02Bearing.setVisible(false);
+                dlg.tfM01Radius.setVisible(false);
+            }
+        } else {
+            dlg.bM01Save.setEnabled(false);
+            dlg.tfM01Name.setEnabled(false);
+            dlg.cM01TopMark.setVisible(false);
+            dlg.cbM01TopMark.setVisible(false);
+            dlg.cM01Radar.setVisible(false);
+            dlg.cM01Racon.setVisible(false);
+            dlg.cbM01Racon.setVisible(false);
+            dlg.tfM01Racon.setVisible(false);
+            dlg.lM01Racon.setVisible(false);
+            dlg.cM01Fog.setVisible(false);
+            dlg.cbM01Fog.setVisible(false);
+            dlg.tfM01FogGroup.setVisible(false);
+            dlg.lM01FogGroup.setVisible(false);
+            dlg.tfM01FogPeriod.setVisible(false);
+            dlg.lM01FogPeriod.setVisible(false);
+            dlg.cM01Fired.setVisible(false);
+            dlg.rbM01Fired1.setVisible(false);
+            dlg.rbM01FiredN.setVisible(false);
+            dlg.cbM01Kennung.setVisible(false);
+            dlg.lM01Kennung.setVisible(false);
+            dlg.tfM01Height.setVisible(false);
+            dlg.lM01Height.setVisible(false);
+            dlg.tfM01Range.setVisible(false);
+            dlg.lM01Range.setVisible(false);
+            dlg.cbM01Colour.setVisible(false);
+            dlg.lM01Colour.setVisible(false);
+            dlg.cbM01Sector.setVisible(false);
+            dlg.lM01Sector.setVisible(false);
+            dlg.tfM01Group.setVisible(false);
+            dlg.lM01Group.setVisible(false);
+            dlg.tfM01RepeatTime.setVisible(false);
+            dlg.lM01RepeatTime.setVisible(false);
+            dlg.tfM01Bearing.setVisible(false);
+            dlg.lM01Bearing.setVisible(false);
+            dlg.tfM02Bearing.setVisible(false);
+            dlg.tfM01Radius.setVisible(false);
+        }
+        dlg.paintlock = false;
+    }
+
+    public void saveSign(String type) {
+        delSeaMarkKeys(Node);
+
+        String str = dlg.tfM01Name.getText();
+        if (!str.isEmpty())
+            Main.main.undoRedo.add(new ChangePropertyCommand(Node, "seamark:name",
+                    str));
+        Main.main.undoRedo
+                .add(new ChangePropertyCommand(Node, "seamark:type", type));
+    }
+
+    protected void saveLightData() {
+        String colour;
+        if (dlg.cM01Fired.isSelected()) {
+            if (!(colour = LightColour[0]).isEmpty())
+                if (colour.equals("R")) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:light:colour", "red"));
+                } else if (colour.equals("G")) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:light:colour", "green"));
+                } else if (colour.equals("W")) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:light:colour", "white"));
+                }
+
+            if (!LightPeriod[0].isEmpty())
+                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                        "seamark:light:period", LightPeriod[0]));
+
+            if (!LightChar[0].isEmpty())
+                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                        "seamark:light:character", LightChar[0]));
+
+            if (!LightGroup[0].isEmpty())
+                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                        "seamark:light:group", LightGroup[0]));
+
+            if (!Height[0].isEmpty())
+                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                        "seamark:light:height", Height[0]));
+
+            if (!Range[0].isEmpty())
+                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                        "seamark:light:range", Range[0]));
+
+            for (int i = 1; i < 10; i++) {
+                if ((colour = LightColour[i]) != null)
+                    if (colour.equals("R")) {
+                        Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                                "seamark:light:" + i + ":colour", "red"));
+                        if ((Bearing1[i] != null) && (Bearing2[i] != null)
+                                && (Radius[i] != null))
+                            Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                                    "seamark:light:" + i, "red:" + Bearing1[i] + ":"
+                                            + Bearing2[i] + ":" + Radius[i]));
+                    } else if (colour.equals("G")) {
+                        Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                                "seamark:light:" + i + ":colour", "green"));
+                        if ((Bearing1[i] != null) && (Bearing2[i] != null)
+                                && (Radius[i] != null))
+                            Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                                    "seamark:light:" + i, "green:" + Bearing1[i] + ":"
+                                            + Bearing2[i] + ":" + Radius[i]));
+                    } else if (colour.equals("W")) {
+                        Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                                "seamark:light:" + i + ":colour", "white"));
+                        if ((Bearing1[i] != null) && (Bearing2[i] != null)
+                                && (Radius[i] != null))
+                            Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                                    "seamark:light:" + i, "white:" + Bearing1[i] + ":"
+                                            + Bearing2[i] + ":" + Radius[i]));
+                    }
+
+                if (LightPeriod[i] != null)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:light:" + i + ":period", LightPeriod[i]));
+
+                if (LightChar[i] != null)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:light:" + i + ":character", LightChar[i]));
+
+                if (LightGroup[i] != null)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:light:" + i + ":group", LightGroup[i]));
+
+                if (Height[i] != null)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:light:" + i + ":height", Height[i]));
+
+                if (Range[i] != null)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:light:" + i + ":range", Range[i]));
+
+                if (Bearing1[i] != null)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:light:" + i + ":sector_start", Bearing1[i]));
+
+                if (Bearing2[i] != null)
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:light:" + i + ":sector_end", Bearing2[i]));
+            }
+        }
+    }
+
+    protected void saveTopMarkData(String shape, String colour) {
+        if (dlg.cM01TopMark.isSelected()) {
+            Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                    "seamark:topmark:shape", shape));
+            Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                    "seamark:topmark:colour", colour));
+        }
+    }
+
+    protected void saveRadarFogData() {
+        if (hasRadar()) {
+            Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                    "seamark:radar_reflector", "yes"));
+        }
+        if (hasRacon()) {
+            switch (RaType) {
+            case RATYPE_RACON:
+                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                        "seamark:radar_transponder:category", "racon"));
+                if (!getRaconGroup().isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:radar_transponder:group", getRaconGroup()));
+                break;
+            case RATYPE_RAMARK:
+                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                        "seamark:radar_transponder:category", "ramark"));
+                break;
+            case RATYPE_LEADING:
+                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                        "seamark:radar_transponder:category", "leading"));
+                break;
+            default:
+                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                        "seamark:radar_transponder", "yes"));
+            }
+        }
+        if (hasFog()) {
+            if (getFogSound() == 0) {
+                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                        "seamark:fog_signal", "yes"));
+            } else {
+                switch (getFogSound()) {
+                case FOG_HORN:
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:fog_signal:category", "horn"));
+                    break;
+                case FOG_SIREN:
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:fog_signal:category", "siren"));
+                    break;
+                case FOG_DIA:
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:fog_signal:category", "diaphone"));
+                    break;
+                case FOG_BELL:
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:fog_signal:category", "bell"));
+                    break;
+                case FOG_WHIS:
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:fog_signal:category", "whistle"));
+                    break;
+                case FOG_GONG:
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:fog_signal:category", "gong"));
+                    break;
+                case FOG_EXPLOS:
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:fog_signal:category", "explosive"));
+                    break;
+                }
+                if (!getFogGroup().isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:fog_signal:group", getFogGroup()));
+                if (!getFogPeriod().isEmpty())
+                    Main.main.undoRedo.add(new ChangePropertyCommand(Node,
+                            "seamark:fog_signal:period", getFogPeriod()));
+            }
+        }
+    }
+
+    public void refreshStyles() {
+    }
+
+    public void refreshLights() {
+        dlg.cbM01Kennung.removeAllItems();
+        dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("Fl"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("LFl"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("Iso"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("F"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("FFl"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("IQ"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("VQ"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("IVQ"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("UQ"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("IUQ"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("Mo"); //$NON-NLS-1$
+        dlg.cbM01Kennung.setSelectedIndex(0);
+    }
+
+    public void resetMask() {
+        setRegion(Main.pref.get("tomsplugin.IALA").equals("B"));
+
+        dlg.lM01Icon.setIcon(null);
+        dlg.lM02Icon.setIcon(null);
+        dlg.lM03Icon.setIcon(null);
+        dlg.lM04Icon.setIcon(null);
+
+        dlg.rbM01RegionA.setEnabled(false);
+        dlg.rbM01RegionB.setEnabled(false);
+        dlg.lM01FireMark.setText("");
+        dlg.cbM01CatOfMark.removeAllItems();
+        dlg.cbM01CatOfMark.setVisible(false);
+        dlg.lM01CatOfMark.setVisible(false);
+        setBuoyIndex(0);
+        dlg.cbM01StyleOfMark.removeAllItems();
+        dlg.cbM01StyleOfMark.setVisible(false);
+        dlg.lM01StyleOfMark.setVisible(false);
+        setStyleIndex(0);
+        dlg.tfM01Name.setText("");
+        dlg.tfM01Name.setEnabled(false);
+        setName("");
+        dlg.cM01TopMark.setSelected(false);
+        dlg.cM01TopMark.setVisible(false);
+        dlg.cbM01TopMark.removeAllItems();
+        dlg.cbM01TopMark.setVisible(false);
+        setTopMark(false);
+        dlg.cM01Radar.setSelected(false);
+        dlg.cM01Radar.setVisible(false);
+        setRadar(false);
+        dlg.cM01Racon.setSelected(false);
+        dlg.cM01Racon.setVisible(false);
+        dlg.cbM01Racon.setVisible(false);
+        dlg.tfM01Racon.setText("");
+        dlg.tfM01Racon.setVisible(false);
+        dlg.lM01Racon.setVisible(false);
+        setRacon(false);
+        setRaType(0);
+        dlg.cM01Fog.setSelected(false);
+        dlg.cM01Fog.setVisible(false);
+        dlg.cbM01Fog.setVisible(false);
+        setFogSound(0);
+        dlg.tfM01FogGroup.setText("");
+        dlg.tfM01FogGroup.setVisible(false);
+        dlg.lM01FogGroup.setVisible(false);
+        dlg.tfM01FogPeriod.setText("");
+        dlg.tfM01FogPeriod.setVisible(false);
+        dlg.lM01FogPeriod.setVisible(false);
+        setFog(false);
+        dlg.cM01Fired.setSelected(false);
+        dlg.cM01Fired.setVisible(false);
+        setFired(false);
+        dlg.rbM01Fired1.setVisible(false);
+        dlg.rbM01Fired1.setSelected(true);
+        dlg.rbM01FiredN.setVisible(false);
+        dlg.rbM01FiredN.setSelected(false);
+        setSectored(false);
+        dlg.cbM01Kennung.removeAllItems();
+        dlg.cbM01Kennung.setVisible(false);
+        dlg.lM01Kennung.setVisible(false);
+        setLightChar("");
+        dlg.tfM01Height.setText("");
+        dlg.tfM01Height.setVisible(false);
+        dlg.lM01Height.setVisible(false);
+        setHeight("");
+        dlg.tfM01Range.setText("");
+        dlg.tfM01Range.setVisible(false);
+        dlg.lM01Range.setVisible(false);
+        setRange("");
+        dlg.cbM01Colour.setVisible(false);
+        dlg.lM01Colour.setVisible(false);
+        setLightColour("");
+        dlg.cbM01Sector.setVisible(false);
+        dlg.lM01Sector.setVisible(false);
+        setSectorIndex(0);
+        dlg.tfM01Group.setText("");
+        dlg.tfM01Group.setVisible(false);
+        dlg.lM01Group.setVisible(false);
+        setLightGroup("");
+        dlg.tfM01RepeatTime.setText("");
+        dlg.tfM01RepeatTime.setVisible(false);
+        dlg.lM01RepeatTime.setVisible(false);
+        setLightPeriod("");
+        dlg.tfM01Bearing.setText("");
+        dlg.tfM01Bearing.setVisible(false);
+        dlg.lM01Bearing.setVisible(false);
+        setBearing1("");
+        dlg.tfM02Bearing.setText("");
+        dlg.tfM02Bearing.setVisible(false);
+        setBearing2("");
+        dlg.tfM01Radius.setText("");
+        dlg.tfM01Radius.setVisible(false);
+        setRadius("");
+
+        dlg.bM01Save.setEnabled(false);
+    }
 
 }
Index: /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java	(revision 23193)
@@ -18,412 +18,412 @@
 public class BuoyCard extends Buoy {
 
-	public BuoyCard(SmpDialogAction dia, Node node) {
-		super(dia);
-
-		String str;
-		Map<String, String> keys;
-		keys = node.getKeys();
-		setNode(node);
-
-		resetMask();
-		dlg.cbM01CatOfMark.removeAllItems();
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.157")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.158")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.159")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.160")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.161")); //$NON-NLS-1$
-
-		dlg.cbM01CatOfMark.setEnabled(true);
-		dlg.cbM01CatOfMark.setVisible(true);
-		dlg.lM01CatOfMark.setVisible(true);
-
-		dlg.cbM01StyleOfMark.removeAllItems();
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.setVisible(true);
-		dlg.lM01StyleOfMark.setVisible(true);
-
-		dlg.cbM01TypeOfMark.setSelectedIndex(CARDINAL);
-
-		setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$
-		if (keys.containsKey("name")) //$NON-NLS-1$
-			setName(keys.get("name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:buoy_cardinal:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:buoy_cardinal:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:beacon_cardinal:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:beacon_cardinal:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$
-
-		String cat = ""; //$NON-NLS-1$
-		String col = ""; //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:buoy_cardinal:category")) //$NON-NLS-1$
-			cat = keys.get("seamark:buoy_cardinal:category"); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:beacon_cardinal:category")) //$NON-NLS-1$
-			cat = keys.get("seamark:beacon_cardinal:category"); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:buoy_cardinal:colour")) //$NON-NLS-1$
-			col = keys.get("seamark:buoy_cardinal:colour"); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:beacon_cardinal:colour")) //$NON-NLS-1$
-			col = keys.get("seamark:beacon_cardinal:colour"); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:light_float:colour")) //$NON-NLS-1$
-			col = keys.get("seamark:light_float:colour"); //$NON-NLS-1$
-
-		if (cat.isEmpty()) { //$NON-NLS-1$
-			if (col.equals("black;yellow")) { //$NON-NLS-1$
-				setBuoyIndex(CARD_NORTH);
-				setColour(BLACK_YELLOW);
-			} else if (col.equals("black;yellow;black")) { //$NON-NLS-1$
-				setBuoyIndex(CARD_EAST);
-				setColour(BLACK_YELLOW_BLACK);
-			} else if (col.equals("yellow;black")) { //$NON-NLS-1$
-				setBuoyIndex(CARD_SOUTH);
-				setColour(YELLOW_BLACK);
-			} else if (col.equals("yellow;black;yellow")) { //$NON-NLS-1$
-				setBuoyIndex(CARD_WEST);
-				setColour(YELLOW_BLACK_YELLOW);
-			}
-		} else if (cat.equals("north")) { //$NON-NLS-1$
-			setBuoyIndex(CARD_NORTH);
-			setColour(BLACK_YELLOW);
-		} else if (cat.equals("east")) { //$NON-NLS-1$
-			setBuoyIndex(CARD_EAST);
-			setColour(BLACK_YELLOW_BLACK);
-		} else if (cat.equals("south")) { //$NON-NLS-1$
-			setBuoyIndex(CARD_SOUTH);
-			setColour(YELLOW_BLACK);
-		} else if (cat.equals("west")) { //$NON-NLS-1$
-			setBuoyIndex(CARD_WEST);
-			setColour(YELLOW_BLACK_YELLOW);
-		}
-
-		if (keys.containsKey("seamark:buoy_cardinal:shape")) { //$NON-NLS-1$
-			str = keys.get("seamark:buoy_cardinal:shape"); //$NON-NLS-1$
-
-			if (str.equals("pillar")) //$NON-NLS-1$
-				setStyleIndex(CARD_PILLAR);
-			else if (str.equals("spar")) //$NON-NLS-1$
-				setStyleIndex(CARD_SPAR);
-		} else if (keys.containsKey("seamark:beacon_cardinal:colour")) { //$NON-NLS-1$
-			if (keys.containsKey("seamark:beacon_cardinal:shape")) { //$NON-NLS-1$
-				str = keys.get("seamark:beacon_cardinal:shape"); //$NON-NLS-1$
-
-				if (str.equals("tower")) //$NON-NLS-1$
-					setStyleIndex(CARD_TOWER);
-				else
-					setStyleIndex(CARD_BEACON);
-			} else
-				setStyleIndex(CARD_BEACON);
-		} else if (keys.containsKey("seamark:type") //$NON-NLS-1$
-				&& (keys.get("seamark:type").equals("light_float"))) { //$NON-NLS-1$ //$NON-NLS-2$
-			setStyleIndex(CARD_FLOAT);
-		}
-
-		if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
-			setStyleIndex(0);
-
-		refreshLights();
-		parseLights(keys);
-		parseFogRadar(keys);
-		
-		dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());
-		dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
-		dlg.tfM01Name.setText(getName());
-		dlg.cM01TopMark.setSelected(hasTopMark());
-	}
-
-	public void refreshLights() {
-		int type = getBuoyIndex();
-
-		dlg.cbM01Kennung.removeAllItems();
-		dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
-		dlg.cbM01Kennung.setSelectedIndex(0);
-
-		switch (type) {
-		case SeaMark.CARD_NORTH:
-			dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$
-			dlg.cbM01Kennung.addItem("VQ"); //$NON-NLS-1$
-			break;
-
-		case SeaMark.CARD_EAST:
-			dlg.cbM01Kennung.addItem("Q(3)"); //$NON-NLS-1$
-			dlg.cbM01Kennung.addItem("VQ(3)"); //$NON-NLS-1$
-			break;
-
-		case SeaMark.CARD_SOUTH:
-			dlg.cbM01Kennung.addItem("Q(6)+LFl"); //$NON-NLS-1$
-			dlg.cbM01Kennung.addItem("VQ(6)+LFl"); //$NON-NLS-1$
-			break;
-
-		case SeaMark.CARD_WEST:
-			dlg.cbM01Kennung.addItem("Q(9)"); //$NON-NLS-1$
-			dlg.cbM01Kennung.addItem("VQ(9)"); //$NON-NLS-1$
-			break;
-
-		default:
-		}
-
-	}
-
-	public boolean isValid() {
-		return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
-	}
-
-	public void paintSign() {
-		if (dlg.paintlock)
-			return;
-		super.paintSign();
-
-		dlg.sM01StatusBar.setText(getErrMsg());
-
-		if (isValid()) {
-			dlg.tfM01Name.setEnabled(true);
-			dlg.tfM01Name.setText(getName());
-			dlg.cM01TopMark.setSelected(true);
-			dlg.cM01TopMark.setVisible(true);
-			dlg.cM01TopMark.setEnabled(false);
-			dlg.cM01Radar.setVisible(true);
-			dlg.cM01Racon.setVisible(true);
-			dlg.cM01Fog.setVisible(true);
-			dlg.cM01Fired.setEnabled(true);
-			dlg.cM01Fired.setVisible(true);
-			dlg.cbM01Colour.setVisible(false);
-			dlg.lM01Colour.setVisible(false);
-			dlg.rbM01Fired1.setVisible(false);
-			dlg.rbM01FiredN.setVisible(false);
-			dlg.lM01Height.setVisible(false);
-			dlg.tfM01Height.setVisible(false);
-			dlg.lM01Range.setVisible(false);
-			dlg.tfM01Range.setVisible(false);
-
-			if (isFired()) {
-				switch (getStyleIndex()) {
-				case LAT_BEACON:
-				case LAT_TOWER:
-					dlg.rbM01Fired1.setVisible(true);
-					dlg.rbM01FiredN.setVisible(true);
-					dlg.lM01Height.setVisible(true);
-					dlg.tfM01Height.setVisible(true);
-					dlg.lM01Range.setVisible(true);
-					dlg.tfM01Range.setVisible(true);
-					break;
-				case LAT_FLOAT:
-					dlg.lM01Height.setVisible(true);
-					dlg.tfM01Height.setVisible(true);
-					dlg.lM01Range.setVisible(true);
-					dlg.tfM01Range.setVisible(true);
-					break;
-				default:
-				}
-			}
-			String image = "/images/Cardinal"; //$NON-NLS-1$
-
-			switch (getStyleIndex()) {
-			case SeaMark.CARD_PILLAR:
-				image += "_Pillar"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_SPAR:
-				image += "_Spar"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_BEACON:
-				image += "_Beacon"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_TOWER:
-				image += "_Tower"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_FLOAT:
-				image += "_Float"; //$NON-NLS-1$
-				break;
-
-			default:
-				return;
-			}
-
-			switch (getBuoyIndex()) {
-			case CARD_NORTH:
-				image += "_North"; //$NON-NLS-1$
-				break;
-			case CARD_EAST:
-				image += "_East"; //$NON-NLS-1$
-				break;
-			case CARD_SOUTH:
-				image += "_South"; //$NON-NLS-1$
-				break;
-			case CARD_WEST:
-				image += "_West"; //$NON-NLS-1$
-				break;
-			default:
-				return;
-			}
-
-			if (!image.equals("/images/Cardinal")) { //$NON-NLS-1$
-				image += ".png"; //$NON-NLS-1$
-				dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image)));
-
-			} else
-				dlg.lM01Icon.setIcon(null);
-		}
-	}
-
-	public void setLightColour() {
-		super.setLightColour("W"); //$NON-NLS-1$
-	}
-
-	public void saveSign() {
-		Node node = getNode();
-		if (node == null) {
-			return;
-		}
-
-		String shape = ""; //$NON-NLS-1$
-
-		switch (getStyleIndex()) {
-		case CARD_PILLAR:
-			super.saveSign("buoy_cardinal"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_cardinal:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case CARD_SPAR:
-			super.saveSign("buoy_cardinal"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_cardinal:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case CARD_BEACON:
-			super.saveSign("beacon_cardinal"); //$NON-NLS-1$
-			break;
-		case CARD_TOWER:
-			super.saveSign("beacon_cardinal"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:beacon_cardinal:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case CARD_FLOAT:
-			super.saveSign("light_float"); //$NON-NLS-1$
-			break;
-		default:
-		}
-
-		switch (getStyleIndex()) {
-		case CARD_PILLAR:
-		case CARD_SPAR:
-			switch (getBuoyIndex()) {
-			case SeaMark.CARD_NORTH:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_cardinal:category", "north")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_cardinal:colour", "black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones up"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_EAST:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_cardinal:category", "east")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_cardinal:colour", "black;yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones base together"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_SOUTH:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_cardinal:category", "south")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_cardinal:colour", "yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones down"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_WEST:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_cardinal:category", "west")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_cardinal:colour", "yellow;black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones point together"; //$NON-NLS-1$
-				break;
-			}
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_cardinal:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case CARD_BEACON:
-		case CARD_TOWER:
-			switch (getBuoyIndex()) {
-			case SeaMark.CARD_NORTH:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_cardinal:category", "north")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_cardinal:colour", "black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones up"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_EAST:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_cardinal:category", "east")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_cardinal:colour", "black;yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones base together"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_SOUTH:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_cardinal:category", "south")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_cardinal:colour", "yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones down"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_WEST:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_cardinal:category", "west")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_cardinal:colour", "yellow;black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones point together"; //$NON-NLS-1$
-				break;
-			}
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:beacon_cardinal:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case CARD_FLOAT:
-			switch (getBuoyIndex()) {
-			case SeaMark.CARD_NORTH:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:light_float:colour", "black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones up"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_EAST:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:light_float:colour", "black;yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones base together"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_SOUTH:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:light_float:colour", "yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones down"; //$NON-NLS-1$
-				break;
-
-			case SeaMark.CARD_WEST:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:light_float:colour", "yellow;black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-				shape = "2 cones point together"; //$NON-NLS-1$
-				break;
-			}
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:light_float:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		}
-		saveTopMarkData(shape, "black"); //$NON-NLS-1$
-		saveLightData(); //$NON-NLS-1$
-		saveRadarFogData();
-	}
+    public BuoyCard(SmpDialogAction dia, Node node) {
+        super(dia);
+
+        String str;
+        Map<String, String> keys;
+        keys = node.getKeys();
+        setNode(node);
+
+        resetMask();
+        dlg.cbM01CatOfMark.removeAllItems();
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.157")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.158")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.159")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.160")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.161")); //$NON-NLS-1$
+
+        dlg.cbM01CatOfMark.setEnabled(true);
+        dlg.cbM01CatOfMark.setVisible(true);
+        dlg.lM01CatOfMark.setVisible(true);
+
+        dlg.cbM01StyleOfMark.removeAllItems();
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.setVisible(true);
+        dlg.lM01StyleOfMark.setVisible(true);
+
+        dlg.cbM01TypeOfMark.setSelectedIndex(CARDINAL);
+
+        setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$
+        if (keys.containsKey("name")) //$NON-NLS-1$
+            setName(keys.get("name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:buoy_cardinal:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:buoy_cardinal:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:beacon_cardinal:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:beacon_cardinal:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$
+
+        String cat = ""; //$NON-NLS-1$
+        String col = ""; //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:buoy_cardinal:category")) //$NON-NLS-1$
+            cat = keys.get("seamark:buoy_cardinal:category"); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:beacon_cardinal:category")) //$NON-NLS-1$
+            cat = keys.get("seamark:beacon_cardinal:category"); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:buoy_cardinal:colour")) //$NON-NLS-1$
+            col = keys.get("seamark:buoy_cardinal:colour"); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:beacon_cardinal:colour")) //$NON-NLS-1$
+            col = keys.get("seamark:beacon_cardinal:colour"); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:light_float:colour")) //$NON-NLS-1$
+            col = keys.get("seamark:light_float:colour"); //$NON-NLS-1$
+
+        if (cat.isEmpty()) { //$NON-NLS-1$
+            if (col.equals("black;yellow")) { //$NON-NLS-1$
+                setBuoyIndex(CARD_NORTH);
+                setColour(BLACK_YELLOW);
+            } else if (col.equals("black;yellow;black")) { //$NON-NLS-1$
+                setBuoyIndex(CARD_EAST);
+                setColour(BLACK_YELLOW_BLACK);
+            } else if (col.equals("yellow;black")) { //$NON-NLS-1$
+                setBuoyIndex(CARD_SOUTH);
+                setColour(YELLOW_BLACK);
+            } else if (col.equals("yellow;black;yellow")) { //$NON-NLS-1$
+                setBuoyIndex(CARD_WEST);
+                setColour(YELLOW_BLACK_YELLOW);
+            }
+        } else if (cat.equals("north")) { //$NON-NLS-1$
+            setBuoyIndex(CARD_NORTH);
+            setColour(BLACK_YELLOW);
+        } else if (cat.equals("east")) { //$NON-NLS-1$
+            setBuoyIndex(CARD_EAST);
+            setColour(BLACK_YELLOW_BLACK);
+        } else if (cat.equals("south")) { //$NON-NLS-1$
+            setBuoyIndex(CARD_SOUTH);
+            setColour(YELLOW_BLACK);
+        } else if (cat.equals("west")) { //$NON-NLS-1$
+            setBuoyIndex(CARD_WEST);
+            setColour(YELLOW_BLACK_YELLOW);
+        }
+
+        if (keys.containsKey("seamark:buoy_cardinal:shape")) { //$NON-NLS-1$
+            str = keys.get("seamark:buoy_cardinal:shape"); //$NON-NLS-1$
+
+            if (str.equals("pillar")) //$NON-NLS-1$
+                setStyleIndex(CARD_PILLAR);
+            else if (str.equals("spar")) //$NON-NLS-1$
+                setStyleIndex(CARD_SPAR);
+        } else if (keys.containsKey("seamark:beacon_cardinal:colour")) { //$NON-NLS-1$
+            if (keys.containsKey("seamark:beacon_cardinal:shape")) { //$NON-NLS-1$
+                str = keys.get("seamark:beacon_cardinal:shape"); //$NON-NLS-1$
+
+                if (str.equals("tower")) //$NON-NLS-1$
+                    setStyleIndex(CARD_TOWER);
+                else
+                    setStyleIndex(CARD_BEACON);
+            } else
+                setStyleIndex(CARD_BEACON);
+        } else if (keys.containsKey("seamark:type") //$NON-NLS-1$
+                && (keys.get("seamark:type").equals("light_float"))) { //$NON-NLS-1$ //$NON-NLS-2$
+            setStyleIndex(CARD_FLOAT);
+        }
+
+        if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
+            setStyleIndex(0);
+
+        refreshLights();
+        parseLights(keys);
+        parseFogRadar(keys);
+        
+        dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());
+        dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
+        dlg.tfM01Name.setText(getName());
+        dlg.cM01TopMark.setSelected(hasTopMark());
+    }
+
+    public void refreshLights() {
+        int type = getBuoyIndex();
+
+        dlg.cbM01Kennung.removeAllItems();
+        dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
+        dlg.cbM01Kennung.setSelectedIndex(0);
+
+        switch (type) {
+        case SeaMark.CARD_NORTH:
+            dlg.cbM01Kennung.addItem("Q"); //$NON-NLS-1$
+            dlg.cbM01Kennung.addItem("VQ"); //$NON-NLS-1$
+            break;
+
+        case SeaMark.CARD_EAST:
+            dlg.cbM01Kennung.addItem("Q(3)"); //$NON-NLS-1$
+            dlg.cbM01Kennung.addItem("VQ(3)"); //$NON-NLS-1$
+            break;
+
+        case SeaMark.CARD_SOUTH:
+            dlg.cbM01Kennung.addItem("Q(6)+LFl"); //$NON-NLS-1$
+            dlg.cbM01Kennung.addItem("VQ(6)+LFl"); //$NON-NLS-1$
+            break;
+
+        case SeaMark.CARD_WEST:
+            dlg.cbM01Kennung.addItem("Q(9)"); //$NON-NLS-1$
+            dlg.cbM01Kennung.addItem("VQ(9)"); //$NON-NLS-1$
+            break;
+
+        default:
+        }
+
+    }
+
+    public boolean isValid() {
+        return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
+    }
+
+    public void paintSign() {
+        if (dlg.paintlock)
+            return;
+        super.paintSign();
+
+        dlg.sM01StatusBar.setText(getErrMsg());
+
+        if (isValid()) {
+            dlg.tfM01Name.setEnabled(true);
+            dlg.tfM01Name.setText(getName());
+            dlg.cM01TopMark.setSelected(true);
+            dlg.cM01TopMark.setVisible(true);
+            dlg.cM01TopMark.setEnabled(false);
+            dlg.cM01Radar.setVisible(true);
+            dlg.cM01Racon.setVisible(true);
+            dlg.cM01Fog.setVisible(true);
+            dlg.cM01Fired.setEnabled(true);
+            dlg.cM01Fired.setVisible(true);
+            dlg.cbM01Colour.setVisible(false);
+            dlg.lM01Colour.setVisible(false);
+            dlg.rbM01Fired1.setVisible(false);
+            dlg.rbM01FiredN.setVisible(false);
+            dlg.lM01Height.setVisible(false);
+            dlg.tfM01Height.setVisible(false);
+            dlg.lM01Range.setVisible(false);
+            dlg.tfM01Range.setVisible(false);
+
+            if (isFired()) {
+                switch (getStyleIndex()) {
+                case LAT_BEACON:
+                case LAT_TOWER:
+                    dlg.rbM01Fired1.setVisible(true);
+                    dlg.rbM01FiredN.setVisible(true);
+                    dlg.lM01Height.setVisible(true);
+                    dlg.tfM01Height.setVisible(true);
+                    dlg.lM01Range.setVisible(true);
+                    dlg.tfM01Range.setVisible(true);
+                    break;
+                case LAT_FLOAT:
+                    dlg.lM01Height.setVisible(true);
+                    dlg.tfM01Height.setVisible(true);
+                    dlg.lM01Range.setVisible(true);
+                    dlg.tfM01Range.setVisible(true);
+                    break;
+                default:
+                }
+            }
+            String image = "/images/Cardinal"; //$NON-NLS-1$
+
+            switch (getStyleIndex()) {
+            case SeaMark.CARD_PILLAR:
+                image += "_Pillar"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_SPAR:
+                image += "_Spar"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_BEACON:
+                image += "_Beacon"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_TOWER:
+                image += "_Tower"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_FLOAT:
+                image += "_Float"; //$NON-NLS-1$
+                break;
+
+            default:
+                return;
+            }
+
+            switch (getBuoyIndex()) {
+            case CARD_NORTH:
+                image += "_North"; //$NON-NLS-1$
+                break;
+            case CARD_EAST:
+                image += "_East"; //$NON-NLS-1$
+                break;
+            case CARD_SOUTH:
+                image += "_South"; //$NON-NLS-1$
+                break;
+            case CARD_WEST:
+                image += "_West"; //$NON-NLS-1$
+                break;
+            default:
+                return;
+            }
+
+            if (!image.equals("/images/Cardinal")) { //$NON-NLS-1$
+                image += ".png"; //$NON-NLS-1$
+                dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image)));
+
+            } else
+                dlg.lM01Icon.setIcon(null);
+        }
+    }
+
+    public void setLightColour() {
+        super.setLightColour("W"); //$NON-NLS-1$
+    }
+
+    public void saveSign() {
+        Node node = getNode();
+        if (node == null) {
+            return;
+        }
+
+        String shape = ""; //$NON-NLS-1$
+
+        switch (getStyleIndex()) {
+        case CARD_PILLAR:
+            super.saveSign("buoy_cardinal"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_cardinal:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case CARD_SPAR:
+            super.saveSign("buoy_cardinal"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_cardinal:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case CARD_BEACON:
+            super.saveSign("beacon_cardinal"); //$NON-NLS-1$
+            break;
+        case CARD_TOWER:
+            super.saveSign("beacon_cardinal"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:beacon_cardinal:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case CARD_FLOAT:
+            super.saveSign("light_float"); //$NON-NLS-1$
+            break;
+        default:
+        }
+
+        switch (getStyleIndex()) {
+        case CARD_PILLAR:
+        case CARD_SPAR:
+            switch (getBuoyIndex()) {
+            case SeaMark.CARD_NORTH:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_cardinal:category", "north")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_cardinal:colour", "black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones up"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_EAST:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_cardinal:category", "east")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_cardinal:colour", "black;yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones base together"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_SOUTH:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_cardinal:category", "south")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_cardinal:colour", "yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones down"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_WEST:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_cardinal:category", "west")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_cardinal:colour", "yellow;black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones point together"; //$NON-NLS-1$
+                break;
+            }
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_cardinal:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case CARD_BEACON:
+        case CARD_TOWER:
+            switch (getBuoyIndex()) {
+            case SeaMark.CARD_NORTH:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_cardinal:category", "north")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_cardinal:colour", "black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones up"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_EAST:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_cardinal:category", "east")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_cardinal:colour", "black;yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones base together"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_SOUTH:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_cardinal:category", "south")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_cardinal:colour", "yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones down"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_WEST:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_cardinal:category", "west")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_cardinal:colour", "yellow;black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones point together"; //$NON-NLS-1$
+                break;
+            }
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:beacon_cardinal:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case CARD_FLOAT:
+            switch (getBuoyIndex()) {
+            case SeaMark.CARD_NORTH:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:light_float:colour", "black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones up"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_EAST:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:light_float:colour", "black;yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones base together"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_SOUTH:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:light_float:colour", "yellow;black")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones down"; //$NON-NLS-1$
+                break;
+
+            case SeaMark.CARD_WEST:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:light_float:colour", "yellow;black;yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+                shape = "2 cones point together"; //$NON-NLS-1$
+                break;
+            }
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:light_float:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        }
+        saveTopMarkData(shape, "black"); //$NON-NLS-1$
+        saveLightData(); //$NON-NLS-1$
+        saveRadarFogData();
+    }
 }
Index: /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java	(revision 23193)
@@ -17,245 +17,245 @@
 
 public class BuoyIsol extends Buoy {
-	public BuoyIsol(SmpDialogAction dia, Node node) {
-		super(dia);
-
-		String str;
-		Map<String, String> keys;
-		keys = node.getKeys();
-		setNode(node);
-
-		resetMask();
-
-		dlg.cbM01TypeOfMark.setSelectedIndex(ISOLATED_DANGER);
-
-		dlg.cbM01StyleOfMark.removeAllItems();
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.setVisible(true);
-		dlg.lM01StyleOfMark.setVisible(true);
-
-		setBuoyIndex(ISOLATED_DANGER);
-		setColour(SeaMark.BLACK_RED_BLACK);
-		setLightColour("W"); //$NON-NLS-1$
-		setTopMark(true);
-		setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$
-
-		if (keys.containsKey("name")) //$NON-NLS-1$
-			setName(keys.get("name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:buoy_isolated_danger:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:buoy_isolated_danger:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:beacon_isolated_danger:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:beacon_isolated_danger:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:buoy_isolated_danger:shape")) { //$NON-NLS-1$
-			str = keys.get("seamark:buoy_isolated_danger:shape"); //$NON-NLS-1$
-
-			if (str.equals("pillar")) //$NON-NLS-1$
-				setStyleIndex(ISOL_PILLAR);
-			else if (str.equals("spar")) //$NON-NLS-1$
-				setStyleIndex(ISOL_SPAR);
-		} else if (keys.containsKey("seamark:beacon_isolated_danger:colour")) { //$NON-NLS-1$
-			if (keys.containsKey("seamark:beacon_isolated_danger:shape")) { //$NON-NLS-1$
-				str = keys.get("seamark:beacon_isolated_danger:shape"); //$NON-NLS-1$
-
-				if (str.equals("tower")) //$NON-NLS-1$
-					setStyleIndex(ISOL_TOWER);
-				else
-					setStyleIndex(ISOL_BEACON);
-			} else
-				setStyleIndex(ISOL_BEACON);
-		} else if (keys.containsKey("seamark:type") //$NON-NLS-1$
-				&& (keys.get("seamark:type").equals("light_float"))) { //$NON-NLS-1$ //$NON-NLS-2$
-			setStyleIndex(CARD_FLOAT);
-		}
-
-		if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
-			setStyleIndex(0);
-		dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
-
-		if (keys.containsKey("seamark:topmark:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:topmark:colour")) { //$NON-NLS-1$
-			setTopMark(true);
-		}
-
-		refreshLights();
-		parseLights(keys);
-		parseFogRadar(keys);
-
-		dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
-		dlg.tfM01Name.setText(getName());
-		dlg.cM01TopMark.setSelected(hasTopMark());
-	}
-	
-	public void refreshLights() {
-		dlg.cbM01Kennung.removeAllItems();
-		dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("Fl(2)"); //$NON-NLS-1$
-		dlg.cbM01Kennung.setSelectedIndex(0);
-	}
-	
-	public boolean isValid() {
-		return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
-	}
-
-	public void paintSign() {
-		if (dlg.paintlock)
-			return;
-		
-		super.paintSign();
-
-		dlg.sM01StatusBar.setText(getErrMsg());
-
-		if (isValid()) {
-			dlg.tfM01Name.setEnabled(true);
-			dlg.tfM01Name.setText(getName());
-			dlg.cM01TopMark.setVisible(true);
-			dlg.cM01Radar.setVisible(true);
-			dlg.cM01Racon.setVisible(true);
-			dlg.cM01Fog.setVisible(true);
-			dlg.cM01Fired.setVisible(true);
-			dlg.cbM01Colour.setVisible(false);
-			dlg.lM01Colour.setVisible(false);
-			dlg.rbM01Fired1.setVisible(false);
-			dlg.rbM01FiredN.setVisible(false);
-			dlg.lM01Height.setVisible(false);
-			dlg.tfM01Height.setVisible(false);
-			dlg.lM01Range.setVisible(false);
-			dlg.tfM01Range.setVisible(false);
-			
-			if (isFired()) {
-				switch (getStyleIndex()) {
-				case SPEC_FLOAT:
-					dlg.lM01Height.setVisible(true);
-					dlg.tfM01Height.setVisible(true);
-					dlg.lM01Range.setVisible(true);
-					dlg.tfM01Range.setVisible(true);
-					break;
-				case SPEC_BEACON:
-				case SPEC_TOWER:
-					dlg.rbM01Fired1.setVisible(true);
-					dlg.rbM01FiredN.setVisible(true);
-					dlg.lM01Height.setVisible(true);
-					dlg.tfM01Height.setVisible(true);
-					dlg.lM01Range.setVisible(true);
-					dlg.tfM01Range.setVisible(true);
-					break;
-				default:
-				}
-			}
-
-			String image = "/images/Cardinal"; //$NON-NLS-1$
-
-			switch (getStyleIndex()) {
-			case ISOL_PILLAR:
-				image += "_Pillar_Single"; //$NON-NLS-1$
-				break;
-			case ISOL_SPAR:
-				image += "_Spar_Single"; //$NON-NLS-1$
-				break;
-			case ISOL_BEACON:
-				image += "_Beacon_Single"; //$NON-NLS-1$
-				break;
-			case ISOL_TOWER:
-				image += "_Tower_Single"; //$NON-NLS-1$
-				break;
-			case ISOL_FLOAT:
-				image += "_Float_Single"; //$NON-NLS-1$
-				break;
-			default:
-			}
-
-			if (!image.equals("/images/Cardinal")) { //$NON-NLS-1$
-				image += ".png"; //$NON-NLS-1$
-				dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image)));
-			} else
-				dlg.lM01Icon.setIcon(null);
-		} else {
-			dlg.tfM01Name.setEnabled(false);
-			dlg.tfM01Name.setText(""); //$NON-NLS-1$
-			dlg.cM01TopMark.setVisible(false);
-			dlg.cM01Radar.setVisible(false);
-			dlg.cM01Racon.setVisible(false);
-			dlg.cM01Fog.setVisible(false);
-			dlg.cM01Fired.setVisible(false);
-		}
-	}
-
-	public void saveSign() {
-		Node node = getNode();
-
-		if (node == null) {
-			return;
-		}
-
-		switch (getStyleIndex()) {
-		case ISOL_PILLAR:
-			super.saveSign("buoy_isolated_danger"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_isolated_danger:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case ISOL_SPAR:
-			super.saveSign("buoy_isolated_danger"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_isolated_danger:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case ISOL_BEACON:
-			super.saveSign("beacon_isolated_danger"); //$NON-NLS-1$
-			break;
-		case ISOL_TOWER:
-			super.saveSign("beacon_isolated_danger"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:beacon_isolated_danger:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case ISOL_FLOAT:
-			super.saveSign("light_float"); //$NON-NLS-1$
-			break;
-		default:
-		}
-
-		switch (getStyleIndex()) {
-		case ISOL_PILLAR:
-		case ISOL_SPAR:
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_isolated_danger:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_isolated_danger:colour", "black;red;black")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case ISOL_BEACON:
-		case ISOL_TOWER:
-			Main.main.undoRedo
-					.add(new ChangePropertyCommand(node,
-							"seamark:beacon_isolated_danger:colour_pattern", //$NON-NLS-1$
-							"horizontal stripes")); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:beacon_isolated_danger:colour", "black;red;black")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case ISOL_FLOAT:
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:light_float:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:light_float:colour", "black;red;black")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		}
-
-		saveTopMarkData("2 spheres", "black"); //$NON-NLS-1$ //$NON-NLS-2$
-		saveLightData(); //$NON-NLS-1$
-		saveRadarFogData();
-
-	}
-
-	public void setLightColour() {
-		super.setLightColour("W"); //$NON-NLS-1$
-	}
+    public BuoyIsol(SmpDialogAction dia, Node node) {
+        super(dia);
+
+        String str;
+        Map<String, String> keys;
+        keys = node.getKeys();
+        setNode(node);
+
+        resetMask();
+
+        dlg.cbM01TypeOfMark.setSelectedIndex(ISOLATED_DANGER);
+
+        dlg.cbM01StyleOfMark.removeAllItems();
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.setVisible(true);
+        dlg.lM01StyleOfMark.setVisible(true);
+
+        setBuoyIndex(ISOLATED_DANGER);
+        setColour(SeaMark.BLACK_RED_BLACK);
+        setLightColour("W"); //$NON-NLS-1$
+        setTopMark(true);
+        setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$
+
+        if (keys.containsKey("name")) //$NON-NLS-1$
+            setName(keys.get("name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:buoy_isolated_danger:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:buoy_isolated_danger:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:beacon_isolated_danger:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:beacon_isolated_danger:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:buoy_isolated_danger:shape")) { //$NON-NLS-1$
+            str = keys.get("seamark:buoy_isolated_danger:shape"); //$NON-NLS-1$
+
+            if (str.equals("pillar")) //$NON-NLS-1$
+                setStyleIndex(ISOL_PILLAR);
+            else if (str.equals("spar")) //$NON-NLS-1$
+                setStyleIndex(ISOL_SPAR);
+        } else if (keys.containsKey("seamark:beacon_isolated_danger:colour")) { //$NON-NLS-1$
+            if (keys.containsKey("seamark:beacon_isolated_danger:shape")) { //$NON-NLS-1$
+                str = keys.get("seamark:beacon_isolated_danger:shape"); //$NON-NLS-1$
+
+                if (str.equals("tower")) //$NON-NLS-1$
+                    setStyleIndex(ISOL_TOWER);
+                else
+                    setStyleIndex(ISOL_BEACON);
+            } else
+                setStyleIndex(ISOL_BEACON);
+        } else if (keys.containsKey("seamark:type") //$NON-NLS-1$
+                && (keys.get("seamark:type").equals("light_float"))) { //$NON-NLS-1$ //$NON-NLS-2$
+            setStyleIndex(CARD_FLOAT);
+        }
+
+        if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
+            setStyleIndex(0);
+        dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
+
+        if (keys.containsKey("seamark:topmark:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:topmark:colour")) { //$NON-NLS-1$
+            setTopMark(true);
+        }
+
+        refreshLights();
+        parseLights(keys);
+        parseFogRadar(keys);
+
+        dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
+        dlg.tfM01Name.setText(getName());
+        dlg.cM01TopMark.setSelected(hasTopMark());
+    }
+    
+    public void refreshLights() {
+        dlg.cbM01Kennung.removeAllItems();
+        dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("Fl(2)"); //$NON-NLS-1$
+        dlg.cbM01Kennung.setSelectedIndex(0);
+    }
+    
+    public boolean isValid() {
+        return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
+    }
+
+    public void paintSign() {
+        if (dlg.paintlock)
+            return;
+        
+        super.paintSign();
+
+        dlg.sM01StatusBar.setText(getErrMsg());
+
+        if (isValid()) {
+            dlg.tfM01Name.setEnabled(true);
+            dlg.tfM01Name.setText(getName());
+            dlg.cM01TopMark.setVisible(true);
+            dlg.cM01Radar.setVisible(true);
+            dlg.cM01Racon.setVisible(true);
+            dlg.cM01Fog.setVisible(true);
+            dlg.cM01Fired.setVisible(true);
+            dlg.cbM01Colour.setVisible(false);
+            dlg.lM01Colour.setVisible(false);
+            dlg.rbM01Fired1.setVisible(false);
+            dlg.rbM01FiredN.setVisible(false);
+            dlg.lM01Height.setVisible(false);
+            dlg.tfM01Height.setVisible(false);
+            dlg.lM01Range.setVisible(false);
+            dlg.tfM01Range.setVisible(false);
+            
+            if (isFired()) {
+                switch (getStyleIndex()) {
+                case SPEC_FLOAT:
+                    dlg.lM01Height.setVisible(true);
+                    dlg.tfM01Height.setVisible(true);
+                    dlg.lM01Range.setVisible(true);
+                    dlg.tfM01Range.setVisible(true);
+                    break;
+                case SPEC_BEACON:
+                case SPEC_TOWER:
+                    dlg.rbM01Fired1.setVisible(true);
+                    dlg.rbM01FiredN.setVisible(true);
+                    dlg.lM01Height.setVisible(true);
+                    dlg.tfM01Height.setVisible(true);
+                    dlg.lM01Range.setVisible(true);
+                    dlg.tfM01Range.setVisible(true);
+                    break;
+                default:
+                }
+            }
+
+            String image = "/images/Cardinal"; //$NON-NLS-1$
+
+            switch (getStyleIndex()) {
+            case ISOL_PILLAR:
+                image += "_Pillar_Single"; //$NON-NLS-1$
+                break;
+            case ISOL_SPAR:
+                image += "_Spar_Single"; //$NON-NLS-1$
+                break;
+            case ISOL_BEACON:
+                image += "_Beacon_Single"; //$NON-NLS-1$
+                break;
+            case ISOL_TOWER:
+                image += "_Tower_Single"; //$NON-NLS-1$
+                break;
+            case ISOL_FLOAT:
+                image += "_Float_Single"; //$NON-NLS-1$
+                break;
+            default:
+            }
+
+            if (!image.equals("/images/Cardinal")) { //$NON-NLS-1$
+                image += ".png"; //$NON-NLS-1$
+                dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image)));
+            } else
+                dlg.lM01Icon.setIcon(null);
+        } else {
+            dlg.tfM01Name.setEnabled(false);
+            dlg.tfM01Name.setText(""); //$NON-NLS-1$
+            dlg.cM01TopMark.setVisible(false);
+            dlg.cM01Radar.setVisible(false);
+            dlg.cM01Racon.setVisible(false);
+            dlg.cM01Fog.setVisible(false);
+            dlg.cM01Fired.setVisible(false);
+        }
+    }
+
+    public void saveSign() {
+        Node node = getNode();
+
+        if (node == null) {
+            return;
+        }
+
+        switch (getStyleIndex()) {
+        case ISOL_PILLAR:
+            super.saveSign("buoy_isolated_danger"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_isolated_danger:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case ISOL_SPAR:
+            super.saveSign("buoy_isolated_danger"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_isolated_danger:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case ISOL_BEACON:
+            super.saveSign("beacon_isolated_danger"); //$NON-NLS-1$
+            break;
+        case ISOL_TOWER:
+            super.saveSign("beacon_isolated_danger"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:beacon_isolated_danger:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case ISOL_FLOAT:
+            super.saveSign("light_float"); //$NON-NLS-1$
+            break;
+        default:
+        }
+
+        switch (getStyleIndex()) {
+        case ISOL_PILLAR:
+        case ISOL_SPAR:
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_isolated_danger:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_isolated_danger:colour", "black;red;black")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case ISOL_BEACON:
+        case ISOL_TOWER:
+            Main.main.undoRedo
+                    .add(new ChangePropertyCommand(node,
+                            "seamark:beacon_isolated_danger:colour_pattern", //$NON-NLS-1$
+                            "horizontal stripes")); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:beacon_isolated_danger:colour", "black;red;black")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case ISOL_FLOAT:
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:light_float:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:light_float:colour", "black;red;black")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        }
+
+        saveTopMarkData("2 spheres", "black"); //$NON-NLS-1$ //$NON-NLS-2$
+        saveLightData(); //$NON-NLS-1$
+        saveRadarFogData();
+
+    }
+
+    public void setLightColour() {
+        super.setLightColour("W"); //$NON-NLS-1$
+    }
 
 }
Index: /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java	(revision 23193)
@@ -16,1038 +16,1038 @@
 
 public class BuoyLat extends Buoy {
-	public BuoyLat(SmpDialogAction dia, Node node) {
-		super(dia);
-
-		String str;
-		Map<String, String> keys;
-		keys = node.getKeys();
-		setNode(node);
-
-		resetMask();
-
-		dlg.cbM01CatOfMark.removeAllItems();
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.152")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.153")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.154")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.155")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.156")); //$NON-NLS-1$
-
-		dlg.rbM01RegionA.setEnabled(true);
-		dlg.rbM01RegionB.setEnabled(true);
-		dlg.cbM01CatOfMark.setEnabled(true);
-		dlg.cbM01CatOfMark.setVisible(true);
-		dlg.lM01CatOfMark.setVisible(true);
-
-		dlg.cbM01StyleOfMark.removeAllItems();
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.setEnabled(true);
-
-		dlg.cbM01TypeOfMark.setSelectedIndex(LATERAL);
-
-		if (keys.containsKey("name")) //$NON-NLS-1$
-			setName(keys.get("name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:buoy_lateral:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:buoy_lateral:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:beacon_lateral:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:beacon_lateral:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$
-
-		String cat = ""; //$NON-NLS-1$
-		String col = ""; //$NON-NLS-1$
-		String top = ""; //$NON-NLS-1$
-
-		if (getStyleIndex() != LAT_PERCH) {
-			if (keys.containsKey("seamark:topmark:shape")) { //$NON-NLS-1$
-				top = keys.get("seamark:topmark:shape"); //$NON-NLS-1$
-				setTopMark(true);
-			}
-			if (keys.containsKey("seamark:topmark:colour")) { //$NON-NLS-1$
-				setTopMark(true);
-			}
-		}
-
-		if (keys.containsKey("seamark:buoy_lateral:colour")) //$NON-NLS-1$
-			col = keys.get("seamark:buoy_lateral:colour"); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:beacon_lateral:colour")) //$NON-NLS-1$
-			col = keys.get("seamark:beacon_lateral:colour"); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:light_float:colour")) //$NON-NLS-1$
-			col = keys.get("seamark:light_float:colour"); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:buoy_lateral:category")) //$NON-NLS-1$
-			cat = keys.get("seamark:buoy_lateral:category"); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:beacon_lateral:category")) //$NON-NLS-1$
-			cat = keys.get("seamark:beacon_lateral:category"); //$NON-NLS-1$
-
-		if (cat.isEmpty()) { //$NON-NLS-1$
-			if (col.equals("red")) { //$NON-NLS-1$
-				setColour(RED);
-				if (top.equals("cylinder")) { //$NON-NLS-1$
-					setBuoyIndex(PORT_HAND);
-					setRegion(IALA_A);
-				} else if (top.equals("cone, point up")) { //$NON-NLS-1$
-					setBuoyIndex(STARBOARD_HAND);
-					setRegion(IALA_B);
-				} else {
-					if (getRegion() == IALA_A)
-						setBuoyIndex(PORT_HAND);
-					else
-						setBuoyIndex(STARBOARD_HAND);
-				}
-			} else if (col.equals("green")) { //$NON-NLS-1$
-				setColour(GREEN);
-				if (top.equals("cone, point up")) { //$NON-NLS-1$
-					setBuoyIndex(STARBOARD_HAND);
-					setRegion(IALA_A);
-				} else if (top.equals("cylinder")) { //$NON-NLS-1$
-					setBuoyIndex(PORT_HAND);
-					setRegion(IALA_B);
-				} else {
-					if (getRegion() == IALA_A)
-						setBuoyIndex(STARBOARD_HAND);
-					else
-						setBuoyIndex(PORT_HAND);
-				}
-			} else if (col.equals("red;green;red")) { //$NON-NLS-1$
-				setColour(RED_GREEN_RED);
-				if (top.equals("cylinder")) { //$NON-NLS-1$
-					setBuoyIndex(PREF_PORT_HAND);
-					setRegion(IALA_A);
-				} else if (top.equals("cone, point up")) { //$NON-NLS-1$
-					setBuoyIndex(PREF_STARBOARD_HAND);
-					setRegion(IALA_B);
-				} else {
-					if (getRegion() == IALA_A)
-						setBuoyIndex(PREF_PORT_HAND);
-					else
-						setBuoyIndex(PREF_STARBOARD_HAND);
-				}
-			} else if (col.equals("green;red;green")) { //$NON-NLS-1$
-				setColour(GREEN_RED_GREEN);
-				if (top.equals("cone, point up")) { //$NON-NLS-1$
-					setBuoyIndex(PREF_STARBOARD_HAND);
-					setRegion(IALA_A);
-				} else if (top.equals("cylinder")) { //$NON-NLS-1$
-					setBuoyIndex(PREF_PORT_HAND);
-					setRegion(IALA_B);
-				} else {
-					if (getRegion() == IALA_A)
-						setBuoyIndex(PREF_STARBOARD_HAND);
-					else
-						setBuoyIndex(PREF_PORT_HAND);
-				}
-			}
-		} else if (cat.equals("port")) { //$NON-NLS-1$
-
-			setBuoyIndex(PORT_HAND);
-
-			if (col.equals("red")) { //$NON-NLS-1$
-				setRegion(IALA_A);
-				setColour(RED);
-			} else if (col.equals("green")) { //$NON-NLS-1$
-				setRegion(IALA_B);
-				setColour(GREEN);
-			} else {
-				if (getRegion() == IALA_A)
-					setColour(RED);
-				else
-					setColour(GREEN);
-			}
-		} else if (cat.equals("starboard")) { //$NON-NLS-1$
-
-			setBuoyIndex(STARBOARD_HAND);
-
-			if (col.equals("green")) { //$NON-NLS-1$
-				setRegion(IALA_A);
-				setColour(GREEN);
-			} else if (col.equals("red")) { //$NON-NLS-1$
-				setRegion(IALA_B);
-				setColour(RED);
-			} else {
-				if (getRegion() == IALA_A)
-					setColour(GREEN);
-				else
-					setColour(RED);
-			}
-		} else if (cat.equals("preferred_channel_port")) { //$NON-NLS-1$
-
-			setBuoyIndex(PREF_PORT_HAND);
-
-			if (col.equals("red;green;red")) { //$NON-NLS-1$
-				setRegion(IALA_A);
-				setColour(RED_GREEN_RED);
-			} else if (col.equals("green;red;green")) { //$NON-NLS-1$
-				setRegion(IALA_B);
-				setColour(GREEN_RED_GREEN);
-			} else {
-				if (getRegion() == IALA_A)
-					setColour(RED_GREEN_RED);
-				else
-					setColour(GREEN_RED_GREEN);
-			}
-
-		} else if (cat.equals("preferred_channel_starboard")) { //$NON-NLS-1$
-
-			setBuoyIndex(PREF_STARBOARD_HAND);
-
-			if (col.equals("green;red;green")) { //$NON-NLS-1$
-				setRegion(IALA_A);
-				setColour(GREEN_RED_GREEN);
-			} else if (col.equals("red;green;red")) { //$NON-NLS-1$
-				setRegion(IALA_B);
-				setColour(RED_GREEN_RED);
-			} else {
-				if (getRegion() == IALA_A)
-					setColour(GREEN_RED_GREEN);
-				else
-					setColour(RED_GREEN_RED);
-			}
-		}
-
-		if (keys.containsKey("seamark:buoy_lateral:shape")) { //$NON-NLS-1$
-			str = keys.get("seamark:buoy_lateral:shape"); //$NON-NLS-1$
-
-			switch (getBuoyIndex()) {
-			case PORT_HAND:
-				if (str.equals("can")) //$NON-NLS-1$
-					setStyleIndex(LAT_CAN);
-				else if (str.equals("pillar")) //$NON-NLS-1$
-					setStyleIndex(LAT_PILLAR);
-				else if (str.equals("spar")) //$NON-NLS-1$
-					setStyleIndex(LAT_SPAR);
-				break;
-
-			case PREF_PORT_HAND:
-				if (str.equals("can")) //$NON-NLS-1$
-					setStyleIndex(LAT_CAN);
-				else if (str.equals("pillar")) //$NON-NLS-1$
-					setStyleIndex(LAT_PILLAR);
-				else if (str.equals("spar")) //$NON-NLS-1$
-					setStyleIndex(LAT_SPAR);
-				break;
-
-			case STARBOARD_HAND:
-				if (str.equals("conical")) //$NON-NLS-1$
-					setStyleIndex(LAT_CONE);
-				else if (str.equals("pillar")) //$NON-NLS-1$
-					setStyleIndex(LAT_PILLAR);
-				else if (str.equals("spar")) //$NON-NLS-1$
-					setStyleIndex(LAT_SPAR);
-				break;
-
-			case PREF_STARBOARD_HAND:
-				if (str.equals("conical")) //$NON-NLS-1$
-					setStyleIndex(LAT_CONE);
-				else if (str.equals("pillar")) //$NON-NLS-1$
-					setStyleIndex(LAT_PILLAR);
-				else if (str.equals("spar")) //$NON-NLS-1$
-					setStyleIndex(LAT_SPAR);
-				break;
-			}
-		} else if (keys.containsKey("seamark:beacon_lateral:shape")) { //$NON-NLS-1$
-			str = keys.get("seamark:beacon_lateral:shape"); //$NON-NLS-1$
-			if (str.equals("tower")) //$NON-NLS-1$
-				setStyleIndex(LAT_TOWER);
-			else if (str.equals("perch")) //$NON-NLS-1$
-				setStyleIndex(LAT_PERCH);
-			else
-				setStyleIndex(LAT_BEACON);
-		} else if (keys.containsKey("seamark:type") //$NON-NLS-1$
-				&& (keys.get("seamark:type").equals("beacon_lateral"))) { //$NON-NLS-1$ //$NON-NLS-2$
-			setStyleIndex(LAT_BEACON);
-		} else if (keys.containsKey("seamark:type") //$NON-NLS-1$
-				&& (keys.get("seamark:type").equals("light_float"))) { //$NON-NLS-1$ //$NON-NLS-2$
-			setStyleIndex(LAT_FLOAT);
-		}
-
-		refreshStyles();
-		refreshLights();
-		setLightColour();
-		parseLights(keys);
-		parseFogRadar(keys);
-		
-		dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());
-		dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
-		dlg.tfM01Name.setText(getName());
-		dlg.cM01TopMark.setSelected(hasTopMark());
-	}
-
-	public void refreshStyles() {
-		int type = getBuoyIndex();
-		int style = getStyleIndex();
-
-		dlg.cbM01StyleOfMark.removeAllItems();
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.213")); //$NON-NLS-1$
-
-		switch (type) {
-		case PORT_HAND:
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); //$NON-NLS-1$
-			break;
-
-		case STARBOARD_HAND:
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); //$NON-NLS-1$
-			break;
-
-		case PREF_PORT_HAND:
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
-			break;
-
-		case PREF_STARBOARD_HAND:
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
-			dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
-			break;
-
-		default:
-		}
-
-		if (style >= dlg.cbM01StyleOfMark.getItemCount())
-			style = 0;
-		setStyleIndex(style);
-		dlg.cbM01StyleOfMark.setSelectedIndex(style);
-		dlg.cbM01StyleOfMark.setVisible(true);
-		dlg.lM01StyleOfMark.setVisible(true);
-	}
-
-	public boolean isValid() {
-		return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
-	}
-
-	public void paintSign() {
-		if (dlg.paintlock)
-			return;
-		super.paintSign();
-
-		dlg.sM01StatusBar.setText(getErrMsg());
-
-		if (isValid()) {
-			dlg.tfM01Name.setEnabled(true);
-			dlg.tfM01Name.setText(getName());
-
-			int cat = getBuoyIndex();
-			boolean region = getRegion();
-			int style = getStyleIndex();
-
-			if (style == LAT_PERCH) {
-				dlg.cM01TopMark.setVisible(false);
-				dlg.cM01TopMark.setSelected(false);
-				dlg.cM01Radar.setVisible(false);
-				dlg.cM01Racon.setVisible(false);
-				dlg.cM01Fog.setVisible(false);
-				dlg.cM01Fired.setVisible(false);
-				dlg.cM01Fired.setSelected(false);
-			} else {
-				dlg.cM01TopMark.setEnabled(true);
-				dlg.cM01TopMark.setVisible(true);
-				dlg.cM01Radar.setVisible(true);
-				dlg.cM01Racon.setVisible(true);
-				dlg.cM01Fog.setVisible(true);
-				dlg.cM01Fired.setVisible(true);
-				dlg.cM01Fired.setEnabled(true);
-				dlg.cM01TopMark.setEnabled(true);
-			}
-			dlg.cbM01Colour.setVisible(false);
-			dlg.lM01Colour.setVisible(false);
-			dlg.rbM01Fired1.setVisible(false);
-			dlg.rbM01FiredN.setVisible(false);
-			dlg.lM01Height.setVisible(false);
-			dlg.tfM01Height.setVisible(false);
-			dlg.lM01Range.setVisible(false);
-			dlg.tfM01Range.setVisible(false);
-
-			if (isFired()) {
-				switch (style) {
-				case LAT_BEACON:
-				case LAT_TOWER:
-					dlg.rbM01Fired1.setVisible(true);
-					dlg.rbM01FiredN.setVisible(true);
-					dlg.lM01Height.setVisible(true);
-					dlg.tfM01Height.setVisible(true);
-					dlg.lM01Range.setVisible(true);
-					dlg.tfM01Range.setVisible(true);
-					break;
-				case LAT_FLOAT:
-					dlg.lM01Height.setVisible(true);
-					dlg.tfM01Height.setVisible(true);
-					dlg.lM01Range.setVisible(true);
-					dlg.tfM01Range.setVisible(true);
-					break;
-				default:
-				}
-			}
-			String image = "/images/Lateral"; //$NON-NLS-1$
-
-			switch (getBuoyIndex()) {
-			case PORT_HAND:
-				if (region == IALA_A)
-					switch (style) {
-					case LAT_CAN:
-						image += "_Can_Red"; //$NON-NLS-1$
-						break;
-					case LAT_PILLAR:
-						image += "_Pillar_Red"; //$NON-NLS-1$
-						break;
-					case LAT_SPAR:
-						image += "_Spar_Red"; //$NON-NLS-1$
-						break;
-					case LAT_BEACON:
-						image += "_Beacon_Red"; //$NON-NLS-1$
-						break;
-					case LAT_TOWER:
-						image += "_Tower_Red"; //$NON-NLS-1$
-						break;
-					case LAT_FLOAT:
-						image += "_Float_Red"; //$NON-NLS-1$
-						break;
-					case LAT_PERCH:
-						image += "_Perch_Port"; //$NON-NLS-1$
-						break;
-					default:
-					}
-				else
-					switch (style) {
-					case LAT_CAN:
-						image += "_Can_Green"; //$NON-NLS-1$
-						break;
-					case LAT_PILLAR:
-						image += "_Pillar_Green"; //$NON-NLS-1$
-						break;
-					case LAT_SPAR:
-						image += "_Spar_Green"; //$NON-NLS-1$
-						break;
-					case LAT_BEACON:
-						image += "_Beacon_Green"; //$NON-NLS-1$
-						break;
-					case LAT_TOWER:
-						image += "_Tower_Green"; //$NON-NLS-1$
-						break;
-					case LAT_FLOAT:
-						image += "_Float_Green"; //$NON-NLS-1$
-						break;
-					case LAT_PERCH:
-						image += "_Perch_Port"; //$NON-NLS-1$
-						break;
-					default:
-					}
-				break;
-
-			case STARBOARD_HAND:
-				if (region == IALA_A)
-					switch (style) {
-					case LAT_CONE:
-						image += "_Cone_Green"; //$NON-NLS-1$
-						break;
-					case LAT_PILLAR:
-						image += "_Pillar_Green"; //$NON-NLS-1$
-						break;
-					case LAT_SPAR:
-						image += "_Spar_Green"; //$NON-NLS-1$
-						break;
-					case LAT_BEACON:
-						image += "_Beacon_Green"; //$NON-NLS-1$
-						break;
-					case LAT_TOWER:
-						image += "_Tower_Green"; //$NON-NLS-1$
-						break;
-					case LAT_FLOAT:
-						image += "_Float_Green"; //$NON-NLS-1$
-						break;
-					case LAT_PERCH:
-						image += "_Perch_Starboard"; //$NON-NLS-1$
-						break;
-					default:
-					}
-				else
-					switch (style) {
-					case LAT_CONE:
-						image += "_Cone_Red"; //$NON-NLS-1$
-						break;
-					case LAT_PILLAR:
-						image += "_Pillar_Red"; //$NON-NLS-1$
-						break;
-					case LAT_SPAR:
-						image += "_Spar_Red"; //$NON-NLS-1$
-						break;
-					case LAT_BEACON:
-						image += "_Beacon_Red"; //$NON-NLS-1$
-						break;
-					case LAT_TOWER:
-						image += "_Tower_Red"; //$NON-NLS-1$
-						break;
-					case LAT_FLOAT:
-						image += "_Float_Red"; //$NON-NLS-1$
-						break;
-					case LAT_PERCH:
-						image += "_Perch_Starboard"; //$NON-NLS-1$
-						break;
-					default:
-					}
-				break;
-
-			case PREF_PORT_HAND:
-				if (region == IALA_A)
-					switch (style) {
-					case LAT_CAN:
-						image += "_Can_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					case LAT_PILLAR:
-						image += "_Pillar_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					case LAT_SPAR:
-						image += "_Spar_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					case LAT_BEACON:
-						image += "_Beacon_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					case LAT_TOWER:
-						image += "_Tower_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					case LAT_FLOAT:
-						image += "_Float_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					default:
-					}
-				else
-					switch (style) {
-					case LAT_CAN:
-						image += "_Can_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					case LAT_PILLAR:
-						image += "_Pillar_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					case LAT_SPAR:
-						image += "_Spar_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					case LAT_BEACON:
-						image += "_Beacon_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					case LAT_TOWER:
-						image += "_Tower_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					case LAT_FLOAT:
-						image += "_Float_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					default:
-					}
-				break;
-
-			case PREF_STARBOARD_HAND:
-				if (region == IALA_A)
-					switch (style) {
-					case LAT_CONE:
-						image += "_Cone_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					case LAT_PILLAR:
-						image += "_Pillar_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					case LAT_SPAR:
-						image += "_Spar_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					case LAT_BEACON:
-						image += "_Beacon_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					case LAT_TOWER:
-						image += "_Tower_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					case LAT_FLOAT:
-						image += "_Float_Green_Red_Green"; //$NON-NLS-1$
-						break;
-					default:
-					}
-				else
-					switch (style) {
-					case LAT_CONE:
-						image += "_Cone_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					case LAT_PILLAR:
-						image += "_Pillar_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					case LAT_SPAR:
-						image += "_Spar_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					case LAT_BEACON:
-						image += "_Beacon_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					case LAT_TOWER:
-						image += "_Tower_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					case LAT_FLOAT:
-						image += "_Float_Red_Green_Red"; //$NON-NLS-1$
-						break;
-					default:
-					}
-				break;
-
-			default:
-			}
-
-			if (!image.equals("/images/Lateral")) { //$NON-NLS-1$
-
-				if (hasTopMark()) {
-					if (cat == PORT_HAND || cat == PREF_PORT_HAND)
-						image += "_Can"; //$NON-NLS-1$
-					else
-						image += "_Cone"; //$NON-NLS-1$
-				}
-				image += ".png"; //$NON-NLS-1$
-				dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image)));
-
-				if (hasRadar()) {
-					dlg.lM03Icon.setIcon(new ImageIcon(getClass().getResource(
-							"/images/Radar_Reflector.png"))); //$NON-NLS-1$
-				}
-
-			} else
-				dlg.lM01Icon.setIcon(null);
-		}
-	}
-
-	public void saveSign() {
-		Node node = getNode();
-
-		if (node == null) {
-			return;
-		}
-
-		int cat = getBuoyIndex();
-		String shape = ""; //$NON-NLS-1$
-		String colour = ""; //$NON-NLS-1$
-
-		switch (cat) {
-
-		case PORT_HAND:
-			switch (getStyleIndex()) {
-			case LAT_CAN:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "can")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_PILLAR:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_SPAR:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_BEACON:
-				super.saveSign("beacon_lateral"); //$NON-NLS-1$
-				break;
-			case LAT_TOWER:
-				super.saveSign("beacon_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_FLOAT:
-				super.saveSign("light_float"); //$NON-NLS-1$
-				break;
-			case LAT_PERCH:
-				super.saveSign("beacon_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:shape", "perch")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			default:
-			}
-			switch (getStyleIndex()) {
-			case LAT_CAN:
-			case LAT_PILLAR:
-			case LAT_SPAR:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:category", "port")); //$NON-NLS-1$ //$NON-NLS-2$
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:buoy_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:buoy_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				}
-				break;
-			case LAT_PERCH:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:category", "port")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_BEACON:
-			case LAT_TOWER:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:category", "port")); //$NON-NLS-1$ //$NON-NLS-2$
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:beacon_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:beacon_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				}
-				break;
-			case LAT_FLOAT:
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:light_float:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:light_float:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				}
-				break;
-			}
-			shape = "cylinder"; //$NON-NLS-1$
-			break;
-
-		case PREF_PORT_HAND:
-			switch (getStyleIndex()) {
-			case LAT_CAN:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "can")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_PILLAR:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_SPAR:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_BEACON:
-				super.saveSign("beacon_lateral"); //$NON-NLS-1$
-				break;
-			case LAT_TOWER:
-				super.saveSign("beacon_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_FLOAT:
-				super.saveSign("light_float"); //$NON-NLS-1$
-				break;
-			default:
-			}
-			switch (getStyleIndex()) {
-			case LAT_CAN:
-			case LAT_PILLAR:
-			case LAT_SPAR:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:category", "preferred_channel_port")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:buoy_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:buoy_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				}
-				break;
-			case LAT_BEACON:
-			case LAT_TOWER:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:category", "preferred_channel_port")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:beacon_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:beacon_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				}
-				break;
-			case LAT_FLOAT:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:light_float:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:light_float:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:light_float:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				}
-				break;
-			}
-			shape = "cylinder"; //$NON-NLS-1$
-			break;
-
-		case STARBOARD_HAND:
-			switch (getStyleIndex()) {
-			case LAT_CONE:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "conical")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_PILLAR:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_SPAR:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_BEACON:
-				super.saveSign("beacon_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:shape", "stake")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_TOWER:
-				super.saveSign("beacon_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_FLOAT:
-				super.saveSign("light_float"); //$NON-NLS-1$
-				break;
-			case LAT_PERCH:
-				super.saveSign("beacon_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:shape", "perch")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			default:
-			}
-			switch (getStyleIndex()) {
-			case LAT_CAN:
-			case LAT_PILLAR:
-			case LAT_SPAR:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:category", "starboard")); //$NON-NLS-1$ //$NON-NLS-2$
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:buoy_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:buoy_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				}
-				break;
-			case LAT_BEACON:
-			case LAT_TOWER:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:category", "starboard")); //$NON-NLS-1$ //$NON-NLS-2$
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:beacon_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:beacon_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				}
-				break;
-			case LAT_FLOAT:
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:light_float:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:light_float:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				}
-				break;
-			case LAT_PERCH:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:category", "starboard")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			}
-			shape = "cone, point up"; //$NON-NLS-1$
-			break;
-
-		case PREF_STARBOARD_HAND:
-			switch (getStyleIndex()) {
-			case LAT_CONE:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "conical")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_PILLAR:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_SPAR:
-				super.saveSign("buoy_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_BEACON:
-				super.saveSign("beacon_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:shape", "stake")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_TOWER:
-				super.saveSign("beacon_lateral"); //$NON-NLS-1$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
-				break;
-			case LAT_FLOAT:
-				super.saveSign("light_float"); //$NON-NLS-1$
-				break;
-			default:
-			}
-			switch (getStyleIndex()) {
-			case LAT_CAN:
-			case LAT_PILLAR:
-			case LAT_SPAR:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:category", "preferred_channel_starboard")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:buoy_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:buoy_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:buoy_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				}
-				break;
-			case LAT_BEACON:
-			case LAT_TOWER:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:category", "preferred_channel_starboard")); //$NON-NLS-1$ //$NON-NLS-2$
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:beacon_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:beacon_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:beacon_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				}
-				break;
-			case LAT_FLOAT:
-				Main.main.undoRedo.add(new ChangePropertyCommand(node,
-						"seamark:light_float:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-				if (getRegion() == IALA_A) {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:light_float:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "green"; //$NON-NLS-1$
-				} else {
-					Main.main.undoRedo.add(new ChangePropertyCommand(node,
-							"seamark:light_float:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
-					colour = "red"; //$NON-NLS-1$
-				}
-				break;
-			}
-			shape = "cone, point up"; //$NON-NLS-1$
-			break;
-
-		default:
-		}
-		saveTopMarkData(shape, colour);
-		saveLightData();
-		saveRadarFogData();
-
-		Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-	}
-
-	public void setLightColour() {
-		if (getRegion() == IALA_A) {
-			if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND)
-				super.setLightColour("R"); //$NON-NLS-1$
-			else
-				super.setLightColour("G"); //$NON-NLS-1$
-		} else {
-			if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND)
-				super.setLightColour("G"); //$NON-NLS-1$
-			else
-				super.setLightColour("R"); //$NON-NLS-1$
-		}
-	}
-
-	public void setLightColour(String str) {
-		int cat = getBuoyIndex();
-
-		if (str == null) {
-			return;
-		}
-
-		switch (cat) {
-		case PORT_HAND:
-		case PREF_PORT_HAND:
-			if (getRegion() == IALA_A) {
-				if (str.equals("red")) { //$NON-NLS-1$
-					setFired(true);
-					super.setLightColour("R"); //$NON-NLS-1$
-				} else {
-					super.setLightColour(""); //$NON-NLS-1$
-				}
-			} else {
-				if (str.equals("green")) { //$NON-NLS-1$
-					setFired(true);
-					super.setLightColour("G"); //$NON-NLS-1$
-				} else {
-					super.setLightColour(""); //$NON-NLS-1$
-				}
-			}
-			break;
-
-		case STARBOARD_HAND:
-		case PREF_STARBOARD_HAND:
-			if (getRegion() == IALA_A) {
-				if (str.equals("green")) { //$NON-NLS-1$
-					setFired(true);
-					super.setLightColour("G"); //$NON-NLS-1$
-				} else {
-					super.setLightColour(""); //$NON-NLS-1$
-				}
-			} else {
-				if (str.equals("red")) { //$NON-NLS-1$
-					setFired(true);
-					super.setLightColour("R"); //$NON-NLS-1$
-				} else {
-					super.setLightColour(""); //$NON-NLS-1$
-				}
-			}
-			break;
-		default:
-		}
-	}
+    public BuoyLat(SmpDialogAction dia, Node node) {
+        super(dia);
+
+        String str;
+        Map<String, String> keys;
+        keys = node.getKeys();
+        setNode(node);
+
+        resetMask();
+
+        dlg.cbM01CatOfMark.removeAllItems();
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.152")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.153")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.154")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.155")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.156")); //$NON-NLS-1$
+
+        dlg.rbM01RegionA.setEnabled(true);
+        dlg.rbM01RegionB.setEnabled(true);
+        dlg.cbM01CatOfMark.setEnabled(true);
+        dlg.cbM01CatOfMark.setVisible(true);
+        dlg.lM01CatOfMark.setVisible(true);
+
+        dlg.cbM01StyleOfMark.removeAllItems();
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.setEnabled(true);
+
+        dlg.cbM01TypeOfMark.setSelectedIndex(LATERAL);
+
+        if (keys.containsKey("name")) //$NON-NLS-1$
+            setName(keys.get("name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:buoy_lateral:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:buoy_lateral:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:beacon_lateral:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:beacon_lateral:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$
+
+        String cat = ""; //$NON-NLS-1$
+        String col = ""; //$NON-NLS-1$
+        String top = ""; //$NON-NLS-1$
+
+        if (getStyleIndex() != LAT_PERCH) {
+            if (keys.containsKey("seamark:topmark:shape")) { //$NON-NLS-1$
+                top = keys.get("seamark:topmark:shape"); //$NON-NLS-1$
+                setTopMark(true);
+            }
+            if (keys.containsKey("seamark:topmark:colour")) { //$NON-NLS-1$
+                setTopMark(true);
+            }
+        }
+
+        if (keys.containsKey("seamark:buoy_lateral:colour")) //$NON-NLS-1$
+            col = keys.get("seamark:buoy_lateral:colour"); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:beacon_lateral:colour")) //$NON-NLS-1$
+            col = keys.get("seamark:beacon_lateral:colour"); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:light_float:colour")) //$NON-NLS-1$
+            col = keys.get("seamark:light_float:colour"); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:buoy_lateral:category")) //$NON-NLS-1$
+            cat = keys.get("seamark:buoy_lateral:category"); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:beacon_lateral:category")) //$NON-NLS-1$
+            cat = keys.get("seamark:beacon_lateral:category"); //$NON-NLS-1$
+
+        if (cat.isEmpty()) { //$NON-NLS-1$
+            if (col.equals("red")) { //$NON-NLS-1$
+                setColour(RED);
+                if (top.equals("cylinder")) { //$NON-NLS-1$
+                    setBuoyIndex(PORT_HAND);
+                    setRegion(IALA_A);
+                } else if (top.equals("cone, point up")) { //$NON-NLS-1$
+                    setBuoyIndex(STARBOARD_HAND);
+                    setRegion(IALA_B);
+                } else {
+                    if (getRegion() == IALA_A)
+                        setBuoyIndex(PORT_HAND);
+                    else
+                        setBuoyIndex(STARBOARD_HAND);
+                }
+            } else if (col.equals("green")) { //$NON-NLS-1$
+                setColour(GREEN);
+                if (top.equals("cone, point up")) { //$NON-NLS-1$
+                    setBuoyIndex(STARBOARD_HAND);
+                    setRegion(IALA_A);
+                } else if (top.equals("cylinder")) { //$NON-NLS-1$
+                    setBuoyIndex(PORT_HAND);
+                    setRegion(IALA_B);
+                } else {
+                    if (getRegion() == IALA_A)
+                        setBuoyIndex(STARBOARD_HAND);
+                    else
+                        setBuoyIndex(PORT_HAND);
+                }
+            } else if (col.equals("red;green;red")) { //$NON-NLS-1$
+                setColour(RED_GREEN_RED);
+                if (top.equals("cylinder")) { //$NON-NLS-1$
+                    setBuoyIndex(PREF_PORT_HAND);
+                    setRegion(IALA_A);
+                } else if (top.equals("cone, point up")) { //$NON-NLS-1$
+                    setBuoyIndex(PREF_STARBOARD_HAND);
+                    setRegion(IALA_B);
+                } else {
+                    if (getRegion() == IALA_A)
+                        setBuoyIndex(PREF_PORT_HAND);
+                    else
+                        setBuoyIndex(PREF_STARBOARD_HAND);
+                }
+            } else if (col.equals("green;red;green")) { //$NON-NLS-1$
+                setColour(GREEN_RED_GREEN);
+                if (top.equals("cone, point up")) { //$NON-NLS-1$
+                    setBuoyIndex(PREF_STARBOARD_HAND);
+                    setRegion(IALA_A);
+                } else if (top.equals("cylinder")) { //$NON-NLS-1$
+                    setBuoyIndex(PREF_PORT_HAND);
+                    setRegion(IALA_B);
+                } else {
+                    if (getRegion() == IALA_A)
+                        setBuoyIndex(PREF_STARBOARD_HAND);
+                    else
+                        setBuoyIndex(PREF_PORT_HAND);
+                }
+            }
+        } else if (cat.equals("port")) { //$NON-NLS-1$
+
+            setBuoyIndex(PORT_HAND);
+
+            if (col.equals("red")) { //$NON-NLS-1$
+                setRegion(IALA_A);
+                setColour(RED);
+            } else if (col.equals("green")) { //$NON-NLS-1$
+                setRegion(IALA_B);
+                setColour(GREEN);
+            } else {
+                if (getRegion() == IALA_A)
+                    setColour(RED);
+                else
+                    setColour(GREEN);
+            }
+        } else if (cat.equals("starboard")) { //$NON-NLS-1$
+
+            setBuoyIndex(STARBOARD_HAND);
+
+            if (col.equals("green")) { //$NON-NLS-1$
+                setRegion(IALA_A);
+                setColour(GREEN);
+            } else if (col.equals("red")) { //$NON-NLS-1$
+                setRegion(IALA_B);
+                setColour(RED);
+            } else {
+                if (getRegion() == IALA_A)
+                    setColour(GREEN);
+                else
+                    setColour(RED);
+            }
+        } else if (cat.equals("preferred_channel_port")) { //$NON-NLS-1$
+
+            setBuoyIndex(PREF_PORT_HAND);
+
+            if (col.equals("red;green;red")) { //$NON-NLS-1$
+                setRegion(IALA_A);
+                setColour(RED_GREEN_RED);
+            } else if (col.equals("green;red;green")) { //$NON-NLS-1$
+                setRegion(IALA_B);
+                setColour(GREEN_RED_GREEN);
+            } else {
+                if (getRegion() == IALA_A)
+                    setColour(RED_GREEN_RED);
+                else
+                    setColour(GREEN_RED_GREEN);
+            }
+
+        } else if (cat.equals("preferred_channel_starboard")) { //$NON-NLS-1$
+
+            setBuoyIndex(PREF_STARBOARD_HAND);
+
+            if (col.equals("green;red;green")) { //$NON-NLS-1$
+                setRegion(IALA_A);
+                setColour(GREEN_RED_GREEN);
+            } else if (col.equals("red;green;red")) { //$NON-NLS-1$
+                setRegion(IALA_B);
+                setColour(RED_GREEN_RED);
+            } else {
+                if (getRegion() == IALA_A)
+                    setColour(GREEN_RED_GREEN);
+                else
+                    setColour(RED_GREEN_RED);
+            }
+        }
+
+        if (keys.containsKey("seamark:buoy_lateral:shape")) { //$NON-NLS-1$
+            str = keys.get("seamark:buoy_lateral:shape"); //$NON-NLS-1$
+
+            switch (getBuoyIndex()) {
+            case PORT_HAND:
+                if (str.equals("can")) //$NON-NLS-1$
+                    setStyleIndex(LAT_CAN);
+                else if (str.equals("pillar")) //$NON-NLS-1$
+                    setStyleIndex(LAT_PILLAR);
+                else if (str.equals("spar")) //$NON-NLS-1$
+                    setStyleIndex(LAT_SPAR);
+                break;
+
+            case PREF_PORT_HAND:
+                if (str.equals("can")) //$NON-NLS-1$
+                    setStyleIndex(LAT_CAN);
+                else if (str.equals("pillar")) //$NON-NLS-1$
+                    setStyleIndex(LAT_PILLAR);
+                else if (str.equals("spar")) //$NON-NLS-1$
+                    setStyleIndex(LAT_SPAR);
+                break;
+
+            case STARBOARD_HAND:
+                if (str.equals("conical")) //$NON-NLS-1$
+                    setStyleIndex(LAT_CONE);
+                else if (str.equals("pillar")) //$NON-NLS-1$
+                    setStyleIndex(LAT_PILLAR);
+                else if (str.equals("spar")) //$NON-NLS-1$
+                    setStyleIndex(LAT_SPAR);
+                break;
+
+            case PREF_STARBOARD_HAND:
+                if (str.equals("conical")) //$NON-NLS-1$
+                    setStyleIndex(LAT_CONE);
+                else if (str.equals("pillar")) //$NON-NLS-1$
+                    setStyleIndex(LAT_PILLAR);
+                else if (str.equals("spar")) //$NON-NLS-1$
+                    setStyleIndex(LAT_SPAR);
+                break;
+            }
+        } else if (keys.containsKey("seamark:beacon_lateral:shape")) { //$NON-NLS-1$
+            str = keys.get("seamark:beacon_lateral:shape"); //$NON-NLS-1$
+            if (str.equals("tower")) //$NON-NLS-1$
+                setStyleIndex(LAT_TOWER);
+            else if (str.equals("perch")) //$NON-NLS-1$
+                setStyleIndex(LAT_PERCH);
+            else
+                setStyleIndex(LAT_BEACON);
+        } else if (keys.containsKey("seamark:type") //$NON-NLS-1$
+                && (keys.get("seamark:type").equals("beacon_lateral"))) { //$NON-NLS-1$ //$NON-NLS-2$
+            setStyleIndex(LAT_BEACON);
+        } else if (keys.containsKey("seamark:type") //$NON-NLS-1$
+                && (keys.get("seamark:type").equals("light_float"))) { //$NON-NLS-1$ //$NON-NLS-2$
+            setStyleIndex(LAT_FLOAT);
+        }
+
+        refreshStyles();
+        refreshLights();
+        setLightColour();
+        parseLights(keys);
+        parseFogRadar(keys);
+        
+        dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());
+        dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
+        dlg.tfM01Name.setText(getName());
+        dlg.cM01TopMark.setSelected(hasTopMark());
+    }
+
+    public void refreshStyles() {
+        int type = getBuoyIndex();
+        int style = getStyleIndex();
+
+        dlg.cbM01StyleOfMark.removeAllItems();
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.213")); //$NON-NLS-1$
+
+        switch (type) {
+        case PORT_HAND:
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); //$NON-NLS-1$
+            break;
+
+        case STARBOARD_HAND:
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); //$NON-NLS-1$
+            break;
+
+        case PREF_PORT_HAND:
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
+            break;
+
+        case PREF_STARBOARD_HAND:
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
+            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
+            break;
+
+        default:
+        }
+
+        if (style >= dlg.cbM01StyleOfMark.getItemCount())
+            style = 0;
+        setStyleIndex(style);
+        dlg.cbM01StyleOfMark.setSelectedIndex(style);
+        dlg.cbM01StyleOfMark.setVisible(true);
+        dlg.lM01StyleOfMark.setVisible(true);
+    }
+
+    public boolean isValid() {
+        return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
+    }
+
+    public void paintSign() {
+        if (dlg.paintlock)
+            return;
+        super.paintSign();
+
+        dlg.sM01StatusBar.setText(getErrMsg());
+
+        if (isValid()) {
+            dlg.tfM01Name.setEnabled(true);
+            dlg.tfM01Name.setText(getName());
+
+            int cat = getBuoyIndex();
+            boolean region = getRegion();
+            int style = getStyleIndex();
+
+            if (style == LAT_PERCH) {
+                dlg.cM01TopMark.setVisible(false);
+                dlg.cM01TopMark.setSelected(false);
+                dlg.cM01Radar.setVisible(false);
+                dlg.cM01Racon.setVisible(false);
+                dlg.cM01Fog.setVisible(false);
+                dlg.cM01Fired.setVisible(false);
+                dlg.cM01Fired.setSelected(false);
+            } else {
+                dlg.cM01TopMark.setEnabled(true);
+                dlg.cM01TopMark.setVisible(true);
+                dlg.cM01Radar.setVisible(true);
+                dlg.cM01Racon.setVisible(true);
+                dlg.cM01Fog.setVisible(true);
+                dlg.cM01Fired.setVisible(true);
+                dlg.cM01Fired.setEnabled(true);
+                dlg.cM01TopMark.setEnabled(true);
+            }
+            dlg.cbM01Colour.setVisible(false);
+            dlg.lM01Colour.setVisible(false);
+            dlg.rbM01Fired1.setVisible(false);
+            dlg.rbM01FiredN.setVisible(false);
+            dlg.lM01Height.setVisible(false);
+            dlg.tfM01Height.setVisible(false);
+            dlg.lM01Range.setVisible(false);
+            dlg.tfM01Range.setVisible(false);
+
+            if (isFired()) {
+                switch (style) {
+                case LAT_BEACON:
+                case LAT_TOWER:
+                    dlg.rbM01Fired1.setVisible(true);
+                    dlg.rbM01FiredN.setVisible(true);
+                    dlg.lM01Height.setVisible(true);
+                    dlg.tfM01Height.setVisible(true);
+                    dlg.lM01Range.setVisible(true);
+                    dlg.tfM01Range.setVisible(true);
+                    break;
+                case LAT_FLOAT:
+                    dlg.lM01Height.setVisible(true);
+                    dlg.tfM01Height.setVisible(true);
+                    dlg.lM01Range.setVisible(true);
+                    dlg.tfM01Range.setVisible(true);
+                    break;
+                default:
+                }
+            }
+            String image = "/images/Lateral"; //$NON-NLS-1$
+
+            switch (getBuoyIndex()) {
+            case PORT_HAND:
+                if (region == IALA_A)
+                    switch (style) {
+                    case LAT_CAN:
+                        image += "_Can_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_PILLAR:
+                        image += "_Pillar_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_SPAR:
+                        image += "_Spar_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_BEACON:
+                        image += "_Beacon_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_TOWER:
+                        image += "_Tower_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_FLOAT:
+                        image += "_Float_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_PERCH:
+                        image += "_Perch_Port"; //$NON-NLS-1$
+                        break;
+                    default:
+                    }
+                else
+                    switch (style) {
+                    case LAT_CAN:
+                        image += "_Can_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_PILLAR:
+                        image += "_Pillar_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_SPAR:
+                        image += "_Spar_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_BEACON:
+                        image += "_Beacon_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_TOWER:
+                        image += "_Tower_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_FLOAT:
+                        image += "_Float_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_PERCH:
+                        image += "_Perch_Port"; //$NON-NLS-1$
+                        break;
+                    default:
+                    }
+                break;
+
+            case STARBOARD_HAND:
+                if (region == IALA_A)
+                    switch (style) {
+                    case LAT_CONE:
+                        image += "_Cone_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_PILLAR:
+                        image += "_Pillar_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_SPAR:
+                        image += "_Spar_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_BEACON:
+                        image += "_Beacon_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_TOWER:
+                        image += "_Tower_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_FLOAT:
+                        image += "_Float_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_PERCH:
+                        image += "_Perch_Starboard"; //$NON-NLS-1$
+                        break;
+                    default:
+                    }
+                else
+                    switch (style) {
+                    case LAT_CONE:
+                        image += "_Cone_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_PILLAR:
+                        image += "_Pillar_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_SPAR:
+                        image += "_Spar_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_BEACON:
+                        image += "_Beacon_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_TOWER:
+                        image += "_Tower_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_FLOAT:
+                        image += "_Float_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_PERCH:
+                        image += "_Perch_Starboard"; //$NON-NLS-1$
+                        break;
+                    default:
+                    }
+                break;
+
+            case PREF_PORT_HAND:
+                if (region == IALA_A)
+                    switch (style) {
+                    case LAT_CAN:
+                        image += "_Can_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_PILLAR:
+                        image += "_Pillar_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_SPAR:
+                        image += "_Spar_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_BEACON:
+                        image += "_Beacon_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_TOWER:
+                        image += "_Tower_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_FLOAT:
+                        image += "_Float_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    default:
+                    }
+                else
+                    switch (style) {
+                    case LAT_CAN:
+                        image += "_Can_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_PILLAR:
+                        image += "_Pillar_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_SPAR:
+                        image += "_Spar_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_BEACON:
+                        image += "_Beacon_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_TOWER:
+                        image += "_Tower_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_FLOAT:
+                        image += "_Float_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    default:
+                    }
+                break;
+
+            case PREF_STARBOARD_HAND:
+                if (region == IALA_A)
+                    switch (style) {
+                    case LAT_CONE:
+                        image += "_Cone_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_PILLAR:
+                        image += "_Pillar_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_SPAR:
+                        image += "_Spar_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_BEACON:
+                        image += "_Beacon_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_TOWER:
+                        image += "_Tower_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    case LAT_FLOAT:
+                        image += "_Float_Green_Red_Green"; //$NON-NLS-1$
+                        break;
+                    default:
+                    }
+                else
+                    switch (style) {
+                    case LAT_CONE:
+                        image += "_Cone_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_PILLAR:
+                        image += "_Pillar_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_SPAR:
+                        image += "_Spar_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_BEACON:
+                        image += "_Beacon_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_TOWER:
+                        image += "_Tower_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    case LAT_FLOAT:
+                        image += "_Float_Red_Green_Red"; //$NON-NLS-1$
+                        break;
+                    default:
+                    }
+                break;
+
+            default:
+            }
+
+            if (!image.equals("/images/Lateral")) { //$NON-NLS-1$
+
+                if (hasTopMark()) {
+                    if (cat == PORT_HAND || cat == PREF_PORT_HAND)
+                        image += "_Can"; //$NON-NLS-1$
+                    else
+                        image += "_Cone"; //$NON-NLS-1$
+                }
+                image += ".png"; //$NON-NLS-1$
+                dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image)));
+
+                if (hasRadar()) {
+                    dlg.lM03Icon.setIcon(new ImageIcon(getClass().getResource(
+                            "/images/Radar_Reflector.png"))); //$NON-NLS-1$
+                }
+
+            } else
+                dlg.lM01Icon.setIcon(null);
+        }
+    }
+
+    public void saveSign() {
+        Node node = getNode();
+
+        if (node == null) {
+            return;
+        }
+
+        int cat = getBuoyIndex();
+        String shape = ""; //$NON-NLS-1$
+        String colour = ""; //$NON-NLS-1$
+
+        switch (cat) {
+
+        case PORT_HAND:
+            switch (getStyleIndex()) {
+            case LAT_CAN:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "can")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_PILLAR:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_SPAR:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_BEACON:
+                super.saveSign("beacon_lateral"); //$NON-NLS-1$
+                break;
+            case LAT_TOWER:
+                super.saveSign("beacon_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_FLOAT:
+                super.saveSign("light_float"); //$NON-NLS-1$
+                break;
+            case LAT_PERCH:
+                super.saveSign("beacon_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:shape", "perch")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            default:
+            }
+            switch (getStyleIndex()) {
+            case LAT_CAN:
+            case LAT_PILLAR:
+            case LAT_SPAR:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:category", "port")); //$NON-NLS-1$ //$NON-NLS-2$
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:buoy_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:buoy_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                }
+                break;
+            case LAT_PERCH:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:category", "port")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_BEACON:
+            case LAT_TOWER:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:category", "port")); //$NON-NLS-1$ //$NON-NLS-2$
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:beacon_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:beacon_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                }
+                break;
+            case LAT_FLOAT:
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:light_float:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:light_float:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                }
+                break;
+            }
+            shape = "cylinder"; //$NON-NLS-1$
+            break;
+
+        case PREF_PORT_HAND:
+            switch (getStyleIndex()) {
+            case LAT_CAN:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "can")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_PILLAR:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_SPAR:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_BEACON:
+                super.saveSign("beacon_lateral"); //$NON-NLS-1$
+                break;
+            case LAT_TOWER:
+                super.saveSign("beacon_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_FLOAT:
+                super.saveSign("light_float"); //$NON-NLS-1$
+                break;
+            default:
+            }
+            switch (getStyleIndex()) {
+            case LAT_CAN:
+            case LAT_PILLAR:
+            case LAT_SPAR:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:category", "preferred_channel_port")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:buoy_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:buoy_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                }
+                break;
+            case LAT_BEACON:
+            case LAT_TOWER:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:category", "preferred_channel_port")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:beacon_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:beacon_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                }
+                break;
+            case LAT_FLOAT:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:light_float:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:light_float:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:light_float:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                }
+                break;
+            }
+            shape = "cylinder"; //$NON-NLS-1$
+            break;
+
+        case STARBOARD_HAND:
+            switch (getStyleIndex()) {
+            case LAT_CONE:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "conical")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_PILLAR:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_SPAR:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_BEACON:
+                super.saveSign("beacon_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:shape", "stake")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_TOWER:
+                super.saveSign("beacon_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_FLOAT:
+                super.saveSign("light_float"); //$NON-NLS-1$
+                break;
+            case LAT_PERCH:
+                super.saveSign("beacon_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:shape", "perch")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            default:
+            }
+            switch (getStyleIndex()) {
+            case LAT_CAN:
+            case LAT_PILLAR:
+            case LAT_SPAR:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:category", "starboard")); //$NON-NLS-1$ //$NON-NLS-2$
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:buoy_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:buoy_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                }
+                break;
+            case LAT_BEACON:
+            case LAT_TOWER:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:category", "starboard")); //$NON-NLS-1$ //$NON-NLS-2$
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:beacon_lateral:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:beacon_lateral:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                }
+                break;
+            case LAT_FLOAT:
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:light_float:colour", "green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:light_float:colour", "red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                }
+                break;
+            case LAT_PERCH:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:category", "starboard")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            }
+            shape = "cone, point up"; //$NON-NLS-1$
+            break;
+
+        case PREF_STARBOARD_HAND:
+            switch (getStyleIndex()) {
+            case LAT_CONE:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "conical")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_PILLAR:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_SPAR:
+                super.saveSign("buoy_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_BEACON:
+                super.saveSign("beacon_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:shape", "stake")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_TOWER:
+                super.saveSign("beacon_lateral"); //$NON-NLS-1$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
+                break;
+            case LAT_FLOAT:
+                super.saveSign("light_float"); //$NON-NLS-1$
+                break;
+            default:
+            }
+            switch (getStyleIndex()) {
+            case LAT_CAN:
+            case LAT_PILLAR:
+            case LAT_SPAR:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:category", "preferred_channel_starboard")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:buoy_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:buoy_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:buoy_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                }
+                break;
+            case LAT_BEACON:
+            case LAT_TOWER:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:category", "preferred_channel_starboard")); //$NON-NLS-1$ //$NON-NLS-2$
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:beacon_lateral:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:beacon_lateral:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:beacon_lateral:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                }
+                break;
+            case LAT_FLOAT:
+                Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                        "seamark:light_float:colour_pattern", "horizontal stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+                if (getRegion() == IALA_A) {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:light_float:colour", "green;red;green")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "green"; //$NON-NLS-1$
+                } else {
+                    Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                            "seamark:light_float:colour", "red;green;red")); //$NON-NLS-1$ //$NON-NLS-2$
+                    colour = "red"; //$NON-NLS-1$
+                }
+                break;
+            }
+            shape = "cone, point up"; //$NON-NLS-1$
+            break;
+
+        default:
+        }
+        saveTopMarkData(shape, colour);
+        saveLightData();
+        saveRadarFogData();
+
+        Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+    }
+
+    public void setLightColour() {
+        if (getRegion() == IALA_A) {
+            if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND)
+                super.setLightColour("R"); //$NON-NLS-1$
+            else
+                super.setLightColour("G"); //$NON-NLS-1$
+        } else {
+            if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND)
+                super.setLightColour("G"); //$NON-NLS-1$
+            else
+                super.setLightColour("R"); //$NON-NLS-1$
+        }
+    }
+
+    public void setLightColour(String str) {
+        int cat = getBuoyIndex();
+
+        if (str == null) {
+            return;
+        }
+
+        switch (cat) {
+        case PORT_HAND:
+        case PREF_PORT_HAND:
+            if (getRegion() == IALA_A) {
+                if (str.equals("red")) { //$NON-NLS-1$
+                    setFired(true);
+                    super.setLightColour("R"); //$NON-NLS-1$
+                } else {
+                    super.setLightColour(""); //$NON-NLS-1$
+                }
+            } else {
+                if (str.equals("green")) { //$NON-NLS-1$
+                    setFired(true);
+                    super.setLightColour("G"); //$NON-NLS-1$
+                } else {
+                    super.setLightColour(""); //$NON-NLS-1$
+                }
+            }
+            break;
+
+        case STARBOARD_HAND:
+        case PREF_STARBOARD_HAND:
+            if (getRegion() == IALA_A) {
+                if (str.equals("green")) { //$NON-NLS-1$
+                    setFired(true);
+                    super.setLightColour("G"); //$NON-NLS-1$
+                } else {
+                    super.setLightColour(""); //$NON-NLS-1$
+                }
+            } else {
+                if (str.equals("red")) { //$NON-NLS-1$
+                    setFired(true);
+                    super.setLightColour("R"); //$NON-NLS-1$
+                } else {
+                    super.setLightColour(""); //$NON-NLS-1$
+                }
+            }
+            break;
+        default:
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyNota.java	(revision 23193)
@@ -17,144 +17,144 @@
 
 public class BuoyNota extends Buoy {
-	public BuoyNota(SmpDialogAction dia, Node node) {
-		super(dia);
+    public BuoyNota(SmpDialogAction dia, Node node) {
+        super(dia);
 
-		Map<String, String> keys;
-		keys = node.getKeys();
-		setNode(node);
+        Map<String, String> keys;
+        keys = node.getKeys();
+        setNode(node);
 
-		resetMask();
+        resetMask();
 
-		dlg.cbM01TypeOfMark.setSelectedIndex(LIGHT);
+        dlg.cbM01TypeOfMark.setSelectedIndex(LIGHT);
 
-		dlg.cbM01CatOfMark.setEnabled(true);
-		dlg.cbM01CatOfMark.setVisible(true);
-		dlg.lM01CatOfMark.setVisible(true);
+        dlg.cbM01CatOfMark.setEnabled(true);
+        dlg.cbM01CatOfMark.setVisible(true);
+        dlg.lM01CatOfMark.setVisible(true);
 
-		dlg.cbM01CatOfMark.removeAllItems();
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.157")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.206")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.207")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.208")); //$NON-NLS-1$
-		dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.209")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.removeAllItems();
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.157")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.206")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.207")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.208")); //$NON-NLS-1$
+        dlg.cbM01CatOfMark.addItem(Messages.getString("SmpDialogAction.209")); //$NON-NLS-1$
 
-		setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$
+        setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$
 
-		if (keys.containsKey("name")) //$NON-NLS-1$
-			setName(keys.get("name")); //$NON-NLS-1$
+        if (keys.containsKey("name")) //$NON-NLS-1$
+            setName(keys.get("name")); //$NON-NLS-1$
 
-		if (keys.containsKey("seamark:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:name")); //$NON-NLS-1$
+        if (keys.containsKey("seamark:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:name")); //$NON-NLS-1$
 
-		if (keys.containsKey("seamark:landmark:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:landmark:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:light_major:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:light_major:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:light_minor:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:light_minor:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:light_vessel:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:light_vessel:name")); //$NON-NLS-1$
+        if (keys.containsKey("seamark:landmark:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:landmark:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:light_major:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:light_major:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:light_minor:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:light_minor:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:light_vessel:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:light_vessel:name")); //$NON-NLS-1$
 
-		if (keys.containsKey("seamark:type")) { //$NON-NLS-1$
-			String type = keys.get("seamark:type"); //$NON-NLS-1$
-			if (type.equals("landmark"))
-				setBuoyIndex(LIGHT_HOUSE);
-			else if (type.equals("light_major"))
-				setBuoyIndex(LIGHT_MAJOR);
-			else if (type.equals("light_minor"))
-				setBuoyIndex(LIGHT_MINOR);
-			else if (type.equals("light_vessel"))
-				setBuoyIndex(LIGHT_VESSEL);
-		}
+        if (keys.containsKey("seamark:type")) { //$NON-NLS-1$
+            String type = keys.get("seamark:type"); //$NON-NLS-1$
+            if (type.equals("landmark"))
+                setBuoyIndex(LIGHT_HOUSE);
+            else if (type.equals("light_major"))
+                setBuoyIndex(LIGHT_MAJOR);
+            else if (type.equals("light_minor"))
+                setBuoyIndex(LIGHT_MINOR);
+            else if (type.equals("light_vessel"))
+                setBuoyIndex(LIGHT_VESSEL);
+        }
 
-		refreshLights();
-		parseLights(keys);
-		parseFogRadar(keys);
-		setTopMark(false);
-		setFired(true);
+        refreshLights();
+        parseLights(keys);
+        parseFogRadar(keys);
+        setTopMark(false);
+        setFired(true);
 
-		dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());
-		dlg.tfM01Name.setText(getName());
-		dlg.cM01Fired.setEnabled(false);
-		dlg.cM01Fired.setSelected(true);
-	}
+        dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());
+        dlg.tfM01Name.setText(getName());
+        dlg.cM01Fired.setEnabled(false);
+        dlg.cM01Fired.setSelected(true);
+    }
 
-	public boolean isValid() {
-		return (getBuoyIndex() > 0);
-	}
+    public boolean isValid() {
+        return (getBuoyIndex() > 0);
+    }
 
-	public void paintSign() {
-		if (dlg.paintlock)
-			return;
-		super.paintSign();
+    public void paintSign() {
+        if (dlg.paintlock)
+            return;
+        super.paintSign();
 
-		dlg.sM01StatusBar.setText(getErrMsg());
+        dlg.sM01StatusBar.setText(getErrMsg());
 
-		if (isValid()) {
-			dlg.cM01Radar.setVisible(true);
-			dlg.cM01Racon.setVisible(true);
-			dlg.cM01Fog.setVisible(true);
+        if (isValid()) {
+            dlg.cM01Radar.setVisible(true);
+            dlg.cM01Racon.setVisible(true);
+            dlg.cM01Fog.setVisible(true);
 
-			dlg.rbM01Fired1.setVisible(true);
-			dlg.rbM01FiredN.setVisible(true);
-			dlg.lM01Height.setVisible(true);
-			dlg.tfM01Height.setVisible(true);
-			dlg.lM01Range.setVisible(true);
-			dlg.tfM01Range.setVisible(true);
+            dlg.rbM01Fired1.setVisible(true);
+            dlg.rbM01FiredN.setVisible(true);
+            dlg.lM01Height.setVisible(true);
+            dlg.tfM01Height.setVisible(true);
+            dlg.lM01Range.setVisible(true);
+            dlg.tfM01Range.setVisible(true);
 
-			switch (getBuoyIndex()) {
-			case SeaMark.LIGHT_HOUSE:
-				dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(
-						"/images/Light_House.png"))); //$NON-NLS-1$
-				break;
+            switch (getBuoyIndex()) {
+            case SeaMark.LIGHT_HOUSE:
+                dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(
+                        "/images/Light_House.png"))); //$NON-NLS-1$
+                break;
 
-			case SeaMark.LIGHT_MAJOR:
-				dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(
-						"/images/Light_Major.png"))); //$NON-NLS-1$
-				break;
+            case SeaMark.LIGHT_MAJOR:
+                dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(
+                        "/images/Light_Major.png"))); //$NON-NLS-1$
+                break;
 
-			case SeaMark.LIGHT_MINOR:
-				dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(
-						"/images/Light_Minor.png"))); //$NON-NLS-1$
-				break;
+            case SeaMark.LIGHT_MINOR:
+                dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(
+                        "/images/Light_Minor.png"))); //$NON-NLS-1$
+                break;
 
-			case SeaMark.LIGHT_VESSEL:
-				dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(
-						"/images/Major_Float.png"))); //$NON-NLS-1$
-				break;
+            case SeaMark.LIGHT_VESSEL:
+                dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(
+                        "/images/Major_Float.png"))); //$NON-NLS-1$
+                break;
 
-			default:
-			}
-		}
-	}
+            default:
+            }
+        }
+    }
 
-	public void saveSign() {
-		Node node = getNode();
+    public void saveSign() {
+        Node node = getNode();
 
-		if (node == null) {
-			return;
-		}
+        if (node == null) {
+            return;
+        }
 
-		switch (getBuoyIndex()) {
-		case LIGHT_HOUSE:
-			super.saveSign("landmark"); //$NON-NLS-1$
-			break;
-		case LIGHT_MAJOR:
-			super.saveSign("light_major"); //$NON-NLS-1$
-			break;
-		case LIGHT_MINOR:
-			super.saveSign("light_minor"); //$NON-NLS-1$
-			break;
-		case LIGHT_VESSEL:
-			super.saveSign("light_vessel"); //$NON-NLS-1$
-			break;
-		default:
-		}
-		saveLightData(); //$NON-NLS-1$
-		saveRadarFogData();
-	}
+        switch (getBuoyIndex()) {
+        case LIGHT_HOUSE:
+            super.saveSign("landmark"); //$NON-NLS-1$
+            break;
+        case LIGHT_MAJOR:
+            super.saveSign("light_major"); //$NON-NLS-1$
+            break;
+        case LIGHT_MINOR:
+            super.saveSign("light_minor"); //$NON-NLS-1$
+            break;
+        case LIGHT_VESSEL:
+            super.saveSign("light_vessel"); //$NON-NLS-1$
+            break;
+        default:
+        }
+        saveLightData(); //$NON-NLS-1$
+        saveRadarFogData();
+    }
 
-	public void setLightColour() {
-	}
+    public void setLightColour() {
+    }
 
 }
Index: /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java	(revision 23193)
@@ -17,233 +17,233 @@
 
 public class BuoySaw extends Buoy {
-	public BuoySaw(SmpDialogAction dia, Node node) {
-		super(dia);
-
-		String str;
-		Map<String, String> keys;
-		keys = node.getKeys();
-		setNode(node);
-
-		resetMask();
-
-		dlg.cbM01TypeOfMark.setSelectedIndex(SAFE_WATER);
-
-		dlg.cbM01StyleOfMark.removeAllItems();
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.08")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.setVisible(true);
-		dlg.lM01StyleOfMark.setVisible(true);
-
-		setBuoyIndex(SAFE_WATER);
-		setColour(SeaMark.RED_WHITE);
-		setLightColour("W"); //$NON-NLS-1$
-		setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$
-
-		if (keys.containsKey("name")) //$NON-NLS-1$
-			setName(keys.get("name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:buoy_safe_water:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:buoy_safe_water:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:beacon_safe_water:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:beacon_safe_water:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:buoy_safe_water:shape")) { //$NON-NLS-1$
-			str = keys.get("seamark:buoy_safe_water:shape"); //$NON-NLS-1$
-
-			if (str.equals("pillar")) //$NON-NLS-1$
-				setStyleIndex(SAFE_PILLAR);
-			else if (str.equals("spar")) //$NON-NLS-1$
-				setStyleIndex(SAFE_SPAR);
-			else if (str.equals("sphere")) //$NON-NLS-1$
-				setStyleIndex(SAFE_SPHERE);
-		} else if ((keys.containsKey("seamark:type")) //$NON-NLS-1$
-				&& (keys.get("seamark:type").equals("light_float"))) { //$NON-NLS-1$ //$NON-NLS-2$
-			setStyleIndex(SAFE_FLOAT);
-		} else if ((keys.containsKey("seamark:type")) //$NON-NLS-1$
-				&& (keys.get("seamark:type").equals("beacon_safe_water"))) { //$NON-NLS-1$ //$NON-NLS-2$
-			setStyleIndex(SAFE_BEACON);
-		}
-
-		if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
-			setStyleIndex(0);
-		
-		if (keys.containsKey("seamark:topmark:shape") //$NON-NLS-1$
-				|| keys.containsKey("seamark:topmark:colour")) { //$NON-NLS-1$
-			setTopMark(true);
-		}
-
-		refreshLights();
-		parseLights(keys);
-		parseFogRadar(keys);
-
-		dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
-		dlg.tfM01Name.setText(getName());
-		dlg.cM01TopMark.setSelected(hasTopMark());
-	}
-
-	public void refreshLights() {
-		dlg.cbM01Kennung.removeAllItems();
-		dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("Iso"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("LFl"); //$NON-NLS-1$
-		dlg.cbM01Kennung.addItem("Mo"); //$NON-NLS-1$
-		dlg.cbM01Kennung.setSelectedIndex(0);
-	}
-	
-	public boolean isValid() {
-		return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
-	}
-
-	public void paintSign() {
-		if (dlg.paintlock)
-			return;
-		super.paintSign();
-
-		dlg.sM01StatusBar.setText(getErrMsg());
-
-		if (isValid()) {
-			dlg.tfM01Name.setEnabled(true);
-			dlg.tfM01Name.setText(getName());
-			dlg.cM01TopMark.setEnabled(true);
-			dlg.cM01TopMark.setVisible(true);
-			dlg.cM01Radar.setVisible(true);
-			dlg.cM01Racon.setVisible(true);
-			dlg.cM01Fog.setVisible(true);
-			dlg.cM01Fired.setVisible(true);
-			dlg.cM01Fired.setEnabled(true);
-			dlg.cbM01Colour.setVisible(false);
-			dlg.lM01Colour.setVisible(false);
-			dlg.rbM01Fired1.setVisible(false);
-			dlg.rbM01FiredN.setVisible(false);
-			dlg.lM01Height.setVisible(false);
-			dlg.tfM01Height.setVisible(false);
-			dlg.lM01Range.setVisible(false);
-			dlg.tfM01Range.setVisible(false);
-
-			if (isFired()) {
-				switch (getStyleIndex()) {
-				case SPEC_FLOAT:
-					dlg.lM01Height.setVisible(true);
-					dlg.tfM01Height.setVisible(true);
-					dlg.lM01Range.setVisible(true);
-					dlg.tfM01Range.setVisible(true);
-					break;
-				case SPEC_BEACON:
-				case SPEC_TOWER:
-					dlg.rbM01Fired1.setVisible(true);
-					dlg.rbM01FiredN.setVisible(true);
-					dlg.lM01Height.setVisible(true);
-					dlg.tfM01Height.setVisible(true);
-					dlg.lM01Range.setVisible(true);
-					dlg.tfM01Range.setVisible(true);
-					break;
-				default:
-				}
-			}
-
-			String image = "/images/Safe_Water"; //$NON-NLS-1$
-
-			switch (getStyleIndex()) {
-			case SAFE_PILLAR:
-				image += "_Pillar"; //$NON-NLS-1$
-				break;
-			case SAFE_SPAR:
-				image += "_Spar"; //$NON-NLS-1$
-				break;
-			case SAFE_SPHERE:
-				image += "_Sphere"; //$NON-NLS-1$
-				break;
-			case SAFE_BEACON:
-				image += "_Beacon"; //$NON-NLS-1$
-				break;
-			case SAFE_FLOAT:
-				image += "_Float"; //$NON-NLS-1$
-				break;
-			default:
-			}
-
-			if (!image.equals("/images/Safe_Water")) { //$NON-NLS-1$
-				if (hasTopMark())
-					image += "_Sphere"; //$NON-NLS-1$
-				image += ".png"; //$NON-NLS-1$
-				dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image)));
-			} else
-				dlg.lM01Icon.setIcon(null);
-		}
-	}
-
-	public void saveSign() {
-		Node node = getNode();
-
-		if (node == null) {
-			return;
-		}
-
-		switch (getStyleIndex()) {
-		case SAFE_PILLAR:
-			super.saveSign("buoy_safe_water"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_safe_water:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case SAFE_SPAR:
-			super.saveSign("buoy_safe_water"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_safe_water:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case SAFE_SPHERE:
-			super.saveSign("buoy_safe_water"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_safe_water:shape", "sphere")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case SAFE_BEACON:
-			super.saveSign("beacon_safe_water"); //$NON-NLS-1$
-			break;
-		case SAFE_FLOAT:
-			super.saveSign("light_float"); //$NON-NLS-1$
-			break;
-		default:
-		}
-
-		switch (getStyleIndex()) {
-		case SAFE_PILLAR:
-		case SAFE_SPAR:
-		case SAFE_SPHERE:
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_safe_water:colour_pattern", "vertical stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_safe_water:colour", "red;white")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case SAFE_BEACON:
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:beacon_safe_water:colour_pattern", "vertical stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:beacon_safe_water:colour", "red;white")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case SAFE_FLOAT:
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:light_float:colour_pattern", "vertical stripes")); //$NON-NLS-1$ //$NON-NLS-2$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:light_float:colour", "red;white")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		default:
-		}
-		saveTopMarkData("spherical", "red"); //$NON-NLS-1$ //$NON-NLS-2$
-		saveLightData(); //$NON-NLS-1$
-		saveRadarFogData();
-	}
-
-	public void setLightColour() {
-		super.setLightColour("W"); //$NON-NLS-1$
-	}
+    public BuoySaw(SmpDialogAction dia, Node node) {
+        super(dia);
+
+        String str;
+        Map<String, String> keys;
+        keys = node.getKeys();
+        setNode(node);
+
+        resetMask();
+
+        dlg.cbM01TypeOfMark.setSelectedIndex(SAFE_WATER);
+
+        dlg.cbM01StyleOfMark.removeAllItems();
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.08")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.setVisible(true);
+        dlg.lM01StyleOfMark.setVisible(true);
+
+        setBuoyIndex(SAFE_WATER);
+        setColour(SeaMark.RED_WHITE);
+        setLightColour("W"); //$NON-NLS-1$
+        setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$
+
+        if (keys.containsKey("name")) //$NON-NLS-1$
+            setName(keys.get("name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:buoy_safe_water:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:buoy_safe_water:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:beacon_safe_water:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:beacon_safe_water:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:buoy_safe_water:shape")) { //$NON-NLS-1$
+            str = keys.get("seamark:buoy_safe_water:shape"); //$NON-NLS-1$
+
+            if (str.equals("pillar")) //$NON-NLS-1$
+                setStyleIndex(SAFE_PILLAR);
+            else if (str.equals("spar")) //$NON-NLS-1$
+                setStyleIndex(SAFE_SPAR);
+            else if (str.equals("sphere")) //$NON-NLS-1$
+                setStyleIndex(SAFE_SPHERE);
+        } else if ((keys.containsKey("seamark:type")) //$NON-NLS-1$
+                && (keys.get("seamark:type").equals("light_float"))) { //$NON-NLS-1$ //$NON-NLS-2$
+            setStyleIndex(SAFE_FLOAT);
+        } else if ((keys.containsKey("seamark:type")) //$NON-NLS-1$
+                && (keys.get("seamark:type").equals("beacon_safe_water"))) { //$NON-NLS-1$ //$NON-NLS-2$
+            setStyleIndex(SAFE_BEACON);
+        }
+
+        if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
+            setStyleIndex(0);
+        
+        if (keys.containsKey("seamark:topmark:shape") //$NON-NLS-1$
+                || keys.containsKey("seamark:topmark:colour")) { //$NON-NLS-1$
+            setTopMark(true);
+        }
+
+        refreshLights();
+        parseLights(keys);
+        parseFogRadar(keys);
+
+        dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
+        dlg.tfM01Name.setText(getName());
+        dlg.cM01TopMark.setSelected(hasTopMark());
+    }
+
+    public void refreshLights() {
+        dlg.cbM01Kennung.removeAllItems();
+        dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("Iso"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("Oc"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("LFl"); //$NON-NLS-1$
+        dlg.cbM01Kennung.addItem("Mo"); //$NON-NLS-1$
+        dlg.cbM01Kennung.setSelectedIndex(0);
+    }
+    
+    public boolean isValid() {
+        return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
+    }
+
+    public void paintSign() {
+        if (dlg.paintlock)
+            return;
+        super.paintSign();
+
+        dlg.sM01StatusBar.setText(getErrMsg());
+
+        if (isValid()) {
+            dlg.tfM01Name.setEnabled(true);
+            dlg.tfM01Name.setText(getName());
+            dlg.cM01TopMark.setEnabled(true);
+            dlg.cM01TopMark.setVisible(true);
+            dlg.cM01Radar.setVisible(true);
+            dlg.cM01Racon.setVisible(true);
+            dlg.cM01Fog.setVisible(true);
+            dlg.cM01Fired.setVisible(true);
+            dlg.cM01Fired.setEnabled(true);
+            dlg.cbM01Colour.setVisible(false);
+            dlg.lM01Colour.setVisible(false);
+            dlg.rbM01Fired1.setVisible(false);
+            dlg.rbM01FiredN.setVisible(false);
+            dlg.lM01Height.setVisible(false);
+            dlg.tfM01Height.setVisible(false);
+            dlg.lM01Range.setVisible(false);
+            dlg.tfM01Range.setVisible(false);
+
+            if (isFired()) {
+                switch (getStyleIndex()) {
+                case SPEC_FLOAT:
+                    dlg.lM01Height.setVisible(true);
+                    dlg.tfM01Height.setVisible(true);
+                    dlg.lM01Range.setVisible(true);
+                    dlg.tfM01Range.setVisible(true);
+                    break;
+                case SPEC_BEACON:
+                case SPEC_TOWER:
+                    dlg.rbM01Fired1.setVisible(true);
+                    dlg.rbM01FiredN.setVisible(true);
+                    dlg.lM01Height.setVisible(true);
+                    dlg.tfM01Height.setVisible(true);
+                    dlg.lM01Range.setVisible(true);
+                    dlg.tfM01Range.setVisible(true);
+                    break;
+                default:
+                }
+            }
+
+            String image = "/images/Safe_Water"; //$NON-NLS-1$
+
+            switch (getStyleIndex()) {
+            case SAFE_PILLAR:
+                image += "_Pillar"; //$NON-NLS-1$
+                break;
+            case SAFE_SPAR:
+                image += "_Spar"; //$NON-NLS-1$
+                break;
+            case SAFE_SPHERE:
+                image += "_Sphere"; //$NON-NLS-1$
+                break;
+            case SAFE_BEACON:
+                image += "_Beacon"; //$NON-NLS-1$
+                break;
+            case SAFE_FLOAT:
+                image += "_Float"; //$NON-NLS-1$
+                break;
+            default:
+            }
+
+            if (!image.equals("/images/Safe_Water")) { //$NON-NLS-1$
+                if (hasTopMark())
+                    image += "_Sphere"; //$NON-NLS-1$
+                image += ".png"; //$NON-NLS-1$
+                dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image)));
+            } else
+                dlg.lM01Icon.setIcon(null);
+        }
+    }
+
+    public void saveSign() {
+        Node node = getNode();
+
+        if (node == null) {
+            return;
+        }
+
+        switch (getStyleIndex()) {
+        case SAFE_PILLAR:
+            super.saveSign("buoy_safe_water"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_safe_water:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case SAFE_SPAR:
+            super.saveSign("buoy_safe_water"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_safe_water:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case SAFE_SPHERE:
+            super.saveSign("buoy_safe_water"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_safe_water:shape", "sphere")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case SAFE_BEACON:
+            super.saveSign("beacon_safe_water"); //$NON-NLS-1$
+            break;
+        case SAFE_FLOAT:
+            super.saveSign("light_float"); //$NON-NLS-1$
+            break;
+        default:
+        }
+
+        switch (getStyleIndex()) {
+        case SAFE_PILLAR:
+        case SAFE_SPAR:
+        case SAFE_SPHERE:
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_safe_water:colour_pattern", "vertical stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_safe_water:colour", "red;white")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case SAFE_BEACON:
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:beacon_safe_water:colour_pattern", "vertical stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:beacon_safe_water:colour", "red;white")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case SAFE_FLOAT:
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:light_float:colour_pattern", "vertical stripes")); //$NON-NLS-1$ //$NON-NLS-2$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:light_float:colour", "red;white")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        default:
+        }
+        saveTopMarkData("spherical", "red"); //$NON-NLS-1$ //$NON-NLS-2$
+        saveLightData(); //$NON-NLS-1$
+        saveRadarFogData();
+    }
+
+    public void setLightColour() {
+        super.setLightColour("W"); //$NON-NLS-1$
+    }
 
 }
Index: /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java	(revision 23193)
@@ -17,293 +17,293 @@
 
 public class BuoySpec extends Buoy {
-	public BuoySpec(SmpDialogAction dia, Node node) {
-		super(dia);
-
-		String str;
-		Map<String, String> keys;
-		keys = node.getKeys();
-		setNode(node);
-
-		resetMask();
-
-		dlg.cbM01TypeOfMark.setSelectedIndex(SPECIAL_PURPOSE);
-
-		dlg.cbM01StyleOfMark.removeAllItems();
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.08")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.09")); //$NON-NLS-1$
-		dlg.cbM01StyleOfMark.setVisible(true);
-		dlg.lM01StyleOfMark.setVisible(true);
-
-		dlg.cbM01TopMark.removeAllItems();
-		dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.212"));
-		dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.210")); //$NON-NLS-1$
-		dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.211")); //$NON-NLS-1$
-
-		dlg.cM01TopMark.setEnabled(true);
-
-		setBuoyIndex(SPECIAL_PURPOSE);
-		setColour(SeaMark.YELLOW);
-		setLightColour("W"); //$NON-NLS-1$
-		setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$
-
-		if (keys.containsKey("name")) //$NON-NLS-1$
-			setName(keys.get("name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:buoy_special_purpose:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:buoy_special_purpose:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:beacon_special_purpose:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:beacon_special_purpose:name")); //$NON-NLS-1$
-		else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$
-			setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$
-
-		if (keys.containsKey("seamark:buoy_special_purpose:shape")) { //$NON-NLS-1$
-			str = keys.get("seamark:buoy_special_purpose:shape"); //$NON-NLS-1$
-
-			if (str.equals("pillar")) //$NON-NLS-1$
-				setStyleIndex(SPEC_PILLAR);
-			else if (str.equals("can")) //$NON-NLS-1$
-				setStyleIndex(SPEC_CAN);
-			else if (str.equals("conical")) //$NON-NLS-1$
-				setStyleIndex(SPEC_CONE);
-			else if (str.equals("spar")) //$NON-NLS-1$
-				setStyleIndex(SPEC_SPAR);
-			else if (str.equals("sphere")) //$NON-NLS-1$
-				setStyleIndex(SPEC_SPHERE);
-			else if (str.equals("barrel")) //$NON-NLS-1$
-				setStyleIndex(SPEC_BARREL);
-		}
-
-		if (keys.containsKey("seamark:beacon_special_purpose:shape")) { //$NON-NLS-1$
-			str = keys.get("seamark:beacon_special_purpose:shape"); //$NON-NLS-1$
-		if (str.equals("tower")) //$NON-NLS-1$
-			setStyleIndex(SPEC_TOWER);
-		else 
-			setStyleIndex(SPEC_BEACON);
-		}
-
-		if (keys.containsKey("seamark:light_float:colour")) {
-			setStyleIndex(SPEC_FLOAT);
-		}
-		
-		if ((keys.containsKey("seamark:type") && keys.get("seamark:type").equals( //$NON-NLS-1$ //$NON-NLS-2$
-				"beacon_special_purpose")) //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_special_purpose:colour") //$NON-NLS-1$
-				|| keys.containsKey("seamark:beacon_special_purpose:shape")) { //$NON-NLS-1$
-			if (keys.containsKey("seamark:beacon_special_purpose:shape") //$NON-NLS-1$
-					&& keys.get("seamark:beacon_special_purpose:shape").equals("tower")) //$NON-NLS-1$ //$NON-NLS-2$
-				setStyleIndex(SPEC_TOWER);
-			else
-				setStyleIndex(SPEC_BEACON);
-		} else if (keys.containsKey("seamark:light_float:colour") //$NON-NLS-1$
-				&& keys.get("seamark:light_float:colour").equals("yellow")) //$NON-NLS-1$ //$NON-NLS-2$
-			setStyleIndex(SPEC_FLOAT);
-
-		if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
-			setStyleIndex(0);
-
-		keys = node.getKeys();
-		if (keys.containsKey("seamark:topmark:shape")) { //$NON-NLS-1$
-			str = keys.get("seamark:topmark:shape"); //$NON-NLS-1$
-
-			if (str.equals("x-shape")) { //$NON-NLS-1$
-				setTopMark(true);
-			}
-		}
-
-		refreshLights();
-		parseLights(keys);
-		parseFogRadar(keys);
-
-		dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
-		dlg.tfM01Name.setText(getName());
-		dlg.cM01TopMark.setSelected(hasTopMark());
-	}
-
-	public void setStyleIndex(int styleIndex) {
-		super.setStyleIndex(styleIndex);
-		if (styleIndex == SPEC_BARREL) {
-			dlg.cM01Fired.setSelected(false);
-			dlg.cM01Fired.setEnabled(false);
-			dlg.cM01TopMark.setEnabled(true);
-		} else {
-			dlg.cM01Fired.setEnabled(true);
-			dlg.cM01TopMark.setEnabled(true);
-		}
-	}
-
-	public boolean isValid() {
-		return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
-	}
-
-	public void paintSign() {
-		if (dlg.paintlock)
-			return;
-		super.paintSign();
-
-		dlg.sM01StatusBar.setText(getErrMsg());
-
-		if (isValid()) {
-			dlg.tfM01Name.setEnabled(true);
-			dlg.tfM01Name.setText(getName());
-			dlg.cM01Radar.setVisible(true);
-			dlg.cM01Racon.setVisible(true);
-			dlg.cM01TopMark.setEnabled(true);
-			dlg.cM01TopMark.setVisible(true);
-			if (hasTopMark()) {
-				dlg.cbM01TopMark.setEnabled(true);
-				dlg.cbM01TopMark.setVisible(true);
-			} else {
-				dlg.cbM01TopMark.setVisible(false);
-			}
-			dlg.cM01Fog.setVisible(true);
-			dlg.cM01Fired.setVisible(true);
-			dlg.cM01Fired.setEnabled(true);
-			dlg.cbM01Colour.setVisible(false);
-			dlg.lM01Colour.setVisible(false);
-			dlg.rbM01Fired1.setVisible(false);
-			dlg.rbM01FiredN.setVisible(false);
-			dlg.lM01Height.setVisible(false);
-			dlg.tfM01Height.setVisible(false);
-			dlg.lM01Range.setVisible(false);
-			dlg.tfM01Range.setVisible(false);
-			
-			if (isFired()) {
-				switch (getStyleIndex()) {
-				case SPEC_FLOAT:
-					dlg.lM01Height.setVisible(true);
-					dlg.tfM01Height.setVisible(true);
-					dlg.lM01Range.setVisible(true);
-					dlg.tfM01Range.setVisible(true);
-					break;
-				case SPEC_BEACON:
-				case SPEC_TOWER:
-					dlg.rbM01Fired1.setVisible(true);
-					dlg.rbM01FiredN.setVisible(true);
-					dlg.lM01Height.setVisible(true);
-					dlg.tfM01Height.setVisible(true);
-					dlg.lM01Range.setVisible(true);
-					dlg.tfM01Range.setVisible(true);
-					break;
-				default:
-				}
-			}
-
-			String image = "/images/Special_Purpose"; //$NON-NLS-1$
-
-			switch (getStyleIndex()) {
-			case SPEC_PILLAR:
-				image += "_Pillar"; //$NON-NLS-1$
-				break;
-			case SPEC_CAN:
-				image += "_Can"; //$NON-NLS-1$
-				break;
-			case SPEC_CONE:
-				image += "_Cone"; //$NON-NLS-1$
-				break;
-			case SPEC_SPAR:
-				image += "_Spar"; //$NON-NLS-1$
-				break;
-			case SPEC_SPHERE:
-				image += "_Sphere"; //$NON-NLS-1$
-				break;
-			case SPEC_BARREL:
-				image += "_Barrel"; //$NON-NLS-1$
-				break;
-			case SPEC_FLOAT:
-				image += "_Float"; //$NON-NLS-1$
-				break;
-			case SPEC_BEACON:
-				image += "_Beacon"; //$NON-NLS-1$
-				break;
-			case SPEC_TOWER:
-				image += "_Tower"; //$NON-NLS-1$
-				break;
-			default:
-			}
-
-			if (!image.equals("/images/Special_Purpose")) { //$NON-NLS-1$
-//				if (hasTopMark())
-//					image += "_CrossY"; //$NON-NLS-1$
-				image += ".png"; //$NON-NLS-1$
-				dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image)));
-			} else
-				dlg.lM01Icon.setIcon(null);
-		}
-	}
-
-	public void saveSign() {
-		Node node = getNode();
-
-		if (node == null) {
-			return;
-		}
-
-		switch (getStyleIndex()) {
-		case SPEC_PILLAR:
-			super.saveSign("buoy_special_purpose"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_special_purpose:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case SPEC_SPAR:
-			super.saveSign("buoy_special_purpose"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_special_purpose:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case SPEC_SPHERE:
-			super.saveSign("buoy_special_purpose"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_special_purpose:shape", "sphere")); //$NON-NLS-1$ //$NON-NLS-2$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case SPEC_BARREL:
-			super.saveSign("buoy_special_purpose"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_special_purpose:shape", "barrel")); //$NON-NLS-1$ //$NON-NLS-2$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case SPEC_FLOAT:
-			super.saveSign("light_float"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:light_float:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case SPEC_BEACON:
-			super.saveSign("beacon_special_purpose"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:beacon_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		case SPEC_TOWER:
-			super.saveSign("beacon_special_purpose"); //$NON-NLS-1$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:beacon_special_purpose:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
-			Main.main.undoRedo.add(new ChangePropertyCommand(node,
-					"seamark:beacon_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
-			break;
-		default:
-		}
-		saveTopMarkData("x-shape", "yellow"); //$NON-NLS-1$ //$NON-NLS-2$
-		saveLightData(); //$NON-NLS-1$
-		saveRadarFogData();
-	}
-
-	public void setLightColour() {
-		super.setLightColour("W"); //$NON-NLS-1$
-	}
+    public BuoySpec(SmpDialogAction dia, Node node) {
+        super(dia);
+
+        String str;
+        Map<String, String> keys;
+        keys = node.getKeys();
+        setNode(node);
+
+        resetMask();
+
+        dlg.cbM01TypeOfMark.setSelectedIndex(SPECIAL_PURPOSE);
+
+        dlg.cbM01StyleOfMark.removeAllItems();
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("SmpDialogAction.212")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.01")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.04")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.05")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.06")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.08")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.09")); //$NON-NLS-1$
+        dlg.cbM01StyleOfMark.setVisible(true);
+        dlg.lM01StyleOfMark.setVisible(true);
+
+        dlg.cbM01TopMark.removeAllItems();
+        dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.212"));
+        dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.210")); //$NON-NLS-1$
+        dlg.cbM01TopMark.addItem(Messages.getString("SmpDialogAction.211")); //$NON-NLS-1$
+
+        dlg.cM01TopMark.setEnabled(true);
+
+        setBuoyIndex(SPECIAL_PURPOSE);
+        setColour(SeaMark.YELLOW);
+        setLightColour("W"); //$NON-NLS-1$
+        setRegion(Main.pref.get("tomsplugin.IALA").equals("B")); //$NON-NLS-1$ //$NON-NLS-2$
+
+        if (keys.containsKey("name")) //$NON-NLS-1$
+            setName(keys.get("name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:buoy_special_purpose:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:buoy_special_purpose:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:beacon_special_purpose:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:beacon_special_purpose:name")); //$NON-NLS-1$
+        else if (keys.containsKey("seamark:light_float:name")) //$NON-NLS-1$
+            setName(keys.get("seamark:light_float:name")); //$NON-NLS-1$
+
+        if (keys.containsKey("seamark:buoy_special_purpose:shape")) { //$NON-NLS-1$
+            str = keys.get("seamark:buoy_special_purpose:shape"); //$NON-NLS-1$
+
+            if (str.equals("pillar")) //$NON-NLS-1$
+                setStyleIndex(SPEC_PILLAR);
+            else if (str.equals("can")) //$NON-NLS-1$
+                setStyleIndex(SPEC_CAN);
+            else if (str.equals("conical")) //$NON-NLS-1$
+                setStyleIndex(SPEC_CONE);
+            else if (str.equals("spar")) //$NON-NLS-1$
+                setStyleIndex(SPEC_SPAR);
+            else if (str.equals("sphere")) //$NON-NLS-1$
+                setStyleIndex(SPEC_SPHERE);
+            else if (str.equals("barrel")) //$NON-NLS-1$
+                setStyleIndex(SPEC_BARREL);
+        }
+
+        if (keys.containsKey("seamark:beacon_special_purpose:shape")) { //$NON-NLS-1$
+            str = keys.get("seamark:beacon_special_purpose:shape"); //$NON-NLS-1$
+        if (str.equals("tower")) //$NON-NLS-1$
+            setStyleIndex(SPEC_TOWER);
+        else 
+            setStyleIndex(SPEC_BEACON);
+        }
+
+        if (keys.containsKey("seamark:light_float:colour")) {
+            setStyleIndex(SPEC_FLOAT);
+        }
+        
+        if ((keys.containsKey("seamark:type") && keys.get("seamark:type").equals( //$NON-NLS-1$ //$NON-NLS-2$
+                "beacon_special_purpose")) //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_special_purpose:colour") //$NON-NLS-1$
+                || keys.containsKey("seamark:beacon_special_purpose:shape")) { //$NON-NLS-1$
+            if (keys.containsKey("seamark:beacon_special_purpose:shape") //$NON-NLS-1$
+                    && keys.get("seamark:beacon_special_purpose:shape").equals("tower")) //$NON-NLS-1$ //$NON-NLS-2$
+                setStyleIndex(SPEC_TOWER);
+            else
+                setStyleIndex(SPEC_BEACON);
+        } else if (keys.containsKey("seamark:light_float:colour") //$NON-NLS-1$
+                && keys.get("seamark:light_float:colour").equals("yellow")) //$NON-NLS-1$ //$NON-NLS-2$
+            setStyleIndex(SPEC_FLOAT);
+
+        if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
+            setStyleIndex(0);
+
+        keys = node.getKeys();
+        if (keys.containsKey("seamark:topmark:shape")) { //$NON-NLS-1$
+            str = keys.get("seamark:topmark:shape"); //$NON-NLS-1$
+
+            if (str.equals("x-shape")) { //$NON-NLS-1$
+                setTopMark(true);
+            }
+        }
+
+        refreshLights();
+        parseLights(keys);
+        parseFogRadar(keys);
+
+        dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
+        dlg.tfM01Name.setText(getName());
+        dlg.cM01TopMark.setSelected(hasTopMark());
+    }
+
+    public void setStyleIndex(int styleIndex) {
+        super.setStyleIndex(styleIndex);
+        if (styleIndex == SPEC_BARREL) {
+            dlg.cM01Fired.setSelected(false);
+            dlg.cM01Fired.setEnabled(false);
+            dlg.cM01TopMark.setEnabled(true);
+        } else {
+            dlg.cM01Fired.setEnabled(true);
+            dlg.cM01TopMark.setEnabled(true);
+        }
+    }
+
+    public boolean isValid() {
+        return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
+    }
+
+    public void paintSign() {
+        if (dlg.paintlock)
+            return;
+        super.paintSign();
+
+        dlg.sM01StatusBar.setText(getErrMsg());
+
+        if (isValid()) {
+            dlg.tfM01Name.setEnabled(true);
+            dlg.tfM01Name.setText(getName());
+            dlg.cM01Radar.setVisible(true);
+            dlg.cM01Racon.setVisible(true);
+            dlg.cM01TopMark.setEnabled(true);
+            dlg.cM01TopMark.setVisible(true);
+            if (hasTopMark()) {
+                dlg.cbM01TopMark.setEnabled(true);
+                dlg.cbM01TopMark.setVisible(true);
+            } else {
+                dlg.cbM01TopMark.setVisible(false);
+            }
+            dlg.cM01Fog.setVisible(true);
+            dlg.cM01Fired.setVisible(true);
+            dlg.cM01Fired.setEnabled(true);
+            dlg.cbM01Colour.setVisible(false);
+            dlg.lM01Colour.setVisible(false);
+            dlg.rbM01Fired1.setVisible(false);
+            dlg.rbM01FiredN.setVisible(false);
+            dlg.lM01Height.setVisible(false);
+            dlg.tfM01Height.setVisible(false);
+            dlg.lM01Range.setVisible(false);
+            dlg.tfM01Range.setVisible(false);
+            
+            if (isFired()) {
+                switch (getStyleIndex()) {
+                case SPEC_FLOAT:
+                    dlg.lM01Height.setVisible(true);
+                    dlg.tfM01Height.setVisible(true);
+                    dlg.lM01Range.setVisible(true);
+                    dlg.tfM01Range.setVisible(true);
+                    break;
+                case SPEC_BEACON:
+                case SPEC_TOWER:
+                    dlg.rbM01Fired1.setVisible(true);
+                    dlg.rbM01FiredN.setVisible(true);
+                    dlg.lM01Height.setVisible(true);
+                    dlg.tfM01Height.setVisible(true);
+                    dlg.lM01Range.setVisible(true);
+                    dlg.tfM01Range.setVisible(true);
+                    break;
+                default:
+                }
+            }
+
+            String image = "/images/Special_Purpose"; //$NON-NLS-1$
+
+            switch (getStyleIndex()) {
+            case SPEC_PILLAR:
+                image += "_Pillar"; //$NON-NLS-1$
+                break;
+            case SPEC_CAN:
+                image += "_Can"; //$NON-NLS-1$
+                break;
+            case SPEC_CONE:
+                image += "_Cone"; //$NON-NLS-1$
+                break;
+            case SPEC_SPAR:
+                image += "_Spar"; //$NON-NLS-1$
+                break;
+            case SPEC_SPHERE:
+                image += "_Sphere"; //$NON-NLS-1$
+                break;
+            case SPEC_BARREL:
+                image += "_Barrel"; //$NON-NLS-1$
+                break;
+            case SPEC_FLOAT:
+                image += "_Float"; //$NON-NLS-1$
+                break;
+            case SPEC_BEACON:
+                image += "_Beacon"; //$NON-NLS-1$
+                break;
+            case SPEC_TOWER:
+                image += "_Tower"; //$NON-NLS-1$
+                break;
+            default:
+            }
+
+            if (!image.equals("/images/Special_Purpose")) { //$NON-NLS-1$
+//              if (hasTopMark())
+//                  image += "_CrossY"; //$NON-NLS-1$
+                image += ".png"; //$NON-NLS-1$
+                dlg.lM01Icon.setIcon(new ImageIcon(getClass().getResource(image)));
+            } else
+                dlg.lM01Icon.setIcon(null);
+        }
+    }
+
+    public void saveSign() {
+        Node node = getNode();
+
+        if (node == null) {
+            return;
+        }
+
+        switch (getStyleIndex()) {
+        case SPEC_PILLAR:
+            super.saveSign("buoy_special_purpose"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_special_purpose:shape", "pillar")); //$NON-NLS-1$ //$NON-NLS-2$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case SPEC_SPAR:
+            super.saveSign("buoy_special_purpose"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_special_purpose:shape", "spar")); //$NON-NLS-1$ //$NON-NLS-2$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case SPEC_SPHERE:
+            super.saveSign("buoy_special_purpose"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_special_purpose:shape", "sphere")); //$NON-NLS-1$ //$NON-NLS-2$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case SPEC_BARREL:
+            super.saveSign("buoy_special_purpose"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_special_purpose:shape", "barrel")); //$NON-NLS-1$ //$NON-NLS-2$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:buoy_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case SPEC_FLOAT:
+            super.saveSign("light_float"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:light_float:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case SPEC_BEACON:
+            super.saveSign("beacon_special_purpose"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:beacon_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        case SPEC_TOWER:
+            super.saveSign("beacon_special_purpose"); //$NON-NLS-1$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:beacon_special_purpose:shape", "tower")); //$NON-NLS-1$ //$NON-NLS-2$
+            Main.main.undoRedo.add(new ChangePropertyCommand(node,
+                    "seamark:beacon_special_purpose:colour", "yellow")); //$NON-NLS-1$ //$NON-NLS-2$
+            break;
+        default:
+        }
+        saveTopMarkData("x-shape", "yellow"); //$NON-NLS-1$ //$NON-NLS-2$
+        saveLightData(); //$NON-NLS-1$
+        saveRadarFogData();
+    }
+
+    public void setLightColour() {
+        super.setLightColour("W"); //$NON-NLS-1$
+    }
 
 }
Index: /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyUkn.java
===================================================================
--- /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyUkn.java	(revision 23192)
+++ /applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyUkn.java	(revision 23193)
@@ -11,29 +11,29 @@
 
 public class BuoyUkn extends Buoy {
-	public BuoyUkn(SmpDialogAction dia, String Msg) {
-		super(dia);
-		resetMask();
-		dlg.cbM01TypeOfMark.setSelectedIndex(0);
-		dlg.cbM01CatOfMark.removeAllItems();
-		dlg.cbM01CatOfMark.setEnabled(false);
-		dlg.tfM01Name.setText(getName());
-		setErrMsg(Msg);
-	}
+    public BuoyUkn(SmpDialogAction dia, String Msg) {
+        super(dia);
+        resetMask();
+        dlg.cbM01TypeOfMark.setSelectedIndex(0);
+        dlg.cbM01CatOfMark.removeAllItems();
+        dlg.cbM01CatOfMark.setEnabled(false);
+        dlg.tfM01Name.setText(getName());
+        setErrMsg(Msg);
+    }
 
-	public void paintSign() {
-		if (dlg.paintlock) return;
-		super.paintSign();
+    public void paintSign() {
+        if (dlg.paintlock) return;
+        super.paintSign();
 
-		if (getErrMsg() != null)
-			dlg.sM01StatusBar.setText(getErrMsg());
+        if (getErrMsg() != null)
+            dlg.sM01StatusBar.setText(getErrMsg());
 
-		setErrMsg(null);
-	}
+        setErrMsg(null);
+    }
 
-	public void setLightColour() {
-		super.setLightColour("");
-	}
+    public void setLightColour() {
+        super.setLightColour("");
+    }
 
-	public void saveSign() {
-	}
+    public void saveSign() {
+    }
 }
Index: /applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/BrowseAction.java
===================================================================
--- /applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/BrowseAction.java	(revision 23192)
+++ /applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/BrowseAction.java	(revision 23193)
@@ -16,64 +16,64 @@
     MouseMotionListener {
 
-	public BrowseAction(MapFrame mapFrame) {
-		super(tr("Browse"), "browse", tr("Browse map with left button"),
-		    mapFrame, Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
-	}
+    public BrowseAction(MapFrame mapFrame) {
+        super(tr("Browse"), "browse", tr("Browse map with left button"),
+            mapFrame, Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
+    }
 
-	@Override public void enterMode() {
-		super.enterMode();
+    @Override public void enterMode() {
+        super.enterMode();
 
-		Main.map.mapView.addMouseListener(this);
-		Main.map.mapView.addMouseMotionListener(this);
-	}
+        Main.map.mapView.addMouseListener(this);
+        Main.map.mapView.addMouseMotionListener(this);
+    }
 
-	@Override public void exitMode() {
-		super.exitMode();
+    @Override public void exitMode() {
+        super.exitMode();
 
-		Main.map.mapView.removeMouseListener(this);
-		Main.map.mapView.removeMouseMotionListener(this);
-	}
+        Main.map.mapView.removeMouseListener(this);
+        Main.map.mapView.removeMouseMotionListener(this);
+    }
 
-	public void mouseDragged(MouseEvent e) {
-		if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) !=
-		    MouseEvent.BUTTON1_DOWN_MASK) {
-			endMovement();
-			return;
-		}
+    public void mouseDragged(MouseEvent e) {
+        if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) !=
+            MouseEvent.BUTTON1_DOWN_MASK) {
+            endMovement();
+            return;
+        }
 
-		if (mousePosMove == null)
-			startMovement(e);
-		EastNorth center = Main.map.mapView.getCenter();
-		EastNorth mouseCenter = Main.map.mapView.getEastNorth(e.getX(), e.getY());
-		Main.map.mapView.zoomTo(new EastNorth(
-		    mousePosMove.east() + center.east() - mouseCenter.east(),
-		    mousePosMove.north() + center.north() - mouseCenter.north()));
-	}
+        if (mousePosMove == null)
+            startMovement(e);
+        EastNorth center = Main.map.mapView.getCenter();
+        EastNorth mouseCenter = Main.map.mapView.getEastNorth(e.getX(), e.getY());
+        Main.map.mapView.zoomTo(new EastNorth(
+            mousePosMove.east() + center.east() - mouseCenter.east(),
+            mousePosMove.north() + center.north() - mouseCenter.north()));
+    }
 
-	@Override public void mousePressed(MouseEvent e) {
-		if (e.getButton() == MouseEvent.BUTTON1)
-			startMovement(e);
-	}
+    @Override public void mousePressed(MouseEvent e) {
+        if (e.getButton() == MouseEvent.BUTTON1)
+            startMovement(e);
+    }
 
-	@Override public void mouseReleased(MouseEvent e) {
-		if (e.getButton() == MouseEvent.BUTTON1)
-			endMovement();
-	}
+    @Override public void mouseReleased(MouseEvent e) {
+        if (e.getButton() == MouseEvent.BUTTON1)
+            endMovement();
+    }
 
-	private EastNorth mousePosMove;
-	private boolean movementInPlace = false;
+    private EastNorth mousePosMove;
+    private boolean movementInPlace = false;
 
-	private void startMovement(MouseEvent e) {
-		if (movementInPlace)
-			return;
-		movementInPlace = true;
-		mousePosMove = Main.map.mapView.getEastNorth(e.getX(), e.getY());
-	}
+    private void startMovement(MouseEvent e) {
+        if (movementInPlace)
+            return;
+        movementInPlace = true;
+        mousePosMove = Main.map.mapView.getEastNorth(e.getX(), e.getY());
+    }
 
-	private void endMovement() {
-		if (!movementInPlace)
-			return;
-		movementInPlace = false;
-		mousePosMove = null;
-	}
+    private void endMovement() {
+        if (!movementInPlace)
+            return;
+        movementInPlace = false;
+        mousePosMove = null;
+    }
 }
Index: /applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/TouchScreenHelperPlugin.java
===================================================================
--- /applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/TouchScreenHelperPlugin.java	(revision 23192)
+++ /applications/editors/josm/plugins/touchscreenhelper/src/touchscreenhelper/TouchScreenHelperPlugin.java	(revision 23193)
@@ -8,12 +8,12 @@
 
 public class TouchScreenHelperPlugin extends Plugin {
-	public TouchScreenHelperPlugin(PluginInformation info) {
-		super(info);
-	}
-	@Override public void mapFrameInitialized(MapFrame oldFrame,
-	    MapFrame newFrame) {
-		if (oldFrame == null && newFrame != null) {
-			Main.map.addMapMode(new IconToggleButton(new BrowseAction(Main.map)));
-		}
-	}
+    public TouchScreenHelperPlugin(PluginInformation info) {
+        super(info);
+    }
+    @Override public void mapFrameInitialized(MapFrame oldFrame,
+        MapFrame newFrame) {
+        if (oldFrame == null && newFrame != null) {
+            Main.map.addMapMode(new IconToggleButton(new BrowseAction(Main.map)));
+        }
+    }
 }
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java	(revision 23192)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/GpsPlayer.java	(revision 23193)
@@ -17,382 +17,382 @@
 //for GPS play control, secure stepping through list and interpolation work in current projection
 public class GpsPlayer {
-	private List<WayPoint> ls;
-	private WayPoint prev,curr,next;
-	private WayPoint start;
-	private Timer t;
-	private TimerTask ani; //for moving trough the list
-	private boolean autoCenter;
-	
-
-	public WayPoint getPrev() {
-		return prev;
-	}
-
-	public WayPoint getCurr() {
-		return curr;
-	}
-
-	public WayPoint getNext() {
-		return next;
-	}
-	
-	public WayPoint getWaypoint(long relTime)
-	{
-		int pos = Math.round(relTime/1000);//TODO ugly quick hack	
-		return ls.get(pos);
-	}
-
-	public GpsPlayer(List<WayPoint> l) {
-		super();
-		this.ls = l;
-		//set start position
-		start=ls.get(0);
-		prev=null;
-		curr=ls.get(0);
-		next=ls.get(1);
-	}
-	
-	// one secure step forward
-	public void next() {		
-		if(ls.indexOf(curr)+1<ls.size())
-		{
-			prev=curr;
-			curr=next;
-			if(ls.indexOf(curr)+1==ls.size()) next=null;
-			else next=ls.get(ls.indexOf(curr)+1);
-		}
-		else next=null;
-		
-	}
-	
-	//one secure step backward
-	public void prev()
-	{
-		if(ls.indexOf(curr)>0)
-		{			
-			next =curr;
-			curr=prev;
-			if(ls.indexOf(curr)==0) prev=null;else 	prev=ls.get(ls.indexOf(curr)-1);
-		}
-		else prev=null;		
-	}
-	
-	//select the given waypoint as center
-	public void jump(WayPoint p)
-	{
-		if(ls.contains(p))
-		{
-			curr=p;
-			if(ls.indexOf(curr)>0)
-			{
-				prev=ls.get(ls.indexOf(curr)-1);
-			}
-			else prev=null;
-			if(ls.indexOf(curr)+1<ls.size())
-			{
-				next=ls.get(ls.indexOf(curr)+1);
-			}
-			else next=null;
-		}
-	}
-	
-	//walk k waypoints forward/backward
-	public void jumpRel(int k)
-	{
-
-		if ((ls.indexOf(curr)+k>0)&&(ls.indexOf(curr)<ls.size())) //check range
-		{
-			jump(ls.get(ls.indexOf(curr)+k));
-		}
-		Main.map.mapView.repaint(); //seperate modell and view logic...
-	}
-	
-	//select the k-th waypoint
-	public void jump(int k)
-	{
-		if (k>0)
-		{
-			if ((ls.indexOf(curr)+k>0)&&(ls.indexOf(curr)<ls.size())) //check range
-			{
-				jump(ls.get(k));
-			}
-			Main.map.mapView.repaint();
-		}
-	}
-	
-	//go to the position at the timecode e.g.g "14:00:01";
-	public void jump(Time GPSAbsTime)
-	{
-		jump(getWaypoint(GPSAbsTime.getTime()-start.getTime().getTime())); //TODO replace Time by Date?
-	}
-	
-	//go to the position at 
-	public void jump(Date GPSDate)
-	{
-		long s,m,h,diff;
-		//calculate which waypoint is at the offset
-		System.out.println(start.getTime());
-		System.out.println(start.getTime().getHours()+":"+start.getTime().getMinutes()+":"+start.getTime().getSeconds());
-		s=GPSDate.getSeconds()-start.getTime().getSeconds();
-		m=GPSDate.getMinutes()-start.getTime().getMinutes();
-		h=GPSDate.getHours()-start.getTime().getHours();
-		diff=s*1000+m*60*1000+h*60*60*1000; //TODO ugly hack but nothing else works right
-		jump(getWaypoint(diff)); 
-	}
-	
-	//gets only points on the line of the GPS track (between waypoints) nearby the point m
-	private Point getInterpolated(Point m)
-	{
-		Point leftP,rightP,highP,lowP;
-		boolean invalid = false; //when we leave this segment
-		Point p1 = Main.map.mapView.getPoint(getCurr().getEastNorth());
-		Point p2 = getEndpoint();
-		//determine which point is what
-		leftP=getLeftPoint(p1, p2);
-		rightP=getRightPoint(p1,p2);
-		highP=getHighPoint(p1, p2);
-		lowP=getLowPoint(p1, p2);
-		if(getNext()!=null)
-		{
-			//we might switch to one neighbor segment
-			if(m.x<leftP.x)
-			{
-				Point c = Main.map.mapView.getPoint(getCurr().getEastNorth());
-				Point n = Main.map.mapView.getPoint(getNext().getEastNorth());
-				if(n.x<c.x)	next(); else prev();
-				invalid=true;
-				m=leftP;
-				System.out.println("entering left segment");
-			}
-			if(m.x>rightP.x)
-			{
-				Point c = Main.map.mapView.getPoint(getCurr().getEastNorth());
-				Point n = Main.map.mapView.getPoint(getNext().getEastNorth());
-				if(n.x>c.x)	next(); else prev();
-				invalid=true;
-				m=rightP;
-				System.out.println("entering right segment");
-			}
-			if(!invalid)
-			{
-				float slope = getSlope(highP, lowP);
-				m.y = highP.y+Math.round(slope*(m.x-highP.x));
-			}
-		}
-		else
-		{
-			//currently we are at the end
-			if(m.x>rightP.x)
-			{
-				m=rightP; //we can't move anywhere
-			}
-			else
-			{
-				prev(); //walk back to the segment before
-			}			
-		}
-		return m;
-	}
-	
-	//returns a point on the p% of the current selected segment
-	private Point getInterpolated(float percent)
-	{
-
-		int dX,dY;
-		Point p;
-		Point leftP,rightP;
-		Point c = Main.map.mapView.getPoint(getCurr().getEastNorth());
-		Point p1 = Main.map.mapView.getPoint(getCurr().getEastNorth());
-		Point p2 = getEndpoint();		
-		//determine which point is what
-		leftP=getLeftPoint(p1, p2);
-		rightP=getRightPoint(p1,p2);
-		//we will never go over the segment
-		percent=percent/100;
-		dX=Math.round((rightP.x-leftP.x)*percent);
-		dY=Math.round((rightP.y-leftP.y)*percent);
-		//move in the right direction
-		p=new Point(rightP.x-dX,rightP.y-dY);
-
-		return p;
-	}
-
-	//gets further infos for a point between two Waypoints
-	public WayPoint getInterpolatedWaypoint(Point m)
-	{	int a,b,length,lengthSeg;
-		long timeSeg;
-		float ratio;
-		Time base;
-		Point p2;
-		
-		Point curr =Main.map.mapView.getPoint(getCurr().getEastNorth());
-		m =getInterpolated(m); //get the right position
-		//get the right time
-		p2=getEndpoint();
-		if (getNext()!=null)
-		{
-			timeSeg=getNext().getTime().getTime()-getCurr().getTime().getTime();
-		}
-		else
-		{
-			timeSeg=-(getPrev().getTime().getTime()-getCurr().getTime().getTime());
-		}
-		WayPoint w =new WayPoint(Main.map.mapView.getLatLon(m.x, m.y));
-		//calc total traversal length
-		lengthSeg = getTraversalLength(p2, curr);
-		length = getTraversalLength(p2, m);
-		length=lengthSeg-length;
-		//calc time difference
-		ratio=(float)length/(float)lengthSeg;
-		long inc=(long) (timeSeg*ratio);		
-		long old = getCurr().getTime().getTime();
-		old=old+inc;
-		Date t = new Date(old);
-		w.time = t.getTime()/1000; //TODO need better way to set time and sync it
-		SimpleDateFormat df = new SimpleDateFormat("hh:mm:ss:S");
-		/*System.out.print(length+"px ");
-		System.out.print(ratio+"% ");
-		System.out.print(inc+"ms ");
-		System.out.println(df.format(t.getTime()));+*/
-		System.out.println(df.format(w.getTime()));
-		//TODO we have to publish the new date to the node...
-		return w;
-	}
-
-	//returns a point and time for the current segment
-	private WayPoint getInterpolatedWaypoint(float percentage)
-	{
-		Point p = getInterpolated(percentage);
-		WayPoint w =new WayPoint(Main.map.mapView.getLatLon(p.x, p.y));
-		return w;
-	}
-	
-	//returns n points on the current segment
-	public List<WayPoint> getInterpolatedLine(int interval)
-	{
-		List<WayPoint> ls;
-		Point p2;
-		float step;
-		int length;
-		
-		step=100/(float)interval;
-		ls=new LinkedList<WayPoint>();
-		for(float i=step;i<100;i+=step)
-		{
-			ls.add(getInterpolatedWaypoint(i));
-		}
-		return ls;
-	}
-	
-	private Point getLeftPoint(Point p1,Point p2)
-	{
-		if(p1.x<p2.x) return p1; else return p2;
-	}
-	
-	private Point getRightPoint(Point p1, Point p2)
-	{
-		if(p1.x>p2.x) return p1; else return p2;
-	}
-	
-	private Point getHighPoint(Point p1, Point p2)
-	{
-		if(p1.y<p2.y)return p1; else return p2;
-	}
-	
-	private Point getLowPoint(Point p1, Point p2)
-	{
-		if(p1.y>p2.y)return p1; else return p2;
-	}
-
-	private Point getEndpoint() {
-		if(getNext()!=null)
-		{
-			return Main.map.mapView.getPoint(getNext().getEastNorth());
-		}
-		else
-		{
-			return Main.map.mapView.getPoint(getPrev().getEastNorth());
-		}
-		
-	}
-
-	private float getSlope(Point highP, Point lowP) {
-		float slope=(float)(highP.y-lowP.y) / (float)(highP.x - lowP.x);
-		return slope;
-	}
-
-	private int getTraversalLength(Point p2, Point curr) {
-		int a;
-		int b;
-		int lengthSeg;
-		a=Math.abs(curr.x-p2.x);
-		b=Math.abs(curr.y-p2.y);
-		lengthSeg= (int) Math.sqrt(Math.pow(a, 2)+Math.pow(b, 2));
-		return lengthSeg;
-	}
-
-	//returns time in ms relatie to startpoint
-	public long getRelativeTime()
-	{
-		return getRelativeTime(curr);
-	}
-	
-	public long getRelativeTime(WayPoint p)
-	{
-		return p.getTime().getTime()-start.getTime().getTime(); //TODO assumes timeintervall is constant!!!!
-	}
-	
-	
-	//jumps to a specific time
-	public void jump(long relTime) {
-		int pos = Math.round(relTime/1000);//TODO ugly quick hack	
-		jump(pos);
-		//if (autoCenter) Main.map.mapView.
-	}
-	
-	//toggles walking along the track
-	public void play()
-	{ /*
-		if (t==null)
-		{
-			//start
-			t= new Timer();
-			ani=new TimerTask() {			
-				@Override
-				//some cheap animation stuff
-				public void run() {				
-					next();
-					if(autoCenter) Main.map.mapView.zoomTo(getCurr().getEastNorth());
-					Main.map.mapView.repaint();
-				}
-			};
-			t.schedule(ani,1000,1000);			
-		}
-		else
-		{
-			//stop
-			ani.cancel();
-			ani=null;
-			t.cancel();
-			t=null;					
-		}*/
-	}
-
-	public long getLength() {
-		return ls.size()*1000; //FIXME this is a poor hack
-	}
-	
-	public void setAutoCenter(boolean b)
-	{
-		this.autoCenter=b;
-	}
-	
-	public List<WayPoint> getTrack()
-	{
-		return ls;
-	}
-
-
-
-	
+    private List<WayPoint> ls;
+    private WayPoint prev,curr,next;
+    private WayPoint start;
+    private Timer t;
+    private TimerTask ani; //for moving trough the list
+    private boolean autoCenter;
+    
+
+    public WayPoint getPrev() {
+        return prev;
+    }
+
+    public WayPoint getCurr() {
+        return curr;
+    }
+
+    public WayPoint getNext() {
+        return next;
+    }
+    
+    public WayPoint getWaypoint(long relTime)
+    {
+        int pos = Math.round(relTime/1000);//TODO ugly quick hack   
+        return ls.get(pos);
+    }
+
+    public GpsPlayer(List<WayPoint> l) {
+        super();
+        this.ls = l;
+        //set start position
+        start=ls.get(0);
+        prev=null;
+        curr=ls.get(0);
+        next=ls.get(1);
+    }
+    
+    // one secure step forward
+    public void next() {        
+        if(ls.indexOf(curr)+1<ls.size())
+        {
+            prev=curr;
+            curr=next;
+            if(ls.indexOf(curr)+1==ls.size()) next=null;
+            else next=ls.get(ls.indexOf(curr)+1);
+        }
+        else next=null;
+        
+    }
+    
+    //one secure step backward
+    public void prev()
+    {
+        if(ls.indexOf(curr)>0)
+        {           
+            next =curr;
+            curr=prev;
+            if(ls.indexOf(curr)==0) prev=null;else  prev=ls.get(ls.indexOf(curr)-1);
+        }
+        else prev=null;     
+    }
+    
+    //select the given waypoint as center
+    public void jump(WayPoint p)
+    {
+        if(ls.contains(p))
+        {
+            curr=p;
+            if(ls.indexOf(curr)>0)
+            {
+                prev=ls.get(ls.indexOf(curr)-1);
+            }
+            else prev=null;
+            if(ls.indexOf(curr)+1<ls.size())
+            {
+                next=ls.get(ls.indexOf(curr)+1);
+            }
+            else next=null;
+        }
+    }
+    
+    //walk k waypoints forward/backward
+    public void jumpRel(int k)
+    {
+
+        if ((ls.indexOf(curr)+k>0)&&(ls.indexOf(curr)<ls.size())) //check range
+        {
+            jump(ls.get(ls.indexOf(curr)+k));
+        }
+        Main.map.mapView.repaint(); //seperate modell and view logic...
+    }
+    
+    //select the k-th waypoint
+    public void jump(int k)
+    {
+        if (k>0)
+        {
+            if ((ls.indexOf(curr)+k>0)&&(ls.indexOf(curr)<ls.size())) //check range
+            {
+                jump(ls.get(k));
+            }
+            Main.map.mapView.repaint();
+        }
+    }
+    
+    //go to the position at the timecode e.g.g "14:00:01";
+    public void jump(Time GPSAbsTime)
+    {
+        jump(getWaypoint(GPSAbsTime.getTime()-start.getTime().getTime())); //TODO replace Time by Date?
+    }
+    
+    //go to the position at 
+    public void jump(Date GPSDate)
+    {
+        long s,m,h,diff;
+        //calculate which waypoint is at the offset
+        System.out.println(start.getTime());
+        System.out.println(start.getTime().getHours()+":"+start.getTime().getMinutes()+":"+start.getTime().getSeconds());
+        s=GPSDate.getSeconds()-start.getTime().getSeconds();
+        m=GPSDate.getMinutes()-start.getTime().getMinutes();
+        h=GPSDate.getHours()-start.getTime().getHours();
+        diff=s*1000+m*60*1000+h*60*60*1000; //TODO ugly hack but nothing else works right
+        jump(getWaypoint(diff)); 
+    }
+    
+    //gets only points on the line of the GPS track (between waypoints) nearby the point m
+    private Point getInterpolated(Point m)
+    {
+        Point leftP,rightP,highP,lowP;
+        boolean invalid = false; //when we leave this segment
+        Point p1 = Main.map.mapView.getPoint(getCurr().getEastNorth());
+        Point p2 = getEndpoint();
+        //determine which point is what
+        leftP=getLeftPoint(p1, p2);
+        rightP=getRightPoint(p1,p2);
+        highP=getHighPoint(p1, p2);
+        lowP=getLowPoint(p1, p2);
+        if(getNext()!=null)
+        {
+            //we might switch to one neighbor segment
+            if(m.x<leftP.x)
+            {
+                Point c = Main.map.mapView.getPoint(getCurr().getEastNorth());
+                Point n = Main.map.mapView.getPoint(getNext().getEastNorth());
+                if(n.x<c.x) next(); else prev();
+                invalid=true;
+                m=leftP;
+                System.out.println("entering left segment");
+            }
+            if(m.x>rightP.x)
+            {
+                Point c = Main.map.mapView.getPoint(getCurr().getEastNorth());
+                Point n = Main.map.mapView.getPoint(getNext().getEastNorth());
+                if(n.x>c.x) next(); else prev();
+                invalid=true;
+                m=rightP;
+                System.out.println("entering right segment");
+            }
+            if(!invalid)
+            {
+                float slope = getSlope(highP, lowP);
+                m.y = highP.y+Math.round(slope*(m.x-highP.x));
+            }
+        }
+        else
+        {
+            //currently we are at the end
+            if(m.x>rightP.x)
+            {
+                m=rightP; //we can't move anywhere
+            }
+            else
+            {
+                prev(); //walk back to the segment before
+            }           
+        }
+        return m;
+    }
+    
+    //returns a point on the p% of the current selected segment
+    private Point getInterpolated(float percent)
+    {
+
+        int dX,dY;
+        Point p;
+        Point leftP,rightP;
+        Point c = Main.map.mapView.getPoint(getCurr().getEastNorth());
+        Point p1 = Main.map.mapView.getPoint(getCurr().getEastNorth());
+        Point p2 = getEndpoint();       
+        //determine which point is what
+        leftP=getLeftPoint(p1, p2);
+        rightP=getRightPoint(p1,p2);
+        //we will never go over the segment
+        percent=percent/100;
+        dX=Math.round((rightP.x-leftP.x)*percent);
+        dY=Math.round((rightP.y-leftP.y)*percent);
+        //move in the right direction
+        p=new Point(rightP.x-dX,rightP.y-dY);
+
+        return p;
+    }
+
+    //gets further infos for a point between two Waypoints
+    public WayPoint getInterpolatedWaypoint(Point m)
+    {   int a,b,length,lengthSeg;
+        long timeSeg;
+        float ratio;
+        Time base;
+        Point p2;
+        
+        Point curr =Main.map.mapView.getPoint(getCurr().getEastNorth());
+        m =getInterpolated(m); //get the right position
+        //get the right time
+        p2=getEndpoint();
+        if (getNext()!=null)
+        {
+            timeSeg=getNext().getTime().getTime()-getCurr().getTime().getTime();
+        }
+        else
+        {
+            timeSeg=-(getPrev().getTime().getTime()-getCurr().getTime().getTime());
+        }
+        WayPoint w =new WayPoint(Main.map.mapView.getLatLon(m.x, m.y));
+        //calc total traversal length
+        lengthSeg = getTraversalLength(p2, curr);
+        length = getTraversalLength(p2, m);
+        length=lengthSeg-length;
+        //calc time difference
+        ratio=(float)length/(float)lengthSeg;
+        long inc=(long) (timeSeg*ratio);        
+        long old = getCurr().getTime().getTime();
+        old=old+inc;
+        Date t = new Date(old);
+        w.time = t.getTime()/1000; //TODO need better way to set time and sync it
+        SimpleDateFormat df = new SimpleDateFormat("hh:mm:ss:S");
+        /*System.out.print(length+"px ");
+        System.out.print(ratio+"% ");
+        System.out.print(inc+"ms ");
+        System.out.println(df.format(t.getTime()));+*/
+        System.out.println(df.format(w.getTime()));
+        //TODO we have to publish the new date to the node...
+        return w;
+    }
+
+    //returns a point and time for the current segment
+    private WayPoint getInterpolatedWaypoint(float percentage)
+    {
+        Point p = getInterpolated(percentage);
+        WayPoint w =new WayPoint(Main.map.mapView.getLatLon(p.x, p.y));
+        return w;
+    }
+    
+    //returns n points on the current segment
+    public List<WayPoint> getInterpolatedLine(int interval)
+    {
+        List<WayPoint> ls;
+        Point p2;
+        float step;
+        int length;
+        
+        step=100/(float)interval;
+        ls=new LinkedList<WayPoint>();
+        for(float i=step;i<100;i+=step)
+        {
+            ls.add(getInterpolatedWaypoint(i));
+        }
+        return ls;
+    }
+    
+    private Point getLeftPoint(Point p1,Point p2)
+    {
+        if(p1.x<p2.x) return p1; else return p2;
+    }
+    
+    private Point getRightPoint(Point p1, Point p2)
+    {
+        if(p1.x>p2.x) return p1; else return p2;
+    }
+    
+    private Point getHighPoint(Point p1, Point p2)
+    {
+        if(p1.y<p2.y)return p1; else return p2;
+    }
+    
+    private Point getLowPoint(Point p1, Point p2)
+    {
+        if(p1.y>p2.y)return p1; else return p2;
+    }
+
+    private Point getEndpoint() {
+        if(getNext()!=null)
+        {
+            return Main.map.mapView.getPoint(getNext().getEastNorth());
+        }
+        else
+        {
+            return Main.map.mapView.getPoint(getPrev().getEastNorth());
+        }
+        
+    }
+
+    private float getSlope(Point highP, Point lowP) {
+        float slope=(float)(highP.y-lowP.y) / (float)(highP.x - lowP.x);
+        return slope;
+    }
+
+    private int getTraversalLength(Point p2, Point curr) {
+        int a;
+        int b;
+        int lengthSeg;
+        a=Math.abs(curr.x-p2.x);
+        b=Math.abs(curr.y-p2.y);
+        lengthSeg= (int) Math.sqrt(Math.pow(a, 2)+Math.pow(b, 2));
+        return lengthSeg;
+    }
+
+    //returns time in ms relatie to startpoint
+    public long getRelativeTime()
+    {
+        return getRelativeTime(curr);
+    }
+    
+    public long getRelativeTime(WayPoint p)
+    {
+        return p.getTime().getTime()-start.getTime().getTime(); //TODO assumes timeintervall is constant!!!!
+    }
+    
+    
+    //jumps to a specific time
+    public void jump(long relTime) {
+        int pos = Math.round(relTime/1000);//TODO ugly quick hack   
+        jump(pos);
+        //if (autoCenter) Main.map.mapView.
+    }
+    
+    //toggles walking along the track
+    public void play()
+    { /*
+        if (t==null)
+        {
+            //start
+            t= new Timer();
+            ani=new TimerTask() {           
+                @Override
+                //some cheap animation stuff
+                public void run() {             
+                    next();
+                    if(autoCenter) Main.map.mapView.zoomTo(getCurr().getEastNorth());
+                    Main.map.mapView.repaint();
+                }
+            };
+            t.schedule(ani,1000,1000);          
+        }
+        else
+        {
+            //stop
+            ani.cancel();
+            ani=null;
+            t.cancel();
+            t=null;                 
+        }*/
+    }
+
+    public long getLength() {
+        return ls.size()*1000; //FIXME this is a poor hack
+    }
+    
+    public void setAutoCenter(boolean b)
+    {
+        this.autoCenter=b;
+    }
+    
+    public List<WayPoint> getTrack()
+    {
+        return ls;
+    }
+
+
+
+    
 }
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PlayerObserver.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PlayerObserver.java	(revision 23192)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PlayerObserver.java	(revision 23193)
@@ -3,7 +3,7 @@
 //an Interface for communication for both players
 public interface PlayerObserver {
-	void playing(long time);
-	void jumping(long time);
-	void metadata(long time,boolean subtitles);
+    void playing(long time);
+    void jumping(long time);
+    void metadata(long time,boolean subtitles);
 
 }
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java	(revision 23192)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/PositionLayer.java	(revision 23193)
@@ -55,46 +55,46 @@
 //Basic rendering and GPS layer interaction
 public class PositionLayer extends Layer implements MouseListener,MouseMotionListener {
-	private static Set<PlayerObserver> observers = new HashSet<PlayerObserver>(); //we have to implement our own Observer pattern
-	private List<WayPoint> ls;
-	public GpsPlayer player;
-	private boolean dragIcon=false; //do we move the icon by hand?
-	private WayPoint iconPosition;
-	private Point mouse;
-	private ImageIcon icon;
-	private SimpleDateFormat mins;
-	private SimpleDateFormat ms;
-	private SimpleDateFormat gpsTimeCode;
-	private GPSVideoPlayer gps;
-		
-	public PositionLayer(String name, final List<WayPoint> ls) {
-		super(name);
-		this.ls=ls;
-		player= new GpsPlayer(ls);
-		icon = new ImageIcon("images/videomapping.png");
-		mins = new SimpleDateFormat("hh:mm:ss:S");
-		ms= new SimpleDateFormat("mm:ss");
-		gpsTimeCode= new SimpleDateFormat("hh:mm:ss");
-		Main.map.mapView.addMouseListener(this);
-		Main.map.mapView.addMouseMotionListener(this);							
-		
-	}
-
-
-	@Override
-	public Icon getIcon() {
-		return icon;
-	}
-
-	@Override
-	public Object getInfoComponent() {
-		String temp;
-		String sep=System.getProperty("line.separator");
-		temp=tr("{0} {1}% of GPS track",gps.getVideo().getName(),gps.getCoverage()*10+sep);
-		temp=temp+gps.getNativePlayerInfos();
-		return temp;
-	}
-
-	@Override
-	public Component[] getMenuEntries() {
+    private static Set<PlayerObserver> observers = new HashSet<PlayerObserver>(); //we have to implement our own Observer pattern
+    private List<WayPoint> ls;
+    public GpsPlayer player;
+    private boolean dragIcon=false; //do we move the icon by hand?
+    private WayPoint iconPosition;
+    private Point mouse;
+    private ImageIcon icon;
+    private SimpleDateFormat mins;
+    private SimpleDateFormat ms;
+    private SimpleDateFormat gpsTimeCode;
+    private GPSVideoPlayer gps;
+        
+    public PositionLayer(String name, final List<WayPoint> ls) {
+        super(name);
+        this.ls=ls;
+        player= new GpsPlayer(ls);
+        icon = new ImageIcon("images/videomapping.png");
+        mins = new SimpleDateFormat("hh:mm:ss:S");
+        ms= new SimpleDateFormat("mm:ss");
+        gpsTimeCode= new SimpleDateFormat("hh:mm:ss");
+        Main.map.mapView.addMouseListener(this);
+        Main.map.mapView.addMouseMotionListener(this);                          
+        
+    }
+
+
+    @Override
+    public Icon getIcon() {
+        return icon;
+    }
+
+    @Override
+    public Object getInfoComponent() {
+        String temp;
+        String sep=System.getProperty("line.separator");
+        temp=tr("{0} {1}% of GPS track",gps.getVideo().getName(),gps.getCoverage()*10+sep);
+        temp=temp+gps.getNativePlayerInfos();
+        return temp;
+    }
+
+    @Override
+    public Component[] getMenuEntries() {
         return new Component[]{
                 new JMenuItem(LayerListDialog.getInstance().createShowHideLayerAction(this)),
@@ -104,214 +104,214 @@
                 new JSeparator(),
                 new JMenuItem(new LayerListPopup.InfoAction(this))};//TODO here infos about the linked videos
-	}
-	  
-
-
-	@Override
-	public String getToolTipText() {
-		return tr("Shows current position in the video");
-	}
-
-	// no merging necessary
-	@Override
-	public boolean isMergable(Layer arg0) {
-		return false;
-	}
-
-	@Override
-	public void mergeFrom(Layer arg0) {
-		
-	}
-
-	
-	
-	@Override
-	//Draw the current position, infos, waypoints
-	public void paint(Graphics2D g, MapView map, Bounds bound) {
-		Point p;
-		//TODO Source out redundant calculations
-		//TODO make icon transparent
-		//draw all GPS points
-		g.setColor(Color.YELLOW); //new Color(0,255,0,128)
-		for(WayPoint n: ls) {
-			p = Main.map.mapView.getPoint(n.getEastNorth());
-			g.drawOval(p.x - 2, p.y - 2, 4, 4);
-		}
-		//draw synced points
-		g.setColor(Color.GREEN);
-		for(WayPoint n: ls) {
-			if(n.attr.containsKey("synced"))
-			{
-				p = Main.map.mapView.getPoint(n.getEastNorth());
-				g.drawOval(p.x - 2, p.y - 2, 4, 4);
-			}
-		}
-		//draw current segment points
-		g.setColor(Color.YELLOW);
-		if(player.getPrev()!=null)
-		{
-			p = Main.map.mapView.getPoint(player.getPrev().getEastNorth());
-			g.drawOval(p.x - 2, p.y - 2, 4, 4);
-			Point p2 = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
-			g.drawLine(p.x, p.y, p2.x, p2.y);
-		}
-		if(player.getNext()!=null)
-		{
-			p = Main.map.mapView.getPoint(player.getNext().getEastNorth());
-			g.drawOval(p.x - 2, p.y - 2, 4, 4);
-			Point p2 = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
-			g.drawLine(p.x, p.y, p2.x, p2.y);
-		}
-		//draw interpolated points
-		g.setColor(Color.CYAN);
-		g.setBackground(Color.CYAN);
-		LinkedList<WayPoint> ipo=(LinkedList<WayPoint>) player.getInterpolatedLine(5);
-		for (WayPoint wp : ipo) {
-			p=Main.map.mapView.getPoint(wp.getEastNorth());
-			g.fillArc(p.x, p.y, 4, 4, 0, 360);
-			//g.drawOval(p.x - 2, p.y - 2, 4, 4);
-		}
-		//draw cam icon
-		g.setColor(Color.RED);
-		if(dragIcon)
-		{
-			if(iconPosition!=null)
-			{
-				p=Main.map.mapView.getPoint(iconPosition.getEastNorth());
-				icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);				
-				//g.drawString(mins.format(iconPosition.getTime()),p.x-10,p.y-10); //TODO when synced we might wan't to use a different layout
-				g.drawString(gpsTimeCode.format(iconPosition.getTime()),p.x-10,p.y-10);
-			}
-		}
-		else
-		{
-			if (player.getCurr()!=null){
-			p=Main.map.mapView.getPoint(player.getCurr().getEastNorth());
-			icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);			
-			g.drawString(gpsTimeCode.format(player.getCurr().getTime()),p.x-10,p.y-10);
-			}
-		}
-	}
-	
-	//finds the first waypoint that is nearby the given point
-	private WayPoint getNearestWayPoint(Point mouse)
-	{
-		final int MAX=10;
-		Point p;
-		Rectangle rect = new Rectangle(mouse.x-MAX/2,mouse.y-MAX/2,MAX,MAX);
-		//iterate through all possible notes
-		for(WayPoint n : ls) //TODO this is not very clever, what better way to find this WP? Hashmaps? Divide and Conquer?
-		{
-			p = Main.map.mapView.getPoint(n.getEastNorth());
-			if (rect.contains(p))
-			{				
-				return n;
-			}
-			
-		}
-		return null;
-		
-	}
-	
-	//upper left corner like rectangle
-	private Rectangle getIconRect()
-	{
-		Point p = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
-		return new Rectangle(p.x-icon.getIconWidth()/2,p.y-icon.getIconHeight()/2,icon.getIconWidth(),icon.getIconHeight());
-	}
-
-
-	@Override
-	public void visitBoundingBox(BoundingXYVisitor arg0) {
-		// TODO don't know what to do here
-
-	}
-
-	public void mouseClicked(MouseEvent e) {		
-	}
-
-	public void mouseEntered(MouseEvent arg0) {	
-	}
-
-	public void mouseExited(MouseEvent arg0) {
-	}
-
-	//init drag&drop
-	public void mousePressed(MouseEvent e) {
-		if(e.getButton() == MouseEvent.BUTTON1) {
-			//is it on the cam icon?
-			if (player.getCurr()!=null)
-			{
-				if (getIconRect().contains(e.getPoint()))
-				{
-					mouse=e.getPoint();
-					dragIcon=true;
-				}
-			}
-		}
-		
-	}
-	
-	//
-	public void mouseReleased(MouseEvent e) {		
-		//only leftclicks on our layer
-		if(e.getButton() == MouseEvent.BUTTON1) {
-			if(dragIcon)
-			{
-				dragIcon=false;
-			}
-			else
-			{
-				//simple click
-				WayPoint wp = getNearestWayPoint(e.getPoint());
-				if(wp!=null)
-				{
-					player.jump(wp);
-					//jump if we know position
-					if(wp.attr.containsKey("synced"))
-					{						
-						if(gps!=null) notifyObservers(player.getRelativeTime()); //call videoplayers to set right position
-					}
-				}
-			}
-			Main.map.mapView.repaint();
-		}
-		
-	}
-	
-	//slide and restrict during movement
-	public void mouseDragged(MouseEvent e) {		
-		if(dragIcon)
-		{			
-			mouse=e.getPoint();
-			//restrict to GPS track
-			iconPosition=player.getInterpolatedWaypoint(mouse);
-
-			Main.map.mapView.repaint();
-		}
-	}
-
-	//visualize drag&drop
-	public void mouseMoved(MouseEvent e) {		
-		if (player.getCurr()!=null)
-		{						
-			if (getIconRect().contains(e.getPoint()))
-			{
-				Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
-			}
-			else
-			{
-				Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-			}
-		}
-		
-	}
-
-	public void setGPSPlayer(GPSVideoPlayer player) {
-		this.gps = player;
-		
-	}
-	
-	public static void addObserver(PlayerObserver observer) {
+    }
+      
+
+
+    @Override
+    public String getToolTipText() {
+        return tr("Shows current position in the video");
+    }
+
+    // no merging necessary
+    @Override
+    public boolean isMergable(Layer arg0) {
+        return false;
+    }
+
+    @Override
+    public void mergeFrom(Layer arg0) {
+        
+    }
+
+    
+    
+    @Override
+    //Draw the current position, infos, waypoints
+    public void paint(Graphics2D g, MapView map, Bounds bound) {
+        Point p;
+        //TODO Source out redundant calculations
+        //TODO make icon transparent
+        //draw all GPS points
+        g.setColor(Color.YELLOW); //new Color(0,255,0,128)
+        for(WayPoint n: ls) {
+            p = Main.map.mapView.getPoint(n.getEastNorth());
+            g.drawOval(p.x - 2, p.y - 2, 4, 4);
+        }
+        //draw synced points
+        g.setColor(Color.GREEN);
+        for(WayPoint n: ls) {
+            if(n.attr.containsKey("synced"))
+            {
+                p = Main.map.mapView.getPoint(n.getEastNorth());
+                g.drawOval(p.x - 2, p.y - 2, 4, 4);
+            }
+        }
+        //draw current segment points
+        g.setColor(Color.YELLOW);
+        if(player.getPrev()!=null)
+        {
+            p = Main.map.mapView.getPoint(player.getPrev().getEastNorth());
+            g.drawOval(p.x - 2, p.y - 2, 4, 4);
+            Point p2 = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
+            g.drawLine(p.x, p.y, p2.x, p2.y);
+        }
+        if(player.getNext()!=null)
+        {
+            p = Main.map.mapView.getPoint(player.getNext().getEastNorth());
+            g.drawOval(p.x - 2, p.y - 2, 4, 4);
+            Point p2 = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
+            g.drawLine(p.x, p.y, p2.x, p2.y);
+        }
+        //draw interpolated points
+        g.setColor(Color.CYAN);
+        g.setBackground(Color.CYAN);
+        LinkedList<WayPoint> ipo=(LinkedList<WayPoint>) player.getInterpolatedLine(5);
+        for (WayPoint wp : ipo) {
+            p=Main.map.mapView.getPoint(wp.getEastNorth());
+            g.fillArc(p.x, p.y, 4, 4, 0, 360);
+            //g.drawOval(p.x - 2, p.y - 2, 4, 4);
+        }
+        //draw cam icon
+        g.setColor(Color.RED);
+        if(dragIcon)
+        {
+            if(iconPosition!=null)
+            {
+                p=Main.map.mapView.getPoint(iconPosition.getEastNorth());
+                icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);             
+                //g.drawString(mins.format(iconPosition.getTime()),p.x-10,p.y-10); //TODO when synced we might wan't to use a different layout
+                g.drawString(gpsTimeCode.format(iconPosition.getTime()),p.x-10,p.y-10);
+            }
+        }
+        else
+        {
+            if (player.getCurr()!=null){
+            p=Main.map.mapView.getPoint(player.getCurr().getEastNorth());
+            icon.paintIcon(null, g, p.x-icon.getIconWidth()/2, p.y-icon.getIconHeight()/2);         
+            g.drawString(gpsTimeCode.format(player.getCurr().getTime()),p.x-10,p.y-10);
+            }
+        }
+    }
+    
+    //finds the first waypoint that is nearby the given point
+    private WayPoint getNearestWayPoint(Point mouse)
+    {
+        final int MAX=10;
+        Point p;
+        Rectangle rect = new Rectangle(mouse.x-MAX/2,mouse.y-MAX/2,MAX,MAX);
+        //iterate through all possible notes
+        for(WayPoint n : ls) //TODO this is not very clever, what better way to find this WP? Hashmaps? Divide and Conquer?
+        {
+            p = Main.map.mapView.getPoint(n.getEastNorth());
+            if (rect.contains(p))
+            {               
+                return n;
+            }
+            
+        }
+        return null;
+        
+    }
+    
+    //upper left corner like rectangle
+    private Rectangle getIconRect()
+    {
+        Point p = Main.map.mapView.getPoint(player.getCurr().getEastNorth());
+        return new Rectangle(p.x-icon.getIconWidth()/2,p.y-icon.getIconHeight()/2,icon.getIconWidth(),icon.getIconHeight());
+    }
+
+
+    @Override
+    public void visitBoundingBox(BoundingXYVisitor arg0) {
+        // TODO don't know what to do here
+
+    }
+
+    public void mouseClicked(MouseEvent e) {        
+    }
+
+    public void mouseEntered(MouseEvent arg0) { 
+    }
+
+    public void mouseExited(MouseEvent arg0) {
+    }
+
+    //init drag&drop
+    public void mousePressed(MouseEvent e) {
+        if(e.getButton() == MouseEvent.BUTTON1) {
+            //is it on the cam icon?
+            if (player.getCurr()!=null)
+            {
+                if (getIconRect().contains(e.getPoint()))
+                {
+                    mouse=e.getPoint();
+                    dragIcon=true;
+                }
+            }
+        }
+        
+    }
+    
+    //
+    public void mouseReleased(MouseEvent e) {       
+        //only leftclicks on our layer
+        if(e.getButton() == MouseEvent.BUTTON1) {
+            if(dragIcon)
+            {
+                dragIcon=false;
+            }
+            else
+            {
+                //simple click
+                WayPoint wp = getNearestWayPoint(e.getPoint());
+                if(wp!=null)
+                {
+                    player.jump(wp);
+                    //jump if we know position
+                    if(wp.attr.containsKey("synced"))
+                    {                       
+                        if(gps!=null) notifyObservers(player.getRelativeTime()); //call videoplayers to set right position
+                    }
+                }
+            }
+            Main.map.mapView.repaint();
+        }
+        
+    }
+    
+    //slide and restrict during movement
+    public void mouseDragged(MouseEvent e) {        
+        if(dragIcon)
+        {           
+            mouse=e.getPoint();
+            //restrict to GPS track
+            iconPosition=player.getInterpolatedWaypoint(mouse);
+
+            Main.map.mapView.repaint();
+        }
+    }
+
+    //visualize drag&drop
+    public void mouseMoved(MouseEvent e) {      
+        if (player.getCurr()!=null)
+        {                       
+            if (getIconRect().contains(e.getPoint()))
+            {
+                Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+            }
+            else
+            {
+                Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+            }
+        }
+        
+    }
+
+    public void setGPSPlayer(GPSVideoPlayer player) {
+        this.gps = player;
+        
+    }
+    
+    public static void addObserver(PlayerObserver observer) {
 
         observers.add(observer);
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java	(revision 23192)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoMappingPlugin.java	(revision 23193)
@@ -49,310 +49,310 @@
 //Here we manage properties and start the other classes
 public class VideoMappingPlugin extends Plugin implements LayerChangeListener{
-	  private JMenu VMenu,VDeinterlacer;
-	  private GpxData GPSTrack;
-	  private List<WayPoint> ls;
-	  private JosmAction VAdd,VRemove,VStart,Vbackward,Vforward,VJump,Vfaster,Vslower,Vloop;
-	  private JRadioButtonMenuItem VIntBob,VIntNone,VIntLinear;
-	  private JCheckBoxMenuItem VCenterIcon,VSubTitles;
-	  private JMenuItem VJumpLength,VLoopLength;
-	  private GPSVideoPlayer player;
-	  private PositionLayer layer;
-	  private final String VM_DEINTERLACER="videomapping.deinterlacer"; //where we store settings
-	  private final String VM_MRU="videomapping.mru";
-	  private final String VM_AUTOCENTER="videomapping.autocenter";
-	  private final String VM_JUMPLENGTH="videomapping.jumplength";
-	  private final String VM_LOOPLENGTH="videomapping.looplength";
-	  private boolean autocenter;
-	  private String deinterlacer;
-	  private Integer jumplength,looplength;
-	  private String mru;
-	  //TODO What more to store during sessions? Size/Position
-	  
-
-	public VideoMappingPlugin(PluginInformation info) {
-		super(info);
-		MapView.addLayerChangeListener(this);
-		//Register for GPS menu
-		VMenu = Main.main.menu.addMenu(" Video", KeyEvent.VK_V, Main.main.menu.defaultMenuPos,ht("/Plugin/Videomapping"));//TODO no more ugly " video" hack
-		addMenuItems();
-		enableControlMenus(true);
-		loadSettings();
-		applySettings();
-		//further plugin informations are provided by build.xml properties
-	}
-			
-	//only use with GPS and own layers
-	public void activeLayerChange(Layer oldLayer, Layer newLayer) {
-		System.out.println(newLayer);
-		if (newLayer instanceof GpxLayer)
-		{
-			VAdd.setEnabled(true);
-			GPSTrack=((GpxLayer) newLayer).data;			
-			//TODO append to GPS Layer menu
-		}
-		else
-		{/*
-			VAdd.setEnabled(false);
-			if(newLayer instanceof PositionLayer)
-			{
-				enableControlMenus(true);
-			}
-			else
-			{
-				enableControlMenus(false);
-			}*/
-		}
-		
-	}
-
-	public void layerAdded(Layer arg0) {
-		activeLayerChange(null,arg0);
-	}
-
-	public void layerRemoved(Layer arg0) {	
-	} //well ok we have a local copy of the GPS track....
-
-	//register main controls
-	private void addMenuItems() {
-		VAdd= new JosmAction(tr("Import Video"),"videomapping",tr("Sync a video against this GPS track"),null,false) {
-			private static final long serialVersionUID = 1L;
-
-			public void actionPerformed(ActionEvent arg0) {					
-					JFileChooser fc = new JFileChooser("C:\\TEMP\\");
-					//fc.setSelectedFile(new File(mru));
-					if(fc.showOpenDialog(Main.main.parent)!=JFileChooser.CANCEL_OPTION)
-					{
-						saveSettings();
-						ls=copyGPSLayer(GPSTrack);
-						enableControlMenus(true);
-						layer = new PositionLayer(fc.getSelectedFile().getName(),ls);
-						Main.main.addLayer(layer);
-						player = new GPSVideoPlayer(fc.getSelectedFile(), layer.player);
-						//TODO Check here if we can sync allready now
-						layer.setGPSPlayer(player);
-						layer.addObserver(player);
-						VAdd.setEnabled(false);
-						VRemove.setEnabled(true);
-						player.setSubtitleAction(VSubTitles);
-					}
-				}
-		
-		};
-		VRemove= new JosmAction(tr("Remove Video"),"videomapping",tr("removes current video from layer"),null,false) {
-			private static final long serialVersionUID = 1L;
-
-			public void actionPerformed(ActionEvent arg0) {
-				player.removeVideo();
-			}
-		};
-		
-		VStart = new JosmAction(tr("Play/Pause"), "audio-playpause", tr("starts/pauses video playback"),
-				Shortcut.registerShortcut("videomapping:startstop","",KeyEvent.VK_NUMPAD5, Shortcut.GROUP_DIRECT), false) {
-			
-			public void actionPerformed(ActionEvent e) {								
-				if(player.playing()) player.pause(); else player.play();
-			}
-		};
-		Vbackward = new JosmAction(tr("Backward"), "audio-prev", tr("jumps n sec back"),
-				Shortcut.registerShortcut("videomapping:backward","",KeyEvent.VK_NUMPAD4, Shortcut.GROUP_DIRECT), false) {
-			public void actionPerformed(ActionEvent e) {
-				player.backward();
-							
-			}
-		};
-		Vbackward = new JosmAction(tr("Jump To"), null, tr("jumps to the entered gps time"),null, false) {			
-			public void actionPerformed(ActionEvent e) {
-				String s =JOptionPane.showInputDialog(tr("please enter GPS timecode"),"10:07:57");
-				SimpleDateFormat format= new SimpleDateFormat("hh:mm:ss");
-				Date t;
-				try {
-					t = format.parse(s);
-					if (t!=null)
-						{							
-							player.jumpToGPSTime(t.getTime());
-						}						
-				} catch (ParseException e1) {
-					// TODO Auto-generated catch block
-					e1.printStackTrace();
-				}
-							
-			}
-		};
-		Vforward= new JosmAction(tr("Forward"), "audio-next", tr("jumps n sec forward"),
-				Shortcut.registerShortcut("videomapping:forward","",KeyEvent.VK_NUMPAD6, Shortcut.GROUP_DIRECT), false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				player.forward();
-							
-			}
-		};
-		Vfaster= new JosmAction(tr("Faster"), "audio-faster", tr("faster playback"),
-				Shortcut.registerShortcut("videomapping:faster","",KeyEvent.VK_NUMPAD8, Shortcut.GROUP_DIRECT), false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				player.faster();
-							
-			}
-		};
-		Vslower= new JosmAction(tr("Slower"), "audio-slower", tr("slower playback"),
-				Shortcut.registerShortcut("videomapping:slower","",KeyEvent.VK_NUMPAD2, Shortcut.GROUP_DIRECT), false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				player.slower();
-							
-			}
-		};
-		Vloop= new JosmAction(tr("Loop"), null, tr("loops n sec around current position"),
-				Shortcut.registerShortcut("videomapping:loop","",KeyEvent.VK_NUMPAD7, Shortcut.GROUP_DIRECT), false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				player.loop();
-							
-			}
-		};
-		
-		//now the options menu
-		VCenterIcon = new JCheckBoxMenuItem(new JosmAction(tr("Keep centered"), null, tr("follows the video icon automaticly"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				autocenter=VCenterIcon.isSelected();
-				player.setAutoCenter(autocenter);
-				applySettings();
-				saveSettings();
-							
-			}
-		});
-		//now the options menu
-		VSubTitles = new JCheckBoxMenuItem(new JosmAction(tr("Subtitles"), null, tr("Show subtitles in video"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				player.toggleSubtitles();
-							
-			}
-		});
-		
-		VJumpLength = new JMenuItem(new JosmAction(tr("Jump length"), null, tr("Set the length of a jump"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				Object[] possibilities = {"200", "500", "1000", "2000", "10000"};
-				String s = (String)JOptionPane.showInputDialog(Main.parent,tr("Jump in video for x ms"),tr("Jump length"),JOptionPane.QUESTION_MESSAGE,null,possibilities,jumplength);
-				jumplength=Integer.getInteger(s);
-				applySettings();
-				saveSettings();			
-			}
-		});
-		
-		VLoopLength = new JMenuItem(new JosmAction(tr("Loop length"), null, tr("Set the length around a looppoint"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				Object[] possibilities = {"500", "1000", "3000", "5000", "10000"};
-				String s = (String)JOptionPane.showInputDialog(Main.parent,tr("Jump in video for x ms"),tr("Loop length"),JOptionPane.QUESTION_MESSAGE,null,possibilities,looplength);
-				looplength=Integer.getInteger(s);
-				applySettings();
-				saveSettings();
-							
-			}
-		});
-		
-		VDeinterlacer= new JMenu("Deinterlacer");
-		VIntNone= new JRadioButtonMenuItem(new JosmAction(tr("none"), null, tr("no deinterlacing"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				deinterlacer=null;
-				applySettings();
-				saveSettings();
-			}
-		});
-		VIntBob= new JRadioButtonMenuItem(new JosmAction("bob", null, tr("deinterlacing using line doubling"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				deinterlacer="bob";
-				applySettings();
-				saveSettings();
-			}
-		});
-		VIntLinear= new JRadioButtonMenuItem(new JosmAction("linear", null, tr("deinterlacing using linear interpolation"),null, false) {
-			
-			public void actionPerformed(ActionEvent e) {
-				deinterlacer="linear";
-				applySettings();
-				saveSettings();
-			}
-		});
-		VDeinterlacer.add(VIntNone);
-		VDeinterlacer.add(VIntBob);
-		VDeinterlacer.add(VIntLinear);
-		
-		VMenu.add(VAdd);		
-		VMenu.add(VStart);
-		VMenu.add(Vbackward);
-		VMenu.add(Vforward);
-		VMenu.add(Vfaster);
-		VMenu.add(Vslower);
-		VMenu.add(Vloop);
-		VMenu.addSeparator();
-		VMenu.add(VCenterIcon);
-		VMenu.add(VJumpLength);
-		VMenu.add(VLoopLength);
-		VMenu.add(VDeinterlacer);
-		VMenu.add(VSubTitles);
-		
-	}
-	
-	
-	
-	//we can only work on our own layer
-	private void enableControlMenus(boolean enabled)
-	{
-		VStart.setEnabled(enabled);
-		Vbackward.setEnabled(enabled);
-		Vforward.setEnabled(enabled);
-		Vloop.setEnabled(enabled);
-	}
-	
-	//load all properties or set defaults
-	private void loadSettings() {
-		String temp;		
-		temp=Main.pref.get(VM_AUTOCENTER);
-		if((temp!=null)&&(temp.length()!=0))autocenter=Boolean.getBoolean(temp); else autocenter=false;
-		temp=Main.pref.get(VM_DEINTERLACER);
-		if((temp!=null)&&(temp.length()!=0)) deinterlacer=Main.pref.get(temp);
-		temp=Main.pref.get(VM_JUMPLENGTH);
-		if((temp!=null)&&(temp.length()!=0)) jumplength=Integer.valueOf(temp); else jumplength=1000; 
-		temp=Main.pref.get(VM_LOOPLENGTH);
-		if((temp!=null)&&(temp.length()!=0)) looplength=Integer.valueOf(temp); else looplength=6000;
-		temp=Main.pref.get(VM_MRU);
-		if((temp!=null)&&(temp.length()!=0)) mru=Main.pref.get(VM_MRU);else mru=System.getProperty("user.home");
-	}
-	
-	private void applySettings(){
-		//Internals
-		if(player!=null)
-		{
-			player.setAutoCenter(autocenter);
-			player.setDeinterlacer(deinterlacer);
-			player.setJumpLength(jumplength);
-			player.setLoopLength(looplength);
-		}
-		//GUI
-		VCenterIcon.setSelected(autocenter);
-		VIntNone.setSelected(true);
-		if(deinterlacer=="bob")VIntBob.setSelected(true);
-		if(deinterlacer=="linear")VIntLinear.setSelected(true);
-		
-	}
-	
-	private void saveSettings(){
-		Main.pref.put(VM_AUTOCENTER, autocenter);
-		Main.pref.put(VM_DEINTERLACER, deinterlacer);
-		Main.pref.put(VM_JUMPLENGTH, jumplength.toString());
-		Main.pref.put(VM_LOOPLENGTH, looplength.toString());
-		Main.pref.put(VM_MRU, mru);
-	}
-	
-	//make a flat copy
-	private List<WayPoint> copyGPSLayer(GpxData route)
-	{ 
-		ls = new LinkedList<WayPoint>();
+      private JMenu VMenu,VDeinterlacer;
+      private GpxData GPSTrack;
+      private List<WayPoint> ls;
+      private JosmAction VAdd,VRemove,VStart,Vbackward,Vforward,VJump,Vfaster,Vslower,Vloop;
+      private JRadioButtonMenuItem VIntBob,VIntNone,VIntLinear;
+      private JCheckBoxMenuItem VCenterIcon,VSubTitles;
+      private JMenuItem VJumpLength,VLoopLength;
+      private GPSVideoPlayer player;
+      private PositionLayer layer;
+      private final String VM_DEINTERLACER="videomapping.deinterlacer"; //where we store settings
+      private final String VM_MRU="videomapping.mru";
+      private final String VM_AUTOCENTER="videomapping.autocenter";
+      private final String VM_JUMPLENGTH="videomapping.jumplength";
+      private final String VM_LOOPLENGTH="videomapping.looplength";
+      private boolean autocenter;
+      private String deinterlacer;
+      private Integer jumplength,looplength;
+      private String mru;
+      //TODO What more to store during sessions? Size/Position
+      
+
+    public VideoMappingPlugin(PluginInformation info) {
+        super(info);
+        MapView.addLayerChangeListener(this);
+        //Register for GPS menu
+        VMenu = Main.main.menu.addMenu(" Video", KeyEvent.VK_V, Main.main.menu.defaultMenuPos,ht("/Plugin/Videomapping"));//TODO no more ugly " video" hack
+        addMenuItems();
+        enableControlMenus(true);
+        loadSettings();
+        applySettings();
+        //further plugin informations are provided by build.xml properties
+    }
+            
+    //only use with GPS and own layers
+    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
+        System.out.println(newLayer);
+        if (newLayer instanceof GpxLayer)
+        {
+            VAdd.setEnabled(true);
+            GPSTrack=((GpxLayer) newLayer).data;            
+            //TODO append to GPS Layer menu
+        }
+        else
+        {/*
+            VAdd.setEnabled(false);
+            if(newLayer instanceof PositionLayer)
+            {
+                enableControlMenus(true);
+            }
+            else
+            {
+                enableControlMenus(false);
+            }*/
+        }
+        
+    }
+
+    public void layerAdded(Layer arg0) {
+        activeLayerChange(null,arg0);
+    }
+
+    public void layerRemoved(Layer arg0) {  
+    } //well ok we have a local copy of the GPS track....
+
+    //register main controls
+    private void addMenuItems() {
+        VAdd= new JosmAction(tr("Import Video"),"videomapping",tr("Sync a video against this GPS track"),null,false) {
+            private static final long serialVersionUID = 1L;
+
+            public void actionPerformed(ActionEvent arg0) {                 
+                    JFileChooser fc = new JFileChooser("C:\\TEMP\\");
+                    //fc.setSelectedFile(new File(mru));
+                    if(fc.showOpenDialog(Main.main.parent)!=JFileChooser.CANCEL_OPTION)
+                    {
+                        saveSettings();
+                        ls=copyGPSLayer(GPSTrack);
+                        enableControlMenus(true);
+                        layer = new PositionLayer(fc.getSelectedFile().getName(),ls);
+                        Main.main.addLayer(layer);
+                        player = new GPSVideoPlayer(fc.getSelectedFile(), layer.player);
+                        //TODO Check here if we can sync allready now
+                        layer.setGPSPlayer(player);
+                        layer.addObserver(player);
+                        VAdd.setEnabled(false);
+                        VRemove.setEnabled(true);
+                        player.setSubtitleAction(VSubTitles);
+                    }
+                }
+        
+        };
+        VRemove= new JosmAction(tr("Remove Video"),"videomapping",tr("removes current video from layer"),null,false) {
+            private static final long serialVersionUID = 1L;
+
+            public void actionPerformed(ActionEvent arg0) {
+                player.removeVideo();
+            }
+        };
+        
+        VStart = new JosmAction(tr("Play/Pause"), "audio-playpause", tr("starts/pauses video playback"),
+                Shortcut.registerShortcut("videomapping:startstop","",KeyEvent.VK_NUMPAD5, Shortcut.GROUP_DIRECT), false) {
+            
+            public void actionPerformed(ActionEvent e) {                                
+                if(player.playing()) player.pause(); else player.play();
+            }
+        };
+        Vbackward = new JosmAction(tr("Backward"), "audio-prev", tr("jumps n sec back"),
+                Shortcut.registerShortcut("videomapping:backward","",KeyEvent.VK_NUMPAD4, Shortcut.GROUP_DIRECT), false) {
+            public void actionPerformed(ActionEvent e) {
+                player.backward();
+                            
+            }
+        };
+        Vbackward = new JosmAction(tr("Jump To"), null, tr("jumps to the entered gps time"),null, false) {          
+            public void actionPerformed(ActionEvent e) {
+                String s =JOptionPane.showInputDialog(tr("please enter GPS timecode"),"10:07:57");
+                SimpleDateFormat format= new SimpleDateFormat("hh:mm:ss");
+                Date t;
+                try {
+                    t = format.parse(s);
+                    if (t!=null)
+                        {                           
+                            player.jumpToGPSTime(t.getTime());
+                        }                       
+                } catch (ParseException e1) {
+                    // TODO Auto-generated catch block
+                    e1.printStackTrace();
+                }
+                            
+            }
+        };
+        Vforward= new JosmAction(tr("Forward"), "audio-next", tr("jumps n sec forward"),
+                Shortcut.registerShortcut("videomapping:forward","",KeyEvent.VK_NUMPAD6, Shortcut.GROUP_DIRECT), false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                player.forward();
+                            
+            }
+        };
+        Vfaster= new JosmAction(tr("Faster"), "audio-faster", tr("faster playback"),
+                Shortcut.registerShortcut("videomapping:faster","",KeyEvent.VK_NUMPAD8, Shortcut.GROUP_DIRECT), false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                player.faster();
+                            
+            }
+        };
+        Vslower= new JosmAction(tr("Slower"), "audio-slower", tr("slower playback"),
+                Shortcut.registerShortcut("videomapping:slower","",KeyEvent.VK_NUMPAD2, Shortcut.GROUP_DIRECT), false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                player.slower();
+                            
+            }
+        };
+        Vloop= new JosmAction(tr("Loop"), null, tr("loops n sec around current position"),
+                Shortcut.registerShortcut("videomapping:loop","",KeyEvent.VK_NUMPAD7, Shortcut.GROUP_DIRECT), false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                player.loop();
+                            
+            }
+        };
+        
+        //now the options menu
+        VCenterIcon = new JCheckBoxMenuItem(new JosmAction(tr("Keep centered"), null, tr("follows the video icon automaticly"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                autocenter=VCenterIcon.isSelected();
+                player.setAutoCenter(autocenter);
+                applySettings();
+                saveSettings();
+                            
+            }
+        });
+        //now the options menu
+        VSubTitles = new JCheckBoxMenuItem(new JosmAction(tr("Subtitles"), null, tr("Show subtitles in video"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                player.toggleSubtitles();
+                            
+            }
+        });
+        
+        VJumpLength = new JMenuItem(new JosmAction(tr("Jump length"), null, tr("Set the length of a jump"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                Object[] possibilities = {"200", "500", "1000", "2000", "10000"};
+                String s = (String)JOptionPane.showInputDialog(Main.parent,tr("Jump in video for x ms"),tr("Jump length"),JOptionPane.QUESTION_MESSAGE,null,possibilities,jumplength);
+                jumplength=Integer.getInteger(s);
+                applySettings();
+                saveSettings();         
+            }
+        });
+        
+        VLoopLength = new JMenuItem(new JosmAction(tr("Loop length"), null, tr("Set the length around a looppoint"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                Object[] possibilities = {"500", "1000", "3000", "5000", "10000"};
+                String s = (String)JOptionPane.showInputDialog(Main.parent,tr("Jump in video for x ms"),tr("Loop length"),JOptionPane.QUESTION_MESSAGE,null,possibilities,looplength);
+                looplength=Integer.getInteger(s);
+                applySettings();
+                saveSettings();
+                            
+            }
+        });
+        
+        VDeinterlacer= new JMenu("Deinterlacer");
+        VIntNone= new JRadioButtonMenuItem(new JosmAction(tr("none"), null, tr("no deinterlacing"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                deinterlacer=null;
+                applySettings();
+                saveSettings();
+            }
+        });
+        VIntBob= new JRadioButtonMenuItem(new JosmAction("bob", null, tr("deinterlacing using line doubling"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                deinterlacer="bob";
+                applySettings();
+                saveSettings();
+            }
+        });
+        VIntLinear= new JRadioButtonMenuItem(new JosmAction("linear", null, tr("deinterlacing using linear interpolation"),null, false) {
+            
+            public void actionPerformed(ActionEvent e) {
+                deinterlacer="linear";
+                applySettings();
+                saveSettings();
+            }
+        });
+        VDeinterlacer.add(VIntNone);
+        VDeinterlacer.add(VIntBob);
+        VDeinterlacer.add(VIntLinear);
+        
+        VMenu.add(VAdd);        
+        VMenu.add(VStart);
+        VMenu.add(Vbackward);
+        VMenu.add(Vforward);
+        VMenu.add(Vfaster);
+        VMenu.add(Vslower);
+        VMenu.add(Vloop);
+        VMenu.addSeparator();
+        VMenu.add(VCenterIcon);
+        VMenu.add(VJumpLength);
+        VMenu.add(VLoopLength);
+        VMenu.add(VDeinterlacer);
+        VMenu.add(VSubTitles);
+        
+    }
+    
+    
+    
+    //we can only work on our own layer
+    private void enableControlMenus(boolean enabled)
+    {
+        VStart.setEnabled(enabled);
+        Vbackward.setEnabled(enabled);
+        Vforward.setEnabled(enabled);
+        Vloop.setEnabled(enabled);
+    }
+    
+    //load all properties or set defaults
+    private void loadSettings() {
+        String temp;        
+        temp=Main.pref.get(VM_AUTOCENTER);
+        if((temp!=null)&&(temp.length()!=0))autocenter=Boolean.getBoolean(temp); else autocenter=false;
+        temp=Main.pref.get(VM_DEINTERLACER);
+        if((temp!=null)&&(temp.length()!=0)) deinterlacer=Main.pref.get(temp);
+        temp=Main.pref.get(VM_JUMPLENGTH);
+        if((temp!=null)&&(temp.length()!=0)) jumplength=Integer.valueOf(temp); else jumplength=1000; 
+        temp=Main.pref.get(VM_LOOPLENGTH);
+        if((temp!=null)&&(temp.length()!=0)) looplength=Integer.valueOf(temp); else looplength=6000;
+        temp=Main.pref.get(VM_MRU);
+        if((temp!=null)&&(temp.length()!=0)) mru=Main.pref.get(VM_MRU);else mru=System.getProperty("user.home");
+    }
+    
+    private void applySettings(){
+        //Internals
+        if(player!=null)
+        {
+            player.setAutoCenter(autocenter);
+            player.setDeinterlacer(deinterlacer);
+            player.setJumpLength(jumplength);
+            player.setLoopLength(looplength);
+        }
+        //GUI
+        VCenterIcon.setSelected(autocenter);
+        VIntNone.setSelected(true);
+        if(deinterlacer=="bob")VIntBob.setSelected(true);
+        if(deinterlacer=="linear")VIntLinear.setSelected(true);
+        
+    }
+    
+    private void saveSettings(){
+        Main.pref.put(VM_AUTOCENTER, autocenter);
+        Main.pref.put(VM_DEINTERLACER, deinterlacer);
+        Main.pref.put(VM_JUMPLENGTH, jumplength.toString());
+        Main.pref.put(VM_LOOPLENGTH, looplength.toString());
+        Main.pref.put(VM_MRU, mru);
+    }
+    
+    //make a flat copy
+    private List<WayPoint> copyGPSLayer(GpxData route)
+    { 
+        ls = new LinkedList<WayPoint>();
         for (GpxTrack trk : route.tracks) {
             for (GpxTrackSegment segment : trk.getSegments()) {
@@ -362,4 +362,4 @@
         Collections.sort(ls); //sort basing upon time
         return ls;
-	}
+    }
   }
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoFile.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoFile.java	(revision 23192)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoFile.java	(revision 23193)
@@ -4,10 +4,10 @@
 // a specific synced video
 public class GPSVideoFile extends File{
-	public long offset; //time difference in ms between GPS and Video track
-	
-	public GPSVideoFile(File f, long offset) {
-		super(f.getAbsoluteFile().toString());
-		this.offset=offset;
-	}
+    public long offset; //time difference in ms between GPS and Video track
+    
+    public GPSVideoFile(File f, long offset) {
+        super(f.getAbsoluteFile().toString());
+        this.offset=offset;
+    }
 
 }
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java	(revision 23192)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideoPlayer.java	(revision 23193)
@@ -22,267 +22,267 @@
 //combines video and GPS playback, major control has the video player
 public class GPSVideoPlayer implements PlayerObserver{
-	Timer t;
-	TimerTask updateGPSTrack;
-	private GpsPlayer gps;
-	private SimpleVideoPlayer video;
-	private JButton syncBtn;
-	private GPSVideoFile file;
-	private boolean synced=false; //do we playback the players together?
-	private JCheckBoxMenuItem subtTitleComponent;
-	
-
-	public GPSVideoPlayer(File f, final GpsPlayer pl) {
-		super();
-		this.gps = pl;
-		//test sync
-		video = new SimpleVideoPlayer();
-		/*
-		long gpsT=(9*60+20)*1000;
-		long videoT=10*60*1000+5*1000;
-		setFile(new GPSVideoFile(f, gpsT-videoT)); */
-		setFile(new GPSVideoFile(f, 0L));
-		//add Sync Button to the Player
-		syncBtn= new JButton("sync");
-		syncBtn.setBackground(Color.RED);
-		syncBtn.addActionListener(new ActionListener() {
-			//do a sync
-			public void actionPerformed(ActionEvent e) {
-				long diff=gps.getRelativeTime()-video.getTime();
-				file= new GPSVideoFile(file, diff);
-				syncBtn.setBackground(Color.GREEN);
-				synced=true;
-				markSyncedPoints();
-				video.play();
-				//gps.play();
-			}
-		});
-		setAsyncMode(true);
-		video.addComponent(syncBtn);
-		//a observer to communicate
-		SimpleVideoPlayer.addObserver(new PlayerObserver() { //TODO has o become this
-
-			public void playing(long time) {
-				//sync the GPS back
-				if(synced) gps.jump(getGPSTime(time));
-				
-			}
-
-			public void jumping(long time) {
-			
-			}
-
-			//a push way to set video attirbutes
-			public void metadata(long time, boolean subtitles) {
-				if(subtTitleComponent!=null) subtTitleComponent.setSelected(subtitles);				
-			}
-			
-		});
-		t = new Timer();		
-	}
-	
-	//marks all points that are covered by video AND GPS track
-	private void markSyncedPoints() {
-		//GPS or video stream starts first in time?
-		WayPoint start,end;
-		long t;
-		if(gps.getLength()<video.getLength())
-		{
-			//GPS is within video timeperiod
-			start=gps.getWaypoint(0);
-			end=gps.getWaypoint(gps.getLength());			
-		}
-		else
-		{
-			//video is within gps timeperiod
-			t=getGPSTime(0);
-			if(t<0) t=0;
-			start=gps.getWaypoint(t);
-			end=gps.getWaypoint(getGPSTime(video.getLength()));
-		}
-		//mark as synced
-		List<WayPoint> ls = gps.getTrack().subList(gps.getTrack().indexOf(start), gps.getTrack().indexOf(end));
-		
-		for (WayPoint wp : ls) {
-			wp.attr.put("synced", "true");
-		}	
-	}
-
-	public void setAsyncMode(boolean b)
-	{
-		if(b)
-		{
-			syncBtn.setVisible(true);
-		}
-		else
-		{
-			syncBtn.setVisible(false);
-		}
-	}
-	
-		
-	public void setFile(GPSVideoFile f)
-	{
-		
-		file=f;
-		video.setFile(f.getAbsoluteFile());
-		//video.play();
-	}
-	
-	public void play(long gpsstart)
-	{
-		//video is already playing
-		jumpToGPSTime(gpsstart);
-		gps.jump(gpsstart);
-		//gps.play();
-	}
-	
-	public void play()
-	{
-		video.play();
-	}
-	
-	public void pause()
-	{
-		video.pause();
-	}
-	
-	//jumps in video to the corresponding linked time
-	public void jumpToGPSTime(Time GPSTime)
-	{
-		gps.jump(GPSTime);
-	}
-	
-	//jumps in video to the corresponding linked time
-	public void jumpToGPSTime(long gpsT)
-	{
-		if(!synced)
-		{
-			//when not synced we can just move the icon to the right position			
-			gps.jump(new Date(gpsT));
-			Main.map.mapView.repaint();
-		}
-		video.jump(getVideoTime(gpsT));
-	}
-	
-	//calc synced timecode from video
-	private long getVideoTime(long GPStime)
-	{
-		return GPStime-file.offset;
-	}
-	
-	//calc corresponding GPS time
-	private long getGPSTime(long videoTime)
-	{
-		return videoTime+file.offset;
-	}
-
-	
-
-	public void setJumpLength(Integer integer) {
-		video.setJumpLength(integer);
-		
-	}
-
-	public void setLoopLength(Integer integer) {
-		video.setLoopLength(integer);
-		
-	}
-	
-	public boolean isSynced()
-	{
-		return isSynced();
-	}
-
-	public void loop() {
-		video.loop();
-		
-	}
-
-	public void forward() {
-		video.forward();
-		
-	}
-
-	public void backward() {
-		video.backward();
-		
-	}
-
-	public void removeVideo() {
-		video.removeVideo();
-		
-	}
-
-	public File getVideo() {
-		return file;
-	}
-
-	public float getCoverage() {
-		return gps.getLength()/video.getLength();
-	}
-
-	public void setDeinterlacer(String string) {
-		video.setDeinterlacer(string);
-		
-	}
-
-	public void setAutoCenter(boolean selected) {
-		gps.setAutoCenter(selected);
-		
-	}
-
-	
-	//not called by GPS
-	public boolean playing() {
-		return video.playing();
-	}
-
-	//when we clicked on the layer, here we update the video position
-	public void jumping(long time) {
-		if(synced) jumpToGPSTime(gps.getRelativeTime());
-		
-	}
-
-	public String getNativePlayerInfos() {
-		return video.getNativePlayerInfos();
-	}
-
-	public void faster() {
-		video.faster();
-		
-	}
-
-	public void slower() {
-		video.slower();
-		
-	}
-
-	public void playing(long time) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	public void toggleSubtitles() {
-		video.toggleSubs();
-		
-	}
-	
-	public boolean hasSubtitles(){
-		return video.hasSubtitles();
-	}
-
-	public void setSubtitleAction(JCheckBoxMenuItem a)
-	{
-		subtTitleComponent=a;
-	}
-
-	public void metadata(long time, boolean subtitles) {
-		// TODO Auto-generated method stub
-		
-	}
-
-	
-	
-
-	
+    Timer t;
+    TimerTask updateGPSTrack;
+    private GpsPlayer gps;
+    private SimpleVideoPlayer video;
+    private JButton syncBtn;
+    private GPSVideoFile file;
+    private boolean synced=false; //do we playback the players together?
+    private JCheckBoxMenuItem subtTitleComponent;
+    
+
+    public GPSVideoPlayer(File f, final GpsPlayer pl) {
+        super();
+        this.gps = pl;
+        //test sync
+        video = new SimpleVideoPlayer();
+        /*
+        long gpsT=(9*60+20)*1000;
+        long videoT=10*60*1000+5*1000;
+        setFile(new GPSVideoFile(f, gpsT-videoT)); */
+        setFile(new GPSVideoFile(f, 0L));
+        //add Sync Button to the Player
+        syncBtn= new JButton("sync");
+        syncBtn.setBackground(Color.RED);
+        syncBtn.addActionListener(new ActionListener() {
+            //do a sync
+            public void actionPerformed(ActionEvent e) {
+                long diff=gps.getRelativeTime()-video.getTime();
+                file= new GPSVideoFile(file, diff);
+                syncBtn.setBackground(Color.GREEN);
+                synced=true;
+                markSyncedPoints();
+                video.play();
+                //gps.play();
+            }
+        });
+        setAsyncMode(true);
+        video.addComponent(syncBtn);
+        //a observer to communicate
+        SimpleVideoPlayer.addObserver(new PlayerObserver() { //TODO has o become this
+
+            public void playing(long time) {
+                //sync the GPS back
+                if(synced) gps.jump(getGPSTime(time));
+                
+            }
+
+            public void jumping(long time) {
+            
+            }
+
+            //a push way to set video attirbutes
+            public void metadata(long time, boolean subtitles) {
+                if(subtTitleComponent!=null) subtTitleComponent.setSelected(subtitles);             
+            }
+            
+        });
+        t = new Timer();        
+    }
+    
+    //marks all points that are covered by video AND GPS track
+    private void markSyncedPoints() {
+        //GPS or video stream starts first in time?
+        WayPoint start,end;
+        long t;
+        if(gps.getLength()<video.getLength())
+        {
+            //GPS is within video timeperiod
+            start=gps.getWaypoint(0);
+            end=gps.getWaypoint(gps.getLength());           
+        }
+        else
+        {
+            //video is within gps timeperiod
+            t=getGPSTime(0);
+            if(t<0) t=0;
+            start=gps.getWaypoint(t);
+            end=gps.getWaypoint(getGPSTime(video.getLength()));
+        }
+        //mark as synced
+        List<WayPoint> ls = gps.getTrack().subList(gps.getTrack().indexOf(start), gps.getTrack().indexOf(end));
+        
+        for (WayPoint wp : ls) {
+            wp.attr.put("synced", "true");
+        }   
+    }
+
+    public void setAsyncMode(boolean b)
+    {
+        if(b)
+        {
+            syncBtn.setVisible(true);
+        }
+        else
+        {
+            syncBtn.setVisible(false);
+        }
+    }
+    
+        
+    public void setFile(GPSVideoFile f)
+    {
+        
+        file=f;
+        video.setFile(f.getAbsoluteFile());
+        //video.play();
+    }
+    
+    public void play(long gpsstart)
+    {
+        //video is already playing
+        jumpToGPSTime(gpsstart);
+        gps.jump(gpsstart);
+        //gps.play();
+    }
+    
+    public void play()
+    {
+        video.play();
+    }
+    
+    public void pause()
+    {
+        video.pause();
+    }
+    
+    //jumps in video to the corresponding linked time
+    public void jumpToGPSTime(Time GPSTime)
+    {
+        gps.jump(GPSTime);
+    }
+    
+    //jumps in video to the corresponding linked time
+    public void jumpToGPSTime(long gpsT)
+    {
+        if(!synced)
+        {
+            //when not synced we can just move the icon to the right position           
+            gps.jump(new Date(gpsT));
+            Main.map.mapView.repaint();
+        }
+        video.jump(getVideoTime(gpsT));
+    }
+    
+    //calc synced timecode from video
+    private long getVideoTime(long GPStime)
+    {
+        return GPStime-file.offset;
+    }
+    
+    //calc corresponding GPS time
+    private long getGPSTime(long videoTime)
+    {
+        return videoTime+file.offset;
+    }
+
+    
+
+    public void setJumpLength(Integer integer) {
+        video.setJumpLength(integer);
+        
+    }
+
+    public void setLoopLength(Integer integer) {
+        video.setLoopLength(integer);
+        
+    }
+    
+    public boolean isSynced()
+    {
+        return isSynced();
+    }
+
+    public void loop() {
+        video.loop();
+        
+    }
+
+    public void forward() {
+        video.forward();
+        
+    }
+
+    public void backward() {
+        video.backward();
+        
+    }
+
+    public void removeVideo() {
+        video.removeVideo();
+        
+    }
+
+    public File getVideo() {
+        return file;
+    }
+
+    public float getCoverage() {
+        return gps.getLength()/video.getLength();
+    }
+
+    public void setDeinterlacer(String string) {
+        video.setDeinterlacer(string);
+        
+    }
+
+    public void setAutoCenter(boolean selected) {
+        gps.setAutoCenter(selected);
+        
+    }
+
+    
+    //not called by GPS
+    public boolean playing() {
+        return video.playing();
+    }
+
+    //when we clicked on the layer, here we update the video position
+    public void jumping(long time) {
+        if(synced) jumpToGPSTime(gps.getRelativeTime());
+        
+    }
+
+    public String getNativePlayerInfos() {
+        return video.getNativePlayerInfos();
+    }
+
+    public void faster() {
+        video.faster();
+        
+    }
+
+    public void slower() {
+        video.slower();
+        
+    }
+
+    public void playing(long time) {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void toggleSubtitles() {
+        video.toggleSubs();
+        
+    }
+    
+    public boolean hasSubtitles(){
+        return video.hasSubtitles();
+    }
+
+    public void setSubtitleAction(JCheckBoxMenuItem a)
+    {
+        subtTitleComponent=a;
+    }
+
+    public void metadata(long time, boolean subtitles) {
+        // TODO Auto-generated method stub
+        
+    }
+
+    
+    
+
+    
 }
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java	(revision 23192)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/SimpleVideoPlayer.java	(revision 23193)
@@ -49,231 +49,231 @@
 //basic class of a videoplayer for one video
 public class SimpleVideoPlayer extends JFrame implements MediaPlayerEventListener, WindowListener{
-	private EmbeddedMediaPlayer mp;
-	private Timer t;
-	private JPanel screenPanel,controlsPanel;
-	private JSlider timeline;
-	private JButton play,back,forward;
-	private JToggleButton loop,mute;
-	private JSlider speed;
-	private Canvas scr;
-	private final String[] mediaOptions = {""};
-	private boolean syncTimeline=false;
-	private boolean looping=false;
-	private SimpleDateFormat ms;
-	private static final Logger LOG = Logger.getLogger(MediaPlayerFactory.class);
-	private int jumpLength=1000;
-	private int  loopLength=6000;
-	private static Set<PlayerObserver> observers = new HashSet<PlayerObserver>(); //we have to implement our own Observer pattern
-	
-	public SimpleVideoPlayer() {
-		super();
-		/*TODO new EnvironmentCheckerFactory().newEnvironmentChecker().checkEnvironment();
-		 * if(RuntimeUtil.isWindows()) {
-	  			vlcArgs.add("--plugin-path=" + WindowsRuntimeUtil.getVlcInstallDir() + "\\plugins");
-			}
-		 */
-		try
-		{
-			//we don't need any options
-			String[] libvlcArgs = {""};
-			String[] standardMediaOptions = {""}; 
-			
-			//System.out.println("libvlc version: " + LibVlc.INSTANCE.libvlc_get_version());
-			//setup Media Player
-			//TODO we have to deal with unloading things....
-			MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(libvlcArgs);
-		    FullScreenStrategy fullScreenStrategy = new DefaultFullScreenStrategy(this);
-		    mp = mediaPlayerFactory.newMediaPlayer(fullScreenStrategy);
-		    mp.setStandardMediaOptions(standardMediaOptions);
-		    //setup GUI
-		    setSize(400, 300); //later we apply movie size
-		    setAlwaysOnTop(true);
-		    createUI();
-		    setLayout();
-			addListeners(); //registering shortcuts is task of the outer plugin class!
-		    //embed vlc player
-			scr.setVisible(true);
-			setVisible(true);
-			mp.setVideoSurface(scr);
-			mp.addMediaPlayerEventListener(this);
-			//mp.pause();
-			//jump(0);
-			//create updater
-			ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
-			executorService.scheduleAtFixedRate(new Syncer(this), 0L, 1000L, TimeUnit.MILLISECONDS);
-		    //setDefaultCloseOperation(EXIT_ON_CLOSE);
-			addWindowListener(this);
-		}
-		catch (NoClassDefFoundError e)
-		{
-			System.err.println(tr("Unable to find JNA Java library!"));
-		}
-		catch (UnsatisfiedLinkError e)
-		{
-			System.err.println(tr("Unable to find native libvlc library!"));
-		}
-		
-	}
-
-	private void createUI() {
-		//setIconImage();
-		ms = new SimpleDateFormat("hh:mm:ss");
-		scr=new Canvas();
-		timeline = new JSlider(0,100,0);
-		timeline.setMajorTickSpacing(10);
-		timeline.setMajorTickSpacing(5);
-		timeline.setPaintTicks(true);
-		//TODO we need Icons instead
-		play= new JButton(tr("play"));
-		back= new JButton("<");
-		forward= new JButton(">");
-		loop= new JToggleButton(tr("loop"));
-		mute= new JToggleButton(tr("mute"));
-		speed = new JSlider(-200,200,0);
-		speed.setMajorTickSpacing(100);
-		speed.setPaintTicks(true);			
-		speed.setOrientation(Adjustable.VERTICAL);
-		Hashtable labelTable = new Hashtable();
-		labelTable.put( new Integer( 0 ), new JLabel("1x") );
-		labelTable.put( new Integer( -200 ), new JLabel("-2x") );
-		labelTable.put( new Integer( 200 ), new JLabel("2x") );
-		speed.setLabelTable( labelTable );
-		speed.setPaintLabels(true);
-	}
-	
-	//creates a layout like the most mediaplayers are...
-	private void setLayout() {
-		this.setLayout(new BorderLayout());
-		screenPanel=new JPanel();
-		screenPanel.setLayout(new BorderLayout());
-		controlsPanel=new JPanel();
-		controlsPanel.setLayout(new FlowLayout());
-		add(screenPanel,BorderLayout.CENTER);
-		add(controlsPanel,BorderLayout.SOUTH);
-		//fill screen panel
-		screenPanel.add(scr,BorderLayout.CENTER);
-		screenPanel.add(timeline,BorderLayout.SOUTH);
-		screenPanel.add(speed,BorderLayout.EAST);
-		controlsPanel.add(play);
-		controlsPanel.add(back);
-		controlsPanel.add(forward);
-		controlsPanel.add(loop);
-		controlsPanel.add(mute);
-		loop.setSelected(false);
-		mute.setSelected(false);
-	}
-
-	//add UI functionality
-	private void addListeners() {
-		timeline.addChangeListener(new ChangeListener() {
-			public void stateChanged(ChangeEvent e) {
-				if(!syncTimeline) //only if user moves the slider by hand
-				{
-					if(!timeline.getValueIsAdjusting()) //and the slider is fixed
-					{
-						//recalc to 0.x percent value
-						mp.setPosition((float)timeline.getValue()/100.0f);
-					}					
-				}
-			}
-		    });
-		
-		play.addActionListener(new ActionListener() {
-			
-			public void actionPerformed(ActionEvent arg0) {
-				if(mp.isPlaying()) mp.pause(); else mp.play();				
-			}
-		});
-		
-		back.addActionListener(new ActionListener() {
-			
-			public void actionPerformed(ActionEvent arg0) {
-				backward();
-			}
-		});
-		
-		forward.addActionListener(new ActionListener() {
-			
-			public void actionPerformed(ActionEvent arg0) {
-				forward();
-			}
-		});
-		
-		loop.addActionListener(new ActionListener() {
-
-			public void actionPerformed(ActionEvent arg0) {
-				loop();
-			}
-		});
-		
-		mute.addActionListener(new ActionListener() {
-
-			public void actionPerformed(ActionEvent arg0) {
-				mute();
-			}
-		});
-		
-		speed.addChangeListener(new ChangeListener() {
-			
-			public void stateChanged(ChangeEvent arg0) {
-				if(!speed.getValueIsAdjusting()&&(mp.isPlaying()))
-				{
-					int perc = speed.getValue();
-					float ratio= (float) (perc/400f*1.75);
-					ratio=ratio+(9/8);
-					mp.setRate(ratio);
-				}
-				
-			}
-		});
-		
-	}	
-
-	public void finished(MediaPlayer arg0) {
-			
-	}
-
-	public void lengthChanged(MediaPlayer arg0, long arg1) {
-
-	}
-
-	public void metaDataAvailable(MediaPlayer arg0, VideoMetaData data) {
-		final float perc = 0.5f;
-		Dimension org=data.getVideoDimension();
-		scr.setSize(new Dimension((int)(org.width*perc), (int)(org.height*perc)));
-		pack();
-		//send out metadatas to all observers
-		for (PlayerObserver o : observers) {
+    private EmbeddedMediaPlayer mp;
+    private Timer t;
+    private JPanel screenPanel,controlsPanel;
+    private JSlider timeline;
+    private JButton play,back,forward;
+    private JToggleButton loop,mute;
+    private JSlider speed;
+    private Canvas scr;
+    private final String[] mediaOptions = {""};
+    private boolean syncTimeline=false;
+    private boolean looping=false;
+    private SimpleDateFormat ms;
+    private static final Logger LOG = Logger.getLogger(MediaPlayerFactory.class);
+    private int jumpLength=1000;
+    private int  loopLength=6000;
+    private static Set<PlayerObserver> observers = new HashSet<PlayerObserver>(); //we have to implement our own Observer pattern
+    
+    public SimpleVideoPlayer() {
+        super();
+        /*TODO new EnvironmentCheckerFactory().newEnvironmentChecker().checkEnvironment();
+         * if(RuntimeUtil.isWindows()) {
+                vlcArgs.add("--plugin-path=" + WindowsRuntimeUtil.getVlcInstallDir() + "\\plugins");
+            }
+         */
+        try
+        {
+            //we don't need any options
+            String[] libvlcArgs = {""};
+            String[] standardMediaOptions = {""}; 
+            
+            //System.out.println("libvlc version: " + LibVlc.INSTANCE.libvlc_get_version());
+            //setup Media Player
+            //TODO we have to deal with unloading things....
+            MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory(libvlcArgs);
+            FullScreenStrategy fullScreenStrategy = new DefaultFullScreenStrategy(this);
+            mp = mediaPlayerFactory.newMediaPlayer(fullScreenStrategy);
+            mp.setStandardMediaOptions(standardMediaOptions);
+            //setup GUI
+            setSize(400, 300); //later we apply movie size
+            setAlwaysOnTop(true);
+            createUI();
+            setLayout();
+            addListeners(); //registering shortcuts is task of the outer plugin class!
+            //embed vlc player
+            scr.setVisible(true);
+            setVisible(true);
+            mp.setVideoSurface(scr);
+            mp.addMediaPlayerEventListener(this);
+            //mp.pause();
+            //jump(0);
+            //create updater
+            ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
+            executorService.scheduleAtFixedRate(new Syncer(this), 0L, 1000L, TimeUnit.MILLISECONDS);
+            //setDefaultCloseOperation(EXIT_ON_CLOSE);
+            addWindowListener(this);
+        }
+        catch (NoClassDefFoundError e)
+        {
+            System.err.println(tr("Unable to find JNA Java library!"));
+        }
+        catch (UnsatisfiedLinkError e)
+        {
+            System.err.println(tr("Unable to find native libvlc library!"));
+        }
+        
+    }
+
+    private void createUI() {
+        //setIconImage();
+        ms = new SimpleDateFormat("hh:mm:ss");
+        scr=new Canvas();
+        timeline = new JSlider(0,100,0);
+        timeline.setMajorTickSpacing(10);
+        timeline.setMajorTickSpacing(5);
+        timeline.setPaintTicks(true);
+        //TODO we need Icons instead
+        play= new JButton(tr("play"));
+        back= new JButton("<");
+        forward= new JButton(">");
+        loop= new JToggleButton(tr("loop"));
+        mute= new JToggleButton(tr("mute"));
+        speed = new JSlider(-200,200,0);
+        speed.setMajorTickSpacing(100);
+        speed.setPaintTicks(true);          
+        speed.setOrientation(Adjustable.VERTICAL);
+        Hashtable labelTable = new Hashtable();
+        labelTable.put( new Integer( 0 ), new JLabel("1x") );
+        labelTable.put( new Integer( -200 ), new JLabel("-2x") );
+        labelTable.put( new Integer( 200 ), new JLabel("2x") );
+        speed.setLabelTable( labelTable );
+        speed.setPaintLabels(true);
+    }
+    
+    //creates a layout like the most mediaplayers are...
+    private void setLayout() {
+        this.setLayout(new BorderLayout());
+        screenPanel=new JPanel();
+        screenPanel.setLayout(new BorderLayout());
+        controlsPanel=new JPanel();
+        controlsPanel.setLayout(new FlowLayout());
+        add(screenPanel,BorderLayout.CENTER);
+        add(controlsPanel,BorderLayout.SOUTH);
+        //fill screen panel
+        screenPanel.add(scr,BorderLayout.CENTER);
+        screenPanel.add(timeline,BorderLayout.SOUTH);
+        screenPanel.add(speed,BorderLayout.EAST);
+        controlsPanel.add(play);
+        controlsPanel.add(back);
+        controlsPanel.add(forward);
+        controlsPanel.add(loop);
+        controlsPanel.add(mute);
+        loop.setSelected(false);
+        mute.setSelected(false);
+    }
+
+    //add UI functionality
+    private void addListeners() {
+        timeline.addChangeListener(new ChangeListener() {
+            public void stateChanged(ChangeEvent e) {
+                if(!syncTimeline) //only if user moves the slider by hand
+                {
+                    if(!timeline.getValueIsAdjusting()) //and the slider is fixed
+                    {
+                        //recalc to 0.x percent value
+                        mp.setPosition((float)timeline.getValue()/100.0f);
+                    }                   
+                }
+            }
+            });
+        
+        play.addActionListener(new ActionListener() {
+            
+            public void actionPerformed(ActionEvent arg0) {
+                if(mp.isPlaying()) mp.pause(); else mp.play();              
+            }
+        });
+        
+        back.addActionListener(new ActionListener() {
+            
+            public void actionPerformed(ActionEvent arg0) {
+                backward();
+            }
+        });
+        
+        forward.addActionListener(new ActionListener() {
+            
+            public void actionPerformed(ActionEvent arg0) {
+                forward();
+            }
+        });
+        
+        loop.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent arg0) {
+                loop();
+            }
+        });
+        
+        mute.addActionListener(new ActionListener() {
+
+            public void actionPerformed(ActionEvent arg0) {
+                mute();
+            }
+        });
+        
+        speed.addChangeListener(new ChangeListener() {
+            
+            public void stateChanged(ChangeEvent arg0) {
+                if(!speed.getValueIsAdjusting()&&(mp.isPlaying()))
+                {
+                    int perc = speed.getValue();
+                    float ratio= (float) (perc/400f*1.75);
+                    ratio=ratio+(9/8);
+                    mp.setRate(ratio);
+                }
+                
+            }
+        });
+        
+    }   
+
+    public void finished(MediaPlayer arg0) {
+            
+    }
+
+    public void lengthChanged(MediaPlayer arg0, long arg1) {
+
+    }
+
+    public void metaDataAvailable(MediaPlayer arg0, VideoMetaData data) {
+        final float perc = 0.5f;
+        Dimension org=data.getVideoDimension();
+        scr.setSize(new Dimension((int)(org.width*perc), (int)(org.height*perc)));
+        pack();
+        //send out metadatas to all observers
+        for (PlayerObserver o : observers) {
             o.metadata(0, hasSubtitles());
         }
-	}
-
-	public void paused(MediaPlayer arg0) {
-
-	}
-
-	public void playing(MediaPlayer arg0) {
-
-	}
-
-	public void positionChanged(MediaPlayer arg0, float arg1) {
-		
-	}
-
-	public void stopped(MediaPlayer arg0) {
-				
-	}
-
-	public void timeChanged(MediaPlayer arg0, long arg1) {
-
-	}
-	
-
-	public void windowActivated(WindowEvent arg0) {	}
-
-	public void windowClosed(WindowEvent arg0) {	}
-
-	//we have to unload and disconnect to the VLC engine
-	public void windowClosing(WindowEvent evt) {
+    }
+
+    public void paused(MediaPlayer arg0) {
+
+    }
+
+    public void playing(MediaPlayer arg0) {
+
+    }
+
+    public void positionChanged(MediaPlayer arg0, float arg1) {
+        
+    }
+
+    public void stopped(MediaPlayer arg0) {
+                
+    }
+
+    public void timeChanged(MediaPlayer arg0, long arg1) {
+
+    }
+    
+
+    public void windowActivated(WindowEvent arg0) { }
+
+    public void windowClosed(WindowEvent arg0) {    }
+
+    //we have to unload and disconnect to the VLC engine
+    public void windowClosing(WindowEvent evt) {
         if(LOG.isDebugEnabled()) {LOG.debug("windowClosing(evt=" + evt + ")");}
         mp.release();
@@ -282,132 +282,132 @@
       }
 
-	public void windowDeactivated(WindowEvent arg0) {	}
-
-	public void windowDeiconified(WindowEvent arg0) {	}
-
-	public void windowIconified(WindowEvent arg0) {	}
-
-	public void windowOpened(WindowEvent arg0) {	}	
-	
-	public void setFile(File f)
-	{
-		String mediaPath = f.getAbsoluteFile().toString();
-		mp.playMedia(mediaPath, mediaOptions);
-		pack();	
-	}
-	
-	public void play()
-	{
-		mp.play();
-	}
-	
-	public void jump(long time)
-	{
-		/*float pos = (float)mp.getLength()/(float)time;
-		mp.setPosition(pos);*/
-		mp.setTime(time);
-	}
-	
-	public long getTime()
-	{
-		return mp.getTime();
-	}
-	
-	public float getPosition()
-	{
-		return mp.getPosition();
-	}
-	
-	public boolean isPlaying()
-	{
-		return mp.isPlaying();
-	}
-	
-	//gets called by the Syncer thread to update all observers
-	public void updateTime ()
-	{
-		if(mp.isPlaying())
-		{
-			setTitle(ms.format(new Date(mp.getTime())));
-			syncTimeline=true;
-			timeline.setValue(Math.round(mp.getPosition()*100));
-			syncTimeline=false;
-			notifyObservers(mp.getTime());
-		}
-	}
-	
-	//allow externals to extend the ui
-	public void addComponent(JComponent c)
-	{
-		controlsPanel.add(c);
-		pack();
-	}
-
-	public long getLength() {		
-		return mp.getLength();
-	}
-
-	public void setDeinterlacer(String string) {
-		mp.setDeinterlace(string);
-		
-	}
-
-	public void setJumpLength(Integer integer) {
-		jumpLength=integer;
-		
-	}
-
-	public void setLoopLength(Integer integer) {
-		loopLength = integer;
-		
-	}
-
-	public void loop() {
-		if(looping)
-		{
-			t.cancel();
-			looping=false;
-		}
-		else			
-		{
-			final long resetpoint=(long) mp.getTime()-loopLength/2;
-			TimerTask ani=new TimerTask() {
-				
-				@Override
-				public void run() {
-					mp.setTime(resetpoint);
-				}
-			};
-			t= new Timer();
-			t.schedule(ani,loopLength/2,loopLength); //first run a half looptime till reset
-			looping=true;
-			}
-		
-	}
-	
-	protected void mute() {
-		mp.mute();
-		
-	}
-
-	public void forward() {
-		mp.setTime((long) (mp.getTime()+jumpLength));
-	}
-
-	public void backward() {
-		mp.setTime((long) (mp.getTime()-jumpLength));
-		
-	}
-
-	public void removeVideo() {
-		if (mp.isPlaying()) mp.stop();
-		mp.release();
-		
-	}
-	
-	public void toggleSubs()
-	{
-		//vlc manages it's subtitles in a own list so we have to cycle trough
-		int spu = mp.getSpu();
+    public void windowDeactivated(WindowEvent arg0) {   }
+
+    public void windowDeiconified(WindowEvent arg0) {   }
+
+    public void windowIconified(WindowEvent arg0) { }
+
+    public void windowOpened(WindowEvent arg0) {    }   
+    
+    public void setFile(File f)
+    {
+        String mediaPath = f.getAbsoluteFile().toString();
+        mp.playMedia(mediaPath, mediaOptions);
+        pack(); 
+    }
+    
+    public void play()
+    {
+        mp.play();
+    }
+    
+    public void jump(long time)
+    {
+        /*float pos = (float)mp.getLength()/(float)time;
+        mp.setPosition(pos);*/
+        mp.setTime(time);
+    }
+    
+    public long getTime()
+    {
+        return mp.getTime();
+    }
+    
+    public float getPosition()
+    {
+        return mp.getPosition();
+    }
+    
+    public boolean isPlaying()
+    {
+        return mp.isPlaying();
+    }
+    
+    //gets called by the Syncer thread to update all observers
+    public void updateTime ()
+    {
+        if(mp.isPlaying())
+        {
+            setTitle(ms.format(new Date(mp.getTime())));
+            syncTimeline=true;
+            timeline.setValue(Math.round(mp.getPosition()*100));
+            syncTimeline=false;
+            notifyObservers(mp.getTime());
+        }
+    }
+    
+    //allow externals to extend the ui
+    public void addComponent(JComponent c)
+    {
+        controlsPanel.add(c);
+        pack();
+    }
+
+    public long getLength() {       
+        return mp.getLength();
+    }
+
+    public void setDeinterlacer(String string) {
+        mp.setDeinterlace(string);
+        
+    }
+
+    public void setJumpLength(Integer integer) {
+        jumpLength=integer;
+        
+    }
+
+    public void setLoopLength(Integer integer) {
+        loopLength = integer;
+        
+    }
+
+    public void loop() {
+        if(looping)
+        {
+            t.cancel();
+            looping=false;
+        }
+        else            
+        {
+            final long resetpoint=(long) mp.getTime()-loopLength/2;
+            TimerTask ani=new TimerTask() {
+                
+                @Override
+                public void run() {
+                    mp.setTime(resetpoint);
+                }
+            };
+            t= new Timer();
+            t.schedule(ani,loopLength/2,loopLength); //first run a half looptime till reset
+            looping=true;
+            }
+        
+    }
+    
+    protected void mute() {
+        mp.mute();
+        
+    }
+
+    public void forward() {
+        mp.setTime((long) (mp.getTime()+jumpLength));
+    }
+
+    public void backward() {
+        mp.setTime((long) (mp.getTime()-jumpLength));
+        
+    }
+
+    public void removeVideo() {
+        if (mp.isPlaying()) mp.stop();
+        mp.release();
+        
+    }
+    
+    public void toggleSubs()
+    {
+        //vlc manages it's subtitles in a own list so we have to cycle trough
+        int spu = mp.getSpu();
         if(spu > -1) {
           spu++;
@@ -420,66 +420,66 @@
         }
         mp.setSpu(spu);
-	}
-
-	public static void addObserver(PlayerObserver observer) {
-
-	        observers.add(observer);
-
-	    }
-
-	 
-
-	    public static void removeObserver(PlayerObserver observer) {
-
-	        observers.remove(observer);
-
-	    }
-
-	    private static void notifyObservers(long newTime) {
-
-	        for (PlayerObserver o : observers) {
-	            o.playing(newTime);
-	        }
-
-	    }
-
-		public String getNativePlayerInfos() {
-			return "VLC "+LibVlc.INSTANCE.libvlc_get_version();
-		}
-
-		public void faster() {
-			speed.setValue(speed.getValue()+100);
-			
-		}
-
-		public void slower() {
-			speed.setValue(speed.getValue()-100);
-			
-		}
-
-		public void pause() {
-			if (mp.isPlaying()) mp.pause();
-			
-		}
-
-		public boolean playing() {
-			return mp.isPlaying();
-		}
-
-		public void error(MediaPlayer arg0) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		public void mediaChanged(MediaPlayer arg0) {
-			// TODO Auto-generated method stub
-			
-		}
-
-		public boolean hasSubtitles() {
-			if (mp.getSpuCount()==0) return false; else   return true;
-		}
-
-	
+    }
+
+    public static void addObserver(PlayerObserver observer) {
+
+            observers.add(observer);
+
+        }
+
+     
+
+        public static void removeObserver(PlayerObserver observer) {
+
+            observers.remove(observer);
+
+        }
+
+        private static void notifyObservers(long newTime) {
+
+            for (PlayerObserver o : observers) {
+                o.playing(newTime);
+            }
+
+        }
+
+        public String getNativePlayerInfos() {
+            return "VLC "+LibVlc.INSTANCE.libvlc_get_version();
+        }
+
+        public void faster() {
+            speed.setValue(speed.getValue()+100);
+            
+        }
+
+        public void slower() {
+            speed.setValue(speed.getValue()-100);
+            
+        }
+
+        public void pause() {
+            if (mp.isPlaying()) mp.pause();
+            
+        }
+
+        public boolean playing() {
+            return mp.isPlaying();
+        }
+
+        public void error(MediaPlayer arg0) {
+            // TODO Auto-generated method stub
+            
+        }
+
+        public void mediaChanged(MediaPlayer arg0) {
+            // TODO Auto-generated method stub
+            
+        }
+
+        public boolean hasSubtitles() {
+            if (mp.getSpuCount()==0) return false; else   return true;
+        }
+
+    
 
 }
Index: /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Syncer.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Syncer.java	(revision 23192)
+++ /applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/Syncer.java	(revision 23193)
@@ -17,7 +17,7 @@
     public void run() {
       SwingUtilities.invokeLater(new Runnable() {
-    	  //here we update
+          //here we update
         public void run() {
-        	if (pl.isPlaying())	pl.updateTime(); //if the video is seeking we get a mess
+            if (pl.isPlaying()) pl.updateTime(); //if the video is seeking we get a mess
         }
       });
Index: /applications/editors/josm/plugins/videomapping/test/videotest.java
===================================================================
--- /applications/editors/josm/plugins/videomapping/test/videotest.java	(revision 23192)
+++ /applications/editors/josm/plugins/videomapping/test/videotest.java	(revision 23193)
@@ -21,22 +21,22 @@
 public class videotest {
 
-	/**
-	 * @param args
-	 */
-	public static void main(String[] args) {
-		final SimpleVideoPlayer sVP = new SimpleVideoPlayer();
-		sVP.setFile(new File("C:\\TEMP\\122_0159.MOV"));
-		//sVP.play(); //FIXME We have a bug so we get out of sync if we jump before the video is up (and this we CAN'T DETECT!!!)
-		/*
-		JButton b = new JButton("jump");
-		b.addActionListener(new ActionListener() {
-			
-			public void actionPerformed(ActionEvent e) {
-				sVP.jump(610000);				
-			}
-		});
-		sVP.add(b);
-		*/
-	}
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        final SimpleVideoPlayer sVP = new SimpleVideoPlayer();
+        sVP.setFile(new File("C:\\TEMP\\122_0159.MOV"));
+        //sVP.play(); //FIXME We have a bug so we get out of sync if we jump before the video is up (and this we CAN'T DETECT!!!)
+        /*
+        JButton b = new JButton("jump");
+        b.addActionListener(new ActionListener() {
+            
+            public void actionPerformed(ActionEvent e) {
+                sVP.jump(610000);               
+            }
+        });
+        sVP.add(b);
+        */
+    }
 
 }
