Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysAction.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysAction.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysAction.java	(revision 23189)
@@ -24,77 +24,77 @@
 public class AlignWaysAction extends JosmAction {
 
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -1540319652562985458L;
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -1540319652562985458L;
 
-	public AlignWaysAction() {
-		super(tr("Align Way Segments"), "alignways",
-				tr("Makes a pair of selected way segments parallel by rotating one of them " +
-				"around a chosen pivot."),
-				Shortcut.registerShortcut("tools:alignways", tr("Tool: {0}",
-						tr("Align Ways")), KeyEvent.VK_A, Shortcut.GROUP_EDIT,
-						Shortcut.SHIFT_DEFAULT), true);
-		setEnabled(false);
-	}
+    public AlignWaysAction() {
+        super(tr("Align Way Segments"), "alignways",
+                tr("Makes a pair of selected way segments parallel by rotating one of them " +
+                "around a chosen pivot."),
+                Shortcut.registerShortcut("tools:alignways", tr("Tool: {0}",
+                        tr("Align Ways")), KeyEvent.VK_A, Shortcut.GROUP_EDIT,
+                        Shortcut.SHIFT_DEFAULT), true);
+        setEnabled(false);
+    }
 
-	public void actionPerformed(ActionEvent e) {
-		if (!isEnabled())
-			return;
-		if (getCurrentDataSet() == null)
-			return;
+    public void actionPerformed(ActionEvent e) {
+        if (!isEnabled())
+            return;
+        if (getCurrentDataSet() == null)
+            return;
 
-		Collection<Node> affectedNodes = AlignWaysSegmentMgr.getInstance(Main.map.mapView).getSelectedNodes();
+        Collection<Node> affectedNodes = AlignWaysSegmentMgr.getInstance(Main.map.mapView).getSelectedNodes();
 
-		Command c = !Main.main.undoRedo.commands.isEmpty() ? Main.main.undoRedo.commands
-				.getLast()
-				: null;
+        Command c = !Main.main.undoRedo.commands.isEmpty() ? Main.main.undoRedo.commands
+                .getLast()
+                : null;
 
-				if (!(c instanceof AlignWaysRotateCommand &&
-						affectedNodes.equals(((AlignWaysRotateCommand) c).getRotatedNodes()))) {
-					c = new AlignWaysRotateCommand();
-					if (actionValid((AlignWaysRotateCommand)c, affectedNodes)) {
-						Main.main.undoRedo.add(c);
-					}
-				}
+                if (!(c instanceof AlignWaysRotateCommand &&
+                        affectedNodes.equals(((AlignWaysRotateCommand) c).getRotatedNodes()))) {
+                    c = new AlignWaysRotateCommand();
+                    if (actionValid((AlignWaysRotateCommand)c, affectedNodes)) {
+                        Main.main.undoRedo.add(c);
+                    }
+                }
 
-				Main.map.mapView.repaint();
+                Main.map.mapView.repaint();
 
-				return;
-	}
+                return;
+    }
 
 
-	/**
-	 * Validates the circumstances of the alignment (rotation) command to be executed.
-	 * @param c Command to be verified.
-	 * @param affectedNodes Nodes to be affected by the action.
-	 * @return true if the aligning action can be done, false otherwise.
-	 */
-	private boolean actionValid(AlignWaysRotateCommand c, Collection<Node> affectedNodes) {
-		// Deny action if reference and alignee segment cannot be aligned
-		if (!c.areSegsAlignable()) {
-			JOptionPane.showMessageDialog(Main.parent,
-					tr("Please select two segments that don''t share any nodes\n"
-							+ " or put the pivot on their common node.\n"),
-							tr("AlignWayS: Alignment not possible"), JOptionPane.WARNING_MESSAGE);
-			return false;
-		}
+    /**
+     * Validates the circumstances of the alignment (rotation) command to be executed.
+     * @param c Command to be verified.
+     * @param affectedNodes Nodes to be affected by the action.
+     * @return true if the aligning action can be done, false otherwise.
+     */
+    private boolean actionValid(AlignWaysRotateCommand c, Collection<Node> affectedNodes) {
+        // Deny action if reference and alignee segment cannot be aligned
+        if (!c.areSegsAlignable()) {
+            JOptionPane.showMessageDialog(Main.parent,
+                    tr("Please select two segments that don''t share any nodes\n"
+                            + " or put the pivot on their common node.\n"),
+                            tr("AlignWayS: Alignment not possible"), JOptionPane.WARNING_MESSAGE);
+            return false;
+        }
 
-		// Deny action if the nodes would end up outside world
-		for (Node n : affectedNodes) {
-			if (n.getCoor().isOutSideWorld()) {
-				// Revert move
-				(c).undoCommand();
-				JOptionPane.showMessageDialog(Main.parent,
-						tr("Aligning would result nodes outside the world.\n"),
-						tr("AlignWayS: Alignment not possible"), JOptionPane.WARNING_MESSAGE);
-				return false;
-			}
+        // Deny action if the nodes would end up outside world
+        for (Node n : affectedNodes) {
+            if (n.getCoor().isOutSideWorld()) {
+                // Revert move
+                (c).undoCommand();
+                JOptionPane.showMessageDialog(Main.parent,
+                        tr("Aligning would result nodes outside the world.\n"),
+                        tr("AlignWayS: Alignment not possible"), JOptionPane.WARNING_MESSAGE);
+                return false;
+            }
 
-		}
+        }
 
-		// Action valid
-		return true;
-	}
+        // Action valid
+        return true;
+    }
 
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysAlgnSegment.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysAlgnSegment.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysAlgnSegment.java	(revision 23189)
@@ -26,188 +26,188 @@
 public class AlignWaysAlgnSegment extends AlignWaysSegment {
 
-	private enum PivotLocations {
-		NONE, NODE1, NODE2, CENTRE
-	};
-
-	private PivotLocations currPivot;
-	Map<PivotLocations, EastNorth> pivotList = new EnumMap<PivotLocations, EastNorth>(
-			PivotLocations.class);
-	private final Color pivotColor = Color.YELLOW;
-	private final Color crossColor = pivotColor;
-
-	public AlignWaysAlgnSegment(MapView mapview, Point p)
-	throws IllegalArgumentException {
-		super(mapview, p);
-		setSegment(getNearestWaySegment(p));
-		segmentColor = Color.ORANGE;
-	}
-
-	/**
-	 * Sets segment and initialises its pivot list and activates the centre
-	 * rotation pivot.
-	 */
-	@Override
-	public void setSegment(WaySegment segment) {
-		super.setSegment(segment);
-		setPivots();
-	}
-
-	/**
-	 * Useful when segments moves (or e.g. rotates) on the map. Updates the end
-	 * segment points and the pivot coordinates without changing the current
-	 * pivot.
-	 */
-	public void updatePivotsEndpoints() {
-		setPivots(currPivot);
-		setSegmentEndpoints(segment);
-	}
-
-	/**
-	 * Updates the segment's pivot list and sets the rotation pivot to centre.
-	 */
-	private void setPivots(PivotLocations pivotRef) {
-		if (segment != null) {
-			for (PivotLocations pl : PivotLocations.values()) {
-				pivotList.put(pl, getPivotCoord(pl));
-			}
-			setPivotReference(pivotRef);
-		} else {
-			setPivotReference(PivotLocations.NONE);
-		}
-	}
-
-	private void setPivots() {
-		setPivots(PivotLocations.CENTRE);
-	}
-
-	private void setPivotReference(PivotLocations pp) {
-		currPivot = pp;
-	}
-
-	/**
-	 * Returns the EastNorth of the specified pivot point pp. It always returns
-	 * up-to-date data from dataset. Assumes segment is not null.
-	 * 
-	 * @param pp
-	 *            The pivot location
-	 */
-	private EastNorth getPivotCoord(PivotLocations pp) {
-		switch (pp) {
-		case NONE:
-			return null;
-		case NODE1:
-			return segment.way.getNode(segment.lowerIndex).getEastNorth();
-		case NODE2:
-			return segment.way.getNode(segment.lowerIndex + 1).getEastNorth();
-		case CENTRE:
-			return getPivotCoord(PivotLocations.NODE1).getCenter(
-					getPivotCoord(PivotLocations.NODE2));
-		default:
-			// Should never happen
-			return null;
-		}
-	}
-
-	/**
-	 * @return The EastNorth of the currently selected pivot.
-	 */
-	public EastNorth getCurrPivotCoord() {
-		if (segment != null)
-			return getPivotCoord(currPivot);
-		return null;
-	}
-
-	/**
-	 * @param clickedPoint
-	 *            Pivot may be updated in the vicinity of this point
-	 * @return true if a pivot is within reach on the segment, false otherwise
-	 */
-	public boolean updatePivot(Point clickedPoint) {
-		// tHQ Done.
-		PivotLocations tmpPivot = findNearbyPivot(clickedPoint);
-		if (tmpPivot != PivotLocations.NONE) {
-			setPivotReference(tmpPivot);
-			return true;
-		} else
-			return false;
-	}
-
-	private PivotLocations findNearbyPivot(Point clickedPoint) {
-		PivotLocations nearest = PivotLocations.NONE;
-		int snapDistance = NavigatableComponent.snapDistance;
-
-		// If no alignee selected yet, there's no point to carry on
-		if (segment == null)
-			return PivotLocations.NONE;
-
-		for (PivotLocations pl : PivotLocations.values()) {
-			if (pl.equals(PivotLocations.NONE)) {
-				continue;
-			}
-			if (mapview.getPoint(pivotList.get(pl)).distance(clickedPoint) <= snapDistance) {
-				nearest = pl;
-				break;
-			}
-		}
-		return nearest;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.openstreetmap.josm.plugins.alignways.AlignWaysRefSegment#paint(java
-	 * .awt.Graphics2D, org.openstreetmap.josm.gui.MapView,
-	 * org.openstreetmap.josm.data.Bounds)
-	 */
-	@Override
-	public void paint(Graphics2D g, MapView mv, Bounds bbox) {
-		// Note: segment should never be null here
-		super.paint(g, mv, bbox);
-
-		// Highlight potential pivot points
-		for (PivotLocations pl : PivotLocations.values()) {
-			if (pl != PivotLocations.NONE) {
-				highlightCross(g, mv, pivotList.get(pl));
-			}
-		}
-
-		// Highlight active pivot
-		highlightPivot(g, mv, getPivotCoord(currPivot));
-
-	}
-
-	private void highlightPivot(Graphics2D g, MapView mv, EastNorth pivot) {
-		g.setColor(pivotColor);
-		g.setStroke(new BasicStroke());
-
-		Shape pvCentrePoint = new Ellipse2D.Double(
-				mv.getPoint(pivot).getX() - 5.0f,
-				mv.getPoint(pivot).getY() - 5.0f, 10.0f, 10.0f);
-		g.fill(pvCentrePoint);
-		Shape pvPoint = new Ellipse2D.Double(mv.getPoint(pivot).getX() - 8.0f,
-				mv.getPoint(pivot).getY() - 8.0f, 16.0f, 16.0f);
-
-		g.draw(pvCentrePoint);
-		g.draw(pvPoint);
-	}
-
-	private void highlightCross(Graphics2D g, MapView mv, EastNorth en) {
-
-		double crossX = mv.getPoint(en).getX();
-		double crossY = mv.getPoint(en).getY();
-		double crossSize = 10.0;
-
-		Line2D crossV = new Line2D.Double(crossX, crossY - crossSize, crossX,
-				crossY + crossSize);
-		Line2D crossH = new Line2D.Double(crossX - crossSize, crossY, crossX
-				+ crossSize, crossY);
-
-		g.setColor(crossColor);
-		g.setStroke(new BasicStroke());
-		g.draw(crossV);
-		g.draw(crossH);
-
-	}
+    private enum PivotLocations {
+        NONE, NODE1, NODE2, CENTRE
+    };
+
+    private PivotLocations currPivot;
+    Map<PivotLocations, EastNorth> pivotList = new EnumMap<PivotLocations, EastNorth>(
+            PivotLocations.class);
+    private final Color pivotColor = Color.YELLOW;
+    private final Color crossColor = pivotColor;
+
+    public AlignWaysAlgnSegment(MapView mapview, Point p)
+    throws IllegalArgumentException {
+        super(mapview, p);
+        setSegment(getNearestWaySegment(p));
+        segmentColor = Color.ORANGE;
+    }
+
+    /**
+     * Sets segment and initialises its pivot list and activates the centre
+     * rotation pivot.
+     */
+    @Override
+    public void setSegment(WaySegment segment) {
+        super.setSegment(segment);
+        setPivots();
+    }
+
+    /**
+     * Useful when segments moves (or e.g. rotates) on the map. Updates the end
+     * segment points and the pivot coordinates without changing the current
+     * pivot.
+     */
+    public void updatePivotsEndpoints() {
+        setPivots(currPivot);
+        setSegmentEndpoints(segment);
+    }
+
+    /**
+     * Updates the segment's pivot list and sets the rotation pivot to centre.
+     */
+    private void setPivots(PivotLocations pivotRef) {
+        if (segment != null) {
+            for (PivotLocations pl : PivotLocations.values()) {
+                pivotList.put(pl, getPivotCoord(pl));
+            }
+            setPivotReference(pivotRef);
+        } else {
+            setPivotReference(PivotLocations.NONE);
+        }
+    }
+
+    private void setPivots() {
+        setPivots(PivotLocations.CENTRE);
+    }
+
+    private void setPivotReference(PivotLocations pp) {
+        currPivot = pp;
+    }
+
+    /**
+     * Returns the EastNorth of the specified pivot point pp. It always returns
+     * up-to-date data from dataset. Assumes segment is not null.
+     * 
+     * @param pp
+     *            The pivot location
+     */
+    private EastNorth getPivotCoord(PivotLocations pp) {
+        switch (pp) {
+        case NONE:
+            return null;
+        case NODE1:
+            return segment.way.getNode(segment.lowerIndex).getEastNorth();
+        case NODE2:
+            return segment.way.getNode(segment.lowerIndex + 1).getEastNorth();
+        case CENTRE:
+            return getPivotCoord(PivotLocations.NODE1).getCenter(
+                    getPivotCoord(PivotLocations.NODE2));
+        default:
+            // Should never happen
+            return null;
+        }
+    }
+
+    /**
+     * @return The EastNorth of the currently selected pivot.
+     */
+    public EastNorth getCurrPivotCoord() {
+        if (segment != null)
+            return getPivotCoord(currPivot);
+        return null;
+    }
+
+    /**
+     * @param clickedPoint
+     *            Pivot may be updated in the vicinity of this point
+     * @return true if a pivot is within reach on the segment, false otherwise
+     */
+    public boolean updatePivot(Point clickedPoint) {
+        // tHQ Done.
+        PivotLocations tmpPivot = findNearbyPivot(clickedPoint);
+        if (tmpPivot != PivotLocations.NONE) {
+            setPivotReference(tmpPivot);
+            return true;
+        } else
+            return false;
+    }
+
+    private PivotLocations findNearbyPivot(Point clickedPoint) {
+        PivotLocations nearest = PivotLocations.NONE;
+        int snapDistance = NavigatableComponent.snapDistance;
+
+        // If no alignee selected yet, there's no point to carry on
+        if (segment == null)
+            return PivotLocations.NONE;
+
+        for (PivotLocations pl : PivotLocations.values()) {
+            if (pl.equals(PivotLocations.NONE)) {
+                continue;
+            }
+            if (mapview.getPoint(pivotList.get(pl)).distance(clickedPoint) <= snapDistance) {
+                nearest = pl;
+                break;
+            }
+        }
+        return nearest;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.openstreetmap.josm.plugins.alignways.AlignWaysRefSegment#paint(java
+     * .awt.Graphics2D, org.openstreetmap.josm.gui.MapView,
+     * org.openstreetmap.josm.data.Bounds)
+     */
+    @Override
+    public void paint(Graphics2D g, MapView mv, Bounds bbox) {
+        // Note: segment should never be null here
+        super.paint(g, mv, bbox);
+
+        // Highlight potential pivot points
+        for (PivotLocations pl : PivotLocations.values()) {
+            if (pl != PivotLocations.NONE) {
+                highlightCross(g, mv, pivotList.get(pl));
+            }
+        }
+
+        // Highlight active pivot
+        highlightPivot(g, mv, getPivotCoord(currPivot));
+
+    }
+
+    private void highlightPivot(Graphics2D g, MapView mv, EastNorth pivot) {
+        g.setColor(pivotColor);
+        g.setStroke(new BasicStroke());
+
+        Shape pvCentrePoint = new Ellipse2D.Double(
+                mv.getPoint(pivot).getX() - 5.0f,
+                mv.getPoint(pivot).getY() - 5.0f, 10.0f, 10.0f);
+        g.fill(pvCentrePoint);
+        Shape pvPoint = new Ellipse2D.Double(mv.getPoint(pivot).getX() - 8.0f,
+                mv.getPoint(pivot).getY() - 8.0f, 16.0f, 16.0f);
+
+        g.draw(pvCentrePoint);
+        g.draw(pvPoint);
+    }
+
+    private void highlightCross(Graphics2D g, MapView mv, EastNorth en) {
+
+        double crossX = mv.getPoint(en).getX();
+        double crossY = mv.getPoint(en).getY();
+        double crossSize = 10.0;
+
+        Line2D crossV = new Line2D.Double(crossX, crossY - crossSize, crossX,
+                crossY + crossSize);
+        Line2D crossH = new Line2D.Double(crossX - crossSize, crossY, crossX
+                + crossSize, crossY);
+
+        g.setColor(crossColor);
+        g.setStroke(new BasicStroke());
+        g.draw(crossV);
+        g.draw(crossH);
+
+    }
 
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysPlugin.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysPlugin.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysPlugin.java	(revision 23189)
@@ -20,44 +20,44 @@
 public class AlignWaysPlugin extends Plugin {
 
-	static AlignWaysMode awMode;
-	private final IconToggleButton btn;
-	static JMenuItem alignWaysMenuItem;
-	static JosmAction awAction;
+    static AlignWaysMode awMode;
+    private final IconToggleButton btn;
+    static JMenuItem alignWaysMenuItem;
+    static JosmAction awAction;
 
-	/**
-	 * 
-	 */
-	public AlignWaysPlugin(PluginInformation info) {
-		super(info);
-		awMode = new AlignWaysMode(Main.map, "alignways", tr("Align Ways mode"));
-		btn = new IconToggleButton(awMode);
-		btn.setVisible(true);
-		Main.main.menu.toolsMenu.addSeparator();
-		awAction = new AlignWaysAction();
-		alignWaysMenuItem = MainMenu.add(Main.main.menu.toolsMenu, awAction);
-		Main.main.menu.toolsMenu.addSeparator();
+    /**
+     * 
+     */
+    public AlignWaysPlugin(PluginInformation info) {
+        super(info);
+        awMode = new AlignWaysMode(Main.map, "alignways", tr("Align Ways mode"));
+        btn = new IconToggleButton(awMode);
+        btn.setVisible(true);
+        Main.main.menu.toolsMenu.addSeparator();
+        awAction = new AlignWaysAction();
+        alignWaysMenuItem = MainMenu.add(Main.main.menu.toolsMenu, awAction);
+        Main.main.menu.toolsMenu.addSeparator();
 
-	}
+    }
 
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if (Main.map != null) {
-			Main.map.addMapMode(btn);
-		}
-	}
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (Main.map != null) {
+            Main.map.addMapMode(btn);
+        }
+    }
 
-	/**
-	 * @return the awAction
-	 */
-	public static JosmAction getAwAction() {
-		return awAction;
-	}
+    /**
+     * @return the awAction
+     */
+    public static JosmAction getAwAction() {
+        return awAction;
+    }
 
-	/**
-	 * @return the awMode
-	 */
-	public static AlignWaysMode getAwMode() {
-		return awMode;
-	}
+    /**
+     * @return the awMode
+     */
+    public static AlignWaysMode getAwMode() {
+        return awMode;
+    }
 
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysRefSegment.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysRefSegment.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysRefSegment.java	(revision 23189)
@@ -15,13 +15,13 @@
 public class AlignWaysRefSegment extends AlignWaysSegment {
 
-	// Note: segment may be null. This is normal.
+    // Note: segment may be null. This is normal.
 
-	public AlignWaysRefSegment(MapView mapview, Point p)
-	throws IllegalArgumentException {
-		super(mapview, p);
-		setSegment(getNearestWaySegment(p));
-		segmentColor = Color.GREEN;
+    public AlignWaysRefSegment(MapView mapview, Point p)
+    throws IllegalArgumentException {
+        super(mapview, p);
+        setSegment(getNearestWaySegment(p));
+        segmentColor = Color.GREEN;
 
-	}
+    }
 
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysRotateCommand.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysRotateCommand.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysRotateCommand.java	(revision 23189)
@@ -32,218 +32,218 @@
 public class AlignWaysRotateCommand extends Command {
 
-	private final AlignWaysAlgnSegment algnSeg;
-
-	/**
-	 * The objects to rotate.
-	 */
-	private Collection<Node> nodes = new HashSet<Node>();
-
-	/**
-	 * pivot point
-	 */
-	private final EastNorth pivot;
-
-	/**
-	 * Small helper for holding the interesting part of the old data state of
-	 * the objects.
-	 */
-	public static class OldState {
-		LatLon latlon;
-		EastNorth eastNorth;
-		WaySegment ws;
-		boolean modified;
-	}
-
-	/**
-	 * computed rotation angle to rotate the segment
-	 * 
-	 */
-	private final double rotationAngle;
-
-	/**
-	 * List of all old states of the objects.
-	 */
-	private final Map<Node, OldState> oldState = new HashMap<Node, OldState>();
-	private final Stack<WaySegment> oldWS = new Stack<WaySegment>();
-
-	/**
-	 * Creates an AlignWaysRotateCommand.
-	 */
-	public AlignWaysRotateCommand() {
-
-		algnSeg = AlignWaysSegmentMgr.getInstance(Main.map.mapView)
-		.getAlgnSeg();
-		WaySegment algnWS = algnSeg.getSegment();
-		WaySegment refWS = AlignWaysSegmentMgr.getInstance(Main.map.mapView)
-		.getRefSeg().getSegment();
-
-		this.pivot = algnSeg.getCurrPivotCoord();
-		this.nodes = algnSeg.getSegmentEndPoints();
-
-		EastNorth enRefNode1 = refWS.way.getNode(refWS.lowerIndex)
-		.getEastNorth();
-		EastNorth enRefNode2 = refWS.way.getNode(refWS.lowerIndex + 1)
-		.getEastNorth();
-
-		EastNorth enAlgnNode1 = algnWS.way.getNode(algnWS.lowerIndex)
-		.getEastNorth();
-		EastNorth enAlgnNode2 = algnWS.way.getNode(algnWS.lowerIndex + 1)
-		.getEastNorth();
-
-		// Calculate the rotation angle
-		double refAngle = Math.atan2(enRefNode1.north() - enRefNode2.north(),
-				enRefNode1.east() - enRefNode2.east());
-		double algnAngle = Math.atan2(
-				enAlgnNode1.north() - enAlgnNode2.north(), enAlgnNode1.east()
-				- enAlgnNode2.east());
-
-		rotationAngle = normalise_angle(refAngle - algnAngle);
-
-		/* For debug only
-		String s = "Ref Angle: " + refAngle + " (" + Math.toDegrees(refAngle)
-				+ ")\n";
-		s += "Algn Angle: " + algnAngle + " (" + Math.toDegrees(algnAngle)
-				+ ")\n";
-		s += "Rotation angle: " + rotationAngle + " ("
-				+ Math.toDegrees(rotationAngle) + ")";
-		 */
-
-		// rotateNodes(true);
-
-	}
-
-	/**
-	 * Helper for actually rotating the nodes.
-	 * 
-	 * @param setModified
-	 *            - true if rotated nodes should be flagged "modified"
-	 */
-	private void rotateNodes(boolean setModified) {
-
-		// "Backup" state
-		WaySegment algnWS = algnSeg.getSegment();
-		for (Node n : this.nodes) {
-			OldState os = new OldState();
-			os.latlon = new LatLon(n.getCoor());
-			os.eastNorth = n.getEastNorth();
-			os.ws = algnWS;
-			os.modified = n.isModified();
-			oldState.put(n, os);
-		}
-		oldWS.push(algnWS);
-
-		// Rotate
-		for (Node n : nodes) {
-			double cosPhi = Math.cos(rotationAngle);
-			double sinPhi = Math.sin(rotationAngle);
-			EastNorth oldEastNorth = oldState.get(n).eastNorth;
-			double x = oldEastNorth.east() - pivot.east();
-			double y = oldEastNorth.north() - pivot.north();
-			double nx = cosPhi * x - sinPhi * y + pivot.east();
-			double ny = sinPhi * x + cosPhi * y + pivot.north();
-			n.setEastNorth(new EastNorth(nx, ny));
-			if (setModified) {
-				n.setModified(true);
-			}
-		}
-		algnSeg.updatePivotsEndpoints();
-	}
-
-	/**
-	 * Make sure angle is in interval ( -Pi/2, Pi/2 ].
-	 */
-	private static double normalise_angle(double a) {
-		while (a > Math.PI) {
-			a -= 2 * Math.PI;
-		}
-		while (a <= -Math.PI) {
-			a += 2 * Math.PI;
-		}
-
-		if (a > Math.PI / 2) {
-			a -= Math.PI;
-		} else if (a < -Math.PI / 2) {
-			a += Math.PI;
-		}
-		return a;
-	}
-
-	@Override
-	public JLabel getDescription() {
-		return new JLabel(tr("Align way segment"), ImageProvider.get(
-				"", "alignways"), SwingConstants.HORIZONTAL);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * org.openstreetmap.josm.command.Command#fillModifiedData(java.util.Collection
-	 * , java.util.Collection, java.util.Collection)
-	 */
-	@Override
-	public void fillModifiedData(Collection<OsmPrimitive> modified,
-			Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) {
-		for (OsmPrimitive osm : nodes) {
-			modified.add(osm);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.openstreetmap.josm.command.Command#executeCommand()
-	 */
-	@Override
-	public boolean executeCommand() {
-		rotateNodes(true);
-		return true;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.openstreetmap.josm.command.Command#undoCommand()
-	 */
-	@Override
-	public void undoCommand() {
-		for (Node n : nodes) {
-			OldState os = oldState.get(n);
-			n.setCoor(os.latlon);
-			n.setModified(os.modified);
-		}
-		algnSeg.updatePivotsEndpoints();
-	}
-
-	public Collection<Node> getRotatedNodes() {
-		return nodes;
-	}
-
-	/** Returns true if the two selected segments are alignable.
-	 *  They are not if they are connected *and* the pivot is not the connection node.
-	 */
-	public boolean areSegsAlignable() {
-		Collection<Node> algnNodes = nodes;
-		Collection<Node> refNodes = AlignWaysSegmentMgr.getInstance(Main.map.mapView)
-		.getRefSeg().getSegmentEndPoints();
-
-		// First check if the pivot node of the alignee exists in the reference:
-		// in this case the pivot is the shared node and alignment is possible
-		for (Node nR : refNodes) {
-			if (nR.getEastNorth().equals(pivot))
-				return true;
-		}
-
-		// Otherwise if the segments are connected, alignment is not possible
-		for (Node nA : algnNodes) {
-			for (Node nR : refNodes) {
-				if (nA.equals(nR))
-					return false;
-			}
-		}
-
-		// In all other cases alignment is possible
-		return true;
-	}
+    private final AlignWaysAlgnSegment algnSeg;
+
+    /**
+     * The objects to rotate.
+     */
+    private Collection<Node> nodes = new HashSet<Node>();
+
+    /**
+     * pivot point
+     */
+    private final EastNorth pivot;
+
+    /**
+     * Small helper for holding the interesting part of the old data state of
+     * the objects.
+     */
+    public static class OldState {
+        LatLon latlon;
+        EastNorth eastNorth;
+        WaySegment ws;
+        boolean modified;
+    }
+
+    /**
+     * computed rotation angle to rotate the segment
+     * 
+     */
+    private final double rotationAngle;
+
+    /**
+     * List of all old states of the objects.
+     */
+    private final Map<Node, OldState> oldState = new HashMap<Node, OldState>();
+    private final Stack<WaySegment> oldWS = new Stack<WaySegment>();
+
+    /**
+     * Creates an AlignWaysRotateCommand.
+     */
+    public AlignWaysRotateCommand() {
+
+        algnSeg = AlignWaysSegmentMgr.getInstance(Main.map.mapView)
+        .getAlgnSeg();
+        WaySegment algnWS = algnSeg.getSegment();
+        WaySegment refWS = AlignWaysSegmentMgr.getInstance(Main.map.mapView)
+        .getRefSeg().getSegment();
+
+        this.pivot = algnSeg.getCurrPivotCoord();
+        this.nodes = algnSeg.getSegmentEndPoints();
+
+        EastNorth enRefNode1 = refWS.way.getNode(refWS.lowerIndex)
+        .getEastNorth();
+        EastNorth enRefNode2 = refWS.way.getNode(refWS.lowerIndex + 1)
+        .getEastNorth();
+
+        EastNorth enAlgnNode1 = algnWS.way.getNode(algnWS.lowerIndex)
+        .getEastNorth();
+        EastNorth enAlgnNode2 = algnWS.way.getNode(algnWS.lowerIndex + 1)
+        .getEastNorth();
+
+        // Calculate the rotation angle
+        double refAngle = Math.atan2(enRefNode1.north() - enRefNode2.north(),
+                enRefNode1.east() - enRefNode2.east());
+        double algnAngle = Math.atan2(
+                enAlgnNode1.north() - enAlgnNode2.north(), enAlgnNode1.east()
+                - enAlgnNode2.east());
+
+        rotationAngle = normalise_angle(refAngle - algnAngle);
+
+        /* For debug only
+        String s = "Ref Angle: " + refAngle + " (" + Math.toDegrees(refAngle)
+                + ")\n";
+        s += "Algn Angle: " + algnAngle + " (" + Math.toDegrees(algnAngle)
+                + ")\n";
+        s += "Rotation angle: " + rotationAngle + " ("
+                + Math.toDegrees(rotationAngle) + ")";
+         */
+
+        // rotateNodes(true);
+
+    }
+
+    /**
+     * Helper for actually rotating the nodes.
+     * 
+     * @param setModified
+     *            - true if rotated nodes should be flagged "modified"
+     */
+    private void rotateNodes(boolean setModified) {
+
+        // "Backup" state
+        WaySegment algnWS = algnSeg.getSegment();
+        for (Node n : this.nodes) {
+            OldState os = new OldState();
+            os.latlon = new LatLon(n.getCoor());
+            os.eastNorth = n.getEastNorth();
+            os.ws = algnWS;
+            os.modified = n.isModified();
+            oldState.put(n, os);
+        }
+        oldWS.push(algnWS);
+
+        // Rotate
+        for (Node n : nodes) {
+            double cosPhi = Math.cos(rotationAngle);
+            double sinPhi = Math.sin(rotationAngle);
+            EastNorth oldEastNorth = oldState.get(n).eastNorth;
+            double x = oldEastNorth.east() - pivot.east();
+            double y = oldEastNorth.north() - pivot.north();
+            double nx = cosPhi * x - sinPhi * y + pivot.east();
+            double ny = sinPhi * x + cosPhi * y + pivot.north();
+            n.setEastNorth(new EastNorth(nx, ny));
+            if (setModified) {
+                n.setModified(true);
+            }
+        }
+        algnSeg.updatePivotsEndpoints();
+    }
+
+    /**
+     * Make sure angle is in interval ( -Pi/2, Pi/2 ].
+     */
+    private static double normalise_angle(double a) {
+        while (a > Math.PI) {
+            a -= 2 * Math.PI;
+        }
+        while (a <= -Math.PI) {
+            a += 2 * Math.PI;
+        }
+
+        if (a > Math.PI / 2) {
+            a -= Math.PI;
+        } else if (a < -Math.PI / 2) {
+            a += Math.PI;
+        }
+        return a;
+    }
+
+    @Override
+    public JLabel getDescription() {
+        return new JLabel(tr("Align way segment"), ImageProvider.get(
+                "", "alignways"), SwingConstants.HORIZONTAL);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.openstreetmap.josm.command.Command#fillModifiedData(java.util.Collection
+     * , java.util.Collection, java.util.Collection)
+     */
+    @Override
+    public void fillModifiedData(Collection<OsmPrimitive> modified,
+            Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) {
+        for (OsmPrimitive osm : nodes) {
+            modified.add(osm);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.openstreetmap.josm.command.Command#executeCommand()
+     */
+    @Override
+    public boolean executeCommand() {
+        rotateNodes(true);
+        return true;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.openstreetmap.josm.command.Command#undoCommand()
+     */
+    @Override
+    public void undoCommand() {
+        for (Node n : nodes) {
+            OldState os = oldState.get(n);
+            n.setCoor(os.latlon);
+            n.setModified(os.modified);
+        }
+        algnSeg.updatePivotsEndpoints();
+    }
+
+    public Collection<Node> getRotatedNodes() {
+        return nodes;
+    }
+
+    /** Returns true if the two selected segments are alignable.
+     *  They are not if they are connected *and* the pivot is not the connection node.
+     */
+    public boolean areSegsAlignable() {
+        Collection<Node> algnNodes = nodes;
+        Collection<Node> refNodes = AlignWaysSegmentMgr.getInstance(Main.map.mapView)
+        .getRefSeg().getSegmentEndPoints();
+
+        // First check if the pivot node of the alignee exists in the reference:
+        // in this case the pivot is the shared node and alignment is possible
+        for (Node nR : refNodes) {
+            if (nR.getEastNorth().equals(pivot))
+                return true;
+        }
+
+        // Otherwise if the segments are connected, alignment is not possible
+        for (Node nA : algnNodes) {
+            for (Node nR : refNodes) {
+                if (nA.equals(nR))
+                    return false;
+            }
+        }
+
+        // In all other cases alignment is possible
+        return true;
+    }
 
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSegment.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSegment.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSegment.java	(revision 23189)
@@ -27,125 +27,125 @@
 public class AlignWaysSegment implements MapViewPaintable {
 
-	protected WaySegment segment;
-	protected MapView mapview;
-	protected Color segmentColor = Color.WHITE;
-	protected Collection<Node> segmentEndPoints;
+    protected WaySegment segment;
+    protected MapView mapview;
+    protected Color segmentColor = Color.WHITE;
+    protected Collection<Node> segmentEndPoints;
 
-	public AlignWaysSegment(MapView mapview, Point p)
-	throws IllegalArgumentException {
-		if (mapview == null)
-			throw new IllegalArgumentException(tr(
-					"Parameter ''{0}'' must not be null", "mapview"));
-		if (p == null)
-			throw new IllegalArgumentException(tr(
-					"Parameter ''{0}'' must not be null", "p"));
+    public AlignWaysSegment(MapView mapview, Point p)
+    throws IllegalArgumentException {
+        if (mapview == null)
+            throw new IllegalArgumentException(tr(
+                    "Parameter ''{0}'' must not be null", "mapview"));
+        if (p == null)
+            throw new IllegalArgumentException(tr(
+                    "Parameter ''{0}'' must not be null", "p"));
 
-		this.mapview = mapview;
-	}
+        this.mapview = mapview;
+    }
 
-	void setSegment(WaySegment segment) {
-		this.segment = segment;
-		if (segment != null) {
-			setSegmentEndpoints(segment);
-			mapview.addTemporaryLayer(this);
-		}
-	}
+    void setSegment(WaySegment segment) {
+        this.segment = segment;
+        if (segment != null) {
+            setSegmentEndpoints(segment);
+            mapview.addTemporaryLayer(this);
+        }
+    }
 
 
-	void setSegmentEndpoints(WaySegment segment) {
-		if (segment != null) {
-			Node node1 = segment.way.getNode(segment.lowerIndex);
-			Node node2 = segment.way.getNode(segment.lowerIndex + 1);
+    void setSegmentEndpoints(WaySegment segment) {
+        if (segment != null) {
+            Node node1 = segment.way.getNode(segment.lowerIndex);
+            Node node2 = segment.way.getNode(segment.lowerIndex + 1);
 
-			segmentEndPoints = new HashSet<Node>();
-			segmentEndPoints.add(node1);
-			segmentEndPoints.add(node2);
+            segmentEndPoints = new HashSet<Node>();
+            segmentEndPoints.add(node1);
+            segmentEndPoints.add(node2);
 
-		}
-	}
+        }
+    }
 
-	protected WaySegment getNearestWaySegment(Point p) {
+    protected WaySegment getNearestWaySegment(Point p) {
 
-		return mapview.getNearestWaySegment(p, OsmPrimitive.isUsablePredicate);
+        return mapview.getNearestWaySegment(p, OsmPrimitive.isUsablePredicate);
 
-	}
+    }
 
-	public void destroy() {
-		if (segment != null) {
-			mapview.removeTemporaryLayer(this);
-		}
-	}
+    public void destroy() {
+        if (segment != null) {
+            mapview.removeTemporaryLayer(this);
+        }
+    }
 
-	public WaySegment getSegment() {
-		return segment;
-	}
+    public WaySegment getSegment() {
+        return segment;
+    }
 
-	public Collection<Node> getSegmentEndPoints() {
-		return segmentEndPoints;
-	}
+    public Collection<Node> getSegmentEndPoints() {
+        return segmentEndPoints;
+    }
 
-	public void paint(Graphics2D g, MapView mv, Bounds bbox) {
-		highlightSegment(segmentColor, g, mv);
-	}
+    public void paint(Graphics2D g, MapView mv, Bounds bbox) {
+        highlightSegment(segmentColor, g, mv);
+    }
 
-	protected void highlightSegment(Color c, Graphics2D g, MapView mv) {
+    protected void highlightSegment(Color c, Graphics2D g, MapView mv) {
 
-		g.setColor(c);
-		g.setStroke(new BasicStroke(6, BasicStroke.CAP_ROUND,
-				BasicStroke.JOIN_ROUND));
-		drawSegment(g, mv);
+        g.setColor(c);
+        g.setStroke(new BasicStroke(6, BasicStroke.CAP_ROUND,
+                BasicStroke.JOIN_ROUND));
+        drawSegment(g, mv);
 
-	}
+    }
 
-	protected void drawSegment(Graphics2D g, MapView mv) {
-		Node n1 = segment.way.getNode(segment.lowerIndex);
-		Node n2 = segment.way.getNode(segment.lowerIndex + 1);
+    protected void drawSegment(Graphics2D g, MapView mv) {
+        Node n1 = segment.way.getNode(segment.lowerIndex);
+        Node n2 = segment.way.getNode(segment.lowerIndex + 1);
 
-		Line2D newline = new Line2D.Double(mv.getPoint(n1), mv.getPoint(n2));
-		g.draw(newline);
-	}
+        Line2D newline = new Line2D.Double(mv.getPoint(n1), mv.getPoint(n2));
+        g.draw(newline);
+    }
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.Object#hashCode()
-	 */
-	@Override
-	public int hashCode() {
-		final int prime = 31;
-		int result = 1;
-		result = prime * result + ((segment == null) ? 0 : segment.hashCode());
-		result = prime * result
-		+ ((segmentColor == null) ? 0 : segmentColor.hashCode());
-		return result;
-	}
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#hashCode()
+     */
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((segment == null) ? 0 : segment.hashCode());
+        result = prime * result
+        + ((segmentColor == null) ? 0 : segmentColor.hashCode());
+        return result;
+    }
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see java.lang.Object#equals(java.lang.Object)
-	 */
-	@Override
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (!(obj instanceof AlignWaysSegment))
-			return false;
-		AlignWaysSegment other = (AlignWaysSegment) obj;
-		if (segment == null) {
-			if (other.segment != null)
-				return false;
-		} else if (!segment.equals(other.segment))
-			return false;
-		/* Segment colour is ignored in comparison
-		if (segmentColor == null) {
-			if (other.segmentColor != null)
-				return false;
-		} else if (!segmentColor.equals(other.segmentColor))
-			return false;
-		 */
-		return true;
-	}
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (!(obj instanceof AlignWaysSegment))
+            return false;
+        AlignWaysSegment other = (AlignWaysSegment) obj;
+        if (segment == null) {
+            if (other.segment != null)
+                return false;
+        } else if (!segment.equals(other.segment))
+            return false;
+        /* Segment colour is ignored in comparison
+        if (segmentColor == null) {
+            if (other.segmentColor != null)
+                return false;
+        } else if (!segmentColor.equals(other.segmentColor))
+            return false;
+         */
+        return true;
+    }
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSegmentMgr.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSegmentMgr.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSegmentMgr.java	(revision 23189)
@@ -22,140 +22,140 @@
 public class AlignWaysSegmentMgr {
 
-	private volatile static AlignWaysSegmentMgr singleton;
-	private AlignWaysRefSegment refSeg = null;
-	private AlignWaysAlgnSegment algnSeg = null;
-	private final MapView mv;
+    private volatile static AlignWaysSegmentMgr singleton;
+    private AlignWaysRefSegment refSeg = null;
+    private AlignWaysAlgnSegment algnSeg = null;
+    private final MapView mv;
 
-	private AlignWaysSegmentMgr(MapView mapView) {
-		mv = mapView;
-	}
+    private AlignWaysSegmentMgr(MapView mapView) {
+        mv = mapView;
+    }
 
-	public static AlignWaysSegmentMgr getInstance(MapView mapView) {
-		if (singleton == null) {
-			synchronized (AlignWaysSegmentMgr.class) {
-				if (singleton == null) {
-					singleton = new AlignWaysSegmentMgr(mapView);
-				}
-			}
-		}
-		return singleton;
-	}
+    public static AlignWaysSegmentMgr getInstance(MapView mapView) {
+        if (singleton == null) {
+            synchronized (AlignWaysSegmentMgr.class) {
+                if (singleton == null) {
+                    singleton = new AlignWaysSegmentMgr(mapView);
+                }
+            }
+        }
+        return singleton;
+    }
 
-	/**
-	 * @param clickedPoint
-	 *            Point nearby where user probably clicked
-	 * @return true, if alignee changed, false otherwise
-	 */
-	public boolean algnUpdate(Point clickedPoint) {
+    /**
+     * @param clickedPoint
+     *            Point nearby where user probably clicked
+     * @return true, if alignee changed, false otherwise
+     */
+    public boolean algnUpdate(Point clickedPoint) {
 
-		if (algnSeg != null) {
-			// Check first if there is a pivot point nearby that needs selection
-			if (algnSeg.updatePivot(clickedPoint))
-				// Updated pivot, alignee reference unchanged
-				return false;
-		}
+        if (algnSeg != null) {
+            // Check first if there is a pivot point nearby that needs selection
+            if (algnSeg.updatePivot(clickedPoint))
+                // Updated pivot, alignee reference unchanged
+                return false;
+        }
 
-		// Previous attempt of pivot update unsuccessful, check alignee update
-		AlignWaysAlgnSegment tmpAlgnSeg = new AlignWaysAlgnSegment(mv,
-				clickedPoint);
-		if (tmpAlgnSeg.getSegment() == null)
-			return false;
-		else {
-			// Found a segment
-			// It may happen that the new segment is identical with the already
-			// selected reference:
-			if ((refSeg != null) && (tmpAlgnSeg.equals(refSeg))) {
-				// This action is then ignored (we won't clear the reference
-				// segment)
-				JOptionPane.showMessageDialog(Main.parent,
-						tr("Segment to be aligned cannot be the same with the reference segment.\n" +
-						"Please choose a different segment to be aligned."),
-						tr("AlignWayS message"), JOptionPane.WARNING_MESSAGE);
-				return false;
-			}
-			// This will be a new alignee, old alignee (if any) will be lost:
-			if (algnSeg != null) {
-				algnSeg.destroy();
-			}
+        // Previous attempt of pivot update unsuccessful, check alignee update
+        AlignWaysAlgnSegment tmpAlgnSeg = new AlignWaysAlgnSegment(mv,
+                clickedPoint);
+        if (tmpAlgnSeg.getSegment() == null)
+            return false;
+        else {
+            // Found a segment
+            // It may happen that the new segment is identical with the already
+            // selected reference:
+            if ((refSeg != null) && (tmpAlgnSeg.equals(refSeg))) {
+                // This action is then ignored (we won't clear the reference
+                // segment)
+                JOptionPane.showMessageDialog(Main.parent,
+                        tr("Segment to be aligned cannot be the same with the reference segment.\n" +
+                        "Please choose a different segment to be aligned."),
+                        tr("AlignWayS message"), JOptionPane.WARNING_MESSAGE);
+                return false;
+            }
+            // This will be a new alignee, old alignee (if any) will be lost:
+            if (algnSeg != null) {
+                algnSeg.destroy();
+            }
 
-			// Update alignee
-			algnSeg = tmpAlgnSeg;
+            // Update alignee
+            algnSeg = tmpAlgnSeg;
 
-			return true;
-		}
+            return true;
+        }
 
-	}
+    }
 
-	/**
-	 * @param clickedPoint
-	 *            Point nearby where user probably clicked
-	 * @return true, if reference changed, false otherwise
-	 */
-	public boolean refUpdate(Point clickedPoint) {
+    /**
+     * @param clickedPoint
+     *            Point nearby where user probably clicked
+     * @return true, if reference changed, false otherwise
+     */
+    public boolean refUpdate(Point clickedPoint) {
 
-		AlignWaysRefSegment tmpRefSeg = new AlignWaysRefSegment(mv,
-				clickedPoint);
-		// TODO Have to check what happens when refSeg wasn't null previously
-		if (tmpRefSeg.getSegment() == null)
-			return false;
-		else {
-			// Found a segment
-			// It may happen that the new segment is identical with the already
-			// selected alignee:
-			if ((algnSeg != null) && (tmpRefSeg.equals(algnSeg))) {
-				// This action is then ignored (we won't clear the alignee
-				// segment)
-				JOptionPane.showMessageDialog(Main.parent,
-						tr("Reference segment cannot be the same with the segment to be aligned.\n" +
-						"Please choose a different reference segment."),
-						tr("AlignWayS message"), JOptionPane.WARNING_MESSAGE);
-				return false;
-			}
-			// This will be a new reference, old reference (if any) will be lost:
-			if (refSeg != null) {
-				refSeg.destroy();
-			}
+        AlignWaysRefSegment tmpRefSeg = new AlignWaysRefSegment(mv,
+                clickedPoint);
+        // TODO Have to check what happens when refSeg wasn't null previously
+        if (tmpRefSeg.getSegment() == null)
+            return false;
+        else {
+            // Found a segment
+            // It may happen that the new segment is identical with the already
+            // selected alignee:
+            if ((algnSeg != null) && (tmpRefSeg.equals(algnSeg))) {
+                // This action is then ignored (we won't clear the alignee
+                // segment)
+                JOptionPane.showMessageDialog(Main.parent,
+                        tr("Reference segment cannot be the same with the segment to be aligned.\n" +
+                        "Please choose a different reference segment."),
+                        tr("AlignWayS message"), JOptionPane.WARNING_MESSAGE);
+                return false;
+            }
+            // This will be a new reference, old reference (if any) will be lost:
+            if (refSeg != null) {
+                refSeg.destroy();
+            }
 
-			// Update reference
-			refSeg = tmpRefSeg;
-			return true;
+            // Update reference
+            refSeg = tmpRefSeg;
+            return true;
 
-		}
+        }
 
-	}
+    }
 
-	/**
-	 * @return Collection of the nodes that belong to the selected alignee.
-	 */
-	public Collection<Node> getSelectedNodes() {
-		if (algnSeg != null)
-			return algnSeg.getSegmentEndPoints();
-		return null;
-	}
+    /**
+     * @return Collection of the nodes that belong to the selected alignee.
+     */
+    public Collection<Node> getSelectedNodes() {
+        if (algnSeg != null)
+            return algnSeg.getSegmentEndPoints();
+        return null;
+    }
 
-	/**
-	 * Performs "clean-up" on the initialised segments
-	 */
-	public void cleanupWays() {
-		if (algnSeg != null) {
-			algnSeg.destroy();
-			algnSeg = null;
-		}
-		if (refSeg != null) {
-			refSeg.destroy();
-			refSeg = null;
-		}
-	}
+    /**
+     * Performs "clean-up" on the initialised segments
+     */
+    public void cleanupWays() {
+        if (algnSeg != null) {
+            algnSeg.destroy();
+            algnSeg = null;
+        }
+        if (refSeg != null) {
+            refSeg.destroy();
+            refSeg = null;
+        }
+    }
 
-	public AlignWaysAlgnSegment getAlgnSeg() {
-		return algnSeg;
-	}
+    public AlignWaysAlgnSegment getAlgnSeg() {
+        return algnSeg;
+    }
 
-	/**
-	 * @return the refSeg
-	 */
-	public AlignWaysRefSegment getRefSeg() {
-		return refSeg;
-	}
+    /**
+     * @return the refSeg
+     */
+    public AlignWaysRefSegment getRefSeg() {
+        return refSeg;
+    }
 
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelAlgnState.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelAlgnState.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelAlgnState.java	(revision 23189)
@@ -12,19 +12,19 @@
 public class AlignWaysSelAlgnState extends AlignWaysState {
 
-	@Override
-	public void leftClick(AlignWaysMode alignWaysMode) {
-		// No state change, nothing to do
-	}
+    @Override
+    public void leftClick(AlignWaysMode alignWaysMode) {
+        // No state change, nothing to do
+    }
 
-	@Override
-	public void ctrlLClick(AlignWaysMode alignWaysMode) {
-		alignWaysMode.setCurrentState(alignWaysMode.getBothSelected());
-	}
+    @Override
+    public void ctrlLClick(AlignWaysMode alignWaysMode) {
+        alignWaysMode.setCurrentState(alignWaysMode.getBothSelected());
+    }
 
-	@Override
-	public void setHelpText() {
-		Main.map.statusLine
-				.setHelpText("Ctrl-Click: select reference way segment; Alt-click: Clear selection");
-	}
+    @Override
+    public void setHelpText() {
+        Main.map.statusLine
+                .setHelpText("Ctrl-Click: select reference way segment; Alt-click: Clear selection");
+    }
 
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelBothState.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelBothState.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelBothState.java	(revision 23189)
@@ -12,20 +12,20 @@
 public class AlignWaysSelBothState extends AlignWaysState {
 
-	@Override
-	public void leftClick(AlignWaysMode alignWaysMode) {
-		// No state change, nothing to do
-	}
+    @Override
+    public void leftClick(AlignWaysMode alignWaysMode) {
+        // No state change, nothing to do
+    }
 
-	@Override
-	public void ctrlLClick(AlignWaysMode alignWaysMode) {
-		// No state change, nothing to do
-	}
+    @Override
+    public void ctrlLClick(AlignWaysMode alignWaysMode) {
+        // No state change, nothing to do
+    }
 
-	@Override
-	public void setHelpText() {
-		Main.map.statusLine
-		.setHelpText(AlignWaysPlugin.getAwAction().getShortcut().getKeyText() +
-				": Align segments; Alt-click: Clear selection");
-	}
+    @Override
+    public void setHelpText() {
+        Main.map.statusLine
+        .setHelpText(AlignWaysPlugin.getAwAction().getShortcut().getKeyText() +
+                ": Align segments; Alt-click: Clear selection");
+    }
 
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelNoneState.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelNoneState.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelNoneState.java	(revision 23189)
@@ -12,22 +12,22 @@
 public class AlignWaysSelNoneState extends AlignWaysState {
 
-	@Override
-	public void leftClick(AlignWaysMode alignWaysMode) {
-		// Reference way segment selected successfully
-		alignWaysMode.setCurrentState(alignWaysMode.getAligneeSelected());
+    @Override
+    public void leftClick(AlignWaysMode alignWaysMode) {
+        // Reference way segment selected successfully
+        alignWaysMode.setCurrentState(alignWaysMode.getAligneeSelected());
 
-	}
+    }
 
-	@Override
-	public void ctrlLClick(AlignWaysMode alignWaysMode) {
-		// Reference way segment selected successfully
-		alignWaysMode.setCurrentState(alignWaysMode.getReferenceSelected());
-	}
+    @Override
+    public void ctrlLClick(AlignWaysMode alignWaysMode) {
+        // Reference way segment selected successfully
+        alignWaysMode.setCurrentState(alignWaysMode.getReferenceSelected());
+    }
 
-	@Override
-	public void setHelpText() {
-		Main.map.statusLine
-		.setHelpText("Ctrl-click: select reference way segment; Click: select way segment to be aligned");
-	}
+    @Override
+    public void setHelpText() {
+        Main.map.statusLine
+        .setHelpText("Ctrl-click: select reference way segment; Click: select way segment to be aligned");
+    }
 
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelRefState.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelRefState.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysSelRefState.java	(revision 23189)
@@ -12,19 +12,19 @@
 public class AlignWaysSelRefState extends AlignWaysState {
 
-	@Override
-	public void leftClick(AlignWaysMode alignWaysMode) {
-		alignWaysMode.setCurrentState(alignWaysMode.getBothSelected());
-	}
+    @Override
+    public void leftClick(AlignWaysMode alignWaysMode) {
+        alignWaysMode.setCurrentState(alignWaysMode.getBothSelected());
+    }
 
-	@Override
-	public void ctrlLClick(AlignWaysMode alignWaysMode) {
-		// No state change, nothing to do
-	}
+    @Override
+    public void ctrlLClick(AlignWaysMode alignWaysMode) {
+        // No state change, nothing to do
+    }
 
-	@Override
-	public void setHelpText() {
-		Main.map.statusLine
-				.setHelpText("Click: select way segment to be aligned; Alt-click: Clear selection");
-	}
+    @Override
+    public void setHelpText() {
+        Main.map.statusLine
+                .setHelpText("Click: select way segment to be aligned; Alt-click: Clear selection");
+    }
 
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysState.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysState.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysState.java	(revision 23189)
@@ -12,15 +12,15 @@
 public abstract class AlignWaysState {
 
-	public abstract void leftClick(AlignWaysMode alignWaysMode);
+    public abstract void leftClick(AlignWaysMode alignWaysMode);
 
-	public abstract void ctrlLClick(AlignWaysMode alignWaysMode);
+    public abstract void ctrlLClick(AlignWaysMode alignWaysMode);
 
-	public abstract void setHelpText();
+    public abstract void setHelpText();
 
-	public void altLClick(AlignWaysMode alignWaysMode) {
-		alignWaysMode.setCurrentState(alignWaysMode.getNoneSelected());
-		Main.map.statusLine
-		.setHelpText("Ctrl-Click: select reference way segment; Click: select way segment to be aligned");
-	}
+    public void altLClick(AlignWaysMode alignWaysMode) {
+        alignWaysMode.setCurrentState(alignWaysMode.getNoneSelected());
+        Main.map.statusLine
+        .setHelpText("Ctrl-Click: select reference way segment; Click: select way segment to be aligned");
+    }
 
 }
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysTipsPanel.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysTipsPanel.java	(revision 23188)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysTipsPanel.java	(revision 23189)
@@ -27,180 +27,180 @@
 public class AlignWaysTipsPanel extends javax.swing.JPanel {
 
-	private static final long serialVersionUID = -8583989497599985140L;
-
-	public AlignWaysTipsPanel() {
-		initComponents();
-	}
-
-	private void initComponents() {
-
-		Title = new JPanel();
-		WelcomeTo = new JLabel();
-		Icon = new JLabel();
-		separator = new JSeparator();
-		Intro = new JPanel();
-		introText = new JLabel();
-		scrollableSteps = new JScrollPane();
-		steps = new JPanel();
-		step01 = new JLabel();
-		step02 = new JLabel();
-		step03 = new JLabel();
-		step04 = new JLabel();
-		lastHint = new JLabel();
-		dontShow = new JCheckBox();
-
-		setAutoscrolls(true);
-
-		WelcomeTo.setText(tr("<html>\n<div style=\"font-family: 'sans-serif'; font-weight: bold; font-style: italic;\">\n<span style=\"font-size: large;\">Welcome to the</span><br>\n<span style=\"font-size: xx-large;\">AlignWay<span style=\"color: rgb(204, 85, 0);\">S</span> Plugin<br>\n</span><span style=\"font-size: medium;\"><br>\n...or it rather should be called <br>\n<span style=\"font-size: large;\">AlignWayS(egments)</span> Plugin...</span>\n</div>\n</html>"));
-
-		WelcomeTo.setVerticalAlignment(SwingConstants.TOP);
-		WelcomeTo.setPreferredSize(new Dimension(400, 128));
-
-		Icon.setIcon(new ImageIcon(getClass().getResource("/images/tipsdialog/alignways128.png"))); // NOI18N
-		GroupLayout TitleLayout = new GroupLayout(Title);
-		Title.setLayout(TitleLayout);
-		TitleLayout.setHorizontalGroup(
-				TitleLayout.createParallelGroup(GroupLayout.LEADING)
-				.add(GroupLayout.TRAILING, TitleLayout.createSequentialGroup()
-						.add(WelcomeTo, GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)
-						.addPreferredGap(LayoutStyle.RELATED)
-						.add(Icon, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE))
-		);
-		TitleLayout.setVerticalGroup(
-				TitleLayout.createParallelGroup(GroupLayout.LEADING)
-				.add(TitleLayout.createSequentialGroup()
-						.add(Icon)
-						.addContainerGap())
-						.add(WelcomeTo, GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
-		);
-
-		Intro.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
-
-		introText.setText(tr("<html>\n<p style=\"font-family: sans-serif; font-weight: bold;\">AlignWays will\nhelp you to align two way segments. This can be handy when for instance\nyou sketch the outlines of a building and want its side to be parallel\nwith a street or road.<br>\n<br>\nSome tips may help before you start:\n</p>\n</html>\n\n"));
-		introText.setVerticalAlignment(SwingConstants.TOP);
-
-		scrollableSteps.setBorder(null);
-		scrollableSteps.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-
-		step01.setIcon(new ImageIcon(getClass().getResource("/images/tipsdialog/hlpRefSel.png"))); // NOI18N
-		step01.setText(tr("<html>\n<div style=\"font-family: sans-serif;\">\n<ul>\n<li><b>Select a reference segment.</b> You can do this by <b><i><span style=\"color:green\">Ctrl-click</span></i></b>ing\non a segment. The other, to be aligned segment will become parallel to\nthis one. </li>\n</ul>\n</div>\n</html>\n\n"));
-		step01.setVerticalAlignment(SwingConstants.TOP);
-
-		step02.setIcon(new ImageIcon(getClass().getResource("/images/tipsdialog/hlpAlgSel.png"))); // NOI18N
-		step02.setText(tr("<html>\n<div style=\"font-family:sans-serif\">\n<ul>\n  <li><b>Select the to be aligned segment.</b> You can do this by simply <b><i><span style=\"color:green\">click</span></i></b>ing on a different segment. \nThe rotation pivot will be highlighted by default in the centre of the segment.\n  </li>\n</ul>\n</div>\n</html>\n\n"));
-		step02.setVerticalAlignment(SwingConstants.TOP);
-
-		step03.setIcon(new ImageIcon(getClass().getResource("/images/tipsdialog/hlpPvtSel.png"))); // NOI18N
-		step03.setText(tr("<html>\n<div style=\"font-family:sans-serif\">\n<ul>\n  <li>Optionally <b>change the rotation pivot point</b>. In order to get parallel with the reference segment, the to be aligned segment will rotate around this point. You can choose the two extremities or the centre of the segment by <b><i><span style=\"color:green\">click</span></i></b>ing nearby. \n  </li>\n</ul>\n</div>\n</html>\n\n"));
-		step03.setVerticalAlignment(SwingConstants.TOP);
-
-		step04.setIcon(new ImageIcon(getClass().getResource("/images/tipsdialog/hlpAlgCmd.png"))); // NOI18N
-		step04.setText(tr("<html>\n<div style=\"font-family:sans-serif\">\n<ul>\n  <li><b>Align the segments.</b> Press <b><i><span style=\"color:green\">"
-				+ AlignWaysPlugin.awAction.getShortcut().getKeyText()
-				+ "</span></i></b>. Alternatively you''ll find the command in the <b>Tools</b>\n menu or may want to place the action on the <b>toolbar</b>.\n  </li>\n</ul>\n</div>\n</html>\n\n"));
-		step04.setVerticalAlignment(SwingConstants.TOP);
-
-		lastHint.setText(tr("<html>\n<div style=\"font-family:sans-serif\">\n<b>Last hint:</b> There is an easy way to start over your selections if you want: <b><i><span style=\"color:green\">Alt-Click</span></i></b> somewhere on the map.\n</div>\n</html>\n\n"));
-		lastHint.setVerticalAlignment(SwingConstants.TOP);
-
-		GroupLayout stepsLayout = new GroupLayout(steps);
-		steps.setLayout(stepsLayout);
-		stepsLayout.setHorizontalGroup(
-				stepsLayout.createParallelGroup(GroupLayout.LEADING)
-				.add(stepsLayout.createSequentialGroup()
-						.addContainerGap()
-						.add(stepsLayout.createParallelGroup(GroupLayout.TRAILING)
-								.add(GroupLayout.LEADING, lastHint, 0, 0, Short.MAX_VALUE)
-								.add(GroupLayout.LEADING, step04, 0, 0, Short.MAX_VALUE)
-								.add(GroupLayout.LEADING, step03, 0, 0, Short.MAX_VALUE)
-								.add(GroupLayout.LEADING, step02, 0, 0, Short.MAX_VALUE)
-								.add(GroupLayout.LEADING, step01, GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE))
-								.add(18, 18, 18))
-		);
-		stepsLayout.setVerticalGroup(
-				stepsLayout.createParallelGroup(GroupLayout.LEADING)
-				.add(stepsLayout.createSequentialGroup()
-						.add(step01, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-						.addPreferredGap(LayoutStyle.RELATED)
-						.add(step02, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-						.addPreferredGap(LayoutStyle.RELATED)
-						.add(step03, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-						.addPreferredGap(LayoutStyle.RELATED)
-						.add(step04, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-						.addPreferredGap(LayoutStyle.RELATED)
-						.add(lastHint, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-						.addContainerGap(22, Short.MAX_VALUE))
-		);
-
-		scrollableSteps.setViewportView(steps);
-
-		dontShow.setText(tr("Don''t show this again"));
-
-		GroupLayout IntroLayout = new GroupLayout(Intro);
-		Intro.setLayout(IntroLayout);
-		IntroLayout.setHorizontalGroup(
-				IntroLayout.createParallelGroup(GroupLayout.LEADING)
-				.add(IntroLayout.createSequentialGroup()
-						.addContainerGap()
-						.add(dontShow, GroupLayout.PREFERRED_SIZE, 245, GroupLayout.PREFERRED_SIZE)
-						.addContainerGap(283, Short.MAX_VALUE))
-						.add(scrollableSteps, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
-						.add(introText, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
-		);
-		IntroLayout.setVerticalGroup(
-				IntroLayout.createParallelGroup(GroupLayout.LEADING)
-				.add(GroupLayout.TRAILING, IntroLayout.createSequentialGroup()
-						.add(introText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-						.addPreferredGap(LayoutStyle.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-						.add(scrollableSteps, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE)
-						.addPreferredGap(LayoutStyle.UNRELATED)
-						.add(dontShow)
-						.addContainerGap())
-		);
-
-		GroupLayout layout = new GroupLayout(this);
-		this.setLayout(layout);
-		layout.setHorizontalGroup(
-				layout.createParallelGroup(GroupLayout.LEADING)
-				.add(GroupLayout.TRAILING, layout.createSequentialGroup()
-						.addContainerGap()
-						.add(layout.createParallelGroup(GroupLayout.TRAILING)
-								.add(GroupLayout.LEADING, separator, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
-								.add(Title, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-								.add(Intro, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
-								.addContainerGap())
-		);
-		layout.setVerticalGroup(
-				layout.createParallelGroup(GroupLayout.LEADING)
-				.add(layout.createSequentialGroup()
-						.addContainerGap()
-						.add(Title, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-						.addPreferredGap(LayoutStyle.UNRELATED)
-						.add(separator, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
-						.addPreferredGap(LayoutStyle.RELATED)
-						.add(Intro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-						.addContainerGap(45, Short.MAX_VALUE))
-		);
-	}
-
-
-	private JLabel Icon;
-	private JPanel Intro;
-	private JPanel Title;
-	private JLabel WelcomeTo;
-	private JCheckBox dontShow;
-	private JLabel introText;
-	private JLabel lastHint;
-	private JScrollPane scrollableSteps;
-	private JSeparator separator;
-	private JLabel step01;
-	private JLabel step02;
-	private JLabel step03;
-	private JLabel step04;
-	private JPanel steps;
-
-	public boolean isChkBoxSelected() {
-		return dontShow.isSelected();
-	}
+    private static final long serialVersionUID = -8583989497599985140L;
+
+    public AlignWaysTipsPanel() {
+        initComponents();
+    }
+
+    private void initComponents() {
+
+        Title = new JPanel();
+        WelcomeTo = new JLabel();
+        Icon = new JLabel();
+        separator = new JSeparator();
+        Intro = new JPanel();
+        introText = new JLabel();
+        scrollableSteps = new JScrollPane();
+        steps = new JPanel();
+        step01 = new JLabel();
+        step02 = new JLabel();
+        step03 = new JLabel();
+        step04 = new JLabel();
+        lastHint = new JLabel();
+        dontShow = new JCheckBox();
+
+        setAutoscrolls(true);
+
+        WelcomeTo.setText(tr("<html>\n<div style=\"font-family: 'sans-serif'; font-weight: bold; font-style: italic;\">\n<span style=\"font-size: large;\">Welcome to the</span><br>\n<span style=\"font-size: xx-large;\">AlignWay<span style=\"color: rgb(204, 85, 0);\">S</span> Plugin<br>\n</span><span style=\"font-size: medium;\"><br>\n...or it rather should be called <br>\n<span style=\"font-size: large;\">AlignWayS(egments)</span> Plugin...</span>\n</div>\n</html>"));
+
+        WelcomeTo.setVerticalAlignment(SwingConstants.TOP);
+        WelcomeTo.setPreferredSize(new Dimension(400, 128));
+
+        Icon.setIcon(new ImageIcon(getClass().getResource("/images/tipsdialog/alignways128.png"))); // NOI18N
+        GroupLayout TitleLayout = new GroupLayout(Title);
+        Title.setLayout(TitleLayout);
+        TitleLayout.setHorizontalGroup(
+                TitleLayout.createParallelGroup(GroupLayout.LEADING)
+                .add(GroupLayout.TRAILING, TitleLayout.createSequentialGroup()
+                        .add(WelcomeTo, GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE)
+                        .addPreferredGap(LayoutStyle.RELATED)
+                        .add(Icon, GroupLayout.PREFERRED_SIZE, 132, GroupLayout.PREFERRED_SIZE))
+        );
+        TitleLayout.setVerticalGroup(
+                TitleLayout.createParallelGroup(GroupLayout.LEADING)
+                .add(TitleLayout.createSequentialGroup()
+                        .add(Icon)
+                        .addContainerGap())
+                        .add(WelcomeTo, GroupLayout.DEFAULT_SIZE, 146, Short.MAX_VALUE)
+        );
+
+        Intro.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+
+        introText.setText(tr("<html>\n<p style=\"font-family: sans-serif; font-weight: bold;\">AlignWays will\nhelp you to align two way segments. This can be handy when for instance\nyou sketch the outlines of a building and want its side to be parallel\nwith a street or road.<br>\n<br>\nSome tips may help before you start:\n</p>\n</html>\n\n"));
+        introText.setVerticalAlignment(SwingConstants.TOP);
+
+        scrollableSteps.setBorder(null);
+        scrollableSteps.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+
+        step01.setIcon(new ImageIcon(getClass().getResource("/images/tipsdialog/hlpRefSel.png"))); // NOI18N
+        step01.setText(tr("<html>\n<div style=\"font-family: sans-serif;\">\n<ul>\n<li><b>Select a reference segment.</b> You can do this by <b><i><span style=\"color:green\">Ctrl-click</span></i></b>ing\non a segment. The other, to be aligned segment will become parallel to\nthis one. </li>\n</ul>\n</div>\n</html>\n\n"));
+        step01.setVerticalAlignment(SwingConstants.TOP);
+
+        step02.setIcon(new ImageIcon(getClass().getResource("/images/tipsdialog/hlpAlgSel.png"))); // NOI18N
+        step02.setText(tr("<html>\n<div style=\"font-family:sans-serif\">\n<ul>\n  <li><b>Select the to be aligned segment.</b> You can do this by simply <b><i><span style=\"color:green\">click</span></i></b>ing on a different segment. \nThe rotation pivot will be highlighted by default in the centre of the segment.\n  </li>\n</ul>\n</div>\n</html>\n\n"));
+        step02.setVerticalAlignment(SwingConstants.TOP);
+
+        step03.setIcon(new ImageIcon(getClass().getResource("/images/tipsdialog/hlpPvtSel.png"))); // NOI18N
+        step03.setText(tr("<html>\n<div style=\"font-family:sans-serif\">\n<ul>\n  <li>Optionally <b>change the rotation pivot point</b>. In order to get parallel with the reference segment, the to be aligned segment will rotate around this point. You can choose the two extremities or the centre of the segment by <b><i><span style=\"color:green\">click</span></i></b>ing nearby. \n  </li>\n</ul>\n</div>\n</html>\n\n"));
+        step03.setVerticalAlignment(SwingConstants.TOP);
+
+        step04.setIcon(new ImageIcon(getClass().getResource("/images/tipsdialog/hlpAlgCmd.png"))); // NOI18N
+        step04.setText(tr("<html>\n<div style=\"font-family:sans-serif\">\n<ul>\n  <li><b>Align the segments.</b> Press <b><i><span style=\"color:green\">"
+                + AlignWaysPlugin.awAction.getShortcut().getKeyText()
+                + "</span></i></b>. Alternatively you''ll find the command in the <b>Tools</b>\n menu or may want to place the action on the <b>toolbar</b>.\n  </li>\n</ul>\n</div>\n</html>\n\n"));
+        step04.setVerticalAlignment(SwingConstants.TOP);
+
+        lastHint.setText(tr("<html>\n<div style=\"font-family:sans-serif\">\n<b>Last hint:</b> There is an easy way to start over your selections if you want: <b><i><span style=\"color:green\">Alt-Click</span></i></b> somewhere on the map.\n</div>\n</html>\n\n"));
+        lastHint.setVerticalAlignment(SwingConstants.TOP);
+
+        GroupLayout stepsLayout = new GroupLayout(steps);
+        steps.setLayout(stepsLayout);
+        stepsLayout.setHorizontalGroup(
+                stepsLayout.createParallelGroup(GroupLayout.LEADING)
+                .add(stepsLayout.createSequentialGroup()
+                        .addContainerGap()
+                        .add(stepsLayout.createParallelGroup(GroupLayout.TRAILING)
+                                .add(GroupLayout.LEADING, lastHint, 0, 0, Short.MAX_VALUE)
+                                .add(GroupLayout.LEADING, step04, 0, 0, Short.MAX_VALUE)
+                                .add(GroupLayout.LEADING, step03, 0, 0, Short.MAX_VALUE)
+                                .add(GroupLayout.LEADING, step02, 0, 0, Short.MAX_VALUE)
+                                .add(GroupLayout.LEADING, step01, GroupLayout.DEFAULT_SIZE, 496, Short.MAX_VALUE))
+                                .add(18, 18, 18))
+        );
+        stepsLayout.setVerticalGroup(
+                stepsLayout.createParallelGroup(GroupLayout.LEADING)
+                .add(stepsLayout.createSequentialGroup()
+                        .add(step01, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(LayoutStyle.RELATED)
+                        .add(step02, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(LayoutStyle.RELATED)
+                        .add(step03, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(LayoutStyle.RELATED)
+                        .add(step04, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(LayoutStyle.RELATED)
+                        .add(lastHint, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                        .addContainerGap(22, Short.MAX_VALUE))
+        );
+
+        scrollableSteps.setViewportView(steps);
+
+        dontShow.setText(tr("Don''t show this again"));
+
+        GroupLayout IntroLayout = new GroupLayout(Intro);
+        Intro.setLayout(IntroLayout);
+        IntroLayout.setHorizontalGroup(
+                IntroLayout.createParallelGroup(GroupLayout.LEADING)
+                .add(IntroLayout.createSequentialGroup()
+                        .addContainerGap()
+                        .add(dontShow, GroupLayout.PREFERRED_SIZE, 245, GroupLayout.PREFERRED_SIZE)
+                        .addContainerGap(283, Short.MAX_VALUE))
+                        .add(scrollableSteps, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
+                        .add(introText, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
+        );
+        IntroLayout.setVerticalGroup(
+                IntroLayout.createParallelGroup(GroupLayout.LEADING)
+                .add(GroupLayout.TRAILING, IntroLayout.createSequentialGroup()
+                        .add(introText, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(LayoutStyle.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                        .add(scrollableSteps, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(LayoutStyle.UNRELATED)
+                        .add(dontShow)
+                        .addContainerGap())
+        );
+
+        GroupLayout layout = new GroupLayout(this);
+        this.setLayout(layout);
+        layout.setHorizontalGroup(
+                layout.createParallelGroup(GroupLayout.LEADING)
+                .add(GroupLayout.TRAILING, layout.createSequentialGroup()
+                        .addContainerGap()
+                        .add(layout.createParallelGroup(GroupLayout.TRAILING)
+                                .add(GroupLayout.LEADING, separator, GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE)
+                                .add(Title, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+                                .add(Intro, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+                                .addContainerGap())
+        );
+        layout.setVerticalGroup(
+                layout.createParallelGroup(GroupLayout.LEADING)
+                .add(layout.createSequentialGroup()
+                        .addContainerGap()
+                        .add(Title, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(LayoutStyle.UNRELATED)
+                        .add(separator, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
+                        .addPreferredGap(LayoutStyle.RELATED)
+                        .add(Intro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                        .addContainerGap(45, Short.MAX_VALUE))
+        );
+    }
+
+
+    private JLabel Icon;
+    private JPanel Intro;
+    private JPanel Title;
+    private JLabel WelcomeTo;
+    private JCheckBox dontShow;
+    private JLabel introText;
+    private JLabel lastHint;
+    private JScrollPane scrollableSteps;
+    private JSeparator separator;
+    private JLabel step01;
+    private JLabel step02;
+    private JLabel step03;
+    private JLabel step04;
+    private JPanel steps;
+
+    public boolean isChkBoxSelected() {
+        return dontShow.isSelected();
+    }
 
 }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java	(revision 23188)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java	(revision 23189)
@@ -35,133 +35,133 @@
 public class EditGpxLayer extends Layer {
 
-	private static Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(EditGpxPlugin.class.getResource("/images/editgpx_layer.png")));
-	public final EditGpxData data;
-	private GPXLayerImportAction layerImport;
+    private static Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(EditGpxPlugin.class.getResource("/images/editgpx_layer.png")));
+    public final EditGpxData data;
+    private GPXLayerImportAction layerImport;
 
-	public EditGpxLayer(String str, EditGpxData gpxData) {
-		super(str);
-		data = gpxData;
-		layerImport = new GPXLayerImportAction(data);
-	}
+    public EditGpxLayer(String str, EditGpxData gpxData) {
+        super(str);
+        data = gpxData;
+        layerImport = new GPXLayerImportAction(data);
+    }
 
-	/**
-	 * check if dataSet is empty
-	 * if so show import dialog to user
-	 */
-	public void initializeImport() {
-		try {
-			if(data.isEmpty()) {
-				layerImport.activateImport();
-			}
-		} catch (Exception e) {
-			System.out.println(e.getMessage());
-			e.printStackTrace();
-		}
-	}
+    /**
+     * check if dataSet is empty
+     * if so show import dialog to user
+     */
+    public void initializeImport() {
+        try {
+            if(data.isEmpty()) {
+                layerImport.activateImport();
+            }
+        } catch (Exception e) {
+            System.out.println(e.getMessage());
+            e.printStackTrace();
+        }
+    }
 
-	@Override
-	public Icon getIcon() {
-		return icon;
-	}
+    @Override
+    public Icon getIcon() {
+        return icon;
+    }
 
-	@Override
-	public Object getInfoComponent() {
-		return getToolTipText();
-	}
+    @Override
+    public Object getInfoComponent() {
+        return getToolTipText();
+    }
 
-	@Override
-	public Action[] getMenuEntries() {
-		return new Action[] {
-				LayerListDialog.getInstance().createShowHideLayerAction(),
-				LayerListDialog.getInstance().createDeleteLayerAction(),
-				SeparatorLayerAction.INSTANCE,
-				layerImport,
-				new ConvertToGpxLayerAction(),
-				new ConvertToAnonTimeGpxLayerAction(),
-				SeparatorLayerAction.INSTANCE,
-				new LayerListPopup.InfoAction(this)};
-	}
+    @Override
+    public Action[] getMenuEntries() {
+        return new Action[] {
+                LayerListDialog.getInstance().createShowHideLayerAction(),
+                LayerListDialog.getInstance().createDeleteLayerAction(),
+                SeparatorLayerAction.INSTANCE,
+                layerImport,
+                new ConvertToGpxLayerAction(),
+                new ConvertToAnonTimeGpxLayerAction(),
+                SeparatorLayerAction.INSTANCE,
+                new LayerListPopup.InfoAction(this)};
+    }
 
-	@Override
-	public String getToolTipText() {
-		return tr("Layer for editing GPX tracks");
-	}
+    @Override
+    public String getToolTipText() {
+        return tr("Layer for editing GPX tracks");
+    }
 
-	@Override
-	public boolean isMergable(Layer other) {
-		// TODO
-		return false;
-	}
+    @Override
+    public boolean isMergable(Layer other) {
+        // TODO
+        return false;
+    }
 
-	@Override
-	public void mergeFrom(Layer from) {
-		// TODO
-	}
+    @Override
+    public void mergeFrom(Layer from) {
+        // TODO
+    }
 
-	@Override
-	public void paint(Graphics2D g, MapView mv, Bounds bounds) {
-		g.setColor(Color.yellow);
+    @Override
+    public void paint(Graphics2D g, MapView mv, Bounds bounds) {
+        g.setColor(Color.yellow);
 
-		//don't iterate through dataSet whiling making changes
-		synchronized(layerImport.importing) {
-			for (EditGpxTrack track: data.getTracks()) {
-				for (EditGpxTrackSegment segment: track.getSegments()) {
-					for (EditGpxWayPoint wayPoint: segment.getWayPoints()) {
-						if (!wayPoint.isDeleted()) {
-							Point pnt = Main.map.mapView.getPoint(wayPoint.getCoor().getEastNorth());
-							g.drawOval(pnt.x - 2, pnt.y - 2, 4, 4);
-						}
-					}
-				}
-			}
-		}
-	}
+        //don't iterate through dataSet whiling making changes
+        synchronized(layerImport.importing) {
+            for (EditGpxTrack track: data.getTracks()) {
+                for (EditGpxTrackSegment segment: track.getSegments()) {
+                    for (EditGpxWayPoint wayPoint: segment.getWayPoints()) {
+                        if (!wayPoint.isDeleted()) {
+                            Point pnt = Main.map.mapView.getPoint(wayPoint.getCoor().getEastNorth());
+                            g.drawOval(pnt.x - 2, pnt.y - 2, 4, 4);
+                        }
+                    }
+                }
+            }
+        }
+    }
 
 
-	public void reset(){
-		//TODO implement a reset
-	}
+    public void reset(){
+        //TODO implement a reset
+    }
 
 
-	@Override
-	public void visitBoundingBox(BoundingXYVisitor v) {
-		// TODO Auto-generated method stub
-	}
+    @Override
+    public void visitBoundingBox(BoundingXYVisitor v) {
+        // TODO Auto-generated method stub
+    }
 
 
-	/**
-	 * convert a DataSet to GPX
-	 *
-	 * @param boolean anonTime If true set all time and date in GPX to 01/01/1970 00:00 ?
-	 * @return GPXData
-	 */
-	private GpxData toGpxData(boolean anonTime) {
-		return data.createGpxData();
-	}
+    /**
+     * convert a DataSet to GPX
+     *
+     * @param boolean anonTime If true set all time and date in GPX to 01/01/1970 00:00 ?
+     * @return GPXData
+     */
+    private GpxData toGpxData(boolean anonTime) {
+        return data.createGpxData();
+    }
 
-	//context item "Convert to GPX layer"
-	public class ConvertToGpxLayerAction extends AbstractAction {
-		public ConvertToGpxLayerAction() {
-			super(tr("Convert to GPX layer"), ImageProvider.get("converttogpx"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			Main.main.addLayer(new GpxLayer(toGpxData(false), tr("Converted from: {0}", getName())));
-			Main.main.removeLayer(EditGpxLayer.this);
-			if(Main.map.mapMode instanceof EditGpxMode)
-				Main.map.selectSelectTool(false);
-		}
-	}
+    //context item "Convert to GPX layer"
+    public class ConvertToGpxLayerAction extends AbstractAction {
+        public ConvertToGpxLayerAction() {
+            super(tr("Convert to GPX layer"), ImageProvider.get("converttogpx"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            Main.main.addLayer(new GpxLayer(toGpxData(false), tr("Converted from: {0}", getName())));
+            Main.main.removeLayer(EditGpxLayer.this);
+            if(Main.map.mapMode instanceof EditGpxMode)
+                Main.map.selectSelectTool(false);
+        }
+    }
 
-	//context item "Convert to GPX layer with anonymised time"
-	public class ConvertToAnonTimeGpxLayerAction extends AbstractAction {
-		public ConvertToAnonTimeGpxLayerAction() {
-			super(tr("Convert to GPX layer with anonymised time"), ImageProvider.get("converttogpx"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			Main.main.addLayer(new GpxLayer(toGpxData(true), tr("Converted from: {0}", getName())));
-			Main.main.removeLayer(EditGpxLayer.this);
-			if(Main.map.mapMode instanceof EditGpxMode)
-				Main.map.selectSelectTool(false);
-		}
-	}
+    //context item "Convert to GPX layer with anonymised time"
+    public class ConvertToAnonTimeGpxLayerAction extends AbstractAction {
+        public ConvertToAnonTimeGpxLayerAction() {
+            super(tr("Convert to GPX layer with anonymised time"), ImageProvider.get("converttogpx"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            Main.main.addLayer(new GpxLayer(toGpxData(true), tr("Converted from: {0}", getName())));
+            Main.main.removeLayer(EditGpxLayer.this);
+            if(Main.map.mapMode instanceof EditGpxMode)
+                Main.map.selectSelectTool(false);
+        }
+    }
 }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxMode.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxMode.java	(revision 23188)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxMode.java	(revision 23189)
@@ -29,152 +29,152 @@
 public class EditGpxMode extends MapMode implements LayerChangeListener {
 
-	private static final long serialVersionUID = 7940589057093872411L;
-	Point pointPressed;
-	MapFrame mapFrame;
-	Rectangle oldRect;
-	MapFrame frame;
-	EditGpxLayer currentEditLayer;
+    private static final long serialVersionUID = 7940589057093872411L;
+    Point pointPressed;
+    MapFrame mapFrame;
+    Rectangle oldRect;
+    MapFrame frame;
+    EditGpxLayer currentEditLayer;
 
-	public EditGpxMode(MapFrame mapFrame, String name, String desc) {
-		super(name, "editgpx_mode.png", desc, mapFrame, Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
-	}
+    public EditGpxMode(MapFrame mapFrame, String name, String desc) {
+        super(name, "editgpx_mode.png", desc, mapFrame, Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
+    }
 
-	@Override public void enterMode() {
-		super.enterMode();
-		Main.map.mapView.addMouseListener(this);
-		Main.map.mapView.addMouseMotionListener(this);
-		MapView.addLayerChangeListener(this);
-		updateLayer();
-	}
+    @Override public void enterMode() {
+        super.enterMode();
+        Main.map.mapView.addMouseListener(this);
+        Main.map.mapView.addMouseMotionListener(this);
+        MapView.addLayerChangeListener(this);
+        updateLayer();
+    }
 
-	@Override public void exitMode() {
-		super.exitMode();
-		Main.map.mapView.removeMouseListener(this);
-		Main.map.mapView.removeMouseMotionListener(this);
-	}
+    @Override public void exitMode() {
+        super.exitMode();
+        Main.map.mapView.removeMouseListener(this);
+        Main.map.mapView.removeMouseMotionListener(this);
+    }
 
 
-	@Override public void mousePressed(MouseEvent e) {
-		pointPressed = new Point(e.getPoint());
-	}
+    @Override public void mousePressed(MouseEvent e) {
+        pointPressed = new Point(e.getPoint());
+    }
 
 
-	@Override public void mouseDragged(MouseEvent e) {
-		if ( (e.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) ==  InputEvent.BUTTON1_DOWN_MASK) {
-			//if button1 is hold, draw the rectangle.
-			paintRect(pointPressed, e.getPoint());
-		}
-	}
+    @Override public void mouseDragged(MouseEvent e) {
+        if ( (e.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) ==  InputEvent.BUTTON1_DOWN_MASK) {
+            //if button1 is hold, draw the rectangle.
+            paintRect(pointPressed, e.getPoint());
+        }
+    }
 
-	@Override public void mouseReleased(MouseEvent e) {
-		if (e.getButton() != MouseEvent.BUTTON1) {
-			return;
-		}
+    @Override public void mouseReleased(MouseEvent e) {
+        if (e.getButton() != MouseEvent.BUTTON1) {
+            return;
+        }
 
-		Point pointReleased = e.getPoint();
+        Point pointReleased = e.getPoint();
 
-		Rectangle r = createRect(pointReleased, pointPressed);
+        Rectangle r = createRect(pointReleased, pointPressed);
 
-		//go through nodes and mark the ones in the selection rect as deleted
-		if (currentEditLayer != null) {
-			for (EditGpxTrack track: currentEditLayer.data.getTracks()) {
-				for (EditGpxTrackSegment segment: track.getSegments()) {
-					for (EditGpxWayPoint wayPoint: segment.getWayPoints()) {
-						Point p = Main.map.mapView.getPoint(wayPoint.getCoor().getEastNorth());
-						if (r.contains(p)) {
-							wayPoint.setDeleted(true);
-						}
-					}
-				}
-			}
-		}
-		oldRect = null;
-		Main.map.mapView.repaint();
+        //go through nodes and mark the ones in the selection rect as deleted
+        if (currentEditLayer != null) {
+            for (EditGpxTrack track: currentEditLayer.data.getTracks()) {
+                for (EditGpxTrackSegment segment: track.getSegments()) {
+                    for (EditGpxWayPoint wayPoint: segment.getWayPoints()) {
+                        Point p = Main.map.mapView.getPoint(wayPoint.getCoor().getEastNorth());
+                        if (r.contains(p)) {
+                            wayPoint.setDeleted(true);
+                        }
+                    }
+                }
+            }
+        }
+        oldRect = null;
+        Main.map.mapView.repaint();
 
-	}
+    }
 
-	/**
-	 * create rectangle out of two given corners
-	 */
-	public Rectangle createRect(Point p1, Point p2) {
-		int x,y,w,h;
-		if (p1.x == p2.x && p1.y == p2.y) {
-			//if p1 and p2 same points draw a small rectangle around them
-			x = p1.x -1;
-			y = p1.y -1;
-			w = 3;
-			h = 3;
-		} else {
-			if (p1.x < p2.x){
-				x = p1.x;
-				w = p2.x-p1.x;
-			} else {
-				x = p2.x;
-				w = p1.x-p2.x;
-			}
-			if (p1.y < p2.y) {
-				y = p1.y;
-				h = p2.y-p1.y;
-			} else {
-				y = p2.y;
-				h = p1.y-p2.y;
-			}
-		}
-		return new Rectangle(x,y,w,h);
-	}
+    /**
+     * create rectangle out of two given corners
+     */
+    public Rectangle createRect(Point p1, Point p2) {
+        int x,y,w,h;
+        if (p1.x == p2.x && p1.y == p2.y) {
+            //if p1 and p2 same points draw a small rectangle around them
+            x = p1.x -1;
+            y = p1.y -1;
+            w = 3;
+            h = 3;
+        } else {
+            if (p1.x < p2.x){
+                x = p1.x;
+                w = p2.x-p1.x;
+            } else {
+                x = p2.x;
+                w = p1.x-p2.x;
+            }
+            if (p1.y < p2.y) {
+                y = p1.y;
+                h = p2.y-p1.y;
+            } else {
+                y = p2.y;
+                h = p1.y-p2.y;
+            }
+        }
+        return new Rectangle(x,y,w,h);
+    }
 
-	/**
-	 * Draw a selection rectangle on screen.
-	 */
-	private void paintRect(Point p1, Point p2) {
-		Graphics g = frame.getGraphics();//Main.map.mapView.getGraphics();
+    /**
+     * Draw a selection rectangle on screen.
+     */
+    private void paintRect(Point p1, Point p2) {
+        Graphics g = frame.getGraphics();//Main.map.mapView.getGraphics();
 
-		Rectangle r = oldRect;
-		if (r != null) {
-			//overwrite old rct
-			g.setXORMode(Color.BLACK);
-			g.setColor(Color.WHITE);
-			g.drawRect(r.x,r.y,r.width,r.height);
-		}
+        Rectangle r = oldRect;
+        if (r != null) {
+            //overwrite old rct
+            g.setXORMode(Color.BLACK);
+            g.setColor(Color.WHITE);
+            g.drawRect(r.x,r.y,r.width,r.height);
+        }
 
-		g.setXORMode(Color.BLACK);
-		g.setColor(Color.WHITE);
-		r = createRect(p1,p2);
-		g.drawRect(r.x,r.y,r.width,r.height);
-		oldRect = r;
-	}
+        g.setXORMode(Color.BLACK);
+        g.setColor(Color.WHITE);
+        r = createRect(p1,p2);
+        g.drawRect(r.x,r.y,r.width,r.height);
+        oldRect = r;
+    }
 
 
-	public void setFrame(MapFrame mapFrame) {
-		frame = mapFrame;
-	}
+    public void setFrame(MapFrame mapFrame) {
+        frame = mapFrame;
+    }
 
-	/**
-	 * create new layer, add listeners and try importing gpx data.
-	 */
-	private void updateLayer() {
+    /**
+     * create new layer, add listeners and try importing gpx data.
+     */
+    private void updateLayer() {
 
-		List<EditGpxLayer> layers = Main.map.mapView.getLayersOfType(EditGpxLayer.class);
-		currentEditLayer = layers.isEmpty()?null:layers.get(0);
+        List<EditGpxLayer> layers = Main.map.mapView.getLayersOfType(EditGpxLayer.class);
+        currentEditLayer = layers.isEmpty()?null:layers.get(0);
 
-		if(currentEditLayer == null) {
-			currentEditLayer = new EditGpxLayer(tr("EditGpx"), new EditGpxData());
-			Main.main.addLayer(currentEditLayer);
-			currentEditLayer.initializeImport();
-		}
-		Main.map.mapView.repaint();
-	}
+        if(currentEditLayer == null) {
+            currentEditLayer = new EditGpxLayer(tr("EditGpx"), new EditGpxData());
+            Main.main.addLayer(currentEditLayer);
+            currentEditLayer.initializeImport();
+        }
+        Main.map.mapView.repaint();
+    }
 
-	public void activeLayerChange(Layer oldLayer, Layer newLayer) { }
+    public void activeLayerChange(Layer oldLayer, Layer newLayer) { }
 
-	public void layerAdded(Layer newLayer) { }
+    public void layerAdded(Layer newLayer) { }
 
-	public void layerRemoved(Layer oldLayer) {
-		if (oldLayer instanceof EditGpxLayer) {
-			currentEditLayer = null;
-			if(Main.map.mapMode instanceof EditGpxMode)
-				Main.map.selectSelectTool(false);
-		}
-	}
+    public void layerRemoved(Layer oldLayer) {
+        if (oldLayer instanceof EditGpxLayer) {
+            currentEditLayer = null;
+            if(Main.map.mapMode instanceof EditGpxMode)
+                Main.map.selectSelectTool(false);
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxPlugin.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxPlugin.java	(revision 23188)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxPlugin.java	(revision 23189)
@@ -31,31 +31,31 @@
 public class EditGpxPlugin extends Plugin {
 
-	private IconToggleButton btn;
-	private EditGpxMode mode;
+    private IconToggleButton btn;
+    private EditGpxMode mode;
 
-	public EditGpxPlugin(PluginInformation info) {
-		super(info);
-		mode = new EditGpxMode(Main.map, "editgpx", tr("edit gpx tracks"));
+    public EditGpxPlugin(PluginInformation info) {
+        super(info);
+        mode = new EditGpxMode(Main.map, "editgpx", tr("edit gpx tracks"));
 
-		btn = new IconToggleButton(mode);
-		btn.setVisible(true);
-	}
+        btn = new IconToggleButton(mode);
+        btn.setVisible(true);
+    }
 
-	/**
-	 * initialize button. if button is pressed create new layer.
-	 */
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if(oldFrame == null && newFrame != null) {
-			mode.setFrame(newFrame);
+    /**
+     * initialize button. if button is pressed create new layer.
+     */
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if(oldFrame == null && newFrame != null) {
+            mode.setFrame(newFrame);
 
-			if(Main.map != null)
-				Main.map.addMapMode(btn);
-		}
-	}
+            if(Main.map != null)
+                Main.map.addMapMode(btn);
+        }
+    }
 
-	public static ImageIcon loadIcon(String name) {
-		URL url = EditGpxPlugin.class.getResource("/images/editgpx.png");
-		return new ImageIcon(url);
-	}
+    public static ImageIcon loadIcon(String name) {
+        URL url = EditGpxPlugin.class.getResource("/images/editgpx.png");
+        return new ImageIcon(url);
+    }
 }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/GPXLayerImportAction.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/GPXLayerImportAction.java	(revision 23188)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/GPXLayerImportAction.java	(revision 23189)
@@ -38,88 +38,88 @@
 
 
-	private static final long serialVersionUID = 5794897888911798168L;
-	private EditGpxData data;
-	public Object importing = new Object(); //used for synchronization
+    private static final long serialVersionUID = 5794897888911798168L;
+    private EditGpxData data;
+    public Object importing = new Object(); //used for synchronization
 
-	public GPXLayerImportAction(EditGpxData data) {
-		//TODO what is icon at the end?
-		super(tr("Import path from GPX layer"), ImageProvider.get("dialogs", "edit"));
-		this.data = data;
-	}
+    public GPXLayerImportAction(EditGpxData data) {
+        //TODO what is icon at the end?
+        super(tr("Import path from GPX layer"), ImageProvider.get("dialogs", "edit"));
+        this.data = data;
+    }
 
-	/**
-	 * shows a list of GPX layers. if user selects one the data from this layer is
-	 * imported.
-	 */
-	public void activateImport() {
-		Box panel = Box.createVerticalBox();
-		DefaultListModel dModel= new DefaultListModel();
+    /**
+     * shows a list of GPX layers. if user selects one the data from this layer is
+     * imported.
+     */
+    public void activateImport() {
+        Box panel = Box.createVerticalBox();
+        DefaultListModel dModel= new DefaultListModel();
 
-		final JList layerList = new JList(dModel);
-		Collection<Layer> data = Main.map.mapView.getAllLayers();
-		Layer lastLayer = null;
-		int layerCnt = 0;
+        final JList layerList = new JList(dModel);
+        Collection<Layer> data = Main.map.mapView.getAllLayers();
+        Layer lastLayer = null;
+        int layerCnt = 0;
 
-		for (Layer l : data){
-			if(l instanceof GpxLayer){
-				dModel.addElement(l);
-				lastLayer = l;
-				layerCnt++;
-			}
-		}
-		if(layerCnt == 1){
-			layerList.setSelectedValue(lastLayer, true);
-		}
-		if(layerCnt > 0){
-			layerList.setCellRenderer(new DefaultListCellRenderer(){
-				@Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
-					Layer layer = (Layer)value;
-					JLabel label = (JLabel)super.getListCellRendererComponent(list,
-							layer.getName(), index, isSelected, cellHasFocus);
-					Icon icon = layer.getIcon();
-					label.setIcon(icon);
-					label.setToolTipText(layer.getToolTipText());
-					return label;
-				}
-			});
+        for (Layer l : data){
+            if(l instanceof GpxLayer){
+                dModel.addElement(l);
+                lastLayer = l;
+                layerCnt++;
+            }
+        }
+        if(layerCnt == 1){
+            layerList.setSelectedValue(lastLayer, true);
+        }
+        if(layerCnt > 0){
+            layerList.setCellRenderer(new DefaultListCellRenderer(){
+                @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+                    Layer layer = (Layer)value;
+                    JLabel label = (JLabel)super.getListCellRendererComponent(list,
+                            layer.getName(), index, isSelected, cellHasFocus);
+                    Icon icon = layer.getIcon();
+                    label.setIcon(icon);
+                    label.setToolTipText(layer.getToolTipText());
+                    return label;
+                }
+            });
 
-			JCheckBox dropFirst = new JCheckBox(tr("Drop existing path"));
+            JCheckBox dropFirst = new JCheckBox(tr("Drop existing path"));
 
-			panel.add(layerList);
-			panel.add(dropFirst);
+            panel.add(layerList);
+            panel.add(dropFirst);
 
-			final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION){
-				@Override public void selectInitialValue() {
-					layerList.requestFocusInWindow();
-				}
-			};
-			final JDialog dlg = optionPane.createDialog(Main.parent, tr("Import path from GPX layer"));
-			dlg.setVisible(true);
+            final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION){
+                @Override public void selectInitialValue() {
+                    layerList.requestFocusInWindow();
+                }
+            };
+            final JDialog dlg = optionPane.createDialog(Main.parent, tr("Import path from GPX layer"));
+            dlg.setVisible(true);
 
-			Object answer = optionPane.getValue();
-			if (answer == null || answer == JOptionPane.UNINITIALIZED_VALUE ||
-					(answer instanceof Integer && (Integer)answer != JOptionPane.OK_OPTION)) {
-				return;
-			}
+            Object answer = optionPane.getValue();
+            if (answer == null || answer == JOptionPane.UNINITIALIZED_VALUE ||
+                    (answer instanceof Integer && (Integer)answer != JOptionPane.OK_OPTION)) {
+                return;
+            }
 
-			GpxLayer gpx = (GpxLayer)layerList.getSelectedValue();
+            GpxLayer gpx = (GpxLayer)layerList.getSelectedValue();
 
-			synchronized(importing) {
-				this.data.load(gpx.data, dropFirst.isSelected());
-			}
-			Main.map.mapView.repaint();
+            synchronized(importing) {
+                this.data.load(gpx.data, dropFirst.isSelected());
+            }
+            Main.map.mapView.repaint();
 
-		} else {
-			// no gps layer
-			JOptionPane.showMessageDialog(Main.parent,tr("No GPX data layer found."));
-		}
-	}
+        } else {
+            // no gps layer
+            JOptionPane.showMessageDialog(Main.parent,tr("No GPX data layer found."));
+        }
+    }
 
-	/**
-	 * called when pressing "Import.." from context menu of EditGpx layer
-	 *
-	 */
-	public void actionPerformed(ActionEvent arg0) {
-		activateImport();
-	}
+    /**
+     * called when pressing "Import.." from context menu of EditGpx layer
+     *
+     */
+    public void actionPerformed(ActionEvent arg0) {
+        activateImport();
+    }
 }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxData.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxData.java	(revision 23188)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxData.java	(revision 23189)
@@ -11,52 +11,52 @@
 public class EditGpxData {
 
-	private final List<EditGpxTrack> tracks = new ArrayList<EditGpxTrack>();
-	// Only copy of routes and waypoints to preserve all info when converting back to gpx track
-	private final List<GpxRoute> routes = new ArrayList<GpxRoute>();
-	private final List<WayPoint> waypoints = new ArrayList<WayPoint>();
+    private final List<EditGpxTrack> tracks = new ArrayList<EditGpxTrack>();
+    // Only copy of routes and waypoints to preserve all info when converting back to gpx track
+    private final List<GpxRoute> routes = new ArrayList<GpxRoute>();
+    private final List<WayPoint> waypoints = new ArrayList<WayPoint>();
 
-	public void load(GpxData data, boolean drop) {
-		if(drop)
-			tracks.clear();
-		for (GpxTrack track: data.tracks) {
-			tracks.add(new EditGpxTrack(track));
-		}
-		routes.clear();
-		routes.addAll(data.routes);
-		waypoints.clear();
-		waypoints.addAll(data.waypoints);
-	}
+    public void load(GpxData data, boolean drop) {
+        if(drop)
+            tracks.clear();
+        for (GpxTrack track: data.tracks) {
+            tracks.add(new EditGpxTrack(track));
+        }
+        routes.clear();
+        routes.addAll(data.routes);
+        waypoints.clear();
+        waypoints.addAll(data.waypoints);
+    }
 
-	public boolean isEmpty() {
-		for (EditGpxTrack track: tracks) {
-			for (EditGpxTrackSegment segment: track.getSegments()) {
-				if (!segment.getWayPoints().isEmpty()) {
-					return false;
-				}
-			}
-		}
-		return true;
-	}
+    public boolean isEmpty() {
+        for (EditGpxTrack track: tracks) {
+            for (EditGpxTrackSegment segment: track.getSegments()) {
+                if (!segment.getWayPoints().isEmpty()) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
 
-	public List<EditGpxTrack> getTracks() {
-		return tracks;
-	}
+    public List<EditGpxTrack> getTracks() {
+        return tracks;
+    }
 
-	public GpxData createGpxData() {
-		GpxData result = new GpxData();
+    public GpxData createGpxData() {
+        GpxData result = new GpxData();
 
-		for (EditGpxTrack track: tracks) {
-			if (!track.isDeleted()) {
-				GpxTrack newTrack = track.createGpxTrack();
-				if (!newTrack.getSegments().isEmpty()) {
-					result.tracks.add(newTrack);
-				}
-			}
-		}
+        for (EditGpxTrack track: tracks) {
+            if (!track.isDeleted()) {
+                GpxTrack newTrack = track.createGpxTrack();
+                if (!newTrack.getSegments().isEmpty()) {
+                    result.tracks.add(newTrack);
+                }
+            }
+        }
 
-		result.routes.addAll(routes);
-		result.waypoints.addAll(waypoints);
-		return result;
-	}
+        result.routes.addAll(routes);
+        result.waypoints.addAll(waypoints);
+        return result;
+    }
 
 }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrack.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrack.java	(revision 23188)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrack.java	(revision 23189)
@@ -14,44 +14,44 @@
 public class EditGpxTrack {
 
-	private final List<EditGpxTrackSegment> segments = new ArrayList<EditGpxTrackSegment>();
-	private final Map<String, Object> attributes = new HashMap<String, Object>();
-	private boolean isDeleted;
+    private final List<EditGpxTrackSegment> segments = new ArrayList<EditGpxTrackSegment>();
+    private final Map<String, Object> attributes = new HashMap<String, Object>();
+    private boolean isDeleted;
 
-	public EditGpxTrack(GpxTrack track) {
-		attributes.putAll(track.getAttributes());
-		for (GpxTrackSegment segment: track.getSegments()) {
-			segments.add(new EditGpxTrackSegment(segment));
-		}
-	}
+    public EditGpxTrack(GpxTrack track) {
+        attributes.putAll(track.getAttributes());
+        for (GpxTrackSegment segment: track.getSegments()) {
+            segments.add(new EditGpxTrackSegment(segment));
+        }
+    }
 
-	public List<EditGpxTrackSegment> getSegments() {
-		return segments;
-	}
-	public Map<String, Object> getAttributes() {
-		return attributes;
-	}
+    public List<EditGpxTrackSegment> getSegments() {
+        return segments;
+    }
+    public Map<String, Object> getAttributes() {
+        return attributes;
+    }
 
-	public GpxTrack createGpxTrack() {
+    public GpxTrack createGpxTrack() {
 
-		Collection<Collection<WayPoint>> wayPoints = new ArrayList<Collection<WayPoint>>();
+        Collection<Collection<WayPoint>> wayPoints = new ArrayList<Collection<WayPoint>>();
 
-		for (EditGpxTrackSegment segment: segments) {
-			if (!segment.isDeleted()) {
-				List<WayPoint> points = segment.getNonDeletedWaypoints();
-				if (!points.isEmpty()) {
-					wayPoints.add(points);
-				}
-			}
-		}
+        for (EditGpxTrackSegment segment: segments) {
+            if (!segment.isDeleted()) {
+                List<WayPoint> points = segment.getNonDeletedWaypoints();
+                if (!points.isEmpty()) {
+                    wayPoints.add(points);
+                }
+            }
+        }
 
-		return new ImmutableGpxTrack(wayPoints, attributes);
-	}
+        return new ImmutableGpxTrack(wayPoints, attributes);
+    }
 
-	public void setDeleted(boolean isDeleted) {
-		this.isDeleted = isDeleted;
-	}
+    public void setDeleted(boolean isDeleted) {
+        this.isDeleted = isDeleted;
+    }
 
-	public boolean isDeleted() {
-		return isDeleted;
-	}
+    public boolean isDeleted() {
+        return isDeleted;
+    }
 }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrackSegment.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrackSegment.java	(revision 23188)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxTrackSegment.java	(revision 23189)
@@ -9,36 +9,36 @@
 public class EditGpxTrackSegment {
 
-	private final List<EditGpxWayPoint> wayPoints = new ArrayList<EditGpxWayPoint>();
-	private boolean deleted;
+    private final List<EditGpxWayPoint> wayPoints = new ArrayList<EditGpxWayPoint>();
+    private boolean deleted;
 
-	public EditGpxTrackSegment(GpxTrackSegment segment) {
-		for (WayPoint wayPoint: segment.getWayPoints()) {
-			wayPoints.add(new EditGpxWayPoint(wayPoint));
-		}
-	}
+    public EditGpxTrackSegment(GpxTrackSegment segment) {
+        for (WayPoint wayPoint: segment.getWayPoints()) {
+            wayPoints.add(new EditGpxWayPoint(wayPoint));
+        }
+    }
 
-	public List<EditGpxWayPoint> getWayPoints() {
-		return wayPoints;
-	}
+    public List<EditGpxWayPoint> getWayPoints() {
+        return wayPoints;
+    }
 
-	public List<WayPoint> getNonDeletedWaypoints() {
-		List<WayPoint> result = new ArrayList<WayPoint>();
+    public List<WayPoint> getNonDeletedWaypoints() {
+        List<WayPoint> result = new ArrayList<WayPoint>();
 
-		for (EditGpxWayPoint wp: wayPoints) {
-			if (!wp.isDeleted()) {
-				result.add(wp.createWayPoint());
-			}
-		}
+        for (EditGpxWayPoint wp: wayPoints) {
+            if (!wp.isDeleted()) {
+                result.add(wp.createWayPoint());
+            }
+        }
 
-		return result;
-	}
+        return result;
+    }
 
-	public void setDeleted(boolean deleted) {
-		this.deleted = deleted;
-	}
+    public void setDeleted(boolean deleted) {
+        this.deleted = deleted;
+    }
 
-	public boolean isDeleted() {
-		return deleted;
-	}
+    public boolean isDeleted() {
+        return deleted;
+    }
 
 }
Index: /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxWayPoint.java
===================================================================
--- /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxWayPoint.java	(revision 23188)
+++ /applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/data/EditGpxWayPoint.java	(revision 23189)
@@ -8,32 +8,32 @@
 
 public class EditGpxWayPoint {
-	private final double time;
-	private final CachedLatLon coor;
-	private boolean deleted;
-	private Map<String, Object> attributes;
+    private final double time;
+    private final CachedLatLon coor;
+    private boolean deleted;
+    private Map<String, Object> attributes;
 
-	public EditGpxWayPoint(WayPoint wayPoint) {
-		this.time = wayPoint.time;
-		this.coor = new CachedLatLon(wayPoint.getCoor());
-		this.attributes = new HashMap<String, Object>(wayPoint.attr);
-	}
+    public EditGpxWayPoint(WayPoint wayPoint) {
+        this.time = wayPoint.time;
+        this.coor = new CachedLatLon(wayPoint.getCoor());
+        this.attributes = new HashMap<String, Object>(wayPoint.attr);
+    }
 
-	public WayPoint createWayPoint() {
-		WayPoint result = new WayPoint(getCoor());
-		result.time = time;
-		result.attr = attributes;
-		return result;
-	}
+    public WayPoint createWayPoint() {
+        WayPoint result = new WayPoint(getCoor());
+        result.time = time;
+        result.attr = attributes;
+        return result;
+    }
 
-	public void setDeleted(boolean deleted) {
-		this.deleted = deleted;
-	}
+    public void setDeleted(boolean deleted) {
+        this.deleted = deleted;
+    }
 
-	public boolean isDeleted() {
-		return deleted;
-	}
+    public boolean isDeleted() {
+        return deleted;
+    }
 
-	public CachedLatLon getCoor() {
-		return coor;
-	}
+    public CachedLatLon getCoor() {
+        return coor;
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessEvaluator.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessEvaluator.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessEvaluator.java	(revision 23189)
@@ -19,24 +19,24 @@
 public interface AccessEvaluator<N, W> {
 
-	/**
-	 * checks whether a way may be accessed in the given direction
-	 *
-	 * @param way                object to be checked; != null
-	 * @param segmentProperties  map from road property types to their values for this way's
-	 *                           segments; each value must be a valid value for its property type;
-	 *                           != null
-	 */
-	public boolean wayUsable(W way, boolean forward,
-			Map<RoadPropertyType<?>, Object> roadPropertyValues);
+    /**
+     * checks whether a way may be accessed in the given direction
+     *
+     * @param way                object to be checked; != null
+     * @param segmentProperties  map from road property types to their values for this way's
+     *                           segments; each value must be a valid value for its property type;
+     *                           != null
+     */
+    public boolean wayUsable(W way, boolean forward,
+            Map<RoadPropertyType<?>, Object> roadPropertyValues);
 
-	/**
-	 * checks whether a node may be accessed/passed
-	 *
-	 * @param node               object to be checked; != null
-	 * @param segmentProperties  map from road property types to their values for SegmentNodes
-	 *                           based on this node, each value must be a valid value for its
-	 *                           property type; != null
-	 */
-	public boolean nodeUsable(N node, Map<RoadPropertyType<?>, Object> roadPropertyValues);
+    /**
+     * checks whether a node may be accessed/passed
+     *
+     * @param node               object to be checked; != null
+     * @param segmentProperties  map from road property types to their values for SegmentNodes
+     *                           based on this node, each value must be a valid value for its
+     *                           property type; != null
+     */
+    public boolean nodeUsable(N node, Map<RoadPropertyType<?>, Object> roadPropertyValues);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessParameters.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessParameters.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessParameters.java	(revision 23189)
@@ -11,29 +11,29 @@
 public interface AccessParameters {
 
-	public String getAccessClass();
+    public String getAccessClass();
 
-	/**
-	 * returns true iff a road with a given access type can be used
-	 * @param accessType  access type to check usablitly for; != null
-	 */
-	public boolean getAccessTypeUsable(AccessType accessType);
+    /**
+     * returns true iff a road with a given access type can be used
+     * @param accessType  access type to check usablitly for; != null
+     */
+    public boolean getAccessTypeUsable(AccessType accessType);
 
-	/**
-	 * returns all {@link VehiclePropertyType}s a value is avaliable for.
-	 * The value can be accessed using {@link #getVehiclePropertyValue(VehiclePropertyType)}
-	 * @return  collection of property types; != null
-	 */
-	public Collection<VehiclePropertyType<?>> getAvailableVehicleProperties();
+    /**
+     * returns all {@link VehiclePropertyType}s a value is avaliable for.
+     * The value can be accessed using {@link #getVehiclePropertyValue(VehiclePropertyType)}
+     * @return  collection of property types; != null
+     */
+    public Collection<VehiclePropertyType<?>> getAvailableVehicleProperties();
 
-	/**
-	 * returns the value for a vehicle property.
-	 *
-	 * @param <V>              type of property value
-	 * @param vehicleProperty  property to get value for; != null
-	 * @return                 value for vehicleProperty, null if no value is available.
-	 *                         Guaranteed to be valid according to vehicleProperty's
-	 *                         {@link VehiclePropertyType#isValidValue(Object)} method.
-	 */
-	public <V> V getVehiclePropertyValue(VehiclePropertyType<V> vehicleProperty);
+    /**
+     * returns the value for a vehicle property.
+     *
+     * @param <V>              type of property value
+     * @param vehicleProperty  property to get value for; != null
+     * @return                 value for vehicleProperty, null if no value is available.
+     *                         Guaranteed to be valid according to vehicleProperty's
+     *                         {@link VehiclePropertyType#isValidValue(Object)} method.
+     */
+    public <V> V getVehiclePropertyValue(VehiclePropertyType<V> vehicleProperty);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessRuleset.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessRuleset.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessRuleset.java	(revision 23189)
@@ -12,27 +12,27 @@
 public interface AccessRuleset {
 
-	/**
-	 * for a mode of transport, returns all transport categories it is a subset of.
-	 * For example, the returned collection for "motorcycle" might include "motor_vehicle" and "vehicle".
-	 *
-	 * @param transportMode  mode of transport to get "supertypes" for; != null
-	 * @return parameters superset categories, including the parameter itself,
-	 *         in the order of decreasing specificness
-	 *         empty if the parameter was no known mode of transport; != null
-	 */
-	public List<String> getAccessHierarchyAncestors(String transportMode);
+    /**
+     * for a mode of transport, returns all transport categories it is a subset of.
+     * For example, the returned collection for "motorcycle" might include "motor_vehicle" and "vehicle".
+     *
+     * @param transportMode  mode of transport to get "supertypes" for; != null
+     * @return parameters superset categories, including the parameter itself,
+     *         in the order of decreasing specificness
+     *         empty if the parameter was no known mode of transport; != null
+     */
+    public List<String> getAccessHierarchyAncestors(String transportMode);
 
-	/**
-	 * returns all base tags.
-	 * Base tags are tags that make an object "eligible" for access evaluation
-	 * (commonly things like highway=* or barrier=*)
-	 */
-	public Collection<Tag> getBaseTags();
+    /**
+     * returns all base tags.
+     * Base tags are tags that make an object "eligible" for access evaluation
+     * (commonly things like highway=* or barrier=*)
+     */
+    public Collection<Tag> getBaseTags();
 
-	/**
-	 * returns ruleset-specific implications
-	 * @return  list of implications in the order they are expected to be applied; != null
-	 */
-	public List<Implication> getImplications();
+    /**
+     * returns ruleset-specific implications
+     * @return  list of implications in the order they are expected to be applied; != null
+     */
+    public List<Implication> getImplications();
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessRulesetReader.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessRulesetReader.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessRulesetReader.java	(revision 23189)
@@ -20,216 +20,216 @@
 public class AccessRulesetReader {
 
-	public static class AccessRulesetSyntaxException extends IOException {
-		private static final long serialVersionUID = 1L;
-		public AccessRulesetSyntaxException(String message) {
-			super(message);
-		};
-		public AccessRulesetSyntaxException(Throwable t) {
-			super(t.toString());
-		}
-	}
-
-	/** private constructor to prevent instantiation */
-	private AccessRulesetReader() { }
-
-	public static AccessRuleset readAccessRuleset(InputStream inputStream)
-	throws AccessRulesetSyntaxException, IOException {
-
-		RulesetHandler rulesetHandler = new RulesetHandler();
-
-		try {
-			XMLReader reader = XMLReaderFactory.createXMLReader();
-			InputSource input = new InputSource(inputStream);
-			reader.setContentHandler(rulesetHandler);
-			reader.setErrorHandler(null);
-			reader.parse(input);
-		} catch (SAXException e) {
-			throw new AccessRulesetSyntaxException(e);
-		}
-
-		return rulesetHandler.getAccessRuleset();
-	}
-
-	private static class RulesetHandler extends DefaultHandler {
-
-		private static class AccessClass {
-			final String name;
-			final AccessClass parent;
-			public AccessClass(String name, AccessClass parent) {
-				this.name = name;
-				this.parent = parent;
-			}
-			List<String> getAncestorHierarchy() {
-				List<String> names;
-				if (parent == null) {
-					names = new LinkedList<String>();
-				} else {
-					names = parent.getAncestorHierarchy();
-				}
-				names.add(0, name);
-				return names;
-			}
-		}
-
-		private final Collection<AccessClass> accessClasses = new LinkedList<AccessClass>();
-		private final Collection<Tag> baseTags = new LinkedList<Tag>();
-
-		private static enum Section {NONE, CLASSES, BASETAGS, IMPLICATIONS};
-		private Section currentSection = Section.NONE;
-
-		private AccessClass currentAccessClass = null;
-
-		private ImplicationXMLReader implicationReader = null;
-		private final List<Implication> implications = new LinkedList<Implication>();
-
-		/** returns the AccessRuleset that was read */
-		AccessRuleset getAccessRuleset() {
-
-			return new AccessRuleset() {
-
-				public List<String> getAccessHierarchyAncestors(String transportMode) {
-					for (AccessClass accessClass : accessClasses) {
-						if (accessClass.name.equals(transportMode)) {
-							return accessClass.getAncestorHierarchy();
-						}
-					}
-					return new LinkedList<String>();
-				}
-
-				public Collection<Tag> getBaseTags() {
-					return baseTags;
-				}
-
-				public List<Implication> getImplications() {
-					return implications;
-				}
-
-			};
-		}
-
-		@Override
-		public void startElement(String uri, String localName, String name,
-				Attributes attributes) throws SAXException {
-
-			if (implicationReader != null) {
-				implicationReader.startElement(uri, localName, name, attributes);
-				return;
-			}
-
-			if ("classes".equals(name)) {
-
-				if (currentSection != Section.NONE) {
-					throw new SAXException("classes element below root child level");
-				}
-
-				currentSection = Section.CLASSES;
-
-			} else if ("class".equals(name)) {
-
-				String className = attributes.getValue("name");
-
-				if (currentSection != Section.CLASSES) {
-					throw new SAXException("class element (" + className + ") outside classes element");
-				} else if (className == null) {
-					throw new SAXException("class element without name");
-				}
-
-				AccessClass newAccessClass = new AccessClass(className, currentAccessClass);
-
-				accessClasses.add(newAccessClass);
-
-				currentAccessClass = newAccessClass;
-
-			} else if ("basetags".equals(name)) {
-
-				if (currentSection != Section.NONE) {
-					throw new SAXException("classes element below root child level");
-				}
-
-				currentSection = Section.BASETAGS;
-
-			} else if ("tag".equals(name)) {
-
-				if (currentSection == Section.BASETAGS) {
-					baseTags.add(readTag(attributes));
-				} else {
-					throw new SAXException("tag element outside basetag and implication elements");
-				}
-
-			} else if ("implications".equals(name)) {
-
-				if (currentSection != Section.NONE) {
-					throw new SAXException("implications element below root child level");
-				}
-
-				implicationReader = new ImplicationXMLReader();
-				currentSection = Section.IMPLICATIONS;
-
-			}
-
-		}
-
-		private static Tag readTag(Attributes attributes) throws SAXException {
-
-			String key = attributes.getValue("k");
-			String value = attributes.getValue("v");
-
-			if (key == null) {
-				throw new SAXException("tag without key");
-			} else if (value == null) {
-				throw new SAXException("tag without value (key is " + key + ")");
-			}
-
-			return new Tag(key, value);
-		}
-
-		@Override
-		public void endElement(String uri, String localName, String name)
-		throws SAXException {
-
-			if (implicationReader != null && !"implications".equals(name)) {
-				implicationReader.endElement(uri, localName, name);
-			}
-
-			if ("classes".equals(name)) {
-
-				if (currentSection != Section.CLASSES) {
-					throw new SAXException("closed classes while it wasn't open");
-				} else if (currentAccessClass != null) {
-					throw new SAXException("closed classes element before all class elements were closed");
-				}
-
-				currentSection = Section.NONE;
-
-			} else if ("class".equals(name)) {
-
-				if (currentAccessClass == null) {
-					throw new SAXException("closed class element while none was open");
-				}
-
-				currentAccessClass = currentAccessClass.parent;
-
-			} else if ("basetags".equals(name)) {
-
-				if (currentSection != Section.BASETAGS) {
-					throw new SAXException("closed basetags while it wasn't open");
-				}
-
-				currentSection = Section.NONE;
-
-			} else if ("implications".equals(name)) {
-
-				if (currentSection != Section.IMPLICATIONS) {
-					throw new SAXException("closed implications while it wasn't open");
-				}
-
-				implications.addAll(implicationReader.getImplications());
-				implicationReader = null;
-				currentSection = Section.NONE;
-
-			}
-
-		}
-
-	};
+    public static class AccessRulesetSyntaxException extends IOException {
+        private static final long serialVersionUID = 1L;
+        public AccessRulesetSyntaxException(String message) {
+            super(message);
+        };
+        public AccessRulesetSyntaxException(Throwable t) {
+            super(t.toString());
+        }
+    }
+
+    /** private constructor to prevent instantiation */
+    private AccessRulesetReader() { }
+
+    public static AccessRuleset readAccessRuleset(InputStream inputStream)
+    throws AccessRulesetSyntaxException, IOException {
+
+        RulesetHandler rulesetHandler = new RulesetHandler();
+
+        try {
+            XMLReader reader = XMLReaderFactory.createXMLReader();
+            InputSource input = new InputSource(inputStream);
+            reader.setContentHandler(rulesetHandler);
+            reader.setErrorHandler(null);
+            reader.parse(input);
+        } catch (SAXException e) {
+            throw new AccessRulesetSyntaxException(e);
+        }
+
+        return rulesetHandler.getAccessRuleset();
+    }
+
+    private static class RulesetHandler extends DefaultHandler {
+
+        private static class AccessClass {
+            final String name;
+            final AccessClass parent;
+            public AccessClass(String name, AccessClass parent) {
+                this.name = name;
+                this.parent = parent;
+            }
+            List<String> getAncestorHierarchy() {
+                List<String> names;
+                if (parent == null) {
+                    names = new LinkedList<String>();
+                } else {
+                    names = parent.getAncestorHierarchy();
+                }
+                names.add(0, name);
+                return names;
+            }
+        }
+
+        private final Collection<AccessClass> accessClasses = new LinkedList<AccessClass>();
+        private final Collection<Tag> baseTags = new LinkedList<Tag>();
+
+        private static enum Section {NONE, CLASSES, BASETAGS, IMPLICATIONS};
+        private Section currentSection = Section.NONE;
+
+        private AccessClass currentAccessClass = null;
+
+        private ImplicationXMLReader implicationReader = null;
+        private final List<Implication> implications = new LinkedList<Implication>();
+
+        /** returns the AccessRuleset that was read */
+        AccessRuleset getAccessRuleset() {
+
+            return new AccessRuleset() {
+
+                public List<String> getAccessHierarchyAncestors(String transportMode) {
+                    for (AccessClass accessClass : accessClasses) {
+                        if (accessClass.name.equals(transportMode)) {
+                            return accessClass.getAncestorHierarchy();
+                        }
+                    }
+                    return new LinkedList<String>();
+                }
+
+                public Collection<Tag> getBaseTags() {
+                    return baseTags;
+                }
+
+                public List<Implication> getImplications() {
+                    return implications;
+                }
+
+            };
+        }
+
+        @Override
+        public void startElement(String uri, String localName, String name,
+                Attributes attributes) throws SAXException {
+
+            if (implicationReader != null) {
+                implicationReader.startElement(uri, localName, name, attributes);
+                return;
+            }
+
+            if ("classes".equals(name)) {
+
+                if (currentSection != Section.NONE) {
+                    throw new SAXException("classes element below root child level");
+                }
+
+                currentSection = Section.CLASSES;
+
+            } else if ("class".equals(name)) {
+
+                String className = attributes.getValue("name");
+
+                if (currentSection != Section.CLASSES) {
+                    throw new SAXException("class element (" + className + ") outside classes element");
+                } else if (className == null) {
+                    throw new SAXException("class element without name");
+                }
+
+                AccessClass newAccessClass = new AccessClass(className, currentAccessClass);
+
+                accessClasses.add(newAccessClass);
+
+                currentAccessClass = newAccessClass;
+
+            } else if ("basetags".equals(name)) {
+
+                if (currentSection != Section.NONE) {
+                    throw new SAXException("classes element below root child level");
+                }
+
+                currentSection = Section.BASETAGS;
+
+            } else if ("tag".equals(name)) {
+
+                if (currentSection == Section.BASETAGS) {
+                    baseTags.add(readTag(attributes));
+                } else {
+                    throw new SAXException("tag element outside basetag and implication elements");
+                }
+
+            } else if ("implications".equals(name)) {
+
+                if (currentSection != Section.NONE) {
+                    throw new SAXException("implications element below root child level");
+                }
+
+                implicationReader = new ImplicationXMLReader();
+                currentSection = Section.IMPLICATIONS;
+
+            }
+
+        }
+
+        private static Tag readTag(Attributes attributes) throws SAXException {
+
+            String key = attributes.getValue("k");
+            String value = attributes.getValue("v");
+
+            if (key == null) {
+                throw new SAXException("tag without key");
+            } else if (value == null) {
+                throw new SAXException("tag without value (key is " + key + ")");
+            }
+
+            return new Tag(key, value);
+        }
+
+        @Override
+        public void endElement(String uri, String localName, String name)
+        throws SAXException {
+
+            if (implicationReader != null && !"implications".equals(name)) {
+                implicationReader.endElement(uri, localName, name);
+            }
+
+            if ("classes".equals(name)) {
+
+                if (currentSection != Section.CLASSES) {
+                    throw new SAXException("closed classes while it wasn't open");
+                } else if (currentAccessClass != null) {
+                    throw new SAXException("closed classes element before all class elements were closed");
+                }
+
+                currentSection = Section.NONE;
+
+            } else if ("class".equals(name)) {
+
+                if (currentAccessClass == null) {
+                    throw new SAXException("closed class element while none was open");
+                }
+
+                currentAccessClass = currentAccessClass.parent;
+
+            } else if ("basetags".equals(name)) {
+
+                if (currentSection != Section.BASETAGS) {
+                    throw new SAXException("closed basetags while it wasn't open");
+                }
+
+                currentSection = Section.NONE;
+
+            } else if ("implications".equals(name)) {
+
+                if (currentSection != Section.IMPLICATIONS) {
+                    throw new SAXException("closed implications while it wasn't open");
+                }
+
+                implications.addAll(implicationReader.getImplications());
+                implicationReader = null;
+                currentSection = Section.NONE;
+
+            }
+
+        }
+
+    };
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessType.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessType.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/AccessType.java	(revision 23189)
@@ -3,36 +3,36 @@
 public enum AccessType {
 
-	YES("yes"),
-	PERMISSIVE("permissive"),
-	DESIGNATED("designated"),
-	DESTINATION("destination"),
-	AGRICULTURAL("agricultural"),
-	FORESTRY("forestry"),
-	DELIVERY("delivery"),
-	PRIVATE("private"),
-	NO("no"),
-	UNDEFINED();
+    YES("yes"),
+    PERMISSIVE("permissive"),
+    DESIGNATED("designated"),
+    DESTINATION("destination"),
+    AGRICULTURAL("agricultural"),
+    FORESTRY("forestry"),
+    DELIVERY("delivery"),
+    PRIVATE("private"),
+    NO("no"),
+    UNDEFINED();
 
-	private String[] valueStrings;
-	private AccessType(String... valueStrings) {
-		this.valueStrings = valueStrings;
-	}
+    private String[] valueStrings;
+    private AccessType(String... valueStrings) {
+        this.valueStrings = valueStrings;
+    }
 
-	/**
-	 * returns the AccessType that fits for a tag's value
-	 *
-	 * @param valueString  a tag's value; != null
-	 * @return             AccessType for the value; != null, will be UNDEFINED for unknown values
-	 */
-	public static AccessType getAccessType(String valueString) {
-		for (AccessType accessType : AccessType.values()) {
-			for (String typeValueString : accessType.valueStrings) {
-				if (typeValueString.equals(valueString)) {
-					return accessType;
-				}
-			}
-		}
-		return UNDEFINED;
-	}
+    /**
+     * returns the AccessType that fits for a tag's value
+     *
+     * @param valueString  a tag's value; != null
+     * @return             AccessType for the value; != null, will be UNDEFINED for unknown values
+     */
+    public static AccessType getAccessType(String valueString) {
+        for (AccessType accessType : AccessType.values()) {
+            for (String typeValueString : accessType.valueStrings) {
+                if (typeValueString.equals(valueString)) {
+                    return accessType;
+                }
+            }
+        }
+        return UNDEFINED;
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/Implication.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/Implication.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/Implication.java	(revision 23189)
@@ -15,47 +15,47 @@
 public final class Implication {
 
-	private final TagCondition condition;
-	private final Collection<Tag> impliedTags;
+    private final TagCondition condition;
+    private final Collection<Tag> impliedTags;
 
-	public Implication(TagCondition condition, Collection<Tag> impliedTags) {
-		this.condition = condition;
-		this.impliedTags = impliedTags;
-	}
+    public Implication(TagCondition condition, Collection<Tag> impliedTags) {
+        this.condition = condition;
+        this.impliedTags = impliedTags;
+    }
 
-	/**
-	 * applies this implication to a tag group.
-	 * The resulting tag group will contain all tags from the original group
-	 * and all implied tags with a key that didn't occur in the original group.
-	 *
-	 * @param tags  tag group to apply implications to; != null
-	 */
-	public TagGroup apply(TagGroup tags) {
+    /**
+     * applies this implication to a tag group.
+     * The resulting tag group will contain all tags from the original group
+     * and all implied tags with a key that didn't occur in the original group.
+     *
+     * @param tags  tag group to apply implications to; != null
+     */
+    public TagGroup apply(TagGroup tags) {
 
-		if (condition.matches(tags)) {
+        if (condition.matches(tags)) {
 
-			Map<String, String> newTagMap = new HashMap<String, String>();
+            Map<String, String> newTagMap = new HashMap<String, String>();
 
-			for (Tag tag : tags) {
-				newTagMap.put(tag.key, tag.value);
-			}
+            for (Tag tag : tags) {
+                newTagMap.put(tag.key, tag.value);
+            }
 
-			for (Tag impliedTag : impliedTags) {
-				if (!newTagMap.containsKey(impliedTag.key)) {
-					newTagMap.put(impliedTag.key, impliedTag.value);
-				}
-			}
+            for (Tag impliedTag : impliedTags) {
+                if (!newTagMap.containsKey(impliedTag.key)) {
+                    newTagMap.put(impliedTag.key, impliedTag.value);
+                }
+            }
 
-			return new MapBasedTagGroup(newTagMap);
+            return new MapBasedTagGroup(newTagMap);
 
-		} else {
-			return tags;
-		}
+        } else {
+            return tags;
+        }
 
-	}
+    }
 
-	@Override
-	public String toString() {
-		return condition.toString() + " => " + impliedTags.toString();
-	}
+    @Override
+    public String toString() {
+        return condition.toString() + " => " + impliedTags.toString();
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/ImplicationXMLReader.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/ImplicationXMLReader.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/ImplicationXMLReader.java	(revision 23189)
@@ -17,278 +17,278 @@
 public class ImplicationXMLReader {
 
-	private final List<Implication> implications = new LinkedList<Implication>();
-
-	private static enum State {BEFORE_IMPLICATION, BEFORE_CONDITION, CONDITION, BEFORE_IMPLIES, IMPLIES, AFTER_IMPLIES};
-	private State state = State.BEFORE_IMPLICATION;
-
-	private ConditionReader currentConditionReader;
-	private TagCondition currentCondition;
-	private Collection<Tag> currentImpliedTags;
-
-	boolean tagOpen = false;
-
-	public void startElement(String uri, String localName, String name, Attributes attributes)
-	throws SAXException {
-
-		switch (state) {
-
-			case BEFORE_IMPLICATION:
-
-				if ("implication".equals(name)) {
-					state = State.BEFORE_CONDITION;
-					return;
-				}
-				break;
-
-			case BEFORE_CONDITION:
-
-				if ("condition".equals(name)) {
-					currentConditionReader = new ConditionReader();
-					state = State.CONDITION;
-					return;
-				}
-				break;
-
-			case CONDITION:
-				currentConditionReader.startElement(uri, localName, name, attributes);
-				return;
-
-			case BEFORE_IMPLIES:
-
-				if ("implies".equals(name)) {
-					currentImpliedTags = new LinkedList<Tag>();
-					state = State.IMPLIES;
-					return;
-				}
-				break;
-
-			case IMPLIES:
-
-				if ("tag".equals(name)) {
-					if (tagOpen) {
-						throw new SAXException("tag element inside other tag element");
-					}
-					currentImpliedTags.add(readTag(attributes));
-					tagOpen = true;
-					return;
-				}
-				break;
-
-		}
-
-		//all vaild paths end with return; reaching this indicates an invalid tag
-		throw new SAXException("invalid opening xml tag <" + name + "> in state " + state);
-
-	}
-
-	public void endElement(String uri, String localName, String name)
-	throws SAXException {
-
-		switch (state) {
-
-			case CONDITION:
-
-				if (name.equals("condition")) {
-					if (!currentConditionReader.isFinished()) {
-						throw new SAXException("condition isn't finished at </condition> tag");
-					} else {
-						currentCondition = currentConditionReader.getCondition();
-						currentConditionReader = null;
-						state = State.BEFORE_IMPLIES;
-						return;
-					}
-				} else {
-					currentConditionReader.endElement(uri, localName, name);
-					return;
-				}
-
-			case IMPLIES:
-
-				if (name.equals("implies")) {
-					state = State.AFTER_IMPLIES;
-					return;
-				} else if (name.equals("tag")) {
-					if (!tagOpen) {
-						throw new SAXException("closing tag element that was not open");
-					}
-					tagOpen = false;
-					return;
-				}
-				break;
-
-			case AFTER_IMPLIES:
-
-				if (name.equals("implication")) {
-					implications.add(new Implication(currentCondition, currentImpliedTags));
-					currentCondition = null;
-					currentImpliedTags = null;
-					state = State.BEFORE_IMPLICATION;
-					return;
-				}
-				break;
-
-		}
-
-		//all vaild paths end with return; reaching this indicates an invalid tag
-		throw new SAXException("invalid closing xml tag </" + name + "> in state " + state);
-
-	}
-
-	public List<Implication> getImplications() throws SAXException {
-
-		if (state != State.BEFORE_IMPLICATION) {
-			throw new SAXException("some tags not been closed; now in state " + state);
-		} else {
-			return new ArrayList<Implication>(implications);
-		}
-	}
-
-	private static Tag readTag(Attributes attributes) throws SAXException {
-
-		String key = attributes.getValue("k");
-		String value = attributes.getValue("v");
-
-		if (key == null) {
-			throw new SAXException("tag without key");
-		} else if (value == null) {
-			throw new SAXException("tag without value (key is " + key + ")");
-		}
-
-		return new Tag(key, value);
-	}
-
-	private static String readKey(Attributes attributes) throws SAXException {
-
-		String key = attributes.getValue("k");
-
-		if (key == null) {
-			throw new SAXException("key element without attribute k");
-		}
-
-		return key;
-	}
-
-	/**
-	 * class to be used for reading tag condition sections of xml files
-	 */
-	private static class ConditionReader {
-
-		String openingName;
-		TagCondition condition;
-		boolean finished;
-
-		private final List<ConditionReader> childReaders = new LinkedList<ConditionReader>();
-		private ConditionReader currentChildReader = null;
-
-		public void startElement(String uri, String localName, String name, Attributes attributes)
-		throws SAXException {
-
-			if (finished) {
-				throw new SAXException("condition is already finished at <" + name + ">");
-			}
-
-			if (currentChildReader != null) {
-				currentChildReader.startElement(uri, localName, name, attributes);
-				return;
-			}
-
-			//first tag is start tag of this condition
-			if (openingName == null) {
-
-				openingName = name;
-
-				if ("tag".equals(name)) {
-					condition = TagConditionLogic.tag(readTag(attributes));
-				} else if ("key".equals(name)) {
-					condition = TagConditionLogic.key(readKey(attributes));
-				} else if (!("or".equals(name)) && !("and".equals(name)) && !("not".equals(name))) {
-					throw new SAXException("unknown tag for condition: " + name);
-				}
-
-				//all tags after the first are start tags of child conditions
-			} else {
-
-				if ("tag".equals(openingName) || "key".equals(openingName)) {
-					throw new SAXException("element must not have childs: " + openingName);
-				}
-
-				currentChildReader = new ConditionReader();
-				currentChildReader.startElement(uri, localName, name, attributes);
-
-			}
-
-		}
-
-		public void endElement(String uri, String localName, String name)
-		throws SAXException {
-
-			if (finished) {
-				throw new SAXException("condition is already finished at </" + name + ">");
-			}
-
-			/* if active child reader exists, pass parameter to it. */
-			if (currentChildReader != null) {
-
-				currentChildReader.endElement(uri, localName, name);
-
-				if (currentChildReader.isFinished()) {
-					childReaders.add(currentChildReader);
-					currentChildReader = null;
-				}
-
-			} else {
-
-				if (openingName.equals(name)) {
-
-					List<TagCondition> childConditions = new ArrayList<TagCondition>();
-					for (ConditionReader childReader : childReaders) {
-						childConditions.add(childReader.getCondition());
-					}
-
-					if ("and".equals(openingName)) {
-						if (childConditions.size() > 0) {
-							condition = TagConditionLogic.and(childConditions);
-						} else {
-							throw new SAXException("<and> needs at least one child");
-						}
-					} else if ("or".equals(openingName)) {
-						if (childConditions.size() > 0) {
-							condition = TagConditionLogic.or(childConditions);
-						} else {
-							throw new SAXException("<or> needs at least one child");
-						}
-					} else if ("not".equals(openingName)) {
-						if (childConditions.size() == 1) {
-							condition = TagConditionLogic.not(childConditions.get(0));
-						} else {
-							throw new SAXException("<not> needs at least one child");
-						}
-					}
-
-					finished = true;
-
-				} else {
-					throw new SAXException("wrong closing tag " + name +
-							" (</" + openingName + "> expected");
-				}
-
-			}
-
-		}
-
-		public boolean isFinished() {
-			return finished;
-		}
-
-		public TagCondition getCondition() {
-			if (!finished) {
-				throw new IllegalStateException("condition " + openingName + " not yet finished");
-			} else {
-				assert condition != null;
-				return condition;
-			}
-		}
-
-	}
+    private final List<Implication> implications = new LinkedList<Implication>();
+
+    private static enum State {BEFORE_IMPLICATION, BEFORE_CONDITION, CONDITION, BEFORE_IMPLIES, IMPLIES, AFTER_IMPLIES};
+    private State state = State.BEFORE_IMPLICATION;
+
+    private ConditionReader currentConditionReader;
+    private TagCondition currentCondition;
+    private Collection<Tag> currentImpliedTags;
+
+    boolean tagOpen = false;
+
+    public void startElement(String uri, String localName, String name, Attributes attributes)
+    throws SAXException {
+
+        switch (state) {
+
+            case BEFORE_IMPLICATION:
+
+                if ("implication".equals(name)) {
+                    state = State.BEFORE_CONDITION;
+                    return;
+                }
+                break;
+
+            case BEFORE_CONDITION:
+
+                if ("condition".equals(name)) {
+                    currentConditionReader = new ConditionReader();
+                    state = State.CONDITION;
+                    return;
+                }
+                break;
+
+            case CONDITION:
+                currentConditionReader.startElement(uri, localName, name, attributes);
+                return;
+
+            case BEFORE_IMPLIES:
+
+                if ("implies".equals(name)) {
+                    currentImpliedTags = new LinkedList<Tag>();
+                    state = State.IMPLIES;
+                    return;
+                }
+                break;
+
+            case IMPLIES:
+
+                if ("tag".equals(name)) {
+                    if (tagOpen) {
+                        throw new SAXException("tag element inside other tag element");
+                    }
+                    currentImpliedTags.add(readTag(attributes));
+                    tagOpen = true;
+                    return;
+                }
+                break;
+
+        }
+
+        //all vaild paths end with return; reaching this indicates an invalid tag
+        throw new SAXException("invalid opening xml tag <" + name + "> in state " + state);
+
+    }
+
+    public void endElement(String uri, String localName, String name)
+    throws SAXException {
+
+        switch (state) {
+
+            case CONDITION:
+
+                if (name.equals("condition")) {
+                    if (!currentConditionReader.isFinished()) {
+                        throw new SAXException("condition isn't finished at </condition> tag");
+                    } else {
+                        currentCondition = currentConditionReader.getCondition();
+                        currentConditionReader = null;
+                        state = State.BEFORE_IMPLIES;
+                        return;
+                    }
+                } else {
+                    currentConditionReader.endElement(uri, localName, name);
+                    return;
+                }
+
+            case IMPLIES:
+
+                if (name.equals("implies")) {
+                    state = State.AFTER_IMPLIES;
+                    return;
+                } else if (name.equals("tag")) {
+                    if (!tagOpen) {
+                        throw new SAXException("closing tag element that was not open");
+                    }
+                    tagOpen = false;
+                    return;
+                }
+                break;
+
+            case AFTER_IMPLIES:
+
+                if (name.equals("implication")) {
+                    implications.add(new Implication(currentCondition, currentImpliedTags));
+                    currentCondition = null;
+                    currentImpliedTags = null;
+                    state = State.BEFORE_IMPLICATION;
+                    return;
+                }
+                break;
+
+        }
+
+        //all vaild paths end with return; reaching this indicates an invalid tag
+        throw new SAXException("invalid closing xml tag </" + name + "> in state " + state);
+
+    }
+
+    public List<Implication> getImplications() throws SAXException {
+
+        if (state != State.BEFORE_IMPLICATION) {
+            throw new SAXException("some tags not been closed; now in state " + state);
+        } else {
+            return new ArrayList<Implication>(implications);
+        }
+    }
+
+    private static Tag readTag(Attributes attributes) throws SAXException {
+
+        String key = attributes.getValue("k");
+        String value = attributes.getValue("v");
+
+        if (key == null) {
+            throw new SAXException("tag without key");
+        } else if (value == null) {
+            throw new SAXException("tag without value (key is " + key + ")");
+        }
+
+        return new Tag(key, value);
+    }
+
+    private static String readKey(Attributes attributes) throws SAXException {
+
+        String key = attributes.getValue("k");
+
+        if (key == null) {
+            throw new SAXException("key element without attribute k");
+        }
+
+        return key;
+    }
+
+    /**
+     * class to be used for reading tag condition sections of xml files
+     */
+    private static class ConditionReader {
+
+        String openingName;
+        TagCondition condition;
+        boolean finished;
+
+        private final List<ConditionReader> childReaders = new LinkedList<ConditionReader>();
+        private ConditionReader currentChildReader = null;
+
+        public void startElement(String uri, String localName, String name, Attributes attributes)
+        throws SAXException {
+
+            if (finished) {
+                throw new SAXException("condition is already finished at <" + name + ">");
+            }
+
+            if (currentChildReader != null) {
+                currentChildReader.startElement(uri, localName, name, attributes);
+                return;
+            }
+
+            //first tag is start tag of this condition
+            if (openingName == null) {
+
+                openingName = name;
+
+                if ("tag".equals(name)) {
+                    condition = TagConditionLogic.tag(readTag(attributes));
+                } else if ("key".equals(name)) {
+                    condition = TagConditionLogic.key(readKey(attributes));
+                } else if (!("or".equals(name)) && !("and".equals(name)) && !("not".equals(name))) {
+                    throw new SAXException("unknown tag for condition: " + name);
+                }
+
+                //all tags after the first are start tags of child conditions
+            } else {
+
+                if ("tag".equals(openingName) || "key".equals(openingName)) {
+                    throw new SAXException("element must not have childs: " + openingName);
+                }
+
+                currentChildReader = new ConditionReader();
+                currentChildReader.startElement(uri, localName, name, attributes);
+
+            }
+
+        }
+
+        public void endElement(String uri, String localName, String name)
+        throws SAXException {
+
+            if (finished) {
+                throw new SAXException("condition is already finished at </" + name + ">");
+            }
+
+            /* if active child reader exists, pass parameter to it. */
+            if (currentChildReader != null) {
+
+                currentChildReader.endElement(uri, localName, name);
+
+                if (currentChildReader.isFinished()) {
+                    childReaders.add(currentChildReader);
+                    currentChildReader = null;
+                }
+
+            } else {
+
+                if (openingName.equals(name)) {
+
+                    List<TagCondition> childConditions = new ArrayList<TagCondition>();
+                    for (ConditionReader childReader : childReaders) {
+                        childConditions.add(childReader.getCondition());
+                    }
+
+                    if ("and".equals(openingName)) {
+                        if (childConditions.size() > 0) {
+                            condition = TagConditionLogic.and(childConditions);
+                        } else {
+                            throw new SAXException("<and> needs at least one child");
+                        }
+                    } else if ("or".equals(openingName)) {
+                        if (childConditions.size() > 0) {
+                            condition = TagConditionLogic.or(childConditions);
+                        } else {
+                            throw new SAXException("<or> needs at least one child");
+                        }
+                    } else if ("not".equals(openingName)) {
+                        if (childConditions.size() == 1) {
+                            condition = TagConditionLogic.not(childConditions.get(0));
+                        } else {
+                            throw new SAXException("<not> needs at least one child");
+                        }
+                    }
+
+                    finished = true;
+
+                } else {
+                    throw new SAXException("wrong closing tag " + name +
+                            " (</" + openingName + "> expected");
+                }
+
+            }
+
+        }
+
+        public boolean isFinished() {
+            return finished;
+        }
+
+        public TagCondition getCondition() {
+            if (!finished) {
+                throw new IllegalStateException("condition " + openingName + " not yet finished");
+            } else {
+                assert condition != null;
+                return condition;
+            }
+        }
+
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/RulesetAccessEvaluator.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/RulesetAccessEvaluator.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/access/RulesetAccessEvaluator.java	(revision 23189)
@@ -18,181 +18,181 @@
 public class RulesetAccessEvaluator<N, W, R, M> implements AccessEvaluator<N, W> {
 
-	private final DataSource<N, W, R, M> dataSource;
-	private final AccessRuleset ruleset;
-	private final AccessParameters parameters;
+    private final DataSource<N, W, R, M> dataSource;
+    private final AccessRuleset ruleset;
+    private final AccessParameters parameters;
 
-	/**
-	 * @param dataSource  object that allows access to data objects and tags/members; != null
-	 * @param ruleset     ruleset that is used for evaluation; != null
-	 * @param parameters  parameters object that describes the vehicle
-	 *                    and situation to evaluate access for; != null
-	 */
-	public RulesetAccessEvaluator(DataSource<N, W, R, M> dataSource, AccessRuleset ruleset, AccessParameters parameters) {
-		assert dataSource != null && ruleset != null && parameters != null;
+    /**
+     * @param dataSource  object that allows access to data objects and tags/members; != null
+     * @param ruleset     ruleset that is used for evaluation; != null
+     * @param parameters  parameters object that describes the vehicle
+     *                    and situation to evaluate access for; != null
+     */
+    public RulesetAccessEvaluator(DataSource<N, W, R, M> dataSource, AccessRuleset ruleset, AccessParameters parameters) {
+        assert dataSource != null && ruleset != null && parameters != null;
 
-		this.dataSource = dataSource;
-		this.ruleset = ruleset;
-		this.parameters = parameters;
+        this.dataSource = dataSource;
+        this.ruleset = ruleset;
+        this.parameters = parameters;
 
-	}
+    }
 
-	public boolean wayUsable(W way, boolean forward,
-			Map<RoadPropertyType<?>, Object> segmentPropertyValues) {
+    public boolean wayUsable(W way, boolean forward,
+            Map<RoadPropertyType<?>, Object> segmentPropertyValues) {
 
-		TagGroup wayTags = dataSource.getTagsW(way);
+        TagGroup wayTags = dataSource.getTagsW(way);
 
-		TagGroup wayTagsWithImplications = new MapBasedTagGroup(wayTags);
-		for (Implication implication : ruleset.getImplications()) {
-			wayTagsWithImplications = implication.apply(wayTagsWithImplications);
-		}
+        TagGroup wayTagsWithImplications = new MapBasedTagGroup(wayTags);
+        for (Implication implication : ruleset.getImplications()) {
+            wayTagsWithImplications = implication.apply(wayTagsWithImplications);
+        }
 
-		/* check base tagging */
+        /* check base tagging */
 
-		boolean usableWay = false;
-		for (Tag tag : ruleset.getBaseTags()) {
-			if (wayTags.contains(tag)) {
-				usableWay = true;
-				break;
-			}
-		}
+        boolean usableWay = false;
+        for (Tag tag : ruleset.getBaseTags()) {
+            if (wayTags.contains(tag)) {
+                usableWay = true;
+                break;
+            }
+        }
 
-		if (!usableWay) {
-			return false;
-		}
+        if (!usableWay) {
+            return false;
+        }
 
-		/* evaluate one-way tagging */
+        /* evaluate one-way tagging */
 
-		String onewayValue =  wayTagsWithImplications.getValue("oneway");
+        String onewayValue =  wayTagsWithImplications.getValue("oneway");
 
-		if (forward && "-1".equals(onewayValue)
-				&& !"foot".equals(parameters.getAccessClass())) {
-			return false;
-		}
+        if (forward && "-1".equals(onewayValue)
+                && !"foot".equals(parameters.getAccessClass())) {
+            return false;
+        }
 
-		if (!forward
-				&& ("1".equals(onewayValue) || "yes".equals(onewayValue) || "true".equals(onewayValue))
-				&& !"foot".equals(parameters.getAccessClass())) {
-			return false;
-		}
+        if (!forward
+                && ("1".equals(onewayValue) || "yes".equals(onewayValue) || "true".equals(onewayValue))
+                && !"foot".equals(parameters.getAccessClass())) {
+            return false;
+        }
 
-		/* evaluate properties and access tagging */
+        /* evaluate properties and access tagging */
 
-		return objectUsable(segmentPropertyValues, wayTags);
-	}
+        return objectUsable(segmentPropertyValues, wayTags);
+    }
 
-	public boolean nodeUsable(N node, Map<RoadPropertyType<?>,Object> roadPropertyValues) {
+    public boolean nodeUsable(N node, Map<RoadPropertyType<?>,Object> roadPropertyValues) {
 
-		TagGroup nodeTags = dataSource.getTagsN(node);
+        TagGroup nodeTags = dataSource.getTagsN(node);
 
-		return objectUsable(roadPropertyValues, nodeTags);
-	};
+        return objectUsable(roadPropertyValues, nodeTags);
+    };
 
-	private boolean objectUsable(Map<RoadPropertyType<?>, Object> roadPropertyValues,
-			TagGroup tags) {
+    private boolean objectUsable(Map<RoadPropertyType<?>, Object> roadPropertyValues,
+            TagGroup tags) {
 
-		/* evaluate road properties */
+        /* evaluate road properties */
 
-		for (RoadPropertyType<?> property : roadPropertyValues.keySet()) {
-			if (!property.isUsable(roadPropertyValues.get(property), parameters)) {
-				return false;
-			}
-		}
+        for (RoadPropertyType<?> property : roadPropertyValues.keySet()) {
+            if (!property.isUsable(roadPropertyValues.get(property), parameters)) {
+                return false;
+            }
+        }
 
-		/* evaluate access type */
+        /* evaluate access type */
 
-		AccessType accessType = UNDEFINED;
+        AccessType accessType = UNDEFINED;
 
-		if (tags.size() > 0) {
+        if (tags.size() > 0) {
 
-			Map<String, AccessType> accessTypePerClass =
-				createAccessTypePerClassMap(tags, ruleset.getAccessHierarchyAncestors(parameters.getAccessClass()));
+            Map<String, AccessType> accessTypePerClass =
+                createAccessTypePerClassMap(tags, ruleset.getAccessHierarchyAncestors(parameters.getAccessClass()));
 
-			for (String accessClass : ruleset.getAccessHierarchyAncestors(parameters.getAccessClass())) {
-				accessType = accessTypePerClass.get(accessClass);
-				if (accessType != UNDEFINED) { break; }
-			}
+            for (String accessClass : ruleset.getAccessHierarchyAncestors(parameters.getAccessClass())) {
+                accessType = accessTypePerClass.get(accessClass);
+                if (accessType != UNDEFINED) { break; }
+            }
 
-		}
+        }
 
-		return parameters.getAccessTypeUsable(accessType);
-	}
+        return parameters.getAccessTypeUsable(accessType);
+    }
 
-	private Map<String, AccessType> createAccessTypePerClassMap(
-			TagGroup wayTags, Collection<String> accessClasses) {
+    private Map<String, AccessType> createAccessTypePerClassMap(
+            TagGroup wayTags, Collection<String> accessClasses) {
 
-		/*
-		 * create map and fill with UNDEFINED values
-		 * (this also allows to use keySet instead of accessClasses later)
-		 */
+        /*
+         * create map and fill with UNDEFINED values
+         * (this also allows to use keySet instead of accessClasses later)
+         */
 
-		Map<String, AccessType> accessTypePerClass = new HashMap<String, AccessType>();
+        Map<String, AccessType> accessTypePerClass = new HashMap<String, AccessType>();
 
-		for (String accessClass : accessClasses) {
-			accessTypePerClass.put(accessClass, AccessType.UNDEFINED);
-		}
+        for (String accessClass : accessClasses) {
+            accessTypePerClass.put(accessClass, AccessType.UNDEFINED);
+        }
 
-		/* evaluate implied tagging of base tag */
+        /* evaluate implied tagging of base tag */
 
-		Tag baseTag = null;
-		for (Tag tag : wayTags) {
-			if (ruleset.getBaseTags().contains(tag)) {
-				baseTag = tag;
-				break;
-			}
-		}
+        Tag baseTag = null;
+        for (Tag tag : wayTags) {
+            if (ruleset.getBaseTags().contains(tag)) {
+                baseTag = tag;
+                break;
+            }
+        }
 
-		if (baseTag != null) {
+        if (baseTag != null) {
 
-			TagGroup tagsWithBaseImplications = new MapBasedTagGroup(baseTag);
-			for (Implication implication : ruleset.getImplications()) {
-				tagsWithBaseImplications = implication.apply(tagsWithBaseImplications);
-			}
+            TagGroup tagsWithBaseImplications = new MapBasedTagGroup(baseTag);
+            for (Implication implication : ruleset.getImplications()) {
+                tagsWithBaseImplications = implication.apply(tagsWithBaseImplications);
+            }
 
-			setAccessTypesFromTags(accessTypePerClass, tagsWithBaseImplications);
+            setAccessTypesFromTags(accessTypePerClass, tagsWithBaseImplications);
 
-		}
+        }
 
-		/* evaluate implied tagging of other tags */
+        /* evaluate implied tagging of other tags */
 
-		Map<String, String> tagMap = new HashMap<String, String>();
-		for (Tag tag : wayTags) {
-			if (!tag.equals(baseTag)) {
-				tagMap.put(tag.key, tag.value);
-			}
-		}
+        Map<String, String> tagMap = new HashMap<String, String>();
+        for (Tag tag : wayTags) {
+            if (!tag.equals(baseTag)) {
+                tagMap.put(tag.key, tag.value);
+            }
+        }
 
-		TagGroup tagsWithOtherImplications = new MapBasedTagGroup(tagMap);
-		for (Implication implication : ruleset.getImplications()) {
-			tagsWithOtherImplications = implication.apply(tagsWithOtherImplications);
-		}
+        TagGroup tagsWithOtherImplications = new MapBasedTagGroup(tagMap);
+        for (Implication implication : ruleset.getImplications()) {
+            tagsWithOtherImplications = implication.apply(tagsWithOtherImplications);
+        }
 
-		setAccessTypesFromTags(accessTypePerClass, tagsWithOtherImplications);
+        setAccessTypesFromTags(accessTypePerClass, tagsWithOtherImplications);
 
-		/* evaluate explicit access tagging */
+        /* evaluate explicit access tagging */
 
-		for (String key : ruleset.getAccessHierarchyAncestors(parameters.getAccessClass())) {
-			String value = wayTags.getValue(key);
-			if (value != null) {
-				AccessType accessType = AccessType.getAccessType(value);
-				accessTypePerClass.put(key, accessType);
-			}
-		}
+        for (String key : ruleset.getAccessHierarchyAncestors(parameters.getAccessClass())) {
+            String value = wayTags.getValue(key);
+            if (value != null) {
+                AccessType accessType = AccessType.getAccessType(value);
+                accessTypePerClass.put(key, accessType);
+            }
+        }
 
-		return accessTypePerClass;
-	}
+        return accessTypePerClass;
+    }
 
-	/**
-	 * adds all access information from a collection of tags to a [access class -> access type] map.
-	 * Existing entries will be replaced.
-	 */
-	private void setAccessTypesFromTags(Map<String, AccessType> accessTypePerClass, TagGroup tags) {
-		for (String accessClass : accessTypePerClass.keySet()) {
-			String value = tags.getValue(accessClass);
-			if (value != null) {
-				AccessType accessType = AccessType.getAccessType(value);
-				accessTypePerClass.put(accessClass, accessType);
-			}
-		}
-	}
+    /**
+     * adds all access information from a collection of tags to a [access class -> access type] map.
+     * Existing entries will be replaced.
+     */
+    private void setAccessTypesFromTags(Map<String, AccessType> accessTypePerClass, TagGroup tags) {
+        for (String accessClass : accessTypePerClass.keySet()) {
+            String value = tags.getValue(accessClass);
+            if (value != null) {
+                AccessType accessType = AccessType.getAccessType(value);
+                accessTypePerClass.put(accessClass, accessType);
+            }
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/DataSource.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/DataSource.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/DataSource.java	(revision 23189)
@@ -9,65 +9,65 @@
  */
 public interface DataSource<N, W, R, M> {
-	
-	/** returns all nodes */
-	public Iterable<N> getNodes();
 
-	/** returns all ways */
-	public Iterable<W> getWays();
+    /** returns all nodes */
+    public Iterable<N> getNodes();
 
-	/** returns all relations */
-	public Iterable<R> getRelations();
+    /** returns all ways */
+    public Iterable<W> getWays();
 
-	/** returns a node's latitude */
-	public double getLat(N node);
+    /** returns all relations */
+    public Iterable<R> getRelations();
 
-	/** returns a node's longitude */
-	public double getLon(N node);
+    /** returns a node's latitude */
+    public double getLat(N node);
 
-	/** returns a way's nodes */
-	public Iterable<N> getNodes(W way);
+    /** returns a node's longitude */
+    public double getLon(N node);
 
-	/** returns a relation's members */
-	public Iterable<M> getMembers(R relation);
+    /** returns a way's nodes */
+    public Iterable<N> getNodes(W way);
 
-	/** returns a node's tags */
-	public TagGroup getTagsN(N node);
+    /** returns a relation's members */
+    public Iterable<M> getMembers(R relation);
 
-	/** returns a way's tags */
-	public TagGroup getTagsW(W way);
+    /** returns a node's tags */
+    public TagGroup getTagsN(N node);
 
-	/** returns a relation's tags */
-	public TagGroup getTagsR(R relation);
+    /** returns a way's tags */
+    public TagGroup getTagsW(W way);
 
-	/** returns a relation member's role */
-	public String getRole(M member);
+    /** returns a relation's tags */
+    public TagGroup getTagsR(R relation);
 
-	/** returns a relation member's member object */
-	public Object getMember(M member);
-	
-	/** returns whether a relation member is a node */
-	public boolean isNMember(M member);
-	
-	/** returns whether a relation member is a way */
-	public boolean isWMember(M member);
-	
-	/** returns whether a relation member is a relation */
-	public boolean isRMember(M member);
-	
-	/**
-	 * adds an observer.
-	 * Does nothing if the parameter is already an observer of this DataSource.
-	 *
-	 * @param observer  observer object, != null
-	 */
-	public void addObserver(DataSourceObserver observer);
+    /** returns a relation member's role */
+    public String getRole(M member);
 
-	/**
-	 * deletes an observer that has been added using {@link #addObserver(DataSourceObserver)}.
-	 * Does nothing if the parameter isn't currently an observer of this DataSource.
-	 *
-	 * @param observer  observer object, != null
-	 */
-	public void deleteObserver(DataSourceObserver observer);
+    /** returns a relation member's member object */
+    public Object getMember(M member);
+
+    /** returns whether a relation member is a node */
+    public boolean isNMember(M member);
+
+    /** returns whether a relation member is a way */
+    public boolean isWMember(M member);
+
+    /** returns whether a relation member is a relation */
+    public boolean isRMember(M member);
+
+    /**
+     * adds an observer.
+     * Does nothing if the parameter is already an observer of this DataSource.
+     *
+     * @param observer  observer object, != null
+     */
+    public void addObserver(DataSourceObserver observer);
+
+    /**
+     * deletes an observer that has been added using {@link #addObserver(DataSourceObserver)}.
+     * Does nothing if the parameter isn't currently an observer of this DataSource.
+     *
+     * @param observer  observer object, != null
+     */
+    public void deleteObserver(DataSourceObserver observer);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/DataSourceObserver.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/DataSourceObserver.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/DataSourceObserver.java	(revision 23189)
@@ -8,9 +8,9 @@
 public interface DataSourceObserver {
 
-	/**
-	 * informs this observer about changes in an observed data source
-	 * @param dataSource  observed data source that has changed; != null
-	 */
-	public void update(DataSource<?, ?, ?, ?> dataSource);
+    /**
+     * informs this observer about changes in an observed data source
+     * @param dataSource  observed data source that has changed; != null
+     */
+    public void update(DataSource<?, ?, ?, ?> dataSource);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/MapBasedTagGroup.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/MapBasedTagGroup.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/MapBasedTagGroup.java	(revision 23189)
@@ -13,93 +13,93 @@
 public class MapBasedTagGroup implements TagGroup {
 
-	private final Map<String, String> tagMap;
+    private final Map<String, String> tagMap;
 
-	/**
-	 * @param tagMap  map from keys to values; != null;
-	 *                must not be modified after being used as parameter
-	 */
-	public MapBasedTagGroup(Map<String, String> tagMap) {
-		if (tagMap == null) {
-			throw new IllegalArgumentException();
-		}
+    /**
+     * @param tagMap  map from keys to values; != null;
+     *                must not be modified after being used as parameter
+     */
+    public MapBasedTagGroup(Map<String, String> tagMap) {
+        if (tagMap == null) {
+            throw new IllegalArgumentException();
+        }
 
-		this.tagMap = tagMap;
-	}
+        this.tagMap = tagMap;
+    }
 
-	/**
-	 * @param tags  tags to add to the group; != null, each != null
-	 */
-	public MapBasedTagGroup(Iterable<Tag> tags) {
-		if (tags == null) {
-			throw new IllegalArgumentException();
-		}
-		this.tagMap = new HashMap<String, String>();
-		for (Tag tag : tags) {
-			if (tag == null) {
-				throw new IllegalArgumentException();
-			} else {
-				this.tagMap.put(tag.key, tag.value);
-			}
-		}
-	}
+    /**
+     * @param tags  tags to add to the group; != null, each != null
+     */
+    public MapBasedTagGroup(Iterable<Tag> tags) {
+        if (tags == null) {
+            throw new IllegalArgumentException();
+        }
+        this.tagMap = new HashMap<String, String>();
+        for (Tag tag : tags) {
+            if (tag == null) {
+                throw new IllegalArgumentException();
+            } else {
+                this.tagMap.put(tag.key, tag.value);
+            }
+        }
+    }
 
-	/**
-	 * @param tags  tags to add to the group; each != null
-	 */
-	public MapBasedTagGroup(Tag... tags) {
-		this.tagMap = new HashMap<String, String>(tags.length);
-		for (Tag tag : tags) {
-			if (tag == null) {
-				throw new IllegalArgumentException();
-			} else {
-				this.tagMap.put(tag.key, tag.value);
-			}
-		}
-	}
+    /**
+     * @param tags  tags to add to the group; each != null
+     */
+    public MapBasedTagGroup(Tag... tags) {
+        this.tagMap = new HashMap<String, String>(tags.length);
+        for (Tag tag : tags) {
+            if (tag == null) {
+                throw new IllegalArgumentException();
+            } else {
+                this.tagMap.put(tag.key, tag.value);
+            }
+        }
+    }
 
-	public String getValue(String key) {
-		assert key != null;
-		return tagMap.get(key);
-	}
+    public String getValue(String key) {
+        assert key != null;
+        return tagMap.get(key);
+    }
 
-	public boolean containsKey(String key) {
-		assert key != null;
-		return tagMap.containsKey(key);
-	}
+    public boolean containsKey(String key) {
+        assert key != null;
+        return tagMap.containsKey(key);
+    }
 
-	public boolean containsValue(String value) {
-		assert value != null;
-		return tagMap.containsValue(value);
-	}
+    public boolean containsValue(String value) {
+        assert value != null;
+        return tagMap.containsValue(value);
+    }
 
-	public boolean contains(Tag tag) {
-		assert tag != null;
-		return tag.value.equals(tagMap.get(tag.key));
-	}
+    public boolean contains(Tag tag) {
+        assert tag != null;
+        return tag.value.equals(tagMap.get(tag.key));
+    }
 
-	public int size() {
-		return tagMap.size();
-	}
+    public int size() {
+        return tagMap.size();
+    }
 
-	/**
-	 * returns an Iterator providing access to all Tags.
-	 * The Iterator does not support the {@link Iterator#remove()} method.
-	 */
-	public Iterator<Tag> iterator() {
+    /**
+     * returns an Iterator providing access to all Tags.
+     * The Iterator does not support the {@link Iterator#remove()} method.
+     */
+    public Iterator<Tag> iterator() {
 
-		Collection<Tag> tagCollection = new LinkedList<Tag>();
+        Collection<Tag> tagCollection = new LinkedList<Tag>();
 
-		for (String key : tagMap.keySet()) {
-			tagCollection.add(new Tag(key, tagMap.get(key)));
-		}
+        for (String key : tagMap.keySet()) {
+            tagCollection.add(new Tag(key, tagMap.get(key)));
+        }
 
-		return Collections.unmodifiableCollection(tagCollection).iterator();
+        return Collections.unmodifiableCollection(tagCollection).iterator();
 
-	}
+    }
 
-	@Override
-	public String toString() {
-		return tagMap.toString();
-	}
+    @Override
+    public String toString() {
+        return tagMap.toString();
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/Tag.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/Tag.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/Tag.java	(revision 23189)
@@ -6,35 +6,35 @@
 public class Tag {
 
-	/** key of the tag; != null */
-	public final String key;
+    /** key of the tag; != null */
+    public final String key;
 
-	/** value of the tag; != null */
-	public final String value;
+    /** value of the tag; != null */
+    public final String value;
 
-	public Tag(String key, String value) {
-		assert key != null && value != null;
-		this.key = key;
-		this.value = value;
-	}
+    public Tag(String key, String value) {
+        assert key != null && value != null;
+        this.key = key;
+        this.value = value;
+    }
 
-	@Override
-	public boolean equals(Object obj) {
-		if (!(obj instanceof Tag)) {
-			return false;
-		} else {
-			Tag otherTag = (Tag)obj;
-			return key.equals(otherTag.key) && value.equals(otherTag.value);
-		}
-	}
+    @Override
+    public boolean equals(Object obj) {
+        if (!(obj instanceof Tag)) {
+            return false;
+        } else {
+            Tag otherTag = (Tag)obj;
+            return key.equals(otherTag.key) && value.equals(otherTag.value);
+        }
+    }
 
-	@Override
-	public int hashCode() {
-		return key.hashCode() + value.hashCode();
-	}
+    @Override
+    public int hashCode() {
+        return key.hashCode() + value.hashCode();
+    }
 
-	@Override
-	public String toString() {
-		return key + "=" + value;
-	}
+    @Override
+    public String toString() {
+        return key + "=" + value;
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/TagGroup.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/TagGroup.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/data/TagGroup.java	(revision 23189)
@@ -8,32 +8,32 @@
 public interface TagGroup extends Iterable<Tag> {
 
-	/**
-	 * returns the value for the given key or null if no tag in this group uses that key
-	 * @param key  key whose value will be returned; != null
-	 */
-	public String getValue(String key);
+    /**
+     * returns the value for the given key or null if no tag in this group uses that key
+     * @param key  key whose value will be returned; != null
+     */
+    public String getValue(String key);
 
-	/**
-	 * returns true if this tag group contains a tag with the given key
-	 * @param key  key to check for; != null
-	 */
-	public boolean containsKey(String key);
+    /**
+     * returns true if this tag group contains a tag with the given key
+     * @param key  key to check for; != null
+     */
+    public boolean containsKey(String key);
 
-	/**
-	 * returns true if this tag group contains at least one tag with the given value
-	 * @param value  value to check for; != null
-	 */
-	public boolean containsValue(String value);
+    /**
+     * returns true if this tag group contains at least one tag with the given value
+     * @param value  value to check for; != null
+     */
+    public boolean containsValue(String value);
 
-	/**
-	 * returns true if this tag group contains the given tag
-	 * @param tag  tag to check for; != null
-	 */
-	public boolean contains(Tag tag);
+    /**
+     * returns true if this tag group contains the given tag
+     * @param tag  tag to check for; != null
+     */
+    public boolean contains(Tag tag);
 
-	/**
-	 * returns the number of tags in this group
-	 */
-	public int size();
+    /**
+     * returns the number of tags in this group
+     */
+    public int size();
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/ConnectorEvaluationGroup.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/ConnectorEvaluationGroup.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/ConnectorEvaluationGroup.java	(revision 23189)
@@ -16,94 +16,94 @@
 public class ConnectorEvaluationGroup extends EvaluationGroup {
 
-	private final Set<Segment> segments;
-	private final List<SegmentNode> borderNodes;
+    private final Set<Segment> segments;
+    private final List<SegmentNode> borderNodes;
 
-	/**
-	 * @param segments     set of Segments, must not be modified
-	 *                     after being used as constructor parameter; != null
-	 * @param borderNodes  nodes that are used as starting/target nodes for sequences; != null
-	 */
-	public ConnectorEvaluationGroup(Set<Segment> segments, Set<SegmentNode> borderNodes) {
-		assert segments != null && borderNodes != null;
+    /**
+     * @param segments     set of Segments, must not be modified
+     *                     after being used as constructor parameter; != null
+     * @param borderNodes  nodes that are used as starting/target nodes for sequences; != null
+     */
+    public ConnectorEvaluationGroup(Set<Segment> segments, Set<SegmentNode> borderNodes) {
+        assert segments != null && borderNodes != null;
 
-		this.segments = segments;
-		this.borderNodes = new ArrayList<SegmentNode>(borderNodes);
-	}
+        this.segments = segments;
+        this.borderNodes = new ArrayList<SegmentNode>(borderNodes);
+    }
 
-	/**
-	 * returns all nodes that can be used as start/target nodes
-	 * @return  border nodes; != null
-	 */
-	public Collection<SegmentNode> getBorderNodes() {
-		return borderNodes;
-	}
+    /**
+     * returns all nodes that can be used as start/target nodes
+     * @return  border nodes; != null
+     */
+    public Collection<SegmentNode> getBorderNodes() {
+        return borderNodes;
+    }
 
-	/**
-	 * returns all segments in the group
-	 * @return  segment set; != null
-	 */
-	public Set<Segment> getSegments() {
-		return segments;
-	}
+    /**
+     * returns all segments in the group
+     * @return  segment set; != null
+     */
+    public Set<Segment> getSegments() {
+        return segments;
+    }
 
-	/**
-	 * returns a segment sequence that runs from an inbound to an outbound
-	 * segment or null if no connection is possible.
-	 * {@link EvaluationGroup#evaluate(Collection)} needs be called before this method.
-	 *
-	 * @param  startNode   start of the potential sequence; must be border node; != null
-	 * @param  targetNode  target of the potential sequence; must be border node; != null
-	 * @return             sequence of segments or null
-	 */
-	public List<Segment> getSegmentSequence(SegmentNode startNode, SegmentNode targetNode) {
-		assert startNode != null && borderNodes.contains(startNode);
-		assert targetNode != null && borderNodes.contains(targetNode);
+    /**
+     * returns a segment sequence that runs from an inbound to an outbound
+     * segment or null if no connection is possible.
+     * {@link EvaluationGroup#evaluate(Collection)} needs be called before this method.
+     *
+     * @param  startNode   start of the potential sequence; must be border node; != null
+     * @param  targetNode  target of the potential sequence; must be border node; != null
+     * @return             sequence of segments or null
+     */
+    public List<Segment> getSegmentSequence(SegmentNode startNode, SegmentNode targetNode) {
+        assert startNode != null && borderNodes.contains(startNode);
+        assert targetNode != null && borderNodes.contains(targetNode);
 
-		if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
+        if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
 
-		int inboundIndex = borderNodes.indexOf(startNode);
-		int outboundIndex = borderNodes.indexOf(targetNode);
+        int inboundIndex = borderNodes.indexOf(startNode);
+        int outboundIndex = borderNodes.indexOf(targetNode);
 
-		return segmentSequences[inboundIndex][outboundIndex];
-	}
+        return segmentSequences[inboundIndex][outboundIndex];
+    }
 
-	@Override
-	protected void evaluateImpl(Collection<Restriction> restrictions) {
+    @Override
+    protected void evaluateImpl(Collection<Restriction> restrictions) {
 
-		/* find segment sequences from inbound to outbound segments */
+        /* find segment sequences from inbound to outbound segments */
 
-		@SuppressWarnings("unchecked") //cannot create generic array without cast
-		List<Segment>[][] sequenceArray = new List[borderNodes.size()][borderNodes.size()];
+        @SuppressWarnings("unchecked") //cannot create generic array without cast
+        List<Segment>[][] sequenceArray = new List[borderNodes.size()][borderNodes.size()];
 
-		for (int startIndex = 0; startIndex < borderNodes.size(); startIndex ++) {
-			for (int targetIndex = 0; targetIndex < borderNodes.size(); targetIndex ++) {
+        for (int startIndex = 0; startIndex < borderNodes.size(); startIndex ++) {
+            for (int targetIndex = 0; targetIndex < borderNodes.size(); targetIndex ++) {
 
-				List<Segment> sequence =
-					findSegmentSequence(borderNodes.get(startIndex),
-							borderNodes.get(targetIndex), restrictions);
+                List<Segment> sequence =
+                    findSegmentSequence(borderNodes.get(startIndex),
+                            borderNodes.get(targetIndex), restrictions);
 
-				sequenceArray[startIndex][targetIndex] = sequence;
+                sequenceArray[startIndex][targetIndex] = sequence;
 
-			}
-		}
+            }
+        }
 
-		segmentSequences = sequenceArray;
-	}
+        segmentSequences = sequenceArray;
+    }
 
-	@Override
-	protected boolean isUsableNode(SegmentNode node) {
-		return shareElement(segments, node.getInboundSegments())
-		|| shareElement(segments, node.getOutboundSegments());
-	}
+    @Override
+    protected boolean isUsableNode(SegmentNode node) {
+        return shareElement(segments, node.getInboundSegments())
+        || shareElement(segments, node.getOutboundSegments());
+    }
 
-	@Override
-	protected boolean isUsableSegment(Segment segment) {
-		return segments.contains(segment);
-	}
+    @Override
+    protected boolean isUsableSegment(Segment segment) {
+        return segments.contains(segment);
+    }
 
-	@Override
-	public String toString() {
-		return "ConnectorEG " + segments;
-	}
+    @Override
+    public String toString() {
+        return "ConnectorEG " + segments;
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/EvaluationGroup.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/EvaluationGroup.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/EvaluationGroup.java	(revision 23189)
@@ -19,276 +19,276 @@
 abstract class EvaluationGroup {
 
-	protected boolean evaluated = false;
-
-	/**
-	 * array of sequences.
-	 * First index is inbound segment/start node index,
-	 * second index is outbound segment/target node index.
-	 * Will contain the segment sequence after evaluation or null if none exists.
-	 */
-	protected List<Segment>[][] segmentSequences;
-
-	private static final List<Segment> EMPTY_SEGMENT_LIST =
-		Collections.unmodifiableList(new ArrayList<Segment>(0));
-
-	private static final List<Restriction> EMPTY_RESTRICTION_LIST =
-		Collections.unmodifiableList(new ArrayList<Restriction>(0));
-
-	private static class State {
-		SegmentNode currentNode;
-		Set<SegmentNode> visitedNodes;
-		Collection<Restriction> activeRestrictions;
-		List<Segment> segmentHistory;
-	}
-
-
-	/**
-	 * tries to find a legal sequence of segments between two segment nodes.
-	 *
-	 * @return  list of segments if connection is possible, null otherwise.
-	 */
-	protected List<Segment> findSegmentSequence(
-			SegmentNode firstNode, SegmentNode lastNode,
-			Collection<Restriction> restrictions) {
-
-		return findSegmentSequence(firstNode, lastNode, restrictions,
-				EMPTY_RESTRICTION_LIST, EMPTY_RESTRICTION_LIST);
-
-	}
-
-	/**
-	 * tries to find a legal sequence of segments between two segments.
-	 *
-	 * @return  list of segments if connection is possible, null otherwise.
-	 *          The list does NOT include firstSegment and lastSegment,
-	 *          but they are considered for restrictions.
-	 */
-	protected List<Segment> findSegmentSequence(
-			Segment firstSegment, Segment lastSegment,
-			Collection<Restriction> restrictions) {
-
-		if (firstSegment == lastSegment) {
-
-			return EMPTY_SEGMENT_LIST;
-
-		} else {
-
-			Collection<Restriction> initiallyActiveRestrictions =
-				activeRestrictionsAfterSegment(firstSegment, EMPTY_RESTRICTION_LIST, restrictions);
-
-			Collection<Restriction> restrictionsForbiddenAtLastNode = new HashSet<Restriction>();
-			for (Restriction restriction : restrictions) {
-				if (restriction.getTos().contains(lastSegment)) {
-					restrictionsForbiddenAtLastNode.add(restriction);
-				}
-			}
-
-			return findSegmentSequence(
-					firstSegment.getNode2(), lastSegment.getNode1(), restrictions,
-					initiallyActiveRestrictions, restrictionsForbiddenAtLastNode);
-		}
-
-	}
-
-	/**
-	 * tries to find a legal sequence of segments between two segment nodes.
-	 *
-	 * @param restrictions  all restrictions that have to be taken into account
-	 * @param initiallyActiveRestrictions  restrictions that are already active at firstNode
-	 * @param restrictionsForbiddenAtLastNode  restrictions that must NOT be active at lastNode
-	 * @return  list of segments if connection is possible, null otherwise.
-	 */
-	private List<Segment> findSegmentSequence(
-			SegmentNode firstNode, SegmentNode lastNode,
-			Collection<Restriction> restrictions,
-			Collection<Restriction> initiallyActiveRestrictions,
-			Collection<Restriction> restrictionsForbiddenAtLastNode) {
-
-		if (firstNode == lastNode
-				&& !shareElement(initiallyActiveRestrictions, restrictionsForbiddenAtLastNode)) {
-			return EMPTY_SEGMENT_LIST;
-		}
-
-		Queue<State> stateQueue = new LinkedList<State>();
-		stateQueue.add(createStartingState(firstNode, initiallyActiveRestrictions));
-
-		/* search for a possible segment sequence */
-
-		while (stateQueue.size() > 0) {
-
-			State state = stateQueue.poll();
-
-			Collection<State> subsequentStates = createSubsequentStates(state, restrictions);
-
-			for (State subsequentState : subsequentStates) {
-				if (subsequentState.currentNode == lastNode
-						&& !shareElement(subsequentState.activeRestrictions,
-								restrictionsForbiddenAtLastNode)) {
-					return subsequentState.segmentHistory;
-				}
-			}
-
-			stateQueue.addAll(subsequentStates);
-
-		}
-
-		return null;
-	}
-
-	private static State createStartingState(SegmentNode firstNode,
-			Collection<Restriction> initiallyActiveRestrictions) {
-
-		State startingState = new State();
-		startingState.currentNode = firstNode;
-		startingState.activeRestrictions = initiallyActiveRestrictions;
-		startingState.segmentHistory = EMPTY_SEGMENT_LIST;
-		startingState.visitedNodes = new HashSet<SegmentNode>();
-		startingState.visitedNodes.add(firstNode);
-
-		return startingState;
-	}
-
-	private List<State> createSubsequentStates(State state, Collection<Restriction> allRestrictions) {
-
-		List<State> subsequentStates = new ArrayList<State>();
-
-		for (Segment segment : state.currentNode.getOutboundSegments()) {
-
-			if (isUsableSegment(segment) &&
-					isLegalSegment(segment, state.activeRestrictions)) {
-
-				State newState = new State();
-
-				newState.activeRestrictions = activeRestrictionsAfterSegment(
-						segment, state.activeRestrictions, allRestrictions);
-
-				newState.segmentHistory = new ArrayList<Segment>(state.segmentHistory.size() + 1);
-				newState.segmentHistory.addAll(state.segmentHistory);
-				newState.segmentHistory.add(segment);
-
-				newState.currentNode = segment.getNode2();
-
-				newState.visitedNodes = new HashSet<SegmentNode>(state.visitedNodes);
-				newState.visitedNodes.add(newState.currentNode);
-
-				/* add state to queue,
-				 * but avoid cycles as well as leaving the node set
-				 */
-
-				if (!state.visitedNodes.contains(newState.currentNode)
-						&& isUsableNode(newState.currentNode)) {
-
-					subsequentStates.add(newState);
-
-				}
-			}
-		}
-
-		return subsequentStates;
-	}
-
-	/**
-	 * returns all restrictions from a collection that have a segment as from member
-	 * @return  segment list; != null; must not be modified.
-	 *          May throw an exception when modifying is attempted.
-	 */
-	private static List<Restriction> getRestrictionsStartedBySegment(
-			Collection<Restriction> restrictions, Segment segment) {
-
-		List<Restriction> result = EMPTY_RESTRICTION_LIST;
-		for (Restriction restriction : restrictions) {
-			if (restriction.getFrom() == segment) {
-				if (result == EMPTY_RESTRICTION_LIST) {
-					result = new ArrayList<Restriction>(restrictions.size());
-				}
-				result.add(restriction);
-			}
-		}
-
-		return result;
-	}
-
-	private static Collection<Restriction> activeRestrictionsAfterSegment(Segment segment,
-			Collection<Restriction> activeRestrictionsBeforeSegment,
-			Collection<Restriction> allRestrictions) {
-
-		Collection<Restriction> result = EMPTY_RESTRICTION_LIST;
-
-		for (Restriction restriction : activeRestrictionsBeforeSegment) {
-			if (restriction.getVias().contains(segment)) {
-				if (result == EMPTY_RESTRICTION_LIST) {
-					result = new ArrayList<Restriction>(allRestrictions.size());
-				}
-				result.add(restriction);
-			}
-		}
-
-		Collection<Restriction> newRestrictions =
-			getRestrictionsStartedBySegment(allRestrictions, segment);
-
-		if (newRestrictions.size() > 0) {
-			if (result == EMPTY_RESTRICTION_LIST) {
-				result = newRestrictions;
-			} else {
-				result.addAll(newRestrictions);
-			}
-		}
-
-		return result;
-	}
-
-	private static boolean isLegalSegment(
-			Segment segment, Collection<Restriction> activeRestrictions) {
-
-		for (Restriction restriction : activeRestrictions) {
-			if (restriction.getTos().contains(segment)) {
-				return false;
-			}
-		}
-
-		return true;
-	}
-
-	/** returns true iff at least one element is contained in both collections */
-	protected static boolean shareElement(
-			Collection<?> collection1, Collection<?> collection2) {
-		for (Object element : collection1) {
-			if (collection2.contains(element)) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	public final void evaluate(Collection<Restriction> restrictions) {
-
-		if (evaluated) { return; }
-
-		evaluateImpl(restrictions);
-
-		evaluated = true;
-	}
-
-	/**
-	 * finds in- and outbound segments (if necessary) and segment sequences.
-	 * After calling this method, the group must be correctly evaluated
-	 * (see {@link #isCorrectlyEvaluated()}).
-	 *
-	 * @param restrictions  restrictions that are used when determining possible connections,
-	 *                      will not be modified; != null
-	 */
-	abstract protected void evaluateImpl(Collection<Restriction> restrictions);
-
-	/**
-	 * returns whether a node can be used while finding a segment sequence
-	 * @param node  node to check; != null
-	 */
-	abstract protected boolean isUsableNode(SegmentNode node);
-
-	/**
-	 * returns whether a segment can be used while finding a segment sequence
-	 * @param segment  segment to check; != null
-	 */
-	abstract protected boolean isUsableSegment(Segment segment);
+    protected boolean evaluated = false;
+
+    /**
+     * array of sequences.
+     * First index is inbound segment/start node index,
+     * second index is outbound segment/target node index.
+     * Will contain the segment sequence after evaluation or null if none exists.
+     */
+    protected List<Segment>[][] segmentSequences;
+
+    private static final List<Segment> EMPTY_SEGMENT_LIST =
+        Collections.unmodifiableList(new ArrayList<Segment>(0));
+
+    private static final List<Restriction> EMPTY_RESTRICTION_LIST =
+        Collections.unmodifiableList(new ArrayList<Restriction>(0));
+
+    private static class State {
+        SegmentNode currentNode;
+        Set<SegmentNode> visitedNodes;
+        Collection<Restriction> activeRestrictions;
+        List<Segment> segmentHistory;
+    }
+
+
+    /**
+     * tries to find a legal sequence of segments between two segment nodes.
+     *
+     * @return  list of segments if connection is possible, null otherwise.
+     */
+    protected List<Segment> findSegmentSequence(
+            SegmentNode firstNode, SegmentNode lastNode,
+            Collection<Restriction> restrictions) {
+
+        return findSegmentSequence(firstNode, lastNode, restrictions,
+                EMPTY_RESTRICTION_LIST, EMPTY_RESTRICTION_LIST);
+
+    }
+
+    /**
+     * tries to find a legal sequence of segments between two segments.
+     *
+     * @return  list of segments if connection is possible, null otherwise.
+     *          The list does NOT include firstSegment and lastSegment,
+     *          but they are considered for restrictions.
+     */
+    protected List<Segment> findSegmentSequence(
+            Segment firstSegment, Segment lastSegment,
+            Collection<Restriction> restrictions) {
+
+        if (firstSegment == lastSegment) {
+
+            return EMPTY_SEGMENT_LIST;
+
+        } else {
+
+            Collection<Restriction> initiallyActiveRestrictions =
+                activeRestrictionsAfterSegment(firstSegment, EMPTY_RESTRICTION_LIST, restrictions);
+
+            Collection<Restriction> restrictionsForbiddenAtLastNode = new HashSet<Restriction>();
+            for (Restriction restriction : restrictions) {
+                if (restriction.getTos().contains(lastSegment)) {
+                    restrictionsForbiddenAtLastNode.add(restriction);
+                }
+            }
+
+            return findSegmentSequence(
+                    firstSegment.getNode2(), lastSegment.getNode1(), restrictions,
+                    initiallyActiveRestrictions, restrictionsForbiddenAtLastNode);
+        }
+
+    }
+
+    /**
+     * tries to find a legal sequence of segments between two segment nodes.
+     *
+     * @param restrictions  all restrictions that have to be taken into account
+     * @param initiallyActiveRestrictions  restrictions that are already active at firstNode
+     * @param restrictionsForbiddenAtLastNode  restrictions that must NOT be active at lastNode
+     * @return  list of segments if connection is possible, null otherwise.
+     */
+    private List<Segment> findSegmentSequence(
+            SegmentNode firstNode, SegmentNode lastNode,
+            Collection<Restriction> restrictions,
+            Collection<Restriction> initiallyActiveRestrictions,
+            Collection<Restriction> restrictionsForbiddenAtLastNode) {
+
+        if (firstNode == lastNode
+                && !shareElement(initiallyActiveRestrictions, restrictionsForbiddenAtLastNode)) {
+            return EMPTY_SEGMENT_LIST;
+        }
+
+        Queue<State> stateQueue = new LinkedList<State>();
+        stateQueue.add(createStartingState(firstNode, initiallyActiveRestrictions));
+
+        /* search for a possible segment sequence */
+
+        while (stateQueue.size() > 0) {
+
+            State state = stateQueue.poll();
+
+            Collection<State> subsequentStates = createSubsequentStates(state, restrictions);
+
+            for (State subsequentState : subsequentStates) {
+                if (subsequentState.currentNode == lastNode
+                        && !shareElement(subsequentState.activeRestrictions,
+                                restrictionsForbiddenAtLastNode)) {
+                    return subsequentState.segmentHistory;
+                }
+            }
+
+            stateQueue.addAll(subsequentStates);
+
+        }
+
+        return null;
+    }
+
+    private static State createStartingState(SegmentNode firstNode,
+            Collection<Restriction> initiallyActiveRestrictions) {
+
+        State startingState = new State();
+        startingState.currentNode = firstNode;
+        startingState.activeRestrictions = initiallyActiveRestrictions;
+        startingState.segmentHistory = EMPTY_SEGMENT_LIST;
+        startingState.visitedNodes = new HashSet<SegmentNode>();
+        startingState.visitedNodes.add(firstNode);
+
+        return startingState;
+    }
+
+    private List<State> createSubsequentStates(State state, Collection<Restriction> allRestrictions) {
+
+        List<State> subsequentStates = new ArrayList<State>();
+
+        for (Segment segment : state.currentNode.getOutboundSegments()) {
+
+            if (isUsableSegment(segment) &&
+                    isLegalSegment(segment, state.activeRestrictions)) {
+
+                State newState = new State();
+
+                newState.activeRestrictions = activeRestrictionsAfterSegment(
+                        segment, state.activeRestrictions, allRestrictions);
+
+                newState.segmentHistory = new ArrayList<Segment>(state.segmentHistory.size() + 1);
+                newState.segmentHistory.addAll(state.segmentHistory);
+                newState.segmentHistory.add(segment);
+
+                newState.currentNode = segment.getNode2();
+
+                newState.visitedNodes = new HashSet<SegmentNode>(state.visitedNodes);
+                newState.visitedNodes.add(newState.currentNode);
+
+                /* add state to queue,
+                 * but avoid cycles as well as leaving the node set
+                 */
+
+                if (!state.visitedNodes.contains(newState.currentNode)
+                        && isUsableNode(newState.currentNode)) {
+
+                    subsequentStates.add(newState);
+
+                }
+            }
+        }
+
+        return subsequentStates;
+    }
+
+    /**
+     * returns all restrictions from a collection that have a segment as from member
+     * @return  segment list; != null; must not be modified.
+     *          May throw an exception when modifying is attempted.
+     */
+    private static List<Restriction> getRestrictionsStartedBySegment(
+            Collection<Restriction> restrictions, Segment segment) {
+
+        List<Restriction> result = EMPTY_RESTRICTION_LIST;
+        for (Restriction restriction : restrictions) {
+            if (restriction.getFrom() == segment) {
+                if (result == EMPTY_RESTRICTION_LIST) {
+                    result = new ArrayList<Restriction>(restrictions.size());
+                }
+                result.add(restriction);
+            }
+        }
+
+        return result;
+    }
+
+    private static Collection<Restriction> activeRestrictionsAfterSegment(Segment segment,
+            Collection<Restriction> activeRestrictionsBeforeSegment,
+            Collection<Restriction> allRestrictions) {
+
+        Collection<Restriction> result = EMPTY_RESTRICTION_LIST;
+
+        for (Restriction restriction : activeRestrictionsBeforeSegment) {
+            if (restriction.getVias().contains(segment)) {
+                if (result == EMPTY_RESTRICTION_LIST) {
+                    result = new ArrayList<Restriction>(allRestrictions.size());
+                }
+                result.add(restriction);
+            }
+        }
+
+        Collection<Restriction> newRestrictions =
+            getRestrictionsStartedBySegment(allRestrictions, segment);
+
+        if (newRestrictions.size() > 0) {
+            if (result == EMPTY_RESTRICTION_LIST) {
+                result = newRestrictions;
+            } else {
+                result.addAll(newRestrictions);
+            }
+        }
+
+        return result;
+    }
+
+    private static boolean isLegalSegment(
+            Segment segment, Collection<Restriction> activeRestrictions) {
+
+        for (Restriction restriction : activeRestrictions) {
+            if (restriction.getTos().contains(segment)) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    /** returns true iff at least one element is contained in both collections */
+    protected static boolean shareElement(
+            Collection<?> collection1, Collection<?> collection2) {
+        for (Object element : collection1) {
+            if (collection2.contains(element)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public final void evaluate(Collection<Restriction> restrictions) {
+
+        if (evaluated) { return; }
+
+        evaluateImpl(restrictions);
+
+        evaluated = true;
+    }
+
+    /**
+     * finds in- and outbound segments (if necessary) and segment sequences.
+     * After calling this method, the group must be correctly evaluated
+     * (see {@link #isCorrectlyEvaluated()}).
+     *
+     * @param restrictions  restrictions that are used when determining possible connections,
+     *                      will not be modified; != null
+     */
+    abstract protected void evaluateImpl(Collection<Restriction> restrictions);
+
+    /**
+     * returns whether a node can be used while finding a segment sequence
+     * @param node  node to check; != null
+     */
+    abstract protected boolean isUsableNode(SegmentNode node);
+
+    /**
+     * returns whether a segment can be used while finding a segment sequence
+     * @param segment  segment to check; != null
+     */
+    abstract protected boolean isUsableSegment(Segment segment);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/GraphEdge.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/GraphEdge.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/GraphEdge.java	(revision 23189)
@@ -12,15 +12,15 @@
 public interface GraphEdge {
 
-	/** returns the node this edge starts at; != null */
-	GraphNode getStartNode();
+    /** returns the node this edge starts at; != null */
+    GraphNode getStartNode();
 
-	/** returns the node this edge leads to; != null */
-	GraphNode getTargetNode();
+    /** returns the node this edge leads to; != null */
+    GraphNode getTargetNode();
 
-	/** returns all property types for which property values are available */
-	Collection<GraphEdgePropertyType<?>> getAvailableProperties();
-	
-	/** TODO */
-	<V> V getPropertyValue(GraphEdgePropertyType<V> property);
-	
+    /** returns all property types for which property values are available */
+    Collection<GraphEdgePropertyType<?>> getAvailableProperties();
+
+    /** TODO */
+    <V> V getPropertyValue(GraphEdgePropertyType<V> property);
+
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/GraphNode.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/GraphNode.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/GraphNode.java	(revision 23189)
@@ -13,28 +13,28 @@
 public interface GraphNode {
 
-	/**
-	 * returns all edges that lead to this GraphNode; != null
-	 */
-	public Collection<GraphEdge> getInboundEdges();
+    /**
+     * returns all edges that lead to this GraphNode; != null
+     */
+    public Collection<GraphEdge> getInboundEdges();
 
-	/**
-	 * returns all edges that start at this GraphNode; != null
-	 */
-	public Collection<GraphEdge> getOutboundEdges();
+    /**
+     * returns all edges that start at this GraphNode; != null
+     */
+    public Collection<GraphEdge> getOutboundEdges();
 
-	/**
-	 * returns the SegmentNode this GraphNode is based on
-	 *
-	 * @return  SegmentNode, must be one of the nodes of the Segment returned
-	 *          by {@link #getSegment()}; != null
-	 */
-	public SegmentNode getSegmentNode();
+    /**
+     * returns the SegmentNode this GraphNode is based on
+     *
+     * @return  SegmentNode, must be one of the nodes of the Segment returned
+     *          by {@link #getSegment()}; != null
+     */
+    public SegmentNode getSegmentNode();
 
-	/**
-	 * returns the Segment this GraphNode is based on
-	 *
-	 * @return  Segment; != null
-	 */
-	public Segment getSegment();
+    /**
+     * returns the Segment this GraphNode is based on
+     *
+     * @return  Segment; != null
+     */
+    public Segment getSegment();
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/JunctionEvaluationGroup.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/JunctionEvaluationGroup.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/JunctionEvaluationGroup.java	(revision 23189)
@@ -15,122 +15,122 @@
 public class JunctionEvaluationGroup extends EvaluationGroup {
 
-	private final Set<SegmentNode> segmentNodes;
+    private final Set<SegmentNode> segmentNodes;
 
-	protected List<Segment> inboundSegments;
-	protected List<Segment> outboundSegments;
+    protected List<Segment> inboundSegments;
+    protected List<Segment> outboundSegments;
 
-	/**
-	 * @param segmentNodes  set of SegmentNodes, must not be modified
-	 *                      after being used as constructor parameter; != null
-	 */
-	public JunctionEvaluationGroup(Set<SegmentNode> segmentNodes) {
-		assert segmentNodes != null;
-		this.segmentNodes = segmentNodes;
-	}
+    /**
+     * @param segmentNodes  set of SegmentNodes, must not be modified
+     *                      after being used as constructor parameter; != null
+     */
+    public JunctionEvaluationGroup(Set<SegmentNode> segmentNodes) {
+        assert segmentNodes != null;
+        this.segmentNodes = segmentNodes;
+    }
 
-	/**
-	 * returns all segments that can be used to enter this group.
-	 * {@link #evaluate(Iterable)} needs be called before this method.
-	 *
-	 * @return  segment collection; != null
-	 */
-	public Collection<Segment> getInboundSegments() {
-		if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
-		return inboundSegments;
-	}
+    /**
+     * returns all segments that can be used to enter this group.
+     * {@link #evaluate(Iterable)} needs be called before this method.
+     *
+     * @return  segment collection; != null
+     */
+    public Collection<Segment> getInboundSegments() {
+        if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
+        return inboundSegments;
+    }
 
-	/**
-	 * returns all segments that can be used to leave this group.
-	 * {@link #evaluate(Iterable)} needs be called before this method.
-	 *
-	 * @return  segment collection; != null
-	 */
-	public Collection<Segment> getOutboundSegments() {
-		if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
-		return outboundSegments;
-	}
+    /**
+     * returns all segments that can be used to leave this group.
+     * {@link #evaluate(Iterable)} needs be called before this method.
+     *
+     * @return  segment collection; != null
+     */
+    public Collection<Segment> getOutboundSegments() {
+        if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
+        return outboundSegments;
+    }
 
-	/**
-	 * returns a segment sequence that runs from an inbound to an outbound
-	 * segment or null if no connection is possible.
-	 * {@link EvaluationGroup#evaluate(Collection)} needs be called before this method.
-	 *
-	 * @param  inboundSegment  start of the potential sequence;
-	 *                         must be inbound segment; != null
-	 * @param  outboundSegment target of the potential sequence;
-	 *                         must be outbound segment; != null
-	 * @return  sequence of segments or null
-	 */
-	public List<Segment> getSegmentSequence(Segment inboundSegment, Segment outboundSegment) {
-		assert inboundSegment != null && inboundSegments.contains(inboundSegment);
-		assert outboundSegment != null && outboundSegments.contains(outboundSegment);
+    /**
+     * returns a segment sequence that runs from an inbound to an outbound
+     * segment or null if no connection is possible.
+     * {@link EvaluationGroup#evaluate(Collection)} needs be called before this method.
+     *
+     * @param  inboundSegment  start of the potential sequence;
+     *                         must be inbound segment; != null
+     * @param  outboundSegment target of the potential sequence;
+     *                         must be outbound segment; != null
+     * @return  sequence of segments or null
+     */
+    public List<Segment> getSegmentSequence(Segment inboundSegment, Segment outboundSegment) {
+        assert inboundSegment != null && inboundSegments.contains(inboundSegment);
+        assert outboundSegment != null && outboundSegments.contains(outboundSegment);
 
-		if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
+        if (!evaluated) { throw new IllegalStateException("group not yet evaluated"); }
 
-		int inboundIndex = inboundSegments.indexOf(inboundSegment);
-		int outboundIndex = outboundSegments.indexOf(outboundSegment);
+        int inboundIndex = inboundSegments.indexOf(inboundSegment);
+        int outboundIndex = outboundSegments.indexOf(outboundSegment);
 
-		return segmentSequences[inboundIndex][outboundIndex];
-	}
+        return segmentSequences[inboundIndex][outboundIndex];
+    }
 
-	@Override
-	protected void evaluateImpl(final Collection<Restriction> restrictions) {
+    @Override
+    protected void evaluateImpl(final Collection<Restriction> restrictions) {
 
-		assert restrictions != null;
+        assert restrictions != null;
 
-		/* find inbound and outbound segments. An inbound segment is a segment whose target
-		 * is in the set and whose start node isn't (analogous for outbound segments)       */
+        /* find inbound and outbound segments. An inbound segment is a segment whose target
+         * is in the set and whose start node isn't (analogous for outbound segments)       */
 
-		inboundSegments = new ArrayList<Segment>();
-		outboundSegments = new ArrayList<Segment>();
+        inboundSegments = new ArrayList<Segment>();
+        outboundSegments = new ArrayList<Segment>();
 
-		for (SegmentNode segmentNode : segmentNodes) {
-			for (Segment segment : segmentNode.getInboundSegments()) {
-				if (!segmentNodes.contains(segment.getNode1())) {
-					inboundSegments.add(segment);
-				}
-			}
-			for (Segment segment : segmentNode.getOutboundSegments()) {
-				if (!segmentNodes.contains(segment.getNode2())) {
-					outboundSegments.add(segment);
-				}
-			}
-		}
+        for (SegmentNode segmentNode : segmentNodes) {
+            for (Segment segment : segmentNode.getInboundSegments()) {
+                if (!segmentNodes.contains(segment.getNode1())) {
+                    inboundSegments.add(segment);
+                }
+            }
+            for (Segment segment : segmentNode.getOutboundSegments()) {
+                if (!segmentNodes.contains(segment.getNode2())) {
+                    outboundSegments.add(segment);
+                }
+            }
+        }
 
-		/* find segment sequences from inbound to outbound segments */
+        /* find segment sequences from inbound to outbound segments */
 
-		@SuppressWarnings("unchecked") //cannot create generic array without cast
-		List<Segment>[][] sequenceArray = new List[inboundSegments.size()][outboundSegments.size()];
+        @SuppressWarnings("unchecked") //cannot create generic array without cast
+        List<Segment>[][] sequenceArray = new List[inboundSegments.size()][outboundSegments.size()];
 
-		for (int inboundIndex = 0; inboundIndex < inboundSegments.size(); inboundIndex ++) {
-			for (int outboundIndex = 0; outboundIndex < outboundSegments.size(); outboundIndex ++) {
+        for (int inboundIndex = 0; inboundIndex < inboundSegments.size(); inboundIndex ++) {
+            for (int outboundIndex = 0; outboundIndex < outboundSegments.size(); outboundIndex ++) {
 
-				List<Segment> sequence =
-					findSegmentSequence(inboundSegments.get(inboundIndex),
-							outboundSegments.get(outboundIndex), restrictions);
+                List<Segment> sequence =
+                    findSegmentSequence(inboundSegments.get(inboundIndex),
+                            outboundSegments.get(outboundIndex), restrictions);
 
-				sequenceArray[inboundIndex][outboundIndex] = sequence;
+                sequenceArray[inboundIndex][outboundIndex] = sequence;
 
-			}
-		}
+            }
+        }
 
-		segmentSequences = sequenceArray;
+        segmentSequences = sequenceArray;
 
-	}
+    }
 
-	@Override
-	protected boolean isUsableNode(SegmentNode node) {
-		return segmentNodes.contains(node);
-	}
+    @Override
+    protected boolean isUsableNode(SegmentNode node) {
+        return segmentNodes.contains(node);
+    }
 
-	@Override
-	protected boolean isUsableSegment(Segment segment) {
-		return segmentNodes.contains(segment.getNode1())
-		&& segmentNodes.contains(segment.getNode2());
-	}
+    @Override
+    protected boolean isUsableSegment(Segment segment) {
+        return segmentNodes.contains(segment.getNode1())
+        && segmentNodes.contains(segment.getNode2());
+    }
 
-	@Override
-	public String toString() {
-		return "JunctionEG " + segmentNodes;
-	}
+    @Override
+    public String toString() {
+        return "JunctionEG " + segmentNodes;
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/TSBasedWayGraph.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/TSBasedWayGraph.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/TSBasedWayGraph.java	(revision 23189)
@@ -23,478 +23,478 @@
 public class TSBasedWayGraph implements WayGraph, TransitionStructureObserver {
 
-	private static final GraphEdgePropertyType<?>[] PROPERTY_TYPES =
-		{GraphEdgeSegments.PROPERTY};
-		//TODO: -> parameter
-	
-	private static class GraphNodeImpl implements GraphNode {
-		private final SegmentNode node;
-		private final Segment segment;
-		private final List<GraphEdge> incomingEdges = new ArrayList<GraphEdge>();
-		private final List<GraphEdge> outgoingEdges = new ArrayList<GraphEdge>();
-		public GraphNodeImpl(SegmentNode node, Segment segment) {
-			assert node != null && segment != null;
-			assert segment.getNode1() == node || segment.getNode2() == node;
-			this.node = node;
-			this.segment = segment;
-		}
-		public SegmentNode getSegmentNode() {
-			return node;
-		}
-		public Segment getSegment() {
-			return segment;
-		}
-		public void addIncomingEdge(GraphEdge edge) {
-			assert edge != null;
-			incomingEdges.add(edge);
-		}
-		public Collection<GraphEdge> getInboundEdges() {
-			return incomingEdges;
-		}
-		public void addOutgoingEdge(GraphEdge edge) {
-			assert edge != null;
-			outgoingEdges.add(edge);
-		}
-		public Collection<GraphEdge> getOutboundEdges() {
-			return outgoingEdges;
-		}
-		@Override
-		public String toString() {
-			return "(" + node + "; " + segment + ")";
-		}
-	}
-
-	private static class GraphEdgeImpl implements GraphEdge {
-		
-		private final GraphNode startNode;
-		private final GraphNode targetNode;
-		private final Map<GraphEdgePropertyType<?>, Object> properties;
-		
-		public GraphEdgeImpl(GraphNode startNode, GraphNode targetNode,
-				Map<GraphEdgePropertyType<?>, Object> properties) {
-			assert startNode != null && targetNode != null && properties != null;
-			this.startNode = startNode;
-			this.targetNode = targetNode;
-			this.properties = properties;
-		}
-		
-		public GraphNode getStartNode() {
-			return startNode;
-		}
-		public GraphNode getTargetNode() {
-			return targetNode;
-		}
-		
-		public Collection<GraphEdgePropertyType<?>> getAvailableProperties() {
-			return properties.keySet();
-		}
-		public <V> V getPropertyValue(GraphEdgePropertyType<V> property) {
-			V result = (V) properties.get(property);
-			return result;
-		}
-		
-		@Override
-		public String toString() {
-			return "(" + startNode + "-->" + targetNode + ")";
-		}
-		
-	};
-
-	private final Set<WayGraphObserver> observers = new HashSet<WayGraphObserver>();
-
-	private final TransitionStructure transitionStructure;
-
-	private Collection<GraphNode> nodes;
-	private List<GraphEdge> edges;
-
-	/**
-	 * create a WayGraph based on a {@link TransitionStructure}
-	 * @param transitionStructure  transition structure this graph is to be based on; != null
-	 */
-	public TSBasedWayGraph(TransitionStructure transitionStructure) {
-		assert transitionStructure != null;
-
-		this.transitionStructure = transitionStructure;
-		transitionStructure.addObserver(this);
-
-		createNodesAndEdges();
-	}
-
-	public Collection<GraphEdge> getEdges() {
-		return edges;
-	}
-
-	public Collection<GraphNode> getNodes() {
-		return nodes;
-	}
-
-	private void createNodesAndEdges() {
-
-		Collection<EvaluationGroup> evaluationGroups =
-			createEvaluationGroups(transitionStructure);
-
-		for (EvaluationGroup evaluationGroup : evaluationGroups) {
-			evaluationGroup.evaluate(transitionStructure.getRestrictions());
-		}
-
-		createNodesAndEdgesFromEvaluationGroups(evaluationGroups);
-
-		evaluationGroups = null;
-	}
-
-	private static Collection<EvaluationGroup> createEvaluationGroups(
-			TransitionStructure transitionStructure) {
-
-		Map<SegmentNode, Set<SegmentNode>> nodeSetMap =
-			new HashMap<SegmentNode, Set<SegmentNode>>();
-
-		/* first step: everything that is part of the same restriction goes into the same set */
-
-		for (Restriction restriction : transitionStructure.getRestrictions()) {
-
-			/* group every node in via segments (which includes the
-			 * last node of from and the first node of to) into a set */
-
-			SegmentNode firstNode = restriction.getFrom().getNode2();
-			createSetIfHasNone(firstNode, nodeSetMap);
-
-			for (Segment segment : restriction.getVias()) {
-				putInSameSet(segment.getNode1(), firstNode, nodeSetMap);
-				putInSameSet(segment.getNode2(), firstNode, nodeSetMap);
-			}
-
-			for (Segment segment : restriction.getTos()) {
-				putInSameSet(segment.getNode1(), firstNode, nodeSetMap);
-			}
-
-		}
-
-		/* second step: create own sets for each junction and end point
-		 * (node connected with more than / less than two nodes). */
-
-		for (SegmentNode node : transitionStructure.getNodes()) {
-
-			if (!nodeSetMap.containsKey(node)
-					&& !isConnectedWithExactly2Nodes(node)) {
-
-				createSetIfHasNone(node, nodeSetMap);
-
-			}
-
-		}
-
-		/* third step: create segment sets for all segments that are not in one of the node sets
-		 * (that is, at least one node is not part of a junction evaluation group
-		 *  or the nodes are part of different junction evaluation groups)  */
-
-		Map<Segment, Set<Segment>> segmentSetMap =
-			new HashMap<Segment, Set<Segment>>();
-
-		for (Segment segment : transitionStructure.getSegments()) {
-
-			SegmentNode node1 = segment.getNode1();
-			SegmentNode node2 = segment.getNode2();
-
-			if (!nodeSetMap.containsKey(node1) || !nodeSetMap.containsKey(node2)
-					|| nodeSetMap.get(node1) != nodeSetMap.get(node2)) {
-
-				createSetIfHasNone(segment, segmentSetMap);
-
-				for (Segment subsequentSegment : segment.getNode2().getOutboundSegments()) {
-					if (!nodeSetMap.containsKey(node2)
-							|| subsequentSegment.getNode2() == node1) {
-						putInSameSet(subsequentSegment, segment, segmentSetMap);
-					}
-				}
-				//note that segments leading to this segment will share sets anyway,
-				//because this segment is a subsequent segment of them
-
-
-			}
-
-		}
-
-		/* create EvaluationGroup objects */
-
-		Collection<EvaluationGroup> evaluationGroups =
-			new ArrayList<EvaluationGroup>(nodeSetMap.size() + segmentSetMap.size());
-
-		Set<Set<SegmentNode>> nodeSets = new HashSet<Set<SegmentNode>>(nodeSetMap.values());
-		for (Set<SegmentNode> nodeSet : nodeSets) {
-			evaluationGroups.add(new JunctionEvaluationGroup(nodeSet));
-		}
-
-		HashSet<Set<Segment>> hashSets = new HashSet<Set<Segment>>(segmentSetMap.values());
-		for (Set<Segment> segmentSet : hashSets) {
-			Set<SegmentNode> borderNodes = new HashSet<SegmentNode>();
-			for (Segment segment : segmentSet) {
-				if (nodeSetMap.containsKey(segment.getNode1())) {
-					borderNodes.add(segment.getNode1());
-				}
-				if (nodeSetMap.containsKey(segment.getNode2())) {
-					borderNodes.add(segment.getNode2());
-				}
-			}
-			evaluationGroups.add(new ConnectorEvaluationGroup(segmentSet, borderNodes));
-		}
-
-		return evaluationGroups;
-	}
-
-	private void createNodesAndEdgesFromEvaluationGroups(
-			Collection<EvaluationGroup> evaluationGroups) {
-
-		nodes = new LinkedList<GraphNode>();
-		edges = new LinkedList<GraphEdge>();
-
-		//map from Segments to GraphNodes;
-		//for those GraphNodes representing an "approaching node on segment" state
-		final Map<Segment, GraphNodeImpl> segment2GNMap_approaching =
-			new HashMap<Segment, GraphNodeImpl>();
-
-		//map from Segments to GraphNodes;
-		//for those GraphNodes representing a "leaving node on segment" state
-		final Map<Segment, GraphNodeImpl> segment2GNMap_leaving =
-			new HashMap<Segment, GraphNodeImpl>();
-
-		//map from SegmentNodes to GraphNode collections;
-		//for those GraphNodes representing an "approaching node on segment" state
-		final Map<SegmentNode, Collection<GraphNodeImpl>> segNode2GNMap_approaching =
-			new HashMap<SegmentNode, Collection<GraphNodeImpl>>();
-
-		//map from SegmentNodes to GraphNodes collections;
-		//for those GraphNodes representing a "leaving node on segment" state
-		final Map<SegmentNode, Collection<GraphNodeImpl>> segNode2GNMap_leaving =
-			new HashMap<SegmentNode, Collection<GraphNodeImpl>>();
-
-
-
-		/* create graph nodes and edges for junction evaluation groups */
-
-		for (EvaluationGroup evaluationGroup : evaluationGroups) {
-			if (evaluationGroup instanceof JunctionEvaluationGroup) {
-
-				JunctionEvaluationGroup junctionEG = (JunctionEvaluationGroup) evaluationGroup;
-
-				//create graph nodes
-				for (Segment segment : junctionEG.getInboundSegments()) {
-					GraphNodeImpl graphNode = new GraphNodeImpl(segment.getNode2(), segment);
-					nodes.add(graphNode);
-					segment2GNMap_approaching.put(segment, graphNode);
-					addToCollectionMap(segNode2GNMap_approaching, segment.getNode2(), graphNode);
-				}
-				for (Segment segment : junctionEG.getOutboundSegments()) {
-					GraphNodeImpl graphNode = new GraphNodeImpl(segment.getNode1(), segment);
-					nodes.add(graphNode);
-					segment2GNMap_leaving.put(segment, graphNode);
-					addToCollectionMap(segNode2GNMap_leaving, segment.getNode1(), graphNode);
-				}
-
-				//create graph edges for all segment sequences between in- and outbound edges
-				for (Segment inboundSegment : junctionEG.getInboundSegments()) {
-					for (Segment outboundSegment : junctionEG.getOutboundSegments()) {
-
-						List<Segment> segmentSequence =
-							junctionEG.getSegmentSequence(inboundSegment, outboundSegment);
-
-						if (segmentSequence != null) {
-
-							createGraphEdge(
-									segment2GNMap_approaching.get(inboundSegment),
-									segment2GNMap_leaving.get(outboundSegment),
-									segmentSequence,
-									junctionEG);
-
-						}
-					}
-				}
-
-			}
-		}
-
-		/* create graph edges for connector evaluation groups.
-		 * Because GraphNodes are created for pairs of SegmentNodes (from connector groups)
-		 * and Segments (from junction groups), the GraphNodes already exist.
-		 */
-
-		for (EvaluationGroup evaluationGroup : evaluationGroups) {
-			if (evaluationGroup instanceof ConnectorEvaluationGroup) {
-
-				ConnectorEvaluationGroup connectorEG = (ConnectorEvaluationGroup) evaluationGroup;
-
-				for (SegmentNode startNode : connectorEG.getBorderNodes()) {
-					for (SegmentNode targetNode : connectorEG.getBorderNodes()) {
-
-						if (segNode2GNMap_leaving.containsKey(startNode)
-								&& segNode2GNMap_approaching.containsKey(targetNode)) {
-
-							for (GraphNodeImpl startGraphNode : segNode2GNMap_leaving.get(startNode)) {
-								for (GraphNodeImpl targetGraphNode : segNode2GNMap_approaching.get(targetNode)) {
-
-									if (connectorEG.getSegments().contains(startGraphNode.getSegment())
-											&& connectorEG.getSegments().contains(targetGraphNode.getSegment())) {
-
-										List<Segment> segmentSequence =
-											connectorEG.getSegmentSequence(startNode, targetNode);
-
-										if (segmentSequence != null) {
-											createGraphEdge(
-													startGraphNode,
-													targetGraphNode,
-													segmentSequence,
-													connectorEG);
-										}
-
-									}
-
-								}
-							}
-
-						}
-
-					}
-				}
-
-			}
-		}
-
-	}
-
-	private void createGraphEdge(
-			GraphNodeImpl startNode, GraphNodeImpl targetNode, 
-			List<Segment> segments, ConnectorEvaluationGroup evaluationGroup) {
-
-		Map<GraphEdgePropertyType<?>, Object> properties = 
-			new HashMap<GraphEdgePropertyType<?>, Object>(); //TODO: replace HashMap with List-based solution
-		
-		for (GraphEdgePropertyType<?> propertyType : PROPERTY_TYPES) {
-			Object value = propertyType.evaluate(evaluationGroup, segments, transitionStructure);
-			properties.put(propertyType, value);
-		}
-		
-		createGraphEdge(startNode, targetNode, properties);
-
-	}
-
-	private void createGraphEdge(
-			GraphNodeImpl startNode, GraphNodeImpl targetNode, 
-			List<Segment> segments, JunctionEvaluationGroup evaluationGroup) {
-
-		Map<GraphEdgePropertyType<?>, Object> properties = 
-			new HashMap<GraphEdgePropertyType<?>, Object>(); //TODO: replace HashMap with List-based solution
-		
-		for (GraphEdgePropertyType<?> propertyType : PROPERTY_TYPES) {
-			Object value = propertyType.evaluate(evaluationGroup, segments, transitionStructure);
-			properties.put(propertyType, value);
-		}
-		
-		createGraphEdge(startNode, targetNode, properties);
-
-	}
-
-	/**
-	 * creates a GraphEdge;
-	 * adds it to its nodes' collections and {@link #edges} collection.
-	 */
-	private void createGraphEdge(GraphNodeImpl startNode, GraphNodeImpl targetNode, 
-			Map<GraphEdgePropertyType<?>, Object> properties) {
-
-		GraphEdge newEdge = new GraphEdgeImpl(startNode, targetNode, properties);
-
-		startNode.addOutgoingEdge(newEdge);
-		targetNode.addIncomingEdge(newEdge);
-
-		edges.add(newEdge);
-
-	}
-	
-	private static boolean isConnectedWithExactly2Nodes(SegmentNode node) {
-
-		Set<SegmentNode> connectedNodes = new HashSet<SegmentNode>(2);
-
-		for (Segment segment : node.getInboundSegments()) {
-			connectedNodes.add(segment.getNode1());
-		}
-		for (Segment segment : node.getOutboundSegments()) {
-			connectedNodes.add(segment.getNode2());
-		}
-
-		return connectedNodes.size() == 2;
-	}
-
-	/**
-	 * creates a set for an object if none exists in a map.
-	 * The set will contain the object and be added to the map with the object being its key.
-	 */
-	private static <T> void createSetIfHasNone(T object, Map<T, Set<T>> objectSetMap) {
-
-		if (!objectSetMap.containsKey(object)) {
-			@SuppressWarnings("unchecked") //no set with generic parameter can be created directly
-			Set<T> set = new HashSet();
-			set.add(object);
-			objectSetMap.put(object, set);
-		}
-
-	}
-
-	/**
-	 * puts an object in another object's set.
-	 * If both nodes have sets already, these sets are merged.
-	 * The objectSetMap is modified accordingly.
-	 *
-	 * @param object        object that might or might not be in a set; != null
-	 * @param objectInSet   object that is guaranteed to be in a set; != null
-	 * @param objectSetMap  map from objects to the one set they are part of; != null
-	 */
-	private static <T> void putInSameSet(T object, T objectInSet, Map<T, Set<T>> objectSetMap) {
-		assert object != null && objectInSet != null && objectSetMap != null;
-		assert objectSetMap.containsKey(objectInSet);
-
-		Set<T> set = objectSetMap.get(objectInSet);
-
-		if (objectSetMap.containsKey(object)) {
-
-			/* merge the two sets */
-			Set<T> oldSet = objectSetMap.get(object);
-			for (T objectFromOldSet : oldSet) {
-				set.add(objectFromOldSet);
-				objectSetMap.put(objectFromOldSet, set);
-			}
-
-		} else {
-
-			/* add object to objectInSet's set */
-			set.add(object);
-			objectSetMap.put(object, set);
-
-		}
-
-	}
-
-	private static <K, E> void addToCollectionMap(final Map<K, Collection<E>> map, K key, E entry) {
-		if (!map.containsKey(key)) {
-			Collection<E> newCollection = new ArrayList<E>();
-			map.put(key, newCollection);
-		}
-		map.get(key).add(entry);
-	}
-
-	public void update(TransitionStructure transitionStructure) {
-		createNodesAndEdges();
-		notifyObservers();
-	}
-
-	public void addObserver(WayGraphObserver observer) {
-		observers.add(observer);
-	}
-
-	public void deleteObserver(WayGraphObserver observer) {
-		observers.remove(observer);
-	}
-
-	private void notifyObservers() {
-		for (WayGraphObserver observer : observers) {
-			observer.update(this);
-		}
-	}
+    private static final GraphEdgePropertyType<?>[] PROPERTY_TYPES =
+        {GraphEdgeSegments.PROPERTY};
+        //TODO: -> parameter
+
+    private static class GraphNodeImpl implements GraphNode {
+        private final SegmentNode node;
+        private final Segment segment;
+        private final List<GraphEdge> incomingEdges = new ArrayList<GraphEdge>();
+        private final List<GraphEdge> outgoingEdges = new ArrayList<GraphEdge>();
+        public GraphNodeImpl(SegmentNode node, Segment segment) {
+            assert node != null && segment != null;
+            assert segment.getNode1() == node || segment.getNode2() == node;
+            this.node = node;
+            this.segment = segment;
+        }
+        public SegmentNode getSegmentNode() {
+            return node;
+        }
+        public Segment getSegment() {
+            return segment;
+        }
+        public void addIncomingEdge(GraphEdge edge) {
+            assert edge != null;
+            incomingEdges.add(edge);
+        }
+        public Collection<GraphEdge> getInboundEdges() {
+            return incomingEdges;
+        }
+        public void addOutgoingEdge(GraphEdge edge) {
+            assert edge != null;
+            outgoingEdges.add(edge);
+        }
+        public Collection<GraphEdge> getOutboundEdges() {
+            return outgoingEdges;
+        }
+        @Override
+        public String toString() {
+            return "(" + node + "; " + segment + ")";
+        }
+    }
+
+    private static class GraphEdgeImpl implements GraphEdge {
+
+        private final GraphNode startNode;
+        private final GraphNode targetNode;
+        private final Map<GraphEdgePropertyType<?>, Object> properties;
+
+        public GraphEdgeImpl(GraphNode startNode, GraphNode targetNode,
+                Map<GraphEdgePropertyType<?>, Object> properties) {
+            assert startNode != null && targetNode != null && properties != null;
+            this.startNode = startNode;
+            this.targetNode = targetNode;
+            this.properties = properties;
+        }
+
+        public GraphNode getStartNode() {
+            return startNode;
+        }
+        public GraphNode getTargetNode() {
+            return targetNode;
+        }
+
+        public Collection<GraphEdgePropertyType<?>> getAvailableProperties() {
+            return properties.keySet();
+        }
+        public <V> V getPropertyValue(GraphEdgePropertyType<V> property) {
+            V result = (V) properties.get(property);
+            return result;
+        }
+
+        @Override
+        public String toString() {
+            return "(" + startNode + "-->" + targetNode + ")";
+        }
+
+    };
+
+    private final Set<WayGraphObserver> observers = new HashSet<WayGraphObserver>();
+
+    private final TransitionStructure transitionStructure;
+
+    private Collection<GraphNode> nodes;
+    private List<GraphEdge> edges;
+
+    /**
+     * create a WayGraph based on a {@link TransitionStructure}
+     * @param transitionStructure  transition structure this graph is to be based on; != null
+     */
+    public TSBasedWayGraph(TransitionStructure transitionStructure) {
+        assert transitionStructure != null;
+
+        this.transitionStructure = transitionStructure;
+        transitionStructure.addObserver(this);
+
+        createNodesAndEdges();
+    }
+
+    public Collection<GraphEdge> getEdges() {
+        return edges;
+    }
+
+    public Collection<GraphNode> getNodes() {
+        return nodes;
+    }
+
+    private void createNodesAndEdges() {
+
+        Collection<EvaluationGroup> evaluationGroups =
+            createEvaluationGroups(transitionStructure);
+
+        for (EvaluationGroup evaluationGroup : evaluationGroups) {
+            evaluationGroup.evaluate(transitionStructure.getRestrictions());
+        }
+
+        createNodesAndEdgesFromEvaluationGroups(evaluationGroups);
+
+        evaluationGroups = null;
+    }
+
+    private static Collection<EvaluationGroup> createEvaluationGroups(
+            TransitionStructure transitionStructure) {
+
+        Map<SegmentNode, Set<SegmentNode>> nodeSetMap =
+            new HashMap<SegmentNode, Set<SegmentNode>>();
+
+        /* first step: everything that is part of the same restriction goes into the same set */
+
+        for (Restriction restriction : transitionStructure.getRestrictions()) {
+
+            /* group every node in via segments (which includes the
+             * last node of from and the first node of to) into a set */
+
+            SegmentNode firstNode = restriction.getFrom().getNode2();
+            createSetIfHasNone(firstNode, nodeSetMap);
+
+            for (Segment segment : restriction.getVias()) {
+                putInSameSet(segment.getNode1(), firstNode, nodeSetMap);
+                putInSameSet(segment.getNode2(), firstNode, nodeSetMap);
+            }
+
+            for (Segment segment : restriction.getTos()) {
+                putInSameSet(segment.getNode1(), firstNode, nodeSetMap);
+            }
+
+        }
+
+        /* second step: create own sets for each junction and end point
+         * (node connected with more than / less than two nodes). */
+
+        for (SegmentNode node : transitionStructure.getNodes()) {
+
+            if (!nodeSetMap.containsKey(node)
+                    && !isConnectedWithExactly2Nodes(node)) {
+
+                createSetIfHasNone(node, nodeSetMap);
+
+            }
+
+        }
+
+        /* third step: create segment sets for all segments that are not in one of the node sets
+         * (that is, at least one node is not part of a junction evaluation group
+         *  or the nodes are part of different junction evaluation groups)  */
+
+        Map<Segment, Set<Segment>> segmentSetMap =
+            new HashMap<Segment, Set<Segment>>();
+
+        for (Segment segment : transitionStructure.getSegments()) {
+
+            SegmentNode node1 = segment.getNode1();
+            SegmentNode node2 = segment.getNode2();
+
+            if (!nodeSetMap.containsKey(node1) || !nodeSetMap.containsKey(node2)
+                    || nodeSetMap.get(node1) != nodeSetMap.get(node2)) {
+
+                createSetIfHasNone(segment, segmentSetMap);
+
+                for (Segment subsequentSegment : segment.getNode2().getOutboundSegments()) {
+                    if (!nodeSetMap.containsKey(node2)
+                            || subsequentSegment.getNode2() == node1) {
+                        putInSameSet(subsequentSegment, segment, segmentSetMap);
+                    }
+                }
+                //note that segments leading to this segment will share sets anyway,
+                //because this segment is a subsequent segment of them
+
+
+            }
+
+        }
+
+        /* create EvaluationGroup objects */
+
+        Collection<EvaluationGroup> evaluationGroups =
+            new ArrayList<EvaluationGroup>(nodeSetMap.size() + segmentSetMap.size());
+
+        Set<Set<SegmentNode>> nodeSets = new HashSet<Set<SegmentNode>>(nodeSetMap.values());
+        for (Set<SegmentNode> nodeSet : nodeSets) {
+            evaluationGroups.add(new JunctionEvaluationGroup(nodeSet));
+        }
+
+        HashSet<Set<Segment>> hashSets = new HashSet<Set<Segment>>(segmentSetMap.values());
+        for (Set<Segment> segmentSet : hashSets) {
+            Set<SegmentNode> borderNodes = new HashSet<SegmentNode>();
+            for (Segment segment : segmentSet) {
+                if (nodeSetMap.containsKey(segment.getNode1())) {
+                    borderNodes.add(segment.getNode1());
+                }
+                if (nodeSetMap.containsKey(segment.getNode2())) {
+                    borderNodes.add(segment.getNode2());
+                }
+            }
+            evaluationGroups.add(new ConnectorEvaluationGroup(segmentSet, borderNodes));
+        }
+
+        return evaluationGroups;
+    }
+
+    private void createNodesAndEdgesFromEvaluationGroups(
+            Collection<EvaluationGroup> evaluationGroups) {
+
+        nodes = new LinkedList<GraphNode>();
+        edges = new LinkedList<GraphEdge>();
+
+        //map from Segments to GraphNodes;
+        //for those GraphNodes representing an "approaching node on segment" state
+        final Map<Segment, GraphNodeImpl> segment2GNMap_approaching =
+            new HashMap<Segment, GraphNodeImpl>();
+
+        //map from Segments to GraphNodes;
+        //for those GraphNodes representing a "leaving node on segment" state
+        final Map<Segment, GraphNodeImpl> segment2GNMap_leaving =
+            new HashMap<Segment, GraphNodeImpl>();
+
+        //map from SegmentNodes to GraphNode collections;
+        //for those GraphNodes representing an "approaching node on segment" state
+        final Map<SegmentNode, Collection<GraphNodeImpl>> segNode2GNMap_approaching =
+            new HashMap<SegmentNode, Collection<GraphNodeImpl>>();
+
+        //map from SegmentNodes to GraphNodes collections;
+        //for those GraphNodes representing a "leaving node on segment" state
+        final Map<SegmentNode, Collection<GraphNodeImpl>> segNode2GNMap_leaving =
+            new HashMap<SegmentNode, Collection<GraphNodeImpl>>();
+
+
+
+        /* create graph nodes and edges for junction evaluation groups */
+
+        for (EvaluationGroup evaluationGroup : evaluationGroups) {
+            if (evaluationGroup instanceof JunctionEvaluationGroup) {
+
+                JunctionEvaluationGroup junctionEG = (JunctionEvaluationGroup) evaluationGroup;
+
+                //create graph nodes
+                for (Segment segment : junctionEG.getInboundSegments()) {
+                    GraphNodeImpl graphNode = new GraphNodeImpl(segment.getNode2(), segment);
+                    nodes.add(graphNode);
+                    segment2GNMap_approaching.put(segment, graphNode);
+                    addToCollectionMap(segNode2GNMap_approaching, segment.getNode2(), graphNode);
+                }
+                for (Segment segment : junctionEG.getOutboundSegments()) {
+                    GraphNodeImpl graphNode = new GraphNodeImpl(segment.getNode1(), segment);
+                    nodes.add(graphNode);
+                    segment2GNMap_leaving.put(segment, graphNode);
+                    addToCollectionMap(segNode2GNMap_leaving, segment.getNode1(), graphNode);
+                }
+
+                //create graph edges for all segment sequences between in- and outbound edges
+                for (Segment inboundSegment : junctionEG.getInboundSegments()) {
+                    for (Segment outboundSegment : junctionEG.getOutboundSegments()) {
+
+                        List<Segment> segmentSequence =
+                            junctionEG.getSegmentSequence(inboundSegment, outboundSegment);
+
+                        if (segmentSequence != null) {
+
+                            createGraphEdge(
+                                    segment2GNMap_approaching.get(inboundSegment),
+                                    segment2GNMap_leaving.get(outboundSegment),
+                                    segmentSequence,
+                                    junctionEG);
+
+                        }
+                    }
+                }
+
+            }
+        }
+
+        /* create graph edges for connector evaluation groups.
+         * Because GraphNodes are created for pairs of SegmentNodes (from connector groups)
+         * and Segments (from junction groups), the GraphNodes already exist.
+         */
+
+        for (EvaluationGroup evaluationGroup : evaluationGroups) {
+            if (evaluationGroup instanceof ConnectorEvaluationGroup) {
+
+                ConnectorEvaluationGroup connectorEG = (ConnectorEvaluationGroup) evaluationGroup;
+
+                for (SegmentNode startNode : connectorEG.getBorderNodes()) {
+                    for (SegmentNode targetNode : connectorEG.getBorderNodes()) {
+
+                        if (segNode2GNMap_leaving.containsKey(startNode)
+                                && segNode2GNMap_approaching.containsKey(targetNode)) {
+
+                            for (GraphNodeImpl startGraphNode : segNode2GNMap_leaving.get(startNode)) {
+                                for (GraphNodeImpl targetGraphNode : segNode2GNMap_approaching.get(targetNode)) {
+
+                                    if (connectorEG.getSegments().contains(startGraphNode.getSegment())
+                                            && connectorEG.getSegments().contains(targetGraphNode.getSegment())) {
+
+                                        List<Segment> segmentSequence =
+                                            connectorEG.getSegmentSequence(startNode, targetNode);
+
+                                        if (segmentSequence != null) {
+                                            createGraphEdge(
+                                                    startGraphNode,
+                                                    targetGraphNode,
+                                                    segmentSequence,
+                                                    connectorEG);
+                                        }
+
+                                    }
+
+                                }
+                            }
+
+                        }
+
+                    }
+                }
+
+            }
+        }
+
+    }
+
+    private void createGraphEdge(
+            GraphNodeImpl startNode, GraphNodeImpl targetNode,
+            List<Segment> segments, ConnectorEvaluationGroup evaluationGroup) {
+
+        Map<GraphEdgePropertyType<?>, Object> properties =
+            new HashMap<GraphEdgePropertyType<?>, Object>(); //TODO: replace HashMap with List-based solution
+
+        for (GraphEdgePropertyType<?> propertyType : PROPERTY_TYPES) {
+            Object value = propertyType.evaluate(evaluationGroup, segments, transitionStructure);
+            properties.put(propertyType, value);
+        }
+
+        createGraphEdge(startNode, targetNode, properties);
+
+    }
+
+    private void createGraphEdge(
+            GraphNodeImpl startNode, GraphNodeImpl targetNode,
+            List<Segment> segments, JunctionEvaluationGroup evaluationGroup) {
+
+        Map<GraphEdgePropertyType<?>, Object> properties =
+            new HashMap<GraphEdgePropertyType<?>, Object>(); //TODO: replace HashMap with List-based solution
+
+        for (GraphEdgePropertyType<?> propertyType : PROPERTY_TYPES) {
+            Object value = propertyType.evaluate(evaluationGroup, segments, transitionStructure);
+            properties.put(propertyType, value);
+        }
+
+        createGraphEdge(startNode, targetNode, properties);
+
+    }
+
+    /**
+     * creates a GraphEdge;
+     * adds it to its nodes' collections and {@link #edges} collection.
+     */
+    private void createGraphEdge(GraphNodeImpl startNode, GraphNodeImpl targetNode,
+            Map<GraphEdgePropertyType<?>, Object> properties) {
+
+        GraphEdge newEdge = new GraphEdgeImpl(startNode, targetNode, properties);
+
+        startNode.addOutgoingEdge(newEdge);
+        targetNode.addIncomingEdge(newEdge);
+
+        edges.add(newEdge);
+
+    }
+
+    private static boolean isConnectedWithExactly2Nodes(SegmentNode node) {
+
+        Set<SegmentNode> connectedNodes = new HashSet<SegmentNode>(2);
+
+        for (Segment segment : node.getInboundSegments()) {
+            connectedNodes.add(segment.getNode1());
+        }
+        for (Segment segment : node.getOutboundSegments()) {
+            connectedNodes.add(segment.getNode2());
+        }
+
+        return connectedNodes.size() == 2;
+    }
+
+    /**
+     * creates a set for an object if none exists in a map.
+     * The set will contain the object and be added to the map with the object being its key.
+     */
+    private static <T> void createSetIfHasNone(T object, Map<T, Set<T>> objectSetMap) {
+
+        if (!objectSetMap.containsKey(object)) {
+            @SuppressWarnings("unchecked") //no set with generic parameter can be created directly
+            Set<T> set = new HashSet();
+            set.add(object);
+            objectSetMap.put(object, set);
+        }
+
+    }
+
+    /**
+     * puts an object in another object's set.
+     * If both nodes have sets already, these sets are merged.
+     * The objectSetMap is modified accordingly.
+     *
+     * @param object        object that might or might not be in a set; != null
+     * @param objectInSet   object that is guaranteed to be in a set; != null
+     * @param objectSetMap  map from objects to the one set they are part of; != null
+     */
+    private static <T> void putInSameSet(T object, T objectInSet, Map<T, Set<T>> objectSetMap) {
+        assert object != null && objectInSet != null && objectSetMap != null;
+        assert objectSetMap.containsKey(objectInSet);
+
+        Set<T> set = objectSetMap.get(objectInSet);
+
+        if (objectSetMap.containsKey(object)) {
+
+            /* merge the two sets */
+            Set<T> oldSet = objectSetMap.get(object);
+            for (T objectFromOldSet : oldSet) {
+                set.add(objectFromOldSet);
+                objectSetMap.put(objectFromOldSet, set);
+            }
+
+        } else {
+
+            /* add object to objectInSet's set */
+            set.add(object);
+            objectSetMap.put(object, set);
+
+        }
+
+    }
+
+    private static <K, E> void addToCollectionMap(final Map<K, Collection<E>> map, K key, E entry) {
+        if (!map.containsKey(key)) {
+            Collection<E> newCollection = new ArrayList<E>();
+            map.put(key, newCollection);
+        }
+        map.get(key).add(entry);
+    }
+
+    public void update(TransitionStructure transitionStructure) {
+        createNodesAndEdges();
+        notifyObservers();
+    }
+
+    public void addObserver(WayGraphObserver observer) {
+        observers.add(observer);
+    }
+
+    public void deleteObserver(WayGraphObserver observer) {
+        observers.remove(observer);
+    }
+
+    private void notifyObservers() {
+        for (WayGraphObserver observer : observers) {
+            observer.update(this);
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/WayGraph.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/WayGraph.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/WayGraph.java	(revision 23189)
@@ -8,22 +8,22 @@
 public interface WayGraph {
 
-	Collection<GraphNode> getNodes();
-	Collection<GraphEdge> getEdges();
+    Collection<GraphNode> getNodes();
+    Collection<GraphEdge> getEdges();
 
-	/**
-	 * adds an observer.
-	 * Does nothing if the parameter is already an observer of this WayGraph.
-	 *
-	 * @param observer  observer object, != null
-	 */
-	public void addObserver(WayGraphObserver observer);
+    /**
+     * adds an observer.
+     * Does nothing if the parameter is already an observer of this WayGraph.
+     *
+     * @param observer  observer object, != null
+     */
+    public void addObserver(WayGraphObserver observer);
 
-	/**
-	 * deletes an observer that has been added using {@link #addObserver(WayGraphObserver)}.
-	 * Does nothing if the parameter isn't currently an observer of this WayGraph.
-	 *
-	 * @param observer  observer object, != null
-	 */
-	public void deleteObserver(WayGraphObserver observer);
+    /**
+     * deletes an observer that has been added using {@link #addObserver(WayGraphObserver)}.
+     * Does nothing if the parameter isn't currently an observer of this WayGraph.
+     *
+     * @param observer  observer object, != null
+     */
+    public void deleteObserver(WayGraphObserver observer);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/WayGraphObserver.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/WayGraphObserver.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/graph/WayGraphObserver.java	(revision 23189)
@@ -7,9 +7,9 @@
 public interface WayGraphObserver {
 
-	/**
-	 * informs this observer about changes in an observed graph
-	 * @param wayGraph  observed graph that has changed; != null
-	 */
-	public void update(WayGraph wayGraph);
+    /**
+     * informs this observer about changes in an observed graph
+     * @param wayGraph  observed graph that has changed; != null
+     */
+    public void update(WayGraph wayGraph);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/GraphEdgePropertyType.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/GraphEdgePropertyType.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/GraphEdgePropertyType.java	(revision 23189)
@@ -17,18 +17,18 @@
  */
 public interface GraphEdgePropertyType<V> {
-	
-	/**
-	 * determines the property value for segments created from junction groups
-	 */
-	public V evaluate(JunctionEvaluationGroup junctionGroup,
-			List<Segment> segmentSequence,
-			TransitionStructure transitionStructure);
 
-	/**
-	 * determines the property value for segments created from connector groups
-	 */
-	public V evaluate(ConnectorEvaluationGroup connectorGroup,
-			List<Segment> segmentSequence,
-			TransitionStructure transitionStructure);
-	
+    /**
+     * determines the property value for segments created from junction groups
+     */
+    public V evaluate(JunctionEvaluationGroup junctionGroup,
+            List<Segment> segmentSequence,
+            TransitionStructure transitionStructure);
+
+    /**
+     * determines the property value for segments created from connector groups
+     */
+    public V evaluate(ConnectorEvaluationGroup connectorGroup,
+            List<Segment> segmentSequence,
+            TransitionStructure transitionStructure);
+
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/GraphEdgeSegments.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/GraphEdgeSegments.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/GraphEdgeSegments.java	(revision 23189)
@@ -12,26 +12,26 @@
  * property for the graph that is being constructed will preserve information
  * from the {@link TransitionStructure}.
- * 
+ *
  * TODO: for some purposes, segments are not needed (only coordinate lists;
  * without properties etc.)
  */
 public final class GraphEdgeSegments implements GraphEdgePropertyType<List<Segment>> {
-	
-	public static final GraphEdgeSegments PROPERTY = new GraphEdgeSegments();
-	
-	/**
-	 * private constructor to make sure that {@link #INSTANCE} is the only instance
-	 */
-	private GraphEdgeSegments() { }
-	
-	public List<Segment> evaluate(JunctionEvaluationGroup junctionGroup,
-			List<Segment> segmentSequence, TransitionStructure transitionStructure) {
-		return segmentSequence;
-	}
-	
-	public List<Segment> evaluate(ConnectorEvaluationGroup connectorGroup,
-			List<Segment> segmentSequence, TransitionStructure transitionStructure) {
-		return segmentSequence;
-	}
-	
+
+    public static final GraphEdgeSegments PROPERTY = new GraphEdgeSegments();
+
+    /**
+     * private constructor to make sure that {@link #INSTANCE} is the only instance
+     */
+    private GraphEdgeSegments() { }
+
+    public List<Segment> evaluate(JunctionEvaluationGroup junctionGroup,
+            List<Segment> segmentSequence, TransitionStructure transitionStructure) {
+        return segmentSequence;
+    }
+
+    public List<Segment> evaluate(ConnectorEvaluationGroup connectorGroup,
+            List<Segment> segmentSequence, TransitionStructure transitionStructure) {
+        return segmentSequence;
+    }
+
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadIncline.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadIncline.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadIncline.java	(revision 23189)
@@ -8,47 +8,47 @@
 public class RoadIncline implements RoadPropertyType<Float> {
 
-	public <N, W, R, M> Float evaluateN(N node, AccessParameters accessParameters,
-			DataSource<N,W,R,M> dataSource) {
-		return null;
-	};
+    public <N, W, R, M> Float evaluateN(N node, AccessParameters accessParameters,
+            DataSource<N,W,R,M> dataSource) {
+        return null;
+    };
 
-	public <N, W, R, M> Float evaluateW(W way, boolean forward, AccessParameters accessParameters,
-			DataSource<N,W,R,M> dataSource) {
-		assert way != null && accessParameters != null && dataSource != null;
+    public <N, W, R, M> Float evaluateW(W way, boolean forward, AccessParameters accessParameters,
+            DataSource<N,W,R,M> dataSource) {
+        assert way != null && accessParameters != null && dataSource != null;
 
-		TagGroup tags = dataSource.getTagsW(way);
-		String inclineString = tags.getValue("incline");
+        TagGroup tags = dataSource.getTagsW(way);
+        String inclineString = tags.getValue("incline");
 
-		if (inclineString != null) {
-			Float incline = ValueStringParser.parseIncline(inclineString);
-			if (incline != null) {
-				if (!forward) {
-					incline = -incline;
-				}
-				return incline;
-			}
-		}
+        if (inclineString != null) {
+            Float incline = ValueStringParser.parseIncline(inclineString);
+            if (incline != null) {
+                if (!forward) {
+                    incline = -incline;
+                }
+                return incline;
+            }
+        }
 
-		return null;
-	};
+        return null;
+    };
 
-	public boolean isUsable(Object propertyValue, AccessParameters accessParameters) {
-		assert propertyValue instanceof Float;
+    public boolean isUsable(Object propertyValue, AccessParameters accessParameters) {
+        assert propertyValue instanceof Float;
 
-		float incline = (Float)propertyValue;
+        float incline = (Float)propertyValue;
 
-		Float maxInclineUp =
-			accessParameters.getVehiclePropertyValue(VehiclePropertyTypes.MAX_INCLINE_UP);
-		Float maxInclineDown =
-			accessParameters.getVehiclePropertyValue(VehiclePropertyTypes.MAX_INCLINE_DOWN);
+        Float maxInclineUp =
+            accessParameters.getVehiclePropertyValue(VehiclePropertyTypes.MAX_INCLINE_UP);
+        Float maxInclineDown =
+            accessParameters.getVehiclePropertyValue(VehiclePropertyTypes.MAX_INCLINE_DOWN);
 
-		if (maxInclineUp != null && incline > maxInclineUp) {
-			return false;
-		} else if (maxInclineDown != null && -incline > maxInclineDown) {
-			return false;
-		} else {
-			return true;
-		}
-	}
+        if (maxInclineUp != null && incline > maxInclineUp) {
+            return false;
+        } else if (maxInclineDown != null && -incline > maxInclineDown) {
+            return false;
+        } else {
+            return true;
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxaxleload.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxaxleload.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxaxleload.java	(revision 23189)
@@ -6,10 +6,10 @@
 
 public class RoadMaxaxleload extends RoadValueLimit {
-	public RoadMaxaxleload() {
-		super("maxaxleload", AXLELOAD, LimitType.MAXIMUM);
-	}
-	@Override
-	protected Float parse(String valueString) {
-		return ValueStringParser.parseWeight(valueString);
-	}
+    public RoadMaxaxleload() {
+        super("maxaxleload", AXLELOAD, LimitType.MAXIMUM);
+    }
+    @Override
+    protected Float parse(String valueString) {
+        return ValueStringParser.parseWeight(valueString);
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxheight.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxheight.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxheight.java	(revision 23189)
@@ -6,10 +6,10 @@
 
 public class RoadMaxheight extends RoadValueLimit {
-	public RoadMaxheight() {
-		super("maxheight", HEIGHT, LimitType.MAXIMUM);
-	}
-	@Override
-	protected Float parse(String valueString) {
-		return ValueStringParser.parseMeasure(valueString);
-	}
+    public RoadMaxheight() {
+        super("maxheight", HEIGHT, LimitType.MAXIMUM);
+    }
+    @Override
+    protected Float parse(String valueString) {
+        return ValueStringParser.parseMeasure(valueString);
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxlength.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxlength.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxlength.java	(revision 23189)
@@ -6,10 +6,10 @@
 
 public class RoadMaxlength extends RoadValueLimit {
-	public RoadMaxlength() {
-		super("maxlength", LENGTH, LimitType.MAXIMUM);
-	}
-	@Override
-	protected Float parse(String valueString) {
-		return ValueStringParser.parseMeasure(valueString);
-	}
+    public RoadMaxlength() {
+        super("maxlength", LENGTH, LimitType.MAXIMUM);
+    }
+    @Override
+    protected Float parse(String valueString) {
+        return ValueStringParser.parseMeasure(valueString);
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxspeed.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxspeed.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxspeed.java	(revision 23189)
@@ -8,63 +8,63 @@
 public class RoadMaxspeed implements RoadPropertyType<Float> {
 
-	private DataSource<?, ?, ?, ?> lastDataSource;
+    private DataSource<?, ?, ?, ?> lastDataSource;
 
-	/**
-	 * (re)creates information like boundaries if data source has changed
-	 * since last call to {@link #evaluate(Object, boolean, AccessParameters, DataSource)}
-	 */
-	private <N, W, R, M> void initializeIfNecessary(DataSource<N, W, R, M> dataSource) {
+    /**
+     * (re)creates information like boundaries if data source has changed
+     * since last call to {@link #evaluate(Object, boolean, AccessParameters, DataSource)}
+     */
+    private <N, W, R, M> void initializeIfNecessary(DataSource<N, W, R, M> dataSource) {
 
-		if (dataSource != lastDataSource) {
+        if (dataSource != lastDataSource) {
 
-			/*
-			 *
-			 * currently no activities;
-			 * place boundaries or similar features can be handled here
-			 * once there is consensus on the topic of implicit maxspeeds, trafficzones etc.
-			 *
-			 */
+            /*
+             *
+             * currently no activities;
+             * place boundaries or similar features can be handled here
+             * once there is consensus on the topic of implicit maxspeeds, trafficzones etc.
+             *
+             */
 
-			lastDataSource = dataSource;
-		}
-	}
+            lastDataSource = dataSource;
+        }
+    }
 
-	public <N, W, R, M> Float evaluateN(N node, AccessParameters accessParameters,
-			DataSource<N, W, R, M> dataSource) {
-		assert node != null && accessParameters != null && dataSource != null;
+    public <N, W, R, M> Float evaluateN(N node, AccessParameters accessParameters,
+            DataSource<N, W, R, M> dataSource) {
+        assert node != null && accessParameters != null && dataSource != null;
 
-		initializeIfNecessary(dataSource);
+        initializeIfNecessary(dataSource);
 
-		return evaluateTags(dataSource.getTagsN(node));
-	}
+        return evaluateTags(dataSource.getTagsN(node));
+    }
 
-	public <N, W, R, M> Float evaluateW(W way, boolean forward, AccessParameters accessParameters,
-			DataSource<N, W, R, M> dataSource) {
-		assert way != null && accessParameters != null && dataSource != null;
+    public <N, W, R, M> Float evaluateW(W way, boolean forward, AccessParameters accessParameters,
+            DataSource<N, W, R, M> dataSource) {
+        assert way != null && accessParameters != null && dataSource != null;
 
-		initializeIfNecessary(dataSource);
+        initializeIfNecessary(dataSource);
 
-		return evaluateTags(dataSource.getTagsW(way));
-	}
+        return evaluateTags(dataSource.getTagsW(way));
+    }
 
-	private Float evaluateTags(TagGroup tags) {
-		String maxspeedString = tags.getValue("maxspeed");
+    private Float evaluateTags(TagGroup tags) {
+        String maxspeedString = tags.getValue("maxspeed");
 
-		if (maxspeedString != null) {
+        if (maxspeedString != null) {
 
-			Float maxspeed = ValueStringParser.parseSpeed(maxspeedString);
-			if (maxspeed != null) {
-				return maxspeed;
-			}
+            Float maxspeed = ValueStringParser.parseSpeed(maxspeedString);
+            if (maxspeed != null) {
+                return maxspeed;
+            }
 
-		}
+        }
 
-		return null;
-	}
+        return null;
+    }
 
-	public boolean isUsable(Object propertyValue, AccessParameters accessParameters) {
-		assert propertyValue instanceof Float;
-		return true;
-	}
+    public boolean isUsable(Object propertyValue, AccessParameters accessParameters) {
+        assert propertyValue instanceof Float;
+        return true;
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxweight.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxweight.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxweight.java	(revision 23189)
@@ -6,10 +6,10 @@
 
 public class RoadMaxweight extends RoadValueLimit {
-	public RoadMaxweight() {
-		super("maxweight", WEIGHT, LimitType.MAXIMUM);
-	}
-	@Override
-	protected Float parse(String valueString) {
-		return ValueStringParser.parseWeight(valueString);
-	}
+    public RoadMaxweight() {
+        super("maxweight", WEIGHT, LimitType.MAXIMUM);
+    }
+    @Override
+    protected Float parse(String valueString) {
+        return ValueStringParser.parseWeight(valueString);
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxwidth.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxwidth.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxwidth.java	(revision 23189)
@@ -6,10 +6,10 @@
 
 public class RoadMaxwidth extends RoadValueLimit {
-	public RoadMaxwidth() {
-		super("maxwidth", WIDTH, LimitType.MAXIMUM);
-	}
-	@Override
-	protected Float parse(String valueString) {
-		return ValueStringParser.parseMeasure(valueString);
-	}
+    public RoadMaxwidth() {
+        super("maxwidth", WIDTH, LimitType.MAXIMUM);
+    }
+    @Override
+    protected Float parse(String valueString) {
+        return ValueStringParser.parseMeasure(valueString);
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMinspeed.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMinspeed.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadMinspeed.java	(revision 23189)
@@ -6,10 +6,10 @@
 
 public class RoadMinspeed extends RoadValueLimit {
-	public RoadMinspeed() {
-		super("minspeed", SPEED, LimitType.MINIMUM);
-	}
-	@Override
-	protected Float parse(String valueString) {
-		return ValueStringParser.parseSpeed(valueString);
-	}
+    public RoadMinspeed() {
+        super("minspeed", SPEED, LimitType.MINIMUM);
+    }
+    @Override
+    protected Float parse(String valueString) {
+        return ValueStringParser.parseSpeed(valueString);
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadPropertyType.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadPropertyType.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadPropertyType.java	(revision 23189)
@@ -14,40 +14,40 @@
 public interface RoadPropertyType<V> {
 
-	/**
-	 * determines the property value for way-based segments.
-	 * Uses the way the segment is created from.
-	 *
-	 * @param way               way that is to be evaluated; != null
-	 * @param forward           chooses whether the property is evaluated
-	 *                          in (true) or against (false) way direction
-	 * @param accessParameters  access parameters for properties that depend on vehicle/situation
-	 * @param dataSource        object providing access to all data; != null
-	 * @return                  value of this property for the way;
-	 *                          null if property cannot be determined / does not apply
-	 */
-	public <N, W, R, M> V evaluateW(W way, boolean forward,
-			AccessParameters accessParameters, DataSource<N, W, R, M> dataSource);
+    /**
+     * determines the property value for way-based segments.
+     * Uses the way the segment is created from.
+     *
+     * @param way               way that is to be evaluated; != null
+     * @param forward           chooses whether the property is evaluated
+     *                          in (true) or against (false) way direction
+     * @param accessParameters  access parameters for properties that depend on vehicle/situation
+     * @param dataSource        object providing access to all data; != null
+     * @return                  value of this property for the way;
+     *                          null if property cannot be determined / does not apply
+     */
+    public <N, W, R, M> V evaluateW(W way, boolean forward,
+            AccessParameters accessParameters, DataSource<N, W, R, M> dataSource);
 
-	/**
-	 * determines the property value for node-based segments.
-	 * Uses the node the segment is created from.
-	 *
-	 * @param way               node that is to be evaluated; != null
-	 * @param accessParameters  access parameters for properties that depend on vehicle/situation
-	 * @param dataSource        object providing access to all data; != null
-	 * @return                  value of this property for the way;
-	 *                          null if property cannot be determined / does not apply
-	 */
-	public <N, W, R, M> V evaluateN(N node,
-			AccessParameters accessParameters, DataSource<N, W, R, M> dataSource);
+    /**
+     * determines the property value for node-based segments.
+     * Uses the node the segment is created from.
+     *
+     * @param way               node that is to be evaluated; != null
+     * @param accessParameters  access parameters for properties that depend on vehicle/situation
+     * @param dataSource        object providing access to all data; != null
+     * @return                  value of this property for the way;
+     *                          null if property cannot be determined / does not apply
+     */
+    public <N, W, R, M> V evaluateN(N node,
+            AccessParameters accessParameters, DataSource<N, W, R, M> dataSource);
 
-	/**
-	 * checks whether a segment with a given value for this property can be used by a vehicle
-	 * with a certain set of access parameters
-	 *
-	 * @param object  value of this property for the segment;
-	 *                MUST be of type V; != null
-	 */
-	public boolean isUsable(Object object, AccessParameters accessParameters);
+    /**
+     * checks whether a segment with a given value for this property can be used by a vehicle
+     * with a certain set of access parameters
+     *
+     * @param object  value of this property for the segment;
+     *                MUST be of type V; != null
+     */
+    public boolean isUsable(Object object, AccessParameters accessParameters);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadSurface.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadSurface.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadSurface.java	(revision 23189)
@@ -9,32 +9,32 @@
 public class RoadSurface implements RoadPropertyType<String> {
 
-	public <N, W, R, M> String evaluateN(N node, AccessParameters accessParameters,
-			DataSource<N,W,R,M> dataSource) {
-		return null;
-	};
+    public <N, W, R, M> String evaluateN(N node, AccessParameters accessParameters,
+            DataSource<N,W,R,M> dataSource) {
+        return null;
+    };
 
-	public <N, W, R, M> String evaluateW(W way, boolean forward, AccessParameters accessParameters,
-			DataSource<N,W,R,M> dataSource) {
-		assert way != null && accessParameters != null && dataSource != null;
+    public <N, W, R, M> String evaluateW(W way, boolean forward, AccessParameters accessParameters,
+            DataSource<N,W,R,M> dataSource) {
+        assert way != null && accessParameters != null && dataSource != null;
 
-		TagGroup tags = dataSource.getTagsW(way);
-		return tags.getValue("surface");
+        TagGroup tags = dataSource.getTagsW(way);
+        return tags.getValue("surface");
 
-	};
+    };
 
-	public boolean isUsable(Object propertyValue, AccessParameters accessParameters) {
-		assert propertyValue instanceof String;
+    public boolean isUsable(Object propertyValue, AccessParameters accessParameters) {
+        assert propertyValue instanceof String;
 
-		String surface = (String)propertyValue;
+        String surface = (String)propertyValue;
 
-		Collection<String> surfaceBlacklist =
-			accessParameters.getVehiclePropertyValue(VehiclePropertyTypes.SURFACE_BLACKLIST);
+        Collection<String> surfaceBlacklist =
+            accessParameters.getVehiclePropertyValue(VehiclePropertyTypes.SURFACE_BLACKLIST);
 
-		if (surfaceBlacklist != null && surfaceBlacklist.contains(surface)) {
-			return false;
-		} else {
-			return true;
-		}
-	}
+        if (surfaceBlacklist != null && surfaceBlacklist.contains(surface)) {
+            return false;
+        } else {
+            return true;
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadTracktype.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadTracktype.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadTracktype.java	(revision 23189)
@@ -7,47 +7,47 @@
 public class RoadTracktype implements RoadPropertyType<Integer> {
 
-	public <N, W, R, M> Integer evaluateN(N node, AccessParameters accessParameters,
-			DataSource<N,W,R,M> dataSource) {
-		return null;
-	};
+    public <N, W, R, M> Integer evaluateN(N node, AccessParameters accessParameters,
+            DataSource<N,W,R,M> dataSource) {
+        return null;
+    };
 
-	public <N, W, R, M> Integer evaluateW(W way, boolean forward, AccessParameters accessParameters,
-			DataSource<N,W,R,M> dataSource) {
-		assert way != null && accessParameters != null && dataSource != null;
+    public <N, W, R, M> Integer evaluateW(W way, boolean forward, AccessParameters accessParameters,
+            DataSource<N,W,R,M> dataSource) {
+        assert way != null && accessParameters != null && dataSource != null;
 
-		TagGroup tags = dataSource.getTagsW(way);
-		String tracktypeString = tags.getValue("tracktype");
+        TagGroup tags = dataSource.getTagsW(way);
+        String tracktypeString = tags.getValue("tracktype");
 
-		if (tracktypeString != null) {
-			if        ("grade1".equals(tracktypeString)) {
-				return 1;
-			} else if ("grade2".equals(tracktypeString)) {
-				return 2;
-			} else if ("grade3".equals(tracktypeString)) {
-				return 3;
-			} else if ("grade4".equals(tracktypeString)) {
-				return 4;
-			} else if ("grade5".equals(tracktypeString)) {
-				return 5;
-			}
-		}
+        if (tracktypeString != null) {
+            if        ("grade1".equals(tracktypeString)) {
+                return 1;
+            } else if ("grade2".equals(tracktypeString)) {
+                return 2;
+            } else if ("grade3".equals(tracktypeString)) {
+                return 3;
+            } else if ("grade4".equals(tracktypeString)) {
+                return 4;
+            } else if ("grade5".equals(tracktypeString)) {
+                return 5;
+            }
+        }
 
-		return null;
-	};
+        return null;
+    };
 
-	public boolean isUsable(Object propertyValue, AccessParameters accessParameters) {
-		assert propertyValue instanceof Integer;
+    public boolean isUsable(Object propertyValue, AccessParameters accessParameters) {
+        assert propertyValue instanceof Integer;
 
-		int tracktype = (Integer)propertyValue;
+        int tracktype = (Integer)propertyValue;
 
-		Integer maxTracktype =
-			accessParameters.getVehiclePropertyValue(VehiclePropertyTypes.MAX_TRACKTYPE);
+        Integer maxTracktype =
+            accessParameters.getVehiclePropertyValue(VehiclePropertyTypes.MAX_TRACKTYPE);
 
-		if (maxTracktype != null && tracktype > maxTracktype) {
-			return false;
-		} else {
-			return true;
-		}
-	}
+        if (maxTracktype != null && tracktype > maxTracktype) {
+            return false;
+        } else {
+            return true;
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadValueLimit.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadValueLimit.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadValueLimit.java	(revision 23189)
@@ -11,66 +11,66 @@
 abstract public class RoadValueLimit implements RoadPropertyType<Float> {
 
-	protected static enum LimitType {MINIMUM, MAXIMUM};
+    protected static enum LimitType {MINIMUM, MAXIMUM};
 
-	private final String keyName;
-	private final VehiclePropertyType<Float> vehicleProperty;
+    private final String keyName;
+    private final VehiclePropertyType<Float> vehicleProperty;
 
-	private final LimitType upperLimit;
+    private final LimitType upperLimit;
 
-	/**
-	 * @param keyName          key that is used to add this property to a way; value must be in
-	 *                         format readable by {@link ValueStringParser#parseOsmDecimal(String)};
-	 *                         != null
-	 * @param vehicleProperty  vehicle property that is limited by this road property; != null
-	 * @param upperLimit       type of limit; != null
-	 */
-	protected RoadValueLimit(String keyName, VehiclePropertyType<Float> vehicleProperty,
-			LimitType upperLimit) {
-		assert keyName != null && vehicleProperty != null && upperLimit != null;
+    /**
+     * @param keyName          key that is used to add this property to a way; value must be in
+     *                         format readable by {@link ValueStringParser#parseOsmDecimal(String)};
+     *                         != null
+     * @param vehicleProperty  vehicle property that is limited by this road property; != null
+     * @param upperLimit       type of limit; != null
+     */
+    protected RoadValueLimit(String keyName, VehiclePropertyType<Float> vehicleProperty,
+            LimitType upperLimit) {
+        assert keyName != null && vehicleProperty != null && upperLimit != null;
 
-		this.keyName = keyName;
-		this.vehicleProperty = vehicleProperty;
-		this.upperLimit = upperLimit;
-	}
+        this.keyName = keyName;
+        this.vehicleProperty = vehicleProperty;
+        this.upperLimit = upperLimit;
+    }
 
-	protected abstract Float parse(String valueString);
+    protected abstract Float parse(String valueString);
 
-	public <N, W, R, M> Float evaluateW(W way, boolean forward,
-			AccessParameters accessParameters, DataSource<N, W, R, M> dataSource) {
-		assert way != null && accessParameters != null && dataSource != null;
-		return evaluateTags(dataSource.getTagsW(way));
-	}
+    public <N, W, R, M> Float evaluateW(W way, boolean forward,
+            AccessParameters accessParameters, DataSource<N, W, R, M> dataSource) {
+        assert way != null && accessParameters != null && dataSource != null;
+        return evaluateTags(dataSource.getTagsW(way));
+    }
 
-	public <N, W, R, M> Float evaluateN(N node,
-			AccessParameters accessParameters, DataSource<N, W, R, M> dataSource) {
-		assert node != null && accessParameters != null && dataSource != null;
-		return evaluateTags(dataSource.getTagsN(node));
-	}
+    public <N, W, R, M> Float evaluateN(N node,
+            AccessParameters accessParameters, DataSource<N, W, R, M> dataSource) {
+        assert node != null && accessParameters != null && dataSource != null;
+        return evaluateTags(dataSource.getTagsN(node));
+    }
 
-	private final Float evaluateTags(TagGroup tags) {
-		String valueString = tags.getValue(keyName);
-		if (valueString != null) {
-			Float value = parse(valueString);
-			return value;
-		} else {
-			return null;
-		}
-	}
+    private final Float evaluateTags(TagGroup tags) {
+        String valueString = tags.getValue(keyName);
+        if (valueString != null) {
+            Float value = parse(valueString);
+            return value;
+        } else {
+            return null;
+        }
+    }
 
-	public boolean isUsable(Object propertyValue, AccessParameters accessParameters) {
-		assert propertyValue instanceof Float;
+    public boolean isUsable(Object propertyValue, AccessParameters accessParameters) {
+        assert propertyValue instanceof Float;
 
-		Float vehicleValue = accessParameters.getVehiclePropertyValue(vehicleProperty);
+        Float vehicleValue = accessParameters.getVehiclePropertyValue(vehicleProperty);
 
-		if (vehicleValue != null) {
-			switch(upperLimit) {
-				case MINIMUM: return vehicleValue >= (Float) propertyValue;
-				case MAXIMUM: return vehicleValue <= (Float) propertyValue;
-				default:      throw new Error("unhandled LimitType");
-			}
-		} else {
-			return true;
-		}
-	}
+        if (vehicleValue != null) {
+            switch(upperLimit) {
+                case MINIMUM: return vehicleValue >= (Float) propertyValue;
+                case MAXIMUM: return vehicleValue <= (Float) propertyValue;
+                default:      throw new Error("unhandled LimitType");
+            }
+        } else {
+            return true;
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadWidth.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadWidth.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/RoadWidth.java	(revision 23189)
@@ -6,10 +6,10 @@
 
 public class RoadWidth extends RoadValueLimit {
-	public RoadWidth() {
-		super("width", WIDTH, LimitType.MAXIMUM);
-	}
-	@Override
-	protected Float parse(String valueString) {
-		return ValueStringParser.parseMeasure(valueString);
-	}
+    public RoadWidth() {
+        super("width", WIDTH, LimitType.MAXIMUM);
+    }
+    @Override
+    protected Float parse(String valueString) {
+        return ValueStringParser.parseMeasure(valueString);
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/VehiclePropertyType.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/VehiclePropertyType.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/VehiclePropertyType.java	(revision 23189)
@@ -11,9 +11,9 @@
 public interface VehiclePropertyType<V> {
 
-	/**
-	 * determines whether a value is valid.
-	 * null is never a valid value and must not be used as parameter.
-	 */
-	public boolean isValidValue(Object value);
+    /**
+     * determines whether a value is valid.
+     * null is never a valid value and must not be used as parameter.
+     */
+    public boolean isValidValue(Object value);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/VehiclePropertyTypes.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/VehiclePropertyTypes.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/property/VehiclePropertyTypes.java	(revision 23189)
@@ -9,65 +9,65 @@
 public final class VehiclePropertyTypes {
 
-	/** prevents instantiation */
-	private VehiclePropertyTypes() { }
+    /** prevents instantiation */
+    private VehiclePropertyTypes() { }
 
-	private static final class NonnegativeFloatProperty implements VehiclePropertyType<Float> {
-		public boolean isValidValue(Object value) {
-			return value instanceof Float && (Float)value >= 0;
-		}
-	}
+    private static final class NonnegativeFloatProperty implements VehiclePropertyType<Float> {
+        public boolean isValidValue(Object value) {
+            return value instanceof Float && (Float)value >= 0;
+        }
+    }
 
-	/** length of a vehicle in meters; negative values are invalid */
-	public static final VehiclePropertyType<Float> LENGTH = new NonnegativeFloatProperty();
+    /** length of a vehicle in meters; negative values are invalid */
+    public static final VehiclePropertyType<Float> LENGTH = new NonnegativeFloatProperty();
 
-	/** width of a vehicle in meters; negative values are invalid */
-	public static final VehiclePropertyType<Float> WIDTH = new NonnegativeFloatProperty();
+    /** width of a vehicle in meters; negative values are invalid */
+    public static final VehiclePropertyType<Float> WIDTH = new NonnegativeFloatProperty();
 
-	/** height of a vehicle in meters; negative values are invalid */
-	public static final VehiclePropertyType<Float> HEIGHT = new NonnegativeFloatProperty();
+    /** height of a vehicle in meters; negative values are invalid */
+    public static final VehiclePropertyType<Float> HEIGHT = new NonnegativeFloatProperty();
 
-	/** weight of a vehicle in tons; negative values are invalid */
-	public static final VehiclePropertyType<Float> WEIGHT = new NonnegativeFloatProperty();
+    /** weight of a vehicle in tons; negative values are invalid */
+    public static final VehiclePropertyType<Float> WEIGHT = new NonnegativeFloatProperty();
 
-	/** axleload of a vehicle in tons; negative values are invalid */
-	public static final VehiclePropertyType<Float> AXLELOAD = new NonnegativeFloatProperty();
+    /** axleload of a vehicle in tons; negative values are invalid */
+    public static final VehiclePropertyType<Float> AXLELOAD = new NonnegativeFloatProperty();
 
-	/** speed a vehicle can reach in km/h; negative values are invalid */
-	public static final VehiclePropertyType<Float> SPEED = new NonnegativeFloatProperty();
+    /** speed a vehicle can reach in km/h; negative values are invalid */
+    public static final VehiclePropertyType<Float> SPEED = new NonnegativeFloatProperty();
 
-	/** maximum incline a vehicle can go up; negative values are invalid */
-	public static final VehiclePropertyType<Float> MAX_INCLINE_UP = new NonnegativeFloatProperty();
+    /** maximum incline a vehicle can go up; negative values are invalid */
+    public static final VehiclePropertyType<Float> MAX_INCLINE_UP = new NonnegativeFloatProperty();
 
-	/** maximum incline a vehicle can go down; negative values are invalid */
-	public static final VehiclePropertyType<Float> MAX_INCLINE_DOWN = new NonnegativeFloatProperty();
+    /** maximum incline a vehicle can go down; negative values are invalid */
+    public static final VehiclePropertyType<Float> MAX_INCLINE_DOWN = new NonnegativeFloatProperty();
 
-	/** surface types ("surface" key values) the vehicle cannot use */
-	public static final VehiclePropertyType<Collection<String>> SURFACE_BLACKLIST = new VehiclePropertyType<Collection<String>>() {
-		public boolean isValidValue(Object value) {
+    /** surface types ("surface" key values) the vehicle cannot use */
+    public static final VehiclePropertyType<Collection<String>> SURFACE_BLACKLIST = new VehiclePropertyType<Collection<String>>() {
+        public boolean isValidValue(Object value) {
 
-			if (!(value instanceof Collection)) {
-				return false;
-			}
+            if (!(value instanceof Collection)) {
+                return false;
+            }
 
-			for (Object contentObject : (Collection<?>)value) {
-				if (!(contentObject instanceof String)) {
-					return false;
-				}
-			}
+            for (Object contentObject : (Collection<?>)value) {
+                if (!(contentObject instanceof String)) {
+                    return false;
+                }
+            }
 
-			return true;
-		}
-	};
+            return true;
+        }
+    };
 
-	/**
-	 * maximum tracktype grade the vehicle can use;
-	 * values are integers from = to 5
-	 * (values of key "tracktype" without "grade_" prefix, 0 is for "none")
-	 */
-	public static final VehiclePropertyType<Integer> MAX_TRACKTYPE = new VehiclePropertyType<Integer>() {
-		public boolean isValidValue(Object value) {
-			return value instanceof Integer && (Integer)value >= 0 && (Integer)value <= 5;
-		}
-	};
+    /**
+     * maximum tracktype grade the vehicle can use;
+     * values are integers from = to 5
+     * (values of key "tracktype" without "grade_" prefix, 0 is for "none")
+     */
+    public static final VehiclePropertyType<Integer> MAX_TRACKTYPE = new VehiclePropertyType<Integer>() {
+        public boolean isValidValue(Object value) {
+            return value instanceof Integer && (Integer)value >= 0 && (Integer)value <= 5;
+        }
+    };
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/GenericTransitionStructure.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/GenericTransitionStructure.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/GenericTransitionStructure.java	(revision 23189)
@@ -30,663 +30,663 @@
 public class GenericTransitionStructure<N, W, R, M> implements TransitionStructure, DataSourceObserver {
 
-	private static final Collection<Segment> EMPTY_SEGMENT_LIST =
-		Collections.unmodifiableList(new ArrayList<Segment>(0));
-	private static final Collection<Restriction> EMPTY_RESTRICTION_COLLECTION =
-		new ArrayList<Restriction>(0);
-
-	private static class SegmentNodeImpl implements SegmentNode {
-		private final double lat;
-		private final double lon;
-		private final List<Segment> inboundSegments = new LinkedList<Segment>();
-		private final List<Segment> outboundSegments = new LinkedList<Segment>();
-		private final Map<RoadPropertyType<?>, Object> properties;
-		public SegmentNodeImpl(double lat, double lon, Map<RoadPropertyType<?>, Object> properties) {
-			assert properties != null;
-			this.lat = lat;
-			this.lon = lon;
-			this.properties = properties;
-		}
-		public double getLat() {
-			return lat;
-		}
-		public double getLon() {
-			return lon;
-		}
-		public void addInboundSegment(Segment segment) {
-			inboundSegments.add(segment);
-		}
-		public void addOutboundSegment(Segment segment) {
-			outboundSegments.add(segment);
-		}
-		public Collection<Segment> getOutboundSegments() {
-			return outboundSegments;
-		}
-		public Collection<Segment> getInboundSegments() {
-			return inboundSegments;
-		}
-
-		public <P> void setProperty(RoadPropertyType<P> property, P value) {
-			properties.put(property, value);
-		}
-		public Collection<RoadPropertyType<?>> getAvailableProperties() {
-			return properties.keySet();
-		}
-		public <P> P getPropertyValue(RoadPropertyType<P> property) {
-			@SuppressWarnings("unchecked") //cast is safe due to type parameter of setProperty
-			P result = (P) properties.get(property);
-			return result;
-		}
-		public Map<RoadPropertyType<?>, Object> getProperties() {
-			return properties;
-		}
-
-		@Override
-		public String toString() {
-			return "(" + lat + ", " + lon + ")";
-		}
-	}
-
-	private static class SegmentImpl implements Segment {
-		private final SegmentNode node1;
-		private final SegmentNode node2;
-		private final Map<RoadPropertyType<?>, Object> properties;
-		public SegmentImpl(SegmentNode node1, SegmentNode node2, Map<RoadPropertyType<?>, Object> properties) {
-			this.node1 = node1;
-			this.node2 = node2;
-			this.properties = properties;
-		}
-		public SegmentNode getNode1() {
-			return node1;
-		}
-		public SegmentNode getNode2() {
-			return node2;
-		}
-		public <P> void setProperty(RoadPropertyType<P> property, P value) {
-			properties.put(property, value);
-		}
-		public Collection<RoadPropertyType<?>> getAvailableProperties() {
-			return properties.keySet();
-		}
-		public <P> P getPropertyValue(RoadPropertyType<P> property) {
-			@SuppressWarnings("unchecked") //cast is safe due to type parameter of setProperty
-			P result = (P) properties.get(property);
-			return result;
-		}
-
-		@Override
-		public String toString() {
-			return "(" + node1 + "->" + node2 + ")";
-		}
-	}
-
-	private static class RestrictionImpl implements Restriction {
-		private final Segment from;
-		private final Collection<Segment> vias;
-		private final Collection<Segment> tos;
-
-		/** constructor, will directly use collection references, collections must not be changed after usage as constructor param */
-		public RestrictionImpl(Segment from, Collection<Segment> vias, Collection<Segment> tos) {
-			this.from = from;
-			this.vias = Collections.unmodifiableCollection(vias);
-			this.tos = Collections.unmodifiableCollection(tos);
-		}
-
-		public Segment getFrom() {
-			return from;
-		}
-		public Collection<Segment> getVias() {
-			return vias;
-		}
-		public Collection<Segment> getTos() {
-			return tos;
-		}
-
-		@Override
-		public String toString() {
-			return from + " -> " + vias + " -> " + tos;
-		}
-	}
-
-	private final Set<TransitionStructureObserver> observers = new HashSet<TransitionStructureObserver>();
-
-	private final Collection<RoadPropertyType<?>> properties;
-
-	private final DataSource<N, W, R, M> dataSource;
-
-	private AccessParameters accessParameters;
-	private AccessRuleset ruleset;
-
-	private AccessEvaluator<N, W> accessEvaluator;
-
-	private Collection<SegmentNode> nodes = null;
-	private Collection<Segment> segments = new LinkedList<Segment>();
-	private Collection<Restriction> restrictions = new LinkedList<Restriction>();
-
-	public GenericTransitionStructure(
-			AccessParameters accessParameters, AccessRuleset ruleset,
-			DataSource<N, W, R, M> dataSource,
-			Collection<RoadPropertyType<?>> properties) {
-
-		assert accessParameters != null && ruleset != null;
-		assert dataSource != null;
-		assert properties != null;
-
-		this.dataSource = dataSource;
-
-		this.properties = properties;
-
-		setAccessParametersAndRuleset(accessParameters, ruleset);
-
-		dataSource.addObserver(this);
-	}
-
-	/**
-	 * sets new access parameters and/or a new ruleset.
-	 * Causes a data update if at least one is actually changed.
-	 *
-	 * @param accessParameters  new access parameters, null indicates no change
-	 * @param ruleset           new ruleset, null indicates no change
-	 */
-	public void setAccessParametersAndRuleset(AccessParameters accessParameters, AccessRuleset ruleset) {
-
-		if (accessParameters != null) {
-			this.accessParameters = accessParameters;
-		}
-		if (ruleset != null) {
-			this.ruleset = ruleset;
-		}
-
-		if (accessParameters != null || ruleset != null) {
-
-			assert dataSource != null;
-
-			accessEvaluator = new RulesetAccessEvaluator<N, W, R, M>(
-					dataSource,
-					this.ruleset,
-					this.accessParameters);
-
-			updateData();
-			notifyObservers();
-
-		}
-
-	}
-
-	public Collection<SegmentNode> getNodes() {
-		return nodes;
-	}
-
-	public Collection<Segment> getSegments() {
-		return segments;
-	}
-
-	public Collection<Restriction> getRestrictions() {
-		return restrictions;
-	}
-
-	/**
-	 * creates nodes, segments and restrictions based on the data source
-	 */
-	protected void updateData() {
-
-		ArrayList<SegmentNode> nodes = new ArrayList<SegmentNode>();
-		ArrayList<Segment> segments = new ArrayList<Segment>();
-
-		Map<N, SegmentNodeImpl> nodeCreationMap = new HashMap<N, SegmentNodeImpl>();
-		Map<W, List<Segment>> waySegmentMap = new HashMap<W, List<Segment>>();
-
-		/* create segments (nodes are created only when included in a segment) */
-
-		for (W way : dataSource.getWays()) {
-			createSegmentsAndSegmentNodes(way, accessEvaluator, nodes, segments, nodeCreationMap, waySegmentMap);
-		}
-
-		nodes.trimToSize();
-		segments.trimToSize();
-
-		/* create restrictions */
-
-		Collection<Restriction> restrictions =
-			createRestrictionsFromTurnRestrictions(dataSource.getRelations(), nodeCreationMap, waySegmentMap);
-
-		restrictions.addAll(createRestrictionsFromBarrierNodes(nodeCreationMap, waySegmentMap));
-
-		/* keep data and inform observers */
-
-		this.nodes = nodes;
-		this.segments = segments;
-		this.restrictions = restrictions;
-
-		notifyObservers();
-
-	}
-
-	/**
-	 * creates all Segments and SegmentNodes for a way
-	 *
-	 * @param way                 way to create Segments and SegmentNodes from; != null
-	 * @param wayAccessEvaluator  evaluator object that decides whether way is usable; != null
-	 * @param nodes               collection of SegmentNodes, new SegmentNodes will be added here; != null
-	 * @param segments            collection of Segments, new Segments will be added here; != null
-	 * @param nodeCreationMap     map providing the SegmentNode that has been created from a Node,
-	 *                            if new SegmentNodes are created, they will be added appropriately; != null
-	 * @param waySegmentMap       map providing the Segments that have been created from a Way,
-	 *                            if new Segments are created, they will be added appropriately; != null
-	 */
-	private void createSegmentsAndSegmentNodes(W way, AccessEvaluator<N, W> wayAccessEvaluator,
-			Collection<SegmentNode> nodes, Collection<Segment> segments,
-			Map<N, SegmentNodeImpl> nodeCreationMap, Map<W, List<Segment>> waySegmentMap) {
-
-		assert way != null && wayAccessEvaluator != null && nodes != null && segments != null && nodeCreationMap != null && waySegmentMap != null;
-
-		/* calculate property values */
-
-		Map<RoadPropertyType<?>, Object> forwardPropertyValues = getWayPropertyMap(way, true);
-		Map<RoadPropertyType<?>, Object> backwardPropertyValues = getWayPropertyMap(way, false);
-
-		/* create segments from the way if it can be accessed and isn't incomplete or deleted */
-
-		boolean forwardAccess = wayAccessEvaluator.wayUsable(way, true, forwardPropertyValues);
-		boolean backwardAccess = wayAccessEvaluator.wayUsable(way, false, backwardPropertyValues);
-
-		if (forwardAccess || backwardAccess) {
-
-			if (!waySegmentMap.containsKey(way)) {
-				waySegmentMap.put(way, new LinkedList<Segment>());
-			}
-
-			/* create segments from all pairs of subsequent nodes */
-
-			N previousNode = null;
-			for (N node : dataSource.getNodes(way)) {
-				if (previousNode != null) {
-
-					SegmentNodeImpl node1 =
-						getOrCreateSegmentNodeForNode(previousNode, nodes, nodeCreationMap);
-					SegmentNodeImpl node2 =
-						getOrCreateSegmentNodeForNode(node, nodes, nodeCreationMap);
-
-					if (forwardAccess) {
-						SegmentImpl segment = new SegmentImpl(node1, node2, forwardPropertyValues);
-						segments.add(segment);
-						waySegmentMap.get(way).add(segment);
-						node1.addOutboundSegment(segment);
-						node2.addInboundSegment(segment);
-					}
-					if (backwardAccess) { //no "else if" because both can be valid
-						SegmentImpl segment = new SegmentImpl(node2, node1, backwardPropertyValues);
-						segments.add(segment);
-						waySegmentMap.get(way).add(segment);
-						node1.addInboundSegment(segment);
-						node2.addOutboundSegment(segment);
-					}
-
-				}
-				previousNode = node;
-			}
-
-		}
-	}
-
-	/**
-	 * if no segment node for a node exists in the nodeCreationMap,
-	 * creates a segment node for it and adds it to the nodeCreationMap and the nodes collection
-	 * and returns it; otherwise returns the existing segment node.
-	 */
-	private SegmentNodeImpl getOrCreateSegmentNodeForNode(N node,
-			Collection<SegmentNode> nodes, Map<N, SegmentNodeImpl> nodeCreationMap) {
-
-		SegmentNodeImpl segmentNode = nodeCreationMap.get(node);
-
-		if (segmentNode == null) {
-
-			Map<RoadPropertyType<?>, Object> nodePropertyValues = getNodePropertyMap(node);
-			segmentNode = new SegmentNodeImpl(dataSource.getLat(node), dataSource.getLon(node),
-					nodePropertyValues);
-
-			nodeCreationMap.put(node, segmentNode);
-			nodes.add(segmentNode);
-
-		}
-
-		return segmentNode;
-	}
-
-	/**
-	 * creates all Restrictions from a collection of Relations.
-	 * Only "type=restriction" relations are relevant for restrictions.
-	 *
-	 * @param relations        Relations to create Restrictions from.
-	 *                         They can have any type key, as filtering is done inside this method.
-	 * @param nodeCreationMap  map providing the SegmentNode that has been created from a Node,
-	 *                         will not be modified; != null
-	 * @param waySegmentMap    map providing the Segments that have been created from a Way,
-	 *                         will not be modified; != null
-	 * @return                 Restrictions created from the Relations; != null, but may be empty
-	 */
-	private Collection<Restriction> createRestrictionsFromTurnRestrictions(
-			Iterable<R> relations,
-			Map<N, SegmentNodeImpl> nodeCreationMap,
-			Map<W, List<Segment>> waySegmentMap) {
-
-		assert relations != null && nodeCreationMap != null && waySegmentMap != null;
-
-		Collection<Restriction> results = new LinkedList<Restriction>();
-
-		for (R relation : relations) {
-
-			TagGroup tags = dataSource.getTagsR(relation);
-
-			if ("restriction".equals(tags.getValue("type"))
-					&& tags.getValue("restriction") != null ) {
-
-				//evaluate relation
-				if (tags.getValue("restriction").startsWith("no_")) {
-					results.addAll(createRestrictionsFromRestrictionRelation(relation, true, nodeCreationMap, waySegmentMap));
-				} else if (tags.getValue("restriction").startsWith("only_")) {
-					results.addAll(createRestrictionsFromRestrictionRelation(relation, false, nodeCreationMap, waySegmentMap));
-				}
-
-			}
-		}
-
-		return results;
-	}
-
-	@SuppressWarnings("unchecked") //several generic casts that are checked with isInstance
-	private Collection<Restriction> createRestrictionsFromRestrictionRelation(
-			R relation,
-			boolean restrictive,
-			Map<N, SegmentNodeImpl> nodeCreationMap,
-			Map<W, List<Segment>> waySegmentMap) {
-
-		/* collect information about the relation */
-
-		W fromWay = null;
-		Collection<N> viaNodes = new LinkedList<N>();
-		Collection<W> viaWays = new LinkedList<W>();
-		Collection<W> toWays = new LinkedList<W>();
-
-		for (M member : dataSource.getMembers(relation)) {
-
-			if ("from".equals(dataSource.getRole(member))) {
-				if (fromWay != null || !dataSource.isWMember(member)) {
-					//broken restriction
-					return EMPTY_RESTRICTION_COLLECTION;
-				} else {
-					fromWay = (W)dataSource.getMember(member);
-				}
-			} else if ("to".equals(dataSource.getRole(member))) {
-				if (!dataSource.isWMember(member)) {
-					//broken restriction
-					return EMPTY_RESTRICTION_COLLECTION;
-				} else {
-					toWays.add((W)dataSource.getMember(member));
-				}
-			} else if ("via".equals(dataSource.getRole(member))) {
-				if (dataSource.isWMember(member)) {
-					viaWays.add((W)dataSource.getMember(member));
-				} else if (dataSource.isNMember(member)) {
-					viaNodes.add((N)dataSource.getMember(member));
-				}
-			}
-
-		}
-
-		if (fromWay != null && toWays.size() > 0 &&
-				(viaNodes.size() > 0 || viaWays.size() > 0)) {
-
-			return createRestrictionsFromRestrictionRelationMembers(
-					restrictive, nodeCreationMap, waySegmentMap,
-					fromWay, viaNodes, viaWays, toWays);
-
-		} else {
-			return new ArrayList<Restriction>(0);
-		}
-	}
-
-	private Collection<Restriction> createRestrictionsFromRestrictionRelationMembers(
-			boolean restrictive,
-			Map<N, SegmentNodeImpl> nodeCreationMap, Map<W, List<Segment>> waySegmentMap,
-			W fromWay, Collection<N> viaNodes, Collection<W> viaWays, Collection<W> toWays) {
-
-		Collection<SegmentNode> nodesCreatedFromViaNodes = new ArrayList<SegmentNode>(viaNodes.size());
-		for (N viaNode : viaNodes) {
-			if (nodeCreationMap.containsKey(viaNode)) {
-				nodesCreatedFromViaNodes.add(nodeCreationMap.get(viaNode));
-			}
-		}
-
-		/* check completeness of restriction to avoid dealing with incomplete restriction info */
-
-		if (!waySegmentMap.containsKey(fromWay)) {
-			//broken restriction
-			return EMPTY_RESTRICTION_COLLECTION;
-		}
-
-		for (W viaWay : viaWays) {
-			if (!waySegmentMap.containsKey(viaWay)) {
-				//broken restriction
-				return EMPTY_RESTRICTION_COLLECTION;
-			}
-		}
-
-		for (W toWay : toWays) {
-			if (!waySegmentMap.containsKey(toWay)) {
-				//broken restriction
-				return EMPTY_RESTRICTION_COLLECTION;
-			}
-		}
-
-		/* find all via segments:
-		 * via segments are segments created from via ways
-		 * or segments starting and ending with nodes created from via nodes */
-
-		ArrayList<Segment> viaSegments = new ArrayList<Segment>();
-
-		for (W viaWay : viaWays) {
-			viaSegments.addAll(waySegmentMap.get(viaWay));
-		}
-
-		for (SegmentNode nodeCreatedFromViaNode : nodesCreatedFromViaNodes) {
-			for (Segment segment : nodeCreatedFromViaNode.getOutboundSegments()) {
-				if (nodesCreatedFromViaNodes.contains(segment.getNode2())) {
-					viaSegments.add(segment);
-				}
-			}
-		}
-
-		viaSegments.trimToSize();
-
-		/* create a set with all nodes that are based on via members */
-
-		Set<SegmentNode> nodesCreatedFromViaMembers
-		= new HashSet<SegmentNode>(nodesCreatedFromViaNodes);
-
-		for (W viaWay : viaWays) {
-			for (N viaWayNode : dataSource.getNodes(viaWay)) {
-				nodesCreatedFromViaMembers.add(nodeCreationMap.get(viaWayNode));
-			}
-		}
-
-		/*
-		 * find from segment and to segments:
-		 * Such a segment contains a node based on a via member.
-		 * Each way should contain only one possible segment
-		 * connecting to via members (due to splitting).
-		 */
-
-		Segment fromSegment = null;
-		Collection<Segment> toSegments = new ArrayList<Segment>();
-
-		for (Segment possibleFromSegment : waySegmentMap.get(fromWay)) {
-			if (nodesCreatedFromViaMembers.contains(possibleFromSegment.getNode2())) {
-
-				if (fromSegment == null) {
-					fromSegment = possibleFromSegment;
-				} else {
-					//broken restriction
-					return EMPTY_RESTRICTION_COLLECTION;
-				}
-
-			}
-		}
-		if (fromSegment == null) {
-			//broken restriction
-			return EMPTY_RESTRICTION_COLLECTION;
-		}
-
-		if (restrictive) {
-
-			for (W toWay : toWays) {
-				if (waySegmentMap.containsKey(toWay)) {
-					Segment toSegment = null;
-					for (Segment possibleToSegment : waySegmentMap.get(toWay)) {
-						if (nodesCreatedFromViaMembers.contains(possibleToSegment.getNode1())) {
-
-							if (toSegment == null) {
-								toSegment = possibleToSegment;
-							} else {
-								//broken restriction
-								return EMPTY_RESTRICTION_COLLECTION;
-							}
-
-						}
-					}
-					if (toSegment == null) {
-						//broken restriction
-						return EMPTY_RESTRICTION_COLLECTION;
-					} else {
-						toSegments.add(toSegment);
-					}
-				}
-			}
-
-		} else { //!restrictive
-
-			/* forbidden "to" segments are all segments that start at a "via" node
-			 * and are neither a via segment nor created from an allowed "to" way */
-
-			for (SegmentNode toStartingNode : nodesCreatedFromViaMembers) {
-				for (Segment outboundSegment : toStartingNode.getOutboundSegments()) {
-
-					if (!viaSegments.contains(outboundSegment)) {
-
-						boolean isAllowed = false;
-
-						for (W toWay : toWays) {
-							if (waySegmentMap.get(toWay).contains(outboundSegment)) {
-								isAllowed = true;
-								break;
-							}
-						}
-
-						if (!isAllowed) {
-							toSegments.add(outboundSegment);
-						}
-
-					}
-
-				}
-			}
-
-		}
-
-		/* create restriction */
-
-		Collection<Restriction> results = new ArrayList<Restriction>(1);
-		results.add(new RestrictionImpl(fromSegment, viaSegments, toSegments));
-		return results;
-	}
-
-	/**
-	 * creates Restrictions from barrier nodes (nodes that are considered impassable by the
-	 * {@link #accessEvaluator}). These restrictions prevent moving from a segment before the
-	 * barrier node to a segment after the barrier node.
-	 *
-	 * @param nodeCreationMap  map providing the SegmentNode that has been created from a node,
-	 *                         will not be modified; != null
-	 * @param waySegmentMap    map providing the Segments that have been created from a way,
-	 *                         will not be modified; != null
-	 * @return                 Restrictions created from barrier nodes; != null, but may be empty
-	 */
-	private Collection<Restriction> createRestrictionsFromBarrierNodes(
-			Map<N, SegmentNodeImpl> nodeCreationMap,
-			Map<W, List<Segment>> waySegmentMap) {
-
-		assert nodeCreationMap != null;
-		assert waySegmentMap != null;
-
-		Collection<Restriction> results = new LinkedList<Restriction>();
-
-		for (N node : nodeCreationMap.keySet()) {
-
-			if (!accessEvaluator.nodeUsable(node, nodeCreationMap.get(node).getProperties())) {
-
-				SegmentNode barrierNode = nodeCreationMap.get(node);
-
-				for (Segment inboundSegment : barrierNode.getInboundSegments()) {
-					for (Segment outboundSegment : barrierNode.getOutboundSegments()) {
-						results.add(new RestrictionImpl(inboundSegment, EMPTY_SEGMENT_LIST, Arrays.asList(outboundSegment)));
-					}
-				}
-
-			}
-
-		}
-
-		return results;
-	}
-
-	/**
-	 * determines the values of all RoadPropertyTypes from {@link #properties} for a way and
-	 * creates a map with the types that have non-null values as keys, property values as content
-	 */
-	private Map<RoadPropertyType<?>, Object> getWayPropertyMap(W way, boolean forward) {
-		Map<RoadPropertyType<?>, Object> propertyValues;
-		propertyValues = new HashMap<RoadPropertyType<?>, Object>();
-		for (RoadPropertyType<?> property : properties) {
-			Object value = property.evaluateW(way, forward, accessParameters, dataSource);
-			if (value != null) {
-				propertyValues.put(property, value);
-			}
-		}
-		return propertyValues;
-	}
-
-	/**
-	 * determines the values of all RoadPropertyTypes from {@link #properties} for a node and
-	 * creates a map with the types that have non-null values as keys, property values as content
-	 */
-	private Map<RoadPropertyType<?>, Object> getNodePropertyMap(N node) {
-		Map<RoadPropertyType<?>, Object> propertyValues;
-		propertyValues = new HashMap<RoadPropertyType<?>, Object>();
-		for (RoadPropertyType<?> property : properties) {
-			Object value = property.evaluateN(node, accessParameters, dataSource);
-			if (value != null) {
-				propertyValues.put(property, value);
-			}
-		}
-		return propertyValues;
-	}
-
-	public void update(DataSource<?, ?, ?, ?> dataSource) {
-		assert this.dataSource == dataSource;
-		updateData();
-	}
-
-	public void addObserver(TransitionStructureObserver observer) {
-		observers.add(observer);
-	}
-
-	public void deleteObserver(TransitionStructureObserver observer) {
-		observers.remove(observer);
-	}
-
-	protected void notifyObservers() {
-		for (TransitionStructureObserver observer : observers) {
-			observer.update(this);
-		}
-	}
+    private static final Collection<Segment> EMPTY_SEGMENT_LIST =
+        Collections.unmodifiableList(new ArrayList<Segment>(0));
+    private static final Collection<Restriction> EMPTY_RESTRICTION_COLLECTION =
+        new ArrayList<Restriction>(0);
+
+    private static class SegmentNodeImpl implements SegmentNode {
+        private final double lat;
+        private final double lon;
+        private final List<Segment> inboundSegments = new LinkedList<Segment>();
+        private final List<Segment> outboundSegments = new LinkedList<Segment>();
+        private final Map<RoadPropertyType<?>, Object> properties;
+        public SegmentNodeImpl(double lat, double lon, Map<RoadPropertyType<?>, Object> properties) {
+            assert properties != null;
+            this.lat = lat;
+            this.lon = lon;
+            this.properties = properties;
+        }
+        public double getLat() {
+            return lat;
+        }
+        public double getLon() {
+            return lon;
+        }
+        public void addInboundSegment(Segment segment) {
+            inboundSegments.add(segment);
+        }
+        public void addOutboundSegment(Segment segment) {
+            outboundSegments.add(segment);
+        }
+        public Collection<Segment> getOutboundSegments() {
+            return outboundSegments;
+        }
+        public Collection<Segment> getInboundSegments() {
+            return inboundSegments;
+        }
+
+        public <P> void setProperty(RoadPropertyType<P> property, P value) {
+            properties.put(property, value);
+        }
+        public Collection<RoadPropertyType<?>> getAvailableProperties() {
+            return properties.keySet();
+        }
+        public <P> P getPropertyValue(RoadPropertyType<P> property) {
+            @SuppressWarnings("unchecked") //cast is safe due to type parameter of setProperty
+            P result = (P) properties.get(property);
+            return result;
+        }
+        public Map<RoadPropertyType<?>, Object> getProperties() {
+            return properties;
+        }
+
+        @Override
+        public String toString() {
+            return "(" + lat + ", " + lon + ")";
+        }
+    }
+
+    private static class SegmentImpl implements Segment {
+        private final SegmentNode node1;
+        private final SegmentNode node2;
+        private final Map<RoadPropertyType<?>, Object> properties;
+        public SegmentImpl(SegmentNode node1, SegmentNode node2, Map<RoadPropertyType<?>, Object> properties) {
+            this.node1 = node1;
+            this.node2 = node2;
+            this.properties = properties;
+        }
+        public SegmentNode getNode1() {
+            return node1;
+        }
+        public SegmentNode getNode2() {
+            return node2;
+        }
+        public <P> void setProperty(RoadPropertyType<P> property, P value) {
+            properties.put(property, value);
+        }
+        public Collection<RoadPropertyType<?>> getAvailableProperties() {
+            return properties.keySet();
+        }
+        public <P> P getPropertyValue(RoadPropertyType<P> property) {
+            @SuppressWarnings("unchecked") //cast is safe due to type parameter of setProperty
+            P result = (P) properties.get(property);
+            return result;
+        }
+
+        @Override
+        public String toString() {
+            return "(" + node1 + "->" + node2 + ")";
+        }
+    }
+
+    private static class RestrictionImpl implements Restriction {
+        private final Segment from;
+        private final Collection<Segment> vias;
+        private final Collection<Segment> tos;
+
+        /** constructor, will directly use collection references, collections must not be changed after usage as constructor param */
+        public RestrictionImpl(Segment from, Collection<Segment> vias, Collection<Segment> tos) {
+            this.from = from;
+            this.vias = Collections.unmodifiableCollection(vias);
+            this.tos = Collections.unmodifiableCollection(tos);
+        }
+
+        public Segment getFrom() {
+            return from;
+        }
+        public Collection<Segment> getVias() {
+            return vias;
+        }
+        public Collection<Segment> getTos() {
+            return tos;
+        }
+
+        @Override
+        public String toString() {
+            return from + " -> " + vias + " -> " + tos;
+        }
+    }
+
+    private final Set<TransitionStructureObserver> observers = new HashSet<TransitionStructureObserver>();
+
+    private final Collection<RoadPropertyType<?>> properties;
+
+    private final DataSource<N, W, R, M> dataSource;
+
+    private AccessParameters accessParameters;
+    private AccessRuleset ruleset;
+
+    private AccessEvaluator<N, W> accessEvaluator;
+
+    private Collection<SegmentNode> nodes = null;
+    private Collection<Segment> segments = new LinkedList<Segment>();
+    private Collection<Restriction> restrictions = new LinkedList<Restriction>();
+
+    public GenericTransitionStructure(
+            AccessParameters accessParameters, AccessRuleset ruleset,
+            DataSource<N, W, R, M> dataSource,
+            Collection<RoadPropertyType<?>> properties) {
+
+        assert accessParameters != null && ruleset != null;
+        assert dataSource != null;
+        assert properties != null;
+
+        this.dataSource = dataSource;
+
+        this.properties = properties;
+
+        setAccessParametersAndRuleset(accessParameters, ruleset);
+
+        dataSource.addObserver(this);
+    }
+
+    /**
+     * sets new access parameters and/or a new ruleset.
+     * Causes a data update if at least one is actually changed.
+     *
+     * @param accessParameters  new access parameters, null indicates no change
+     * @param ruleset           new ruleset, null indicates no change
+     */
+    public void setAccessParametersAndRuleset(AccessParameters accessParameters, AccessRuleset ruleset) {
+
+        if (accessParameters != null) {
+            this.accessParameters = accessParameters;
+        }
+        if (ruleset != null) {
+            this.ruleset = ruleset;
+        }
+
+        if (accessParameters != null || ruleset != null) {
+
+            assert dataSource != null;
+
+            accessEvaluator = new RulesetAccessEvaluator<N, W, R, M>(
+                    dataSource,
+                    this.ruleset,
+                    this.accessParameters);
+
+            updateData();
+            notifyObservers();
+
+        }
+
+    }
+
+    public Collection<SegmentNode> getNodes() {
+        return nodes;
+    }
+
+    public Collection<Segment> getSegments() {
+        return segments;
+    }
+
+    public Collection<Restriction> getRestrictions() {
+        return restrictions;
+    }
+
+    /**
+     * creates nodes, segments and restrictions based on the data source
+     */
+    protected void updateData() {
+
+        ArrayList<SegmentNode> nodes = new ArrayList<SegmentNode>();
+        ArrayList<Segment> segments = new ArrayList<Segment>();
+
+        Map<N, SegmentNodeImpl> nodeCreationMap = new HashMap<N, SegmentNodeImpl>();
+        Map<W, List<Segment>> waySegmentMap = new HashMap<W, List<Segment>>();
+
+        /* create segments (nodes are created only when included in a segment) */
+
+        for (W way : dataSource.getWays()) {
+            createSegmentsAndSegmentNodes(way, accessEvaluator, nodes, segments, nodeCreationMap, waySegmentMap);
+        }
+
+        nodes.trimToSize();
+        segments.trimToSize();
+
+        /* create restrictions */
+
+        Collection<Restriction> restrictions =
+            createRestrictionsFromTurnRestrictions(dataSource.getRelations(), nodeCreationMap, waySegmentMap);
+
+        restrictions.addAll(createRestrictionsFromBarrierNodes(nodeCreationMap, waySegmentMap));
+
+        /* keep data and inform observers */
+
+        this.nodes = nodes;
+        this.segments = segments;
+        this.restrictions = restrictions;
+
+        notifyObservers();
+
+    }
+
+    /**
+     * creates all Segments and SegmentNodes for a way
+     *
+     * @param way                 way to create Segments and SegmentNodes from; != null
+     * @param wayAccessEvaluator  evaluator object that decides whether way is usable; != null
+     * @param nodes               collection of SegmentNodes, new SegmentNodes will be added here; != null
+     * @param segments            collection of Segments, new Segments will be added here; != null
+     * @param nodeCreationMap     map providing the SegmentNode that has been created from a Node,
+     *                            if new SegmentNodes are created, they will be added appropriately; != null
+     * @param waySegmentMap       map providing the Segments that have been created from a Way,
+     *                            if new Segments are created, they will be added appropriately; != null
+     */
+    private void createSegmentsAndSegmentNodes(W way, AccessEvaluator<N, W> wayAccessEvaluator,
+            Collection<SegmentNode> nodes, Collection<Segment> segments,
+            Map<N, SegmentNodeImpl> nodeCreationMap, Map<W, List<Segment>> waySegmentMap) {
+
+        assert way != null && wayAccessEvaluator != null && nodes != null && segments != null && nodeCreationMap != null && waySegmentMap != null;
+
+        /* calculate property values */
+
+        Map<RoadPropertyType<?>, Object> forwardPropertyValues = getWayPropertyMap(way, true);
+        Map<RoadPropertyType<?>, Object> backwardPropertyValues = getWayPropertyMap(way, false);
+
+        /* create segments from the way if it can be accessed and isn't incomplete or deleted */
+
+        boolean forwardAccess = wayAccessEvaluator.wayUsable(way, true, forwardPropertyValues);
+        boolean backwardAccess = wayAccessEvaluator.wayUsable(way, false, backwardPropertyValues);
+
+        if (forwardAccess || backwardAccess) {
+
+            if (!waySegmentMap.containsKey(way)) {
+                waySegmentMap.put(way, new LinkedList<Segment>());
+            }
+
+            /* create segments from all pairs of subsequent nodes */
+
+            N previousNode = null;
+            for (N node : dataSource.getNodes(way)) {
+                if (previousNode != null) {
+
+                    SegmentNodeImpl node1 =
+                        getOrCreateSegmentNodeForNode(previousNode, nodes, nodeCreationMap);
+                    SegmentNodeImpl node2 =
+                        getOrCreateSegmentNodeForNode(node, nodes, nodeCreationMap);
+
+                    if (forwardAccess) {
+                        SegmentImpl segment = new SegmentImpl(node1, node2, forwardPropertyValues);
+                        segments.add(segment);
+                        waySegmentMap.get(way).add(segment);
+                        node1.addOutboundSegment(segment);
+                        node2.addInboundSegment(segment);
+                    }
+                    if (backwardAccess) { //no "else if" because both can be valid
+                        SegmentImpl segment = new SegmentImpl(node2, node1, backwardPropertyValues);
+                        segments.add(segment);
+                        waySegmentMap.get(way).add(segment);
+                        node1.addInboundSegment(segment);
+                        node2.addOutboundSegment(segment);
+                    }
+
+                }
+                previousNode = node;
+            }
+
+        }
+    }
+
+    /**
+     * if no segment node for a node exists in the nodeCreationMap,
+     * creates a segment node for it and adds it to the nodeCreationMap and the nodes collection
+     * and returns it; otherwise returns the existing segment node.
+     */
+    private SegmentNodeImpl getOrCreateSegmentNodeForNode(N node,
+            Collection<SegmentNode> nodes, Map<N, SegmentNodeImpl> nodeCreationMap) {
+
+        SegmentNodeImpl segmentNode = nodeCreationMap.get(node);
+
+        if (segmentNode == null) {
+
+            Map<RoadPropertyType<?>, Object> nodePropertyValues = getNodePropertyMap(node);
+            segmentNode = new SegmentNodeImpl(dataSource.getLat(node), dataSource.getLon(node),
+                    nodePropertyValues);
+
+            nodeCreationMap.put(node, segmentNode);
+            nodes.add(segmentNode);
+
+        }
+
+        return segmentNode;
+    }
+
+    /**
+     * creates all Restrictions from a collection of Relations.
+     * Only "type=restriction" relations are relevant for restrictions.
+     *
+     * @param relations        Relations to create Restrictions from.
+     *                         They can have any type key, as filtering is done inside this method.
+     * @param nodeCreationMap  map providing the SegmentNode that has been created from a Node,
+     *                         will not be modified; != null
+     * @param waySegmentMap    map providing the Segments that have been created from a Way,
+     *                         will not be modified; != null
+     * @return                 Restrictions created from the Relations; != null, but may be empty
+     */
+    private Collection<Restriction> createRestrictionsFromTurnRestrictions(
+            Iterable<R> relations,
+            Map<N, SegmentNodeImpl> nodeCreationMap,
+            Map<W, List<Segment>> waySegmentMap) {
+
+        assert relations != null && nodeCreationMap != null && waySegmentMap != null;
+
+        Collection<Restriction> results = new LinkedList<Restriction>();
+
+        for (R relation : relations) {
+
+            TagGroup tags = dataSource.getTagsR(relation);
+
+            if ("restriction".equals(tags.getValue("type"))
+                    && tags.getValue("restriction") != null ) {
+
+                //evaluate relation
+                if (tags.getValue("restriction").startsWith("no_")) {
+                    results.addAll(createRestrictionsFromRestrictionRelation(relation, true, nodeCreationMap, waySegmentMap));
+                } else if (tags.getValue("restriction").startsWith("only_")) {
+                    results.addAll(createRestrictionsFromRestrictionRelation(relation, false, nodeCreationMap, waySegmentMap));
+                }
+
+            }
+        }
+
+        return results;
+    }
+
+    @SuppressWarnings("unchecked") //several generic casts that are checked with isInstance
+    private Collection<Restriction> createRestrictionsFromRestrictionRelation(
+            R relation,
+            boolean restrictive,
+            Map<N, SegmentNodeImpl> nodeCreationMap,
+            Map<W, List<Segment>> waySegmentMap) {
+
+        /* collect information about the relation */
+
+        W fromWay = null;
+        Collection<N> viaNodes = new LinkedList<N>();
+        Collection<W> viaWays = new LinkedList<W>();
+        Collection<W> toWays = new LinkedList<W>();
+
+        for (M member : dataSource.getMembers(relation)) {
+
+            if ("from".equals(dataSource.getRole(member))) {
+                if (fromWay != null || !dataSource.isWMember(member)) {
+                    //broken restriction
+                    return EMPTY_RESTRICTION_COLLECTION;
+                } else {
+                    fromWay = (W)dataSource.getMember(member);
+                }
+            } else if ("to".equals(dataSource.getRole(member))) {
+                if (!dataSource.isWMember(member)) {
+                    //broken restriction
+                    return EMPTY_RESTRICTION_COLLECTION;
+                } else {
+                    toWays.add((W)dataSource.getMember(member));
+                }
+            } else if ("via".equals(dataSource.getRole(member))) {
+                if (dataSource.isWMember(member)) {
+                    viaWays.add((W)dataSource.getMember(member));
+                } else if (dataSource.isNMember(member)) {
+                    viaNodes.add((N)dataSource.getMember(member));
+                }
+            }
+
+        }
+
+        if (fromWay != null && toWays.size() > 0 &&
+                (viaNodes.size() > 0 || viaWays.size() > 0)) {
+
+            return createRestrictionsFromRestrictionRelationMembers(
+                    restrictive, nodeCreationMap, waySegmentMap,
+                    fromWay, viaNodes, viaWays, toWays);
+
+        } else {
+            return new ArrayList<Restriction>(0);
+        }
+    }
+
+    private Collection<Restriction> createRestrictionsFromRestrictionRelationMembers(
+            boolean restrictive,
+            Map<N, SegmentNodeImpl> nodeCreationMap, Map<W, List<Segment>> waySegmentMap,
+            W fromWay, Collection<N> viaNodes, Collection<W> viaWays, Collection<W> toWays) {
+
+        Collection<SegmentNode> nodesCreatedFromViaNodes = new ArrayList<SegmentNode>(viaNodes.size());
+        for (N viaNode : viaNodes) {
+            if (nodeCreationMap.containsKey(viaNode)) {
+                nodesCreatedFromViaNodes.add(nodeCreationMap.get(viaNode));
+            }
+        }
+
+        /* check completeness of restriction to avoid dealing with incomplete restriction info */
+
+        if (!waySegmentMap.containsKey(fromWay)) {
+            //broken restriction
+            return EMPTY_RESTRICTION_COLLECTION;
+        }
+
+        for (W viaWay : viaWays) {
+            if (!waySegmentMap.containsKey(viaWay)) {
+                //broken restriction
+                return EMPTY_RESTRICTION_COLLECTION;
+            }
+        }
+
+        for (W toWay : toWays) {
+            if (!waySegmentMap.containsKey(toWay)) {
+                //broken restriction
+                return EMPTY_RESTRICTION_COLLECTION;
+            }
+        }
+
+        /* find all via segments:
+         * via segments are segments created from via ways
+         * or segments starting and ending with nodes created from via nodes */
+
+        ArrayList<Segment> viaSegments = new ArrayList<Segment>();
+
+        for (W viaWay : viaWays) {
+            viaSegments.addAll(waySegmentMap.get(viaWay));
+        }
+
+        for (SegmentNode nodeCreatedFromViaNode : nodesCreatedFromViaNodes) {
+            for (Segment segment : nodeCreatedFromViaNode.getOutboundSegments()) {
+                if (nodesCreatedFromViaNodes.contains(segment.getNode2())) {
+                    viaSegments.add(segment);
+                }
+            }
+        }
+
+        viaSegments.trimToSize();
+
+        /* create a set with all nodes that are based on via members */
+
+        Set<SegmentNode> nodesCreatedFromViaMembers
+        = new HashSet<SegmentNode>(nodesCreatedFromViaNodes);
+
+        for (W viaWay : viaWays) {
+            for (N viaWayNode : dataSource.getNodes(viaWay)) {
+                nodesCreatedFromViaMembers.add(nodeCreationMap.get(viaWayNode));
+            }
+        }
+
+        /*
+         * find from segment and to segments:
+         * Such a segment contains a node based on a via member.
+         * Each way should contain only one possible segment
+         * connecting to via members (due to splitting).
+         */
+
+        Segment fromSegment = null;
+        Collection<Segment> toSegments = new ArrayList<Segment>();
+
+        for (Segment possibleFromSegment : waySegmentMap.get(fromWay)) {
+            if (nodesCreatedFromViaMembers.contains(possibleFromSegment.getNode2())) {
+
+                if (fromSegment == null) {
+                    fromSegment = possibleFromSegment;
+                } else {
+                    //broken restriction
+                    return EMPTY_RESTRICTION_COLLECTION;
+                }
+
+            }
+        }
+        if (fromSegment == null) {
+            //broken restriction
+            return EMPTY_RESTRICTION_COLLECTION;
+        }
+
+        if (restrictive) {
+
+            for (W toWay : toWays) {
+                if (waySegmentMap.containsKey(toWay)) {
+                    Segment toSegment = null;
+                    for (Segment possibleToSegment : waySegmentMap.get(toWay)) {
+                        if (nodesCreatedFromViaMembers.contains(possibleToSegment.getNode1())) {
+
+                            if (toSegment == null) {
+                                toSegment = possibleToSegment;
+                            } else {
+                                //broken restriction
+                                return EMPTY_RESTRICTION_COLLECTION;
+                            }
+
+                        }
+                    }
+                    if (toSegment == null) {
+                        //broken restriction
+                        return EMPTY_RESTRICTION_COLLECTION;
+                    } else {
+                        toSegments.add(toSegment);
+                    }
+                }
+            }
+
+        } else { //!restrictive
+
+            /* forbidden "to" segments are all segments that start at a "via" node
+             * and are neither a via segment nor created from an allowed "to" way */
+
+            for (SegmentNode toStartingNode : nodesCreatedFromViaMembers) {
+                for (Segment outboundSegment : toStartingNode.getOutboundSegments()) {
+
+                    if (!viaSegments.contains(outboundSegment)) {
+
+                        boolean isAllowed = false;
+
+                        for (W toWay : toWays) {
+                            if (waySegmentMap.get(toWay).contains(outboundSegment)) {
+                                isAllowed = true;
+                                break;
+                            }
+                        }
+
+                        if (!isAllowed) {
+                            toSegments.add(outboundSegment);
+                        }
+
+                    }
+
+                }
+            }
+
+        }
+
+        /* create restriction */
+
+        Collection<Restriction> results = new ArrayList<Restriction>(1);
+        results.add(new RestrictionImpl(fromSegment, viaSegments, toSegments));
+        return results;
+    }
+
+    /**
+     * creates Restrictions from barrier nodes (nodes that are considered impassable by the
+     * {@link #accessEvaluator}). These restrictions prevent moving from a segment before the
+     * barrier node to a segment after the barrier node.
+     *
+     * @param nodeCreationMap  map providing the SegmentNode that has been created from a node,
+     *                         will not be modified; != null
+     * @param waySegmentMap    map providing the Segments that have been created from a way,
+     *                         will not be modified; != null
+     * @return                 Restrictions created from barrier nodes; != null, but may be empty
+     */
+    private Collection<Restriction> createRestrictionsFromBarrierNodes(
+            Map<N, SegmentNodeImpl> nodeCreationMap,
+            Map<W, List<Segment>> waySegmentMap) {
+
+        assert nodeCreationMap != null;
+        assert waySegmentMap != null;
+
+        Collection<Restriction> results = new LinkedList<Restriction>();
+
+        for (N node : nodeCreationMap.keySet()) {
+
+            if (!accessEvaluator.nodeUsable(node, nodeCreationMap.get(node).getProperties())) {
+
+                SegmentNode barrierNode = nodeCreationMap.get(node);
+
+                for (Segment inboundSegment : barrierNode.getInboundSegments()) {
+                    for (Segment outboundSegment : barrierNode.getOutboundSegments()) {
+                        results.add(new RestrictionImpl(inboundSegment, EMPTY_SEGMENT_LIST, Arrays.asList(outboundSegment)));
+                    }
+                }
+
+            }
+
+        }
+
+        return results;
+    }
+
+    /**
+     * determines the values of all RoadPropertyTypes from {@link #properties} for a way and
+     * creates a map with the types that have non-null values as keys, property values as content
+     */
+    private Map<RoadPropertyType<?>, Object> getWayPropertyMap(W way, boolean forward) {
+        Map<RoadPropertyType<?>, Object> propertyValues;
+        propertyValues = new HashMap<RoadPropertyType<?>, Object>();
+        for (RoadPropertyType<?> property : properties) {
+            Object value = property.evaluateW(way, forward, accessParameters, dataSource);
+            if (value != null) {
+                propertyValues.put(property, value);
+            }
+        }
+        return propertyValues;
+    }
+
+    /**
+     * determines the values of all RoadPropertyTypes from {@link #properties} for a node and
+     * creates a map with the types that have non-null values as keys, property values as content
+     */
+    private Map<RoadPropertyType<?>, Object> getNodePropertyMap(N node) {
+        Map<RoadPropertyType<?>, Object> propertyValues;
+        propertyValues = new HashMap<RoadPropertyType<?>, Object>();
+        for (RoadPropertyType<?> property : properties) {
+            Object value = property.evaluateN(node, accessParameters, dataSource);
+            if (value != null) {
+                propertyValues.put(property, value);
+            }
+        }
+        return propertyValues;
+    }
+
+    public void update(DataSource<?, ?, ?, ?> dataSource) {
+        assert this.dataSource == dataSource;
+        updateData();
+    }
+
+    public void addObserver(TransitionStructureObserver observer) {
+        observers.add(observer);
+    }
+
+    public void deleteObserver(TransitionStructureObserver observer) {
+        observers.remove(observer);
+    }
+
+    protected void notifyObservers() {
+        for (TransitionStructureObserver observer : observers) {
+            observer.update(this);
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/Restriction.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/Restriction.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/Restriction.java	(revision 23189)
@@ -10,25 +10,25 @@
 public interface Restriction {
 
-	/**
-	 * returns the starting segment that will trigger the restriction when used;
-	 * != null
-	 */
-	public Segment getFrom();
+    /**
+     * returns the starting segment that will trigger the restriction when used;
+     * != null
+     */
+    public Segment getFrom();
 
-	/**
-	 * returns the "via" segments.
-	 * The restriction will remain active as long as only via segments are used.
-	 *
-	 * @return  unmodifiable collection of segments; != null
-	 */
-	public Collection<Segment> getVias();
+    /**
+     * returns the "via" segments.
+     * The restriction will remain active as long as only via segments are used.
+     *
+     * @return  unmodifiable collection of segments; != null
+     */
+    public Collection<Segment> getVias();
 
-	/**
-	 * returns the forbidden "to" segments.
-	 * The restriction prevents leaving the via segment set by using one of the to segments.
-	 *
-	 * @return  unmodifiable collection of segments; != null
-	 */
-	public Collection<Segment> getTos();
+    /**
+     * returns the forbidden "to" segments.
+     * The restriction prevents leaving the via segment set by using one of the to segments.
+     *
+     * @return  unmodifiable collection of segments; != null
+     */
+    public Collection<Segment> getTos();
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/Segment.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/Segment.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/Segment.java	(revision 23189)
@@ -6,13 +6,13 @@
 public interface Segment extends TransitionStructureElement {
 
-	/**
-	 * returns the node this segment starts at; != null
-	 */
-	public SegmentNode getNode1();
+    /**
+     * returns the node this segment starts at; != null
+     */
+    public SegmentNode getNode1();
 
-	/**
-	 * returns the node this segment leads to; != null
-	 */
-	public SegmentNode getNode2();
+    /**
+     * returns the node this segment leads to; != null
+     */
+    public SegmentNode getNode2();
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/SegmentNode.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/SegmentNode.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/SegmentNode.java	(revision 23189)
@@ -8,15 +8,15 @@
 public interface SegmentNode extends TransitionStructureElement {
 
-	/** returns the node's latitude */
-	public double getLat();
+    /** returns the node's latitude */
+    public double getLat();
 
-	/** returns the node's longitude */
-	public double getLon();
+    /** returns the node's longitude */
+    public double getLon();
 
-	/** returns all segments that end at this node */
-	Collection<Segment> getInboundSegments();
+    /** returns all segments that end at this node */
+    Collection<Segment> getInboundSegments();
 
-	/** returns all segments that start at this node */
-	Collection<Segment> getOutboundSegments();
+    /** returns all segments that start at this node */
+    Collection<Segment> getOutboundSegments();
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/TransitionStructure.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/TransitionStructure.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/TransitionStructure.java	(revision 23189)
@@ -9,23 +9,23 @@
 public interface TransitionStructure {
 
-	public Collection<SegmentNode> getNodes();
-	public Collection<Segment> getSegments();
-	public Collection<Restriction> getRestrictions();
+    public Collection<SegmentNode> getNodes();
+    public Collection<Segment> getSegments();
+    public Collection<Restriction> getRestrictions();
 
-	/**
-	 * adds an observer.
-	 * Does nothing if the parameter is already an observer of this TransitionStructure.
-	 *
-	 * @param observer  observer object, != null
-	 */
-	public void addObserver(TransitionStructureObserver observer);
+    /**
+     * adds an observer.
+     * Does nothing if the parameter is already an observer of this TransitionStructure.
+     *
+     * @param observer  observer object, != null
+     */
+    public void addObserver(TransitionStructureObserver observer);
 
-	/**
-	 * deletes an observer that has been added using {@link #addObserver(TransitionStructureObserver)}.
-	 * Does nothing if the parameter isn't currently an observer of this TransitionStructure.
-	 *
-	 * @param observer  observer object, != null
-	 */
-	public void deleteObserver(TransitionStructureObserver observer);
+    /**
+     * deletes an observer that has been added using {@link #addObserver(TransitionStructureObserver)}.
+     * Does nothing if the parameter isn't currently an observer of this TransitionStructure.
+     *
+     * @param observer  observer object, != null
+     */
+    public void deleteObserver(TransitionStructureObserver observer);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/TransitionStructureElement.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/TransitionStructureElement.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/TransitionStructureElement.java	(revision 23189)
@@ -10,18 +10,18 @@
 public interface TransitionStructureElement {
 
-	/**
-	 * returns the types of this object's properties
-	 *
-	 * @return  property type collection; != null
-	 */
-	public Collection<RoadPropertyType<?>> getAvailableProperties();
+    /**
+     * returns the types of this object's properties
+     *
+     * @return  property type collection; != null
+     */
+    public Collection<RoadPropertyType<?>> getAvailableProperties();
 
-	/**
-	 * returns the value of a property for this object
-	 *
-	 * @param propertyType   property type to return value for; != null
-	 * @return property      value of the property for this segment; null if not available
-	 */
-	public <P> P getPropertyValue(RoadPropertyType<P> propertyType);
+    /**
+     * returns the value of a property for this object
+     *
+     * @param propertyType   property type to return value for; != null
+     * @return property      value of the property for this segment; null if not available
+     */
+    public <P> P getPropertyValue(RoadPropertyType<P> propertyType);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/TransitionStructureObserver.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/TransitionStructureObserver.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/transition/TransitionStructureObserver.java	(revision 23189)
@@ -7,9 +7,9 @@
 public interface TransitionStructureObserver {
 
-	/**
-	 * informs this observer about changes in an observed transition structure
-	 * @param transitionStructure  observed transition structure that has changed; != null
-	 */
-	public void update(TransitionStructure transitionStructure);
+    /**
+     * informs this observer about changes in an observed transition structure
+     * @param transitionStructure  observed transition structure that has changed; != null
+     */
+    public void update(TransitionStructure transitionStructure);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/GraphUtil.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/GraphUtil.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/GraphUtil.java	(revision 23189)
@@ -11,42 +11,42 @@
 public final class GraphUtil {
 
-	/** prevents instantiation */
-	private GraphUtil() { }
+    /** prevents instantiation */
+    private GraphUtil() { }
 
-	/**
-	 * checks whether a node is an "end node"
-	 * (a node whose {@link SegmentNode} is connected to at most one other {@link SegmentNode})
-	 */
-	public static final boolean isEndNode(GraphNode node) {
+    /**
+     * checks whether a node is an "end node"
+     * (a node whose {@link SegmentNode} is connected to at most one other {@link SegmentNode})
+     */
+    public static final boolean isEndNode(GraphNode node) {
 
-		SegmentNode ownSegmentNode = node.getSegmentNode();
+        SegmentNode ownSegmentNode = node.getSegmentNode();
 
-		SegmentNode connectedNode = null;
+        SegmentNode connectedNode = null;
 
-		for (Segment inboundSegment : node.getSegmentNode().getInboundSegments()) {
-			SegmentNode otherSegmentNode = inboundSegment.getNode1();
-			if (otherSegmentNode != ownSegmentNode) {
-				if (connectedNode == null) {
-					connectedNode = otherSegmentNode;
-				} else if (connectedNode != otherSegmentNode) {
-					return false;
-				}
-			}
-		}
+        for (Segment inboundSegment : node.getSegmentNode().getInboundSegments()) {
+            SegmentNode otherSegmentNode = inboundSegment.getNode1();
+            if (otherSegmentNode != ownSegmentNode) {
+                if (connectedNode == null) {
+                    connectedNode = otherSegmentNode;
+                } else if (connectedNode != otherSegmentNode) {
+                    return false;
+                }
+            }
+        }
 
-		for (Segment outboundSegment : node.getSegmentNode().getOutboundSegments()) {
-			SegmentNode otherSegmentNode = outboundSegment.getNode2();
-			if (otherSegmentNode != ownSegmentNode) {
-				if (connectedNode == null) {
-					connectedNode = otherSegmentNode;
-				} else if (connectedNode != otherSegmentNode) {
-					return false;
-				}
-			}
-		}
+        for (Segment outboundSegment : node.getSegmentNode().getOutboundSegments()) {
+            SegmentNode otherSegmentNode = outboundSegment.getNode2();
+            if (otherSegmentNode != ownSegmentNode) {
+                if (connectedNode == null) {
+                    connectedNode = otherSegmentNode;
+                } else if (connectedNode != otherSegmentNode) {
+                    return false;
+                }
+            }
+        }
 
-		return true;
+        return true;
 
-	}
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/TagCondition.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/TagCondition.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/TagCondition.java	(revision 23189)
@@ -9,10 +9,10 @@
 public interface TagCondition {
 
-	/**
-	 * returns true if the tags match the condition
-	 *
-	 * @param tags  tags to check against the condition; != null
-	 */
-	boolean matches(TagGroup tags);
+    /**
+     * returns true if the tags match the condition
+     *
+     * @param tags  tags to check against the condition; != null
+     */
+    boolean matches(TagGroup tags);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/TagConditionLogic.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/TagConditionLogic.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/TagConditionLogic.java	(revision 23189)
@@ -11,193 +11,193 @@
 public final class TagConditionLogic {
 
-	/** prevents instantiation */
-	private TagConditionLogic(){ }
-
-	/**
-	 * creates a condition that is fulfilled if the set of tags contains a given tag
-	 *
-	 * @param tag  tag that must be in the tag collection; != null
-	 */
-	public static TagCondition tag(final Tag tag) {
-		assert tag != null;
-		return new TagCondition() {
-			public boolean matches(TagGroup tags) {
-				return tags.contains(tag);
-			}
-			@Override
-			public String toString() {
-				return tag.toString();
-			}
-		};
-	}
-
-	/**
-	 * creates a condition that is fulfilled if the set of tags contains a tag with the given key
-	 *
-	 * @param key  the key to look for; != null
-	 */
-	public static TagCondition key(final String key) {
-		assert key != null;
-		return new TagCondition() {
-			public boolean matches(TagGroup tags) {
-				return tags.containsKey(key);
-			}
-			@Override
-			public String toString() {
-				return key;
-			}
-		};
-	}
-
-	/**
-	 * combines conditions using a boolean "and"
-	 *
-	 * @param condition   first condition; != null
-	 * @param conditions  more conditions; each != null
-	 */
-	public static TagCondition and(final TagCondition condition, final TagCondition... conditions) {
-		return new TagCondition() {
-			public boolean matches(TagGroup tags) {
-				for (TagCondition c : conditions) {
-					if (!c.matches(tags)) {
-						return false;
-					}
-				}
-				return condition.matches(tags);
-			}
-			@Override
-			public String toString() {
-				StringBuilder result = new StringBuilder();
-				result.append("(");
-				result.append(condition);
-				for (TagCondition c : conditions) {
-					result.append(" && ");
-					result.append(c);
-				}
-				result.append(")");
-				return result.toString();
-			}
-		};
-	}
-
-	/**
-	 * combines conditions using a boolean "and"
-	 *
-	 * @param conditions   collection of conditions, must contain at least one element; != null
-	 */
-	public static TagCondition and(final Collection<TagCondition> conditions) {
-		if (conditions.size() == 0) {
-			throw new IllegalArgumentException("collection must contain at least one condition");
-		}
-		return new TagCondition() {
-			public boolean matches(TagGroup tags) {
-				for (TagCondition c : conditions) {
-					if (!c.matches(tags)) {
-						return false;
-					}
-				}
-				return true;
-			}
-			@Override
-			public String toString() {
-				StringBuilder result = new StringBuilder();
-				result.append("(");
-				boolean firstCondition = true;
-				for (TagCondition c : conditions) {
-					if (!firstCondition) {
-						result.append(" && ");
-					}
-					firstCondition = false;
-					result.append(c);
-				}
-				result.append(")");
-				return result.toString();
-			}
-		};
-	}
-
-	/**
-	 * combines conditions using a boolean "or"
-	 *
-	 * @param condition   first condition; != null
-	 * @param conditions  more conditions; each != null
-	 */
-	public static TagCondition or(final TagCondition condition, final TagCondition... conditions) {
-		return new TagCondition() {
-			public boolean matches(TagGroup tags) {
-				for (TagCondition c : conditions) {
-					if (c.matches(tags)) {
-						return true;
-					}
-				}
-				return condition.matches(tags);
-			}
-			@Override
-			public String toString() {
-				StringBuilder result = new StringBuilder();
-				result.append("(");
-				result.append(condition);
-				for (TagCondition c : conditions) {
-					result.append(" || ");
-					result.append(c);
-				}
-				result.append(")");
-				return result.toString();
-			}
-		};
-	}
-
-	/**
-	 * combines conditions using a boolean "or"
-	 *
-	 * @param conditions   collection of conditions, must contain at least one element; != null
-	 */
-	public static TagCondition or(final Collection<TagCondition> conditions) {
-		if (conditions.size() == 0) {
-			throw new IllegalArgumentException("collection must contain at least one condition");
-		}
-		return new TagCondition() {
-			public boolean matches(TagGroup tags) {
-				for (TagCondition c : conditions) {
-					if (c.matches(tags)) {
-						return true;
-					}
-				}
-				return false;
-			}
-			@Override
-			public String toString() {
-				StringBuilder result = new StringBuilder();
-				result.append("(");
-				boolean firstCondition = true;
-				for (TagCondition c : conditions) {
-					if (!firstCondition) {
-						result.append(" || ");
-					}
-					firstCondition = false;
-					result.append(c);
-				}
-				result.append(")");
-				return result.toString();
-			}
-		};
-	}
-
-	/**
-	 * inverts a condition
-	 *
-	 * @param condition  condition to invert, != null
-	 */
-	public static TagCondition not(final TagCondition condition) {
-		return new TagCondition() {
-			public boolean matches(TagGroup tags) {
-				return !condition.matches(tags);
-			}
-			@Override
-			public String toString() {
-				return "!" + condition;
-			}
-		};
-	}
+    /** prevents instantiation */
+    private TagConditionLogic(){ }
+
+    /**
+     * creates a condition that is fulfilled if the set of tags contains a given tag
+     *
+     * @param tag  tag that must be in the tag collection; != null
+     */
+    public static TagCondition tag(final Tag tag) {
+        assert tag != null;
+        return new TagCondition() {
+            public boolean matches(TagGroup tags) {
+                return tags.contains(tag);
+            }
+            @Override
+            public String toString() {
+                return tag.toString();
+            }
+        };
+    }
+
+    /**
+     * creates a condition that is fulfilled if the set of tags contains a tag with the given key
+     *
+     * @param key  the key to look for; != null
+     */
+    public static TagCondition key(final String key) {
+        assert key != null;
+        return new TagCondition() {
+            public boolean matches(TagGroup tags) {
+                return tags.containsKey(key);
+            }
+            @Override
+            public String toString() {
+                return key;
+            }
+        };
+    }
+
+    /**
+     * combines conditions using a boolean "and"
+     *
+     * @param condition   first condition; != null
+     * @param conditions  more conditions; each != null
+     */
+    public static TagCondition and(final TagCondition condition, final TagCondition... conditions) {
+        return new TagCondition() {
+            public boolean matches(TagGroup tags) {
+                for (TagCondition c : conditions) {
+                    if (!c.matches(tags)) {
+                        return false;
+                    }
+                }
+                return condition.matches(tags);
+            }
+            @Override
+            public String toString() {
+                StringBuilder result = new StringBuilder();
+                result.append("(");
+                result.append(condition);
+                for (TagCondition c : conditions) {
+                    result.append(" && ");
+                    result.append(c);
+                }
+                result.append(")");
+                return result.toString();
+            }
+        };
+    }
+
+    /**
+     * combines conditions using a boolean "and"
+     *
+     * @param conditions   collection of conditions, must contain at least one element; != null
+     */
+    public static TagCondition and(final Collection<TagCondition> conditions) {
+        if (conditions.size() == 0) {
+            throw new IllegalArgumentException("collection must contain at least one condition");
+        }
+        return new TagCondition() {
+            public boolean matches(TagGroup tags) {
+                for (TagCondition c : conditions) {
+                    if (!c.matches(tags)) {
+                        return false;
+                    }
+                }
+                return true;
+            }
+            @Override
+            public String toString() {
+                StringBuilder result = new StringBuilder();
+                result.append("(");
+                boolean firstCondition = true;
+                for (TagCondition c : conditions) {
+                    if (!firstCondition) {
+                        result.append(" && ");
+                    }
+                    firstCondition = false;
+                    result.append(c);
+                }
+                result.append(")");
+                return result.toString();
+            }
+        };
+    }
+
+    /**
+     * combines conditions using a boolean "or"
+     *
+     * @param condition   first condition; != null
+     * @param conditions  more conditions; each != null
+     */
+    public static TagCondition or(final TagCondition condition, final TagCondition... conditions) {
+        return new TagCondition() {
+            public boolean matches(TagGroup tags) {
+                for (TagCondition c : conditions) {
+                    if (c.matches(tags)) {
+                        return true;
+                    }
+                }
+                return condition.matches(tags);
+            }
+            @Override
+            public String toString() {
+                StringBuilder result = new StringBuilder();
+                result.append("(");
+                result.append(condition);
+                for (TagCondition c : conditions) {
+                    result.append(" || ");
+                    result.append(c);
+                }
+                result.append(")");
+                return result.toString();
+            }
+        };
+    }
+
+    /**
+     * combines conditions using a boolean "or"
+     *
+     * @param conditions   collection of conditions, must contain at least one element; != null
+     */
+    public static TagCondition or(final Collection<TagCondition> conditions) {
+        if (conditions.size() == 0) {
+            throw new IllegalArgumentException("collection must contain at least one condition");
+        }
+        return new TagCondition() {
+            public boolean matches(TagGroup tags) {
+                for (TagCondition c : conditions) {
+                    if (c.matches(tags)) {
+                        return true;
+                    }
+                }
+                return false;
+            }
+            @Override
+            public String toString() {
+                StringBuilder result = new StringBuilder();
+                result.append("(");
+                boolean firstCondition = true;
+                for (TagCondition c : conditions) {
+                    if (!firstCondition) {
+                        result.append(" || ");
+                    }
+                    firstCondition = false;
+                    result.append(c);
+                }
+                result.append(")");
+                return result.toString();
+            }
+        };
+    }
+
+    /**
+     * inverts a condition
+     *
+     * @param condition  condition to invert, != null
+     */
+    public static TagCondition not(final TagCondition condition) {
+        return new TagCondition() {
+            public boolean matches(TagGroup tags) {
+                return !condition.matches(tags);
+            }
+            @Override
+            public String toString() {
+                return "!" + condition;
+            }
+        };
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/ValueStringParser.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/ValueStringParser.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/util/ValueStringParser.java	(revision 23189)
@@ -6,215 +6,215 @@
 public final class ValueStringParser {
 
-	/** prevents instantiation */
-	private ValueStringParser() { }
-
-	/** pattern that splits into a part before and after a decimal point */
-	private static final Pattern DEC_POINT_PATTERN = Pattern.compile("^(\\-?\\d+)\\.(\\d+)$");
-
-	public static final Float parseOsmDecimal(String value, boolean allowNegative) {
-
-		/* positive integer */
-
-		try {
-
-			int weight = Integer.parseInt(value);
-			if (weight >= 0 || allowNegative) {
-				return (float)weight;
-			}
-
-		} catch (NumberFormatException nfe) {}
-
-		/* positive number with decimal point */
-
-		Matcher matcher = DEC_POINT_PATTERN.matcher(value);
-
-		if (matcher.matches()) {
-
-			String stringBeforePoint = matcher.group(1);
-			String stringAfterPoint = matcher.group(2);
-
-			if (stringBeforePoint.length() > 0 || stringAfterPoint.length() > 0) {
-
-				try {
-
-					float beforePoint = Integer.parseInt(stringBeforePoint);
-					float afterPoint = Integer.parseInt(stringAfterPoint);
-
-					double result = Math.signum(beforePoint) *
-					(Math.abs(beforePoint)
-							+ Math.pow(10, -stringAfterPoint.length()) * afterPoint);
-
-					if (result >= 0 || allowNegative) {
-						return (float)result;
-					}
-
-				} catch (NumberFormatException nfe) {}
-
-			}
-		}
-
-		return null;
-	}
-
-	private static final Pattern KMH_PATTERN = Pattern.compile("^(\\d+)\\s*km/h$");
-	private static final Pattern MPH_PATTERN = Pattern.compile("^(\\d+)\\s*mph$");
-
-	private static final float KM_PER_MILE = 1.609344f;
-
-	/**
-	 * parses a speed value given e.g. for the "maxspeed" key.
-	 *
-	 * @return  speed in km/h; null if value had syntax errors
-	 */
-	public static final Float parseSpeed(String value) {
-
-		/* try numeric speed (implied km/h) */
-
-		Float speed = parseOsmDecimal(value, false);
-		if (speed != null) {
-			return speed;
-		}
-
-		/* try km/h speed */
-
-		Matcher kmhMatcher = KMH_PATTERN.matcher(value);
-		if (kmhMatcher.matches()) {
-			String kmhString = kmhMatcher.group(1);
-			try {
-				return (float)Integer.parseInt(kmhString);
-			} catch (NumberFormatException nfe) {}
-		}
-
-		/* try mph speed */
-
-		Matcher mphMatcher = MPH_PATTERN.matcher(value);
-		if (mphMatcher.matches()) {
-			String mphString = mphMatcher.group(1);
-			try {
-				int mph = Integer.parseInt(mphString);
-				return KM_PER_MILE * mph;
-			} catch (NumberFormatException nfe) {}
-		}
-
-		/* all possibilities failed */
-
-		return null;
-	}
-
-	private static final Pattern M_PATTERN = Pattern.compile("^([\\d\\.]+)\\s*m$");
-	private static final Pattern KM_PATTERN = Pattern.compile("^([\\d\\.]+)\\s*km$");
-	private static final Pattern MI_PATTERN = Pattern.compile("^([\\d\\.]+)\\s*mi$");
-	private static final Pattern FEET_INCHES_PATTERN = Pattern.compile("^([\\d]+)'\\s*([\\d]+)\"");
-
-	private static final double M_PER_MI = 1609.344;
-	private static final double M_PER_INCH = 0.0254f;
-
-	/**
-	 * parses a measure value given e.g. for the "width" or "length" key.
-	 *
-	 * @return  measure in m; null if value had syntax errors
-	 */
-	public static final Float parseMeasure(String value) {
-
-		/* try numeric measure (implied m) */
-
-		Float measure = parseOsmDecimal(value, false);
-		if (measure != null) {
-			return measure;
-		}
-
-		/* try m measure */
-
-		Matcher mMatcher = M_PATTERN.matcher(value);
-		if (mMatcher.matches()) {
-			String mString = mMatcher.group(1);
-			return parseOsmDecimal(mString, false);
-		}
-
-		/* try km measure */
-
-		Matcher kmMatcher = KM_PATTERN.matcher(value);
-		if (kmMatcher.matches()) {
-			String kmString = kmMatcher.group(1);
-			float km = parseOsmDecimal(kmString, false);
-			return 1000 * km;
-		}
-
-		/* try mi measure */
-
-		Matcher miMatcher = MI_PATTERN.matcher(value);
-		if (miMatcher.matches()) {
-			String miString = miMatcher.group(1);
-			float mi = parseOsmDecimal(miString, false);
-			return (float)(M_PER_MI * mi);
-		}
-
-		/* try feet/inches measure */
-
-		Matcher feetInchesMatcher = FEET_INCHES_PATTERN.matcher(value);
-		if (feetInchesMatcher.matches()) {
-			String feetString = feetInchesMatcher.group(1);
-			String inchesString = feetInchesMatcher.group(2);
-			try {
-				int feet = Integer.parseInt(feetString);
-				int inches = Integer.parseInt(inchesString);
-				if (feet >= 0 && inches >= 0 && inches < 12) {
-					return (float)(M_PER_INCH * (12 * feet + inches));
-				}
-			} catch (NumberFormatException nfe) {}
-		}
-
-		/* all possibilities failed */
-
-		return null;
-	}
-
-	private static final Pattern T_PATTERN = Pattern.compile("^([\\d\\.]+)\\s*t$");
-
-	/**
-	 * parses a weight value given e.g. for the "maxweight" or "maxaxleload" key.
-	 *
-	 * @return  weight in t; null if value had syntax errors
-	 */
-	public static Float parseWeight(String value) {
-
-		/* try numeric weight (implied t) */
-
-		Float weight = parseOsmDecimal(value, false);
-		if (weight != null) {
-			return weight;
-		}
-
-		/* try t weight */
-
-		Matcher tMatcher = T_PATTERN.matcher(value);
-		if (tMatcher.matches()) {
-			String tString = tMatcher.group(1);
-			return parseOsmDecimal(tString, false);
-		}
-
-		/* all possibilities failed */
-
-		return null;
-
-	}
-
-	private static final Pattern INCLINE_PATTERN = Pattern.compile("^(\\-?\\d+(?:\\.\\d+)?)\\s*%$");
-
-	/**
-	 * parses an incline value as given for the "incline" key.
-	 *
-	 * @return  incline in percents; null if value had syntax errors
-	 */
-	public static final Float parseIncline(String value) {
-
-		Matcher inclineMatcher = INCLINE_PATTERN.matcher(value);
-		if (inclineMatcher.matches()) {
-			String inclineString = inclineMatcher.group(1);
-			return parseOsmDecimal(inclineString, true);
-		}
-
-		return null;
-	}
+    /** prevents instantiation */
+    private ValueStringParser() { }
+
+    /** pattern that splits into a part before and after a decimal point */
+    private static final Pattern DEC_POINT_PATTERN = Pattern.compile("^(\\-?\\d+)\\.(\\d+)$");
+
+    public static final Float parseOsmDecimal(String value, boolean allowNegative) {
+
+        /* positive integer */
+
+        try {
+
+            int weight = Integer.parseInt(value);
+            if (weight >= 0 || allowNegative) {
+                return (float)weight;
+            }
+
+        } catch (NumberFormatException nfe) {}
+
+        /* positive number with decimal point */
+
+        Matcher matcher = DEC_POINT_PATTERN.matcher(value);
+
+        if (matcher.matches()) {
+
+            String stringBeforePoint = matcher.group(1);
+            String stringAfterPoint = matcher.group(2);
+
+            if (stringBeforePoint.length() > 0 || stringAfterPoint.length() > 0) {
+
+                try {
+
+                    float beforePoint = Integer.parseInt(stringBeforePoint);
+                    float afterPoint = Integer.parseInt(stringAfterPoint);
+
+                    double result = Math.signum(beforePoint) *
+                    (Math.abs(beforePoint)
+                            + Math.pow(10, -stringAfterPoint.length()) * afterPoint);
+
+                    if (result >= 0 || allowNegative) {
+                        return (float)result;
+                    }
+
+                } catch (NumberFormatException nfe) {}
+
+            }
+        }
+
+        return null;
+    }
+
+    private static final Pattern KMH_PATTERN = Pattern.compile("^(\\d+)\\s*km/h$");
+    private static final Pattern MPH_PATTERN = Pattern.compile("^(\\d+)\\s*mph$");
+
+    private static final float KM_PER_MILE = 1.609344f;
+
+    /**
+     * parses a speed value given e.g. for the "maxspeed" key.
+     *
+     * @return  speed in km/h; null if value had syntax errors
+     */
+    public static final Float parseSpeed(String value) {
+
+        /* try numeric speed (implied km/h) */
+
+        Float speed = parseOsmDecimal(value, false);
+        if (speed != null) {
+            return speed;
+        }
+
+        /* try km/h speed */
+
+        Matcher kmhMatcher = KMH_PATTERN.matcher(value);
+        if (kmhMatcher.matches()) {
+            String kmhString = kmhMatcher.group(1);
+            try {
+                return (float)Integer.parseInt(kmhString);
+            } catch (NumberFormatException nfe) {}
+        }
+
+        /* try mph speed */
+
+        Matcher mphMatcher = MPH_PATTERN.matcher(value);
+        if (mphMatcher.matches()) {
+            String mphString = mphMatcher.group(1);
+            try {
+                int mph = Integer.parseInt(mphString);
+                return KM_PER_MILE * mph;
+            } catch (NumberFormatException nfe) {}
+        }
+
+        /* all possibilities failed */
+
+        return null;
+    }
+
+    private static final Pattern M_PATTERN = Pattern.compile("^([\\d\\.]+)\\s*m$");
+    private static final Pattern KM_PATTERN = Pattern.compile("^([\\d\\.]+)\\s*km$");
+    private static final Pattern MI_PATTERN = Pattern.compile("^([\\d\\.]+)\\s*mi$");
+    private static final Pattern FEET_INCHES_PATTERN = Pattern.compile("^([\\d]+)'\\s*([\\d]+)\"");
+
+    private static final double M_PER_MI = 1609.344;
+    private static final double M_PER_INCH = 0.0254f;
+
+    /**
+     * parses a measure value given e.g. for the "width" or "length" key.
+     *
+     * @return  measure in m; null if value had syntax errors
+     */
+    public static final Float parseMeasure(String value) {
+
+        /* try numeric measure (implied m) */
+
+        Float measure = parseOsmDecimal(value, false);
+        if (measure != null) {
+            return measure;
+        }
+
+        /* try m measure */
+
+        Matcher mMatcher = M_PATTERN.matcher(value);
+        if (mMatcher.matches()) {
+            String mString = mMatcher.group(1);
+            return parseOsmDecimal(mString, false);
+        }
+
+        /* try km measure */
+
+        Matcher kmMatcher = KM_PATTERN.matcher(value);
+        if (kmMatcher.matches()) {
+            String kmString = kmMatcher.group(1);
+            float km = parseOsmDecimal(kmString, false);
+            return 1000 * km;
+        }
+
+        /* try mi measure */
+
+        Matcher miMatcher = MI_PATTERN.matcher(value);
+        if (miMatcher.matches()) {
+            String miString = miMatcher.group(1);
+            float mi = parseOsmDecimal(miString, false);
+            return (float)(M_PER_MI * mi);
+        }
+
+        /* try feet/inches measure */
+
+        Matcher feetInchesMatcher = FEET_INCHES_PATTERN.matcher(value);
+        if (feetInchesMatcher.matches()) {
+            String feetString = feetInchesMatcher.group(1);
+            String inchesString = feetInchesMatcher.group(2);
+            try {
+                int feet = Integer.parseInt(feetString);
+                int inches = Integer.parseInt(inchesString);
+                if (feet >= 0 && inches >= 0 && inches < 12) {
+                    return (float)(M_PER_INCH * (12 * feet + inches));
+                }
+            } catch (NumberFormatException nfe) {}
+        }
+
+        /* all possibilities failed */
+
+        return null;
+    }
+
+    private static final Pattern T_PATTERN = Pattern.compile("^([\\d\\.]+)\\s*t$");
+
+    /**
+     * parses a weight value given e.g. for the "maxweight" or "maxaxleload" key.
+     *
+     * @return  weight in t; null if value had syntax errors
+     */
+    public static Float parseWeight(String value) {
+
+        /* try numeric weight (implied t) */
+
+        Float weight = parseOsmDecimal(value, false);
+        if (weight != null) {
+            return weight;
+        }
+
+        /* try t weight */
+
+        Matcher tMatcher = T_PATTERN.matcher(value);
+        if (tMatcher.matches()) {
+            String tString = tMatcher.group(1);
+            return parseOsmDecimal(tString, false);
+        }
+
+        /* all possibilities failed */
+
+        return null;
+
+    }
+
+    private static final Pattern INCLINE_PATTERN = Pattern.compile("^(\\-?\\d+(?:\\.\\d+)?)\\s*%$");
+
+    /**
+     * parses an incline value as given for the "incline" key.
+     *
+     * @return  incline in percents; null if value had syntax errors
+     */
+    public static final Float parseIncline(String value) {
+
+        Matcher inclineMatcher = INCLINE_PATTERN.matcher(value);
+        if (inclineMatcher.matches()) {
+            String inclineString = inclineMatcher.group(1);
+            return parseOsmDecimal(inclineString, true);
+        }
+
+        return null;
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/ColorScheme.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/ColorScheme.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/ColorScheme.java	(revision 23189)
@@ -11,15 +11,15 @@
 public interface ColorScheme {
 
-	/**
-	 * returns the color to be used for a node in a WayGraph
-	 * @param edge  GraphNode to determine the color for; != null
-	 */
-	public Color getNodeColor(GraphNode node);
+    /**
+     * returns the color to be used for a node in a WayGraph
+     * @param edge  GraphNode to determine the color for; != null
+     */
+    public Color getNodeColor(GraphNode node);
 
-	/**
-	 * returns the color to be used for an edge in a WayGraph
-	 * @param segment  segment to determine the color for; != null
-	 */
-	public Color getSegmentColor(Segment segment);
+    /**
+     * returns the color to be used for an edge in a WayGraph
+     * @param segment  segment to determine the color for; != null
+     */
+    public Color getSegmentColor(Segment segment);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/DefaultNodePositioner.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/DefaultNodePositioner.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/DefaultNodePositioner.java	(revision 23189)
@@ -11,37 +11,37 @@
 public class DefaultNodePositioner implements NodePositioner {
 
-	public LatLonCoords getPosition(GraphNode node) {
+    public LatLonCoords getPosition(GraphNode node) {
 
-		SegmentNode segmentNode = node.getSegmentNode();
+        SegmentNode segmentNode = node.getSegmentNode();
 
-		if (2 >= segmentNode.getInboundSegments().size()
-				+ segmentNode.getOutboundSegments().size() ) {
+        if (2 >= segmentNode.getInboundSegments().size()
+                + segmentNode.getOutboundSegments().size() ) {
 
-			return new LatLonCoords(
-					node.getSegmentNode().getLat(),
-					node.getSegmentNode().getLon());
+            return new LatLonCoords(
+                    node.getSegmentNode().getLat(),
+                    node.getSegmentNode().getLon());
 
-		} else {
+        } else {
 
-			SegmentNode node1 = node.getSegment().getNode1();
-			SegmentNode node2 = node.getSegment().getNode2();
+            SegmentNode node1 = node.getSegment().getNode1();
+            SegmentNode node2 = node.getSegment().getNode2();
 
-			assert segmentNode == node1 || segmentNode == node2;
+            assert segmentNode == node1 || segmentNode == node2;
 
-			LatLonCoords result;
+            LatLonCoords result;
 
-			if (segmentNode == node1) {
-				result = new LatLonCoords(
-						(2 * node1.getLat() + node2.getLat()) / 3,
-						(2 * node1.getLon() + node2.getLon()) / 3);
-			} else {
-				result = new LatLonCoords(
-						(node1.getLat() + 2 * node2.getLat()) / 3,
-						(node1.getLon() + 2 * node2.getLon()) / 3);
-			}
+            if (segmentNode == node1) {
+                result = new LatLonCoords(
+                        (2 * node1.getLat() + node2.getLat()) / 3,
+                        (2 * node1.getLon() + node2.getLon()) / 3);
+            } else {
+                result = new LatLonCoords(
+                        (node1.getLat() + 2 * node2.getLat()) / 3,
+                        (node1.getLon() + 2 * node2.getLon()) / 3);
+            }
 
-			return result;
-		}
-	}
+            return result;
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/EndNodeColorScheme.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/EndNodeColorScheme.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/EndNodeColorScheme.java	(revision 23189)
@@ -12,21 +12,21 @@
 public class EndNodeColorScheme implements ColorScheme {
 
-	private final Color nodeColor;
-	private final Color endNodeColor;
-	private final Color segmentColor;
+    private final Color nodeColor;
+    private final Color endNodeColor;
+    private final Color segmentColor;
 
-	public EndNodeColorScheme(Color nodeColor, Color endNodeColor, Color segmentColor) {
-		this.nodeColor = nodeColor;
-		this.endNodeColor = endNodeColor;
-		this.segmentColor = segmentColor;
-	}
+    public EndNodeColorScheme(Color nodeColor, Color endNodeColor, Color segmentColor) {
+        this.nodeColor = nodeColor;
+        this.endNodeColor = endNodeColor;
+        this.segmentColor = segmentColor;
+    }
 
-	public Color getNodeColor(GraphNode node) {
-		return GraphUtil.isEndNode(node) ? endNodeColor : nodeColor;
-	}
+    public Color getNodeColor(GraphNode node) {
+        return GraphUtil.isEndNode(node) ? endNodeColor : nodeColor;
+    }
 
-	public Color getSegmentColor(Segment segment) {
-		return segmentColor;
-	}
+    public Color getSegmentColor(Segment segment) {
+        return segmentColor;
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/FloatPropertyColorScheme.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/FloatPropertyColorScheme.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/FloatPropertyColorScheme.java	(revision 23189)
@@ -22,169 +22,169 @@
 public class FloatPropertyColorScheme implements ColorScheme {
 
-	private final Class<? extends RoadPropertyType<Float>> propertyClass;
-	private final Map<Float, Color> colorMap;
-	private final Color defaultColor;
+    private final Class<? extends RoadPropertyType<Float>> propertyClass;
+    private final Map<Float, Color> colorMap;
+    private final Color defaultColor;
 
-	/**
-	 * @param propertyClass  property type to get values for; != null
-	 * @param colorMap       map from some values to colors.
-	 *                       Colors for all other values are interpolated.
-	 *                       This map will be copied and not used directly later. != null
-	 * @param defaultColor   color that is used when the property is not available; != null
-	 */
-	public FloatPropertyColorScheme(Class<? extends RoadPropertyType<Float>> propertyClass,
-			Map<Float, Color> colorMap, Color defaultColor) {
-		assert propertyClass != null && colorMap != null && defaultColor != null;
+    /**
+     * @param propertyClass  property type to get values for; != null
+     * @param colorMap       map from some values to colors.
+     *                       Colors for all other values are interpolated.
+     *                       This map will be copied and not used directly later. != null
+     * @param defaultColor   color that is used when the property is not available; != null
+     */
+    public FloatPropertyColorScheme(Class<? extends RoadPropertyType<Float>> propertyClass,
+            Map<Float, Color> colorMap, Color defaultColor) {
+        assert propertyClass != null && colorMap != null && defaultColor != null;
 
-		this.propertyClass = propertyClass;
-		this.colorMap = new HashMap<Float, Color>(colorMap);
-		this.defaultColor = defaultColor;
-	}
+        this.propertyClass = propertyClass;
+        this.colorMap = new HashMap<Float, Color>(colorMap);
+        this.defaultColor = defaultColor;
+    }
 
-	public Color getSegmentColor(Segment segment) {
-		assert segment != null;
+    public Color getSegmentColor(Segment segment) {
+        assert segment != null;
 
-		Float propertyValue = null;
-		Collection<RoadPropertyType<?>> availableProperties = segment.getAvailableProperties();
-		for (RoadPropertyType<?> property : availableProperties) {
-			if (propertyClass.isInstance(property)) {
-				@SuppressWarnings("unchecked") //has been checked using isInstance
-				RoadPropertyType<Float> floatProperty = (RoadPropertyType<Float>)property;
-				propertyValue = segment.getPropertyValue(floatProperty);
-				break;
-			}
-		}
+        Float propertyValue = null;
+        Collection<RoadPropertyType<?>> availableProperties = segment.getAvailableProperties();
+        for (RoadPropertyType<?> property : availableProperties) {
+            if (propertyClass.isInstance(property)) {
+                @SuppressWarnings("unchecked") //has been checked using isInstance
+                RoadPropertyType<Float> floatProperty = (RoadPropertyType<Float>)property;
+                propertyValue = segment.getPropertyValue(floatProperty);
+                break;
+            }
+        }
 
-		if (propertyValue != null) {
-			return getColorForValue(propertyValue);
-		} else {
-			return defaultColor;
-		}
-	}
+        if (propertyValue != null) {
+            return getColorForValue(propertyValue);
+        } else {
+            return defaultColor;
+        }
+    }
 
-	public Color getNodeColor(GraphNode node) {
+    public Color getNodeColor(GraphNode node) {
 
-		List<Color> segmentColors = new ArrayList<Color>();
+        List<Color> segmentColors = new ArrayList<Color>();
 
-		
-		
-		for (GraphEdge edge : node.getInboundEdges()) {
-			List<Segment> edgeSegments = edge.getPropertyValue(GraphEdgeSegments.PROPERTY);
-			if (edgeSegments.size() > 0) {
-				Segment firstSegment = edgeSegments.get(0);
-				segmentColors.add(getSegmentColor(firstSegment));
-			}
-		}
-		for (GraphEdge edge : node.getOutboundEdges()) {
-			List<Segment> edgeSegments = edge.getPropertyValue(GraphEdgeSegments.PROPERTY);
-			if (edgeSegments.size() > 0) {
-				Segment lastSegment = edgeSegments.get(edgeSegments.size()-1);
-				segmentColors.add(getSegmentColor(lastSegment));
-			}
-		}
 
-		if (segmentColors.size() > 0) {
-			return averageColor(segmentColors);
-		} else {
-			return Color.WHITE;
-		}
 
-	}
+        for (GraphEdge edge : node.getInboundEdges()) {
+            List<Segment> edgeSegments = edge.getPropertyValue(GraphEdgeSegments.PROPERTY);
+            if (edgeSegments.size() > 0) {
+                Segment firstSegment = edgeSegments.get(0);
+                segmentColors.add(getSegmentColor(firstSegment));
+            }
+        }
+        for (GraphEdge edge : node.getOutboundEdges()) {
+            List<Segment> edgeSegments = edge.getPropertyValue(GraphEdgeSegments.PROPERTY);
+            if (edgeSegments.size() > 0) {
+                Segment lastSegment = edgeSegments.get(edgeSegments.size()-1);
+                segmentColors.add(getSegmentColor(lastSegment));
+            }
+        }
 
-	/**
-	 * returns the color for a value
-	 * @param value  value to get color for; != null
-	 * @return       color; != null
-	 */
-	protected Color getColorForValue(Float value) {
-		assert value != null;
+        if (segmentColors.size() > 0) {
+            return averageColor(segmentColors);
+        } else {
+            return Color.WHITE;
+        }
 
-		if (colorMap.containsKey(value)) {
+    }
 
-			return colorMap.get(value);
+    /**
+     * returns the color for a value
+     * @param value  value to get color for; != null
+     * @return       color; != null
+     */
+    protected Color getColorForValue(Float value) {
+        assert value != null;
 
-		} else {
+        if (colorMap.containsKey(value)) {
 
-			LinkedList<Float> valuesWithDefinedColor = new LinkedList<Float>(colorMap.keySet());
-			Collections.sort(valuesWithDefinedColor);
+            return colorMap.get(value);
 
-			if (value <= valuesWithDefinedColor.getFirst()) {
+        } else {
 
-				return colorMap.get(valuesWithDefinedColor.getFirst());
+            LinkedList<Float> valuesWithDefinedColor = new LinkedList<Float>(colorMap.keySet());
+            Collections.sort(valuesWithDefinedColor);
 
-			} else if (value >= valuesWithDefinedColor.getLast()) {
+            if (value <= valuesWithDefinedColor.getFirst()) {
 
-				return colorMap.get(valuesWithDefinedColor.getLast());
+                return colorMap.get(valuesWithDefinedColor.getFirst());
 
-			} else {
+            } else if (value >= valuesWithDefinedColor.getLast()) {
 
-				/* interpolate */
+                return colorMap.get(valuesWithDefinedColor.getLast());
 
-				Float lowerValue = valuesWithDefinedColor.getFirst();
-				Float higherValue = null;
+            } else {
 
-				for (Float v : valuesWithDefinedColor) {
-					if (v >= value) {
-						higherValue = v;
-						break;
-					}
-					lowerValue = v;
-				}
+                /* interpolate */
 
-				assert lowerValue != null && higherValue != null;
+                Float lowerValue = valuesWithDefinedColor.getFirst();
+                Float higherValue = null;
 
-				Color lowerColor = colorMap.get(lowerValue);
-				Color higherColor = colorMap.get(higherValue);
+                for (Float v : valuesWithDefinedColor) {
+                    if (v >= value) {
+                        higherValue = v;
+                        break;
+                    }
+                    lowerValue = v;
+                }
 
-				float weightHigherColor = (value - lowerValue) / (higherValue - lowerValue);
+                assert lowerValue != null && higherValue != null;
 
-				return weightedAverageColor(lowerColor, higherColor, weightHigherColor);
+                Color lowerColor = colorMap.get(lowerValue);
+                Color higherColor = colorMap.get(higherValue);
 
-			}
+                float weightHigherColor = (value - lowerValue) / (higherValue - lowerValue);
 
-		}
+                return weightedAverageColor(lowerColor, higherColor, weightHigherColor);
 
-	}
+            }
 
-	/**
-	 * returns an average of all colors that have been passed as parameter
-	 *
-	 * @param colors  colors to calculate average from; not empty or null
-	 * @return        average color; != null
-	 */
-	private static Color averageColor(List<Color> colors) {
-		assert colors != null && colors.size() > 0;
+        }
 
-		float weightPerColor = 1.0f / colors.size();
+    }
 
-		Color average = new Color(0,0,0);
+    /**
+     * returns an average of all colors that have been passed as parameter
+     *
+     * @param colors  colors to calculate average from; not empty or null
+     * @return        average color; != null
+     */
+    private static Color averageColor(List<Color> colors) {
+        assert colors != null && colors.size() > 0;
 
-		for (Color color : colors) {
-			average = new Color(
-					Math.min(Math.round(average.getRed() + weightPerColor*color.getRed()), 255),
-					Math.min(Math.round(average.getGreen() + weightPerColor*color.getGreen()), 255),
-					Math.min(Math.round(average.getBlue() + weightPerColor*color.getBlue()), 255));
-		}
+        float weightPerColor = 1.0f / colors.size();
 
-		return average;
-	}
+        Color average = new Color(0,0,0);
 
-	/**
-	 * returns a weighted average of two colors
-	 *
-	 * @param color1        first color for the average; != null
-	 * @param color2        second color for the average; != null
-	 * @param weightColor2  weight of color2; must be in [0..1]
-	 * @return              average color; != null
-	 */
-	private static Color weightedAverageColor(Color color1, Color color2, float weightColor2) {
-		assert color1 != null && color2 != null;
-		assert 0 <= weightColor2 && weightColor2 <= 1;
+        for (Color color : colors) {
+            average = new Color(
+                    Math.min(Math.round(average.getRed() + weightPerColor*color.getRed()), 255),
+                    Math.min(Math.round(average.getGreen() + weightPerColor*color.getGreen()), 255),
+                    Math.min(Math.round(average.getBlue() + weightPerColor*color.getBlue()), 255));
+        }
 
-		return new Color(
-				Math.round((1 - weightColor2) * color1.getRed() + weightColor2 * color2.getRed()),
-				Math.round((1 - weightColor2) * color1.getGreen() + weightColor2 * color2.getGreen()),
-				Math.round((1 - weightColor2) * color1.getBlue() + weightColor2 * color2.getBlue()));
-	}
+        return average;
+    }
+
+    /**
+     * returns a weighted average of two colors
+     *
+     * @param color1        first color for the average; != null
+     * @param color2        second color for the average; != null
+     * @param weightColor2  weight of color2; must be in [0..1]
+     * @return              average color; != null
+     */
+    private static Color weightedAverageColor(Color color1, Color color2, float weightColor2) {
+        assert color1 != null && color2 != null;
+        assert 0 <= weightColor2 && weightColor2 <= 1;
+
+        return new Color(
+                Math.round((1 - weightColor2) * color1.getRed() + weightColor2 * color2.getRed()),
+                Math.round((1 - weightColor2) * color1.getGreen() + weightColor2 * color2.getGreen()),
+                Math.round((1 - weightColor2) * color1.getBlue() + weightColor2 * color2.getBlue()));
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/InclineColorScheme.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/InclineColorScheme.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/InclineColorScheme.java	(revision 23189)
@@ -12,15 +12,15 @@
 public class InclineColorScheme extends FloatPropertyColorScheme {
 
-	private static final Map<Float, Color> COLOR_MAP;
+    private static final Map<Float, Color> COLOR_MAP;
 
-	static {
-		COLOR_MAP = new HashMap<Float, Color>();
-		COLOR_MAP.put(-30f, Color.BLUE);
-		COLOR_MAP.put(0f, Color.WHITE);
-		COLOR_MAP.put(30f, Color.RED);
-	}
+    static {
+        COLOR_MAP = new HashMap<Float, Color>();
+        COLOR_MAP.put(-30f, Color.BLUE);
+        COLOR_MAP.put(0f, Color.WHITE);
+        COLOR_MAP.put(30f, Color.RED);
+    }
 
-	public InclineColorScheme() {
-		super(RoadIncline.class, COLOR_MAP, Color.GRAY);
-	}
+    public InclineColorScheme() {
+        super(RoadIncline.class, COLOR_MAP, Color.GRAY);
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/LatLonCoords.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/LatLonCoords.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/LatLonCoords.java	(revision 23189)
@@ -6,19 +6,19 @@
 public final class LatLonCoords {
 
-	private final double lat;
-	private final double lon;
+    private final double lat;
+    private final double lon;
 
-	public LatLonCoords(double lat, double lon) {
-		this.lat = lat;
-		this.lon = lon;
-	}
+    public LatLonCoords(double lat, double lon) {
+        this.lat = lat;
+        this.lon = lon;
+    }
 
-	public double getLat() {
-		return lat;
-	}
+    public double getLat() {
+        return lat;
+    }
 
-	public double getLon() {
-		return lon;
-	}
+    public double getLon() {
+        return lon;
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxheightColorScheme.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxheightColorScheme.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxheightColorScheme.java	(revision 23189)
@@ -12,15 +12,15 @@
 public class MaxheightColorScheme extends FloatPropertyColorScheme {
 
-	private static final Map<Float, Color> COLOR_MAP;
+    private static final Map<Float, Color> COLOR_MAP;
 
-	static {
-		COLOR_MAP = new HashMap<Float, Color>();
-		COLOR_MAP.put(0f, new Color(0, 0, 50));
-		COLOR_MAP.put(10f, new Color(100, 100, 255));
-		COLOR_MAP.put(30f, new Color(200, 200, 255));
-	}
+    static {
+        COLOR_MAP = new HashMap<Float, Color>();
+        COLOR_MAP.put(0f, new Color(0, 0, 50));
+        COLOR_MAP.put(10f, new Color(100, 100, 255));
+        COLOR_MAP.put(30f, new Color(200, 200, 255));
+    }
 
-	public MaxheightColorScheme() {
-		super(RoadMaxheight.class, COLOR_MAP, Color.WHITE);
-	}
+    public MaxheightColorScheme() {
+        super(RoadMaxheight.class, COLOR_MAP, Color.WHITE);
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxspeedColorScheme.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxspeedColorScheme.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxspeedColorScheme.java	(revision 23189)
@@ -12,17 +12,17 @@
 public class MaxspeedColorScheme extends FloatPropertyColorScheme {
 
-	private static final Map<Float, Color> COLOR_MAP;
+    private static final Map<Float, Color> COLOR_MAP;
 
-	static {
-		COLOR_MAP = new HashMap<Float, Color>();
-		COLOR_MAP.put(0f, new Color(50, 0, 0));
-		COLOR_MAP.put(30f, Color.RED);
-		COLOR_MAP.put(60f, Color.YELLOW);
-		COLOR_MAP.put(90f, Color.GREEN);
-		COLOR_MAP.put(150f, Color.BLUE);
-	}
+    static {
+        COLOR_MAP = new HashMap<Float, Color>();
+        COLOR_MAP.put(0f, new Color(50, 0, 0));
+        COLOR_MAP.put(30f, Color.RED);
+        COLOR_MAP.put(60f, Color.YELLOW);
+        COLOR_MAP.put(90f, Color.GREEN);
+        COLOR_MAP.put(150f, Color.BLUE);
+    }
 
-	public MaxspeedColorScheme() {
-		super(RoadMaxspeed.class, COLOR_MAP, Color.GRAY);
-	}
+    public MaxspeedColorScheme() {
+        super(RoadMaxspeed.class, COLOR_MAP, Color.GRAY);
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxweightColorScheme.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxweightColorScheme.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/MaxweightColorScheme.java	(revision 23189)
@@ -12,15 +12,15 @@
 public class MaxweightColorScheme extends FloatPropertyColorScheme {
 
-	private static final Map<Float, Color> COLOR_MAP;
+    private static final Map<Float, Color> COLOR_MAP;
 
-	static {
-		COLOR_MAP = new HashMap<Float, Color>();
-		COLOR_MAP.put(0f, new Color(0, 0, 50));
-		COLOR_MAP.put(20f, new Color(100, 100, 255));
-		COLOR_MAP.put(50f, new Color(200, 200, 255));
-	}
+    static {
+        COLOR_MAP = new HashMap<Float, Color>();
+        COLOR_MAP.put(0f, new Color(0, 0, 50));
+        COLOR_MAP.put(20f, new Color(100, 100, 255));
+        COLOR_MAP.put(50f, new Color(200, 200, 255));
+    }
 
-	public MaxweightColorScheme() {
-		super(RoadMaxweight.class, COLOR_MAP, Color.WHITE);
-	}
+    public MaxweightColorScheme() {
+        super(RoadMaxweight.class, COLOR_MAP, Color.WHITE);
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/NodePositioner.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/NodePositioner.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/NodePositioner.java	(revision 23189)
@@ -9,5 +9,5 @@
 public interface NodePositioner {
 
-	LatLonCoords getPosition(GraphNode node);
+    LatLonCoords getPosition(GraphNode node);
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/NonMovingNodePositioner.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/NonMovingNodePositioner.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/NonMovingNodePositioner.java	(revision 23189)
@@ -5,9 +5,9 @@
 public class NonMovingNodePositioner implements NodePositioner {
 
-	public LatLonCoords getPosition(GraphNode node) {
-		return new LatLonCoords(
-				node.getSegmentNode().getLat(),
-				node.getSegmentNode().getLon());
-	}
+    public LatLonCoords getPosition(GraphNode node) {
+        return new LatLonCoords(
+                node.getSegmentNode().getLat(),
+                node.getSegmentNode().getLon());
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/SingleColorScheme.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/SingleColorScheme.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/core/visualisation/SingleColorScheme.java	(revision 23189)
@@ -12,19 +12,19 @@
 public class SingleColorScheme implements ColorScheme {
 
-	private final Color nodeColor;
-	private final Color segmentColor;
+    private final Color nodeColor;
+    private final Color segmentColor;
 
-	public SingleColorScheme(Color nodeColor, Color segmentColor) {
-		this.nodeColor = nodeColor;
-		this.segmentColor = segmentColor;
-	}
+    public SingleColorScheme(Color nodeColor, Color segmentColor) {
+        this.nodeColor = nodeColor;
+        this.segmentColor = segmentColor;
+    }
 
-	public Color getNodeColor(GraphNode node) {
-		return nodeColor;
-	}
+    public Color getNodeColor(GraphNode node) {
+        return nodeColor;
+    }
 
-	public Color getSegmentColor(Segment segment) {
-		return segmentColor;
-	}
+    public Color getSegmentColor(Segment segment) {
+        return segmentColor;
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/GraphViewPlugin.java	(revision 23189)
@@ -52,222 +52,222 @@
 public class GraphViewPlugin extends Plugin implements LayerChangeListener, Observer {
 
-	private static final Collection<RoadPropertyType<?>> PROPERTIES;
-
-	static {
-		PROPERTIES = new LinkedList<RoadPropertyType<?>>();
-		PROPERTIES.add(new RoadIncline());
-		PROPERTIES.add(new RoadMaxaxleload());
-		PROPERTIES.add(new RoadMaxheight());
-		PROPERTIES.add(new RoadMaxlength());
-		PROPERTIES.add(new RoadMaxspeed());
-		PROPERTIES.add(new RoadMaxweight());
-		PROPERTIES.add(new RoadMaxwidth());
-		PROPERTIES.add(new RoadMinspeed());
-		PROPERTIES.add(new RoadSurface());
-		PROPERTIES.add(new RoadTracktype());
-		PROPERTIES.add(new RoadWidth());
-	}
-
-	private final GraphViewPreferences preferences;
-
-	private JOSMTransitionStructure transitionStructure;
-	private GraphViewLayer graphViewLayer;
-
-	/** creates the plugin */
-	public GraphViewPlugin(PluginInformation info) {
-		super(info);
-		preferences = GraphViewPreferences.getInstance();
-		this.preferences.addObserver(this);
-
-	}
-
-	/** allows creation/update of GraphViewLayer */
-	public void createGraphViewLayer() {
-
-		try {
-
-			if (graphViewLayer != null) {
-
-				AccessRuleset accessRuleset = getAccessRuleset();
-
-				if (accessRuleset == null) {
-					JOptionPane.showMessageDialog(Main.parent, "No ruleset has been selected!", "No ruleset", JOptionPane.ERROR_MESSAGE);
-				} else {
-					transitionStructure.setAccessParametersAndRuleset(preferences.getCurrentParameterBookmark(), accessRuleset);
-					transitionStructure.forceUpdate();
-				}
-
-			} else {
-
-				AccessRuleset accessRuleset = getAccessRuleset();
-
-				if (accessRuleset == null) {
-					JOptionPane.showMessageDialog(Main.parent, "No ruleset has been selected!",
-							"No ruleset", JOptionPane.ERROR_MESSAGE);
-				} else {
-
-					transitionStructure = new JOSMTransitionStructure(
-							preferences.getCurrentParameterBookmark(),
-							accessRuleset,
-							PROPERTIES);
-
-					WayGraph graph = new TSBasedWayGraph(transitionStructure);
-
-					graphViewLayer = new GraphViewLayer();
-					graphViewLayer.setWayGraph(graph);
-					graphViewLayer.setColorScheme(preferences.getCurrentColorScheme());
-					graphViewLayer.setNodePositioner(new DefaultNodePositioner());
-
-					Main.main.addLayer(graphViewLayer);
-
-				}
-
-			}
-
-		} catch (AccessRulesetSyntaxException e) {
-			JOptionPane.showMessageDialog(Main.parent, "syntax exception in access ruleset:\n" + e);
-			e.printStackTrace();
-		} catch (FileNotFoundException e) {
-			JOptionPane.showMessageDialog(Main.parent, "file not found:\n" + e);
-			e.printStackTrace();
-		} catch (IOException e) {
-			JOptionPane.showMessageDialog(Main.parent, "problem when accessing a file:\n" + e);
-			e.printStackTrace();
-		}
-
-	}
-
-	/** allows update of GraphViewLayer */
-	public void updateGraphViewLayer() {
-
-		try {
-
-			if (graphViewLayer != null) {
-
-				AccessRuleset accessRuleset = getAccessRuleset();
-
-				if (accessRuleset == null) {
-					JOptionPane.showMessageDialog(Main.parent, "No ruleset has been selected!",
-							"No ruleset", JOptionPane.ERROR_MESSAGE);
-				} else {
-					transitionStructure.setAccessParametersAndRuleset(
-							preferences.getCurrentParameterBookmark(), accessRuleset);
-					transitionStructure.forceUpdate();
-				}
-
-			}
-
-		} catch (AccessRulesetSyntaxException e) {
-			JOptionPane.showMessageDialog(Main.parent, "syntax exception in access ruleset:\n" + e);
-			e.printStackTrace();
-		} catch (FileNotFoundException e) {
-			JOptionPane.showMessageDialog(Main.parent, "file not found:\n" + e);
-			e.printStackTrace();
-		} catch (IOException e) {
-			JOptionPane.showMessageDialog(Main.parent, "problem when accessing a file:\n" + e);
-			e.printStackTrace();
-		}
-
-	}
-
-	/** repaints the GraphViewLayer without recalculating the graph (visual update) */
-	public void repaintGraphViewLayer() {
-
-		if (graphViewLayer != null) {
-			Main.panel.repaint();
-		}
-
-	}
-
-	/**
-	 * @return ruleset read from a source as specified by preferences, null if the preferences
-	 *         don't specify a ruleset source
-	 * @throws AccessRulesetSyntaxException
-	 * @throws IOException
-	 * @throws FileNotFoundException
-	 */
-	private AccessRuleset getAccessRuleset()
-	throws AccessRulesetSyntaxException, IOException, FileNotFoundException {
-
-		InputStream rulesetInputStream;
-
-		if (preferences.getUseInternalRulesets()) {
-
-			InternalRuleset ruleset = preferences.getCurrentInternalRuleset();
-
-			if (ruleset == null) {
-				return null;
-			}
-
-			ClassLoader classLoader = this.getClass().getClassLoader();
-			URL rulesetURL = classLoader.getResource(ruleset.getResourceName());
-
-			if (rulesetURL != null) {
-				rulesetInputStream = rulesetURL.openStream();
-			} else {
-				throw new FileNotFoundException("couldn't find built-in ruleset " + ruleset);
-			}
-
-		} else {
-
-			File rulesetFile = preferences.getCurrentRulesetFile();
-
-			if (rulesetFile == null) {
-				return null;
-			}
-
-			rulesetInputStream = new FileInputStream(rulesetFile);
-
-		}
-
-		return AccessRulesetReader.readAccessRuleset(rulesetInputStream);
-
-	}
-
-	@Override
-	public PreferenceSetting getPreferenceSetting() {
-		return new GraphViewPreferenceEditor();
-	}
-
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if (newFrame != null) {
-			if (oldFrame == null) {
-				final GraphViewDialog laneDialog
-					= new GraphViewDialog(this);
-				newFrame.addToggleDialog(laneDialog);
-			}
-			MapView.addLayerChangeListener(this);
-		} else {
-			MapView.removeLayerChangeListener(this);
-		}
-	}
-
-	public void layerRemoved(Layer oldLayer) {
-		if (oldLayer == graphViewLayer) {
-			graphViewLayer = null;
-		} else if (oldLayer == Main.map.mapView.getEditLayer()) { //data layer removed
-			if (graphViewLayer != null) {
-				Main.map.mapView.removeLayer(graphViewLayer);
-				graphViewLayer = null;
-			}
-		}
-	}
-
-	public void activeLayerChange(Layer oldLayer, Layer newLayer) {
-		//do nothing
-	}
-
-	public void layerAdded(Layer newLayer) {
-		//do nothing
-	}
-
-	public void update(Observable arg0, Object arg1) {
-		if (arg0 == preferences) {
-			if (graphViewLayer != null) {
-				graphViewLayer.setColorScheme(preferences.getCurrentColorScheme());
-			}
-		}
-	}
+    private static final Collection<RoadPropertyType<?>> PROPERTIES;
+
+    static {
+        PROPERTIES = new LinkedList<RoadPropertyType<?>>();
+        PROPERTIES.add(new RoadIncline());
+        PROPERTIES.add(new RoadMaxaxleload());
+        PROPERTIES.add(new RoadMaxheight());
+        PROPERTIES.add(new RoadMaxlength());
+        PROPERTIES.add(new RoadMaxspeed());
+        PROPERTIES.add(new RoadMaxweight());
+        PROPERTIES.add(new RoadMaxwidth());
+        PROPERTIES.add(new RoadMinspeed());
+        PROPERTIES.add(new RoadSurface());
+        PROPERTIES.add(new RoadTracktype());
+        PROPERTIES.add(new RoadWidth());
+    }
+
+    private final GraphViewPreferences preferences;
+
+    private JOSMTransitionStructure transitionStructure;
+    private GraphViewLayer graphViewLayer;
+
+    /** creates the plugin */
+    public GraphViewPlugin(PluginInformation info) {
+        super(info);
+        preferences = GraphViewPreferences.getInstance();
+        this.preferences.addObserver(this);
+
+    }
+
+    /** allows creation/update of GraphViewLayer */
+    public void createGraphViewLayer() {
+
+        try {
+
+            if (graphViewLayer != null) {
+
+                AccessRuleset accessRuleset = getAccessRuleset();
+
+                if (accessRuleset == null) {
+                    JOptionPane.showMessageDialog(Main.parent, "No ruleset has been selected!", "No ruleset", JOptionPane.ERROR_MESSAGE);
+                } else {
+                    transitionStructure.setAccessParametersAndRuleset(preferences.getCurrentParameterBookmark(), accessRuleset);
+                    transitionStructure.forceUpdate();
+                }
+
+            } else {
+
+                AccessRuleset accessRuleset = getAccessRuleset();
+
+                if (accessRuleset == null) {
+                    JOptionPane.showMessageDialog(Main.parent, "No ruleset has been selected!",
+                            "No ruleset", JOptionPane.ERROR_MESSAGE);
+                } else {
+
+                    transitionStructure = new JOSMTransitionStructure(
+                            preferences.getCurrentParameterBookmark(),
+                            accessRuleset,
+                            PROPERTIES);
+
+                    WayGraph graph = new TSBasedWayGraph(transitionStructure);
+
+                    graphViewLayer = new GraphViewLayer();
+                    graphViewLayer.setWayGraph(graph);
+                    graphViewLayer.setColorScheme(preferences.getCurrentColorScheme());
+                    graphViewLayer.setNodePositioner(new DefaultNodePositioner());
+
+                    Main.main.addLayer(graphViewLayer);
+
+                }
+
+            }
+
+        } catch (AccessRulesetSyntaxException e) {
+            JOptionPane.showMessageDialog(Main.parent, "syntax exception in access ruleset:\n" + e);
+            e.printStackTrace();
+        } catch (FileNotFoundException e) {
+            JOptionPane.showMessageDialog(Main.parent, "file not found:\n" + e);
+            e.printStackTrace();
+        } catch (IOException e) {
+            JOptionPane.showMessageDialog(Main.parent, "problem when accessing a file:\n" + e);
+            e.printStackTrace();
+        }
+
+    }
+
+    /** allows update of GraphViewLayer */
+    public void updateGraphViewLayer() {
+
+        try {
+
+            if (graphViewLayer != null) {
+
+                AccessRuleset accessRuleset = getAccessRuleset();
+
+                if (accessRuleset == null) {
+                    JOptionPane.showMessageDialog(Main.parent, "No ruleset has been selected!",
+                            "No ruleset", JOptionPane.ERROR_MESSAGE);
+                } else {
+                    transitionStructure.setAccessParametersAndRuleset(
+                            preferences.getCurrentParameterBookmark(), accessRuleset);
+                    transitionStructure.forceUpdate();
+                }
+
+            }
+
+        } catch (AccessRulesetSyntaxException e) {
+            JOptionPane.showMessageDialog(Main.parent, "syntax exception in access ruleset:\n" + e);
+            e.printStackTrace();
+        } catch (FileNotFoundException e) {
+            JOptionPane.showMessageDialog(Main.parent, "file not found:\n" + e);
+            e.printStackTrace();
+        } catch (IOException e) {
+            JOptionPane.showMessageDialog(Main.parent, "problem when accessing a file:\n" + e);
+            e.printStackTrace();
+        }
+
+    }
+
+    /** repaints the GraphViewLayer without recalculating the graph (visual update) */
+    public void repaintGraphViewLayer() {
+
+        if (graphViewLayer != null) {
+            Main.panel.repaint();
+        }
+
+    }
+
+    /**
+     * @return ruleset read from a source as specified by preferences, null if the preferences
+     *         don't specify a ruleset source
+     * @throws AccessRulesetSyntaxException
+     * @throws IOException
+     * @throws FileNotFoundException
+     */
+    private AccessRuleset getAccessRuleset()
+    throws AccessRulesetSyntaxException, IOException, FileNotFoundException {
+
+        InputStream rulesetInputStream;
+
+        if (preferences.getUseInternalRulesets()) {
+
+            InternalRuleset ruleset = preferences.getCurrentInternalRuleset();
+
+            if (ruleset == null) {
+                return null;
+            }
+
+            ClassLoader classLoader = this.getClass().getClassLoader();
+            URL rulesetURL = classLoader.getResource(ruleset.getResourceName());
+
+            if (rulesetURL != null) {
+                rulesetInputStream = rulesetURL.openStream();
+            } else {
+                throw new FileNotFoundException("couldn't find built-in ruleset " + ruleset);
+            }
+
+        } else {
+
+            File rulesetFile = preferences.getCurrentRulesetFile();
+
+            if (rulesetFile == null) {
+                return null;
+            }
+
+            rulesetInputStream = new FileInputStream(rulesetFile);
+
+        }
+
+        return AccessRulesetReader.readAccessRuleset(rulesetInputStream);
+
+    }
+
+    @Override
+    public PreferenceSetting getPreferenceSetting() {
+        return new GraphViewPreferenceEditor();
+    }
+
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (newFrame != null) {
+            if (oldFrame == null) {
+                final GraphViewDialog laneDialog
+                    = new GraphViewDialog(this);
+                newFrame.addToggleDialog(laneDialog);
+            }
+            MapView.addLayerChangeListener(this);
+        } else {
+            MapView.removeLayerChangeListener(this);
+        }
+    }
+
+    public void layerRemoved(Layer oldLayer) {
+        if (oldLayer == graphViewLayer) {
+            graphViewLayer = null;
+        } else if (oldLayer == Main.map.mapView.getEditLayer()) { //data layer removed
+            if (graphViewLayer != null) {
+                Main.map.mapView.removeLayer(graphViewLayer);
+                graphViewLayer = null;
+            }
+        }
+    }
+
+    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
+        //do nothing
+    }
+
+    public void layerAdded(Layer newLayer) {
+        //do nothing
+    }
+
+    public void update(Observable arg0, Object arg1) {
+        if (arg0 == preferences) {
+            if (graphViewLayer != null) {
+                graphViewLayer.setColorScheme(preferences.getCurrentColorScheme());
+            }
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/data/JOSMDataSource.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/data/JOSMDataSource.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/data/JOSMDataSource.java	(revision 23189)
@@ -26,191 +26,191 @@
 public class JOSMDataSource implements DataSource<Node, Way, Relation, RelationMember> {
 
-	public double getLat(Node node) {
-		return node.getCoor().lat();
-	}
-
-	public double getLon(Node node) {
-		return node.getCoor().lon();
-	}
-
-	public Iterable<RelationMember> getMembers(Relation relation) {
-		return relation.getMembers();
-	}
-
-	public Iterable<Node> getNodes(Way way) {
-		return new FilteredOsmPrimitiveIterable<Node>(way.getNodes());
-	}
-
-	public Iterable<Node> getNodes() {
-		return new FilteredOsmPrimitiveIterable<Node>(Main.main.getCurrentDataSet().getNodes());
-	}
-
-	public Iterable<Relation> getRelations() {
-		return new FilteredRelationIterable(Main.main.getCurrentDataSet().getRelations());
-	}
-
-	public Iterable<Way> getWays() {
-		return new FilteredOsmPrimitiveIterable<Way>(Main.main.getCurrentDataSet().getWays());
-	}
-
-	public TagGroup getTagsN(Node node) {
-		return getTags(node);
-	}
-
-	public TagGroup getTagsW(Way way) {
-		return getTags(way);
-	}
-
-	public TagGroup getTagsR(Relation relation) {
-		return getTags(relation);
-	}
-
-	private TagGroup getTags(OsmPrimitive primitive) {
-		if (primitive.getKeys() == null) {
-			return EMPTY_TAG_GROUP;
-		} else {
-			return new MapBasedTagGroup(primitive.getKeys());
-		}
-	}
-
-	public Object getMember(RelationMember member) {
-		return member.getMember();
-	}
-
-	public String getRole(RelationMember member) {
-		return member.getRole();
-	}
-
-	public boolean isNMember(RelationMember member) {
-		return member.getMember() instanceof Node;
-	}
-
-	public boolean isWMember(RelationMember member) {
-		return member.getMember() instanceof Way;
-	}
-
-	public boolean isRMember(RelationMember member) {
-		return member.getMember() instanceof Relation;
-	}
-
-
-	private static final TagGroup EMPTY_TAG_GROUP;
-	static {
-		Map<String, String> emptyMap = new HashMap<String, String>(0);
-		EMPTY_TAG_GROUP = new MapBasedTagGroup(emptyMap);
-	}
-
-	/**
-	 * Iterable of OsmPrimitive objects based on an existing Iterable,
-	 * will filter incomplete and deleted objects from the iterator.
-	 *
-	 * @param <P>  OsmPrimitive subtype
-	 */
-	public static class FilteredOsmPrimitiveIterable<P extends OsmPrimitive> implements Iterable<P> {
-
-		private final Iterable<P> originalIterable;
-
-		public FilteredOsmPrimitiveIterable(Iterable<P> originalIterable) {
-			this.originalIterable = originalIterable;
-		}
-
-		/** returns an iterator. The iterator does not support {@link Iterator#remove()}. */
-		public Iterator<P> iterator() {
-			return new FilteredIterator(originalIterable.iterator());
-		}
-
-		private class FilteredIterator implements Iterator<P> {
-
-			private final Iterator<P> originalIterator;
-
-			private P next;
-
-			public FilteredIterator(Iterator<P> originalIterator) {
-				this.originalIterator = originalIterator;
-				updateNext();
-			}
-
-			public boolean hasNext() {
-				return next != null;
-			}
-
-			public P next() {
-				if (next != null) {
-					P result = next;
-					updateNext();
-					return result;
-				} else {
-					throw new NoSuchElementException();
-				}
-			}
-
-			public void remove() {
-				throw new UnsupportedOperationException();
-			}
-
-			private void updateNext() {
-				next = null;
-				while (originalIterator.hasNext()) {
-					P originalNext = originalIterator.next();
-					if (accept(originalNext)) {
-						next = originalNext;
-						break;
-					}
-				}
-			}
-
-		}
-
-		protected boolean accept(P primitive) {
-			return !primitive.isDeleted() && !primitive.isIncomplete();
-		}
-	}
-
-	/**
-	 * Relation-specific variant of the FilteredOsmPrimitiveIterable,
-	 * also checks completeness of relation's members
-	 */
-	public static class FilteredRelationIterable extends FilteredOsmPrimitiveIterable<Relation> {
-
-		public FilteredRelationIterable(Iterable<Relation> originalIterable) {
-			super(originalIterable);
-		}
-
-		@Override
-		protected boolean accept(Relation relation) {
-			boolean complete = true;
-			for (org.openstreetmap.josm.data.osm.RelationMember member : relation.getMembers()) {
-				if (member.getMember() == null || member.getMember().isDeleted() || member.getMember().isIncomplete()) {
-					complete = false;
-				}
-			}
-			return complete && super.accept(relation);
-		}
-	}
-
-	static class RelationMemberImpl {
-		private final String role;
-		private final Object member;
-		public RelationMemberImpl(org.openstreetmap.josm.data.osm.RelationMember originalMember) {
-			this.role = originalMember.getRole();
-			this.member = originalMember.getMember();
-		}
-		public String getRole() {
-			return role;
-		}
-		public Object getMember() {
-			return member;
-		}
-	}
-
-	private final Set<DataSourceObserver> observers = new HashSet<DataSourceObserver>();
-
-	public void addObserver(DataSourceObserver observer) {
-		observers.add(observer);
-	}
-
-	public void deleteObserver(DataSourceObserver observer) {
-		observers.remove(observer);
-	}
+    public double getLat(Node node) {
+        return node.getCoor().lat();
+    }
+
+    public double getLon(Node node) {
+        return node.getCoor().lon();
+    }
+
+    public Iterable<RelationMember> getMembers(Relation relation) {
+        return relation.getMembers();
+    }
+
+    public Iterable<Node> getNodes(Way way) {
+        return new FilteredOsmPrimitiveIterable<Node>(way.getNodes());
+    }
+
+    public Iterable<Node> getNodes() {
+        return new FilteredOsmPrimitiveIterable<Node>(Main.main.getCurrentDataSet().getNodes());
+    }
+
+    public Iterable<Relation> getRelations() {
+        return new FilteredRelationIterable(Main.main.getCurrentDataSet().getRelations());
+    }
+
+    public Iterable<Way> getWays() {
+        return new FilteredOsmPrimitiveIterable<Way>(Main.main.getCurrentDataSet().getWays());
+    }
+
+    public TagGroup getTagsN(Node node) {
+        return getTags(node);
+    }
+
+    public TagGroup getTagsW(Way way) {
+        return getTags(way);
+    }
+
+    public TagGroup getTagsR(Relation relation) {
+        return getTags(relation);
+    }
+
+    private TagGroup getTags(OsmPrimitive primitive) {
+        if (primitive.getKeys() == null) {
+            return EMPTY_TAG_GROUP;
+        } else {
+            return new MapBasedTagGroup(primitive.getKeys());
+        }
+    }
+
+    public Object getMember(RelationMember member) {
+        return member.getMember();
+    }
+
+    public String getRole(RelationMember member) {
+        return member.getRole();
+    }
+
+    public boolean isNMember(RelationMember member) {
+        return member.getMember() instanceof Node;
+    }
+
+    public boolean isWMember(RelationMember member) {
+        return member.getMember() instanceof Way;
+    }
+
+    public boolean isRMember(RelationMember member) {
+        return member.getMember() instanceof Relation;
+    }
+
+
+    private static final TagGroup EMPTY_TAG_GROUP;
+    static {
+        Map<String, String> emptyMap = new HashMap<String, String>(0);
+        EMPTY_TAG_GROUP = new MapBasedTagGroup(emptyMap);
+    }
+
+    /**
+     * Iterable of OsmPrimitive objects based on an existing Iterable,
+     * will filter incomplete and deleted objects from the iterator.
+     *
+     * @param <P>  OsmPrimitive subtype
+     */
+    public static class FilteredOsmPrimitiveIterable<P extends OsmPrimitive> implements Iterable<P> {
+
+        private final Iterable<P> originalIterable;
+
+        public FilteredOsmPrimitiveIterable(Iterable<P> originalIterable) {
+            this.originalIterable = originalIterable;
+        }
+
+        /** returns an iterator. The iterator does not support {@link Iterator#remove()}. */
+        public Iterator<P> iterator() {
+            return new FilteredIterator(originalIterable.iterator());
+        }
+
+        private class FilteredIterator implements Iterator<P> {
+
+            private final Iterator<P> originalIterator;
+
+            private P next;
+
+            public FilteredIterator(Iterator<P> originalIterator) {
+                this.originalIterator = originalIterator;
+                updateNext();
+            }
+
+            public boolean hasNext() {
+                return next != null;
+            }
+
+            public P next() {
+                if (next != null) {
+                    P result = next;
+                    updateNext();
+                    return result;
+                } else {
+                    throw new NoSuchElementException();
+                }
+            }
+
+            public void remove() {
+                throw new UnsupportedOperationException();
+            }
+
+            private void updateNext() {
+                next = null;
+                while (originalIterator.hasNext()) {
+                    P originalNext = originalIterator.next();
+                    if (accept(originalNext)) {
+                        next = originalNext;
+                        break;
+                    }
+                }
+            }
+
+        }
+
+        protected boolean accept(P primitive) {
+            return !primitive.isDeleted() && !primitive.isIncomplete();
+        }
+    }
+
+    /**
+     * Relation-specific variant of the FilteredOsmPrimitiveIterable,
+     * also checks completeness of relation's members
+     */
+    public static class FilteredRelationIterable extends FilteredOsmPrimitiveIterable<Relation> {
+
+        public FilteredRelationIterable(Iterable<Relation> originalIterable) {
+            super(originalIterable);
+        }
+
+        @Override
+        protected boolean accept(Relation relation) {
+            boolean complete = true;
+            for (org.openstreetmap.josm.data.osm.RelationMember member : relation.getMembers()) {
+                if (member.getMember() == null || member.getMember().isDeleted() || member.getMember().isIncomplete()) {
+                    complete = false;
+                }
+            }
+            return complete && super.accept(relation);
+        }
+    }
+
+    static class RelationMemberImpl {
+        private final String role;
+        private final Object member;
+        public RelationMemberImpl(org.openstreetmap.josm.data.osm.RelationMember originalMember) {
+            this.role = originalMember.getRole();
+            this.member = originalMember.getMember();
+        }
+        public String getRole() {
+            return role;
+        }
+        public Object getMember() {
+            return member;
+        }
+    }
+
+    private final Set<DataSourceObserver> observers = new HashSet<DataSourceObserver>();
+
+    public void addObserver(DataSourceObserver observer) {
+        observers.add(observer);
+    }
+
+    public void deleteObserver(DataSourceObserver observer) {
+        observers.remove(observer);
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/data/JOSMTransitionStructure.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/data/JOSMTransitionStructure.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/data/JOSMTransitionStructure.java	(revision 23189)
@@ -17,19 +17,19 @@
 public class JOSMTransitionStructure extends GenericTransitionStructure<Node, Way, Relation, RelationMember> {
 
-	private static final JOSMDataSource DATA_SOURCE = new JOSMDataSource();
+    private static final JOSMDataSource DATA_SOURCE = new JOSMDataSource();
 
-	public JOSMTransitionStructure(AccessParameters accessParameters, AccessRuleset ruleset,
-			Collection<RoadPropertyType<?>> properties) {
+    public JOSMTransitionStructure(AccessParameters accessParameters, AccessRuleset ruleset,
+            Collection<RoadPropertyType<?>> properties) {
 
-		super(accessParameters, ruleset,
-				DATA_SOURCE,
-				properties);
+        super(accessParameters, ruleset,
+                DATA_SOURCE,
+                properties);
 
-	}
+    }
 
-	/** causes an update (as if the DataSource had noticed a change) */
-	public void forceUpdate() {
-		super.update(DATA_SOURCE);
-	}
+    /** causes an update (as if the DataSource had noticed a change) */
+    public void forceUpdate() {
+        super.update(DATA_SOURCE);
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/AccessParameterDialog.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/AccessParameterDialog.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/AccessParameterDialog.java	(revision 23189)
@@ -38,424 +38,424 @@
 public class AccessParameterDialog extends JDialog {
 
-	public static interface BookmarkAction {
-		public void execute(String name, PreferenceAccessParameters parameters);
-	}
-
-	/**
-	 * map that contains all float value vehicle properties (as those can be treated uniformly)
-	 * and their labels
-	 */
-	private static final Map<VehiclePropertyType<Float>, String> FLOAT_PROPERTIES;
-
-	static {
-		FLOAT_PROPERTIES = new LinkedHashMap<VehiclePropertyType<Float>, String>();
-		FLOAT_PROPERTIES.put(VehiclePropertyTypes.HEIGHT, "height (m)");
-		FLOAT_PROPERTIES.put(VehiclePropertyTypes.WIDTH, "width (m)");
-		FLOAT_PROPERTIES.put(VehiclePropertyTypes.LENGTH, "length (m)");
-		FLOAT_PROPERTIES.put(VehiclePropertyTypes.SPEED, "speed (km/h)");
-		FLOAT_PROPERTIES.put(VehiclePropertyTypes.WEIGHT, "weight (t)");
-		FLOAT_PROPERTIES.put(VehiclePropertyTypes.AXLELOAD, "axleload (t)");
-	}
-
-	private static final Collection<Character> FORBIDDEN_CHARS =
-		Arrays.asList(',', ';', '{', '}', '=', '|');
-
-	private class BookmarkNamePanel extends JPanel {
-
-		private final JTextField bookmarkNameTextField;
-
-		public BookmarkNamePanel(String initialName) {
-			super();
-			this.setBorder(BorderFactory.createTitledBorder("bookmark name"));
-
-			this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
-
-			bookmarkNameTextField = new JTextField(initialName);
-			this.add(bookmarkNameTextField);
-
-		}
-
-		public String getBookmarkName() {
-
-			String name = bookmarkNameTextField.getText();
-
-			if (existingBookmarkNames.contains(name)) {
-				JOptionPane.showMessageDialog(this, "Bookmark name already exists!");
-				return null;
-			}
-
-			for (char nameChar : name.toCharArray()) {
-				if (FORBIDDEN_CHARS.contains(nameChar)) {
-					JOptionPane.showMessageDialog(this, "Bookmark name must not contain '" +
-							nameChar + "'!");
-					return null;
-				}
-			}
-
-			return name;
-		}
-	}
-
-	private static class AccessClassPanel extends JPanel {
-
-		private final JTextField accessClassTextField;
-
-		public AccessClassPanel(PreferenceAccessParameters initialParameters) {
-			super();
-			this.setBorder(BorderFactory.createTitledBorder("access class"));
-
-			this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
-
-			accessClassTextField = new JTextField(initialParameters.getAccessClass());
-			this.add(accessClassTextField);
-
-		}
-
-		public String getAccessClass() {
-
-			String name = accessClassTextField.getText();
-
-			for (char nameChar : name.toCharArray()) {
-				if (FORBIDDEN_CHARS.contains(nameChar)) {
-					JOptionPane.showMessageDialog(this, "Access class must not contain '" +
-							nameChar + "'!");
-					return null;
-				}
-			}
-
-			return name;
-		}
-	}
-
-	private static class AccessTypesPanel extends JPanel {
-
-		private static final int COLS = 4;
-
-		private final Map<AccessType, JCheckBox> accessTypeCheckBoxes =
-			new EnumMap<AccessType, JCheckBox>(AccessType.class);
-
-		public AccessTypesPanel(PreferenceAccessParameters initialParameters) {
-			super();
-			this.setBorder(BorderFactory.createTitledBorder("access types"));
-
-			this.setLayout(
-					new GridLayout(((COLS-1 + AccessType.values().length) / COLS), COLS));
-
-			for (AccessType accessType : AccessType.values()) {
-				JCheckBox checkBox = new JCheckBox(accessType.toString());
-				checkBox.setSelected(initialParameters.getAccessTypeUsable(accessType));
-				accessTypeCheckBoxes.put(accessType, checkBox);
-				this.add(checkBox);
-			}
-
-		}
-
-		public Collection<AccessType> getUsableAccessTypes() {
-
-			Collection<AccessType> usableAccessTypes = new LinkedList<AccessType>();
-
-			for (AccessType accessType : AccessType.values()) {
-				if (accessTypeCheckBoxes.get(accessType).isSelected()) {
-					usableAccessTypes.add(accessType);
-				}
-			}
-
-			return usableAccessTypes;
-		}
-	}
-
-	private static class VehiclePropertiesPanel extends JPanel {
-
-		private static final int COLS = 2;
-
-		private final Map<VehiclePropertyType<Float>, JTextField> floatPropertyTextFields =
-			new HashMap<VehiclePropertyType<Float>, JTextField>();
-
-		public VehiclePropertiesPanel(PreferenceAccessParameters initialParameters) {
-			super();
-			this.setBorder(BorderFactory.createTitledBorder("vehicle properties"));
-
-			this.setLayout(new GridLayout(((COLS-1 + FLOAT_PROPERTIES.size()) / COLS),
-					2*COLS));
-
-			for (VehiclePropertyType<Float> vehicleProperty : FLOAT_PROPERTIES.keySet()) {
-
-				JLabel label = new JLabel(FLOAT_PROPERTIES.get(vehicleProperty));
-				this.add(label);
-
-				JTextField textField = new JTextField();
-
-				String vehiclePropertyString =
-					initialParameters.getVehiclePropertyString(vehicleProperty);
-				if (vehiclePropertyString != null) {
-					textField.setText(vehiclePropertyString);
-				}
-
-				floatPropertyTextFields.put(vehicleProperty, textField);
-				this.add(textField);
-			}
-
-		}
-
-		public Map<VehiclePropertyType<?>, String> getVehiclePropertyStrings() {
-
-			Map<VehiclePropertyType<?>, String> vehiclePropertyStrings =
-				new HashMap<VehiclePropertyType<?>, String>();
-
-			for (VehiclePropertyType<Float> vehicleProperty : floatPropertyTextFields.keySet()) {
-				String textFieldContent = floatPropertyTextFields.get(vehicleProperty).getText();
-				if (textFieldContent.trim().length() > 0) {
-					vehiclePropertyStrings.put(vehicleProperty, textFieldContent);
-				}
-			}
-
-			return vehiclePropertyStrings;
-		}
-	}
-
-	private static class RoadQualityPanel extends JPanel {
-
-		private JTextField inclineUpTextField;
-		private JTextField inclineDownTextField;
-		private JTextField surfaceTextField;
-		private JTextField tracktypeTextField;
-
-		public RoadQualityPanel(PreferenceAccessParameters initialParameters) {
-			super();
-			this.setBorder(BorderFactory.createTitledBorder("road requirements"));
-
-
-			this.setLayout(new GridLayout(4, 2));
-
-			/* incline up */
-			{
-				JLabel inclineUpLabel = new JLabel("max. incline up (%, pos.)");
-				inclineUpLabel.setToolTipText("maximum incline the vehicle can go up");
-				this.add(inclineUpLabel);
-
-				inclineUpTextField = new JTextField();
-
-				String vehiclePropertyString =
-					initialParameters.getVehiclePropertyString(MAX_INCLINE_UP);
-				if (vehiclePropertyString != null) {
-					inclineUpTextField.setText(vehiclePropertyString);
-				}
-				inclineUpTextField.setToolTipText("maximum incline the vehicle can go up");
-
-				this.add(inclineUpTextField);
-			}
-
-			/* incline down */
-			{
-				JLabel inclineDownLabel = new JLabel("max. incline down (%, pos.)");
-				inclineDownLabel.setToolTipText("maximum incline the vehicle can go down");
-				this.add(inclineDownLabel);
-
-				inclineDownTextField = new JTextField();
-
-				String vehiclePropertyString =
-					initialParameters.getVehiclePropertyString(MAX_INCLINE_DOWN);
-				if (vehiclePropertyString != null) {
-					inclineDownTextField.setText(vehiclePropertyString);
-				}
-				inclineDownTextField.setToolTipText("maximum incline the vehicle can go down");
-
-				this.add(inclineDownTextField);
-			}
-
-			/* surface */
-			{
-				JLabel surfaceLabel = new JLabel("surface blacklist");
-				surfaceLabel.setToolTipText("list of surfaces the vehicle cannot use, "
-						+ "values are separated by semicolons (;)");
-				this.add(surfaceLabel);
-
-				surfaceTextField = new JTextField();
-
-				String vehiclePropertyString =
-					initialParameters.getVehiclePropertyString(SURFACE_BLACKLIST);
-
-				if (vehiclePropertyString != null) {
-					surfaceTextField.setText(vehiclePropertyString);
-				}
-
-				surfaceTextField.setToolTipText("list of surfaces the vehicle cannot use, "
-						+ "values are separated by semicolons (;)");
-
-				this.add(surfaceTextField);
-			}
-
-			/* tracktype */
-			{
-				JLabel tracktypeLabel = new JLabel("max. tracktype grade");
-				tracktypeLabel.setToolTipText("worst tracktype (1-5) the vehicle can still use,"
-						+ " 0 for none");
-				this.add(tracktypeLabel);
-
-				tracktypeTextField = new JTextField();
-
-				String vehiclePropertyString =
-					initialParameters.getVehiclePropertyString(MAX_TRACKTYPE);
-				if (vehiclePropertyString != null) {
-					tracktypeTextField.setText(vehiclePropertyString);
-				}
-				tracktypeTextField.setToolTipText("worst tracktype (1-5) the vehicle can still use,"
-						+ " 0 for none");
-
-				this.add(tracktypeTextField);
-			}
-
-		}
-
-		public Map<VehiclePropertyType<?>, String> getVehiclePropertyStrings() {
-
-			Map<VehiclePropertyType<?>, String> vehiclePropertyStrings =
-				new HashMap<VehiclePropertyType<?>, String>();
-
-			String incUpString = inclineUpTextField.getText();
-			if (incUpString.trim().length() > 0) {
-				vehiclePropertyStrings.put(MAX_INCLINE_UP, incUpString);
-			}
-
-			String incDownString = inclineDownTextField.getText();
-			if (incDownString.trim().length() > 0) {
-				vehiclePropertyStrings.put(MAX_INCLINE_DOWN, incDownString);
-			}
-
-			String surfaceString = surfaceTextField.getText();
-			if (surfaceString.trim().length() > 0) {
-				vehiclePropertyStrings.put(SURFACE_BLACKLIST, surfaceString);
-			}
-
-			String tracktypeString = tracktypeTextField.getText();
-			if (tracktypeString.trim().length() > 0) {
-				vehiclePropertyStrings.put(MAX_TRACKTYPE, tracktypeString);
-			}
-
-			return vehiclePropertyStrings;
-		}
-	}
-
-	private class OkCancelPanel extends JPanel {
-
-		public OkCancelPanel() {
-
-			new BoxLayout(this, BoxLayout.X_AXIS);
-
-			JButton okButton = new JButton(existingBookmark?"Change bookmark":"Create bookmark");
-			okButton.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					String bookmarkName = bookmarkNamePanel.getBookmarkName();
-					if (bookmarkName != null) {
-						PreferenceAccessParameters parameters = getAccessParameters();
-						if (parameters != null) {
-							okAction.execute(bookmarkName, parameters);
-							AccessParameterDialog.this.dispose();
-						}
-					}
-				}
-			});
-			this.add(okButton);
-
-			JButton cancelButton = new JButton("Cancel");
-			cancelButton.addActionListener(new ActionListener() {
-				public void actionPerformed(ActionEvent e) {
-					AccessParameterDialog.this.dispose();
-				}
-			});
-			this.add(cancelButton);
-
-		}
-
-	}
-
-	private boolean existingBookmark = false;
-	private final Collection<String> existingBookmarkNames;
-
-	private final BookmarkAction okAction;
-
-	private final BookmarkNamePanel bookmarkNamePanel;
-	private final AccessClassPanel accessClassPanel;
-	private final AccessTypesPanel accessTypesPanel;
-	private final VehiclePropertiesPanel vehiclePropertiesPanel;
-	private final RoadQualityPanel roadQualityPanel;
-
-	public AccessParameterDialog(final Frame owner, boolean existingBookmark, String initialName,
-			Collection<String> existingBookmarkNames,
-			PreferenceAccessParameters initialAccessParameters, BookmarkAction okAction) {
-		super(owner, "edit access parameters", true);
-
-		this.existingBookmark = existingBookmark;
-		this.existingBookmarkNames = existingBookmarkNames;
-		this.okAction = okAction;
-
-		GridBagLayout layout = new GridBagLayout();
-		this.setLayout(layout);
-
-		GridBagConstraints gbc = new GridBagConstraints();
-		gbc.gridx = 0;
-		gbc.weighty = 1;
-		gbc.fill = GridBagConstraints.BOTH;
-
-		bookmarkNamePanel = new BookmarkNamePanel(initialName);
-		gbc.gridy = 0;
-		layout.setConstraints(bookmarkNamePanel, gbc);
-		this.add(bookmarkNamePanel);
-
-		accessClassPanel = new AccessClassPanel(initialAccessParameters);
-		gbc.gridy = 1;
-		layout.setConstraints(accessClassPanel, gbc);
-		this.add(accessClassPanel);
-
-		accessTypesPanel = new AccessTypesPanel(initialAccessParameters);
-		gbc.gridy = 2;
-		layout.setConstraints(accessTypesPanel, gbc);
-		this.add(accessTypesPanel);
-
-		vehiclePropertiesPanel = new VehiclePropertiesPanel(initialAccessParameters);
-		gbc.gridy = 3;
-		layout.setConstraints(vehiclePropertiesPanel, gbc);
-		this.add(vehiclePropertiesPanel);
-
-		roadQualityPanel = new RoadQualityPanel(initialAccessParameters);
-		gbc.gridy = 4;
-		layout.setConstraints(roadQualityPanel, gbc);
-		this.add(roadQualityPanel);
-
-		JPanel okCancelPanel = new OkCancelPanel();
-		gbc.gridy = 5;
-		gbc.weighty = 0;
-		gbc.fill = GridBagConstraints.HORIZONTAL;
-		layout.setConstraints(okCancelPanel, gbc);
-		this.add(okCancelPanel);
-
-		this.pack();
-	}
-
-	private PreferenceAccessParameters getAccessParameters() {
-
-		String accessClass = accessClassPanel.getAccessClass();
-		Collection<AccessType> usableAccessTypes = accessTypesPanel.getUsableAccessTypes();
-		Map<VehiclePropertyType<?>, String> vehiclePropertyStrings =
-			vehiclePropertiesPanel.getVehiclePropertyStrings();
-		Map<VehiclePropertyType<?>, String> additionalVehiclePropertyStrings =
-			roadQualityPanel.getVehiclePropertyStrings();
-
-		if (accessClass != null && usableAccessTypes != null && vehiclePropertyStrings != null
-				&& additionalVehiclePropertyStrings != null) {
-
-			vehiclePropertyStrings.putAll(additionalVehiclePropertyStrings);
-
-			try {
-				return new PreferenceAccessParameters(accessClass, usableAccessTypes, vehiclePropertyStrings);
-			} catch (PropertyValueSyntaxException e) {
-				JOptionPane.showMessageDialog(this, e.getMessage());
-				return null;
-			}
-
-		} else {
-			return null;
-		}
-	}
+    public static interface BookmarkAction {
+        public void execute(String name, PreferenceAccessParameters parameters);
+    }
+
+    /**
+     * map that contains all float value vehicle properties (as those can be treated uniformly)
+     * and their labels
+     */
+    private static final Map<VehiclePropertyType<Float>, String> FLOAT_PROPERTIES;
+
+    static {
+        FLOAT_PROPERTIES = new LinkedHashMap<VehiclePropertyType<Float>, String>();
+        FLOAT_PROPERTIES.put(VehiclePropertyTypes.HEIGHT, "height (m)");
+        FLOAT_PROPERTIES.put(VehiclePropertyTypes.WIDTH, "width (m)");
+        FLOAT_PROPERTIES.put(VehiclePropertyTypes.LENGTH, "length (m)");
+        FLOAT_PROPERTIES.put(VehiclePropertyTypes.SPEED, "speed (km/h)");
+        FLOAT_PROPERTIES.put(VehiclePropertyTypes.WEIGHT, "weight (t)");
+        FLOAT_PROPERTIES.put(VehiclePropertyTypes.AXLELOAD, "axleload (t)");
+    }
+
+    private static final Collection<Character> FORBIDDEN_CHARS =
+        Arrays.asList(',', ';', '{', '}', '=', '|');
+
+    private class BookmarkNamePanel extends JPanel {
+
+        private final JTextField bookmarkNameTextField;
+
+        public BookmarkNamePanel(String initialName) {
+            super();
+            this.setBorder(BorderFactory.createTitledBorder("bookmark name"));
+
+            this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
+
+            bookmarkNameTextField = new JTextField(initialName);
+            this.add(bookmarkNameTextField);
+
+        }
+
+        public String getBookmarkName() {
+
+            String name = bookmarkNameTextField.getText();
+
+            if (existingBookmarkNames.contains(name)) {
+                JOptionPane.showMessageDialog(this, "Bookmark name already exists!");
+                return null;
+            }
+
+            for (char nameChar : name.toCharArray()) {
+                if (FORBIDDEN_CHARS.contains(nameChar)) {
+                    JOptionPane.showMessageDialog(this, "Bookmark name must not contain '" +
+                            nameChar + "'!");
+                    return null;
+                }
+            }
+
+            return name;
+        }
+    }
+
+    private static class AccessClassPanel extends JPanel {
+
+        private final JTextField accessClassTextField;
+
+        public AccessClassPanel(PreferenceAccessParameters initialParameters) {
+            super();
+            this.setBorder(BorderFactory.createTitledBorder("access class"));
+
+            this.setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
+
+            accessClassTextField = new JTextField(initialParameters.getAccessClass());
+            this.add(accessClassTextField);
+
+        }
+
+        public String getAccessClass() {
+
+            String name = accessClassTextField.getText();
+
+            for (char nameChar : name.toCharArray()) {
+                if (FORBIDDEN_CHARS.contains(nameChar)) {
+                    JOptionPane.showMessageDialog(this, "Access class must not contain '" +
+                            nameChar + "'!");
+                    return null;
+                }
+            }
+
+            return name;
+        }
+    }
+
+    private static class AccessTypesPanel extends JPanel {
+
+        private static final int COLS = 4;
+
+        private final Map<AccessType, JCheckBox> accessTypeCheckBoxes =
+            new EnumMap<AccessType, JCheckBox>(AccessType.class);
+
+        public AccessTypesPanel(PreferenceAccessParameters initialParameters) {
+            super();
+            this.setBorder(BorderFactory.createTitledBorder("access types"));
+
+            this.setLayout(
+                    new GridLayout(((COLS-1 + AccessType.values().length) / COLS), COLS));
+
+            for (AccessType accessType : AccessType.values()) {
+                JCheckBox checkBox = new JCheckBox(accessType.toString());
+                checkBox.setSelected(initialParameters.getAccessTypeUsable(accessType));
+                accessTypeCheckBoxes.put(accessType, checkBox);
+                this.add(checkBox);
+            }
+
+        }
+
+        public Collection<AccessType> getUsableAccessTypes() {
+
+            Collection<AccessType> usableAccessTypes = new LinkedList<AccessType>();
+
+            for (AccessType accessType : AccessType.values()) {
+                if (accessTypeCheckBoxes.get(accessType).isSelected()) {
+                    usableAccessTypes.add(accessType);
+                }
+            }
+
+            return usableAccessTypes;
+        }
+    }
+
+    private static class VehiclePropertiesPanel extends JPanel {
+
+        private static final int COLS = 2;
+
+        private final Map<VehiclePropertyType<Float>, JTextField> floatPropertyTextFields =
+            new HashMap<VehiclePropertyType<Float>, JTextField>();
+
+        public VehiclePropertiesPanel(PreferenceAccessParameters initialParameters) {
+            super();
+            this.setBorder(BorderFactory.createTitledBorder("vehicle properties"));
+
+            this.setLayout(new GridLayout(((COLS-1 + FLOAT_PROPERTIES.size()) / COLS),
+                    2*COLS));
+
+            for (VehiclePropertyType<Float> vehicleProperty : FLOAT_PROPERTIES.keySet()) {
+
+                JLabel label = new JLabel(FLOAT_PROPERTIES.get(vehicleProperty));
+                this.add(label);
+
+                JTextField textField = new JTextField();
+
+                String vehiclePropertyString =
+                    initialParameters.getVehiclePropertyString(vehicleProperty);
+                if (vehiclePropertyString != null) {
+                    textField.setText(vehiclePropertyString);
+                }
+
+                floatPropertyTextFields.put(vehicleProperty, textField);
+                this.add(textField);
+            }
+
+        }
+
+        public Map<VehiclePropertyType<?>, String> getVehiclePropertyStrings() {
+
+            Map<VehiclePropertyType<?>, String> vehiclePropertyStrings =
+                new HashMap<VehiclePropertyType<?>, String>();
+
+            for (VehiclePropertyType<Float> vehicleProperty : floatPropertyTextFields.keySet()) {
+                String textFieldContent = floatPropertyTextFields.get(vehicleProperty).getText();
+                if (textFieldContent.trim().length() > 0) {
+                    vehiclePropertyStrings.put(vehicleProperty, textFieldContent);
+                }
+            }
+
+            return vehiclePropertyStrings;
+        }
+    }
+
+    private static class RoadQualityPanel extends JPanel {
+
+        private JTextField inclineUpTextField;
+        private JTextField inclineDownTextField;
+        private JTextField surfaceTextField;
+        private JTextField tracktypeTextField;
+
+        public RoadQualityPanel(PreferenceAccessParameters initialParameters) {
+            super();
+            this.setBorder(BorderFactory.createTitledBorder("road requirements"));
+
+
+            this.setLayout(new GridLayout(4, 2));
+
+            /* incline up */
+            {
+                JLabel inclineUpLabel = new JLabel("max. incline up (%, pos.)");
+                inclineUpLabel.setToolTipText("maximum incline the vehicle can go up");
+                this.add(inclineUpLabel);
+
+                inclineUpTextField = new JTextField();
+
+                String vehiclePropertyString =
+                    initialParameters.getVehiclePropertyString(MAX_INCLINE_UP);
+                if (vehiclePropertyString != null) {
+                    inclineUpTextField.setText(vehiclePropertyString);
+                }
+                inclineUpTextField.setToolTipText("maximum incline the vehicle can go up");
+
+                this.add(inclineUpTextField);
+            }
+
+            /* incline down */
+            {
+                JLabel inclineDownLabel = new JLabel("max. incline down (%, pos.)");
+                inclineDownLabel.setToolTipText("maximum incline the vehicle can go down");
+                this.add(inclineDownLabel);
+
+                inclineDownTextField = new JTextField();
+
+                String vehiclePropertyString =
+                    initialParameters.getVehiclePropertyString(MAX_INCLINE_DOWN);
+                if (vehiclePropertyString != null) {
+                    inclineDownTextField.setText(vehiclePropertyString);
+                }
+                inclineDownTextField.setToolTipText("maximum incline the vehicle can go down");
+
+                this.add(inclineDownTextField);
+            }
+
+            /* surface */
+            {
+                JLabel surfaceLabel = new JLabel("surface blacklist");
+                surfaceLabel.setToolTipText("list of surfaces the vehicle cannot use, "
+                        + "values are separated by semicolons (;)");
+                this.add(surfaceLabel);
+
+                surfaceTextField = new JTextField();
+
+                String vehiclePropertyString =
+                    initialParameters.getVehiclePropertyString(SURFACE_BLACKLIST);
+
+                if (vehiclePropertyString != null) {
+                    surfaceTextField.setText(vehiclePropertyString);
+                }
+
+                surfaceTextField.setToolTipText("list of surfaces the vehicle cannot use, "
+                        + "values are separated by semicolons (;)");
+
+                this.add(surfaceTextField);
+            }
+
+            /* tracktype */
+            {
+                JLabel tracktypeLabel = new JLabel("max. tracktype grade");
+                tracktypeLabel.setToolTipText("worst tracktype (1-5) the vehicle can still use,"
+                        + " 0 for none");
+                this.add(tracktypeLabel);
+
+                tracktypeTextField = new JTextField();
+
+                String vehiclePropertyString =
+                    initialParameters.getVehiclePropertyString(MAX_TRACKTYPE);
+                if (vehiclePropertyString != null) {
+                    tracktypeTextField.setText(vehiclePropertyString);
+                }
+                tracktypeTextField.setToolTipText("worst tracktype (1-5) the vehicle can still use,"
+                        + " 0 for none");
+
+                this.add(tracktypeTextField);
+            }
+
+        }
+
+        public Map<VehiclePropertyType<?>, String> getVehiclePropertyStrings() {
+
+            Map<VehiclePropertyType<?>, String> vehiclePropertyStrings =
+                new HashMap<VehiclePropertyType<?>, String>();
+
+            String incUpString = inclineUpTextField.getText();
+            if (incUpString.trim().length() > 0) {
+                vehiclePropertyStrings.put(MAX_INCLINE_UP, incUpString);
+            }
+
+            String incDownString = inclineDownTextField.getText();
+            if (incDownString.trim().length() > 0) {
+                vehiclePropertyStrings.put(MAX_INCLINE_DOWN, incDownString);
+            }
+
+            String surfaceString = surfaceTextField.getText();
+            if (surfaceString.trim().length() > 0) {
+                vehiclePropertyStrings.put(SURFACE_BLACKLIST, surfaceString);
+            }
+
+            String tracktypeString = tracktypeTextField.getText();
+            if (tracktypeString.trim().length() > 0) {
+                vehiclePropertyStrings.put(MAX_TRACKTYPE, tracktypeString);
+            }
+
+            return vehiclePropertyStrings;
+        }
+    }
+
+    private class OkCancelPanel extends JPanel {
+
+        public OkCancelPanel() {
+
+            new BoxLayout(this, BoxLayout.X_AXIS);
+
+            JButton okButton = new JButton(existingBookmark?"Change bookmark":"Create bookmark");
+            okButton.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    String bookmarkName = bookmarkNamePanel.getBookmarkName();
+                    if (bookmarkName != null) {
+                        PreferenceAccessParameters parameters = getAccessParameters();
+                        if (parameters != null) {
+                            okAction.execute(bookmarkName, parameters);
+                            AccessParameterDialog.this.dispose();
+                        }
+                    }
+                }
+            });
+            this.add(okButton);
+
+            JButton cancelButton = new JButton("Cancel");
+            cancelButton.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    AccessParameterDialog.this.dispose();
+                }
+            });
+            this.add(cancelButton);
+
+        }
+
+    }
+
+    private boolean existingBookmark = false;
+    private final Collection<String> existingBookmarkNames;
+
+    private final BookmarkAction okAction;
+
+    private final BookmarkNamePanel bookmarkNamePanel;
+    private final AccessClassPanel accessClassPanel;
+    private final AccessTypesPanel accessTypesPanel;
+    private final VehiclePropertiesPanel vehiclePropertiesPanel;
+    private final RoadQualityPanel roadQualityPanel;
+
+    public AccessParameterDialog(final Frame owner, boolean existingBookmark, String initialName,
+            Collection<String> existingBookmarkNames,
+            PreferenceAccessParameters initialAccessParameters, BookmarkAction okAction) {
+        super(owner, "edit access parameters", true);
+
+        this.existingBookmark = existingBookmark;
+        this.existingBookmarkNames = existingBookmarkNames;
+        this.okAction = okAction;
+
+        GridBagLayout layout = new GridBagLayout();
+        this.setLayout(layout);
+
+        GridBagConstraints gbc = new GridBagConstraints();
+        gbc.gridx = 0;
+        gbc.weighty = 1;
+        gbc.fill = GridBagConstraints.BOTH;
+
+        bookmarkNamePanel = new BookmarkNamePanel(initialName);
+        gbc.gridy = 0;
+        layout.setConstraints(bookmarkNamePanel, gbc);
+        this.add(bookmarkNamePanel);
+
+        accessClassPanel = new AccessClassPanel(initialAccessParameters);
+        gbc.gridy = 1;
+        layout.setConstraints(accessClassPanel, gbc);
+        this.add(accessClassPanel);
+
+        accessTypesPanel = new AccessTypesPanel(initialAccessParameters);
+        gbc.gridy = 2;
+        layout.setConstraints(accessTypesPanel, gbc);
+        this.add(accessTypesPanel);
+
+        vehiclePropertiesPanel = new VehiclePropertiesPanel(initialAccessParameters);
+        gbc.gridy = 3;
+        layout.setConstraints(vehiclePropertiesPanel, gbc);
+        this.add(vehiclePropertiesPanel);
+
+        roadQualityPanel = new RoadQualityPanel(initialAccessParameters);
+        gbc.gridy = 4;
+        layout.setConstraints(roadQualityPanel, gbc);
+        this.add(roadQualityPanel);
+
+        JPanel okCancelPanel = new OkCancelPanel();
+        gbc.gridy = 5;
+        gbc.weighty = 0;
+        gbc.fill = GridBagConstraints.HORIZONTAL;
+        layout.setConstraints(okCancelPanel, gbc);
+        this.add(okCancelPanel);
+
+        this.pack();
+    }
+
+    private PreferenceAccessParameters getAccessParameters() {
+
+        String accessClass = accessClassPanel.getAccessClass();
+        Collection<AccessType> usableAccessTypes = accessTypesPanel.getUsableAccessTypes();
+        Map<VehiclePropertyType<?>, String> vehiclePropertyStrings =
+            vehiclePropertiesPanel.getVehiclePropertyStrings();
+        Map<VehiclePropertyType<?>, String> additionalVehiclePropertyStrings =
+            roadQualityPanel.getVehiclePropertyStrings();
+
+        if (accessClass != null && usableAccessTypes != null && vehiclePropertyStrings != null
+                && additionalVehiclePropertyStrings != null) {
+
+            vehiclePropertyStrings.putAll(additionalVehiclePropertyStrings);
+
+            try {
+                return new PreferenceAccessParameters(accessClass, usableAccessTypes, vehiclePropertyStrings);
+            } catch (PropertyValueSyntaxException e) {
+                JOptionPane.showMessageDialog(this, e.getMessage());
+                return null;
+            }
+
+        } else {
+            return null;
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewDialog.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewDialog.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewDialog.java	(revision 23189)
@@ -44,251 +44,251 @@
 public class GraphViewDialog extends ToggleDialog implements Observer {
 
-	private static final int HEIGHT = 150;
-
-	/** map from labels to available color schemes */
-	private final LinkedHashMap<String, ColorScheme> availableColorSchemes;
-
-
-	private final GraphViewPreferences preferences;
-	private final GraphViewPlugin plugin;
-
-	private final JComboBox rulesetComboBox;
-	private final JComboBox bookmarkComboBox;
-	private final JComboBox colorSchemeComboBox;
-
-	/**
-	 * list of ruleset files in the order currently used by rulesetComboBox;
-	 * null if internal rulesets are used
-	 */
-	private List<File> rulesetFiles;
-
-	public GraphViewDialog(final GraphViewPlugin plugin) {
-
-		super("Graph View Dialog", "graphview",
-				"Open the dialog for graph view configuration.", (Shortcut)null, HEIGHT);
-
-		this.preferences = GraphViewPreferences.getInstance();
-		this.plugin = plugin;
-
-		availableColorSchemes = new LinkedHashMap<String, ColorScheme>();
-
-		availableColorSchemes.put("default",
-				new PreferencesColorScheme(preferences));
-		availableColorSchemes.put("end nodes",
-				new EndNodeColorScheme(Color.GRAY, Color.RED, Color.GRAY));
-		availableColorSchemes.put("maxspeed",
-				new MaxspeedColorScheme());
-		availableColorSchemes.put("maxweight",
-				new MaxweightColorScheme());
-		availableColorSchemes.put("maxheight",
-				new MaxheightColorScheme());
-		availableColorSchemes.put("incline",
-				new InclineColorScheme());
-
-		JPanel selectionPanel = new JPanel();
-		GridBagLayout selectionLayout = new GridBagLayout();
-		selectionPanel.setLayout(selectionLayout);
-
-		GridBagConstraints gbcLabel = new GridBagConstraints();
-		gbcLabel.gridx = 0;
-		gbcLabel.anchor = GridBagConstraints.WEST;
-		gbcLabel.insets = new Insets(0, 5, 0, 5);
-
-		GridBagConstraints gbcComboBox = new GridBagConstraints();
-		gbcComboBox.gridx = 1;
-		gbcComboBox.fill = GridBagConstraints.HORIZONTAL;
-		gbcComboBox.weightx = 1;
-
-
-		/* create ruleset label and combo box */
-		{
-			JLabel rulesetLabel = new JLabel("ruleset:");
-			gbcLabel.gridy = 0;
-			selectionLayout.setConstraints(rulesetLabel, gbcLabel);
-			selectionPanel.add(rulesetLabel);
-
-			rulesetComboBox = new JComboBox();
-			rulesetComboBox.addActionListener(rulesetActionListener);
-			gbcComboBox.gridy = 0;
-			selectionLayout.setConstraints(rulesetComboBox, gbcComboBox);
-			selectionPanel.add(rulesetComboBox);
-		}
-
-		/* create bookmark label and combo box */
-		{
-			JLabel bookmarkLabel = new JLabel("parameters:");
-			gbcLabel.gridy = 1;
-			selectionLayout.setConstraints(bookmarkLabel, gbcLabel);
-			selectionPanel.add(bookmarkLabel);
-
-			bookmarkComboBox = new JComboBox();
-			bookmarkComboBox.addActionListener(bookmarkActionListener);
-			gbcComboBox.gridy = 1;
-			selectionLayout.setConstraints(bookmarkComboBox, gbcComboBox);
-			selectionPanel.add(bookmarkComboBox);
-		}
-
-		/* create color scheme label and combo box */
-		{
-			JLabel colorSchemeLabel = new JLabel("coloring:");
-			gbcLabel.gridy = 2;
-			selectionLayout.setConstraints(colorSchemeLabel, gbcLabel);
-			selectionPanel.add(colorSchemeLabel);
-
-			colorSchemeComboBox = new JComboBox();
-			for (String colorSchemeName : availableColorSchemes.keySet()) {
-				colorSchemeComboBox.addItem(colorSchemeName);
-				ColorScheme colorScheme = availableColorSchemes.get(colorSchemeName);
-				if (colorScheme.getClass().equals(preferences.getCurrentColorScheme().getClass())) {
-					colorSchemeComboBox.setSelectedItem(colorSchemeName);
-				}
-			}
-			colorSchemeComboBox.addActionListener(colorSchemeActionListener);
-			gbcComboBox.gridy = 2;
-			selectionLayout.setConstraints(colorSchemeComboBox, gbcComboBox);
-			selectionPanel.add(colorSchemeComboBox);
-		}
-
-		this.add(BorderLayout.CENTER, selectionPanel);
-
-
-		JPanel buttonPanel = new JPanel();
-		JButton showLayerButton = new JButton("create/update graph");
-		showLayerButton.addActionListener(new ActionListener() {
-			public void actionPerformed(ActionEvent e) {
-				plugin.createGraphViewLayer();
-			}
-		});
-		buttonPanel.add(showLayerButton);
-
-		this.add(BorderLayout.SOUTH, buttonPanel);
-
-		updateSelections();
-		this.preferences.addObserver(this);
-
-	}
-
-	private final ActionListener rulesetActionListener = new ActionListener() {
-		public void actionPerformed(ActionEvent e) {
-			if (rulesetComboBox.getSelectedItem() != null) {
-				int selectedRulesetIndex = rulesetComboBox.getSelectedIndex();
-				if (rulesetFiles != null) {
-					File selectedRulesetFile = rulesetFiles.get(selectedRulesetIndex);
-					preferences.setCurrentRulesetFile(selectedRulesetFile);
-					preferences.distributeChanges();
-					plugin.updateGraphViewLayer();
-				} else {
-					if (selectedRulesetIndex < InternalRuleset.values().length) {
-						InternalRuleset selectedIRR = InternalRuleset.values()[selectedRulesetIndex];
-						preferences.setCurrentInternalRuleset(selectedIRR);
-						preferences.distributeChanges();
-						plugin.updateGraphViewLayer();
-					}
-				}
-			}
-		}
-	};
-
-	private final ActionListener bookmarkActionListener = new ActionListener() {
-		public void actionPerformed(ActionEvent e) {
-			String selectedBookmarkName = (String)bookmarkComboBox.getSelectedItem();
-			if (selectedBookmarkName != null) {
-				preferences.setCurrentParameterBookmarkName(selectedBookmarkName);
-				preferences.distributeChanges();
-				plugin.updateGraphViewLayer();
-			}
-		}
-	};
-
-	private final ActionListener colorSchemeActionListener = new ActionListener() {
-		public void actionPerformed(ActionEvent e) {
-			assert availableColorSchemes.containsKey(colorSchemeComboBox.getSelectedItem());
-			String colorSchemeLabel = (String)colorSchemeComboBox.getSelectedItem();
-			preferences.setCurrentColorScheme(availableColorSchemes.get(colorSchemeLabel));
-			preferences.distributeChanges();
-			plugin.repaintGraphViewLayer();
-		}
-	};
-
-	public void update(Observable observable, Object param) {
-		if (observable == preferences) {
-			updateSelections();
-		}
-	}
-
-	protected void updateSelections() {
-
-		/* update rulesets */
-
-		rulesetComboBox.removeActionListener(rulesetActionListener);
-
-		if (preferences.getUseInternalRulesets()) {
-
-			rulesetFiles = null;
-
-			rulesetComboBox.removeAllItems();
-			for (int i=0; i < InternalRuleset.values().length; i++) {
-				InternalRuleset ruleset = InternalRuleset.values()[i];
-				rulesetComboBox.addItem(ruleset.toString());
-				if (ruleset == preferences.getCurrentInternalRuleset()) {
-					rulesetComboBox.setSelectedIndex(i);
-				}
-			}
-
-			if (preferences.getCurrentInternalRuleset() == null) {
-				rulesetComboBox.addItem("");
-				rulesetComboBox.setSelectedIndex(InternalRuleset.values().length);
-			}
-
-		} else {
-
-			rulesetFiles = new LinkedList<File>();
-
-			File[] filesInRulesetFolder = preferences.getRulesetFolder().listFiles();
-
-			if (filesInRulesetFolder != null) {
-				for (File possibleRulesetFile : filesInRulesetFolder) {
-					try {
-						AccessRulesetReader.readAccessRuleset(new FileInputStream(possibleRulesetFile));
-						rulesetFiles.add(possibleRulesetFile);
-					} catch (IOException ioe) {
-						//don't add to rulesetFiles
-					}
-				}
-			}
-
-			Collections.sort(rulesetFiles);
-
-			rulesetComboBox.removeAllItems();
-			for (int i=0; i < rulesetFiles.size(); i++) {
-				File rulesetFile = rulesetFiles.get(i);
-				rulesetComboBox.addItem(rulesetFile.getName());
-				if (rulesetFile.equals(preferences.getCurrentRulesetFile())) {
-					rulesetComboBox.setSelectedIndex(i);
-				}
-			}
-
-		}
-
-		rulesetComboBox.addActionListener(rulesetActionListener);
-
-		/* update bookmarks */
-
-		bookmarkComboBox.removeActionListener(bookmarkActionListener);
-
-		String activeBookmarkName = preferences.getCurrentParameterBookmarkName();
-		Set<String> bookmarkNames = new HashSet<String>(preferences.getParameterBookmarks().keySet());
-
-		bookmarkComboBox.removeAllItems();
-		for (String bookmarkName : bookmarkNames) {
-			bookmarkComboBox.addItem(bookmarkName);
-			if (bookmarkName.equals(activeBookmarkName)) {
-				bookmarkComboBox.setSelectedItem(bookmarkName);
-			}
-		}
-
-		bookmarkComboBox.addActionListener(bookmarkActionListener);
-
-	}
+    private static final int HEIGHT = 150;
+
+    /** map from labels to available color schemes */
+    private final LinkedHashMap<String, ColorScheme> availableColorSchemes;
+
+
+    private final GraphViewPreferences preferences;
+    private final GraphViewPlugin plugin;
+
+    private final JComboBox rulesetComboBox;
+    private final JComboBox bookmarkComboBox;
+    private final JComboBox colorSchemeComboBox;
+
+    /**
+     * list of ruleset files in the order currently used by rulesetComboBox;
+     * null if internal rulesets are used
+     */
+    private List<File> rulesetFiles;
+
+    public GraphViewDialog(final GraphViewPlugin plugin) {
+
+        super("Graph View Dialog", "graphview",
+                "Open the dialog for graph view configuration.", (Shortcut)null, HEIGHT);
+
+        this.preferences = GraphViewPreferences.getInstance();
+        this.plugin = plugin;
+
+        availableColorSchemes = new LinkedHashMap<String, ColorScheme>();
+
+        availableColorSchemes.put("default",
+                new PreferencesColorScheme(preferences));
+        availableColorSchemes.put("end nodes",
+                new EndNodeColorScheme(Color.GRAY, Color.RED, Color.GRAY));
+        availableColorSchemes.put("maxspeed",
+                new MaxspeedColorScheme());
+        availableColorSchemes.put("maxweight",
+                new MaxweightColorScheme());
+        availableColorSchemes.put("maxheight",
+                new MaxheightColorScheme());
+        availableColorSchemes.put("incline",
+                new InclineColorScheme());
+
+        JPanel selectionPanel = new JPanel();
+        GridBagLayout selectionLayout = new GridBagLayout();
+        selectionPanel.setLayout(selectionLayout);
+
+        GridBagConstraints gbcLabel = new GridBagConstraints();
+        gbcLabel.gridx = 0;
+        gbcLabel.anchor = GridBagConstraints.WEST;
+        gbcLabel.insets = new Insets(0, 5, 0, 5);
+
+        GridBagConstraints gbcComboBox = new GridBagConstraints();
+        gbcComboBox.gridx = 1;
+        gbcComboBox.fill = GridBagConstraints.HORIZONTAL;
+        gbcComboBox.weightx = 1;
+
+
+        /* create ruleset label and combo box */
+        {
+            JLabel rulesetLabel = new JLabel("ruleset:");
+            gbcLabel.gridy = 0;
+            selectionLayout.setConstraints(rulesetLabel, gbcLabel);
+            selectionPanel.add(rulesetLabel);
+
+            rulesetComboBox = new JComboBox();
+            rulesetComboBox.addActionListener(rulesetActionListener);
+            gbcComboBox.gridy = 0;
+            selectionLayout.setConstraints(rulesetComboBox, gbcComboBox);
+            selectionPanel.add(rulesetComboBox);
+        }
+
+        /* create bookmark label and combo box */
+        {
+            JLabel bookmarkLabel = new JLabel("parameters:");
+            gbcLabel.gridy = 1;
+            selectionLayout.setConstraints(bookmarkLabel, gbcLabel);
+            selectionPanel.add(bookmarkLabel);
+
+            bookmarkComboBox = new JComboBox();
+            bookmarkComboBox.addActionListener(bookmarkActionListener);
+            gbcComboBox.gridy = 1;
+            selectionLayout.setConstraints(bookmarkComboBox, gbcComboBox);
+            selectionPanel.add(bookmarkComboBox);
+        }
+
+        /* create color scheme label and combo box */
+        {
+            JLabel colorSchemeLabel = new JLabel("coloring:");
+            gbcLabel.gridy = 2;
+            selectionLayout.setConstraints(colorSchemeLabel, gbcLabel);
+            selectionPanel.add(colorSchemeLabel);
+
+            colorSchemeComboBox = new JComboBox();
+            for (String colorSchemeName : availableColorSchemes.keySet()) {
+                colorSchemeComboBox.addItem(colorSchemeName);
+                ColorScheme colorScheme = availableColorSchemes.get(colorSchemeName);
+                if (colorScheme.getClass().equals(preferences.getCurrentColorScheme().getClass())) {
+                    colorSchemeComboBox.setSelectedItem(colorSchemeName);
+                }
+            }
+            colorSchemeComboBox.addActionListener(colorSchemeActionListener);
+            gbcComboBox.gridy = 2;
+            selectionLayout.setConstraints(colorSchemeComboBox, gbcComboBox);
+            selectionPanel.add(colorSchemeComboBox);
+        }
+
+        this.add(BorderLayout.CENTER, selectionPanel);
+
+
+        JPanel buttonPanel = new JPanel();
+        JButton showLayerButton = new JButton("create/update graph");
+        showLayerButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                plugin.createGraphViewLayer();
+            }
+        });
+        buttonPanel.add(showLayerButton);
+
+        this.add(BorderLayout.SOUTH, buttonPanel);
+
+        updateSelections();
+        this.preferences.addObserver(this);
+
+    }
+
+    private final ActionListener rulesetActionListener = new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+            if (rulesetComboBox.getSelectedItem() != null) {
+                int selectedRulesetIndex = rulesetComboBox.getSelectedIndex();
+                if (rulesetFiles != null) {
+                    File selectedRulesetFile = rulesetFiles.get(selectedRulesetIndex);
+                    preferences.setCurrentRulesetFile(selectedRulesetFile);
+                    preferences.distributeChanges();
+                    plugin.updateGraphViewLayer();
+                } else {
+                    if (selectedRulesetIndex < InternalRuleset.values().length) {
+                        InternalRuleset selectedIRR = InternalRuleset.values()[selectedRulesetIndex];
+                        preferences.setCurrentInternalRuleset(selectedIRR);
+                        preferences.distributeChanges();
+                        plugin.updateGraphViewLayer();
+                    }
+                }
+            }
+        }
+    };
+
+    private final ActionListener bookmarkActionListener = new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+            String selectedBookmarkName = (String)bookmarkComboBox.getSelectedItem();
+            if (selectedBookmarkName != null) {
+                preferences.setCurrentParameterBookmarkName(selectedBookmarkName);
+                preferences.distributeChanges();
+                plugin.updateGraphViewLayer();
+            }
+        }
+    };
+
+    private final ActionListener colorSchemeActionListener = new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+            assert availableColorSchemes.containsKey(colorSchemeComboBox.getSelectedItem());
+            String colorSchemeLabel = (String)colorSchemeComboBox.getSelectedItem();
+            preferences.setCurrentColorScheme(availableColorSchemes.get(colorSchemeLabel));
+            preferences.distributeChanges();
+            plugin.repaintGraphViewLayer();
+        }
+    };
+
+    public void update(Observable observable, Object param) {
+        if (observable == preferences) {
+            updateSelections();
+        }
+    }
+
+    protected void updateSelections() {
+
+        /* update rulesets */
+
+        rulesetComboBox.removeActionListener(rulesetActionListener);
+
+        if (preferences.getUseInternalRulesets()) {
+
+            rulesetFiles = null;
+
+            rulesetComboBox.removeAllItems();
+            for (int i=0; i < InternalRuleset.values().length; i++) {
+                InternalRuleset ruleset = InternalRuleset.values()[i];
+                rulesetComboBox.addItem(ruleset.toString());
+                if (ruleset == preferences.getCurrentInternalRuleset()) {
+                    rulesetComboBox.setSelectedIndex(i);
+                }
+            }
+
+            if (preferences.getCurrentInternalRuleset() == null) {
+                rulesetComboBox.addItem("");
+                rulesetComboBox.setSelectedIndex(InternalRuleset.values().length);
+            }
+
+        } else {
+
+            rulesetFiles = new LinkedList<File>();
+
+            File[] filesInRulesetFolder = preferences.getRulesetFolder().listFiles();
+
+            if (filesInRulesetFolder != null) {
+                for (File possibleRulesetFile : filesInRulesetFolder) {
+                    try {
+                        AccessRulesetReader.readAccessRuleset(new FileInputStream(possibleRulesetFile));
+                        rulesetFiles.add(possibleRulesetFile);
+                    } catch (IOException ioe) {
+                        //don't add to rulesetFiles
+                    }
+                }
+            }
+
+            Collections.sort(rulesetFiles);
+
+            rulesetComboBox.removeAllItems();
+            for (int i=0; i < rulesetFiles.size(); i++) {
+                File rulesetFile = rulesetFiles.get(i);
+                rulesetComboBox.addItem(rulesetFile.getName());
+                if (rulesetFile.equals(preferences.getCurrentRulesetFile())) {
+                    rulesetComboBox.setSelectedIndex(i);
+                }
+            }
+
+        }
+
+        rulesetComboBox.addActionListener(rulesetActionListener);
+
+        /* update bookmarks */
+
+        bookmarkComboBox.removeActionListener(bookmarkActionListener);
+
+        String activeBookmarkName = preferences.getCurrentParameterBookmarkName();
+        Set<String> bookmarkNames = new HashSet<String>(preferences.getParameterBookmarks().keySet());
+
+        bookmarkComboBox.removeAllItems();
+        for (String bookmarkName : bookmarkNames) {
+            bookmarkComboBox.addItem(bookmarkName);
+            if (bookmarkName.equals(activeBookmarkName)) {
+                bookmarkComboBox.setSelectedItem(bookmarkName);
+            }
+        }
+
+        bookmarkComboBox.addActionListener(bookmarkActionListener);
+
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewPreferenceEditor.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewPreferenceEditor.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewPreferenceEditor.java	(revision 23189)
@@ -33,332 +33,332 @@
 public class GraphViewPreferenceEditor implements PreferenceSetting {
 
-	private File rulesetFolder;
-	private Map<String, PreferenceAccessParameters> parameterBookmarks;
-
-	private JPanel preferencePanel;
-
-	private JCheckBox internalRulesetCheckBox;
-	private JLabel rulesetFolderLabel;
-	private JTextField rulesetFolderTextField;
-	private JButton selectRulesetFolderButton;
-
-	private JComboBox bookmarkComboBox;
-	private JButton editBookmarkButton;
-	private JButton deleteBookmarkButton;
-
-	private JCheckBox separateDirectionsCheckBox;
-
-	public void addGui(PreferenceTabbedPane gui) {
-
-		readPreferences();
-
-		preferencePanel = gui.createPreferenceTab("graphview", "Graphview",
-		"Settings for the Graphview plugin that visualizes routing graphs.");
-
-		JPanel mainPanel = createMainPanel();
-
-		preferencePanel.add(mainPanel, GBC.eol().fill(GBC.BOTH));
-
-		updateVehiclePanel(GraphViewPreferences.getInstance().getCurrentParameterBookmarkName());
-
-	}
-
-	/**
-	 * creates local versions of preference information
-	 * that will only be written to real preferences if the OK button is pressed
-	 */
-	private void readPreferences() {
-
-		GraphViewPreferences preferences = GraphViewPreferences.getInstance();
-
-		rulesetFolder = preferences.getRulesetFolder();
-
-		parameterBookmarks =
-			new HashMap<String, PreferenceAccessParameters>(preferences.getParameterBookmarks());
-
-	}
-
-	private JPanel createMainPanel() {
-
-		JPanel mainPanel = new JPanel();
-
-		GridBagLayout mainLayout = new GridBagLayout();
-		mainPanel.setLayout(mainLayout);
-
-		GridBagConstraints constraints = new GridBagConstraints();
-		constraints.fill = GridBagConstraints.HORIZONTAL;
-		constraints.weightx = 1;
-		constraints.gridx = 0;
-
-		{
-			JPanel rulesetPanel = createRulesetPanel();
-			constraints.gridy = 0;
-			mainLayout.setConstraints(rulesetPanel, constraints);
-			mainPanel.add(rulesetPanel);
-		} {
-			JPanel vehiclePanel = createVehiclePanel();
-			constraints.gridy = 1;
-			mainLayout.setConstraints(vehiclePanel, constraints);
-			mainPanel.add(vehiclePanel);
-		} {
-			JPanel visualizationPanel = createVisualizationPanel();
-			constraints.gridy = 2;
-			mainLayout.setConstraints(visualizationPanel, constraints);
-			mainPanel.add(visualizationPanel);
-		}
-
-		mainPanel.add(GBC.glue(0, 0));
-
-		return mainPanel;
-
-	}
-
-	private JPanel createRulesetPanel() {
-
-		JPanel rulesetPanel = new JPanel();
-		rulesetPanel.setBorder(BorderFactory.createTitledBorder("ruleset"));
-		rulesetPanel.setLayout(new BoxLayout(rulesetPanel, BoxLayout.Y_AXIS));
-
-		internalRulesetCheckBox = new JCheckBox("use built-in rulesets");
-		internalRulesetCheckBox.setSelected(GraphViewPreferences.getInstance().getUseInternalRulesets());
-		internalRulesetCheckBox.addActionListener(internalRulesetActionListener);
-		rulesetPanel.add(internalRulesetCheckBox);
-
-		rulesetFolderLabel = new JLabel("external ruleset directory:");
-		rulesetPanel.add(rulesetFolderLabel);
-
-		rulesetFolderTextField = new JTextField();
-		rulesetFolderTextField.setText(rulesetFolder.getPath());
-		rulesetFolderTextField.setEditable(false);
-		rulesetPanel.add(rulesetFolderTextField);
-
-		selectRulesetFolderButton = new JButton("select directory");
-		selectRulesetFolderButton.addActionListener(selectRulesetFolderActionListener);
-		rulesetPanel.add(selectRulesetFolderButton);
-
-		updateRulesetPanel();
-
-		return rulesetPanel;
-	}
-
-	private JPanel createVehiclePanel() {
-
-		JPanel vehiclePanel = new JPanel();
-		vehiclePanel.setBorder(BorderFactory.createTitledBorder("vehicle"));
-		vehiclePanel.setLayout(new BoxLayout(vehiclePanel, BoxLayout.Y_AXIS));
-
-		bookmarkComboBox = new JComboBox();
-		vehiclePanel.add(bookmarkComboBox);
-
-		JPanel buttonPanel = new JPanel();
-		buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
-
-		JButton createButton = new JButton("create");
-		createButton.addActionListener(createVehicleActionListener);
-		buttonPanel.add(createButton);
-
-		editBookmarkButton = new JButton("edit");
-		editBookmarkButton.addActionListener(editVehicleActionListener);
-		buttonPanel.add(editBookmarkButton);
-
-		deleteBookmarkButton = new JButton("delete");
-		deleteBookmarkButton.addActionListener(deleteVehicleActionListener);
-		buttonPanel.add(deleteBookmarkButton);
-
-		JButton restoreDefaultsButton = new JButton("restore defaults");
-		restoreDefaultsButton.addActionListener(restoreVehicleDefaultsActionListener);
-		buttonPanel.add(restoreDefaultsButton);
-
-		vehiclePanel.add(buttonPanel);
-
-		return vehiclePanel;
-	}
-
-	private JPanel createVisualizationPanel() {
-
-		JPanel visualizationPanel = new JPanel();
-		visualizationPanel.setBorder(BorderFactory.createTitledBorder("visualization"));
-		visualizationPanel.setLayout(new BoxLayout(visualizationPanel, BoxLayout.Y_AXIS));
-
-		separateDirectionsCheckBox = new JCheckBox("draw directions separately");
-		separateDirectionsCheckBox.setSelected(GraphViewPreferences.getInstance().getSeparateDirections());
-		visualizationPanel.add(separateDirectionsCheckBox);
-
-		return visualizationPanel;
-	}
-
-	public boolean ok() {
-
-		GraphViewPreferences preferences = GraphViewPreferences.getInstance();
-
-		preferences.setUseInternalRulesets(internalRulesetCheckBox.isSelected());
-		preferences.setRulesetFolder(rulesetFolder);
-
-		preferences.setParameterBookmarks(parameterBookmarks);
-
-		String selectedBookmarkName = (String)bookmarkComboBox.getSelectedItem();
-		preferences.setCurrentParameterBookmarkName(selectedBookmarkName);
-
-		preferences.setSeparateDirections(separateDirectionsCheckBox.isSelected());
-
-		preferences.distributeChanges();
-
-		return false;
-	}
-
-	private final ActionListener internalRulesetActionListener = new ActionListener() {
-		public void actionPerformed(ActionEvent e) {
-			updateRulesetPanel();
-		}
-	};
-
-	private final ActionListener selectRulesetFolderActionListener = new ActionListener() {
-		public void actionPerformed(ActionEvent e) {
-
-			File initialFCDirectory = rulesetFolder;
-			if (rulesetFolder.getParentFile() != null) {
-				initialFCDirectory = rulesetFolder.getParentFile();
-			}
-
-			final JFileChooser fc = new JFileChooser();
-			fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
-			fc.setCurrentDirectory(initialFCDirectory);
-
-			int returnVal = fc.showOpenDialog(preferencePanel);
-
-			if (returnVal == JFileChooser.APPROVE_OPTION) {
-				rulesetFolder = fc.getSelectedFile();
-				rulesetFolderTextField.setText(rulesetFolder.getPath());
-			}
-
-		}
-	};
-
-	private final ActionListener createVehicleActionListener = new ActionListener() {
-		public void actionPerformed(ActionEvent e) {
-
-			PreferenceAccessParameters defaultBookmarkParameters =
-				GraphViewPreferenceDefaults.createDefaultBookmarkAccessParameters();
-
-			AccessParameterDialog apd = new AccessParameterDialog(
-					null,
-					false,
-					"new bookmark",
-					parameterBookmarks.keySet(),
-					defaultBookmarkParameters,
-					new BookmarkAction() {
-						public void execute(String name, PreferenceAccessParameters parameters) {
-							parameterBookmarks.put(name, parameters);
-							updateVehiclePanel(name);
-						}
-					});
-
-			apd.setVisible(true);
-		}
-	};
-
-	private final ActionListener editVehicleActionListener = new ActionListener() {
-		public void actionPerformed(ActionEvent e) {
-			if (bookmarkComboBox.getSelectedItem() != null) {
-
-				final String selectedBookmarkName = (String)bookmarkComboBox.getSelectedItem();
-				PreferenceAccessParameters parameters =
-					parameterBookmarks.get(selectedBookmarkName);
-
-				Collection<String> otherBookmarkNames = new LinkedList<String>();
-				for (String bookmarkName : parameterBookmarks.keySet()) {
-					if (!bookmarkName.equals(selectedBookmarkName)) {
-						otherBookmarkNames.add(bookmarkName);
-					}
-				}
-
-				AccessParameterDialog apd = new AccessParameterDialog(
-						null,
-						true,
-						selectedBookmarkName,
-						otherBookmarkNames,
-						parameters,
-						new BookmarkAction() {
-							public void execute(String name, PreferenceAccessParameters parameters) {
-								parameterBookmarks.remove(selectedBookmarkName);
-								parameterBookmarks.put(name, parameters);
-								updateVehiclePanel(name);
-							}
-						});
-
-				apd.setVisible(true);
-			}
-
-		}
-	};
-
-	private final ActionListener deleteVehicleActionListener = new ActionListener() {
-		public void actionPerformed(ActionEvent e) {
-			if (bookmarkComboBox.getSelectedItem() != null) {
-
-				String selectedBookmarkName = (String)bookmarkComboBox.getSelectedItem();
-
-				int userChoice = JOptionPane.showConfirmDialog(
-						preferencePanel,
-						"Really delete \"" + selectedBookmarkName + "\"?",
-						"Bookmark deletion",
-						JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
-
-				if (userChoice == JOptionPane.YES_OPTION) {
-					parameterBookmarks.remove(selectedBookmarkName);
-					updateVehiclePanel(null);
-				}
-
-			}
-		}
-	};
-
-	private final ActionListener restoreVehicleDefaultsActionListener = new ActionListener() {
-		public void actionPerformed(ActionEvent e) {
-
-			int userChoice = JOptionPane.showConfirmDialog(
-					preferencePanel,
-					"Really restore default bookmarks?\n"
-					+ "All manually added or edited bookmarks will be lost!",
-					"Bookmark reset",
-					JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
-
-			if (userChoice == JOptionPane.YES_OPTION) {
-				parameterBookmarks.clear();
-				parameterBookmarks.putAll(
-						GraphViewPreferenceDefaults.createDefaultAccessParameterBookmarks());
-				updateVehiclePanel(null);
-			}
-
-		}
-	};
-
-	private void updateRulesetPanel() {
-
-		rulesetFolderLabel.setEnabled(!internalRulesetCheckBox.isSelected());
-		rulesetFolderTextField.setEnabled(!internalRulesetCheckBox.isSelected());
-		selectRulesetFolderButton.setEnabled(!internalRulesetCheckBox.isSelected());
-
-	}
-
-	private void updateVehiclePanel(String selectedBookmarkName) {
-
-		bookmarkComboBox.removeAllItems();
-		for (String bookmarkName : parameterBookmarks.keySet()) {
-			bookmarkComboBox.addItem(bookmarkName);
-		}
-
-		if (selectedBookmarkName == null) {
-			if (bookmarkComboBox.getItemCount() > 0) {
-				bookmarkComboBox.setSelectedIndex(0);
-			}
-		} else {
-			bookmarkComboBox.setSelectedItem(selectedBookmarkName);
-		}
-
-		editBookmarkButton.setEnabled(parameterBookmarks.size() > 0);
-		deleteBookmarkButton.setEnabled(parameterBookmarks.size() > 0);
-
-	}
+    private File rulesetFolder;
+    private Map<String, PreferenceAccessParameters> parameterBookmarks;
+
+    private JPanel preferencePanel;
+
+    private JCheckBox internalRulesetCheckBox;
+    private JLabel rulesetFolderLabel;
+    private JTextField rulesetFolderTextField;
+    private JButton selectRulesetFolderButton;
+
+    private JComboBox bookmarkComboBox;
+    private JButton editBookmarkButton;
+    private JButton deleteBookmarkButton;
+
+    private JCheckBox separateDirectionsCheckBox;
+
+    public void addGui(PreferenceTabbedPane gui) {
+
+        readPreferences();
+
+        preferencePanel = gui.createPreferenceTab("graphview", "Graphview",
+        "Settings for the Graphview plugin that visualizes routing graphs.");
+
+        JPanel mainPanel = createMainPanel();
+
+        preferencePanel.add(mainPanel, GBC.eol().fill(GBC.BOTH));
+
+        updateVehiclePanel(GraphViewPreferences.getInstance().getCurrentParameterBookmarkName());
+
+    }
+
+    /**
+     * creates local versions of preference information
+     * that will only be written to real preferences if the OK button is pressed
+     */
+    private void readPreferences() {
+
+        GraphViewPreferences preferences = GraphViewPreferences.getInstance();
+
+        rulesetFolder = preferences.getRulesetFolder();
+
+        parameterBookmarks =
+            new HashMap<String, PreferenceAccessParameters>(preferences.getParameterBookmarks());
+
+    }
+
+    private JPanel createMainPanel() {
+
+        JPanel mainPanel = new JPanel();
+
+        GridBagLayout mainLayout = new GridBagLayout();
+        mainPanel.setLayout(mainLayout);
+
+        GridBagConstraints constraints = new GridBagConstraints();
+        constraints.fill = GridBagConstraints.HORIZONTAL;
+        constraints.weightx = 1;
+        constraints.gridx = 0;
+
+        {
+            JPanel rulesetPanel = createRulesetPanel();
+            constraints.gridy = 0;
+            mainLayout.setConstraints(rulesetPanel, constraints);
+            mainPanel.add(rulesetPanel);
+        } {
+            JPanel vehiclePanel = createVehiclePanel();
+            constraints.gridy = 1;
+            mainLayout.setConstraints(vehiclePanel, constraints);
+            mainPanel.add(vehiclePanel);
+        } {
+            JPanel visualizationPanel = createVisualizationPanel();
+            constraints.gridy = 2;
+            mainLayout.setConstraints(visualizationPanel, constraints);
+            mainPanel.add(visualizationPanel);
+        }
+
+        mainPanel.add(GBC.glue(0, 0));
+
+        return mainPanel;
+
+    }
+
+    private JPanel createRulesetPanel() {
+
+        JPanel rulesetPanel = new JPanel();
+        rulesetPanel.setBorder(BorderFactory.createTitledBorder("ruleset"));
+        rulesetPanel.setLayout(new BoxLayout(rulesetPanel, BoxLayout.Y_AXIS));
+
+        internalRulesetCheckBox = new JCheckBox("use built-in rulesets");
+        internalRulesetCheckBox.setSelected(GraphViewPreferences.getInstance().getUseInternalRulesets());
+        internalRulesetCheckBox.addActionListener(internalRulesetActionListener);
+        rulesetPanel.add(internalRulesetCheckBox);
+
+        rulesetFolderLabel = new JLabel("external ruleset directory:");
+        rulesetPanel.add(rulesetFolderLabel);
+
+        rulesetFolderTextField = new JTextField();
+        rulesetFolderTextField.setText(rulesetFolder.getPath());
+        rulesetFolderTextField.setEditable(false);
+        rulesetPanel.add(rulesetFolderTextField);
+
+        selectRulesetFolderButton = new JButton("select directory");
+        selectRulesetFolderButton.addActionListener(selectRulesetFolderActionListener);
+        rulesetPanel.add(selectRulesetFolderButton);
+
+        updateRulesetPanel();
+
+        return rulesetPanel;
+    }
+
+    private JPanel createVehiclePanel() {
+
+        JPanel vehiclePanel = new JPanel();
+        vehiclePanel.setBorder(BorderFactory.createTitledBorder("vehicle"));
+        vehiclePanel.setLayout(new BoxLayout(vehiclePanel, BoxLayout.Y_AXIS));
+
+        bookmarkComboBox = new JComboBox();
+        vehiclePanel.add(bookmarkComboBox);
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
+
+        JButton createButton = new JButton("create");
+        createButton.addActionListener(createVehicleActionListener);
+        buttonPanel.add(createButton);
+
+        editBookmarkButton = new JButton("edit");
+        editBookmarkButton.addActionListener(editVehicleActionListener);
+        buttonPanel.add(editBookmarkButton);
+
+        deleteBookmarkButton = new JButton("delete");
+        deleteBookmarkButton.addActionListener(deleteVehicleActionListener);
+        buttonPanel.add(deleteBookmarkButton);
+
+        JButton restoreDefaultsButton = new JButton("restore defaults");
+        restoreDefaultsButton.addActionListener(restoreVehicleDefaultsActionListener);
+        buttonPanel.add(restoreDefaultsButton);
+
+        vehiclePanel.add(buttonPanel);
+
+        return vehiclePanel;
+    }
+
+    private JPanel createVisualizationPanel() {
+
+        JPanel visualizationPanel = new JPanel();
+        visualizationPanel.setBorder(BorderFactory.createTitledBorder("visualization"));
+        visualizationPanel.setLayout(new BoxLayout(visualizationPanel, BoxLayout.Y_AXIS));
+
+        separateDirectionsCheckBox = new JCheckBox("draw directions separately");
+        separateDirectionsCheckBox.setSelected(GraphViewPreferences.getInstance().getSeparateDirections());
+        visualizationPanel.add(separateDirectionsCheckBox);
+
+        return visualizationPanel;
+    }
+
+    public boolean ok() {
+
+        GraphViewPreferences preferences = GraphViewPreferences.getInstance();
+
+        preferences.setUseInternalRulesets(internalRulesetCheckBox.isSelected());
+        preferences.setRulesetFolder(rulesetFolder);
+
+        preferences.setParameterBookmarks(parameterBookmarks);
+
+        String selectedBookmarkName = (String)bookmarkComboBox.getSelectedItem();
+        preferences.setCurrentParameterBookmarkName(selectedBookmarkName);
+
+        preferences.setSeparateDirections(separateDirectionsCheckBox.isSelected());
+
+        preferences.distributeChanges();
+
+        return false;
+    }
+
+    private final ActionListener internalRulesetActionListener = new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+            updateRulesetPanel();
+        }
+    };
+
+    private final ActionListener selectRulesetFolderActionListener = new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+
+            File initialFCDirectory = rulesetFolder;
+            if (rulesetFolder.getParentFile() != null) {
+                initialFCDirectory = rulesetFolder.getParentFile();
+            }
+
+            final JFileChooser fc = new JFileChooser();
+            fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+            fc.setCurrentDirectory(initialFCDirectory);
+
+            int returnVal = fc.showOpenDialog(preferencePanel);
+
+            if (returnVal == JFileChooser.APPROVE_OPTION) {
+                rulesetFolder = fc.getSelectedFile();
+                rulesetFolderTextField.setText(rulesetFolder.getPath());
+            }
+
+        }
+    };
+
+    private final ActionListener createVehicleActionListener = new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+
+            PreferenceAccessParameters defaultBookmarkParameters =
+                GraphViewPreferenceDefaults.createDefaultBookmarkAccessParameters();
+
+            AccessParameterDialog apd = new AccessParameterDialog(
+                    null,
+                    false,
+                    "new bookmark",
+                    parameterBookmarks.keySet(),
+                    defaultBookmarkParameters,
+                    new BookmarkAction() {
+                        public void execute(String name, PreferenceAccessParameters parameters) {
+                            parameterBookmarks.put(name, parameters);
+                            updateVehiclePanel(name);
+                        }
+                    });
+
+            apd.setVisible(true);
+        }
+    };
+
+    private final ActionListener editVehicleActionListener = new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+            if (bookmarkComboBox.getSelectedItem() != null) {
+
+                final String selectedBookmarkName = (String)bookmarkComboBox.getSelectedItem();
+                PreferenceAccessParameters parameters =
+                    parameterBookmarks.get(selectedBookmarkName);
+
+                Collection<String> otherBookmarkNames = new LinkedList<String>();
+                for (String bookmarkName : parameterBookmarks.keySet()) {
+                    if (!bookmarkName.equals(selectedBookmarkName)) {
+                        otherBookmarkNames.add(bookmarkName);
+                    }
+                }
+
+                AccessParameterDialog apd = new AccessParameterDialog(
+                        null,
+                        true,
+                        selectedBookmarkName,
+                        otherBookmarkNames,
+                        parameters,
+                        new BookmarkAction() {
+                            public void execute(String name, PreferenceAccessParameters parameters) {
+                                parameterBookmarks.remove(selectedBookmarkName);
+                                parameterBookmarks.put(name, parameters);
+                                updateVehiclePanel(name);
+                            }
+                        });
+
+                apd.setVisible(true);
+            }
+
+        }
+    };
+
+    private final ActionListener deleteVehicleActionListener = new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+            if (bookmarkComboBox.getSelectedItem() != null) {
+
+                String selectedBookmarkName = (String)bookmarkComboBox.getSelectedItem();
+
+                int userChoice = JOptionPane.showConfirmDialog(
+                        preferencePanel,
+                        "Really delete \"" + selectedBookmarkName + "\"?",
+                        "Bookmark deletion",
+                        JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
+
+                if (userChoice == JOptionPane.YES_OPTION) {
+                    parameterBookmarks.remove(selectedBookmarkName);
+                    updateVehiclePanel(null);
+                }
+
+            }
+        }
+    };
+
+    private final ActionListener restoreVehicleDefaultsActionListener = new ActionListener() {
+        public void actionPerformed(ActionEvent e) {
+
+            int userChoice = JOptionPane.showConfirmDialog(
+                    preferencePanel,
+                    "Really restore default bookmarks?\n"
+                    + "All manually added or edited bookmarks will be lost!",
+                    "Bookmark reset",
+                    JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
+
+            if (userChoice == JOptionPane.YES_OPTION) {
+                parameterBookmarks.clear();
+                parameterBookmarks.putAll(
+                        GraphViewPreferenceDefaults.createDefaultAccessParameterBookmarks());
+                updateVehiclePanel(null);
+            }
+
+        }
+    };
+
+    private void updateRulesetPanel() {
+
+        rulesetFolderLabel.setEnabled(!internalRulesetCheckBox.isSelected());
+        rulesetFolderTextField.setEnabled(!internalRulesetCheckBox.isSelected());
+        selectRulesetFolderButton.setEnabled(!internalRulesetCheckBox.isSelected());
+
+    }
+
+    private void updateVehiclePanel(String selectedBookmarkName) {
+
+        bookmarkComboBox.removeAllItems();
+        for (String bookmarkName : parameterBookmarks.keySet()) {
+            bookmarkComboBox.addItem(bookmarkName);
+        }
+
+        if (selectedBookmarkName == null) {
+            if (bookmarkComboBox.getItemCount() > 0) {
+                bookmarkComboBox.setSelectedIndex(0);
+            }
+        } else {
+            bookmarkComboBox.setSelectedItem(selectedBookmarkName);
+        }
+
+        editBookmarkButton.setEnabled(parameterBookmarks.size() > 0);
+        deleteBookmarkButton.setEnabled(parameterBookmarks.size() > 0);
+
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/GraphViewLayer.java	(revision 23189)
@@ -46,305 +46,305 @@
 public class GraphViewLayer extends Layer implements LayerChangeListener, WayGraphObserver {
 
-	private static final int NODE_RADIUS = 5;
-
-	/**
-	 * offset from real position if {@link GraphViewPreferences#getSeparateDirections()} is active,
-	 * causes the graph nodes for the two directions to be visually distinguishable.
-	 * Positive values move "forward" direction to the right.
-	 */
-	private static final double DIRECTIONAL_OFFSET = 20;
-
-	private static final double OFFSET_ANGLE = 0.5 * Math.PI;
-
-	private static final double MIN_QUAD_DISTANCE_FOR_OFFSET = 4;
-
-	private static final boolean CONNECT_ALL_NODE_PAIRS = false;
-
-	/** an arrow head that points along the x-axis to (0,0) */
-	private static final Shape ARROW_HEAD;
-
-	static {
-
-		Polygon head = new Polygon();
-
-		head.addPoint(  0,  0);
-		head.addPoint(-15, +4);
-		head.addPoint(-15, -4);
-
-		ARROW_HEAD = head;
-	}
-
-	private WayGraph wayGraph = null;
-
-	private ColorScheme colorScheme = null;
-	private NodePositioner nodePositioner = new NonMovingNodePositioner();
-
-	public GraphViewLayer() {
-		super("Graph view");
-		MapView.addLayerChangeListener(this);
-	}
-
-	/** sets the WayGraph that is to be displayed by this layer, may be null */
-	public void setWayGraph(WayGraph wayGraph) {
-		if (this.wayGraph != null) {
-			this.wayGraph.deleteObserver(this);
-		}
-		this.wayGraph = wayGraph;
-		if (wayGraph != null) {
-			wayGraph.addObserver(this);
-		}
-	}
-
-	/** sets the ColorScheme that is to be used for choosing colors, may be null */
-	public void setColorScheme(ColorScheme colorScheme) {
-		this.colorScheme = colorScheme;
-		Main.panel.repaint();
-	}
-
-	/**
-	 * sets the NodePositioner that is to be used for determining node placement,
-	 * null will cause a {@link NonMovingNodePositioner} to be used.
-	 */
-	public void setNodePositioner(NodePositioner nodePositioner) {
-		this.nodePositioner = nodePositioner;
-		if (nodePositioner == null) {
-			this.nodePositioner = new NonMovingNodePositioner();
-		}
-		Main.panel.repaint();
-	}
-
-	@Override
-	public Icon getIcon() {
-		return ImageProvider.get("layer", "graphview");
-	}
-
-	private void paintGraphNode(final GraphNode node, final Graphics g, final MapView mv) {
-
-		Color color = colorScheme != null ? colorScheme.getNodeColor(node) : Color.LIGHT_GRAY;
-
-		Point p = getNodePoint(node, mv);
-		g.setColor(color);
-		g.fillOval(p.x - NODE_RADIUS, p.y - NODE_RADIUS, 2 * NODE_RADIUS, 2 * NODE_RADIUS);
-
-	}
-
-	private void paintGraphEdge(final GraphEdge e, final Graphics2D g2D, final MapView mv) {
-
-		if (!CONNECT_ALL_NODE_PAIRS && GraphViewPreferences.getInstance().getSeparateDirections()) {
-
-			//don't paint edges between nodes from the same SegmentNode and simply inverted Segment
-			if (e.getStartNode().getSegmentNode() == e.getTargetNode().getSegmentNode()
-					&& e.getStartNode().getSegment().getNode2() == e.getTargetNode().getSegment().getNode1()
-					&& e.getStartNode().getSegment().getNode1() == e.getTargetNode().getSegment().getNode2()) {
-				return;
-			}
-
-		}
-
-		/* draw line(s) */
-
-		g2D.setStroke(new BasicStroke(3, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
-
-		List<Segment> edgeSegments = e.getPropertyValue(GraphEdgeSegments.PROPERTY);
-
-		if (edgeSegments.size() > 0) {
-
-			Segment firstSegment = edgeSegments.get(0);
-			Segment lastSegment = edgeSegments.get(edgeSegments.size() - 1);
-
-			//draw segments
-
-			for (Segment segment : edgeSegments) {
-
-				Color color = Color.WHITE;
-				if (colorScheme != null) {
-					color = colorScheme.getSegmentColor(segment);
-				}
-				g2D.setColor(color);
-
-				Point p1 = getNodePoint(segment.getNode1(), mv);
-				Point p2 = getNodePoint(segment.getNode2(), mv);
-
-				if (segment == firstSegment) {
-					p1 = getNodePoint(e.getStartNode(), mv);
-				}
-				if (segment == lastSegment) {
-					p2 = getNodePoint(e.getTargetNode(), mv);
-				}
-
-				g2D.draw(new Line2D.Float(p1.x, p1.y, p2.x, p2.y));
-
-			}
-
-		} else {
-
-			g2D.setColor(Color.WHITE);
-
-			Point p1 = getNodePoint(e.getStartNode(), mv);
-			Point p2 = getNodePoint(e.getTargetNode(), mv);
-
-			g2D.draw(new Line2D.Float(p1.x, p1.y, p2.x, p2.y));
-
-		}
-
-		/* draw arrow head (note: color of last segment is still set) */
-
-		{
-			Point p1 = getNodePoint(e.getStartNode(), mv);
-			Point p2 = getNodePoint(e.getTargetNode(), mv);
-
-			if (edgeSegments.size() > 0) {
-				Segment lastSegment = edgeSegments.get(edgeSegments.size() - 1);
-				p1 = getNodePoint(lastSegment.getNode1(), mv);
-			}
-
-			double angle = angleFromXAxis(p1, p2); // angle between x-axis and [p1,p2]
-			Shape head = ARROW_HEAD;
-			head = AffineTransform.getRotateInstance(angle).createTransformedShape(head);
-			head = AffineTransform.getTranslateInstance(p2.x, p2.y).createTransformedShape(head);
-
-			g2D.fill(head);
-
-		}
-	}
-
-	private Point getNodePoint(GraphNode node, MapView mv) {
-
-		Point nodePoint = getNodePoint(nodePositioner.getPosition(node), mv);
-
-		if (GraphViewPreferences.getInstance().getSeparateDirections()
-				&& !GraphUtil.isEndNode(node)) {
-
-			SegmentNode node1 = node.getSegment().getNode1();
-			SegmentNode node2 = node.getSegment().getNode2();
-
-			Point node1Point = getNodePoint(node1, mv);
-			Point node2Point = getNodePoint(node2, mv);
-
-			double segmentX = node2Point.getX() - node1Point.getX();
-			double segmentY = node2Point.getY() - node1Point.getY();
-
-			if (segmentX*segmentX + segmentY*segmentY >= MIN_QUAD_DISTANCE_FOR_OFFSET) {
-
-				double rotatedX = Math.cos(OFFSET_ANGLE) * segmentX - Math.sin(OFFSET_ANGLE) * segmentY;
-				double rotatedY = Math.sin(OFFSET_ANGLE) * segmentX + Math.cos(OFFSET_ANGLE) * segmentY;
-
-				double segmentLength = Math.sqrt(rotatedX * rotatedX + rotatedY * rotatedY);
-
-				double normalizedX = rotatedX / segmentLength;
-				double normalizedY = rotatedY / segmentLength;
-
-				nodePoint.x += DIRECTIONAL_OFFSET * normalizedX;
-				nodePoint.y += DIRECTIONAL_OFFSET * normalizedY;
-
-			}
-
-		}
-
-		return nodePoint;
-	}
-	private Point getNodePoint(SegmentNode node, MapView mv) {
-		LatLonCoords coords = new LatLonCoords(node.getLat(), node.getLon());
-		return getNodePoint(coords, mv);
-	}
-	private Point getNodePoint(LatLonCoords coords, MapView mv) {
-		LatLon latLon = new LatLon(coords.getLat(), coords.getLon());
-		EastNorth eastNorth = Main.proj.latlon2eastNorth(latLon);
-		return mv.getPoint(eastNorth);
-	}
-
-	/**
-	 * calculates the angle between the x axis and a vector given by two points
-	 * @param p1  first point for vector; != null
-	 * @param p2  second point for vector; != null
-	 * @return  angle in radians, in range [-Pi .. +Pi]
-	 */
-	private double angleFromXAxis(Point p1, Point p2) {
-		assert p1 != null && p2 != null;
-
-		final float vecX = p2.x - p1.x;
-		final float vecY = p2.y - p1.y;
-
-		final float vecLength = (float)Math.sqrt(vecX*vecX + vecY*vecY);
-
-		final float dotProductVecAxis = vecX;
-
-		float angle = (float)Math.acos(dotProductVecAxis / vecLength);
-
-		if (p2.y < p1.y) {
-			angle = -angle;
-		}
-
-		assert -Math.PI*0.5 < angle && angle <= Math.PI*0.5;
-
-		return angle;
-	}
-
-	@Override
-	public void paint(final Graphics2D g, final MapView mv, Bounds bounds) {
-		if (wayGraph != null) {
-
-			for (GraphNode n : wayGraph.getNodes()) {
-				paintGraphNode(n, g, mv);
-			}
-
-			for (GraphEdge e : wayGraph.getEdges()) {
-				paintGraphEdge(e, g, mv);
-			}
-
-		}
-
-	}
-
-	@Override
-	public String getToolTipText() {
-		return "routing graph calculated by the GraphView plugin";
-	}
-
-	@Override
-	public void mergeFrom(Layer from) {
-		throw new AssertionError("GraphView layer is not mergable");
-	}
-
-	@Override
-	public boolean isMergable(Layer other) {
-		return false;
-	}
-
-	@Override
-	public void visitBoundingBox(BoundingXYVisitor v) {
-	}
-
-	@Override
-	public Object getInfoComponent() {
-		return getToolTipText();
-	}
-
-	@Override
-	public Action[] getMenuEntries() {
-		return new Action[] {
-				LayerListDialog.getInstance().createShowHideLayerAction(),
-				LayerListDialog.getInstance().createDeleteLayerAction(),
-				SeparatorLayerAction.INSTANCE,
-				new RenameLayerAction(null, this),
-				SeparatorLayerAction.INSTANCE,
-				new LayerListPopup.InfoAction(this)};
-	}
-
-	public void update(WayGraph wayGraph) {
-		assert wayGraph == this.wayGraph;
-		Main.panel.repaint();
-	}
-
-	public void activeLayerChange(Layer oldLayer, Layer newLayer) {
-		//do nothing
-	}
-	public void layerAdded(Layer newLayer) {
-		//do nothing
-	}
-	public void layerRemoved(Layer oldLayer) {
-		if (oldLayer == this) {
-			MapView.removeLayerChangeListener(this);
-		}
-	}
+    private static final int NODE_RADIUS = 5;
+
+    /**
+     * offset from real position if {@link GraphViewPreferences#getSeparateDirections()} is active,
+     * causes the graph nodes for the two directions to be visually distinguishable.
+     * Positive values move "forward" direction to the right.
+     */
+    private static final double DIRECTIONAL_OFFSET = 20;
+
+    private static final double OFFSET_ANGLE = 0.5 * Math.PI;
+
+    private static final double MIN_QUAD_DISTANCE_FOR_OFFSET = 4;
+
+    private static final boolean CONNECT_ALL_NODE_PAIRS = false;
+
+    /** an arrow head that points along the x-axis to (0,0) */
+    private static final Shape ARROW_HEAD;
+
+    static {
+
+        Polygon head = new Polygon();
+
+        head.addPoint(  0,  0);
+        head.addPoint(-15, +4);
+        head.addPoint(-15, -4);
+
+        ARROW_HEAD = head;
+    }
+
+    private WayGraph wayGraph = null;
+
+    private ColorScheme colorScheme = null;
+    private NodePositioner nodePositioner = new NonMovingNodePositioner();
+
+    public GraphViewLayer() {
+        super("Graph view");
+        MapView.addLayerChangeListener(this);
+    }
+
+    /** sets the WayGraph that is to be displayed by this layer, may be null */
+    public void setWayGraph(WayGraph wayGraph) {
+        if (this.wayGraph != null) {
+            this.wayGraph.deleteObserver(this);
+        }
+        this.wayGraph = wayGraph;
+        if (wayGraph != null) {
+            wayGraph.addObserver(this);
+        }
+    }
+
+    /** sets the ColorScheme that is to be used for choosing colors, may be null */
+    public void setColorScheme(ColorScheme colorScheme) {
+        this.colorScheme = colorScheme;
+        Main.panel.repaint();
+    }
+
+    /**
+     * sets the NodePositioner that is to be used for determining node placement,
+     * null will cause a {@link NonMovingNodePositioner} to be used.
+     */
+    public void setNodePositioner(NodePositioner nodePositioner) {
+        this.nodePositioner = nodePositioner;
+        if (nodePositioner == null) {
+            this.nodePositioner = new NonMovingNodePositioner();
+        }
+        Main.panel.repaint();
+    }
+
+    @Override
+    public Icon getIcon() {
+        return ImageProvider.get("layer", "graphview");
+    }
+
+    private void paintGraphNode(final GraphNode node, final Graphics g, final MapView mv) {
+
+        Color color = colorScheme != null ? colorScheme.getNodeColor(node) : Color.LIGHT_GRAY;
+
+        Point p = getNodePoint(node, mv);
+        g.setColor(color);
+        g.fillOval(p.x - NODE_RADIUS, p.y - NODE_RADIUS, 2 * NODE_RADIUS, 2 * NODE_RADIUS);
+
+    }
+
+    private void paintGraphEdge(final GraphEdge e, final Graphics2D g2D, final MapView mv) {
+
+        if (!CONNECT_ALL_NODE_PAIRS && GraphViewPreferences.getInstance().getSeparateDirections()) {
+
+            //don't paint edges between nodes from the same SegmentNode and simply inverted Segment
+            if (e.getStartNode().getSegmentNode() == e.getTargetNode().getSegmentNode()
+                    && e.getStartNode().getSegment().getNode2() == e.getTargetNode().getSegment().getNode1()
+                    && e.getStartNode().getSegment().getNode1() == e.getTargetNode().getSegment().getNode2()) {
+                return;
+            }
+
+        }
+
+        /* draw line(s) */
+
+        g2D.setStroke(new BasicStroke(3, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
+
+        List<Segment> edgeSegments = e.getPropertyValue(GraphEdgeSegments.PROPERTY);
+
+        if (edgeSegments.size() > 0) {
+
+            Segment firstSegment = edgeSegments.get(0);
+            Segment lastSegment = edgeSegments.get(edgeSegments.size() - 1);
+
+            //draw segments
+
+            for (Segment segment : edgeSegments) {
+
+                Color color = Color.WHITE;
+                if (colorScheme != null) {
+                    color = colorScheme.getSegmentColor(segment);
+                }
+                g2D.setColor(color);
+
+                Point p1 = getNodePoint(segment.getNode1(), mv);
+                Point p2 = getNodePoint(segment.getNode2(), mv);
+
+                if (segment == firstSegment) {
+                    p1 = getNodePoint(e.getStartNode(), mv);
+                }
+                if (segment == lastSegment) {
+                    p2 = getNodePoint(e.getTargetNode(), mv);
+                }
+
+                g2D.draw(new Line2D.Float(p1.x, p1.y, p2.x, p2.y));
+
+            }
+
+        } else {
+
+            g2D.setColor(Color.WHITE);
+
+            Point p1 = getNodePoint(e.getStartNode(), mv);
+            Point p2 = getNodePoint(e.getTargetNode(), mv);
+
+            g2D.draw(new Line2D.Float(p1.x, p1.y, p2.x, p2.y));
+
+        }
+
+        /* draw arrow head (note: color of last segment is still set) */
+
+        {
+            Point p1 = getNodePoint(e.getStartNode(), mv);
+            Point p2 = getNodePoint(e.getTargetNode(), mv);
+
+            if (edgeSegments.size() > 0) {
+                Segment lastSegment = edgeSegments.get(edgeSegments.size() - 1);
+                p1 = getNodePoint(lastSegment.getNode1(), mv);
+            }
+
+            double angle = angleFromXAxis(p1, p2); // angle between x-axis and [p1,p2]
+            Shape head = ARROW_HEAD;
+            head = AffineTransform.getRotateInstance(angle).createTransformedShape(head);
+            head = AffineTransform.getTranslateInstance(p2.x, p2.y).createTransformedShape(head);
+
+            g2D.fill(head);
+
+        }
+    }
+
+    private Point getNodePoint(GraphNode node, MapView mv) {
+
+        Point nodePoint = getNodePoint(nodePositioner.getPosition(node), mv);
+
+        if (GraphViewPreferences.getInstance().getSeparateDirections()
+                && !GraphUtil.isEndNode(node)) {
+
+            SegmentNode node1 = node.getSegment().getNode1();
+            SegmentNode node2 = node.getSegment().getNode2();
+
+            Point node1Point = getNodePoint(node1, mv);
+            Point node2Point = getNodePoint(node2, mv);
+
+            double segmentX = node2Point.getX() - node1Point.getX();
+            double segmentY = node2Point.getY() - node1Point.getY();
+
+            if (segmentX*segmentX + segmentY*segmentY >= MIN_QUAD_DISTANCE_FOR_OFFSET) {
+
+                double rotatedX = Math.cos(OFFSET_ANGLE) * segmentX - Math.sin(OFFSET_ANGLE) * segmentY;
+                double rotatedY = Math.sin(OFFSET_ANGLE) * segmentX + Math.cos(OFFSET_ANGLE) * segmentY;
+
+                double segmentLength = Math.sqrt(rotatedX * rotatedX + rotatedY * rotatedY);
+
+                double normalizedX = rotatedX / segmentLength;
+                double normalizedY = rotatedY / segmentLength;
+
+                nodePoint.x += DIRECTIONAL_OFFSET * normalizedX;
+                nodePoint.y += DIRECTIONAL_OFFSET * normalizedY;
+
+            }
+
+        }
+
+        return nodePoint;
+    }
+    private Point getNodePoint(SegmentNode node, MapView mv) {
+        LatLonCoords coords = new LatLonCoords(node.getLat(), node.getLon());
+        return getNodePoint(coords, mv);
+    }
+    private Point getNodePoint(LatLonCoords coords, MapView mv) {
+        LatLon latLon = new LatLon(coords.getLat(), coords.getLon());
+        EastNorth eastNorth = Main.proj.latlon2eastNorth(latLon);
+        return mv.getPoint(eastNorth);
+    }
+
+    /**
+     * calculates the angle between the x axis and a vector given by two points
+     * @param p1  first point for vector; != null
+     * @param p2  second point for vector; != null
+     * @return  angle in radians, in range [-Pi .. +Pi]
+     */
+    private double angleFromXAxis(Point p1, Point p2) {
+        assert p1 != null && p2 != null;
+
+        final float vecX = p2.x - p1.x;
+        final float vecY = p2.y - p1.y;
+
+        final float vecLength = (float)Math.sqrt(vecX*vecX + vecY*vecY);
+
+        final float dotProductVecAxis = vecX;
+
+        float angle = (float)Math.acos(dotProductVecAxis / vecLength);
+
+        if (p2.y < p1.y) {
+            angle = -angle;
+        }
+
+        assert -Math.PI*0.5 < angle && angle <= Math.PI*0.5;
+
+        return angle;
+    }
+
+    @Override
+    public void paint(final Graphics2D g, final MapView mv, Bounds bounds) {
+        if (wayGraph != null) {
+
+            for (GraphNode n : wayGraph.getNodes()) {
+                paintGraphNode(n, g, mv);
+            }
+
+            for (GraphEdge e : wayGraph.getEdges()) {
+                paintGraphEdge(e, g, mv);
+            }
+
+        }
+
+    }
+
+    @Override
+    public String getToolTipText() {
+        return "routing graph calculated by the GraphView plugin";
+    }
+
+    @Override
+    public void mergeFrom(Layer from) {
+        throw new AssertionError("GraphView layer is not mergable");
+    }
+
+    @Override
+    public boolean isMergable(Layer other) {
+        return false;
+    }
+
+    @Override
+    public void visitBoundingBox(BoundingXYVisitor v) {
+    }
+
+    @Override
+    public Object getInfoComponent() {
+        return getToolTipText();
+    }
+
+    @Override
+    public Action[] getMenuEntries() {
+        return new Action[] {
+                LayerListDialog.getInstance().createShowHideLayerAction(),
+                LayerListDialog.getInstance().createDeleteLayerAction(),
+                SeparatorLayerAction.INSTANCE,
+                new RenameLayerAction(null, this),
+                SeparatorLayerAction.INSTANCE,
+                new LayerListPopup.InfoAction(this)};
+    }
+
+    public void update(WayGraph wayGraph) {
+        assert wayGraph == this.wayGraph;
+        Main.panel.repaint();
+    }
+
+    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
+        //do nothing
+    }
+    public void layerAdded(Layer newLayer) {
+        //do nothing
+    }
+    public void layerRemoved(Layer oldLayer) {
+        if (oldLayer == this) {
+            MapView.removeLayerChangeListener(this);
+        }
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/PreferencesColorScheme.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/PreferencesColorScheme.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/layer/PreferencesColorScheme.java	(revision 23189)
@@ -13,17 +13,17 @@
 public class PreferencesColorScheme implements ColorScheme {
 
-	private final GraphViewPreferences preferences;
+    private final GraphViewPreferences preferences;
 
-	public PreferencesColorScheme(GraphViewPreferences preferences) {
-		this.preferences = preferences;
-	}
+    public PreferencesColorScheme(GraphViewPreferences preferences) {
+        this.preferences = preferences;
+    }
 
-	public Color getNodeColor(GraphNode node) {
-		return preferences.getNodeColor();
-	}
+    public Color getNodeColor(GraphNode node) {
+        return preferences.getNodeColor();
+    }
 
-	public Color getSegmentColor(Segment segment) {
-		return preferences.getSegmentColor();
-	}
+    public Color getSegmentColor(Segment segment) {
+        return preferences.getSegmentColor();
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/GraphViewPreferenceDefaults.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/GraphViewPreferenceDefaults.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/GraphViewPreferenceDefaults.java	(revision 23189)
@@ -22,90 +22,90 @@
 public final class GraphViewPreferenceDefaults {
 
-	/** prevents instantiation */
-	private GraphViewPreferenceDefaults() { }
+    /** prevents instantiation */
+    private GraphViewPreferenceDefaults() { }
 
-	/** creates a default "empty" bookmark */
-	public static PreferenceAccessParameters createDefaultBookmarkAccessParameters() {
+    /** creates a default "empty" bookmark */
+    public static PreferenceAccessParameters createDefaultBookmarkAccessParameters() {
 
-		Collection<AccessType> accessTypes =
-			Arrays.asList(UNDEFINED, YES, PERMISSIVE, DESIGNATED);
+        Collection<AccessType> accessTypes =
+            Arrays.asList(UNDEFINED, YES, PERMISSIVE, DESIGNATED);
 
-		Map<VehiclePropertyType<?>, String> propertyStringMap =
-			new HashMap<VehiclePropertyType<?>, String>();
+        Map<VehiclePropertyType<?>, String> propertyStringMap =
+            new HashMap<VehiclePropertyType<?>, String>();
 
-		try {
-			return new PreferenceAccessParameters("", accessTypes, propertyStringMap);
-		} catch (PropertyValueSyntaxException e) {
-			throw new AssertionError(e);
-		}
+        try {
+            return new PreferenceAccessParameters("", accessTypes, propertyStringMap);
+        } catch (PropertyValueSyntaxException e) {
+            throw new AssertionError(e);
+        }
 
-	}
+    }
 
-	/** creates the default map of access parameter bookmarks */
-	public static Map<String, PreferenceAccessParameters> createDefaultAccessParameterBookmarks() {
+    /** creates the default map of access parameter bookmarks */
+    public static Map<String, PreferenceAccessParameters> createDefaultAccessParameterBookmarks() {
 
-		try {
+        try {
 
-			Map<String, PreferenceAccessParameters> result =
-				new HashMap<String, PreferenceAccessParameters>();
+            Map<String, PreferenceAccessParameters> result =
+                new HashMap<String, PreferenceAccessParameters>();
 
-			Collection<AccessType> accessTypes =
-				Arrays.asList(UNDEFINED, YES, PERMISSIVE, DESIGNATED);
+            Collection<AccessType> accessTypes =
+                Arrays.asList(UNDEFINED, YES, PERMISSIVE, DESIGNATED);
 
-			/* create motorcar bookmark */
-			{
-				Map<VehiclePropertyType<?>, String> propertyMap =
-					new HashMap<VehiclePropertyType<?>, String>();
+            /* create motorcar bookmark */
+            {
+                Map<VehiclePropertyType<?>, String> propertyMap =
+                    new HashMap<VehiclePropertyType<?>, String>();
 
-				PreferenceAccessParameters accessParameters =
-					new PreferenceAccessParameters("motorcar", accessTypes, propertyMap);
+                PreferenceAccessParameters accessParameters =
+                    new PreferenceAccessParameters("motorcar", accessTypes, propertyMap);
 
-				result.put("motorcar", accessParameters);
-			}
+                result.put("motorcar", accessParameters);
+            }
 
-			/* create hgv bookmark */
-			{
-				Map<VehiclePropertyType<?>, String> propertyMap =
-					new HashMap<VehiclePropertyType<?>, String>();
-				propertyMap.put(VehiclePropertyTypes.WEIGHT, "3.5");
+            /* create hgv bookmark */
+            {
+                Map<VehiclePropertyType<?>, String> propertyMap =
+                    new HashMap<VehiclePropertyType<?>, String>();
+                propertyMap.put(VehiclePropertyTypes.WEIGHT, "3.5");
 
-				PreferenceAccessParameters accessParameters =
-					new PreferenceAccessParameters("hgv", accessTypes, propertyMap);
+                PreferenceAccessParameters accessParameters =
+                    new PreferenceAccessParameters("hgv", accessTypes, propertyMap);
 
-				result.put("hgv (3.5 t)", accessParameters);
-			}
+                result.put("hgv (3.5 t)", accessParameters);
+            }
 
-			/* create bicycle bookmark */
-			{
-				Map<VehiclePropertyType<?>, String> propertyMap =
-					new HashMap<VehiclePropertyType<?>, String>();
+            /* create bicycle bookmark */
+            {
+                Map<VehiclePropertyType<?>, String> propertyMap =
+                    new HashMap<VehiclePropertyType<?>, String>();
 
-				PreferenceAccessParameters accessParameters =
-					new PreferenceAccessParameters("bicycle", accessTypes, propertyMap);
+                PreferenceAccessParameters accessParameters =
+                    new PreferenceAccessParameters("bicycle", accessTypes, propertyMap);
 
-				result.put("bicycle", accessParameters);
-			}
+                result.put("bicycle", accessParameters);
+            }
 
-			/* create pedestrian bookmark */
-			{
-				Map<VehiclePropertyType<?>, String> propertyMap =
-					new HashMap<VehiclePropertyType<?>, String>();
+            /* create pedestrian bookmark */
+            {
+                Map<VehiclePropertyType<?>, String> propertyMap =
+                    new HashMap<VehiclePropertyType<?>, String>();
 
-				PreferenceAccessParameters accessParameters =
-					new PreferenceAccessParameters("foot", accessTypes, propertyMap);
+                PreferenceAccessParameters accessParameters =
+                    new PreferenceAccessParameters("foot", accessTypes, propertyMap);
 
-				result.put("pedestrian", accessParameters);
-			}
+                result.put("pedestrian", accessParameters);
+            }
 
-			return result;
+            return result;
 
-		} catch (PropertyValueSyntaxException e) {
-			throw new AssertionError(e);
-		}
-	}
+        } catch (PropertyValueSyntaxException e) {
+            throw new AssertionError(e);
+        }
+    }
 
-	public static File getDefaultRulesetFolder() {
-		return new File(System.getProperty("user.home"));
-	}
+    public static File getDefaultRulesetFolder() {
+        return new File(System.getProperty("user.home"));
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/GraphViewPreferences.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/GraphViewPreferences.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/GraphViewPreferences.java	(revision 23189)
@@ -39,451 +39,451 @@
 public class GraphViewPreferences extends Observable {
 
-	private static GraphViewPreferences instance;
-
-	/**
-	 * returns the single instance of GraphViewPreferences.
-	 * @param ignoreSyntaxErrors
-	 * @return
-	 */
-	public static GraphViewPreferences getInstance() {
-		if (instance == null) {
-			instance = new GraphViewPreferences();
-		}
-		return instance;
-	}
-
-	private boolean useInternalRulesets;
-	private File rulesetFolder;
-	private File currentRulesetFile;
-	private InternalRuleset currentInternalRuleset;
-
-	private String currentParameterBookmarkName;
-	private Map<String, PreferenceAccessParameters> parameterBookmarks;
-
-	private ColorScheme currentColorScheme;
-	private Color nodeColor;
-	private Color segmentColor;
-
-	private boolean separateDirections;
-
-
-	public synchronized boolean getUseInternalRulesets() {
-		return useInternalRulesets;
-	}
-	public synchronized void setUseInternalRulesets(boolean useInternalRulesets) {
-		this.useInternalRulesets = useInternalRulesets;
-	}
-
-	public synchronized File getRulesetFolder() {
-		return rulesetFolder;
-	}
-	public synchronized void setRulesetFolder(File rulesetFolder) {
-		this.rulesetFolder = rulesetFolder;
-	}
-
-	public synchronized File getCurrentRulesetFile() {
-		return currentRulesetFile;
-	}
-	public synchronized void setCurrentRulesetFile(File currentRulesetFile) {
-		this.currentRulesetFile = currentRulesetFile;
-	}
-
-	public synchronized InternalRuleset getCurrentInternalRuleset() {
-		return currentInternalRuleset;
-	}
-	public synchronized void setCurrentInternalRuleset(InternalRuleset internalRuleset) {
-		this.currentInternalRuleset = internalRuleset;
-	}
-
-	/**
-	 * returns the name (map key) of the currently selected parameter bookmark
-	 * or null if none is selected.
-	 * If a name is returned, is has to be a key of the map returned by
-	 * {@link #getParameterBookmarks()}.
-	 */
-	public synchronized String getCurrentParameterBookmarkName() {
-		assert parameterBookmarks.containsKey(currentParameterBookmarkName);
-		return currentParameterBookmarkName;
-	}
-
-	/**
-	 * returns the access parameters of the currently selected parameter bookmark
-	 * or null if none is selected.
-	 */
-	public synchronized AccessParameters getCurrentParameterBookmark() {
-		if (currentParameterBookmarkName == null) {
-			return null;
-		} else {
-			assert parameterBookmarks.containsKey(currentParameterBookmarkName);
-			return parameterBookmarks.get(currentParameterBookmarkName);
-		}
-	}
-
-	/**
-	 * sets the active parameter bookmark using its name as an identifier
-	 * @param currentParameters  name of bookmark to set or null (no active bookmark).
-	 *                           Non-null values must be keys of the map returned by
-	 *                           {@link #getParameterBookmarks()}.
-	 */
-	public synchronized void setCurrentParameterBookmarkName(String parameterBookmarkName) {
-		assert parameterBookmarks.containsKey(parameterBookmarkName);
-		this.currentParameterBookmarkName = parameterBookmarkName;
-	}
-
-	public synchronized Map<String, PreferenceAccessParameters> getParameterBookmarks() {
-		return Collections.unmodifiableMap(parameterBookmarks);
-	}
-	public synchronized void setParameterBookmarks(
-			Map<String, PreferenceAccessParameters> parameterBookmarks) {
-		assert parameterBookmarks != null;
-
-		this.parameterBookmarks =
-			new HashMap<String, PreferenceAccessParameters>(parameterBookmarks);
-	}
-
-	public synchronized ColorScheme getCurrentColorScheme() {
-		return currentColorScheme;
-	}
-	public synchronized void setCurrentColorScheme(ColorScheme currentColorScheme) {
-		this.currentColorScheme = currentColorScheme;
-	}
-
-	public synchronized Color getNodeColor() {
-		return nodeColor;
-	}
-	public synchronized void setNodeColor(Color nodeColor) {
-		this.nodeColor = nodeColor;
-	}
-
-	public synchronized Color getSegmentColor() {
-		return segmentColor;
-	}
-	public synchronized void setSegmentColor(Color segmentColor) {
-		this.segmentColor = segmentColor;
-	}
-
-	public synchronized boolean getSeparateDirections() {
-		return separateDirections;
-	}
-	public synchronized void setSeparateDirections(boolean separateDirections) {
-		this.separateDirections = separateDirections;
-	}
-
-	/**
-	 * writes changes to JOSM's preferences and notifies observers.
-	 * Must be called explicitly after setters (to prevent distributing incomplete changes).
-	 */
-	public void distributeChanges() {
-		writePreferences();
-		setChanged();
-		notifyObservers();
-	}
-
-	private GraphViewPreferences() {
-
-		/* set defaults first (in case preferences are incomplete) */
-
-		fillDefaults();
-
-		/* read preferences and overwrite defaults */
-
-		readPreferences();
-
-		/* write preferences
-		 * (this will restore missing/defect preferences,
-		 *  but will simply rewrite valid preferences) */
-
-		writePreferences();
-
-	}
-
-	private void fillDefaults() {
-
-		parameterBookmarks = GraphViewPreferenceDefaults.createDefaultAccessParameterBookmarks();
-
-		if (parameterBookmarks.size() > 0) {
-			currentParameterBookmarkName = parameterBookmarks.keySet().iterator().next();
-		} else {
-			currentParameterBookmarkName = null;
-		}
-
-		useInternalRulesets = true;
-		rulesetFolder = GraphViewPreferenceDefaults.getDefaultRulesetFolder();
-		currentRulesetFile = null;
-		currentInternalRuleset = null;
-
-		nodeColor = Color.WHITE;
-		segmentColor = Color.WHITE;
-		currentColorScheme = new PreferencesColorScheme(this);
-
-		separateDirections = false;
-
-	}
-
-	private void writePreferences() {
-
-		Main.pref.put("graphview.parameterBookmarks",
-				createAccessParameterBookmarksString(parameterBookmarks));
-
-		if (currentParameterBookmarkName != null) {
-			Main.pref.put("graphview.activeBookmark", currentParameterBookmarkName);
-		}
-
-		Main.pref.put("graphview.useInternalRulesets", useInternalRulesets);
-
-		Main.pref.put("graphview.rulesetFolder", rulesetFolder.getPath());
-
-		if (currentRulesetFile != null) {
-			Main.pref.put("graphview.rulesetFile", currentRulesetFile.getPath());
-		}
-		if (currentInternalRuleset != null) {
-			Main.pref.put("graphview.rulesetResource", currentInternalRuleset.toString());
-		}
-
-		Main.pref.put("graphview.defaultNodeColor", createColorString(nodeColor));
-		Main.pref.put("graphview.defaultSegmentColor", createColorString(segmentColor));
-
-		Main.pref.put("graphview.separateDirections", separateDirections);
-
-	}
-
-	private void readPreferences() {
-
-		if (Main.pref.hasKey("graphview.parameterBookmarks")) {
-			String bookmarksString = Main.pref.get("graphview.parameterBookmarks");
-			parameterBookmarks = parseAccessParameterBookmarksString(bookmarksString);
-		}
-
-		if (Main.pref.hasKey("graphview.activeBookmark")) {
-			currentParameterBookmarkName = Main.pref.get("graphview.activeBookmark");
-		}
-		if (!parameterBookmarks.containsKey(currentParameterBookmarkName)) {
-			currentParameterBookmarkName = null;
-		}
-
-
-		useInternalRulesets = Main.pref.getBoolean("graphview.useInternalRulesets", true);
-
-		if (Main.pref.hasKey("graphview.rulesetFolder")) {
-			String dirString = Main.pref.get("graphview.rulesetFolder");
-			rulesetFolder = new File(dirString);
-		}
-		if (Main.pref.hasKey("graphview.rulesetFile")) {
-			String fileString = Main.pref.get("graphview.rulesetFile");
-			currentRulesetFile = new File(fileString);
-		}
-
-		if (Main.pref.hasKey("graphview.rulesetResource")) {
-			String rulesetString = Main.pref.get("graphview.rulesetResource");
-			//get the enum value for the string
-			//(InternalRuleset.valueOf cannot be used because it cannot handle invalid strings well)
-			for (InternalRuleset ruleset : InternalRuleset.values()) {
-				if (ruleset.toString().equals(rulesetString)) {
-					currentInternalRuleset = ruleset;
-					break;
-				}
-			}
-		}
-
-		if (Main.pref.hasKey("graphview.defaultNodeColor")) {
-			Color color = parseColorString(Main.pref.get("graphview.defaultNodeColor"));
-			if (color != null) {
-				nodeColor = color;
-			}
-		}
-		if (Main.pref.hasKey("graphview.defaultSegmentColor")) {
-			Color color = parseColorString(Main.pref.get("graphview.defaultSegmentColor"));
-			if (color != null) {
-				segmentColor = color;
-			}
-		}
-
-		separateDirections = Main.pref.getBoolean("graphview.separateDirections", false);
-
-	}
-
-	private static final Pattern ACCESS_PARAM_PATTERN = Pattern.compile("^([^;]*);([^;]*);types=\\{([^\\}]*)\\};properties=\\{([^\\}]*)\\}$");
-
-	private static final Pattern PROPERTY_MAP_ENTRY_PATTERN = Pattern.compile("^([^=]*)=(.*)$");
-
-	private static final Map<VehiclePropertyType<?>, String> VEHICLE_PROPERTY_TYPE_NAME_MAP =
-		new HashMap<VehiclePropertyType<?>, String>();
-
-
-	static {
-		VEHICLE_PROPERTY_TYPE_NAME_MAP.put(AXLELOAD, "AXLELOAD");
-		VEHICLE_PROPERTY_TYPE_NAME_MAP.put(HEIGHT, "HEIGHT");
-		VEHICLE_PROPERTY_TYPE_NAME_MAP.put(LENGTH, "LENGTH");
-		VEHICLE_PROPERTY_TYPE_NAME_MAP.put(MAX_INCLINE_DOWN, "MAX_INCLINE_DOWN");
-		VEHICLE_PROPERTY_TYPE_NAME_MAP.put(MAX_INCLINE_UP, "MAX_INCLINE_UP");
-		VEHICLE_PROPERTY_TYPE_NAME_MAP.put(MAX_TRACKTYPE, "MAX_TRACKTYPE");
-		VEHICLE_PROPERTY_TYPE_NAME_MAP.put(SPEED, "SPEED");
-		VEHICLE_PROPERTY_TYPE_NAME_MAP.put(SURFACE_BLACKLIST, "SURFACE_BLACKLIST");
-		VEHICLE_PROPERTY_TYPE_NAME_MAP.put(WEIGHT, "WEIGHT");
-		VEHICLE_PROPERTY_TYPE_NAME_MAP.put(WIDTH, "WIDTH");
-	}
-
-	private static String createAccessParameterBookmarksString(
-			Map<String, PreferenceAccessParameters> parameterBookmarks) {
-
-		StringBuilder stringBuilder = new StringBuilder();
-
-		boolean firstEntry = true;
-
-		for (String bookmarkName : parameterBookmarks.keySet()) {
-
-			if (!firstEntry) {
-				stringBuilder.append("|");
-			} else {
-				firstEntry = false;
-			}
-
-			stringBuilder.append(createAccessParameterBookmarkString(
-					bookmarkName,
-					parameterBookmarks.get(bookmarkName)));
-
-		}
-
-		return stringBuilder.toString();
-	}
-
-	private static String createAccessParameterBookmarkString(
-			String bookmarkName, PreferenceAccessParameters parameters) {
-
-		StringBuilder stringBuilder = new StringBuilder();
-
-		stringBuilder.append(bookmarkName).append(";");
-
-		stringBuilder.append(parameters.getAccessClass());
-
-		stringBuilder.append(";types={");
-		for (AccessType accessType : AccessType.values()) {
-			if (parameters.getAccessTypeUsable(accessType)) {
-				stringBuilder.append(accessType).append(",");
-			}
-		}
-
-		if(stringBuilder.charAt(stringBuilder.length()-1) == ',') {
-			stringBuilder.deleteCharAt(stringBuilder.length()-1);
-		}
-		stringBuilder.append("}");
-
-		stringBuilder.append(";properties={");
-
-		for (VehiclePropertyType<?> vehiclePropertyType : VEHICLE_PROPERTY_TYPE_NAME_MAP.keySet()) {
-			String propertyString = parameters.getVehiclePropertyString(vehiclePropertyType);
-			if (propertyString != null) {
-				stringBuilder.append(VEHICLE_PROPERTY_TYPE_NAME_MAP.get(vehiclePropertyType));
-				stringBuilder.append("=");
-				stringBuilder.append(propertyString);
-				stringBuilder.append(",");
-			}
-		}
-
-		if(stringBuilder.charAt(stringBuilder.length()-1) == ',') {
-			stringBuilder.deleteCharAt(stringBuilder.length()-1);
-		}
-		stringBuilder.append("}");
-
-		assert ACCESS_PARAM_PATTERN.matcher(stringBuilder.toString()).matches();
-
-		return stringBuilder.toString();
-	}
-
-	private static Map<String, PreferenceAccessParameters> parseAccessParameterBookmarksString(
-			String string) {
-
-		Map<String, PreferenceAccessParameters> resultMap =
-			new HashMap<String, PreferenceAccessParameters>();
-
-		String[] bookmarkStrings = string.split("\\|");
-
-		for (String bookmarkString : bookmarkStrings) {
-			parseAccessParameterBookmarkString(bookmarkString, resultMap);
-		}
-
-		return resultMap;
-	}
-
-	private static void parseAccessParameterBookmarkString(String bookmarkString,
-			Map<String, PreferenceAccessParameters> resultMap) {
-
-		Matcher matcher = ACCESS_PARAM_PATTERN.matcher(bookmarkString);
-
-		if (matcher.matches()) {
-
-			String bookmarkName = matcher.group(1);
-
-			String accessClass = matcher.group(2);
-
-			String[] accessTypeStrings = matcher.group(3).split(",");
-			Collection<AccessType> accessTypes = new LinkedList<AccessType>();
-			for (String accessTypeString : accessTypeStrings) {
-				AccessType accessType = AccessType.valueOf(accessTypeString);
-				if (accessType != null) {
-					accessTypes.add(accessType);
-				}
-			}
-
-
-			String[] vehiclePropertyStrings = matcher.group(4).split(",");
-			Map<VehiclePropertyType<?>, String> vehiclePropertyMap =
-				new HashMap<VehiclePropertyType<?>, String>();
-
-			for (String vehiclePropertyString : vehiclePropertyStrings) {
-
-				Matcher entryMatcher = PROPERTY_MAP_ENTRY_PATTERN.matcher(vehiclePropertyString);
-				if (entryMatcher.matches()) {
-
-					String propertyTypeString = entryMatcher.group(1);
-					String propertyValueString = entryMatcher.group(2);
-
-					for (VehiclePropertyType<?> propertyType :
-						VEHICLE_PROPERTY_TYPE_NAME_MAP.keySet()) {
-
-						if (propertyTypeString.equals(
-								VEHICLE_PROPERTY_TYPE_NAME_MAP.get(propertyType))) {
-
-							vehiclePropertyMap.put(propertyType, propertyValueString);
-
-						}
-
-					}
-
-				}
-
-			}
-
-			try {
-
-				PreferenceAccessParameters accessParameters =
-					new PreferenceAccessParameters(accessClass, accessTypes, vehiclePropertyMap);
-
-				resultMap.put(bookmarkName, accessParameters);
-
-			} catch (PropertyValueSyntaxException e) {
-				//don't add bookmark
-			}
-
-		}
-	}
-
-	private static final Pattern COLOR_PATTERN =
-		Pattern.compile("^(\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})$");
-	private String createColorString(Color color) {
-		return color.getRed() + ", " + color.getGreen() + ", " + color.getBlue();
-	}
-
-	private Color parseColorString(String string) {
-		Matcher matcher = COLOR_PATTERN.matcher(string);
-		if (!matcher.matches()) {
-			return null;
-		} else {
-			int r = Integer.parseInt(matcher.group(1));
-			int g = Integer.parseInt(matcher.group(2));
-			int b = Integer.parseInt(matcher.group(3));
-			return new Color(r, g, b);
-		}
-	}
+    private static GraphViewPreferences instance;
+
+    /**
+     * returns the single instance of GraphViewPreferences.
+     * @param ignoreSyntaxErrors
+     * @return
+     */
+    public static GraphViewPreferences getInstance() {
+        if (instance == null) {
+            instance = new GraphViewPreferences();
+        }
+        return instance;
+    }
+
+    private boolean useInternalRulesets;
+    private File rulesetFolder;
+    private File currentRulesetFile;
+    private InternalRuleset currentInternalRuleset;
+
+    private String currentParameterBookmarkName;
+    private Map<String, PreferenceAccessParameters> parameterBookmarks;
+
+    private ColorScheme currentColorScheme;
+    private Color nodeColor;
+    private Color segmentColor;
+
+    private boolean separateDirections;
+
+
+    public synchronized boolean getUseInternalRulesets() {
+        return useInternalRulesets;
+    }
+    public synchronized void setUseInternalRulesets(boolean useInternalRulesets) {
+        this.useInternalRulesets = useInternalRulesets;
+    }
+
+    public synchronized File getRulesetFolder() {
+        return rulesetFolder;
+    }
+    public synchronized void setRulesetFolder(File rulesetFolder) {
+        this.rulesetFolder = rulesetFolder;
+    }
+
+    public synchronized File getCurrentRulesetFile() {
+        return currentRulesetFile;
+    }
+    public synchronized void setCurrentRulesetFile(File currentRulesetFile) {
+        this.currentRulesetFile = currentRulesetFile;
+    }
+
+    public synchronized InternalRuleset getCurrentInternalRuleset() {
+        return currentInternalRuleset;
+    }
+    public synchronized void setCurrentInternalRuleset(InternalRuleset internalRuleset) {
+        this.currentInternalRuleset = internalRuleset;
+    }
+
+    /**
+     * returns the name (map key) of the currently selected parameter bookmark
+     * or null if none is selected.
+     * If a name is returned, is has to be a key of the map returned by
+     * {@link #getParameterBookmarks()}.
+     */
+    public synchronized String getCurrentParameterBookmarkName() {
+        assert parameterBookmarks.containsKey(currentParameterBookmarkName);
+        return currentParameterBookmarkName;
+    }
+
+    /**
+     * returns the access parameters of the currently selected parameter bookmark
+     * or null if none is selected.
+     */
+    public synchronized AccessParameters getCurrentParameterBookmark() {
+        if (currentParameterBookmarkName == null) {
+            return null;
+        } else {
+            assert parameterBookmarks.containsKey(currentParameterBookmarkName);
+            return parameterBookmarks.get(currentParameterBookmarkName);
+        }
+    }
+
+    /**
+     * sets the active parameter bookmark using its name as an identifier
+     * @param currentParameters  name of bookmark to set or null (no active bookmark).
+     *                           Non-null values must be keys of the map returned by
+     *                           {@link #getParameterBookmarks()}.
+     */
+    public synchronized void setCurrentParameterBookmarkName(String parameterBookmarkName) {
+        assert parameterBookmarks.containsKey(parameterBookmarkName);
+        this.currentParameterBookmarkName = parameterBookmarkName;
+    }
+
+    public synchronized Map<String, PreferenceAccessParameters> getParameterBookmarks() {
+        return Collections.unmodifiableMap(parameterBookmarks);
+    }
+    public synchronized void setParameterBookmarks(
+            Map<String, PreferenceAccessParameters> parameterBookmarks) {
+        assert parameterBookmarks != null;
+
+        this.parameterBookmarks =
+            new HashMap<String, PreferenceAccessParameters>(parameterBookmarks);
+    }
+
+    public synchronized ColorScheme getCurrentColorScheme() {
+        return currentColorScheme;
+    }
+    public synchronized void setCurrentColorScheme(ColorScheme currentColorScheme) {
+        this.currentColorScheme = currentColorScheme;
+    }
+
+    public synchronized Color getNodeColor() {
+        return nodeColor;
+    }
+    public synchronized void setNodeColor(Color nodeColor) {
+        this.nodeColor = nodeColor;
+    }
+
+    public synchronized Color getSegmentColor() {
+        return segmentColor;
+    }
+    public synchronized void setSegmentColor(Color segmentColor) {
+        this.segmentColor = segmentColor;
+    }
+
+    public synchronized boolean getSeparateDirections() {
+        return separateDirections;
+    }
+    public synchronized void setSeparateDirections(boolean separateDirections) {
+        this.separateDirections = separateDirections;
+    }
+
+    /**
+     * writes changes to JOSM's preferences and notifies observers.
+     * Must be called explicitly after setters (to prevent distributing incomplete changes).
+     */
+    public void distributeChanges() {
+        writePreferences();
+        setChanged();
+        notifyObservers();
+    }
+
+    private GraphViewPreferences() {
+
+        /* set defaults first (in case preferences are incomplete) */
+
+        fillDefaults();
+
+        /* read preferences and overwrite defaults */
+
+        readPreferences();
+
+        /* write preferences
+         * (this will restore missing/defect preferences,
+         *  but will simply rewrite valid preferences) */
+
+        writePreferences();
+
+    }
+
+    private void fillDefaults() {
+
+        parameterBookmarks = GraphViewPreferenceDefaults.createDefaultAccessParameterBookmarks();
+
+        if (parameterBookmarks.size() > 0) {
+            currentParameterBookmarkName = parameterBookmarks.keySet().iterator().next();
+        } else {
+            currentParameterBookmarkName = null;
+        }
+
+        useInternalRulesets = true;
+        rulesetFolder = GraphViewPreferenceDefaults.getDefaultRulesetFolder();
+        currentRulesetFile = null;
+        currentInternalRuleset = null;
+
+        nodeColor = Color.WHITE;
+        segmentColor = Color.WHITE;
+        currentColorScheme = new PreferencesColorScheme(this);
+
+        separateDirections = false;
+
+    }
+
+    private void writePreferences() {
+
+        Main.pref.put("graphview.parameterBookmarks",
+                createAccessParameterBookmarksString(parameterBookmarks));
+
+        if (currentParameterBookmarkName != null) {
+            Main.pref.put("graphview.activeBookmark", currentParameterBookmarkName);
+        }
+
+        Main.pref.put("graphview.useInternalRulesets", useInternalRulesets);
+
+        Main.pref.put("graphview.rulesetFolder", rulesetFolder.getPath());
+
+        if (currentRulesetFile != null) {
+            Main.pref.put("graphview.rulesetFile", currentRulesetFile.getPath());
+        }
+        if (currentInternalRuleset != null) {
+            Main.pref.put("graphview.rulesetResource", currentInternalRuleset.toString());
+        }
+
+        Main.pref.put("graphview.defaultNodeColor", createColorString(nodeColor));
+        Main.pref.put("graphview.defaultSegmentColor", createColorString(segmentColor));
+
+        Main.pref.put("graphview.separateDirections", separateDirections);
+
+    }
+
+    private void readPreferences() {
+
+        if (Main.pref.hasKey("graphview.parameterBookmarks")) {
+            String bookmarksString = Main.pref.get("graphview.parameterBookmarks");
+            parameterBookmarks = parseAccessParameterBookmarksString(bookmarksString);
+        }
+
+        if (Main.pref.hasKey("graphview.activeBookmark")) {
+            currentParameterBookmarkName = Main.pref.get("graphview.activeBookmark");
+        }
+        if (!parameterBookmarks.containsKey(currentParameterBookmarkName)) {
+            currentParameterBookmarkName = null;
+        }
+
+
+        useInternalRulesets = Main.pref.getBoolean("graphview.useInternalRulesets", true);
+
+        if (Main.pref.hasKey("graphview.rulesetFolder")) {
+            String dirString = Main.pref.get("graphview.rulesetFolder");
+            rulesetFolder = new File(dirString);
+        }
+        if (Main.pref.hasKey("graphview.rulesetFile")) {
+            String fileString = Main.pref.get("graphview.rulesetFile");
+            currentRulesetFile = new File(fileString);
+        }
+
+        if (Main.pref.hasKey("graphview.rulesetResource")) {
+            String rulesetString = Main.pref.get("graphview.rulesetResource");
+            //get the enum value for the string
+            //(InternalRuleset.valueOf cannot be used because it cannot handle invalid strings well)
+            for (InternalRuleset ruleset : InternalRuleset.values()) {
+                if (ruleset.toString().equals(rulesetString)) {
+                    currentInternalRuleset = ruleset;
+                    break;
+                }
+            }
+        }
+
+        if (Main.pref.hasKey("graphview.defaultNodeColor")) {
+            Color color = parseColorString(Main.pref.get("graphview.defaultNodeColor"));
+            if (color != null) {
+                nodeColor = color;
+            }
+        }
+        if (Main.pref.hasKey("graphview.defaultSegmentColor")) {
+            Color color = parseColorString(Main.pref.get("graphview.defaultSegmentColor"));
+            if (color != null) {
+                segmentColor = color;
+            }
+        }
+
+        separateDirections = Main.pref.getBoolean("graphview.separateDirections", false);
+
+    }
+
+    private static final Pattern ACCESS_PARAM_PATTERN = Pattern.compile("^([^;]*);([^;]*);types=\\{([^\\}]*)\\};properties=\\{([^\\}]*)\\}$");
+
+    private static final Pattern PROPERTY_MAP_ENTRY_PATTERN = Pattern.compile("^([^=]*)=(.*)$");
+
+    private static final Map<VehiclePropertyType<?>, String> VEHICLE_PROPERTY_TYPE_NAME_MAP =
+        new HashMap<VehiclePropertyType<?>, String>();
+
+
+    static {
+        VEHICLE_PROPERTY_TYPE_NAME_MAP.put(AXLELOAD, "AXLELOAD");
+        VEHICLE_PROPERTY_TYPE_NAME_MAP.put(HEIGHT, "HEIGHT");
+        VEHICLE_PROPERTY_TYPE_NAME_MAP.put(LENGTH, "LENGTH");
+        VEHICLE_PROPERTY_TYPE_NAME_MAP.put(MAX_INCLINE_DOWN, "MAX_INCLINE_DOWN");
+        VEHICLE_PROPERTY_TYPE_NAME_MAP.put(MAX_INCLINE_UP, "MAX_INCLINE_UP");
+        VEHICLE_PROPERTY_TYPE_NAME_MAP.put(MAX_TRACKTYPE, "MAX_TRACKTYPE");
+        VEHICLE_PROPERTY_TYPE_NAME_MAP.put(SPEED, "SPEED");
+        VEHICLE_PROPERTY_TYPE_NAME_MAP.put(SURFACE_BLACKLIST, "SURFACE_BLACKLIST");
+        VEHICLE_PROPERTY_TYPE_NAME_MAP.put(WEIGHT, "WEIGHT");
+        VEHICLE_PROPERTY_TYPE_NAME_MAP.put(WIDTH, "WIDTH");
+    }
+
+    private static String createAccessParameterBookmarksString(
+            Map<String, PreferenceAccessParameters> parameterBookmarks) {
+
+        StringBuilder stringBuilder = new StringBuilder();
+
+        boolean firstEntry = true;
+
+        for (String bookmarkName : parameterBookmarks.keySet()) {
+
+            if (!firstEntry) {
+                stringBuilder.append("|");
+            } else {
+                firstEntry = false;
+            }
+
+            stringBuilder.append(createAccessParameterBookmarkString(
+                    bookmarkName,
+                    parameterBookmarks.get(bookmarkName)));
+
+        }
+
+        return stringBuilder.toString();
+    }
+
+    private static String createAccessParameterBookmarkString(
+            String bookmarkName, PreferenceAccessParameters parameters) {
+
+        StringBuilder stringBuilder = new StringBuilder();
+
+        stringBuilder.append(bookmarkName).append(";");
+
+        stringBuilder.append(parameters.getAccessClass());
+
+        stringBuilder.append(";types={");
+        for (AccessType accessType : AccessType.values()) {
+            if (parameters.getAccessTypeUsable(accessType)) {
+                stringBuilder.append(accessType).append(",");
+            }
+        }
+
+        if(stringBuilder.charAt(stringBuilder.length()-1) == ',') {
+            stringBuilder.deleteCharAt(stringBuilder.length()-1);
+        }
+        stringBuilder.append("}");
+
+        stringBuilder.append(";properties={");
+
+        for (VehiclePropertyType<?> vehiclePropertyType : VEHICLE_PROPERTY_TYPE_NAME_MAP.keySet()) {
+            String propertyString = parameters.getVehiclePropertyString(vehiclePropertyType);
+            if (propertyString != null) {
+                stringBuilder.append(VEHICLE_PROPERTY_TYPE_NAME_MAP.get(vehiclePropertyType));
+                stringBuilder.append("=");
+                stringBuilder.append(propertyString);
+                stringBuilder.append(",");
+            }
+        }
+
+        if(stringBuilder.charAt(stringBuilder.length()-1) == ',') {
+            stringBuilder.deleteCharAt(stringBuilder.length()-1);
+        }
+        stringBuilder.append("}");
+
+        assert ACCESS_PARAM_PATTERN.matcher(stringBuilder.toString()).matches();
+
+        return stringBuilder.toString();
+    }
+
+    private static Map<String, PreferenceAccessParameters> parseAccessParameterBookmarksString(
+            String string) {
+
+        Map<String, PreferenceAccessParameters> resultMap =
+            new HashMap<String, PreferenceAccessParameters>();
+
+        String[] bookmarkStrings = string.split("\\|");
+
+        for (String bookmarkString : bookmarkStrings) {
+            parseAccessParameterBookmarkString(bookmarkString, resultMap);
+        }
+
+        return resultMap;
+    }
+
+    private static void parseAccessParameterBookmarkString(String bookmarkString,
+            Map<String, PreferenceAccessParameters> resultMap) {
+
+        Matcher matcher = ACCESS_PARAM_PATTERN.matcher(bookmarkString);
+
+        if (matcher.matches()) {
+
+            String bookmarkName = matcher.group(1);
+
+            String accessClass = matcher.group(2);
+
+            String[] accessTypeStrings = matcher.group(3).split(",");
+            Collection<AccessType> accessTypes = new LinkedList<AccessType>();
+            for (String accessTypeString : accessTypeStrings) {
+                AccessType accessType = AccessType.valueOf(accessTypeString);
+                if (accessType != null) {
+                    accessTypes.add(accessType);
+                }
+            }
+
+
+            String[] vehiclePropertyStrings = matcher.group(4).split(",");
+            Map<VehiclePropertyType<?>, String> vehiclePropertyMap =
+                new HashMap<VehiclePropertyType<?>, String>();
+
+            for (String vehiclePropertyString : vehiclePropertyStrings) {
+
+                Matcher entryMatcher = PROPERTY_MAP_ENTRY_PATTERN.matcher(vehiclePropertyString);
+                if (entryMatcher.matches()) {
+
+                    String propertyTypeString = entryMatcher.group(1);
+                    String propertyValueString = entryMatcher.group(2);
+
+                    for (VehiclePropertyType<?> propertyType :
+                        VEHICLE_PROPERTY_TYPE_NAME_MAP.keySet()) {
+
+                        if (propertyTypeString.equals(
+                                VEHICLE_PROPERTY_TYPE_NAME_MAP.get(propertyType))) {
+
+                            vehiclePropertyMap.put(propertyType, propertyValueString);
+
+                        }
+
+                    }
+
+                }
+
+            }
+
+            try {
+
+                PreferenceAccessParameters accessParameters =
+                    new PreferenceAccessParameters(accessClass, accessTypes, vehiclePropertyMap);
+
+                resultMap.put(bookmarkName, accessParameters);
+
+            } catch (PropertyValueSyntaxException e) {
+                //don't add bookmark
+            }
+
+        }
+    }
+
+    private static final Pattern COLOR_PATTERN =
+        Pattern.compile("^(\\d{1,3}),\\s*(\\d{1,3}),\\s*(\\d{1,3})$");
+    private String createColorString(Color color) {
+        return color.getRed() + ", " + color.getGreen() + ", " + color.getBlue();
+    }
+
+    private Color parseColorString(String string) {
+        Matcher matcher = COLOR_PATTERN.matcher(string);
+        if (!matcher.matches()) {
+            return null;
+        } else {
+            int r = Integer.parseInt(matcher.group(1));
+            int g = Integer.parseInt(matcher.group(2));
+            int b = Integer.parseInt(matcher.group(3));
+            return new Color(r, g, b);
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/InternalRuleset.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/InternalRuleset.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/InternalRuleset.java	(revision 23189)
@@ -3,13 +3,13 @@
 public enum InternalRuleset {
 
-	DEFAULT("files/accessRuleset.xml"),
-	GERMANY("files/accessRuleset_de.xml");
+    DEFAULT("files/accessRuleset.xml"),
+    GERMANY("files/accessRuleset_de.xml");
 
-	private String resourceName;
-	private InternalRuleset(String resourceName) {
-		this.resourceName = resourceName;
-	}
-	public String getResourceName() {
-		return resourceName;
-	}
+    private String resourceName;
+    private InternalRuleset(String resourceName) {
+        this.resourceName = resourceName;
+    }
+    public String getResourceName() {
+        return resourceName;
+    }
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/PreferenceAccessParameters.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/PreferenceAccessParameters.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/PreferenceAccessParameters.java	(revision 23189)
@@ -17,85 +17,85 @@
 public class PreferenceAccessParameters implements AccessParameters {
 
-	private final String accessClass;
-	private final Map<AccessType, Boolean> accessTypeUsableMap;
-	private final Map<VehiclePropertyType<?>, String> vehiclePropertyStrings;
-	private final Map<VehiclePropertyType<?>, Object> vehiclePropertyValues;
+    private final String accessClass;
+    private final Map<AccessType, Boolean> accessTypeUsableMap;
+    private final Map<VehiclePropertyType<?>, String> vehiclePropertyStrings;
+    private final Map<VehiclePropertyType<?>, Object> vehiclePropertyValues;
 
-	public String getAccessClass() {
-		return accessClass;
-	}
+    public String getAccessClass() {
+        return accessClass;
+    }
 
-	public boolean getAccessTypeUsable(AccessType accessType) {
-		assert accessType != null;
-		return accessTypeUsableMap.get(accessType);
-	}
+    public boolean getAccessTypeUsable(AccessType accessType) {
+        assert accessType != null;
+        return accessTypeUsableMap.get(accessType);
+    }
 
-	public Collection<VehiclePropertyType<?>> getAvailableVehicleProperties() {
-		return vehiclePropertyValues.keySet();
-	}
+    public Collection<VehiclePropertyType<?>> getAvailableVehicleProperties() {
+        return vehiclePropertyValues.keySet();
+    }
 
-	/**
-	 * returns the value for a vehicle property.
-	 *
-	 * @param <D>              type of property value
-	 * @param vehicleProperty  property to get value for; != null
-	 * @return                 value for vehicleProperty, null if no value is available.
-	 *                         Guaranteed to be valid according to vehicleProperty's
-	 *                         {@link VehiclePropertyType#isValidValue(Object)} method.
-	 */
-	public <D> D getVehiclePropertyValue(VehiclePropertyType<D> vehicleProperty) {
-		assert vehicleProperty != null;
+    /**
+     * returns the value for a vehicle property.
+     *
+     * @param <D>              type of property value
+     * @param vehicleProperty  property to get value for; != null
+     * @return                 value for vehicleProperty, null if no value is available.
+     *                         Guaranteed to be valid according to vehicleProperty's
+     *                         {@link VehiclePropertyType#isValidValue(Object)} method.
+     */
+    public <D> D getVehiclePropertyValue(VehiclePropertyType<D> vehicleProperty) {
+        assert vehicleProperty != null;
 
-		@SuppressWarnings("unchecked")
-		D value = (D)vehiclePropertyValues.get(vehicleProperty);
-		return value;
-	}
+        @SuppressWarnings("unchecked")
+        D value = (D)vehiclePropertyValues.get(vehicleProperty);
+        return value;
+    }
 
-	/**
-	 * returns the unparsed String for a vehicle property.
-	 *
-	 * @param vehicleProperty  property to get String for; != null
-	 * @return                 unparsed String, null if no value is available.
-	 */
-	public String getVehiclePropertyString(VehiclePropertyType<?> vehicleProperty) {
-		assert vehicleProperty != null;
+    /**
+     * returns the unparsed String for a vehicle property.
+     *
+     * @param vehicleProperty  property to get String for; != null
+     * @return                 unparsed String, null if no value is available.
+     */
+    public String getVehiclePropertyString(VehiclePropertyType<?> vehicleProperty) {
+        assert vehicleProperty != null;
 
-		return vehiclePropertyStrings.get(vehicleProperty);
-	}
+        return vehiclePropertyStrings.get(vehicleProperty);
+    }
 
-	/**
-	 * @param vehiclePropertyStrings  map from vehicle properties to string representations
-	 *                                that will be parsed using {@link VehiclePropertyStringParser}
-	 *                                to get the property values; != null
-	 *
-	 * @throws VehiclePropertyStringParser.PropertyValueSyntaxException
-	 *         if a String from vehiclePropertyStrings contains a syntax error
-	 */
-	public PreferenceAccessParameters(String accessClass,
-			Collection<AccessType> usableAccessTypes,
-			Map<VehiclePropertyType<?>, String> vehiclePropertyStrings)
-	throws VehiclePropertyStringParser.PropertyValueSyntaxException {
+    /**
+     * @param vehiclePropertyStrings  map from vehicle properties to string representations
+     *                                that will be parsed using {@link VehiclePropertyStringParser}
+     *                                to get the property values; != null
+     *
+     * @throws VehiclePropertyStringParser.PropertyValueSyntaxException
+     *         if a String from vehiclePropertyStrings contains a syntax error
+     */
+    public PreferenceAccessParameters(String accessClass,
+            Collection<AccessType> usableAccessTypes,
+            Map<VehiclePropertyType<?>, String> vehiclePropertyStrings)
+    throws VehiclePropertyStringParser.PropertyValueSyntaxException {
 
-		this.accessClass = accessClass;
+        this.accessClass = accessClass;
 
-		accessTypeUsableMap = new EnumMap<AccessType, Boolean>(AccessType.class);
-		for (AccessType accessType : AccessType.values()) {
-			accessTypeUsableMap.put(accessType, usableAccessTypes.contains(accessType));
-		}
+        accessTypeUsableMap = new EnumMap<AccessType, Boolean>(AccessType.class);
+        for (AccessType accessType : AccessType.values()) {
+            accessTypeUsableMap.put(accessType, usableAccessTypes.contains(accessType));
+        }
 
-		/* check and use vehicle properties */
+        /* check and use vehicle properties */
 
-		this.vehiclePropertyStrings = Collections.unmodifiableMap(
-				new HashMap<VehiclePropertyType<?>, String>(vehiclePropertyStrings));
+        this.vehiclePropertyStrings = Collections.unmodifiableMap(
+                new HashMap<VehiclePropertyType<?>, String>(vehiclePropertyStrings));
 
-		this.vehiclePropertyValues = new HashMap<VehiclePropertyType<?>, Object>();
-		for (VehiclePropertyType<?> vehiclePropertyType : vehiclePropertyStrings.keySet()) {
-			String propertyValueString = vehiclePropertyStrings.get(vehiclePropertyType);
-			Object propertyValue = VehiclePropertyStringParser.parsePropertyValue(
-					vehiclePropertyType, propertyValueString);
-			this.vehiclePropertyValues.put(vehiclePropertyType, propertyValue);
-		}
+        this.vehiclePropertyValues = new HashMap<VehiclePropertyType<?>, Object>();
+        for (VehiclePropertyType<?> vehiclePropertyType : vehiclePropertyStrings.keySet()) {
+            String propertyValueString = vehiclePropertyStrings.get(vehiclePropertyType);
+            Object propertyValue = VehiclePropertyStringParser.parsePropertyValue(
+                    vehiclePropertyType, propertyValueString);
+            this.vehiclePropertyValues.put(vehiclePropertyType, propertyValue);
+        }
 
-	}
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/VehiclePropertyStringParser.java
===================================================================
--- /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/VehiclePropertyStringParser.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/preferences/VehiclePropertyStringParser.java	(revision 23189)
@@ -16,137 +16,137 @@
 public final class VehiclePropertyStringParser {
 
-	/** prevents instantiation */
-	private VehiclePropertyStringParser() { }
+    /** prevents instantiation */
+    private VehiclePropertyStringParser() { }
 
-	/**
-	 * Exception class for syntax errors in property value Strings,
-	 * the message contains the reason using one of this utility class' public String constants.
-	 */
-	public static class PropertyValueSyntaxException extends Exception {
-		private static final long serialVersionUID = 1L;
-		public PropertyValueSyntaxException(String message) {
-			super(message);
-		}
-	}
+    /**
+     * Exception class for syntax errors in property value Strings,
+     * the message contains the reason using one of this utility class' public String constants.
+     */
+    public static class PropertyValueSyntaxException extends Exception {
+        private static final long serialVersionUID = 1L;
+        public PropertyValueSyntaxException(String message) {
+            super(message);
+        }
+    }
 
-	public static final String ERROR_WEIGHT =
-		"Weights must be given as positive decimal numbers with unit \"t\" or without unit.";
-	public static final String ERROR_LENGTH =
-		"Lengths must be given as positive decimal numbers with unit \"m\", \"km\", \"mi\"" +
-		" or without unit.\nAlternatively, the format FEET' INCHES\" can be used.";
-	public static final String ERROR_SPEED =
-		"Speeds should be given as numbers without unit or "
-		+ "as numbers followed by \"mph\".";
-	public static final String ERROR_INCLINE =
-		"Inclines must be given as positive decimal numbers with followed by \"%\".";
-	public static final String ERROR_TRACKTYPE =
-		"Tracktype grades must be given as integers between 0 and 5.";
-	public static final String ERROR_SURFACE =
-		"Surface values must not contain any of the following characters: ',' '{' '}' '=' '|";
+    public static final String ERROR_WEIGHT =
+        "Weights must be given as positive decimal numbers with unit \"t\" or without unit.";
+    public static final String ERROR_LENGTH =
+        "Lengths must be given as positive decimal numbers with unit \"m\", \"km\", \"mi\"" +
+        " or without unit.\nAlternatively, the format FEET' INCHES\" can be used.";
+    public static final String ERROR_SPEED =
+        "Speeds should be given as numbers without unit or "
+        + "as numbers followed by \"mph\".";
+    public static final String ERROR_INCLINE =
+        "Inclines must be given as positive decimal numbers with followed by \"%\".";
+    public static final String ERROR_TRACKTYPE =
+        "Tracktype grades must be given as integers between 0 and 5.";
+    public static final String ERROR_SURFACE =
+        "Surface values must not contain any of the following characters: ',' '{' '}' '=' '|";
 
-	private static final List<Character> FORBIDDEN_SURFACE_CHARS =
-		Arrays.asList(',', '{', '}', '=', '|');
+    private static final List<Character> FORBIDDEN_SURFACE_CHARS =
+        Arrays.asList(',', '{', '}', '=', '|');
 
-	/**
-	 * returns the value represented by the propertyValueString
-	 *
-	 * @throws PropertyValueSyntaxException  if the string has syntax errors that prevent parsing
-	 * @throws InvalidParameterException     if an unknown property type was passed
-	 *
-	 * @param propertyType         type of the property; != null
-	 * @param propertyValueString  string to parse; != null
-	 * @return                     property value; != null.
-	 *                             Guaranteed to be valid according to propertyType's
-	 *                             {@link VehiclePropertyType#isValidValue(Object)} method.
-	 */
-	public static final <V> V parsePropertyValue(
-			VehiclePropertyType<V> propertyType, String propertyValueString)
-	throws PropertyValueSyntaxException {
+    /**
+     * returns the value represented by the propertyValueString
+     *
+     * @throws PropertyValueSyntaxException  if the string has syntax errors that prevent parsing
+     * @throws InvalidParameterException     if an unknown property type was passed
+     *
+     * @param propertyType         type of the property; != null
+     * @param propertyValueString  string to parse; != null
+     * @return                     property value; != null.
+     *                             Guaranteed to be valid according to propertyType's
+     *                             {@link VehiclePropertyType#isValidValue(Object)} method.
+     */
+    public static final <V> V parsePropertyValue(
+            VehiclePropertyType<V> propertyType, String propertyValueString)
+    throws PropertyValueSyntaxException {
 
-		assert propertyType != null && propertyValueString != null;
+        assert propertyType != null && propertyValueString != null;
 
-		if (propertyType == VehiclePropertyTypes.AXLELOAD
-				|| propertyType == VehiclePropertyTypes.WEIGHT) {
+        if (propertyType == VehiclePropertyTypes.AXLELOAD
+                || propertyType == VehiclePropertyTypes.WEIGHT) {
 
-			Float value = ValueStringParser.parseWeight(propertyValueString);
-			if (value != null && propertyType.isValidValue(value)) {
-				@SuppressWarnings("unchecked") //V must be float because of propertyType condition
-				V result = (V)value;
-				return result;
-			} else {
-				throw new PropertyValueSyntaxException(ERROR_WEIGHT);
-			}
+            Float value = ValueStringParser.parseWeight(propertyValueString);
+            if (value != null && propertyType.isValidValue(value)) {
+                @SuppressWarnings("unchecked") //V must be float because of propertyType condition
+                V result = (V)value;
+                return result;
+            } else {
+                throw new PropertyValueSyntaxException(ERROR_WEIGHT);
+            }
 
-		} else if (propertyType == VehiclePropertyTypes.HEIGHT
-				|| propertyType == VehiclePropertyTypes.LENGTH
-				|| propertyType == VehiclePropertyTypes.WIDTH) {
+        } else if (propertyType == VehiclePropertyTypes.HEIGHT
+                || propertyType == VehiclePropertyTypes.LENGTH
+                || propertyType == VehiclePropertyTypes.WIDTH) {
 
-			Float value = ValueStringParser.parseMeasure(propertyValueString);
-			if (value != null && propertyType.isValidValue(value)) {
-				@SuppressWarnings("unchecked") //V must be float because of propertyType condition
-				V result = (V)value;
-				return result;
-			} else {
-				throw new PropertyValueSyntaxException(ERROR_LENGTH);
-			}
+            Float value = ValueStringParser.parseMeasure(propertyValueString);
+            if (value != null && propertyType.isValidValue(value)) {
+                @SuppressWarnings("unchecked") //V must be float because of propertyType condition
+                V result = (V)value;
+                return result;
+            } else {
+                throw new PropertyValueSyntaxException(ERROR_LENGTH);
+            }
 
-		} else if (propertyType == VehiclePropertyTypes.SPEED) {
+        } else if (propertyType == VehiclePropertyTypes.SPEED) {
 
-			Float value = ValueStringParser.parseSpeed(propertyValueString);
-			if (value != null && propertyType.isValidValue(value)) {
-				@SuppressWarnings("unchecked") //V must be float because of propertyType condition
-				V result = (V)value;
-				return result;
-			} else {
-				throw new PropertyValueSyntaxException(ERROR_SPEED);
-			}
+            Float value = ValueStringParser.parseSpeed(propertyValueString);
+            if (value != null && propertyType.isValidValue(value)) {
+                @SuppressWarnings("unchecked") //V must be float because of propertyType condition
+                V result = (V)value;
+                return result;
+            } else {
+                throw new PropertyValueSyntaxException(ERROR_SPEED);
+            }
 
-		} else if (propertyType == VehiclePropertyTypes.MAX_INCLINE_DOWN
-				|| propertyType == VehiclePropertyTypes.MAX_INCLINE_UP) {
+        } else if (propertyType == VehiclePropertyTypes.MAX_INCLINE_DOWN
+                || propertyType == VehiclePropertyTypes.MAX_INCLINE_UP) {
 
-			Float value = ValueStringParser.parseIncline(propertyValueString);
-			if (value != null && propertyType.isValidValue(value)) {
-				@SuppressWarnings("unchecked") //V must be float because of propertyType condition
-				V result = (V)value;
-				return result;
-			} else {
-				throw new PropertyValueSyntaxException(ERROR_INCLINE);
-			}
+            Float value = ValueStringParser.parseIncline(propertyValueString);
+            if (value != null && propertyType.isValidValue(value)) {
+                @SuppressWarnings("unchecked") //V must be float because of propertyType condition
+                V result = (V)value;
+                return result;
+            } else {
+                throw new PropertyValueSyntaxException(ERROR_INCLINE);
+            }
 
-		} else if (propertyType == VehiclePropertyTypes.MAX_TRACKTYPE) {
+        } else if (propertyType == VehiclePropertyTypes.MAX_TRACKTYPE) {
 
-			try {
-				int value = Integer.parseInt(propertyValueString);
-				if (0 <= value && value <= 5) {
-					@SuppressWarnings("unchecked") //V must be int because of propertyType condition
-					V result = (V)(Integer)value;
-					return result;
-				}
-			} catch (NumberFormatException e) {}
+            try {
+                int value = Integer.parseInt(propertyValueString);
+                if (0 <= value && value <= 5) {
+                    @SuppressWarnings("unchecked") //V must be int because of propertyType condition
+                    V result = (V)(Integer)value;
+                    return result;
+                }
+            } catch (NumberFormatException e) {}
 
-			throw new PropertyValueSyntaxException(ERROR_TRACKTYPE);
+            throw new PropertyValueSyntaxException(ERROR_TRACKTYPE);
 
-		} else if (propertyType == VehiclePropertyTypes.SURFACE_BLACKLIST) {
+        } else if (propertyType == VehiclePropertyTypes.SURFACE_BLACKLIST) {
 
-			String[] surfaces = propertyValueString.split(";\\s*");
-			Collection<String> surfaceBlacklist = new ArrayList<String>(surfaces.length);
-			for (String surface : surfaces) {
-				for (char nameChar : surface.toCharArray()) {
-					if (FORBIDDEN_SURFACE_CHARS.contains(nameChar)) {
-						throw new PropertyValueSyntaxException(ERROR_SURFACE);
-					}
-				}
-				surfaceBlacklist.add(surface);
-			}
+            String[] surfaces = propertyValueString.split(";\\s*");
+            Collection<String> surfaceBlacklist = new ArrayList<String>(surfaces.length);
+            for (String surface : surfaces) {
+                for (char nameChar : surface.toCharArray()) {
+                    if (FORBIDDEN_SURFACE_CHARS.contains(nameChar)) {
+                        throw new PropertyValueSyntaxException(ERROR_SURFACE);
+                    }
+                }
+                surfaceBlacklist.add(surface);
+            }
 
-			@SuppressWarnings("unchecked") //V must be Collection because of propertyType condition
-			V result = (V)surfaceBlacklist;
-			return result;
+            @SuppressWarnings("unchecked") //V must be Collection because of propertyType condition
+            V result = (V)surfaceBlacklist;
+            return result;
 
-		} else {
-			throw new InvalidParameterException("unknown property type: " + propertyType);
-		}
+        } else {
+            throw new InvalidParameterException("unknown property type: " + propertyType);
+        }
 
-	}
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/FullGraphCreationTest.java
===================================================================
--- /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/FullGraphCreationTest.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/FullGraphCreationTest.java	(revision 23189)
@@ -32,150 +32,150 @@
 public class FullGraphCreationTest {
 
-	private static final AccessParameters ACCESS_PARAMS;
-	static {
-		Map<VehiclePropertyType<?>, String> vehiclePropertyValues =
-			new HashMap<VehiclePropertyType<?>, String>();
-		vehiclePropertyValues.put(VehiclePropertyTypes.WIDTH, "3.0");
+    private static final AccessParameters ACCESS_PARAMS;
+    static {
+        Map<VehiclePropertyType<?>, String> vehiclePropertyValues =
+            new HashMap<VehiclePropertyType<?>, String>();
+        vehiclePropertyValues.put(VehiclePropertyTypes.WIDTH, "3.0");
 
-		try {
-			ACCESS_PARAMS = new PreferenceAccessParameters(
-					"test_vehicle",
-					Arrays.asList(AccessType.UNDEFINED),
-					vehiclePropertyValues);
-		} catch (PropertyValueSyntaxException e) {
-			throw new Error(e);
-		}
-	}
+        try {
+            ACCESS_PARAMS = new PreferenceAccessParameters(
+                    "test_vehicle",
+                    Arrays.asList(AccessType.UNDEFINED),
+                    vehiclePropertyValues);
+        } catch (PropertyValueSyntaxException e) {
+            throw new Error(e);
+        }
+    }
 
-	private static final AccessRuleset TEST_RULESET = new AccessRuleset() {
-		public java.util.List<String> getAccessHierarchyAncestors(String transportMode) {
-			return Arrays.asList(transportMode);
-		}
-		public java.util.Collection<Tag> getBaseTags() {
-			return Arrays.asList(new Tag("highway", "test"));
-		}
-		public java.util.List<Implication> getImplications() {
-			return new LinkedList<Implication>();
-		}
-	};
+    private static final AccessRuleset TEST_RULESET = new AccessRuleset() {
+        public java.util.List<String> getAccessHierarchyAncestors(String transportMode) {
+            return Arrays.asList(transportMode);
+        }
+        public java.util.Collection<Tag> getBaseTags() {
+            return Arrays.asList(new Tag("highway", "test"));
+        }
+        public java.util.List<Implication> getImplications() {
+            return new LinkedList<Implication>();
+        }
+    };
 
-	@Test
-	public void testTJunction() {
+    @Test
+    public void testTJunction() {
 
-		TestDataSource ds = new TestDataSource();
+        TestDataSource ds = new TestDataSource();
 
-		TestNode nodeN = new TestNode(2, 1);
-		TestNode nodeW = new TestNode(1, 0);
-		TestNode nodeS = new TestNode(0, 1);
-		TestNode nodeC = new TestNode(1, 1);
+        TestNode nodeN = new TestNode(2, 1);
+        TestNode nodeW = new TestNode(1, 0);
+        TestNode nodeS = new TestNode(0, 1);
+        TestNode nodeC = new TestNode(1, 1);
 
-		ds.nodes.addAll(Arrays.asList(nodeN, nodeW, nodeS, nodeC));
+        ds.nodes.addAll(Arrays.asList(nodeN, nodeW, nodeS, nodeC));
 
-		TestWay wayNC = new TestWay();
-		wayNC.tags.put("highway", "test");
-		wayNC.nodes.addAll(Arrays.asList(nodeN, nodeC));
-		TestWay wayCS = new TestWay();
-		wayCS.tags.put("highway", "test");
-		wayCS.nodes.addAll(Arrays.asList(nodeC, nodeS));
-		TestWay wayCW = new TestWay();
-		wayCW.tags.put("highway", "test");
-		wayCW.nodes.addAll(Arrays.asList(nodeC, nodeW));
+        TestWay wayNC = new TestWay();
+        wayNC.tags.put("highway", "test");
+        wayNC.nodes.addAll(Arrays.asList(nodeN, nodeC));
+        TestWay wayCS = new TestWay();
+        wayCS.tags.put("highway", "test");
+        wayCS.nodes.addAll(Arrays.asList(nodeC, nodeS));
+        TestWay wayCW = new TestWay();
+        wayCW.tags.put("highway", "test");
+        wayCW.nodes.addAll(Arrays.asList(nodeC, nodeW));
 
-		ds.ways.add(wayNC);
-		ds.ways.add(wayCS);
-		ds.ways.add(wayCW);
+        ds.ways.add(wayNC);
+        ds.ways.add(wayCS);
+        ds.ways.add(wayCW);
 
-		/* variant 1: no restrictions */
-		{
-			TransitionStructure ts1 = createTestTransitionStructure(ds);
+        /* variant 1: no restrictions */
+        {
+            TransitionStructure ts1 = createTestTransitionStructure(ds);
 
-			assertSame(4, size(ts1.getNodes()));
-			assertSame(6, size(ts1.getSegments()));
-			assertSame(0, size(ts1.getRestrictions()));
+            assertSame(4, size(ts1.getNodes()));
+            assertSame(6, size(ts1.getSegments()));
+            assertSame(0, size(ts1.getRestrictions()));
 
-			WayGraph graph1 = new TSBasedWayGraph(ts1);
+            WayGraph graph1 = new TSBasedWayGraph(ts1);
 
-			assertSame(12, graph1.getNodes().size());
-			assertSame(24, graph1.getEdges().size());
-		}
-		/* variant 2: no left turn from S to W */
-		{
-			ds.relations.add(createTurnRestrictionRelation(wayCS, nodeC, wayCW, "no_left_turn"));
-			TransitionStructure ts2 = createTestTransitionStructure(ds);
+            assertSame(12, graph1.getNodes().size());
+            assertSame(24, graph1.getEdges().size());
+        }
+        /* variant 2: no left turn from S to W */
+        {
+            ds.relations.add(createTurnRestrictionRelation(wayCS, nodeC, wayCW, "no_left_turn"));
+            TransitionStructure ts2 = createTestTransitionStructure(ds);
 
-			assertSame(4, size(ts2.getNodes()));
-			assertSame(6, size(ts2.getSegments()));
-			assertSame(1, size(ts2.getRestrictions()));
+            assertSame(4, size(ts2.getNodes()));
+            assertSame(6, size(ts2.getSegments()));
+            assertSame(1, size(ts2.getRestrictions()));
 
-			WayGraph graph2 = new TSBasedWayGraph(ts2);
+            WayGraph graph2 = new TSBasedWayGraph(ts2);
 
-			assertSame(12, graph2.getNodes().size());
-			assertSame(23, graph2.getEdges().size());
-		}
+            assertSame(12, graph2.getNodes().size());
+            assertSame(23, graph2.getEdges().size());
+        }
 
-	}
+    }
 
-	@Test
-	public void testBarrier() {
+    @Test
+    public void testBarrier() {
 
-		TestDataSource ds = new TestDataSource();
+        TestDataSource ds = new TestDataSource();
 
-		TestNode node1 = new TestNode(0, 1);
-		TestNode nodeB = new TestNode(0, 2);
-		nodeB.tags.put("width", "1");
-		TestNode node2 = new TestNode(0, 3);
+        TestNode node1 = new TestNode(0, 1);
+        TestNode nodeB = new TestNode(0, 2);
+        nodeB.tags.put("width", "1");
+        TestNode node2 = new TestNode(0, 3);
 
-		ds.nodes.addAll(Arrays.asList(node1, nodeB, node2));
+        ds.nodes.addAll(Arrays.asList(node1, nodeB, node2));
 
-		TestWay way = new TestWay();
-		way.tags.put("highway", "test");
-		way.tags.put("oneway", "yes");
-		way.nodes.addAll(Arrays.asList(node1, nodeB, node2));
-		ds.ways.add(way);
+        TestWay way = new TestWay();
+        way.tags.put("highway", "test");
+        way.tags.put("oneway", "yes");
+        way.nodes.addAll(Arrays.asList(node1, nodeB, node2));
+        ds.ways.add(way);
 
-		/* variant 1: no restrictions */
+        /* variant 1: no restrictions */
 
-		TransitionStructure ts = createTestTransitionStructure(ds);
+        TransitionStructure ts = createTestTransitionStructure(ds);
 
-		assertSame(3, size(ts.getNodes()));
-		assertSame(2, size(ts.getSegments()));
-		assertSame(1, size(ts.getRestrictions()));
+        assertSame(3, size(ts.getNodes()));
+        assertSame(2, size(ts.getSegments()));
+        assertSame(1, size(ts.getRestrictions()));
 
-		WayGraph graph = new TSBasedWayGraph(ts);
+        WayGraph graph = new TSBasedWayGraph(ts);
 
-		assertSame(4, graph.getNodes().size());
-		assertSame(2, graph.getEdges().size());
+        assertSame(4, graph.getNodes().size());
+        assertSame(2, graph.getEdges().size());
 
-	}
+    }
 
-	private TestRelation createTurnRestrictionRelation(
-			TestWay from, TestNode via, TestWay to, String restriction) {
-		TestRelation resultRelation = new TestRelation();
-		resultRelation.tags.put("type", "restriction");
-		resultRelation.tags.put("restriction", restriction);
-		resultRelation.members.add(new TestRelationMember("from", from));
-		resultRelation.members.add(new TestRelationMember("via", via));
-		resultRelation.members.add(new TestRelationMember("to", to));
-		return resultRelation;
-	}
+    private TestRelation createTurnRestrictionRelation(
+            TestWay from, TestNode via, TestWay to, String restriction) {
+        TestRelation resultRelation = new TestRelation();
+        resultRelation.tags.put("type", "restriction");
+        resultRelation.tags.put("restriction", restriction);
+        resultRelation.members.add(new TestRelationMember("from", from));
+        resultRelation.members.add(new TestRelationMember("via", via));
+        resultRelation.members.add(new TestRelationMember("to", to));
+        return resultRelation;
+    }
 
-	private TransitionStructure createTestTransitionStructure(TestDataSource dataSource) {
+    private TransitionStructure createTestTransitionStructure(TestDataSource dataSource) {
 
-		LinkedList<RoadPropertyType<?>> properties = new LinkedList<RoadPropertyType<?>>();
-		properties.add(new RoadWidth());
+        LinkedList<RoadPropertyType<?>> properties = new LinkedList<RoadPropertyType<?>>();
+        properties.add(new RoadWidth());
 
-		return new GenericTransitionStructure<TestNode, TestWay, TestRelation, TestRelationMember>(
-				ACCESS_PARAMS, TEST_RULESET, dataSource, properties);
-	}
+        return new GenericTransitionStructure<TestNode, TestWay, TestRelation, TestRelationMember>(
+                ACCESS_PARAMS, TEST_RULESET, dataSource, properties);
+    }
 
-	private static int size(Iterable<?> iterable) {
-		Iterator<?> iterator = iterable.iterator();
-		int size = 0;
-		while (iterator.hasNext()) {
-			iterator.next();
-			size ++;
-		}
-		return size;
-	}
+    private static int size(Iterable<?> iterable) {
+        Iterator<?> iterator = iterable.iterator();
+        int size = 0;
+        while (iterator.hasNext()) {
+            iterator.next();
+            size ++;
+        }
+        return size;
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/TestDataSource.java
===================================================================
--- /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/TestDataSource.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/TestDataSource.java	(revision 23189)
@@ -14,131 +14,131 @@
 public class TestDataSource implements DataSource<TestDataSource.TestNode, TestDataSource.TestWay, TestDataSource.TestRelation, TestDataSource.TestRelationMember> {
 
-	public static class TestPrimitive {
-		public final Map<String, String> tags = new HashMap<String, String>();
-	};
+    public static class TestPrimitive {
+        public final Map<String, String> tags = new HashMap<String, String>();
+    };
 
-	public static class TestNode extends TestPrimitive {
-		public final double lat;
-		public final double lon;
-		public TestNode() {
-			this(0, 0);
-		}
-		public TestNode(double lat, double lon) {
-			this.lat = lat;
-			this.lon = lon;
-		}
-		@Override
-		public String toString() {
-			return "(" + lat + ", " + lon + "); " + tags;
-		}
-	}
+    public static class TestNode extends TestPrimitive {
+        public final double lat;
+        public final double lon;
+        public TestNode() {
+            this(0, 0);
+        }
+        public TestNode(double lat, double lon) {
+            this.lat = lat;
+            this.lon = lon;
+        }
+        @Override
+        public String toString() {
+            return "(" + lat + ", " + lon + "); " + tags;
+        }
+    }
 
-	public static class TestWay extends TestPrimitive {
-		public final List<TestNode> nodes = new LinkedList<TestNode>();
-		@Override
-		public String toString() {
-			return nodes + "; " + tags;
-		}
-	}
+    public static class TestWay extends TestPrimitive {
+        public final List<TestNode> nodes = new LinkedList<TestNode>();
+        @Override
+        public String toString() {
+            return nodes + "; " + tags;
+        }
+    }
 
-	public static class TestRelation extends TestPrimitive {
-		public final Collection<TestRelationMember> members = new LinkedList<TestRelationMember>();
-		@Override
-		public String toString() {
-			return members + "; " + tags;
-		}
-	}
+    public static class TestRelation extends TestPrimitive {
+        public final Collection<TestRelationMember> members = new LinkedList<TestRelationMember>();
+        @Override
+        public String toString() {
+            return members + "; " + tags;
+        }
+    }
 
-	public static class TestRelationMember {
-		public final String role;
-		public final TestPrimitive member;
-		public TestRelationMember(String role, TestPrimitive member) {
-			this.role = role;
-			this.member = member;
-		}
-		public TestPrimitive getMember() {
-			return member;
-		}
-		public String getRole() {
-			return role;
-		}
-		@Override
-		public String toString() {
-			return role + "=" + member;
-		}
-	}
+    public static class TestRelationMember {
+        public final String role;
+        public final TestPrimitive member;
+        public TestRelationMember(String role, TestPrimitive member) {
+            this.role = role;
+            this.member = member;
+        }
+        public TestPrimitive getMember() {
+            return member;
+        }
+        public String getRole() {
+            return role;
+        }
+        @Override
+        public String toString() {
+            return role + "=" + member;
+        }
+    }
 
 
-	public final Collection<TestNode> nodes = new LinkedList<TestNode>();
-	public final Collection<TestWay> ways = new LinkedList<TestWay>();
-	public final Collection<TestRelation> relations = new LinkedList<TestRelation>();
+    public final Collection<TestNode> nodes = new LinkedList<TestNode>();
+    public final Collection<TestWay> ways = new LinkedList<TestWay>();
+    public final Collection<TestRelation> relations = new LinkedList<TestRelation>();
 
 
-	public double getLat(TestNode node) {
-		return node.lat;
-	}
-	public double getLon(TestNode node) {
-		return node.lon;
-	}
+    public double getLat(TestNode node) {
+        return node.lat;
+    }
+    public double getLon(TestNode node) {
+        return node.lon;
+    }
 
-	public Iterable<TestRelationMember> getMembers(TestRelation relation) {
-		return relation.members;
-	}
+    public Iterable<TestRelationMember> getMembers(TestRelation relation) {
+        return relation.members;
+    }
 
-	public Iterable<TestNode> getNodes() {
-		return nodes;
-	}
+    public Iterable<TestNode> getNodes() {
+        return nodes;
+    }
 
-	public Iterable<TestNode> getNodes(TestWay way) {
-		return way.nodes;
-	}
+    public Iterable<TestNode> getNodes(TestWay way) {
+        return way.nodes;
+    }
 
-	public Iterable<TestWay> getWays() {
-		return ways;
-	}
+    public Iterable<TestWay> getWays() {
+        return ways;
+    }
 
-	public Iterable<TestRelation> getRelations() {
-		return relations;
-	}
+    public Iterable<TestRelation> getRelations() {
+        return relations;
+    }
 
-	public TagGroup getTagsN(TestNode node) {
-		return new MapBasedTagGroup(node.tags);
-	}
+    public TagGroup getTagsN(TestNode node) {
+        return new MapBasedTagGroup(node.tags);
+    }
 
-	public TagGroup getTagsW(TestWay way) {
-		return new MapBasedTagGroup(way.tags);
-	}
+    public TagGroup getTagsW(TestWay way) {
+        return new MapBasedTagGroup(way.tags);
+    }
 
-	public TagGroup getTagsR(TestRelation relation) {
-		return new MapBasedTagGroup(relation.tags);
-	}
-	
-	public Object getMember(TestRelationMember member) {
-		return member.getMember();
-	}
-	
-	public String getRole(TestRelationMember member) {
-		return member.getRole();
-	}
-	
-	public boolean isNMember(TestRelationMember member) {
-		return member.getMember() instanceof TestNode;
-	}
-	
-	public boolean isWMember(TestRelationMember member) {
-		return member.getMember() instanceof TestWay;
-	}
-	
-	public boolean isRMember(TestRelationMember member) {
-		return member.getMember() instanceof TestRelation;
-	}
+    public TagGroup getTagsR(TestRelation relation) {
+        return new MapBasedTagGroup(relation.tags);
+    }
 
-	public void addObserver(DataSourceObserver observer) {
-		// not needed for test
-	}
+    public Object getMember(TestRelationMember member) {
+        return member.getMember();
+    }
 
-	public void deleteObserver(DataSourceObserver observer) {
-		// not needed for test
-	}
+    public String getRole(TestRelationMember member) {
+        return member.getRole();
+    }
+
+    public boolean isNMember(TestRelationMember member) {
+        return member.getMember() instanceof TestNode;
+    }
+
+    public boolean isWMember(TestRelationMember member) {
+        return member.getMember() instanceof TestWay;
+    }
+
+    public boolean isRMember(TestRelationMember member) {
+        return member.getMember() instanceof TestRelation;
+    }
+
+    public void addObserver(DataSourceObserver observer) {
+        // not needed for test
+    }
+
+    public void deleteObserver(DataSourceObserver observer) {
+        // not needed for test
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/access/AccessRulesetReaderTest.java
===================================================================
--- /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/access/AccessRulesetReaderTest.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/access/AccessRulesetReaderTest.java	(revision 23189)
@@ -22,89 +22,89 @@
 public class AccessRulesetReaderTest {
 
-	@Test
-	public void testReadAccessRuleset_valid_classes() throws IOException {
+    @Test
+    public void testReadAccessRuleset_valid_classes() throws IOException {
 
-		InputStream is = new FileInputStream("plugins/graphview/test/files/accessRuleset_valid.xml");
-		AccessRuleset ruleset = AccessRulesetReader.readAccessRuleset(is);
-		assertNotNull(ruleset);
+        InputStream is = new FileInputStream("plugins/graphview/test/files/accessRuleset_valid.xml");
+        AccessRuleset ruleset = AccessRulesetReader.readAccessRuleset(is);
+        assertNotNull(ruleset);
 
 
-		assertEquals("vehicle", ruleset.getAccessHierarchyAncestors("vehicle").get(0));
+        assertEquals("vehicle", ruleset.getAccessHierarchyAncestors("vehicle").get(0));
 
-		assertEquals("motor_vehicle", ruleset.getAccessHierarchyAncestors("motor_vehicle").get(0));
-		assertEquals("vehicle", ruleset.getAccessHierarchyAncestors("motor_vehicle").get(1));
+        assertEquals("motor_vehicle", ruleset.getAccessHierarchyAncestors("motor_vehicle").get(0));
+        assertEquals("vehicle", ruleset.getAccessHierarchyAncestors("motor_vehicle").get(1));
 
-		assertEquals("bus", ruleset.getAccessHierarchyAncestors("bus").get(0));
-		assertEquals("motor_vehicle", ruleset.getAccessHierarchyAncestors("bus").get(1));
-		assertEquals("vehicle", ruleset.getAccessHierarchyAncestors("bus").get(2));
+        assertEquals("bus", ruleset.getAccessHierarchyAncestors("bus").get(0));
+        assertEquals("motor_vehicle", ruleset.getAccessHierarchyAncestors("bus").get(1));
+        assertEquals("vehicle", ruleset.getAccessHierarchyAncestors("bus").get(2));
 
-		assertEquals("bicycle", ruleset.getAccessHierarchyAncestors("bicycle").get(0));
-		assertEquals("vehicle", ruleset.getAccessHierarchyAncestors("bicycle").get(1));
+        assertEquals("bicycle", ruleset.getAccessHierarchyAncestors("bicycle").get(0));
+        assertEquals("vehicle", ruleset.getAccessHierarchyAncestors("bicycle").get(1));
 
-		assertFalse(ruleset.getAccessHierarchyAncestors("bus").contains("bicycle"));
+        assertFalse(ruleset.getAccessHierarchyAncestors("bus").contains("bicycle"));
 
-		assertSame(ruleset.getAccessHierarchyAncestors("boat").size(), 0);
+        assertSame(ruleset.getAccessHierarchyAncestors("boat").size(), 0);
 
-	}
+    }
 
-	@Test
-	public void testReadAccessRuleset_valid_basetags() throws IOException {
+    @Test
+    public void testReadAccessRuleset_valid_basetags() throws IOException {
 
-		InputStream is = new FileInputStream("plugins/graphview/test/files/accessRuleset_valid.xml");
-		AccessRuleset ruleset = AccessRulesetReader.readAccessRuleset(is);
-		assertNotNull(ruleset);
+        InputStream is = new FileInputStream("plugins/graphview/test/files/accessRuleset_valid.xml");
+        AccessRuleset ruleset = AccessRulesetReader.readAccessRuleset(is);
+        assertNotNull(ruleset);
 
-		assertSame(2, ruleset.getBaseTags().size());
+        assertSame(2, ruleset.getBaseTags().size());
 
-		assertTrue(ruleset.getBaseTags().contains(new Tag("highway", "residential")));
-		assertTrue(ruleset.getBaseTags().contains(new Tag("highway", "cycleway")));
-		assertFalse(ruleset.getBaseTags().contains(new Tag("building", "residential")));
-		assertFalse(ruleset.getBaseTags().contains(new Tag("highway", "stop")));
+        assertTrue(ruleset.getBaseTags().contains(new Tag("highway", "residential")));
+        assertTrue(ruleset.getBaseTags().contains(new Tag("highway", "cycleway")));
+        assertFalse(ruleset.getBaseTags().contains(new Tag("building", "residential")));
+        assertFalse(ruleset.getBaseTags().contains(new Tag("highway", "stop")));
 
-	}
+    }
 
-	@Test
-	public void testReadAccessRuleset_valid_implications() throws IOException {
+    @Test
+    public void testReadAccessRuleset_valid_implications() throws IOException {
 
-		InputStream is = new FileInputStream("plugins/graphview/test/files/accessRuleset_valid.xml");
-		AccessRuleset ruleset = AccessRulesetReader.readAccessRuleset(is);
-		assertNotNull(ruleset);
+        InputStream is = new FileInputStream("plugins/graphview/test/files/accessRuleset_valid.xml");
+        AccessRuleset ruleset = AccessRulesetReader.readAccessRuleset(is);
+        assertNotNull(ruleset);
 
-		List<Implication> implications = ruleset.getImplications();
+        List<Implication> implications = ruleset.getImplications();
 
-		assertSame(3, implications.size());
+        assertSame(3, implications.size());
 
-		TagGroup[] tagGroups = new TagGroup[4];
-		tagGroups[0] = createTagGroup(new Tag("highway", "cycleway"));
-		tagGroups[1] = createTagGroup(new Tag("highway", "steps"));
-		tagGroups[2] = createTagGroup(new Tag("highway", "steps"), new Tag("escalator", "yes"));
-		tagGroups[3] = createTagGroup(new Tag("disused", "yes"), new Tag("construction", "no"));
+        TagGroup[] tagGroups = new TagGroup[4];
+        tagGroups[0] = createTagGroup(new Tag("highway", "cycleway"));
+        tagGroups[1] = createTagGroup(new Tag("highway", "steps"));
+        tagGroups[2] = createTagGroup(new Tag("highway", "steps"), new Tag("escalator", "yes"));
+        tagGroups[3] = createTagGroup(new Tag("disused", "yes"), new Tag("construction", "no"));
 
-		for (Implication implication : implications) {
-			for (int i = 0; i < tagGroups.length; i++) {
-				tagGroups[i] = implication.apply(tagGroups[i]);
-			}
-		}
+        for (Implication implication : implications) {
+            for (int i = 0; i < tagGroups.length; i++) {
+                tagGroups[i] = implication.apply(tagGroups[i]);
+            }
+        }
 
-		assertSame(2, tagGroups[0].size());
-		assertTrue(tagGroups[0].contains(new Tag("bicycle", "designated")));
+        assertSame(2, tagGroups[0].size());
+        assertTrue(tagGroups[0].contains(new Tag("bicycle", "designated")));
 
-		assertSame(2, tagGroups[1].size());
-		assertTrue(tagGroups[1].contains(new Tag("normal_steps", "yes")));
+        assertSame(2, tagGroups[1].size());
+        assertTrue(tagGroups[1].contains(new Tag("normal_steps", "yes")));
 
-		assertSame(2, tagGroups[2].size());
-		assertFalse(tagGroups[2].contains(new Tag("normal_steps", "yes")));
+        assertSame(2, tagGroups[2].size());
+        assertFalse(tagGroups[2].contains(new Tag("normal_steps", "yes")));
 
-		assertSame(3, tagGroups[3].size());
-		assertTrue(tagGroups[3].contains(new Tag("usable", "no")));
-	}
+        assertSame(3, tagGroups[3].size());
+        assertTrue(tagGroups[3].contains(new Tag("usable", "no")));
+    }
 
-	private static TagGroup createTagGroup(Tag... tags) {
-		Map<String, String> tagMap = new HashMap<String, String>();
-		for (Tag tag : tags) {
-			tagMap.put(tag.key, tag.value);
-		}
-		return new MapBasedTagGroup(tagMap);
-	}
+    private static TagGroup createTagGroup(Tag... tags) {
+        Map<String, String> tagMap = new HashMap<String, String>();
+        for (Tag tag : tags) {
+            tagMap.put(tag.key, tag.value);
+        }
+        return new MapBasedTagGroup(tagMap);
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/property/RoadInclineTest.java
===================================================================
--- /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/property/RoadInclineTest.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/property/RoadInclineTest.java	(revision 23189)
@@ -6,19 +6,19 @@
 public class RoadInclineTest extends RoadPropertyTest {
 
-	private static void testIncline(Float expectedInclineForward, Float expectedInclineBackward,
-			String inclineString) {
+    private static void testIncline(Float expectedInclineForward, Float expectedInclineBackward,
+            String inclineString) {
 
-		testEvaluateW(new RoadIncline(),
-				expectedInclineForward, expectedInclineBackward,
-				new Tag("incline", inclineString));
-	}
+        testEvaluateW(new RoadIncline(),
+                expectedInclineForward, expectedInclineBackward,
+                new Tag("incline", inclineString));
+    }
 
-	@Test
-	public void testEvaluate() {
-		testIncline(5f, -5f, "5 %");
-		testIncline(9.5f, -9.5f, "9.5 %");
-		testIncline(-2.5f, 2.5f, "-2.5%");
-		testIncline(null, null, "steep");
-	}
+    @Test
+    public void testEvaluate() {
+        testIncline(5f, -5f, "5 %");
+        testIncline(9.5f, -9.5f, "9.5 %");
+        testIncline(-2.5f, 2.5f, "-2.5%");
+        testIncline(null, null, "steep");
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxspeedTest.java
===================================================================
--- /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxspeedTest.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/property/RoadMaxspeedTest.java	(revision 23189)
@@ -6,27 +6,27 @@
 public class RoadMaxspeedTest extends RoadPropertyTest {
 
-	private static void testMaxspeed(float expectedMaxspeed, String maxspeedString) {
-		testEvaluateBoth(new RoadMaxspeed(),	expectedMaxspeed, new Tag("maxspeed", maxspeedString));
-	}
+    private static void testMaxspeed(float expectedMaxspeed, String maxspeedString) {
+        testEvaluateBoth(new RoadMaxspeed(),    expectedMaxspeed, new Tag("maxspeed", maxspeedString));
+    }
 
-	@Test
-	public void testEvaluate_numeric() {
-		testMaxspeed(30, "30");
-		testMaxspeed(48.3f, "48.3");
-	}
+    @Test
+    public void testEvaluate_numeric() {
+        testMaxspeed(30, "30");
+        testMaxspeed(48.3f, "48.3");
+    }
 
-	@Test
-	public void testEvaluate_kmh() {
-		testMaxspeed(50, "50 km/h");
-		testMaxspeed(120, "120km/h");
-		testMaxspeed(30, "30	km/h");
-	}
+    @Test
+    public void testEvaluate_kmh() {
+        testMaxspeed(50, "50 km/h");
+        testMaxspeed(120, "120km/h");
+        testMaxspeed(30, "30    km/h");
+    }
 
-	@Test
-	public void testEvaluate_mph() {
-		testMaxspeed(72.42048f, "45 mph");
-		testMaxspeed(64.373764f, "40mph");
-		testMaxspeed(24.14016f, "15	mph");
-	}
+    @Test
+    public void testEvaluate_mph() {
+        testMaxspeed(72.42048f, "45 mph");
+        testMaxspeed(64.373764f, "40mph");
+        testMaxspeed(24.14016f, "15 mph");
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/property/RoadPropertyTest.java
===================================================================
--- /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/property/RoadPropertyTest.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/property/RoadPropertyTest.java	(revision 23189)
@@ -8,37 +8,37 @@
 abstract public class RoadPropertyTest {
 
-	protected static <P> void testEvaluateW(RoadPropertyType<P> property, P expectedForward, P expectedBackward, Tag... wayTags) {
+    protected static <P> void testEvaluateW(RoadPropertyType<P> property, P expectedForward, P expectedBackward, Tag... wayTags) {
 
-		TestDataSource ds = new TestDataSource();
-		TestDataSource.TestWay testWay = new TestDataSource.TestWay();
-		for (Tag tag : wayTags) {
-			testWay.tags.put(tag.key, tag.value);
-		}
-		ds.ways.add(testWay);
+        TestDataSource ds = new TestDataSource();
+        TestDataSource.TestWay testWay = new TestDataSource.TestWay();
+        for (Tag tag : wayTags) {
+            testWay.tags.put(tag.key, tag.value);
+        }
+        ds.ways.add(testWay);
 
-		assertEquals(expectedForward, property.evaluateW(testWay, true, null, ds));
-		assertEquals(expectedBackward, property.evaluateW(testWay, false, null, ds));
+        assertEquals(expectedForward, property.evaluateW(testWay, true, null, ds));
+        assertEquals(expectedBackward, property.evaluateW(testWay, false, null, ds));
 
-	}
+    }
 
-	protected static <P> void testEvaluateN(RoadPropertyType<P> property, P expected, Tag... nodeTags) {
+    protected static <P> void testEvaluateN(RoadPropertyType<P> property, P expected, Tag... nodeTags) {
 
-		TestDataSource ds = new TestDataSource();
-		TestDataSource.TestNode testNode = new TestDataSource.TestNode();
-		for (Tag tag : nodeTags) {
-			testNode.tags.put(tag.key, tag.value);
-		}
-		ds.nodes.add(testNode);
+        TestDataSource ds = new TestDataSource();
+        TestDataSource.TestNode testNode = new TestDataSource.TestNode();
+        for (Tag tag : nodeTags) {
+            testNode.tags.put(tag.key, tag.value);
+        }
+        ds.nodes.add(testNode);
 
-		RoadMaxspeed m = new RoadMaxspeed();
+        RoadMaxspeed m = new RoadMaxspeed();
 
-		assertEquals(expected, m.evaluateN(testNode, null, ds));
+        assertEquals(expected, m.evaluateN(testNode, null, ds));
 
-	}
+    }
 
-	protected static <P> void testEvaluateBoth(RoadPropertyType<P> property, P expected, Tag... nodeTags) {
-		testEvaluateW(property, expected, expected, nodeTags);
-		testEvaluateN(property, expected, nodeTags);
-	}
+    protected static <P> void testEvaluateBoth(RoadPropertyType<P> property, P expected, Tag... nodeTags) {
+        testEvaluateW(property, expected, expected, nodeTags);
+        testEvaluateN(property, expected, nodeTags);
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/util/TagConditionLogicTest.java
===================================================================
--- /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/util/TagConditionLogicTest.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/util/TagConditionLogicTest.java	(revision 23189)
@@ -15,101 +15,101 @@
 public class TagConditionLogicTest {
 
-	TagGroup groupA;
-	TagGroup groupB;
+    TagGroup groupA;
+    TagGroup groupB;
 
-	@Before
-	public void setUp() {
-		Map<String, String> mapA = new HashMap<String, String>();
-		mapA.put("key1", "value1");
-		mapA.put("key2", "value2");
-		mapA.put("key3", "value1");
-		groupA = new MapBasedTagGroup(mapA);
+    @Before
+    public void setUp() {
+        Map<String, String> mapA = new HashMap<String, String>();
+        mapA.put("key1", "value1");
+        mapA.put("key2", "value2");
+        mapA.put("key3", "value1");
+        groupA = new MapBasedTagGroup(mapA);
 
-		Map<String, String> mapB = new HashMap<String, String>();
-		mapB.put("key1", "value1");
-		mapB.put("key4", "value4");
-		groupB = new MapBasedTagGroup(mapB);
-	}
+        Map<String, String> mapB = new HashMap<String, String>();
+        mapB.put("key1", "value1");
+        mapB.put("key4", "value4");
+        groupB = new MapBasedTagGroup(mapB);
+    }
 
-	@Test
-	public void testTag() {
-		TagCondition condition = TagConditionLogic.tag(new Tag("key3", "value1"));
-		assertTrue(condition.matches(groupA));
-		assertFalse(condition.matches(groupB));
-	}
+    @Test
+    public void testTag() {
+        TagCondition condition = TagConditionLogic.tag(new Tag("key3", "value1"));
+        assertTrue(condition.matches(groupA));
+        assertFalse(condition.matches(groupB));
+    }
 
-	@Test
-	public void testKey() {
-		TagCondition condition = TagConditionLogic.key("key3");
-		assertTrue(condition.matches(groupA));
-		assertFalse(condition.matches(groupB));
-	}
+    @Test
+    public void testKey() {
+        TagCondition condition = TagConditionLogic.key("key3");
+        assertTrue(condition.matches(groupA));
+        assertFalse(condition.matches(groupB));
+    }
 
-	@Test
-	public void testAnd() {
-		TagCondition condition1 = TagConditionLogic.tag(new Tag("key2", "value2"));
-		TagCondition conditionAnd1a = TagConditionLogic.and(condition1);
-		TagCondition conditionAnd1b = TagConditionLogic.and(Arrays.asList(condition1));
+    @Test
+    public void testAnd() {
+        TagCondition condition1 = TagConditionLogic.tag(new Tag("key2", "value2"));
+        TagCondition conditionAnd1a = TagConditionLogic.and(condition1);
+        TagCondition conditionAnd1b = TagConditionLogic.and(Arrays.asList(condition1));
 
-		assertTrue(conditionAnd1a.matches(groupA));
-		assertTrue(conditionAnd1b.matches(groupA));
-		assertFalse(conditionAnd1a.matches(groupB));
-		assertFalse(conditionAnd1b.matches(groupB));
+        assertTrue(conditionAnd1a.matches(groupA));
+        assertTrue(conditionAnd1b.matches(groupA));
+        assertFalse(conditionAnd1a.matches(groupB));
+        assertFalse(conditionAnd1b.matches(groupB));
 
-		TagCondition condition2 = TagConditionLogic.tag(new Tag("key1", "value1"));
-		TagCondition conditionAnd2a = TagConditionLogic.and(condition1, condition2);
-		TagCondition conditionAnd2b = TagConditionLogic.and(Arrays.asList(condition1, condition2));
+        TagCondition condition2 = TagConditionLogic.tag(new Tag("key1", "value1"));
+        TagCondition conditionAnd2a = TagConditionLogic.and(condition1, condition2);
+        TagCondition conditionAnd2b = TagConditionLogic.and(Arrays.asList(condition1, condition2));
 
-		assertTrue(conditionAnd2a.matches(groupA));
-		assertTrue(conditionAnd2b.matches(groupA));
-		assertFalse(conditionAnd2a.matches(groupB));
-		assertFalse(conditionAnd2b.matches(groupB));
+        assertTrue(conditionAnd2a.matches(groupA));
+        assertTrue(conditionAnd2b.matches(groupA));
+        assertFalse(conditionAnd2a.matches(groupB));
+        assertFalse(conditionAnd2b.matches(groupB));
 
-		TagCondition condition3 = TagConditionLogic.tag(new Tag("key4", "value4"));
-		TagCondition conditionAnd3a = TagConditionLogic.and(condition1, condition2, condition3);
-		TagCondition conditionAnd3b = TagConditionLogic.and(Arrays.asList(condition1, condition2, condition3));
+        TagCondition condition3 = TagConditionLogic.tag(new Tag("key4", "value4"));
+        TagCondition conditionAnd3a = TagConditionLogic.and(condition1, condition2, condition3);
+        TagCondition conditionAnd3b = TagConditionLogic.and(Arrays.asList(condition1, condition2, condition3));
 
-		assertFalse(conditionAnd3a.matches(groupA));
-		assertFalse(conditionAnd3b.matches(groupA));
-		assertFalse(conditionAnd3a.matches(groupB));
-		assertFalse(conditionAnd3b.matches(groupB));
-	}
+        assertFalse(conditionAnd3a.matches(groupA));
+        assertFalse(conditionAnd3b.matches(groupA));
+        assertFalse(conditionAnd3a.matches(groupB));
+        assertFalse(conditionAnd3b.matches(groupB));
+    }
 
-	@Test
-	public void testOr() {
-		TagCondition condition1 = TagConditionLogic.tag(new Tag("key42", "value42"));
-		TagCondition conditionOr1a = TagConditionLogic.or(condition1);
-		TagCondition conditionOr1b = TagConditionLogic.or(Arrays.asList(condition1));
+    @Test
+    public void testOr() {
+        TagCondition condition1 = TagConditionLogic.tag(new Tag("key42", "value42"));
+        TagCondition conditionOr1a = TagConditionLogic.or(condition1);
+        TagCondition conditionOr1b = TagConditionLogic.or(Arrays.asList(condition1));
 
-		assertFalse(conditionOr1a.matches(groupA));
-		assertFalse(conditionOr1b.matches(groupA));
-		assertFalse(conditionOr1a.matches(groupB));
-		assertFalse(conditionOr1b.matches(groupB));
+        assertFalse(conditionOr1a.matches(groupA));
+        assertFalse(conditionOr1b.matches(groupA));
+        assertFalse(conditionOr1a.matches(groupB));
+        assertFalse(conditionOr1b.matches(groupB));
 
-		TagCondition condition2 = TagConditionLogic.tag(new Tag("key3", "value1"));
-		TagCondition conditionOr2a = TagConditionLogic.or(condition1, condition2);
-		TagCondition conditionOr2b = TagConditionLogic.or(Arrays.asList(condition1, condition2));
+        TagCondition condition2 = TagConditionLogic.tag(new Tag("key3", "value1"));
+        TagCondition conditionOr2a = TagConditionLogic.or(condition1, condition2);
+        TagCondition conditionOr2b = TagConditionLogic.or(Arrays.asList(condition1, condition2));
 
-		assertTrue(conditionOr2a.matches(groupA));
-		assertTrue(conditionOr2b.matches(groupA));
-		assertFalse(conditionOr2a.matches(groupB));
-		assertFalse(conditionOr2b.matches(groupB));
+        assertTrue(conditionOr2a.matches(groupA));
+        assertTrue(conditionOr2b.matches(groupA));
+        assertFalse(conditionOr2a.matches(groupB));
+        assertFalse(conditionOr2b.matches(groupB));
 
-		TagCondition condition3 = TagConditionLogic.tag(new Tag("key1", "value1"));
-		TagCondition conditionOr3a = TagConditionLogic.or(condition1, condition2, condition3);
-		TagCondition conditionOr3b = TagConditionLogic.or(Arrays.asList(condition1, condition2, condition3));
+        TagCondition condition3 = TagConditionLogic.tag(new Tag("key1", "value1"));
+        TagCondition conditionOr3a = TagConditionLogic.or(condition1, condition2, condition3);
+        TagCondition conditionOr3b = TagConditionLogic.or(Arrays.asList(condition1, condition2, condition3));
 
-		assertTrue(conditionOr3a.matches(groupA));
-		assertTrue(conditionOr3b.matches(groupA));
-		assertTrue(conditionOr3a.matches(groupB));
-		assertTrue(conditionOr3b.matches(groupB));
-	}
+        assertTrue(conditionOr3a.matches(groupA));
+        assertTrue(conditionOr3b.matches(groupA));
+        assertTrue(conditionOr3a.matches(groupB));
+        assertTrue(conditionOr3b.matches(groupB));
+    }
 
-	@Test
-	public void testNot() {
-		TagCondition condition = TagConditionLogic.not(TagConditionLogic.key("key3"));
-		assertFalse(condition.matches(groupA));
-		assertTrue(condition.matches(groupB));
-	}
+    @Test
+    public void testNot() {
+        TagCondition condition = TagConditionLogic.not(TagConditionLogic.key("key3"));
+        assertFalse(condition.matches(groupA));
+        assertTrue(condition.matches(groupB));
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/util/ValueStringParserTest.java
===================================================================
--- /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/util/ValueStringParserTest.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/util/ValueStringParserTest.java	(revision 23189)
@@ -10,87 +10,87 @@
 public class ValueStringParserTest {
 
-	/* speed */
+    /* speed */
 
-	@Test
-	public void testParseSpeedDefault() {
-		assertClose(50, parseSpeed("50"));
-	}
+    @Test
+    public void testParseSpeedDefault() {
+        assertClose(50, parseSpeed("50"));
+    }
 
-	@Test
-	public void testParseSpeedKmh() {
-		assertClose(30, parseSpeed("30 km/h"));
-		assertClose(100, parseSpeed("100km/h"));
-	}
+    @Test
+    public void testParseSpeedKmh() {
+        assertClose(30, parseSpeed("30 km/h"));
+        assertClose(100, parseSpeed("100km/h"));
+    }
 
-	@Test
-	public void testParseSpeedMph() {
-		assertClose(40.234f, parseSpeed("25mph"));
-		assertClose(40.234f, parseSpeed("25 mph"));
-	}
+    @Test
+    public void testParseSpeedMph() {
+        assertClose(40.234f, parseSpeed("25mph"));
+        assertClose(40.234f, parseSpeed("25 mph"));
+    }
 
-	@Test
-	public void testParseSpeedInvalid() {
-		assertNull(parseSpeed("lightspeed"));
-	}
+    @Test
+    public void testParseSpeedInvalid() {
+        assertNull(parseSpeed("lightspeed"));
+    }
 
-	/* measure */
+    /* measure */
 
-	@Test
-	public void testParseMeasureDefault() {
-		assertClose(3.5f, parseMeasure("3.5"));
-	}
+    @Test
+    public void testParseMeasureDefault() {
+        assertClose(3.5f, parseMeasure("3.5"));
+    }
 
-	@Test
-	public void testParseMeasureM() {
-		assertClose(2, parseMeasure("2m"));
-		assertClose(5.5f, parseMeasure("5.5 m"));
-	}
+    @Test
+    public void testParseMeasureM() {
+        assertClose(2, parseMeasure("2m"));
+        assertClose(5.5f, parseMeasure("5.5 m"));
+    }
 
-	@Test
-	public void testParseMeasureKm() {
-		assertClose(1000, parseMeasure("1 km"));
-		assertClose(7200, parseMeasure("7.2km"));
-	}
+    @Test
+    public void testParseMeasureKm() {
+        assertClose(1000, parseMeasure("1 km"));
+        assertClose(7200, parseMeasure("7.2km"));
+    }
 
-	@Test
-	public void testParseMeasureMi() {
-		assertClose(1609.344f, parseMeasure("1 mi"));
-	}
+    @Test
+    public void testParseMeasureMi() {
+        assertClose(1609.344f, parseMeasure("1 mi"));
+    }
 
-	@Test
-	public void testParseMeasureFeetInches() {
-		assertClose(3.6576f, parseMeasure("12'0\""));
-		assertClose(1.9812f, parseMeasure("6' 6\""));
-	}
+    @Test
+    public void testParseMeasureFeetInches() {
+        assertClose(3.6576f, parseMeasure("12'0\""));
+        assertClose(1.9812f, parseMeasure("6' 6\""));
+    }
 
-	@Test
-	public void testParseMeasureInvalid() {
-		assertNull(parseMeasure("very long"));
-		assertNull(parseMeasure("6' 16\""));
-	}
+    @Test
+    public void testParseMeasureInvalid() {
+        assertNull(parseMeasure("very long"));
+        assertNull(parseMeasure("6' 16\""));
+    }
 
-	/* weight */
+    /* weight */
 
-	@Test
-	public void testParseWeightDefault() {
-		assertClose(3.6f, parseWeight("3.6"));
-	}
+    @Test
+    public void testParseWeightDefault() {
+        assertClose(3.6f, parseWeight("3.6"));
+    }
 
-	@Test
-	public void testParseWeightT() {
-		assertClose(30, parseWeight("30t"));
-		assertClose(3.5f, parseWeight("3.5 t"));
-	}
+    @Test
+    public void testParseWeightT() {
+        assertClose(30, parseWeight("30t"));
+        assertClose(3.5f, parseWeight("3.5 t"));
+    }
 
-	@Test
-	public void testParseWeightInvalid() {
-		assertNull(parseWeight("heavy"));
-	}
+    @Test
+    public void testParseWeightInvalid() {
+        assertNull(parseWeight("heavy"));
+    }
 
-	private static final void assertClose(float expected, float actual) {
-		if (Math.abs(expected - actual) > 0.001) {
-			throw new AssertionError("expected " + expected + ", was " + actual);
-		}
-	}
+    private static final void assertClose(float expected, float actual) {
+        if (Math.abs(expected - actual) > 0.001) {
+            throw new AssertionError("expected " + expected + ", was " + actual);
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/visualisation/FloatPropertyColorSchemeTest.java
===================================================================
--- /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/visualisation/FloatPropertyColorSchemeTest.java	(revision 23188)
+++ /applications/editors/josm/plugins/graphview/test/org/openstreetmap/josm/plugins/graphview/core/visualisation/FloatPropertyColorSchemeTest.java	(revision 23189)
@@ -13,37 +13,37 @@
 public class FloatPropertyColorSchemeTest {
 
-	private FloatPropertyColorScheme subject;
+    private FloatPropertyColorScheme subject;
 
-	@Before
-	public void setUp() {
+    @Before
+    public void setUp() {
 
-		Map<Float, Color> colorMap = new HashMap<Float, Color>();
-		colorMap.put( 5f, new Color( 42,  42,  42));
-		colorMap.put(10f, new Color(100, 100, 100));
-		colorMap.put(20f, new Color(200, 200, 200));
+        Map<Float, Color> colorMap = new HashMap<Float, Color>();
+        colorMap.put( 5f, new Color( 42,  42,  42));
+        colorMap.put(10f, new Color(100, 100, 100));
+        colorMap.put(20f, new Color(200, 200, 200));
 
-		subject = new FloatPropertyColorScheme(RoadMaxweight.class, colorMap, Color.RED);
-	}
+        subject = new FloatPropertyColorScheme(RoadMaxweight.class, colorMap, Color.RED);
+    }
 
-	@Test
-	public void testGetColorForValue_below() {
-		assertEquals(new Color(42, 42, 42), subject.getColorForValue(1f));
-		assertEquals(new Color(42, 42, 42), subject.getColorForValue(5f));
-	}
+    @Test
+    public void testGetColorForValue_below() {
+        assertEquals(new Color(42, 42, 42), subject.getColorForValue(1f));
+        assertEquals(new Color(42, 42, 42), subject.getColorForValue(5f));
+    }
 
-	@Test
-	public void testGetColorForValue_above() {
-		assertEquals(new Color(200, 200, 200), subject.getColorForValue(25f));
-	}
+    @Test
+    public void testGetColorForValue_above() {
+        assertEquals(new Color(200, 200, 200), subject.getColorForValue(25f));
+    }
 
-	@Test
-	public void testGetColorForValue_value() {
-		assertEquals(new Color(100, 100, 100), subject.getColorForValue(10f));
-	}
+    @Test
+    public void testGetColorForValue_value() {
+        assertEquals(new Color(100, 100, 100), subject.getColorForValue(10f));
+    }
 
-	@Test
-	public void testGetColorForValue_interpolate() {
-		assertEquals(new Color(150, 150, 150), subject.getColorForValue(15f));
-	}
+    @Test
+    public void testGetColorForValue_interpolate() {
+        assertEquals(new Color(150, 150, 150), subject.getColorForValue(15f));
+    }
 
 }
Index: /applications/editors/josm/plugins/multipoly-convert/src/converttomultipoly/MultipolyAction.java
===================================================================
--- /applications/editors/josm/plugins/multipoly-convert/src/converttomultipoly/MultipolyAction.java	(revision 23188)
+++ /applications/editors/josm/plugins/multipoly-convert/src/converttomultipoly/MultipolyAction.java	(revision 23189)
@@ -27,7 +27,7 @@
 /**
  * Convert an area into an advance multipolygon.
- * 
+ *
  * New relation with type=multipolygon is created for each ways.
- * 
+ *
  * All the tags (except the source tag) will be moved into the relation.
  */
@@ -35,104 +35,104 @@
 public class MultipolyAction extends JosmAction {
 
-	public MultipolyAction() {
-		super(tr("Convert to multipolygon"), "multipoly_convert",
-				tr("Convert to multipolygon."), Shortcut.registerShortcut(
-						"tools:multipolyconv", tr("Tool: {0}",
-								tr("Convert to multipolygon")), KeyEvent.VK_M,
-						Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
-	}
+    public MultipolyAction() {
+        super(tr("Convert to multipolygon"), "multipoly_convert",
+                tr("Convert to multipolygon."), Shortcut.registerShortcut(
+                        "tools:multipolyconv", tr("Tool: {0}",
+                                tr("Convert to multipolygon")), KeyEvent.VK_M,
+                        Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
+    }
 
-	/**
-	 * The action button has been clicked
-	 * 
-	 * @param e
-	 *            Action Event
-	 */
-	public void actionPerformed(ActionEvent e) {
+    /**
+     * The action button has been clicked
+     *
+     * @param e
+     *            Action Event
+     */
+    public void actionPerformed(ActionEvent e) {
 
-		// Get all ways in some type=multipolygon relation
-		HashSet<OsmPrimitive> relationsInMulti = new HashSet<OsmPrimitive>();
-		for (Relation r : Main.main.getCurrentDataSet().getRelations()) {
-			if (!r.isUsable())
-				continue;
-			if (r.get("type") != "multipolygon")
-				continue;
-			for (RelationMember rm : r.getMembers()) {
-				OsmPrimitive m = rm.getMember();
-				if (m instanceof Way) {
-					relationsInMulti.add(m);
-				}
-			}
-		}
+        // Get all ways in some type=multipolygon relation
+        HashSet<OsmPrimitive> relationsInMulti = new HashSet<OsmPrimitive>();
+        for (Relation r : Main.main.getCurrentDataSet().getRelations()) {
+            if (!r.isUsable())
+                continue;
+            if (r.get("type") != "multipolygon")
+                continue;
+            for (RelationMember rm : r.getMembers()) {
+                OsmPrimitive m = rm.getMember();
+                if (m instanceof Way) {
+                    relationsInMulti.add(m);
+                }
+            }
+        }
 
-		// List of selected ways
-		ArrayList<Way> selectedWays = new ArrayList<Way>();
-		
+        // List of selected ways
+        ArrayList<Way> selectedWays = new ArrayList<Way>();
 
-		// For every selected way
-		for (OsmPrimitive osm : Main.main.getCurrentDataSet().getSelected()) {
-			if (osm instanceof Way) {
-				Way way = (Way) osm;
-				// Check if way is already in another multipolygon
-				if (relationsInMulti.contains(osm)) {
-					JOptionPane
-							.showMessageDialog(
-									Main.parent,
-									tr("One of the selected ways is already part of another multipolygon."));
-					return;
-				}
 
-				selectedWays.add(way);
-			}
-		}
+        // For every selected way
+        for (OsmPrimitive osm : Main.main.getCurrentDataSet().getSelected()) {
+            if (osm instanceof Way) {
+                Way way = (Way) osm;
+                // Check if way is already in another multipolygon
+                if (relationsInMulti.contains(osm)) {
+                    JOptionPane
+                            .showMessageDialog(
+                                    Main.parent,
+                                    tr("One of the selected ways is already part of another multipolygon."));
+                    return;
+                }
 
-		if (Main.map == null) {
-			JOptionPane.showMessageDialog(Main.parent, tr("No data loaded."));
-			return;
-		}
+                selectedWays.add(way);
+            }
+        }
 
-		Collection<Command> cmds = new LinkedList<Command>();
-		// Add ways to it
-		for (int i = 0; i < selectedWays.size(); i++) {
-		        Way way = selectedWays.get(i);
+        if (Main.map == null) {
+            JOptionPane.showMessageDialog(Main.parent, tr("No data loaded."));
+            return;
+        }
 
-		        // Create new relation
-	                Relation rel = new Relation();
-	                rel.put("type", "multipolygon");
+        Collection<Command> cmds = new LinkedList<Command>();
+        // Add ways to it
+        for (int i = 0; i < selectedWays.size(); i++) {
+                Way way = selectedWays.get(i);
 
-			RelationMember rm = new RelationMember("outer", way);
-			rel.addMember(rm);
-			
-			for (Iterator<String> keyi = way.getKeys().keySet().iterator() ; keyi.hasNext() ; ) {
-			        String key = keyi.next();
-			        rel.put(key, way.get(key));
-			        System.out.println(key);
-			        if (key.compareTo("source") != 0) {
-			                way.remove(key);
-			        }
-			}
-	                // Add relation
-	                cmds.add(new AddCommand(rel));
-		}
-		// Commit
-		Main.main.undoRedo.add(new SequenceCommand(tr("Create multipolygon"), cmds));
-		Main.map.repaint();
-	}
+                // Create new relation
+                    Relation rel = new Relation();
+                    rel.put("type", "multipolygon");
 
-	/** Enable this action only if something is selected */
-	@Override
-	protected void updateEnabledState() {
-		if (getCurrentDataSet() == null) {
-			setEnabled(false);
-		} else {
-			updateEnabledState(getCurrentDataSet().getSelected());
-		}
-	}
+            RelationMember rm = new RelationMember("outer", way);
+            rel.addMember(rm);
 
-	/** Enable this action only if something is selected */
-	@Override
-	protected void updateEnabledState(
-			Collection<? extends OsmPrimitive> selection) {
-		setEnabled(selection != null && !selection.isEmpty());
-	}
+            for (Iterator<String> keyi = way.getKeys().keySet().iterator() ; keyi.hasNext() ; ) {
+                    String key = keyi.next();
+                    rel.put(key, way.get(key));
+                    System.out.println(key);
+                    if (key.compareTo("source") != 0) {
+                            way.remove(key);
+                    }
+            }
+                    // Add relation
+                    cmds.add(new AddCommand(rel));
+        }
+        // Commit
+        Main.main.undoRedo.add(new SequenceCommand(tr("Create multipolygon"), cmds));
+        Main.map.repaint();
+    }
+
+    /** Enable this action only if something is selected */
+    @Override
+    protected void updateEnabledState() {
+        if (getCurrentDataSet() == null) {
+            setEnabled(false);
+        } else {
+            updateEnabledState(getCurrentDataSet().getSelected());
+        }
+    }
+
+    /** Enable this action only if something is selected */
+    @Override
+    protected void updateEnabledState(
+            Collection<? extends OsmPrimitive> selection) {
+        setEnabled(selection != null && !selection.isEmpty());
+    }
 }
Index: /applications/editors/josm/plugins/multipoly-convert/src/converttomultipoly/MultipolyPlugin.java
===================================================================
--- /applications/editors/josm/plugins/multipoly-convert/src/converttomultipoly/MultipolyPlugin.java	(revision 23188)
+++ /applications/editors/josm/plugins/multipoly-convert/src/converttomultipoly/MultipolyPlugin.java	(revision 23189)
@@ -15,27 +15,27 @@
 public class MultipolyPlugin extends Plugin {
 
-	protected String name;
+    protected String name;
 
 //        public MultipolyPlugin(PluginInformation info) {
         public MultipolyPlugin(PluginInformation info) {
-		super(info);
-		name = tr("Convert to multipolygon");
-		JMenu toolsMenu = null;
-		for (int i = 0; i < Main.main.menu.getMenuCount() && toolsMenu == null; i++) {
-			JMenu menu = Main.main.menu.getMenu(i);
-			String name = menu.getText();
-			if (name != null && name.equals(tr("Tools"))) {
-				toolsMenu = menu;
-			}
-		}
+        super(info);
+        name = tr("Convert to multipolygon");
+        JMenu toolsMenu = null;
+        for (int i = 0; i < Main.main.menu.getMenuCount() && toolsMenu == null; i++) {
+            JMenu menu = Main.main.menu.getMenu(i);
+            String name = menu.getText();
+            if (name != null && name.equals(tr("Tools"))) {
+                toolsMenu = menu;
+            }
+        }
 
-		if (toolsMenu == null) {
-			toolsMenu = new JMenu(name);
-			toolsMenu.add(new JMenuItem(new MultipolyAction()));
-			Main.main.menu.add(toolsMenu, 2);
-		} else {
-			toolsMenu.addSeparator();
-			toolsMenu.add(new JMenuItem(new MultipolyAction()));
-		}
-	}
+        if (toolsMenu == null) {
+            toolsMenu = new JMenu(name);
+            toolsMenu.add(new JMenuItem(new MultipolyAction()));
+            Main.main.menu.add(toolsMenu, 2);
+        } else {
+            toolsMenu.addSeparator();
+            toolsMenu.add(new JMenuItem(new MultipolyAction()));
+        }
+    }
 }
Index: /applications/editors/josm/plugins/multipoly/src/multipoly/MultipolyAction.java
===================================================================
--- /applications/editors/josm/plugins/multipoly/src/multipoly/MultipolyAction.java	(revision 23188)
+++ /applications/editors/josm/plugins/multipoly/src/multipoly/MultipolyAction.java	(revision 23189)
@@ -30,10 +30,10 @@
 /**
  * Create multipolygon from selected ways automatically.
- * 
+ *
  * New relation with type=multipolygon is created
- * 
+ *
  * If one or more of ways is already in relation with type=multipolygon or the
  * way is not closed, then error is reported and no relation is created
- * 
+ *
  * The "inner" and "outer" roles are guessed automatically. First, bbox is
  * calculated for each way. then the largest area is assumed to be outside and
@@ -45,137 +45,137 @@
 public class MultipolyAction extends JosmAction {
 
-	public MultipolyAction() {
-		super(tr("Create multipolygon"), "multipoly_create",
-				tr("Create multipolygon."), Shortcut.registerShortcut(
-						"tools:multipoly", tr("Tool: {0}",
-								tr("Create multipolygon")), KeyEvent.VK_M,
-						Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
-	}
+    public MultipolyAction() {
+        super(tr("Create multipolygon"), "multipoly_create",
+                tr("Create multipolygon."), Shortcut.registerShortcut(
+                        "tools:multipoly", tr("Tool: {0}",
+                                tr("Create multipolygon")), KeyEvent.VK_M,
+                        Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true);
+    }
 
-	/**
-	 * The action button has been clicked
-	 * 
-	 * @param e
-	 *            Action Event
-	 */
-	public void actionPerformed(ActionEvent e) {
+    /**
+     * The action button has been clicked
+     *
+     * @param e
+     *            Action Event
+     */
+    public void actionPerformed(ActionEvent e) {
 
-		// Get all ways in some type=multipolygon relation
-		HashSet<OsmPrimitive> relationsInMulti = new HashSet<OsmPrimitive>();
-		for (Relation r : Main.main.getCurrentDataSet().getRelations()) {
-			if (!r.isUsable())
-				continue;
-			if (r.get("type") != "multipolygon")
-				continue;
-			for (RelationMember rm : r.getMembers()) {
-				OsmPrimitive m = rm.getMember();
-				if (m instanceof Way) {
-					relationsInMulti.add(m);
-				}
-			}
-		}
+        // Get all ways in some type=multipolygon relation
+        HashSet<OsmPrimitive> relationsInMulti = new HashSet<OsmPrimitive>();
+        for (Relation r : Main.main.getCurrentDataSet().getRelations()) {
+            if (!r.isUsable())
+                continue;
+            if (r.get("type") != "multipolygon")
+                continue;
+            for (RelationMember rm : r.getMembers()) {
+                OsmPrimitive m = rm.getMember();
+                if (m instanceof Way) {
+                    relationsInMulti.add(m);
+                }
+            }
+        }
 
-		// List of selected ways
-		List<Way> selectedWays = new ArrayList<Way>();
-		// Area of largest way (in square degrees)
-		double maxarea = 0;
-		// Which way is the largest one (outer)
-		Way maxWay = null;
+        // List of selected ways
+        List<Way> selectedWays = new ArrayList<Way>();
+        // Area of largest way (in square degrees)
+        double maxarea = 0;
+        // Which way is the largest one (outer)
+        Way maxWay = null;
 
-		// For every selected way
-		for (OsmPrimitive osm : Main.main.getCurrentDataSet().getSelected()) {
-			if (osm instanceof Way) {
-				Way way = (Way) osm;
-				// Check if way is already in another multipolygon
-				if (relationsInMulti.contains(osm)) {
-					JOptionPane
-							.showMessageDialog(
-									Main.parent,
-									tr("One of the selected ways is already part of another multipolygon."));
-					return;
-				}
-				EastNorth first = null, last = null;
-				// Boundingbox of way
-				double minx = 9999, miny = 9999, maxx = -9999, maxy = -9999;
-				for (Pair<Node, Node> seg : way.getNodePairs(false)) {
-					if (first == null)
-						first = seg.a.getEastNorth();
-					last = seg.b.getEastNorth();
-					double x = seg.a.getEastNorth().east();
-					double y = seg.a.getEastNorth().north();
-					if (x < minx)
-						minx = x;
-					if (y < miny)
-						miny = y;
-					if (x > maxx)
-						maxx = x;
-					if (y > maxy)
-						maxy = y;
-				}
-				// Check if first and last node are the same
-				if (!first.equals(last)) {
-					JOptionPane
-							.showMessageDialog(
-									Main.parent,
-									tr("Multipolygon must consist only of closed ways."));
-					return;
-				}
-				// Determine area
-				double area = (maxx - minx) * (maxy - miny);
-				selectedWays.add(way);
-				if (area > maxarea) {
-					maxarea = area;
-					maxWay = way;
-				}
-			}
-		}
+        // For every selected way
+        for (OsmPrimitive osm : Main.main.getCurrentDataSet().getSelected()) {
+            if (osm instanceof Way) {
+                Way way = (Way) osm;
+                // Check if way is already in another multipolygon
+                if (relationsInMulti.contains(osm)) {
+                    JOptionPane
+                            .showMessageDialog(
+                                    Main.parent,
+                                    tr("One of the selected ways is already part of another multipolygon."));
+                    return;
+                }
+                EastNorth first = null, last = null;
+                // Boundingbox of way
+                double minx = 9999, miny = 9999, maxx = -9999, maxy = -9999;
+                for (Pair<Node, Node> seg : way.getNodePairs(false)) {
+                    if (first == null)
+                        first = seg.a.getEastNorth();
+                    last = seg.b.getEastNorth();
+                    double x = seg.a.getEastNorth().east();
+                    double y = seg.a.getEastNorth().north();
+                    if (x < minx)
+                        minx = x;
+                    if (y < miny)
+                        miny = y;
+                    if (x > maxx)
+                        maxx = x;
+                    if (y > maxy)
+                        maxy = y;
+                }
+                // Check if first and last node are the same
+                if (!first.equals(last)) {
+                    JOptionPane
+                            .showMessageDialog(
+                                    Main.parent,
+                                    tr("Multipolygon must consist only of closed ways."));
+                    return;
+                }
+                // Determine area
+                double area = (maxx - minx) * (maxy - miny);
+                selectedWays.add(way);
+                if (area > maxarea) {
+                    maxarea = area;
+                    maxWay = way;
+                }
+            }
+        }
 
-		if (Main.map == null) {
-			JOptionPane.showMessageDialog(Main.parent, tr("No data loaded."));
-			return;
-		}
+        if (Main.map == null) {
+            JOptionPane.showMessageDialog(Main.parent, tr("No data loaded."));
+            return;
+        }
 
-		if (selectedWays.size() < 2) {
-			JOptionPane.showMessageDialog(Main.parent,
-					tr("You must select at least two ways."));
-			return;
-		}
+        if (selectedWays.size() < 2) {
+            JOptionPane.showMessageDialog(Main.parent,
+                    tr("You must select at least two ways."));
+            return;
+        }
 
-		Collection<Command> cmds = new LinkedList<Command>();
-		// Create new relation
-		Relation rel = new Relation();
-		rel.put("type", "multipolygon");
-		// Add ways to it
-		for (int i = 0; i < selectedWays.size(); i++) {
-			Way s = selectedWays.get(i);
-			String xrole = "inner";
-			if (s == maxWay)
-				xrole = "outer";
-			RelationMember rm = new RelationMember(xrole, s);
-			rel.addMember(rm);
-		}
-		// Add relation
-		cmds.add(new AddCommand(rel));
-		// Commit
-		Main.main.undoRedo.add(new SequenceCommand(tr("Create multipolygon"),
-				cmds));
-		Main.map.repaint();
-	}
+        Collection<Command> cmds = new LinkedList<Command>();
+        // Create new relation
+        Relation rel = new Relation();
+        rel.put("type", "multipolygon");
+        // Add ways to it
+        for (int i = 0; i < selectedWays.size(); i++) {
+            Way s = selectedWays.get(i);
+            String xrole = "inner";
+            if (s == maxWay)
+                xrole = "outer";
+            RelationMember rm = new RelationMember(xrole, s);
+            rel.addMember(rm);
+        }
+        // Add relation
+        cmds.add(new AddCommand(rel));
+        // Commit
+        Main.main.undoRedo.add(new SequenceCommand(tr("Create multipolygon"),
+                cmds));
+        Main.map.repaint();
+    }
 
-	/** Enable this action only if something is selected */
-	@Override
-	protected void updateEnabledState() {
-		if (getCurrentDataSet() == null) {
-			setEnabled(false);
-		} else {
-			updateEnabledState(getCurrentDataSet().getSelected());
-		}
-	}
+    /** Enable this action only if something is selected */
+    @Override
+    protected void updateEnabledState() {
+        if (getCurrentDataSet() == null) {
+            setEnabled(false);
+        } else {
+            updateEnabledState(getCurrentDataSet().getSelected());
+        }
+    }
 
-	/** Enable this action only if something is selected */
-	@Override
-	protected void updateEnabledState(
-			Collection<? extends OsmPrimitive> selection) {
-		setEnabled(selection != null && !selection.isEmpty());
-	}
+    /** Enable this action only if something is selected */
+    @Override
+    protected void updateEnabledState(
+            Collection<? extends OsmPrimitive> selection) {
+        setEnabled(selection != null && !selection.isEmpty());
+    }
 }
Index: /applications/editors/josm/plugins/multipoly/src/multipoly/MultipolyPlugin.java
===================================================================
--- /applications/editors/josm/plugins/multipoly/src/multipoly/MultipolyPlugin.java	(revision 23188)
+++ /applications/editors/josm/plugins/multipoly/src/multipoly/MultipolyPlugin.java	(revision 23189)
@@ -15,26 +15,26 @@
 public class MultipolyPlugin extends Plugin {
 
-	protected String name;
+    protected String name;
 
-	public MultipolyPlugin(PluginInformation info) {
-		super(info);
-		name = tr("Create multipolygon");
-		JMenu toolsMenu = null;
-		for (int i = 0; i < Main.main.menu.getMenuCount() && toolsMenu == null; i++) {
-			JMenu menu = Main.main.menu.getMenu(i);
-			String name = menu.getText();
-			if (name != null && name.equals(tr("Tools"))) {
-				toolsMenu = menu;
-			}
-		}
+    public MultipolyPlugin(PluginInformation info) {
+        super(info);
+        name = tr("Create multipolygon");
+        JMenu toolsMenu = null;
+        for (int i = 0; i < Main.main.menu.getMenuCount() && toolsMenu == null; i++) {
+            JMenu menu = Main.main.menu.getMenu(i);
+            String name = menu.getText();
+            if (name != null && name.equals(tr("Tools"))) {
+                toolsMenu = menu;
+            }
+        }
 
-		if (toolsMenu == null) {
-			toolsMenu = new JMenu(name);
-			toolsMenu.add(new JMenuItem(new MultipolyAction()));
-			Main.main.menu.add(toolsMenu, 2);
-		} else {
-			toolsMenu.addSeparator();
-			toolsMenu.add(new JMenuItem(new MultipolyAction()));
-		}
-	}
+        if (toolsMenu == null) {
+            toolsMenu = new JMenu(name);
+            toolsMenu.add(new JMenuItem(new MultipolyAction()));
+            Main.main.menu.add(toolsMenu, 2);
+        } else {
+            toolsMenu.addSeparator();
+            toolsMenu.add(new JMenuItem(new MultipolyAction()));
+        }
+    }
 }
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPref.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPref.java	(revision 23188)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPref.java	(revision 23189)
@@ -7,18 +7,18 @@
  *
  * Use @see PermissionPrefWithDefault instead of this class.
- * 
+ *
  * @author Bodo Meissner
  */
  @Deprecated
 public class PermissionPref {
-	/** name of the preference setting to permit the remote operation */
-	String pref;
-	/** message to be displayed if operation is not permitted */
-	String message;
-	
-	public PermissionPref(String pref, String message)
-	{
-		this.pref = pref;
-		this.message = message;
-	}
+    /** name of the preference setting to permit the remote operation */
+    String pref;
+    /** message to be displayed if operation is not permitted */
+    String message;
+
+    public PermissionPref(String pref, String message)
+    {
+        this.pref = pref;
+        this.message = message;
+    }
 }
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPrefWithDefault.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPrefWithDefault.java	(revision 23188)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/PermissionPrefWithDefault.java	(revision 23189)
@@ -2,7 +2,7 @@
 
 /**
- * This class should replace PermissionPref because it allows explicit 
+ * This class should replace PermissionPref because it allows explicit
  * specification of the permission's default value.
- * 
+ *
  * @author Bodo Meissner
  */
@@ -10,13 +10,13 @@
 public class PermissionPrefWithDefault extends PermissionPref {
 
-	boolean defaultVal = true;
+    boolean defaultVal = true;
 
-	public PermissionPrefWithDefault(String pref, boolean defaultVal, String message) {
-		super(pref, message);
-		this.defaultVal = defaultVal;
-	}
+    public PermissionPrefWithDefault(String pref, boolean defaultVal, String message) {
+        super(pref, message);
+        this.defaultVal = defaultVal;
+    }
 
-	public PermissionPrefWithDefault(PermissionPref prefWithoutDefault) {
-		super(prefWithoutDefault.pref, prefWithoutDefault.message);
-	}
+    public PermissionPrefWithDefault(PermissionPref prefWithoutDefault) {
+        super(prefWithoutDefault.pref, prefWithoutDefault.message);
+    }
 }
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPlugin.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPlugin.java	(revision 23188)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPlugin.java	(revision 23189)
@@ -8,11 +8,11 @@
 
 /**
- * Base plugin for remote control operations. 
+ * Base plugin for remote control operations.
  * This plugin contains operations that use JOSM core only.
- * 
- * Other plugins can register additional operations by calling 
+ *
+ * Other plugins can register additional operations by calling
  * @see addRequestHandler().
  * To allow API changes this plugin contains a @see getVersion() method.
- * 
+ *
  * IMPORTANT! increment the minor version on compatible API extensions
  * and increment the major version and set minor to 0 on incompatible changes.
@@ -20,37 +20,37 @@
 public class RemoteControlPlugin extends Plugin
 {
-	/** API version
-	 * IMPORTANT! update the version number on API changes.
-	 */
-	static final int apiMajorVersion = 1;
-	static final int apiMinorVersion = 0;
-	
-	/**
-	 * RemoteControl HTTP protocol version. Change minor number for compatible
-	 * interface extensions. Change major number in case of incompatible
-	 * changes.
-	 */
-	static final int protocolMajorVersion = 1;
-	static final int protocolMinorVersion = 2;
-	
+    /** API version
+     * IMPORTANT! update the version number on API changes.
+     */
+    static final int apiMajorVersion = 1;
+    static final int apiMinorVersion = 0;
+
+    /**
+     * RemoteControl HTTP protocol version. Change minor number for compatible
+     * interface extensions. Change major number in case of incompatible
+     * changes.
+     */
+    static final int protocolMajorVersion = 1;
+    static final int protocolMinorVersion = 2;
+
     /** The HTTP server this plugin launches */
     static HttpServer server;
 
     /**
-     * Returns an array of int values with major and minor API version 
+     * Returns an array of int values with major and minor API version
      * and major and minor HTTP protocol version.
-     *  
+     *
      * The function returns an int[4] instead of an object with fields
      * to avoid ClassNotFound errors with old versions of remotecontrol.
-     *  
-     * @return array of integer version numbers: 
+     *
+     * @return array of integer version numbers:
      *    apiMajorVersion, apiMinorVersion, protocolMajorVersion, protocolMajorVersion
      */
     public int[] getVersion()
     {
-    	int versions[] = {apiMajorVersion, apiMinorVersion, protocolMajorVersion, protocolMajorVersion};
-    	return versions;
+        int versions[] = {apiMajorVersion, apiMinorVersion, protocolMajorVersion, protocolMajorVersion};
+        return versions;
     }
-    
+
     /**
      * Creates the plugin, and starts the HTTP server
@@ -58,9 +58,9 @@
     public RemoteControlPlugin(PluginInformation info)
     {
-    	super(info);
-    	/*
-		System.out.println("constructor " + this.getClass().getName() + " (" + info.name +
-				" v " + info.version + " stage " + info.stage + ")");
-		*/
+        super(info);
+        /*
+        System.out.println("constructor " + this.getClass().getName() + " (" + info.name +
+                " v " + info.version + " stage " + info.stage + ")");
+        */
         restartServer();
     }
@@ -103,4 +103,4 @@
         RequestProcessor.addRequestHandlerClass(command, handlerClass);
     }
-    
+
 }
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestHandler.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestHandler.java	(revision 23188)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestHandler.java	(revision 23189)
@@ -11,18 +11,18 @@
 
 /**
- * This is the parent of all classes that handle a specific command 
+ * This is the parent of all classes that handle a specific command
  * in remote control plug-in.
- *   
+ *
  * @author Bodo Meissner
  */
 public abstract class RequestHandler
 {
-	public static final String globalConfirmationKey = "remotecontrol.always-confirm";
-	public static final boolean globalConfirmationDefault = false;
-	
-	/** The GET request arguments */
-	protected HashMap<String,String> args;
-	
-	/** The request URL without "GET". */
+    public static final String globalConfirmationKey = "remotecontrol.always-confirm";
+    public static final boolean globalConfirmationDefault = false;
+
+    /** The GET request arguments */
+    protected HashMap<String,String> args;
+
+    /** The request URL without "GET". */
     protected String request;
 
@@ -34,8 +34,8 @@
     /** will be filled with the command assigned to the subclass */
     protected String myCommand;
-    
+
     /**
      * Check permission and parameters and handle request.
-     * 
+     *
      * @throws RequestHandlerForbiddenException
      * @throws RequestHandlerBadRequestException
@@ -44,16 +44,16 @@
     final void handle() throws RequestHandlerForbiddenException, RequestHandlerBadRequestException, RequestHandlerErrorException
     {
-    	checkPermission();
-    	checkMandatoryParams();
-    	handleRequest();
-    }
-    
+        checkPermission();
+        checkMandatoryParams();
+        handleRequest();
+    }
+
     /**
      * Handle a specific command sent as remote control.
-     * 
-     * This method of the subclass will do the real work.  
-     * 
+     *
+     * This method of the subclass will do the real work.
+     *
      * @throws RequestHandlerErrorException
-     * @throws RequestHandlerBadRequestException 
+     * @throws RequestHandlerBadRequestException
      */
     protected abstract void handleRequest() throws RequestHandlerErrorException, RequestHandlerBadRequestException;
@@ -62,8 +62,8 @@
      * Get a specific message to ask the user for permission for the operation
      * requested via remote control.
-     * 
+     *
      * This message will be displayed to the user if the preference
      * remotecontrol.always-confirm is true.
-     * 
+     *
      * @return the message
      */
@@ -74,12 +74,12 @@
      * preference to individually allow the requested operation and an error
      * message to be displayed when a disabled operation is requested.
-     * 
-     * Default is not to check any special preference. Override this in a 
+     *
+     * Default is not to check any special preference. Override this in a
      * subclass to define permission preference and error message.
-     * 
+     *
      * @return the preference name and error message or null
      */
-	@SuppressWarnings("deprecation")
-	public PermissionPref getPermissionPref()
+    @SuppressWarnings("deprecation")
+    public PermissionPref getPermissionPref()
     {
         /* Example:
@@ -93,20 +93,20 @@
     protected String[] getMandatoryParams()
     {
-    	return null;
-    }
-    
-    /**
-     * Check permissions in preferences and display error message 
+        return null;
+    }
+
+    /**
+     * Check permissions in preferences and display error message
      * or ask for permission.
-     * 
+     *
      * @throws RequestHandlerForbiddenException
      */
     @SuppressWarnings("deprecation")
-	final public void checkPermission() throws RequestHandlerForbiddenException
-    {
-        /* 
+    final public void checkPermission() throws RequestHandlerForbiddenException
+    {
+        /*
          * If the subclass defines a specific preference and if this is set
          * to false, abort with an error message.
-         * 
+         *
          * Note: we use the deprecated class here for compatibility with
          * older versions of WMSPlugin.
@@ -118,12 +118,12 @@
             if(permissionPref instanceof PermissionPrefWithDefault)
             {
-            	permissionPrefWithDefault = (PermissionPrefWithDefault) permissionPref;
-            }
-            else 
+                permissionPrefWithDefault = (PermissionPrefWithDefault) permissionPref;
+            }
+            else
             {
-            	permissionPrefWithDefault = new PermissionPrefWithDefault(permissionPref);
+                permissionPrefWithDefault = new PermissionPrefWithDefault(permissionPref);
             }
             if (!Main.pref.getBoolean(permissionPrefWithDefault.pref,
-            		permissionPrefWithDefault.defaultVal)) {
+                    permissionPrefWithDefault.defaultVal)) {
                 System.out.println(permissionPrefWithDefault.message);
                 throw new RequestHandlerForbiddenException();
@@ -147,61 +147,61 @@
     /**
      * Set request URL and parse args.
-     * 
+     *
      * @param url The request URL.
      */
-	public void setUrl(String url) {
-		this.request = url;
-		parseArgs();
-	}
-
-	/**
-	 * Parse the request parameters as key=value pairs.
-	 * The result will be stored in this.args.
-	 * 
-	 * Can be overridden by subclass.
-	 */
-	protected void parseArgs() {
-		StringTokenizer st = new StringTokenizer(this.request, "&?");
-		HashMap<String, String> args = new HashMap<String, String>();
-		// ignore first token which is the command
-		if(st.hasMoreTokens()) st.nextToken();
-		while (st.hasMoreTokens()) {
-			String param = st.nextToken();
-			int eq = param.indexOf("=");
-			if (eq > -1)
-				args.put(param.substring(0, eq),
+    public void setUrl(String url) {
+        this.request = url;
+        parseArgs();
+    }
+
+    /**
+     * Parse the request parameters as key=value pairs.
+     * The result will be stored in this.args.
+     *
+     * Can be overridden by subclass.
+     */
+    protected void parseArgs() {
+        StringTokenizer st = new StringTokenizer(this.request, "&?");
+        HashMap<String, String> args = new HashMap<String, String>();
+        // ignore first token which is the command
+        if(st.hasMoreTokens()) st.nextToken();
+        while (st.hasMoreTokens()) {
+            String param = st.nextToken();
+            int eq = param.indexOf("=");
+            if (eq > -1)
+                args.put(param.substring(0, eq),
                          param.substring(eq + 1));
-		}
-		this.args = args;
-	}
-	
-	void checkMandatoryParams() throws RequestHandlerBadRequestException
-	{
-		String[] mandatory = getMandatoryParams();
-		if(mandatory == null) return;
-		
-		boolean error = false;
-		for(int i = 0; i < mandatory.length; ++i)
-		{
-			String key = mandatory[i];
-			String value = args.get(key);
-			if((value == null) || (value.length() == 0))
-			{
-				error = true;
-				System.out.println("'" + myCommand + "' remote control request must have '" + key + "' parameter");
-			}
-		}
-		if(error) throw new RequestHandlerBadRequestException();
-	}
-	
-	/**
-	 * Save command associated with this handler.
-	 * 
-	 * @param command The command.
-	 */
-	public void setCommand(String command)
-	{
-		if(command.charAt(0) == '/') command = command.substring(1);
-		myCommand = command;
-	}
+        }
+        this.args = args;
+    }
+
+    void checkMandatoryParams() throws RequestHandlerBadRequestException
+    {
+        String[] mandatory = getMandatoryParams();
+        if(mandatory == null) return;
+
+        boolean error = false;
+        for(int i = 0; i < mandatory.length; ++i)
+        {
+            String key = mandatory[i];
+            String value = args.get(key);
+            if((value == null) || (value.length() == 0))
+            {
+                error = true;
+                System.out.println("'" + myCommand + "' remote control request must have '" + key + "' parameter");
+            }
+        }
+        if(error) throw new RequestHandlerBadRequestException();
+    }
+
+    /**
+     * Save command associated with this handler.
+     *
+     * @param command The command.
+     */
+    public void setCommand(String command)
+    {
+        if(command.charAt(0) == '/') command = command.substring(1);
+        myCommand = command;
+    }
 }
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestHandlerForbiddenException.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestHandlerForbiddenException.java	(revision 23188)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestHandlerForbiddenException.java	(revision 23189)
@@ -2,4 +2,4 @@
 
 public class RequestHandlerForbiddenException extends RequestHandlerException {
-	private static final long serialVersionUID = 2263904699747115423L;
+    private static final long serialVersionUID = 2263904699747115423L;
 }
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 23188)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java	(revision 23189)
@@ -23,286 +23,286 @@
  */
 public class RequestProcessor extends Thread {
-	/**
-	 * RemoteControl protocol version. Change minor number for compatible
-	 * interface extensions. Change major number in case of incompatible
-	 * changes.
-	 */
-	public static final String PROTOCOLVERSION = "{\"protocolversion\": {\"major\": " +
-		RemoteControlPlugin.protocolMajorVersion + ", \"minor\": " + 
-		RemoteControlPlugin.protocolMinorVersion +
-		"}, \"application\": \"JOSM RemoteControl\"}";
-
-	/** The socket this processor listens on */
-	private Socket request;
-
-	/**
-	 * Collection of request handlers.
-	 * Will be initialized with default handlers here. Other plug-ins
-	 * can extend this list by using @see addRequestHandler 
-	 */
-	private static HashMap<String, Class<? extends RequestHandler>> handlers = new HashMap<String, Class<? extends RequestHandler>>();
-
-	/**
-	 * Constructor
-	 * 
-	 * @param request A socket to read the request.
-	 */
-	public RequestProcessor(Socket request) {
-		super("RemoteControl request processor");
-		this.setDaemon(true);
-		this.request = request;
-	}
-
-	/**
-	 * Spawns a new thread for the request
-	 * 
-	 * @param request
-	 *            The WMS request
-	 */
-	public static void processRequest(Socket request) {
-		RequestProcessor processor = new RequestProcessor(request);
-		processor.start();
-	}
-
-	/**
-	 * Add external request handler. Can be used by other plug-ins that
-	 * want to use remote control.
-	 * @param command The command to handle.
-	 * @param handler The additional request handler.
-	 */
-	static void addRequestHandlerClass(String command,
-			Class<? extends RequestHandler> handler) {
-		addRequestHandlerClass(command, handler, false);
-	}
-
-	/**
-	 * Add external request handler. Message can be suppressed.
-	 * (for internal use)
-	 * @param command The command to handle.
-	 * @param handler The additional request handler.
-	 * @param silent Don't show message if true.
-	 */
-	private static void addRequestHandlerClass(String command,
-				Class<? extends RequestHandler> handler, boolean silent) {
-		if(command.charAt(0) == '/')
-		{
-			command = command.substring(1);
-		}
-		String commandWithSlash = "/" + command;
-		if (handlers.get(commandWithSlash) != null) {
-			System.out.println("RemoteControl: ignoring duplicate command " + command
-					+ " with handler " + handler.getName());
-		} else {
-			if(!silent) System.out.println("RemoteControl: adding command \"" + 
-					command + "\" (handled by " + handler.getSimpleName() + ")");
-			handlers.put(commandWithSlash, handler);
-		}
-	}
-
-	/** Add default request handlers */
-	static {
-		addRequestHandlerClass(LoadAndZoomHandler.command,
-				LoadAndZoomHandler.class, true);
-		addRequestHandlerClass(LoadAndZoomHandler.command2,
-				LoadAndZoomHandler.class, true);
-		addRequestHandlerClass(AddNodeHandler.command, AddNodeHandler.class, true);
-		addRequestHandlerClass(ImportHandler.command, ImportHandler.class, true);
-		addRequestHandlerClass(VersionHandler.command, VersionHandler.class, true);
-	}
-
-	/**
-	 * The work is done here.
-	 */
-	public void run() {
-		Writer out = null;
-		try {
-			OutputStream raw = new BufferedOutputStream(
-					request.getOutputStream());
-			out = new OutputStreamWriter(raw);
-			Reader in = new InputStreamReader(new BufferedInputStream(
-					request.getInputStream()), "ASCII");
-
-			StringBuffer requestLine = new StringBuffer();
-			while (requestLine.length() < 1024) {
-				int c = in.read();
-				if (c == '\r' || c == '\n')
-					break;
-				requestLine.append((char) c);
-			}
-
-			System.out.println("RemoteControl received: " + requestLine);
-			String get = requestLine.toString();
-			StringTokenizer st = new StringTokenizer(get);
-			if (!st.hasMoreTokens()) {
-				sendError(out);
-				return;
-			}
-			String method = st.nextToken();
-			if (!st.hasMoreTokens()) {
-				sendError(out);
-				return;
-			}
-			String url = st.nextToken();
-
-			if (!method.equals("GET")) {
-				sendNotImplemented(out);
-				return;
-			}
-
-			String command = null;
-			int questionPos = url.indexOf('?');
-			if(questionPos < 0)
-			{
-				command = url;
-			}
-			else
-			{
-				command = url.substring(0, questionPos);
-			}
-
-			// find a handler for this command
-			Class<? extends RequestHandler> handlerClass = handlers
-					.get(command);
-			if (handlerClass == null) {
-				// no handler found
-				sendBadRequest(out);
-			} else {
-				// create handler object
-				RequestHandler handler = handlerClass.newInstance();
-				try {
-					handler.setCommand(command);
-					handler.setUrl(url);
-					handler.checkPermission();
-					handler.handle();
-					sendHeader(out, "200 OK", handler.contentType, false);
-					out.write("Content-length: " + handler.content.length()
-							+ "\r\n");
-					out.write("\r\n");
-					out.write(handler.content);
-					out.flush();
-				} catch (RequestHandlerErrorException ex) {
-					sendError(out);
-				} catch (RequestHandlerBadRequestException ex) {
-					sendBadRequest(out);
-				} catch (RequestHandlerForbiddenException ex) {
-					sendForbidden(out);
-				}
-			}
-
-		} catch (IOException ioe) {
-		} catch (Exception e) {
-			e.printStackTrace();
-			try {
-				sendError(out);
-			} catch (IOException e1) {
-			}
-		} finally {
-			try {
-				request.close();
-			} catch (IOException e) {
-			}
-		}
-	}
-
-	/**
-	 * Sends a 500 error: server error
-	 * 
-	 * @param out
-	 *            The writer where the error is written
-	 * @throws IOException
-	 *             If the error can not be written
-	 */
-	private void sendError(Writer out) throws IOException {
-		sendHeader(out, "500 Internal Server Error", "text/html", true);
-		out.write("<HTML>\r\n");
-		out.write("<HEAD><TITLE>Internal Error</TITLE>\r\n");
-		out.write("</HEAD>\r\n");
-		out.write("<BODY>");
-		out.write("<H1>HTTP Error 500: Internal Server Error</h2>\r\n");
-		out.write("</BODY></HTML>\r\n");
-		out.flush();
-	}
-
-	/**
-	 * Sends a 501 error: not implemented
-	 * 
-	 * @param out
-	 *            The writer where the error is written
-	 * @throws IOException
-	 *             If the error can not be written
-	 */
-	private void sendNotImplemented(Writer out) throws IOException {
-		sendHeader(out, "501 Not Implemented", "text/html", true);
-		out.write("<HTML>\r\n");
-		out.write("<HEAD><TITLE>Not Implemented</TITLE>\r\n");
-		out.write("</HEAD>\r\n");
-		out.write("<BODY>");
-		out.write("<H1>HTTP Error 501: Not Implemented</h2>\r\n");
-		out.write("</BODY></HTML>\r\n");
-		out.flush();
-	}
-
-	/**
-	 * Sends a 403 error: forbidden
-	 * 
-	 * @param out
-	 *            The writer where the error is written
-	 * @throws IOException
-	 *             If the error can not be written
-	 */
-	private void sendForbidden(Writer out) throws IOException {
-		sendHeader(out, "403 Forbidden", "text/html", true);
-		out.write("<HTML>\r\n");
-		out.write("<HEAD><TITLE>Forbidden</TITLE>\r\n");
-		out.write("</HEAD>\r\n");
-		out.write("<BODY>");
-		out.write("<H1>HTTP Error 403: Forbidden</h2>\r\n");
-		out.write("</BODY></HTML>\r\n");
-		out.flush();
-	}
-
-	/**
-	 * Sends a 403 error: forbidden
-	 * 
-	 * @param out
-	 *            The writer where the error is written
-	 * @throws IOException
-	 *             If the error can not be written
-	 */
-	private void sendBadRequest(Writer out) throws IOException {
-		sendHeader(out, "400 Bad Request", "text/html", true);
-		out.write("<HTML>\r\n");
-		out.write("<HEAD><TITLE>Bad Request</TITLE>\r\n");
-		out.write("</HEAD>\r\n");
-		out.write("<BODY>");
-		out.write("<H1>HTTP Error 400: Bad Request</h2>\r\n");
-		out.write("</BODY></HTML>\r\n");
-		out.flush();
-	}
-
-	/**
-	 * Send common HTTP headers to the client.
-	 * 
-	 * @param out
-	 *            The Writer
-	 * @param status
-	 *            The status string ("200 OK", "500", etc)
-	 * @param contentType
-	 *            The content type of the data sent
-	 * @param endHeaders
-	 *            If true, adds a new line, ending the headers.
-	 * @throws IOException
-	 *             When error
-	 */
-	private void sendHeader(Writer out, String status, String contentType,
-			boolean endHeaders) throws IOException {
-		out.write("HTTP/1.1 " + status + "\r\n");
-		Date now = new Date();
-		out.write("Date: " + now + "\r\n");
-		out.write("Server: JOSM RemoteControl\r\n");
-		out.write("Content-type: " + contentType + "\r\n");
-		out.write("Access-Control-Allow-Origin: *\r\n");
-		if (endHeaders)
-			out.write("\r\n");
-	}
+    /**
+     * RemoteControl protocol version. Change minor number for compatible
+     * interface extensions. Change major number in case of incompatible
+     * changes.
+     */
+    public static final String PROTOCOLVERSION = "{\"protocolversion\": {\"major\": " +
+        RemoteControlPlugin.protocolMajorVersion + ", \"minor\": " +
+        RemoteControlPlugin.protocolMinorVersion +
+        "}, \"application\": \"JOSM RemoteControl\"}";
+
+    /** The socket this processor listens on */
+    private Socket request;
+
+    /**
+     * Collection of request handlers.
+     * Will be initialized with default handlers here. Other plug-ins
+     * can extend this list by using @see addRequestHandler
+     */
+    private static HashMap<String, Class<? extends RequestHandler>> handlers = new HashMap<String, Class<? extends RequestHandler>>();
+
+    /**
+     * Constructor
+     *
+     * @param request A socket to read the request.
+     */
+    public RequestProcessor(Socket request) {
+        super("RemoteControl request processor");
+        this.setDaemon(true);
+        this.request = request;
+    }
+
+    /**
+     * Spawns a new thread for the request
+     *
+     * @param request
+     *            The WMS request
+     */
+    public static void processRequest(Socket request) {
+        RequestProcessor processor = new RequestProcessor(request);
+        processor.start();
+    }
+
+    /**
+     * Add external request handler. Can be used by other plug-ins that
+     * want to use remote control.
+     * @param command The command to handle.
+     * @param handler The additional request handler.
+     */
+    static void addRequestHandlerClass(String command,
+            Class<? extends RequestHandler> handler) {
+        addRequestHandlerClass(command, handler, false);
+    }
+
+    /**
+     * Add external request handler. Message can be suppressed.
+     * (for internal use)
+     * @param command The command to handle.
+     * @param handler The additional request handler.
+     * @param silent Don't show message if true.
+     */
+    private static void addRequestHandlerClass(String command,
+                Class<? extends RequestHandler> handler, boolean silent) {
+        if(command.charAt(0) == '/')
+        {
+            command = command.substring(1);
+        }
+        String commandWithSlash = "/" + command;
+        if (handlers.get(commandWithSlash) != null) {
+            System.out.println("RemoteControl: ignoring duplicate command " + command
+                    + " with handler " + handler.getName());
+        } else {
+            if(!silent) System.out.println("RemoteControl: adding command \"" +
+                    command + "\" (handled by " + handler.getSimpleName() + ")");
+            handlers.put(commandWithSlash, handler);
+        }
+    }
+
+    /** Add default request handlers */
+    static {
+        addRequestHandlerClass(LoadAndZoomHandler.command,
+                LoadAndZoomHandler.class, true);
+        addRequestHandlerClass(LoadAndZoomHandler.command2,
+                LoadAndZoomHandler.class, true);
+        addRequestHandlerClass(AddNodeHandler.command, AddNodeHandler.class, true);
+        addRequestHandlerClass(ImportHandler.command, ImportHandler.class, true);
+        addRequestHandlerClass(VersionHandler.command, VersionHandler.class, true);
+    }
+
+    /**
+     * The work is done here.
+     */
+    public void run() {
+        Writer out = null;
+        try {
+            OutputStream raw = new BufferedOutputStream(
+                    request.getOutputStream());
+            out = new OutputStreamWriter(raw);
+            Reader in = new InputStreamReader(new BufferedInputStream(
+                    request.getInputStream()), "ASCII");
+
+            StringBuffer requestLine = new StringBuffer();
+            while (requestLine.length() < 1024) {
+                int c = in.read();
+                if (c == '\r' || c == '\n')
+                    break;
+                requestLine.append((char) c);
+            }
+
+            System.out.println("RemoteControl received: " + requestLine);
+            String get = requestLine.toString();
+            StringTokenizer st = new StringTokenizer(get);
+            if (!st.hasMoreTokens()) {
+                sendError(out);
+                return;
+            }
+            String method = st.nextToken();
+            if (!st.hasMoreTokens()) {
+                sendError(out);
+                return;
+            }
+            String url = st.nextToken();
+
+            if (!method.equals("GET")) {
+                sendNotImplemented(out);
+                return;
+            }
+
+            String command = null;
+            int questionPos = url.indexOf('?');
+            if(questionPos < 0)
+            {
+                command = url;
+            }
+            else
+            {
+                command = url.substring(0, questionPos);
+            }
+
+            // find a handler for this command
+            Class<? extends RequestHandler> handlerClass = handlers
+                    .get(command);
+            if (handlerClass == null) {
+                // no handler found
+                sendBadRequest(out);
+            } else {
+                // create handler object
+                RequestHandler handler = handlerClass.newInstance();
+                try {
+                    handler.setCommand(command);
+                    handler.setUrl(url);
+                    handler.checkPermission();
+                    handler.handle();
+                    sendHeader(out, "200 OK", handler.contentType, false);
+                    out.write("Content-length: " + handler.content.length()
+                            + "\r\n");
+                    out.write("\r\n");
+                    out.write(handler.content);
+                    out.flush();
+                } catch (RequestHandlerErrorException ex) {
+                    sendError(out);
+                } catch (RequestHandlerBadRequestException ex) {
+                    sendBadRequest(out);
+                } catch (RequestHandlerForbiddenException ex) {
+                    sendForbidden(out);
+                }
+            }
+
+        } catch (IOException ioe) {
+        } catch (Exception e) {
+            e.printStackTrace();
+            try {
+                sendError(out);
+            } catch (IOException e1) {
+            }
+        } finally {
+            try {
+                request.close();
+            } catch (IOException e) {
+            }
+        }
+    }
+
+    /**
+     * Sends a 500 error: server error
+     *
+     * @param out
+     *            The writer where the error is written
+     * @throws IOException
+     *             If the error can not be written
+     */
+    private void sendError(Writer out) throws IOException {
+        sendHeader(out, "500 Internal Server Error", "text/html", true);
+        out.write("<HTML>\r\n");
+        out.write("<HEAD><TITLE>Internal Error</TITLE>\r\n");
+        out.write("</HEAD>\r\n");
+        out.write("<BODY>");
+        out.write("<H1>HTTP Error 500: Internal Server Error</h2>\r\n");
+        out.write("</BODY></HTML>\r\n");
+        out.flush();
+    }
+
+    /**
+     * Sends a 501 error: not implemented
+     *
+     * @param out
+     *            The writer where the error is written
+     * @throws IOException
+     *             If the error can not be written
+     */
+    private void sendNotImplemented(Writer out) throws IOException {
+        sendHeader(out, "501 Not Implemented", "text/html", true);
+        out.write("<HTML>\r\n");
+        out.write("<HEAD><TITLE>Not Implemented</TITLE>\r\n");
+        out.write("</HEAD>\r\n");
+        out.write("<BODY>");
+        out.write("<H1>HTTP Error 501: Not Implemented</h2>\r\n");
+        out.write("</BODY></HTML>\r\n");
+        out.flush();
+    }
+
+    /**
+     * Sends a 403 error: forbidden
+     *
+     * @param out
+     *            The writer where the error is written
+     * @throws IOException
+     *             If the error can not be written
+     */
+    private void sendForbidden(Writer out) throws IOException {
+        sendHeader(out, "403 Forbidden", "text/html", true);
+        out.write("<HTML>\r\n");
+        out.write("<HEAD><TITLE>Forbidden</TITLE>\r\n");
+        out.write("</HEAD>\r\n");
+        out.write("<BODY>");
+        out.write("<H1>HTTP Error 403: Forbidden</h2>\r\n");
+        out.write("</BODY></HTML>\r\n");
+        out.flush();
+    }
+
+    /**
+     * Sends a 403 error: forbidden
+     *
+     * @param out
+     *            The writer where the error is written
+     * @throws IOException
+     *             If the error can not be written
+     */
+    private void sendBadRequest(Writer out) throws IOException {
+        sendHeader(out, "400 Bad Request", "text/html", true);
+        out.write("<HTML>\r\n");
+        out.write("<HEAD><TITLE>Bad Request</TITLE>\r\n");
+        out.write("</HEAD>\r\n");
+        out.write("<BODY>");
+        out.write("<H1>HTTP Error 400: Bad Request</h2>\r\n");
+        out.write("</BODY></HTML>\r\n");
+        out.flush();
+    }
+
+    /**
+     * Send common HTTP headers to the client.
+     *
+     * @param out
+     *            The Writer
+     * @param status
+     *            The status string ("200 OK", "500", etc)
+     * @param contentType
+     *            The content type of the data sent
+     * @param endHeaders
+     *            If true, adds a new line, ending the headers.
+     * @throws IOException
+     *             When error
+     */
+    private void sendHeader(Writer out, String status, String contentType,
+            boolean endHeaders) throws IOException {
+        out.write("HTTP/1.1 " + status + "\r\n");
+        Date now = new Date();
+        out.write("Date: " + now + "\r\n");
+        out.write("Server: JOSM RemoteControl\r\n");
+        out.write("Content-type: " + contentType + "\r\n");
+        out.write("Access-Control-Allow-Origin: *\r\n");
+        if (endHeaders)
+            out.write("\r\n");
+    }
 }
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/AddNodeHandler.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/AddNodeHandler.java	(revision 23188)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/AddNodeHandler.java	(revision 23189)
@@ -17,31 +17,31 @@
 public class AddNodeHandler extends RequestHandler {
 
-	public static final String command = "add_node";
-	public static final String permissionKey = "remotecontrol.permission.create-objects";
-	public static final boolean permissionDefault = false;
+    public static final String command = "add_node";
+    public static final String permissionKey = "remotecontrol.permission.create-objects";
+    public static final boolean permissionDefault = false;
 
-	@Override
-	protected void handleRequest() {
+    @Override
+    protected void handleRequest() {
         addNode(args);
-	}
+    }
 
-	@Override
-	protected String[] getMandatoryParams()
-	{
-		return new String[] { "lat", "lon" };
-	}
-	
-	@Override
-	public String getPermissionMessage() {
-		return tr("Remote Control has been asked to create a new node.");
-	}
+    @Override
+    protected String[] getMandatoryParams()
+    {
+        return new String[] { "lat", "lon" };
+    }
 
-	@Override
-	public PermissionPrefWithDefault getPermissionPref()
-	{
-		return new PermissionPrefWithDefault(permissionKey, permissionDefault,
-				"RemoteControl: creating objects forbidden by preferences");
-	}
-	
+    @Override
+    public String getPermissionMessage() {
+        return tr("Remote Control has been asked to create a new node.");
+    }
+
+    @Override
+    public PermissionPrefWithDefault getPermissionPref()
+    {
+        return new PermissionPrefWithDefault(permissionKey, permissionDefault,
+                "RemoteControl: creating objects forbidden by preferences");
+    }
+
     /**
      * Adds a node, implements the GET /add_node?lon=...&amp;lat=... request.
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/ImportHandler.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/ImportHandler.java	(revision 23188)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/ImportHandler.java	(revision 23189)
@@ -16,10 +16,10 @@
 public class ImportHandler extends RequestHandler {
 
-	public static final String command = "import";
-	public static final String permissionKey = "remotecontrol.permission.import";
-	public static final boolean permissionDefault = true;
+    public static final String command = "import";
+    public static final String permissionKey = "remotecontrol.permission.import";
+    public static final boolean permissionDefault = true;
 
-	@Override
-	protected void handleRequest() throws RequestHandlerErrorException {
+    @Override
+    protected void handleRequest() throws RequestHandlerErrorException {
         try {
             DownloadTask osmTask = new DownloadOsmTask();
@@ -30,23 +30,23 @@
             throw new RequestHandlerErrorException();
         }
-	}
+    }
 
-	@Override
-	protected String[] getMandatoryParams()
-	{
-		return new String[] { "url" };
-	}
-	
-	@Override
-	public String getPermissionMessage() {
-		return tr("Remote Control has been asked to import data from the following URL:") +
+    @Override
+    protected String[] getMandatoryParams()
+    {
+        return new String[] { "url" };
+    }
+
+    @Override
+    public String getPermissionMessage() {
+        return tr("Remote Control has been asked to import data from the following URL:") +
         "<br>" + request;
-	}
+    }
 
-	@Override
-	public PermissionPrefWithDefault getPermissionPref()
-	{
-		return new PermissionPrefWithDefault(permissionKey, permissionDefault,
-				"RemoteControl: import forbidden by preferences");
-	}
+    @Override
+    public PermissionPrefWithDefault getPermissionPref()
+    {
+        return new PermissionPrefWithDefault(permissionKey, permissionDefault,
+                "RemoteControl: import forbidden by preferences");
+    }
 }
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/LoadAndZoomHandler.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/LoadAndZoomHandler.java	(revision 23188)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/LoadAndZoomHandler.java	(revision 23189)
@@ -29,139 +29,139 @@
 public class LoadAndZoomHandler extends RequestHandler
 {
-	public static final String command = "load_and_zoom";
-	public static final String command2 = "zoom";
-	
-	public static final String loadDataPermissionKey = "remotecontrol.permission.load-data";
-	public static final boolean loadDataPermissionDefault = true;
-	public static final String changeSelectionPermissionKey = "remotecontrol.permission.change-selection";
-	public static final boolean changeSelectionPermissionDefault = true;
-	public static final String changeViewportPermissionKey = "remotecontrol.permission.change-viewport";
-	public static final boolean changeViewportPermissionDefault = true;
-	
+    public static final String command = "load_and_zoom";
+    public static final String command2 = "zoom";
+
+    public static final String loadDataPermissionKey = "remotecontrol.permission.load-data";
+    public static final boolean loadDataPermissionDefault = true;
+    public static final String changeSelectionPermissionKey = "remotecontrol.permission.change-selection";
+    public static final boolean changeSelectionPermissionDefault = true;
+    public static final String changeViewportPermissionKey = "remotecontrol.permission.change-viewport";
+    public static final boolean changeViewportPermissionDefault = true;
+
     @Override
     public String getPermissionMessage()
     {
-    	return tr("Remote Control has been asked to load data from the API.") +
+        return tr("Remote Control has been asked to load data from the API.") +
         "<br>" + tr("Request details: {0}", request);
     }
 
-	@Override
-	protected String[] getMandatoryParams()
-	{
-		return new String[] { "bottom", "top", "left", "right" };
-	}
-	
-	@Override
-	protected void handleRequest() throws RequestHandlerErrorException
-	{
-		DownloadTask osmTask = new DownloadOsmTask();
-		double minlat = 0;
-		double maxlat = 0;
-		double minlon = 0;
-		double maxlon = 0;
-		try {
-			minlat = Double.parseDouble(args.get("bottom"));
-			maxlat = Double.parseDouble(args.get("top"));
-			minlon = Double.parseDouble(args.get("left"));
-			maxlon = Double.parseDouble(args.get("right"));
+    @Override
+    protected String[] getMandatoryParams()
+    {
+        return new String[] { "bottom", "top", "left", "right" };
+    }
 
-			if(command.equals(myCommand))
-			{
-				if (!Main.pref.getBoolean(loadDataPermissionKey, loadDataPermissionDefault))
-				{
-					System.out.println("RemoteControl: download forbidden by preferences");
-				}
-				else
-				{
-	
-					// find out whether some data has already been downloaded
-					Area present = null;
-					Area toDownload = null;
-					DataSet ds = Main.main.getCurrentDataSet();
-					if (ds != null)
-						present = ds.getDataSourceArea();
-					if (present != null && !present.isEmpty()) {
-						toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat));
-						toDownload.subtract(present);
-						if (!toDownload.isEmpty())
-						{
-							// the result might not be a rectangle (L shaped etc)
-							Rectangle2D downloadBounds = toDownload.getBounds2D();
-							minlat = downloadBounds.getMinY();
-							minlon = downloadBounds.getMinX();
-							maxlat = downloadBounds.getMaxY();
-							maxlon = downloadBounds.getMaxX();
-						}
-					}
-					if((toDownload != null) && toDownload.isEmpty())
-					{
-						System.out.println("RemoteControl: no download necessary");
-					}
-					else
-					{
-	                    Future<?> future = osmTask.download(false /*no new layer*/, new Bounds(minlat,minlon,maxlat,maxlon), null /* let the task manage the progress monitor */);
-	                    Main.worker.submit(new PostDownloadHandler(osmTask, future));
-					}
-				}
-			}
-		} catch (Exception ex) {
-			System.out.println("RemoteControl: Error parsing load_and_zoom remote control request:");
-			ex.printStackTrace();
-			throw new RequestHandlerErrorException();
-		}
-		if (args.containsKey("select") && Main.pref.getBoolean(changeSelectionPermissionKey, changeSelectionPermissionDefault)) {
-			// select objects after downloading, zoom to selection.
-			final String selection = args.get("select");
-			Main.worker.execute(new Runnable() {
-				public void run() {
-					HashSet<Long> ways = new HashSet<Long>();
-					HashSet<Long> nodes = new HashSet<Long>();
-					HashSet<Long> relations = new HashSet<Long>();
-					HashSet<OsmPrimitive> newSel = new HashSet<OsmPrimitive>();
-					for (String item : selection.split(",")) {
-						if (item.startsWith("way")) {
-							ways.add(Long.parseLong(item.substring(3)));
-						} else if (item.startsWith("node")) {
-							nodes.add(Long.parseLong(item.substring(4)));
-						} else if (item.startsWith("relation")) {
-							relations.add(Long.parseLong(item.substring(8)));
-						} else if (item.startsWith("rel")) {
-							relations.add(Long.parseLong(item.substring(3)));
-						} else {
-							System.out.println("RemoteControl: invalid selection '"+item+"' ignored");
-						}
-					}
-					DataSet ds = Main.main.getCurrentDataSet();
-					if(ds == null) // e.g. download failed
-						return;
-					for (Way w : ds.getWays()) if (ways.contains(w.getId())) newSel.add(w);
-					for (Node n : ds.getNodes()) if (nodes.contains(n.getId())) newSel.add(n);
-					for (Relation r : ds.getRelations()) if (relations.contains(r.getId())) newSel.add(r);
-					ds.setSelected(newSel);
-					if (Main.pref.getBoolean(changeViewportPermissionKey, changeViewportPermissionDefault))
-						new AutoScaleAction("selection").actionPerformed(null);
-				}
-			});
-		} else if (Main.pref.getBoolean(changeViewportPermissionKey, changeViewportPermissionDefault)) {
-			// after downloading, zoom to downloaded area.
-			zoom(minlat, maxlat, minlon, maxlon);
-		}
-	}
+    @Override
+    protected void handleRequest() throws RequestHandlerErrorException
+    {
+        DownloadTask osmTask = new DownloadOsmTask();
+        double minlat = 0;
+        double maxlat = 0;
+        double minlon = 0;
+        double maxlon = 0;
+        try {
+            minlat = Double.parseDouble(args.get("bottom"));
+            maxlat = Double.parseDouble(args.get("top"));
+            minlon = Double.parseDouble(args.get("left"));
+            maxlon = Double.parseDouble(args.get("right"));
 
-	protected void zoom(double minlat, double maxlat, double minlon, double maxlon) {
-		final Bounds bounds = new Bounds(new LatLon(minlat, minlon),
-				new LatLon(maxlat, maxlon));
+            if(command.equals(myCommand))
+            {
+                if (!Main.pref.getBoolean(loadDataPermissionKey, loadDataPermissionDefault))
+                {
+                    System.out.println("RemoteControl: download forbidden by preferences");
+                }
+                else
+                {
 
-		// make sure this isn't called unless there *is* a MapView
-		//
-		if (Main.map != null && Main.map.mapView != null) {
-			Main.worker.execute(new Runnable() {
-				public void run() {
-					BoundingXYVisitor bbox = new BoundingXYVisitor();
-					bbox.visit(bounds);
-					Main.map.mapView.recalculateCenterScale(bbox);
-				}
-			});
-		}
-	}
+                    // find out whether some data has already been downloaded
+                    Area present = null;
+                    Area toDownload = null;
+                    DataSet ds = Main.main.getCurrentDataSet();
+                    if (ds != null)
+                        present = ds.getDataSourceArea();
+                    if (present != null && !present.isEmpty()) {
+                        toDownload = new Area(new Rectangle2D.Double(minlon,minlat,maxlon-minlon,maxlat-minlat));
+                        toDownload.subtract(present);
+                        if (!toDownload.isEmpty())
+                        {
+                            // the result might not be a rectangle (L shaped etc)
+                            Rectangle2D downloadBounds = toDownload.getBounds2D();
+                            minlat = downloadBounds.getMinY();
+                            minlon = downloadBounds.getMinX();
+                            maxlat = downloadBounds.getMaxY();
+                            maxlon = downloadBounds.getMaxX();
+                        }
+                    }
+                    if((toDownload != null) && toDownload.isEmpty())
+                    {
+                        System.out.println("RemoteControl: no download necessary");
+                    }
+                    else
+                    {
+                        Future<?> future = osmTask.download(false /*no new layer*/, new Bounds(minlat,minlon,maxlat,maxlon), null /* let the task manage the progress monitor */);
+                        Main.worker.submit(new PostDownloadHandler(osmTask, future));
+                    }
+                }
+            }
+        } catch (Exception ex) {
+            System.out.println("RemoteControl: Error parsing load_and_zoom remote control request:");
+            ex.printStackTrace();
+            throw new RequestHandlerErrorException();
+        }
+        if (args.containsKey("select") && Main.pref.getBoolean(changeSelectionPermissionKey, changeSelectionPermissionDefault)) {
+            // select objects after downloading, zoom to selection.
+            final String selection = args.get("select");
+            Main.worker.execute(new Runnable() {
+                public void run() {
+                    HashSet<Long> ways = new HashSet<Long>();
+                    HashSet<Long> nodes = new HashSet<Long>();
+                    HashSet<Long> relations = new HashSet<Long>();
+                    HashSet<OsmPrimitive> newSel = new HashSet<OsmPrimitive>();
+                    for (String item : selection.split(",")) {
+                        if (item.startsWith("way")) {
+                            ways.add(Long.parseLong(item.substring(3)));
+                        } else if (item.startsWith("node")) {
+                            nodes.add(Long.parseLong(item.substring(4)));
+                        } else if (item.startsWith("relation")) {
+                            relations.add(Long.parseLong(item.substring(8)));
+                        } else if (item.startsWith("rel")) {
+                            relations.add(Long.parseLong(item.substring(3)));
+                        } else {
+                            System.out.println("RemoteControl: invalid selection '"+item+"' ignored");
+                        }
+                    }
+                    DataSet ds = Main.main.getCurrentDataSet();
+                    if(ds == null) // e.g. download failed
+                        return;
+                    for (Way w : ds.getWays()) if (ways.contains(w.getId())) newSel.add(w);
+                    for (Node n : ds.getNodes()) if (nodes.contains(n.getId())) newSel.add(n);
+                    for (Relation r : ds.getRelations()) if (relations.contains(r.getId())) newSel.add(r);
+                    ds.setSelected(newSel);
+                    if (Main.pref.getBoolean(changeViewportPermissionKey, changeViewportPermissionDefault))
+                        new AutoScaleAction("selection").actionPerformed(null);
+                }
+            });
+        } else if (Main.pref.getBoolean(changeViewportPermissionKey, changeViewportPermissionDefault)) {
+            // after downloading, zoom to downloaded area.
+            zoom(minlat, maxlat, minlon, maxlon);
+        }
+    }
+
+    protected void zoom(double minlat, double maxlat, double minlon, double maxlon) {
+        final Bounds bounds = new Bounds(new LatLon(minlat, minlon),
+                new LatLon(maxlat, maxlon));
+
+        // make sure this isn't called unless there *is* a MapView
+        //
+        if (Main.map != null && Main.map.mapView != null) {
+            Main.worker.execute(new Runnable() {
+                public void run() {
+                    BoundingXYVisitor bbox = new BoundingXYVisitor();
+                    bbox.visit(bounds);
+                    Main.map.mapView.recalculateCenterScale(bbox);
+                }
+            });
+        }
+    }
 }
Index: /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/VersionHandler.java
===================================================================
--- /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/VersionHandler.java	(revision 23188)
+++ /applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/handler/VersionHandler.java	(revision 23189)
@@ -14,28 +14,28 @@
 public class VersionHandler extends RequestHandler {
 
-	public static final String command = "version";
-	public static final String permissionKey = "remotecontrol.permission.read-protocolversion";
-	public static final boolean permissionDefault = true;
+    public static final String command = "version";
+    public static final String permissionKey = "remotecontrol.permission.read-protocolversion";
+    public static final boolean permissionDefault = true;
 
-	@Override
-	protected void handleRequest() throws RequestHandlerErrorException,
-			RequestHandlerBadRequestException {
-		content = RequestProcessor.PROTOCOLVERSION;
-		contentType = "application/json";
-		if (args.containsKey("jsonp")) {
-			content = args.get("jsonp")+ " && " + args.get("jsonp") + "(" + content + ")";
-		}
-	}
+    @Override
+    protected void handleRequest() throws RequestHandlerErrorException,
+            RequestHandlerBadRequestException {
+        content = RequestProcessor.PROTOCOLVERSION;
+        contentType = "application/json";
+        if (args.containsKey("jsonp")) {
+            content = args.get("jsonp")+ " && " + args.get("jsonp") + "(" + content + ")";
+        }
+    }
 
-	@Override
-	public String getPermissionMessage() {
-		return tr("Remote Control has been asked to report its protocol version. This enables web sites to detect a running JOSM.");
-	}
+    @Override
+    public String getPermissionMessage() {
+        return tr("Remote Control has been asked to report its protocol version. This enables web sites to detect a running JOSM.");
+    }
 
-	@Override
-	public PermissionPrefWithDefault getPermissionPref()
-	{
-		return new PermissionPrefWithDefault(permissionKey, permissionDefault,
-				"RemoteControl: /version forbidden by preferences");
-	}
+    @Override
+    public PermissionPrefWithDefault getPermissionPref()
+    {
+        return new PermissionPrefWithDefault(permissionKey, permissionDefault,
+                "RemoteControl: /version forbidden by preferences");
+    }
 }
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/ConvertedWay.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/ConvertedWay.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/ConvertedWay.java	(revision 23189)
@@ -11,81 +11,81 @@
 
 public class ConvertedWay {
-	
-	public class WayEnd {
-		private Node end;
-		
-		public WayEnd(Node end) {
-			this.end = end;
-		}
-		
-		@Override
-		public boolean equals(Object o) {
-			if (o instanceof WayEnd) {
-				WayEnd otherEnd = (WayEnd)o;
-				return end.equals(otherEnd.end) && routes.equals(otherEnd.getRoutes());
-			} else {
-				return false;
-			}
-		}
-		
-		@Override
-		public int hashCode() {
-			return end.hashCode() + routes.hashCode();
-		}
-		
-		public BitSet getRoutes() {
-			return routes;
-		}
-		
-		public ConvertedWay getWay() {
-			return ConvertedWay.this;
-		}
-	}
-	
-	private List<Node> nodes = new ArrayList<Node>();
-	private BitSet routes;
-	
-	public ConvertedWay(BitSet routes, Way way) {
-		this.routes = routes;
-		nodes.addAll(way.getNodes());
-	}
-	
-	public WayEnd getStart() {
-		return new WayEnd(nodes.get(0));
-	}
-	
-	public WayEnd getStop() {
-		return new WayEnd(nodes.get(nodes.size() - 1));
-	}
-	
-	/**
-	 * Connects way to this way. Other ways internal representation is destroyed!!!
-	 * @param way
-	 */
-	public void connect(ConvertedWay way) {
-		for (int i=0; i<2; i++) {			
-			if (way.nodes.get(0).equals(nodes.get(nodes.size() - 1))) {
-				way.nodes.remove(0);
-				nodes.addAll(way.nodes);
-				return;
-			}
-			
-			if (way.nodes.get(way.nodes.size() - 1).equals(nodes.get(0))) {
-				nodes.remove(0);
-				way.nodes.addAll(nodes);
-				nodes = way.nodes;
-				return;
-			}
-			Collections.reverse(nodes);
-		}
-	}
 
-	public List<Node> getNodes() {
-		return nodes;
-	}
+    public class WayEnd {
+        private Node end;
 
-	public BitSet getRoutes() {
-		return routes;
-	}
+        public WayEnd(Node end) {
+            this.end = end;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (o instanceof WayEnd) {
+                WayEnd otherEnd = (WayEnd)o;
+                return end.equals(otherEnd.end) && routes.equals(otherEnd.getRoutes());
+            } else {
+                return false;
+            }
+        }
+
+        @Override
+        public int hashCode() {
+            return end.hashCode() + routes.hashCode();
+        }
+
+        public BitSet getRoutes() {
+            return routes;
+        }
+
+        public ConvertedWay getWay() {
+            return ConvertedWay.this;
+        }
+    }
+
+    private List<Node> nodes = new ArrayList<Node>();
+    private BitSet routes;
+
+    public ConvertedWay(BitSet routes, Way way) {
+        this.routes = routes;
+        nodes.addAll(way.getNodes());
+    }
+
+    public WayEnd getStart() {
+        return new WayEnd(nodes.get(0));
+    }
+
+    public WayEnd getStop() {
+        return new WayEnd(nodes.get(nodes.size() - 1));
+    }
+
+    /**
+     * Connects way to this way. Other ways internal representation is destroyed!!!
+     * @param way
+     */
+    public void connect(ConvertedWay way) {
+        for (int i=0; i<2; i++) {
+            if (way.nodes.get(0).equals(nodes.get(nodes.size() - 1))) {
+                way.nodes.remove(0);
+                nodes.addAll(way.nodes);
+                return;
+            }
+
+            if (way.nodes.get(way.nodes.size() - 1).equals(nodes.get(0))) {
+                nodes.remove(0);
+                way.nodes.addAll(nodes);
+                nodes = way.nodes;
+                return;
+            }
+            Collections.reverse(nodes);
+        }
+    }
+
+    public List<Node> getNodes() {
+        return nodes;
+    }
+
+    public BitSet getRoutes() {
+        return routes;
+    }
 
 
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/PathBuilder.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/PathBuilder.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/PathBuilder.java	(revision 23189)
@@ -14,60 +14,60 @@
 public class PathBuilder {
 
-	private Map<Way, BitSet> wayRoutes = new HashMap<Way, BitSet>();
-	private Collection<ConvertedWay> convertedWays;
+    private Map<Way, BitSet> wayRoutes = new HashMap<Way, BitSet>();
+    private Collection<ConvertedWay> convertedWays;
 
-	public void addWay(Way way, RouteDefinition route) {
+    public void addWay(Way way, RouteDefinition route) {
 
-		if (way.getNodesCount() >= 2) {
-			BitSet routes = wayRoutes.get(way);
-			if (routes == null) {
-				routes = new BitSet();
-				wayRoutes.put(way, routes);
-			}
-			routes.set(route.getIndex());
-		}
+        if (way.getNodesCount() >= 2) {
+            BitSet routes = wayRoutes.get(way);
+            if (routes == null) {
+                routes = new BitSet();
+                wayRoutes.put(way, routes);
+            }
+            routes.set(route.getIndex());
+        }
 
-	}
+    }
 
-	public Collection<ConvertedWay> getConvertedWays() {
-		if (convertedWays == null) {
-			Map<WayEnd, ConvertedWay> ways = new HashMap<WayEnd, ConvertedWay>();
+    public Collection<ConvertedWay> getConvertedWays() {
+        if (convertedWays == null) {
+            Map<WayEnd, ConvertedWay> ways = new HashMap<WayEnd, ConvertedWay>();
 
-			for (Entry<Way, BitSet> wayEntry:wayRoutes.entrySet()) {
-				ConvertedWay way = new ConvertedWay(wayEntry.getValue(), wayEntry.getKey());
+            for (Entry<Way, BitSet> wayEntry:wayRoutes.entrySet()) {
+                ConvertedWay way = new ConvertedWay(wayEntry.getValue(), wayEntry.getKey());
 
-				ConvertedWay wayBefore = ways.get(way.getStart());
-				ConvertedWay wayAfter = ways.get(way.getStop());
+                ConvertedWay wayBefore = ways.get(way.getStart());
+                ConvertedWay wayAfter = ways.get(way.getStop());
 
-				if (wayBefore != null) {
-					removeWay(ways, wayBefore);
-					way.connect(wayBefore);
-				}
+                if (wayBefore != null) {
+                    removeWay(ways, wayBefore);
+                    way.connect(wayBefore);
+                }
 
-				if (wayAfter != null) {
-					removeWay(ways, wayAfter);
-					way.connect(wayAfter);
-				}
+                if (wayAfter != null) {
+                    removeWay(ways, wayAfter);
+                    way.connect(wayAfter);
+                }
 
-				ways.put(way.getStart(), way);
-				ways.put(way.getStop(), way);
-			}
+                ways.put(way.getStart(), way);
+                ways.put(way.getStop(), way);
+            }
 
-			Set<ConvertedWay> uniqueWays = new HashSet<ConvertedWay>();
-			uniqueWays.addAll(ways.values());
-			convertedWays = uniqueWays;
-		}
-		return convertedWays;
-	}
+            Set<ConvertedWay> uniqueWays = new HashSet<ConvertedWay>();
+            uniqueWays.addAll(ways.values());
+            convertedWays = uniqueWays;
+        }
+        return convertedWays;
+    }
 
-	private void removeWay(Map<WayEnd, ConvertedWay> map, ConvertedWay wayInMap) {
-		map.remove(wayInMap.getStart());
-		map.remove(wayInMap.getStop());
-	}
+    private void removeWay(Map<WayEnd, ConvertedWay> map, ConvertedWay wayInMap) {
+        map.remove(wayInMap.getStart());
+        map.remove(wayInMap.getStop());
+    }
 
-	public void clear() {
-		convertedWays = null;
-		wayRoutes.clear();
-	}
+    public void clear() {
+        convertedWays = null;
+        wayRoutes.clear();
+    }
 
 }
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RelationEditMode.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RelationEditMode.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RelationEditMode.java	(revision 23189)
@@ -21,77 +21,77 @@
 
 public class RelationEditMode extends MapMode {
-	private static final long serialVersionUID = -7767329767438266289L;
+    private static final long serialVersionUID = -7767329767438266289L;
 
-	private Way highlightedWay;
+    private Way highlightedWay;
 
-	public RelationEditMode(MapFrame mapFrame) {
-		super(tr("Edit relation"), "node/autonode", tr("Edit relations"),
-				Shortcut.registerShortcut("mapmode:editRelation", tr("Mode: {0}", tr("Edit relation")), KeyEvent.VK_H, Shortcut.GROUP_EDIT),
-				mapFrame, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-	}
+    public RelationEditMode(MapFrame mapFrame) {
+        super(tr("Edit relation"), "node/autonode", tr("Edit relations"),
+                Shortcut.registerShortcut("mapmode:editRelation", tr("Mode: {0}", tr("Edit relation")), KeyEvent.VK_H, Shortcut.GROUP_EDIT),
+                mapFrame, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+    }
 
-	@Override
-	public void enterMode() {
-		super.enterMode();
-		Main.map.mapView.addMouseListener(this);
-		Main.map.mapView.addMouseMotionListener(this);
-	}
+    @Override
+    public void enterMode() {
+        super.enterMode();
+        Main.map.mapView.addMouseListener(this);
+        Main.map.mapView.addMouseMotionListener(this);
+    }
 
-	@Override
-	public void exitMode() {
-		super.exitMode();
-		Main.map.mapView.removeMouseListener(this);
-		Main.map.mapView.removeMouseMotionListener(this);
-	}
+    @Override
+    public void exitMode() {
+        super.exitMode();
+        Main.map.mapView.removeMouseListener(this);
+        Main.map.mapView.removeMouseMotionListener(this);
+    }
 
-	@Override
-	public void mouseMoved(MouseEvent e) {
-		Way nearestWay = Main.map.mapView.getNearestWay(e.getPoint(), OsmPrimitive.isUsablePredicate);
-		if (nearestWay != highlightedWay) {
-			if (highlightedWay != null) {
-				highlightedWay.setHighlighted(false);
-			}
-			if (nearestWay != null) {
-				nearestWay.setHighlighted(true);
-			}
-			highlightedWay = nearestWay;
-			Main.map.mapView.repaint();
-		}
-	}
+    @Override
+    public void mouseMoved(MouseEvent e) {
+        Way nearestWay = Main.map.mapView.getNearestWay(e.getPoint(), OsmPrimitive.isUsablePredicate);
+        if (nearestWay != highlightedWay) {
+            if (highlightedWay != null) {
+                highlightedWay.setHighlighted(false);
+            }
+            if (nearestWay != null) {
+                nearestWay.setHighlighted(true);
+            }
+            highlightedWay = nearestWay;
+            Main.map.mapView.repaint();
+        }
+    }
 
-	@Override
-	public void mouseClicked(MouseEvent e) {
-		if (Main.main.getCurrentDataSet() == null)
-			return;
+    @Override
+    public void mouseClicked(MouseEvent e) {
+        if (Main.main.getCurrentDataSet() == null)
+            return;
 
-		Way way = Main.map.mapView.getNearestWay(e.getPoint(), OsmPrimitive.isUsablePredicate);
-		Collection<Relation> selectedRelations = Main.main.getCurrentDataSet().getSelectedRelations();
+        Way way = Main.map.mapView.getNearestWay(e.getPoint(), OsmPrimitive.isUsablePredicate);
+        Collection<Relation> selectedRelations = Main.main.getCurrentDataSet().getSelectedRelations();
 
-		if (way != null) {
+        if (way != null) {
 
-			if (selectedRelations.isEmpty()) {
-				JOptionPane.showMessageDialog(Main.parent, tr("No relation is selected"));
-			}
+            if (selectedRelations.isEmpty()) {
+                JOptionPane.showMessageDialog(Main.parent, tr("No relation is selected"));
+            }
 
-			for (OsmPrimitive rel:selectedRelations) {
-				Relation r = (Relation)rel;
-				RelationMember foundMember = null;
-				for (RelationMember member:r.getMembers()) {
-					if (member.getMember() == way) {
-						foundMember = member;
-						break;
-					}
-				}
+            for (OsmPrimitive rel:selectedRelations) {
+                Relation r = (Relation)rel;
+                RelationMember foundMember = null;
+                for (RelationMember member:r.getMembers()) {
+                    if (member.getMember() == way) {
+                        foundMember = member;
+                        break;
+                    }
+                }
 
-				if (foundMember != null) {
-					Main.main.undoRedo.add(new RemoveRelationMemberCommand(r, new RelationMember("", way)));
-				} else {
-					Relation newRelation = new Relation(r);
-					newRelation.addMember(new RelationMember("", way));
-					Main.main.undoRedo.add(new ChangeCommand(r, newRelation));
-				}
-			}
-		}
-	}
+                if (foundMember != null) {
+                    Main.main.undoRedo.add(new RemoveRelationMemberCommand(r, new RelationMember("", way)));
+                } else {
+                    Relation newRelation = new Relation(r);
+                    newRelation.addMember(new RelationMember("", way));
+                    Main.main.undoRedo.add(new ChangeCommand(r, newRelation));
+                }
+            }
+        }
+    }
 
 
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteDefinition.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteDefinition.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteDefinition.java	(revision 23189)
@@ -10,37 +10,37 @@
 public class RouteDefinition {
 
-	private final Color color;
-	private final String matchString;
-	private Match match;
-	private final int index;
+    private final Color color;
+    private final String matchString;
+    private Match match;
+    private final int index;
 
-	public RouteDefinition(int index, Color color, String expression) {
-		this.color = color;
-		this.matchString = expression;
-		this.index = index;
-		try {
-			match = SearchCompiler.compile(expression, false, false);
-		} catch (ParseError e) {
-			match = new SearchCompiler.Never();
-			e.printStackTrace();
-		}
-	}
+    public RouteDefinition(int index, Color color, String expression) {
+        this.color = color;
+        this.matchString = expression;
+        this.index = index;
+        try {
+            match = SearchCompiler.compile(expression, false, false);
+        } catch (ParseError e) {
+            match = new SearchCompiler.Never();
+            e.printStackTrace();
+        }
+    }
 
-	public boolean matches(OsmPrimitive primitive) {
-		return match.match(primitive);
-	}
+    public boolean matches(OsmPrimitive primitive) {
+        return match.match(primitive);
+    }
 
-	public Color getColor() {
-		return color;
-	}
+    public Color getColor() {
+        return color;
+    }
 
-	public int getIndex() {
-		return index;
-	}
+    public int getIndex() {
+        return index;
+    }
 
-	@Override
-	public String toString() {
-		return color.toString() + " " + matchString;
-	}
+    @Override
+    public String toString() {
+        return color.toString() + " " + matchString;
+    }
 
 }
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteLayer.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteLayer.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RouteLayer.java	(revision 23189)
@@ -33,124 +33,124 @@
 public class RouteLayer extends Layer implements DataSetListenerAdapter.Listener {
 
-	private final PathPainter pathPainter;
-	private final PathBuilder pathBuilder = new PathBuilder();
-	private final List<RouteDefinition> routes = new ArrayList<RouteDefinition>();
-	private volatile boolean datasetChanged = true;
+    private final PathPainter pathPainter;
+    private final PathBuilder pathBuilder = new PathBuilder();
+    private final List<RouteDefinition> routes = new ArrayList<RouteDefinition>();
+    private volatile boolean datasetChanged = true;
 
-	public RouteLayer(RoutesXMLLayer xmlLayer) {
-		super(xmlLayer.getName());
+    public RouteLayer(RoutesXMLLayer xmlLayer) {
+        super(xmlLayer.getName());
 
-		int index = 0;
-		for (RoutesXMLRoute route:xmlLayer.getRoute()) {
-			if (route.isEnabled()) {
-				Color color = ColorHelper.html2color(route.getColor());
-				if (color == null) {
-					color = Color.RED;
-					System.err.printf("Routes plugin - unable to convert color (%s)\n", route.getColor());
-				}
-				routes.add(new RouteDefinition(index++, color, route.getPattern()));
-			}
-		}
+        int index = 0;
+        for (RoutesXMLRoute route:xmlLayer.getRoute()) {
+            if (route.isEnabled()) {
+                Color color = ColorHelper.html2color(route.getColor());
+                if (color == null) {
+                    color = Color.RED;
+                    System.err.printf("Routes plugin - unable to convert color (%s)\n", route.getColor());
+                }
+                routes.add(new RouteDefinition(index++, color, route.getPattern()));
+            }
+        }
 
-		if ("wide".equals(Main.pref.get("routes.painter"))) {
-			pathPainter = new WideLinePainter(this);
-		} else {
-			pathPainter = new NarrowLinePainter(this);
-		}
+        if ("wide".equals(Main.pref.get("routes.painter"))) {
+            pathPainter = new WideLinePainter(this);
+        } else {
+            pathPainter = new NarrowLinePainter(this);
+        }
 
-		DatasetEventManager.getInstance().addDatasetListener(new DataSetListenerAdapter(this), FireMode.IMMEDIATELY);
-	}
+        DatasetEventManager.getInstance().addDatasetListener(new DataSetListenerAdapter(this), FireMode.IMMEDIATELY);
+    }
 
-	@Override
-	public Icon getIcon() {
-		return ImageProvider.get("layer", "osmdata_small");
-	}
+    @Override
+    public Icon getIcon() {
+        return ImageProvider.get("layer", "osmdata_small");
+    }
 
-	@Override
-	public Object getInfoComponent() {
-		return null;
-	}
+    @Override
+    public Object getInfoComponent() {
+        return null;
+    }
 
-	@Override
-	public Action[] getMenuEntries() {
-		return new Action[0];
-	}
+    @Override
+    public Action[] getMenuEntries() {
+        return new Action[0];
+    }
 
-	@Override
-	public String getToolTipText() {
-		return "Hiking routes";
-	}
+    @Override
+    public String getToolTipText() {
+        return "Hiking routes";
+    }
 
-	@Override
-	public boolean isMergable(Layer other) {
-		return false;
-	}
+    @Override
+    public boolean isMergable(Layer other) {
+        return false;
+    }
 
-	@Override
-	public void mergeFrom(Layer from) {
-		// Merging is not supported
-	}
+    @Override
+    public void mergeFrom(Layer from) {
+        // Merging is not supported
+    }
 
-	private void addRelation(Relation relation, RouteDefinition route) {
-		for (RelationMember member:relation.getMembers()) {
-			if (member.getMember() instanceof Way) {
-				Way way = (Way)member.getMember();
-				pathBuilder.addWay(way, route);
-			}
-		}
-	}
+    private void addRelation(Relation relation, RouteDefinition route) {
+        for (RelationMember member:relation.getMembers()) {
+            if (member.getMember() instanceof Way) {
+                Way way = (Way)member.getMember();
+                pathBuilder.addWay(way, route);
+            }
+        }
+    }
 
-	@Override
-	public void paint(Graphics2D g, MapView mv, Bounds bounds) {
+    @Override
+    public void paint(Graphics2D g, MapView mv, Bounds bounds) {
 
-		DataSet dataset = Main.main.getCurrentDataSet();
+        DataSet dataset = Main.main.getCurrentDataSet();
 
-		if (dataset == null) {
-			return;
-		}
+        if (dataset == null) {
+            return;
+        }
 
-		if (datasetChanged) {
-			datasetChanged = false;
-			pathBuilder.clear();
+        if (datasetChanged) {
+            datasetChanged = false;
+            pathBuilder.clear();
 
-			for (Relation relation:dataset.getRelations()) {
-				for (RouteDefinition route:routes) {
-					if (route.matches(relation)) {
-						addRelation(relation, route);
-					}
-				}
-			}
+            for (Relation relation:dataset.getRelations()) {
+                for (RouteDefinition route:routes) {
+                    if (route.matches(relation)) {
+                        addRelation(relation, route);
+                    }
+                }
+            }
 
-			for (Way way:dataset.getWays()) {
-				for (RouteDefinition route:routes) {
-					if (route.matches(way)) {
-						pathBuilder.addWay(way, route);
-					}
-				}
-			}
-		}
+            for (Way way:dataset.getWays()) {
+                for (RouteDefinition route:routes) {
+                    if (route.matches(way)) {
+                        pathBuilder.addWay(way, route);
+                    }
+                }
+            }
+        }
 
-		Stroke stroke = g.getStroke();
-		Color color   = g.getColor();
-		for (ConvertedWay way:pathBuilder.getConvertedWays()) {
-			pathPainter.drawWay(way, mv, g);
-		}
-		g.setStroke(stroke);
-		g.setColor(color);
+        Stroke stroke = g.getStroke();
+        Color color   = g.getColor();
+        for (ConvertedWay way:pathBuilder.getConvertedWays()) {
+            pathPainter.drawWay(way, mv, g);
+        }
+        g.setStroke(stroke);
+        g.setColor(color);
 
-	}
+    }
 
-	@Override
-	public void visitBoundingBox(BoundingXYVisitor v) {
+    @Override
+    public void visitBoundingBox(BoundingXYVisitor v) {
 
-	}
+    }
 
-	public List<RouteDefinition> getRoutes() {
-		return routes;
-	}
+    public List<RouteDefinition> getRoutes() {
+        return routes;
+    }
 
-	public void processDatasetEvent(AbstractDatasetChangedEvent event) {
-		datasetChanged = true;
-	}
+    public void processDatasetEvent(AbstractDatasetChangedEvent event) {
+        datasetChanged = true;
+    }
 
 }
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RoutesPlugin.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RoutesPlugin.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/RoutesPlugin.java	(revision 23189)
@@ -26,35 +26,35 @@
 
 public class RoutesPlugin extends Plugin implements LayerChangeListener {
-        
+
     private final List<RouteLayer> routeLayers = new ArrayList<RouteLayer>();
     private boolean isShown;
-    
+
     public RoutesPlugin(PluginInformation info) {
-    	super(info);
-    	MapView.addLayerChangeListener(this);
-        
+        super(info);
+        MapView.addLayerChangeListener(this);
+
         File routesFile = new File(getPluginDir() + File.separator + "routes.xml");
         if (!routesFile.exists()) {
             System.out.println("File with route definitions doesn't exist, using default");
-            
+
             try {
                 routesFile.getParentFile().mkdir();
                 OutputStream outputStream = new FileOutputStream(routesFile);
                 InputStream inputStream = Routes.class.getResourceAsStream("routes.xml");
-                  
-                byte[] b = new byte[512];  
-                int read;  
-                while ((read = inputStream.read(b)) != -1) {  
+
+                byte[] b = new byte[512];
+                int read;
+                while ((read = inputStream.read(b)) != -1) {
                     outputStream.write(b, 0, read);
                 }
-                
-                outputStream.close();               
+
+                outputStream.close();
                 inputStream.close();
-                    
+
             } catch (IOException e) {
                 e.printStackTrace();
             }
         }
-        
+
         try {
             JAXBContext context = JAXBContext.newInstance(
@@ -64,11 +64,11 @@
                 new FileInputStream(getPluginDir() + File.separator + "routes.xml"));
             for (RoutesXMLLayer layer:routes.getLayer()) {
-            	if (layer.isEnabled()) {
-            		routeLayers.add(new RouteLayer(layer));
-            	}
+                if (layer.isEnabled()) {
+                    routeLayers.add(new RouteLayer(layer));
+                }
             }
         } catch (Exception e) {
             e.printStackTrace();
-        } 
+        }
 
         //new RelationEditMode(Main.map);
@@ -77,7 +77,7 @@
 
     public void activeLayerChange(Layer oldLayer, Layer newLayer) {
-        // TODO Auto-generated method stub  
+        // TODO Auto-generated method stub
     }
-    
+
     private void checkLayers() {
         if (Main.map != null && Main.map.mapView != null) {
@@ -91,9 +91,9 @@
                                     Main.main.addLayer(routeLayer);
                                 }
-                            }                           
+                            }
                         });
                     }
                     return;
-                } 
+                }
             }
             if (isShown) {
@@ -104,5 +104,5 @@
                             Main.main.removeLayer(routeLayer);
                         }
-                    }                   
+                    }
                 });
             }
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/AbstractLinePainter.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/AbstractLinePainter.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/AbstractLinePainter.java	(revision 23189)
@@ -17,164 +17,164 @@
 public abstract class AbstractLinePainter implements PathPainter {
 
-	// Following two method copied from http://blog.persistent.info/2004/03/java-lineline-intersections.html
-	protected boolean getLineLineIntersection(Line2D.Double l1,
-			Line2D.Double l2,
-			Point intersection)
-	{
-		double  x1 = l1.getX1(), y1 = l1.getY1(),
-		x2 = l1.getX2(), y2 = l1.getY2(),
-		x3 = l2.getX1(), y3 = l2.getY1(),
-		x4 = l2.getX2(), y4 = l2.getY2();
-		double dx1 = x2 - x1;
-		double dx2 = x4 - x3;
-		double dy1 = y2 - y1;
-		double dy2 = y4 - y3;
+    // Following two method copied from http://blog.persistent.info/2004/03/java-lineline-intersections.html
+    protected boolean getLineLineIntersection(Line2D.Double l1,
+            Line2D.Double l2,
+            Point intersection)
+    {
+        double  x1 = l1.getX1(), y1 = l1.getY1(),
+        x2 = l1.getX2(), y2 = l1.getY2(),
+        x3 = l2.getX1(), y3 = l2.getY1(),
+        x4 = l2.getX2(), y4 = l2.getY2();
+        double dx1 = x2 - x1;
+        double dx2 = x4 - x3;
+        double dy1 = y2 - y1;
+        double dy2 = y4 - y3;
 
-		double ua = (dx2 * (y1 - y3) - dy2 * (x1 - x3)) / (dy2 * dx1 - dx2 * dy1);
+        double ua = (dx2 * (y1 - y3) - dy2 * (x1 - x3)) / (dy2 * dx1 - dx2 * dy1);
 
-		if (Math.abs(dy2 * dx1 - dx2 * dy1) < 0.0001) {
-			intersection.x = (int)l1.x2;
-			intersection.y = (int)l1.y2;
-			return false;
-		} else {
-			intersection.x = (int)(x1 + ua * (x2 - x1));
-			intersection.y = (int)(y1 + ua * (y2 - y1));
-		}
+        if (Math.abs(dy2 * dx1 - dx2 * dy1) < 0.0001) {
+            intersection.x = (int)l1.x2;
+            intersection.y = (int)l1.y2;
+            return false;
+        } else {
+            intersection.x = (int)(x1 + ua * (x2 - x1));
+            intersection.y = (int)(y1 + ua * (y2 - y1));
+        }
 
-		return true;
-	}
+        return true;
+    }
 
-	protected double det(double a, double b, double c, double d)
-	{
-		return a * d - b * c;
-	}
+    protected double det(double a, double b, double c, double d)
+    {
+        return a * d - b * c;
+    }
 
-	protected Point shiftPoint(Point2D p1, Point2D p2, double shift) {
-		double dx = p2.getX() - p1.getX();
-		double dy = p2.getY() - p1.getY();
+    protected Point shiftPoint(Point2D p1, Point2D p2, double shift) {
+        double dx = p2.getX() - p1.getX();
+        double dy = p2.getY() - p1.getY();
 
-		// Perpendicular vector
-		double ndx = -dy;
-		double ndy = dx;
+        // Perpendicular vector
+        double ndx = -dy;
+        double ndy = dx;
 
-		// Normalize
-		double length = Math.sqrt(ndx * ndx + ndy * ndy);
-		ndx = ndx / length;
-		ndy = ndy / length;
+        // Normalize
+        double length = Math.sqrt(ndx * ndx + ndy * ndy);
+        ndx = ndx / length;
+        ndy = ndy / length;
 
-		return new Point((int)(p1.getX() + shift * ndx), (int)(p1.getY() + shift * ndy));
-	}
+        return new Point((int)(p1.getX() + shift * ndx), (int)(p1.getY() + shift * ndy));
+    }
 
-	protected Line2D.Double shiftLine(Point2D p1, Point2D p2, double shift) {
-		double dx = p2.getX() - p1.getX();
-		double dy = p2.getY() - p1.getY();
+    protected Line2D.Double shiftLine(Point2D p1, Point2D p2, double shift) {
+        double dx = p2.getX() - p1.getX();
+        double dy = p2.getY() - p1.getY();
 
-		Point2D point1 = shiftPoint(p1, p2, shift);
-		Point2D point2 = new Point2D.Double(point1.getX() + dx, point1.getY() + dy);
+        Point2D point1 = shiftPoint(p1, p2, shift);
+        Point2D point2 = new Point2D.Double(point1.getX() + dx, point1.getY() + dy);
 
-		return new Line2D.Double(
-				point1, point2);
-	}
+        return new Line2D.Double(
+                point1, point2);
+    }
 
-	protected GeneralPath getPath(Graphics2D g, MapView mapView, List<Node> nodes, double shift) {
+    protected GeneralPath getPath(Graphics2D g, MapView mapView, List<Node> nodes, double shift) {
 
-		GeneralPath path = new GeneralPath();
+        GeneralPath path = new GeneralPath();
 
-		if (nodes.size() < 2) {
-			return path;
-		}
+        if (nodes.size() < 2) {
+            return path;
+        }
 
-		Point p1 = null;
-		Point p2 = null;
-		Point p3 = null;
-		Point lastPoint = null;
+        Point p1 = null;
+        Point p2 = null;
+        Point p3 = null;
+        Point lastPoint = null;
 
-		for (Node n: nodes) {
-			Point p = mapView.getPoint(n);
+        for (Node n: nodes) {
+            Point p = mapView.getPoint(n);
 
-			if (!p.equals(p3)) {
-				p1 = p2;
-				p2 = p3;
-				p3 = p;
-			} else {
-				continue;
-			}
+            if (!p.equals(p3)) {
+                p1 = p2;
+                p2 = p3;
+                p3 = p;
+            } else {
+                continue;
+            }
 
-			p = null;
-			if (p2 != null) {
-				if (p1 == null) {
-					p = shiftPoint(p2, p3, shift);
-				} else {
-					Line2D.Double line1 = shiftLine(p1, p2, shift);
-					Line2D.Double line2 = shiftLine(p2, p3, shift);
+            p = null;
+            if (p2 != null) {
+                if (p1 == null) {
+                    p = shiftPoint(p2, p3, shift);
+                } else {
+                    Line2D.Double line1 = shiftLine(p1, p2, shift);
+                    Line2D.Double line2 = shiftLine(p2, p3, shift);
 
-					/*path.moveTo((float)line1.x1, (float)line1.y1);
-					path.lineTo((float)line1.x2, (float)line1.y2);
-					path.moveTo((float)line2.x1, (float)line2.y1);
-					path.lineTo((float)line2.x2, (float)line2.y2);*/
+                    /*path.moveTo((float)line1.x1, (float)line1.y1);
+                    path.lineTo((float)line1.x2, (float)line1.y2);
+                    path.moveTo((float)line2.x1, (float)line2.y1);
+                    path.lineTo((float)line2.x2, (float)line2.y2);*/
 
-					p = new Point();
-					if (!getLineLineIntersection(line1, line2, p)) {
-						p = null;
-					} else {
-						int dx = p.x - p2.x;
-						int dy = p.y - p2.y;
-						int distance = (int)Math.sqrt(dx * dx + dy * dy);
-						if (distance > 10) {
-							p.x = p2.x + dx / (distance / 10);
-							p.y = p2.y + dy / (distance / 10);
-						}
-					}
-				}
-			}
+                    p = new Point();
+                    if (!getLineLineIntersection(line1, line2, p)) {
+                        p = null;
+                    } else {
+                        int dx = p.x - p2.x;
+                        int dy = p.y - p2.y;
+                        int distance = (int)Math.sqrt(dx * dx + dy * dy);
+                        if (distance > 10) {
+                            p.x = p2.x + dx / (distance / 10);
+                            p.y = p2.y + dy / (distance / 10);
+                        }
+                    }
+                }
+            }
 
-			if (p != null && lastPoint != null) {
-				drawSegment(g, mapView, path, lastPoint, p);
-			}
-			if (p != null) {
-				lastPoint = p;
-			}
-		}
+            if (p != null && lastPoint != null) {
+                drawSegment(g, mapView, path, lastPoint, p);
+            }
+            if (p != null) {
+                lastPoint = p;
+            }
+        }
 
-		if (p2 != null && p3 != null && lastPoint != null) {
-			p3 = shiftPoint(p3, p2, -shift);
-			drawSegment(g, mapView, path, lastPoint, p3);
-		}
+        if (p2 != null && p3 != null && lastPoint != null) {
+            p3 = shiftPoint(p3, p2, -shift);
+            drawSegment(g, mapView, path, lastPoint, p3);
+        }
 
-		return path;
-	}
+        return path;
+    }
 
-	private void drawSegment(Graphics2D g, NavigatableComponent nc, GeneralPath path, Point p1, Point p2) {
-		boolean drawIt = false;
-		if (Main.isOpenjdk) {
-			/**
-			 * Work around openjdk bug. It leads to drawing artefacts when zooming in a lot. (#4289, #4424)
-			 * (It looks like int overflow when clipping.) We do custom clipping.
-			 */
-			Rectangle bounds = g.getClipBounds();
-			bounds.grow(100, 100);                  // avoid arrow heads at the border
-			LineClip clip = new LineClip();
-			drawIt = clip.cohenSutherland(p1.x, p1.y, p2.x, p2.y, bounds.x, bounds.y, bounds.x+bounds.width, bounds.y+bounds.height);
-			if (drawIt) {
-				p1 = clip.getP1();
-				p2 = clip.getP2();
-			}
-		} else {
-			drawIt = isSegmentVisible(nc, p1, p2);
-		}
-		if (drawIt) {
-			/* draw segment line */
-			path.moveTo(p1.x, p1.y);
-			path.lineTo(p2.x, p2.y);
-		}
-	}
+    private void drawSegment(Graphics2D g, NavigatableComponent nc, GeneralPath path, Point p1, Point p2) {
+        boolean drawIt = false;
+        if (Main.isOpenjdk) {
+            /**
+             * Work around openjdk bug. It leads to drawing artefacts when zooming in a lot. (#4289, #4424)
+             * (It looks like int overflow when clipping.) We do custom clipping.
+             */
+            Rectangle bounds = g.getClipBounds();
+            bounds.grow(100, 100);                  // avoid arrow heads at the border
+            LineClip clip = new LineClip();
+            drawIt = clip.cohenSutherland(p1.x, p1.y, p2.x, p2.y, bounds.x, bounds.y, bounds.x+bounds.width, bounds.y+bounds.height);
+            if (drawIt) {
+                p1 = clip.getP1();
+                p2 = clip.getP2();
+            }
+        } else {
+            drawIt = isSegmentVisible(nc, p1, p2);
+        }
+        if (drawIt) {
+            /* draw segment line */
+            path.moveTo(p1.x, p1.y);
+            path.lineTo(p2.x, p2.y);
+        }
+    }
 
-	private boolean isSegmentVisible(NavigatableComponent nc, Point p1, Point p2) {
-		if ((p1.x < 0) && (p2.x < 0)) return false;
-		if ((p1.y < 0) && (p2.y < 0)) return false;
-		if ((p1.x > nc.getWidth()) && (p2.x > nc.getWidth())) return false;
-		if ((p1.y > nc.getHeight()) && (p2.y > nc.getHeight())) return false;
-		return true;
-	}
+    private boolean isSegmentVisible(NavigatableComponent nc, Point p1, Point p2) {
+        if ((p1.x < 0) && (p2.x < 0)) return false;
+        if ((p1.y < 0) && (p2.y < 0)) return false;
+        if ((p1.x > nc.getWidth()) && (p2.x > nc.getWidth())) return false;
+        if ((p1.y > nc.getHeight()) && (p2.y > nc.getHeight())) return false;
+        return true;
+    }
 
 
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/NarrowLinePainter.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/NarrowLinePainter.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/NarrowLinePainter.java	(revision 23189)
@@ -14,41 +14,41 @@
 public class NarrowLinePainter extends AbstractLinePainter {
 
-	private static final float LINE_WIDTH = 5;
-	private final RouteLayer layer;
+    private static final float LINE_WIDTH = 5;
+    private final RouteLayer layer;
 
-	public NarrowLinePainter(RouteLayer layer) {
-		this.layer = layer;
-	}
+    public NarrowLinePainter(RouteLayer layer) {
+        this.layer = layer;
+    }
 
-	public void drawWay(ConvertedWay way, MapView mapView, Graphics2D g) {
-		List<Node> nodes = way.getNodes();
-		BitSet routes = way.getRoutes();
+    public void drawWay(ConvertedWay way, MapView mapView, Graphics2D g) {
+        List<Node> nodes = way.getNodes();
+        BitSet routes = way.getRoutes();
 
-		if (nodes.size() < 2) {
-			return;
-		}
+        if (nodes.size() < 2) {
+            return;
+        }
 
-		//double totalWidth = LINE_WIDTH + (colors.size() - 1) * 4;
-		//double width = totalWidth / colors.size();
-		//double shift = -totalWidth / 2 + width / 2;
-		double width = LINE_WIDTH;
-		double shift = - (LINE_WIDTH * routes.cardinality()) / 2 + width / 2;
+        //double totalWidth = LINE_WIDTH + (colors.size() - 1) * 4;
+        //double width = totalWidth / colors.size();
+        //double shift = -totalWidth / 2 + width / 2;
+        double width = LINE_WIDTH;
+        double shift = - (LINE_WIDTH * routes.cardinality()) / 2 + width / 2;
 
-		for (int k=0; k<routes.length(); k++) {
+        for (int k=0; k<routes.length(); k++) {
 
-			if (!routes.get(k)) {
-				continue;
-			}
+            if (!routes.get(k)) {
+                continue;
+            }
 
-			RouteDefinition route = layer.getRoutes().get(k);
+            RouteDefinition route = layer.getRoutes().get(k);
 
-			g.setColor(route.getColor());
-			g.setStroke(new BasicStroke((float) width));
+            g.setColor(route.getColor());
+            g.setStroke(new BasicStroke((float) width));
 
-			g.draw(getPath(g, mapView, nodes, shift));
+            g.draw(getPath(g, mapView, nodes, shift));
 
-			shift += width + 2;
-		}
-	}
+            shift += width + 2;
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/PathPainter.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/PathPainter.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/PathPainter.java	(revision 23189)
@@ -7,6 +7,6 @@
 
 public interface PathPainter {
-	
-	public void drawWay(ConvertedWay way, MapView mapView, Graphics2D g);
+
+    public void drawWay(ConvertedWay way, MapView mapView, Graphics2D g);
 
 }
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/WideLinePainter.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/WideLinePainter.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/paint/WideLinePainter.java	(revision 23189)
@@ -15,40 +15,40 @@
 public class WideLinePainter extends AbstractLinePainter {
 
-	private static final float LINE_WIDTH = 10;
-	private final RouteLayer layer;
+    private static final float LINE_WIDTH = 10;
+    private final RouteLayer layer;
 
-	public WideLinePainter(RouteLayer layer) {
-		this.layer = layer;
-	}
+    public WideLinePainter(RouteLayer layer) {
+        this.layer = layer;
+    }
 
-	public void drawWay(ConvertedWay way, MapView mapView, Graphics2D g) {
-		List<Node> nodes = way.getNodes();
-		BitSet routes = way.getRoutes();
+    public void drawWay(ConvertedWay way, MapView mapView, Graphics2D g) {
+        List<Node> nodes = way.getNodes();
+        BitSet routes = way.getRoutes();
 
-		if (nodes.size() < 2) {
-			return;
-		}
+        if (nodes.size() < 2) {
+            return;
+        }
 
-		double totalWidth = LINE_WIDTH + (routes.size() - 1) * 4;
-		double width = totalWidth / routes.cardinality();
-		double shift = -totalWidth / 2 + width / 2;
+        double totalWidth = LINE_WIDTH + (routes.size() - 1) * 4;
+        double width = totalWidth / routes.cardinality();
+        double shift = -totalWidth / 2 + width / 2;
 
-		for (int k=0; k<routes.length(); k++) {
+        for (int k=0; k<routes.length(); k++) {
 
-			if (!routes.get(k)) {
-				continue;
-			}
+            if (!routes.get(k)) {
+                continue;
+            }
 
-			RouteDefinition route = layer.getRoutes().get(k);
+            RouteDefinition route = layer.getRoutes().get(k);
 
-			Color color = route.getColor();
-			g.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 100));
-			g.setStroke(new BasicStroke((float) width));
+            Color color = route.getColor();
+            g.setColor(new Color(color.getRed(), color.getGreen(), color.getBlue(), 100));
+            g.setStroke(new BasicStroke((float) width));
 
-			g.draw(getPath(g, mapView, nodes, shift));
+            g.draw(getPath(g, mapView, nodes, shift));
 
-			shift += width;
-		}
-	}
+            shift += width;
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/ObjectFactory.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/ObjectFactory.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/ObjectFactory.java	(revision 23189)
@@ -1,7 +1,7 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2009.07.19 at 03:50:48 odp. CEST 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.19 at 03:50:48 odp. CEST
 //
 
@@ -13,16 +13,16 @@
 
 /**
- * This object contains factory methods for each 
- * Java content interface and Java element interface 
- * generated in the org.openstreetmap.josm.plugins.routes.xml package. 
- * <p>An ObjectFactory allows you to programatically 
- * construct new instances of the Java representation 
- * for XML content. The Java representation of XML 
- * content can consist of schema derived interfaces 
- * and classes representing the binding of schema 
- * type definitions, element declarations and model 
- * groups.  Factory methods for each of these are 
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.openstreetmap.josm.plugins.routes.xml package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups.  Factory methods for each of these are
  * provided in this class.
- * 
+ *
  */
 @XmlRegistry
@@ -32,5 +32,5 @@
     /**
      * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.openstreetmap.josm.plugins.routes.xml
-     * 
+     *
      */
     public ObjectFactory() {
@@ -39,5 +39,5 @@
     /**
      * Create an instance of {@link RoutesXMLRoute }
-     * 
+     *
      */
     public RoutesXMLRoute createRoutesXMLRoute() {
@@ -47,5 +47,5 @@
     /**
      * Create an instance of {@link RoutesXMLLayer }
-     * 
+     *
      */
     public RoutesXMLLayer createRoutesXMLLayer() {
@@ -55,5 +55,5 @@
     /**
      * Create an instance of {@link Routes }
-     * 
+     *
      */
     public Routes createRoutes() {
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/Routes.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/Routes.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/Routes.java	(revision 23189)
@@ -1,7 +1,7 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2009.07.19 at 03:50:48 odp. CEST 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.19 at 03:50:48 odp. CEST
 //
 
@@ -19,7 +19,7 @@
 /**
  * <p>Java class for anonymous complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType>
@@ -33,6 +33,6 @@
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
@@ -47,5 +47,5 @@
     /**
      * Gets the value of the layer property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
@@ -53,5 +53,5 @@
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the layer property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
@@ -59,11 +59,11 @@
      *    getLayer().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link RoutesXMLLayer }
-     * 
-     * 
+     *
+     *
      */
     public List<RoutesXMLLayer> getLayer() {
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/RoutesXMLLayer.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/RoutesXMLLayer.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/RoutesXMLLayer.java	(revision 23189)
@@ -1,7 +1,7 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2009.07.19 at 03:50:48 odp. CEST 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.19 at 03:50:48 odp. CEST
 //
 
@@ -19,7 +19,7 @@
 /**
  * <p>Java class for layer complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="layer">
@@ -35,6 +35,6 @@
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
@@ -52,5 +52,5 @@
     /**
      * Gets the value of the route property.
-     * 
+     *
      * <p>
      * This accessor method returns a reference to the live list,
@@ -58,5 +58,5 @@
      * returned list will be present inside the JAXB object.
      * This is why there is not a <CODE>set</CODE> method for the route property.
-     * 
+     *
      * <p>
      * For example, to add a new item, do as follows:
@@ -64,11 +64,11 @@
      *    getRoute().add(newItem);
      * </pre>
-     * 
-     * 
+     *
+     *
      * <p>
      * Objects of the following type(s) are allowed in the list
      * {@link RoutesXMLRoute }
-     * 
-     * 
+     *
+     *
      */
     public List<RoutesXMLRoute> getRoute() {
@@ -81,9 +81,9 @@
     /**
      * Gets the value of the name property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getName() {
@@ -93,9 +93,9 @@
     /**
      * Sets the value of the name property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setName(String value) {
@@ -105,9 +105,9 @@
     /**
      * Gets the value of the enabled property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link Boolean }
-     *     
+     *
      */
     public boolean isEnabled() {
@@ -121,9 +121,9 @@
     /**
      * Sets the value of the enabled property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link Boolean }
-     *     
+     *
      */
     public void setEnabled(Boolean value) {
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/RoutesXMLRoute.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/RoutesXMLRoute.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/RoutesXMLRoute.java	(revision 23189)
@@ -1,7 +1,7 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2009.07.19 at 03:50:48 odp. CEST 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.19 at 03:50:48 odp. CEST
 //
 
@@ -18,7 +18,7 @@
 /**
  * <p>Java class for route complex type.
- * 
+ *
  * <p>The following schema fragment specifies the expected content contained within this class.
- * 
+ *
  * <pre>
  * &lt;complexType name="route">
@@ -34,6 +34,6 @@
  * &lt;/complexType>
  * </pre>
- * 
- * 
+ *
+ *
  */
 @XmlAccessorType(XmlAccessType.FIELD)
@@ -52,9 +52,9 @@
     /**
      * Gets the value of the pattern property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getPattern() {
@@ -64,9 +64,9 @@
     /**
      * Sets the value of the pattern property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setPattern(String value) {
@@ -76,9 +76,9 @@
     /**
      * Gets the value of the color property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link String }
-     *     
+     *
      */
     public String getColor() {
@@ -88,9 +88,9 @@
     /**
      * Sets the value of the color property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link String }
-     *     
+     *
      */
     public void setColor(String value) {
@@ -100,9 +100,9 @@
     /**
      * Gets the value of the enabled property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link Boolean }
-     *     
+     *
      */
     public boolean isEnabled() {
@@ -116,9 +116,9 @@
     /**
      * Sets the value of the enabled property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link Boolean }
-     *     
+     *
      */
     public void setEnabled(Boolean value) {
Index: /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/package-info.java
===================================================================
--- /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/package-info.java	(revision 23188)
+++ /applications/editors/josm/plugins/routes/src/org/openstreetmap/josm/plugins/routes/xml/package-info.java	(revision 23189)
@@ -1,7 +1,7 @@
 //
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
-// Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2009.07.19 at 03:50:48 odp. CEST 
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
+// Any modifications to this file will be lost upon recompilation of the source schema.
+// Generated on: 2009.07.19 at 03:50:48 odp. CEST
 //
 
Index: /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/EdgeIterator.java
===================================================================
--- /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/EdgeIterator.java	(revision 23188)
+++ /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/EdgeIterator.java	(revision 23189)
@@ -4,5 +4,5 @@
 
     public boolean hasNext();
-    
+
     public RoutingEdge next();
 
Index: /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingEdge.java
===================================================================
--- /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingEdge.java	(revision 23188)
+++ /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingEdge.java	(revision 23189)
@@ -8,5 +8,5 @@
 
       public LatLon toLatLon();
-      
+
       public Object fromV();
 
@@ -14,13 +14,13 @@
 
       public double getLength();
-      
+
       public void setLength(double length);
-      
+
       public double getSpeed();
 
       public void setSpeed(double speed);
-      
+
       public boolean isOneway();
-      
+
       public void setOneway(boolean isOneway);
 
Index: /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraphDelegator.java
===================================================================
--- /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraphDelegator.java	(revision 23188)
+++ /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraphDelegator.java	(revision 23189)
@@ -1,4 +1,4 @@
 /**
- * 
+ *
  */
 package com.innovant.josm.jrt.core;
@@ -23,14 +23,14 @@
      */
     static Logger logger = Logger.getLogger(RoutingGraphDelegator.class);
-    
+
     /**
      *
      */
     private RouteType routeType;
-    
+
     public RoutingGraphDelegator(Graph<Node, OsmEdge> arg0) {
         super(arg0);
     }
-    
+
 
     public RouteType getRouteType() {
@@ -44,5 +44,5 @@
 
     /**
-     * 
+     *
      */
     private static final long serialVersionUID = 1L;
@@ -51,5 +51,5 @@
     public double getEdgeWeight(OsmEdge edge) {
         double weight=Double.MAX_VALUE;
-        
+
         if (routeType==RouteType.SHORTEST) weight=edge.getLength();
         if (routeType==RouteType.FASTEST) weight=edge.getLength() / edge.getSpeed();
Index: /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/osm/OsmEdge.java
===================================================================
--- /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/osm/OsmEdge.java	(revision 23188)
+++ /applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/osm/OsmEdge.java	(revision 23189)
@@ -94,5 +94,5 @@
     return length;
   }
-  
+
   public void setLength(double length) {
     this.length = length;
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/LaunchAction.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/LaunchAction.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/LaunchAction.java	(revision 23189)
@@ -21,38 +21,38 @@
 public class LaunchAction extends JosmAction implements SelectionChangedListener {
 
-	public LaunchAction()  {
-		super(
-				tr("Edit tags"),
-				null, //TODO: set "tag-editor" and add /images/tag-editor.png to distrib
-				tr("Launches the tag editor dialog"),
-				Shortcut.registerShortcut(
-						"edit:launchtageditor",
-						tr("Launches the tag editor dialog"),
-						KeyEvent.VK_T,
-						Shortcut.GROUP_EDIT),
-						true
-		);
+    public LaunchAction()  {
+        super(
+                tr("Edit tags"),
+                null, //TODO: set "tag-editor" and add /images/tag-editor.png to distrib
+                tr("Launches the tag editor dialog"),
+                Shortcut.registerShortcut(
+                        "edit:launchtageditor",
+                        tr("Launches the tag editor dialog"),
+                        KeyEvent.VK_T,
+                        Shortcut.GROUP_EDIT),
+                        true
+        );
 
-		DataSet.selListeners.add(this);
-		setEnabled(false);
-	}
+        DataSet.selListeners.add(this);
+        setEnabled(false);
+    }
 
-	/**
-	 * launch the editor
-	 */
-	protected void launchEditor() {
-		if (!isEnabled())
-			return;
-		TagEditorDialog dialog = TagEditorDialog.getInstance();
-		dialog.startEditSession();
-		dialog.setVisible(true);
-	}
+    /**
+     * launch the editor
+     */
+    protected void launchEditor() {
+        if (!isEnabled())
+            return;
+        TagEditorDialog dialog = TagEditorDialog.getInstance();
+        dialog.startEditSession();
+        dialog.setVisible(true);
+    }
 
-	public void actionPerformed(ActionEvent e) {
-		launchEditor();
-	}
+    public void actionPerformed(ActionEvent e) {
+        launchEditor();
+    }
 
-	public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-		setEnabled(newSelection != null && newSelection.size() >0);
-	}
+    public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
+        setEnabled(newSelection != null && newSelection.size() >0);
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorDialog.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorDialog.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorDialog.java	(revision 23189)
@@ -50,207 +50,207 @@
 @SuppressWarnings("serial")
 public class TagEditorDialog extends JDialog {
-	static private final Logger logger = Logger.getLogger(TagEditorDialog.class.getName());
-
-	/** the unique instance */
-	static private  TagEditorDialog instance = null;
-
-	/**
-	 * Access to the singleton instance
-	 * 
-	 * @return the singleton instance of the dialog
-	 */
-	static public TagEditorDialog getInstance() {
-		if (instance == null) {
-			instance = new TagEditorDialog();
-		}
-		return instance;
-	}
-
-	/** default preferred size */
-	static public final Dimension PREFERRED_SIZE = new Dimension(700, 500);
-
-	/** the properties table */
-	private TagEditor tagEditor = null;
-
-	/**  the auto completion list viewer */
-	private AutoCompletionListViewer aclViewer = null;
-
-	/** the cache of auto completion values used by the tag editor */
-	private AutoCompletionManager autocomplete = null;
-
-	private OKAction okAction = null;
-	private CancelAction cancelAction = null;
-
-	/**
-	 * @return the tag editor model
-	 */
-	public TagEditorModel getModel() {
-		return tagEditor.getModel();
-	}
-
-	protected JPanel buildButtonRow() {
-		JPanel pnl = new JPanel(new FlowLayout(FlowLayout.CENTER));
-		
-		// the ok button
-		//
-		pnl.add(new JButton(okAction = new OKAction()));
-		getModel().addPropertyChangeListener(okAction);
-
-		// the cancel button
-		//
-		pnl.add(new JButton(cancelAction  = new CancelAction()));
-		return pnl;
-	}
-
-	protected JPanel buildTagGridPanel() {
-		// create tag editor and inject an instance of the tag
-		// editor model
-		//
-		tagEditor = new TagEditor();
-		
-		// create the auto completion list viewer and connect it
-		// to the tag editor
-		//
-		AutoCompletionList autoCompletionList = new AutoCompletionList();
-		aclViewer = new AutoCompletionListViewer(autoCompletionList);
-		tagEditor.setAutoCompletionList(autoCompletionList);
-		aclViewer.addAutoCompletionListListener(tagEditor);
-		tagEditor.addComponentNotStoppingCellEditing(aclViewer);
-
-		JPanel pnlTagGrid = new JPanel();
-		pnlTagGrid.setLayout(new BorderLayout());
-		
-		
-		pnlTagGrid.add(tagEditor, BorderLayout.CENTER);
-		pnlTagGrid.add(aclViewer, BorderLayout.EAST);
-		pnlTagGrid.setBorder(BorderFactory.createEmptyBorder(5, 0,0,0));
-		
-		JSplitPane splitPane = new JSplitPane(
-				JSplitPane.HORIZONTAL_SPLIT,
-				tagEditor, 
-				aclViewer
-		);
-		splitPane.setOneTouchExpandable(false);
-		splitPane.setDividerLocation(600);		
-		pnlTagGrid.add(splitPane, BorderLayout.CENTER);
-		return pnlTagGrid;
-	}
-		
-	/**
-	 * build the GUI
-	 */
-	protected void build() {
-		getContentPane().setLayout(new BorderLayout());
-
-		// basic UI prpoperties
-		//
-		setModal(true);
-		setSize(PREFERRED_SIZE);
-		setTitle(tr("JOSM Tag Editor Plugin"));
-		
-		JPanel pnlTagGrid = buildTagGridPanel();
-
-		// create the preset selector
-		//
-		TabularPresetSelector presetSelector = new TabularPresetSelector();
-		presetSelector.addPresetSelectorListener(
-				new IPresetSelectorListener() {
-					public void itemSelected(Item item) {
-						tagEditor.stopEditing();
-						tagEditor.getModel().applyPreset(item);
-						tagEditor.requestFocusInTopLeftCell();
-					}
-				}
-		);
-
-		JPanel pnlPresetSelector = new JPanel();
-		pnlPresetSelector.setLayout(new BorderLayout());
-		pnlPresetSelector.add(presetSelector,BorderLayout.CENTER);
-		pnlPresetSelector.setBorder(BorderFactory.createEmptyBorder(0,0,5,0	));
-
-		// create the tag selector
-		//
-		TabularTagSelector tagSelector = new TabularTagSelector();
-		tagSelector.addTagSelectorListener(
-				new ITagSelectorListener() {
-					public void itemSelected(KeyValuePair pair) {
-						tagEditor.stopEditing();
-						tagEditor.getModel().applyKeyValuePair(pair);
-						tagEditor.requestFocusInTopLeftCell();
-					}
-				}
-		);
-		JPanel pnlTagSelector = new JPanel();
-		pnlTagSelector.setLayout(new BorderLayout());
-		pnlTagSelector.add(tagSelector,BorderLayout.CENTER);
-		pnlTagSelector.setBorder(BorderFactory.createEmptyBorder(0,0,5,0	));
-
-		// create the tabbed pane
-		//
-		JTabbedPane tabbedPane = new JTabbedPane();
-		tabbedPane.add(pnlPresetSelector, tr("Presets"));
-		tabbedPane.add(pnlTagSelector, tr("Tags"));
-
-		
-		// create split pane
-		//
-		JSplitPane splitPane = new JSplitPane(
-				JSplitPane.VERTICAL_SPLIT,
-				tabbedPane, 
-				pnlTagGrid
-		);
-		splitPane.setOneTouchExpandable(true);
-		splitPane.setDividerLocation(200);
-
-		Dimension minimumSize = new Dimension(100, 50);
-		presetSelector.setMinimumSize(minimumSize);
-		pnlTagGrid.setMinimumSize(minimumSize);
-
-		getContentPane().add(splitPane,BorderLayout.CENTER);
-
-		getContentPane().add(buildButtonRow(), BorderLayout.SOUTH);
-
-
-		addWindowListener(
-				new WindowAdapter() {
-					@Override public void windowActivated(WindowEvent e) {
-						SwingUtilities.invokeLater(new Runnable(){
-							public void run()
-							{
-								getModel().ensureOneTag();
-								tagEditor.clearSelection();
-								tagEditor.requestFocusInTopLeftCell();
-							}
-						});
-					}
-				}
-		);
-
-		// makes sure that 'Ctrl-Enter' in the properties table
-		// and in the aclViewer is handled by okAction
-		//
-		getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put((KeyStroke)cancelAction.getValue(Action.ACCELERATOR_KEY), okAction.getValue(AbstractAction.NAME));
-		getRootPane().getActionMap().put(cancelAction.getValue(Action.NAME), cancelAction);
-
-		getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put((KeyStroke)okAction.getValue(Action.ACCELERATOR_KEY), okAction.getValue(AbstractAction.NAME));
-		getRootPane().getActionMap().put(okAction.getValue(Action.NAME), okAction);
-
-
-		// make sure the OK action is also enabled in sub components. I registered
-		// the action in the input and action maps of the dialogs root pane and I expected
-		// it to get triggered regardless of what subcomponent had focus, but it didn't.
-		//
-		aclViewer.installKeyAction(okAction);
-		aclViewer.installKeyAction(cancelAction);
-		presetSelector.installKeyAction(okAction);
-		presetSelector.installKeyAction(cancelAction);
-	}
-
-	/**
-	 * constructor
-	 */
-	protected TagEditorDialog() {
-		build();
-	}
+    static private final Logger logger = Logger.getLogger(TagEditorDialog.class.getName());
+
+    /** the unique instance */
+    static private  TagEditorDialog instance = null;
+
+    /**
+     * Access to the singleton instance
+     * 
+     * @return the singleton instance of the dialog
+     */
+    static public TagEditorDialog getInstance() {
+        if (instance == null) {
+            instance = new TagEditorDialog();
+        }
+        return instance;
+    }
+
+    /** default preferred size */
+    static public final Dimension PREFERRED_SIZE = new Dimension(700, 500);
+
+    /** the properties table */
+    private TagEditor tagEditor = null;
+
+    /**  the auto completion list viewer */
+    private AutoCompletionListViewer aclViewer = null;
+
+    /** the cache of auto completion values used by the tag editor */
+    private AutoCompletionManager autocomplete = null;
+
+    private OKAction okAction = null;
+    private CancelAction cancelAction = null;
+
+    /**
+     * @return the tag editor model
+     */
+    public TagEditorModel getModel() {
+        return tagEditor.getModel();
+    }
+
+    protected JPanel buildButtonRow() {
+        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.CENTER));
+        
+        // the ok button
+        //
+        pnl.add(new JButton(okAction = new OKAction()));
+        getModel().addPropertyChangeListener(okAction);
+
+        // the cancel button
+        //
+        pnl.add(new JButton(cancelAction  = new CancelAction()));
+        return pnl;
+    }
+
+    protected JPanel buildTagGridPanel() {
+        // create tag editor and inject an instance of the tag
+        // editor model
+        //
+        tagEditor = new TagEditor();
+        
+        // create the auto completion list viewer and connect it
+        // to the tag editor
+        //
+        AutoCompletionList autoCompletionList = new AutoCompletionList();
+        aclViewer = new AutoCompletionListViewer(autoCompletionList);
+        tagEditor.setAutoCompletionList(autoCompletionList);
+        aclViewer.addAutoCompletionListListener(tagEditor);
+        tagEditor.addComponentNotStoppingCellEditing(aclViewer);
+
+        JPanel pnlTagGrid = new JPanel();
+        pnlTagGrid.setLayout(new BorderLayout());
+        
+        
+        pnlTagGrid.add(tagEditor, BorderLayout.CENTER);
+        pnlTagGrid.add(aclViewer, BorderLayout.EAST);
+        pnlTagGrid.setBorder(BorderFactory.createEmptyBorder(5, 0,0,0));
+        
+        JSplitPane splitPane = new JSplitPane(
+                JSplitPane.HORIZONTAL_SPLIT,
+                tagEditor, 
+                aclViewer
+        );
+        splitPane.setOneTouchExpandable(false);
+        splitPane.setDividerLocation(600);      
+        pnlTagGrid.add(splitPane, BorderLayout.CENTER);
+        return pnlTagGrid;
+    }
+        
+    /**
+     * build the GUI
+     */
+    protected void build() {
+        getContentPane().setLayout(new BorderLayout());
+
+        // basic UI prpoperties
+        //
+        setModal(true);
+        setSize(PREFERRED_SIZE);
+        setTitle(tr("JOSM Tag Editor Plugin"));
+        
+        JPanel pnlTagGrid = buildTagGridPanel();
+
+        // create the preset selector
+        //
+        TabularPresetSelector presetSelector = new TabularPresetSelector();
+        presetSelector.addPresetSelectorListener(
+                new IPresetSelectorListener() {
+                    public void itemSelected(Item item) {
+                        tagEditor.stopEditing();
+                        tagEditor.getModel().applyPreset(item);
+                        tagEditor.requestFocusInTopLeftCell();
+                    }
+                }
+        );
+
+        JPanel pnlPresetSelector = new JPanel();
+        pnlPresetSelector.setLayout(new BorderLayout());
+        pnlPresetSelector.add(presetSelector,BorderLayout.CENTER);
+        pnlPresetSelector.setBorder(BorderFactory.createEmptyBorder(0,0,5,0 ));
+
+        // create the tag selector
+        //
+        TabularTagSelector tagSelector = new TabularTagSelector();
+        tagSelector.addTagSelectorListener(
+                new ITagSelectorListener() {
+                    public void itemSelected(KeyValuePair pair) {
+                        tagEditor.stopEditing();
+                        tagEditor.getModel().applyKeyValuePair(pair);
+                        tagEditor.requestFocusInTopLeftCell();
+                    }
+                }
+        );
+        JPanel pnlTagSelector = new JPanel();
+        pnlTagSelector.setLayout(new BorderLayout());
+        pnlTagSelector.add(tagSelector,BorderLayout.CENTER);
+        pnlTagSelector.setBorder(BorderFactory.createEmptyBorder(0,0,5,0    ));
+
+        // create the tabbed pane
+        //
+        JTabbedPane tabbedPane = new JTabbedPane();
+        tabbedPane.add(pnlPresetSelector, tr("Presets"));
+        tabbedPane.add(pnlTagSelector, tr("Tags"));
+
+        
+        // create split pane
+        //
+        JSplitPane splitPane = new JSplitPane(
+                JSplitPane.VERTICAL_SPLIT,
+                tabbedPane, 
+                pnlTagGrid
+        );
+        splitPane.setOneTouchExpandable(true);
+        splitPane.setDividerLocation(200);
+
+        Dimension minimumSize = new Dimension(100, 50);
+        presetSelector.setMinimumSize(minimumSize);
+        pnlTagGrid.setMinimumSize(minimumSize);
+
+        getContentPane().add(splitPane,BorderLayout.CENTER);
+
+        getContentPane().add(buildButtonRow(), BorderLayout.SOUTH);
+
+
+        addWindowListener(
+                new WindowAdapter() {
+                    @Override public void windowActivated(WindowEvent e) {
+                        SwingUtilities.invokeLater(new Runnable(){
+                            public void run()
+                            {
+                                getModel().ensureOneTag();
+                                tagEditor.clearSelection();
+                                tagEditor.requestFocusInTopLeftCell();
+                            }
+                        });
+                    }
+                }
+        );
+
+        // makes sure that 'Ctrl-Enter' in the properties table
+        // and in the aclViewer is handled by okAction
+        //
+        getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put((KeyStroke)cancelAction.getValue(Action.ACCELERATOR_KEY), okAction.getValue(AbstractAction.NAME));
+        getRootPane().getActionMap().put(cancelAction.getValue(Action.NAME), cancelAction);
+
+        getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put((KeyStroke)okAction.getValue(Action.ACCELERATOR_KEY), okAction.getValue(AbstractAction.NAME));
+        getRootPane().getActionMap().put(okAction.getValue(Action.NAME), okAction);
+
+
+        // make sure the OK action is also enabled in sub components. I registered
+        // the action in the input and action maps of the dialogs root pane and I expected
+        // it to get triggered regardless of what subcomponent had focus, but it didn't.
+        //
+        aclViewer.installKeyAction(okAction);
+        aclViewer.installKeyAction(cancelAction);
+        presetSelector.installKeyAction(okAction);
+        presetSelector.installKeyAction(cancelAction);
+    }
+
+    /**
+     * constructor
+     */
+    protected TagEditorDialog() {
+        build();
+    }
 
     @Override
@@ -270,60 +270,60 @@
     }
 
-	/**
-	 * start an editing session. This method should be called before the dialog
-	 * is shown on the screen, i.e. before {@link Dialog#setVisible(boolean)} is
-	 * called.
-	 */
-	public void startEditSession() {
-		tagEditor.getModel().clearAppliedPresets();
-		tagEditor.getModel().initFromJOSMSelection();
-		autocomplete = Main.main.getEditLayer().data.getAutoCompletionManager();
-		tagEditor.setAutoCompletionManager(autocomplete);
-		getModel().ensureOneTag();
-	}
-
-	class CancelAction extends AbstractAction {
-		public CancelAction() {
-			putValue(NAME, tr("Cancel"));
-			putValue(SMALL_ICON, ImageProvider.get("cancel"));
-			putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0));
-			putValue(SHORT_DESCRIPTION, tr("Abort tag editing and close dialog"));
-		}
-
-		public void actionPerformed(ActionEvent arg0) {
-			setVisible(false);
-		}
-	}
-
-	class OKAction extends AbstractAction implements PropertyChangeListener {
-
-		public OKAction() {
-			putValue(NAME, tr("OK"));
-			putValue(SMALL_ICON, ImageProvider.get("ok"));
-			putValue(SHORT_DESCRIPTION, tr("Apply edited tags and close dialog"));
-			putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke("ctrl ENTER"));
-		}
-
-		public void actionPerformed(ActionEvent e) {
-			run();
-		}
-
-		public void run() {
-			tagEditor.stopEditing();
-			setVisible(false);
-			tagEditor.getModel().updateJOSMSelection();
-			DataSet ds = Main.main.getCurrentDataSet();
-			ds.fireSelectionChanged();
-			Main.parent.repaint(); // repaint all - drawing could have been changed
-		}
-
-		public void propertyChange(PropertyChangeEvent evt) {
-			if (! evt.getPropertyName().equals(TagEditorModel.PROP_DIRTY))
-				return;
-			if (! evt.getNewValue().getClass().equals(Boolean.class))
-				return;
-			boolean dirty = (Boolean)evt.getNewValue();
-			setEnabled(dirty);
-		}
-	}
+    /**
+     * start an editing session. This method should be called before the dialog
+     * is shown on the screen, i.e. before {@link Dialog#setVisible(boolean)} is
+     * called.
+     */
+    public void startEditSession() {
+        tagEditor.getModel().clearAppliedPresets();
+        tagEditor.getModel().initFromJOSMSelection();
+        autocomplete = Main.main.getEditLayer().data.getAutoCompletionManager();
+        tagEditor.setAutoCompletionManager(autocomplete);
+        getModel().ensureOneTag();
+    }
+
+    class CancelAction extends AbstractAction {
+        public CancelAction() {
+            putValue(NAME, tr("Cancel"));
+            putValue(SMALL_ICON, ImageProvider.get("cancel"));
+            putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0));
+            putValue(SHORT_DESCRIPTION, tr("Abort tag editing and close dialog"));
+        }
+
+        public void actionPerformed(ActionEvent arg0) {
+            setVisible(false);
+        }
+    }
+
+    class OKAction extends AbstractAction implements PropertyChangeListener {
+
+        public OKAction() {
+            putValue(NAME, tr("OK"));
+            putValue(SMALL_ICON, ImageProvider.get("ok"));
+            putValue(SHORT_DESCRIPTION, tr("Apply edited tags and close dialog"));
+            putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke("ctrl ENTER"));
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            run();
+        }
+
+        public void run() {
+            tagEditor.stopEditing();
+            setVisible(false);
+            tagEditor.getModel().updateJOSMSelection();
+            DataSet ds = Main.main.getCurrentDataSet();
+            ds.fireSelectionChanged();
+            Main.parent.repaint(); // repaint all - drawing could have been changed
+        }
+
+        public void propertyChange(PropertyChangeEvent evt) {
+            if (! evt.getPropertyName().equals(TagEditorModel.PROP_DIRTY))
+                return;
+            if (! evt.getNewValue().getClass().equals(Boolean.class))
+                return;
+            boolean dirty = (Boolean)evt.getNewValue();
+            setEnabled(dirty);
+        }
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorPlugin.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorPlugin.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorPlugin.java	(revision 23189)
@@ -7,13 +7,13 @@
 
 public class TagEditorPlugin extends Plugin {
-	LaunchAction action;
-	
-	/**
-	 * constructor 
-	 */
-	public TagEditorPlugin(PluginInformation info) {
-		super(info);
-		action = new LaunchAction();
-		MainMenu.add(Main.main.menu.editMenu, action);
-	}
+    LaunchAction action;
+    
+    /**
+     * constructor 
+     */
+    public TagEditorPlugin(PluginInformation info) {
+        super(info);
+        action = new LaunchAction();
+        MainMenu.add(Main.main.menu.editMenu, action);
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionContext.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionContext.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionContext.java	(revision 23189)
@@ -5,45 +5,45 @@
 public class AutoCompletionContext {
 
-	private boolean selectionIncludesNodes = false;
-	private boolean selectionIncludesWays = false;
-	private boolean selectionIncludesRelations = false;
-	private boolean selectionEmpty = false;
+    private boolean selectionIncludesNodes = false;
+    private boolean selectionIncludesWays = false;
+    private boolean selectionIncludesRelations = false;
+    private boolean selectionEmpty = false;
 
-	public AutoCompletionContext(){
-	}
+    public AutoCompletionContext(){
+    }
 
-	public void initFromJOSMSelection() {
-		selectionIncludesNodes = ! Main.main.getCurrentDataSet().getSelectedNodes().isEmpty();
-		selectionIncludesWays = !Main.main.getCurrentDataSet().getSelectedWays().isEmpty();
-		selectionIncludesRelations = !Main.main.getCurrentDataSet().getSelectedRelations().isEmpty();
-		selectionEmpty = (Main.main.getCurrentDataSet().getSelected().size() == 0);
-	}
+    public void initFromJOSMSelection() {
+        selectionIncludesNodes = ! Main.main.getCurrentDataSet().getSelectedNodes().isEmpty();
+        selectionIncludesWays = !Main.main.getCurrentDataSet().getSelectedWays().isEmpty();
+        selectionIncludesRelations = !Main.main.getCurrentDataSet().getSelectedRelations().isEmpty();
+        selectionEmpty = (Main.main.getCurrentDataSet().getSelected().size() == 0);
+    }
 
-	public boolean isSelectionEmpty() {
-		return selectionEmpty;
-	}
+    public boolean isSelectionEmpty() {
+        return selectionEmpty;
+    }
 
-	public boolean isSelectionIncludesNodes() {
-		return selectionIncludesNodes;
-	}
+    public boolean isSelectionIncludesNodes() {
+        return selectionIncludesNodes;
+    }
 
-	public void setSelectionIncludesNodes(boolean selectionIncludesNodes) {
-		this.selectionIncludesNodes = selectionIncludesNodes;
-	}
+    public void setSelectionIncludesNodes(boolean selectionIncludesNodes) {
+        this.selectionIncludesNodes = selectionIncludesNodes;
+    }
 
-	public boolean isSelectionIncludesWays() {
-		return selectionIncludesWays;
-	}
+    public boolean isSelectionIncludesWays() {
+        return selectionIncludesWays;
+    }
 
-	public void setSelectionIncludesWays(boolean selectionIncludesWays) {
-		this.selectionIncludesWays = selectionIncludesWays;
-	}
+    public void setSelectionIncludesWays(boolean selectionIncludesWays) {
+        this.selectionIncludesWays = selectionIncludesWays;
+    }
 
-	public boolean isSelectionIncludesRelations() {
-		return selectionIncludesRelations;
-	}
+    public boolean isSelectionIncludesRelations() {
+        return selectionIncludesRelations;
+    }
 
-	public void setSelectionIncludesRelations(boolean selectionIncludesRelations) {
-		this.selectionIncludesRelations = selectionIncludesRelations;
-	}
+    public void setSelectionIncludesRelations(boolean selectionIncludesRelations) {
+        this.selectionIncludesRelations = selectionIncludesRelations;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListRenderer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListRenderer.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListRenderer.java	(revision 23189)
@@ -21,108 +21,108 @@
 public class AutoCompletionListRenderer extends JLabel implements TableCellRenderer {
 
-	static public final String RES_OSM_ICON = "/resources/osm.gif";
-	static public final String RES_SELECTION_ICON = "/resources/selection.gif";
+    static public final String RES_OSM_ICON = "/resources/osm.gif";
+    static public final String RES_SELECTION_ICON = "/resources/selection.gif";
 
-	/** the icon used to decorate items of priority
-	 *  {@link AutoCompletionItemPritority#IS_IN_STANDARD}
-	 */
-	private Icon iconStandard;
+    /** the icon used to decorate items of priority
+     *  {@link AutoCompletionItemPritority#IS_IN_STANDARD}
+     */
+    private Icon iconStandard;
 
-	/** the icon used to decorate items of priority
-	 *  {@link AutoCompletionItemPritority#IS_IN_SELECTION}
-	 */
-	private Icon iconSelection;
+    /** the icon used to decorate items of priority
+     *  {@link AutoCompletionItemPritority#IS_IN_SELECTION}
+     */
+    private Icon iconSelection;
 
-	/**
-	 * constructor
-	 */
-	public AutoCompletionListRenderer() {
-		setOpaque(true);
-		loadIcons();
-	}
+    /**
+     * constructor
+     */
+    public AutoCompletionListRenderer() {
+        setOpaque(true);
+        loadIcons();
+    }
 
-	/**
-	 * loads the icons
-	 */
-	protected void loadIcons() {
-		URL imgURL = getClass().getResource(RES_OSM_ICON);
-		if (imgURL != null) {
-			iconStandard = new ImageIcon(imgURL);
-		} else {
-			System.err.println("Could not load icon: " + RES_OSM_ICON);
-			iconStandard = null;
-		}
+    /**
+     * loads the icons
+     */
+    protected void loadIcons() {
+        URL imgURL = getClass().getResource(RES_OSM_ICON);
+        if (imgURL != null) {
+            iconStandard = new ImageIcon(imgURL);
+        } else {
+            System.err.println("Could not load icon: " + RES_OSM_ICON);
+            iconStandard = null;
+        }
 
-		imgURL = getClass().getResource(RES_SELECTION_ICON);
-		if (imgURL != null) {
-			iconSelection = new ImageIcon(imgURL);
-		} else {
-			System.err.println("Could not load icon: " + RES_SELECTION_ICON);
-			iconSelection = null;
-		}
-	}
+        imgURL = getClass().getResource(RES_SELECTION_ICON);
+        if (imgURL != null) {
+            iconSelection = new ImageIcon(imgURL);
+        } else {
+            System.err.println("Could not load icon: " + RES_SELECTION_ICON);
+            iconSelection = null;
+        }
+    }
 
-	/**
-	 * prepares the renderer for rendering a specific icon
-	 * 
-	 * @param item the item to be rendered
-	 */
-	protected void prepareRendererIcon(AutoCompletionListItem item) {
-		if (item.getPriority().equals(AutoCompletionItemPritority.IS_IN_STANDARD)) {
-			if (iconStandard != null) {
-				setIcon(iconStandard);
-			}
-		} else if (item.getPriority().equals(AutoCompletionItemPritority.IS_IN_SELECTION)) {
-			if (iconSelection != null) {
-				setIcon(iconSelection);
-			}
-		}
-	}
+    /**
+     * prepares the renderer for rendering a specific icon
+     * 
+     * @param item the item to be rendered
+     */
+    protected void prepareRendererIcon(AutoCompletionListItem item) {
+        if (item.getPriority().equals(AutoCompletionItemPritority.IS_IN_STANDARD)) {
+            if (iconStandard != null) {
+                setIcon(iconStandard);
+            }
+        } else if (item.getPriority().equals(AutoCompletionItemPritority.IS_IN_SELECTION)) {
+            if (iconSelection != null) {
+                setIcon(iconSelection);
+            }
+        }
+    }
 
-	/**
-	 * resets the renderer
-	 */
-	protected void resetRenderer() {
-		setIcon(null);
-		setText("");
-		setFont(UIManager.getFont("Table.font"));
-		setOpaque(true);
-		setBackground(UIManager.getColor("Table.background"));
-		setForeground(UIManager.getColor("Table.foreground"));
-	}
+    /**
+     * resets the renderer
+     */
+    protected void resetRenderer() {
+        setIcon(null);
+        setText("");
+        setFont(UIManager.getFont("Table.font"));
+        setOpaque(true);
+        setBackground(UIManager.getColor("Table.background"));
+        setForeground(UIManager.getColor("Table.foreground"));
+    }
 
-	/**
-	 * prepares background and text colors for a selected item
-	 */
-	protected void renderSelected() {
-		setBackground(UIManager.getColor("Table.selectionBackground"));
-		setForeground(UIManager.getColor("Table.selectionForeground"));
-	}
+    /**
+     * prepares background and text colors for a selected item
+     */
+    protected void renderSelected() {
+        setBackground(UIManager.getColor("Table.selectionBackground"));
+        setForeground(UIManager.getColor("Table.selectionForeground"));
+    }
 
-	public Component getTableCellRendererComponent(JTable table, Object value,
-			boolean isSelected, boolean hasFocus, int row, int column) {
+    public Component getTableCellRendererComponent(JTable table, Object value,
+            boolean isSelected, boolean hasFocus, int row, int column) {
 
-		resetRenderer();
-		// set icon and text
-		//
-		if (value instanceof AutoCompletionListItem) {
-			AutoCompletionListItem item = (AutoCompletionListItem)value;
-			prepareRendererIcon(item);
-			setText(item.getValue());
-			setToolTipText(item.getValue());
-		} else if (value != null) {
-			setText(value.toString());
-			setToolTipText(value.toString());
-		} else {
-			setText(tr("unknown"));
-			setFont(getFont().deriveFont(Font.ITALIC));
-		}
+        resetRenderer();
+        // set icon and text
+        //
+        if (value instanceof AutoCompletionListItem) {
+            AutoCompletionListItem item = (AutoCompletionListItem)value;
+            prepareRendererIcon(item);
+            setText(item.getValue());
+            setToolTipText(item.getValue());
+        } else if (value != null) {
+            setText(value.toString());
+            setToolTipText(value.toString());
+        } else {
+            setText(tr("unknown"));
+            setFont(getFont().deriveFont(Font.ITALIC));
+        }
 
-		// prepare background and foreground for a selected item
-		//
-		if (isSelected) {
-			renderSelected();
-		}
-		return this;
-	}
+        // prepare background and foreground for a selected item
+        //
+        if (isSelected) {
+            renderSelected();
+        }
+        return this;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListViewer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListViewer.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/AutoCompletionListViewer.java	(revision 23189)
@@ -22,172 +22,172 @@
 
 public class AutoCompletionListViewer extends JPanel {
-	
-	static private Logger logger = Logger.getLogger(AutoCompletionListViewer.class.getName());
+    
+    static private Logger logger = Logger.getLogger(AutoCompletionListViewer.class.getName());
 
-	/** the table showing the auto completion list entries */
-	private JTable table = null;
-	
-	/** the auto completion list to be displayed */
-	private AutoCompletionList autoCompletionList = null;
-	
-	/** the listeners */
-	private ArrayList<IAutoCompletionListListener> listener = null;
-	
-	/**
-	 * creates the GUI 
-	 */
-	protected void createGUI() {
-		setBackground(Color.WHITE);
-		setLayout(new BorderLayout());
-	
-		table = new JTable();
-		
-		// the table model
-		//
-		if (autoCompletionList == null) {
-			//logger.info("setting model to default model");
-			table.setModel(new DefaultTableModel());
-		} else {
-			//logger.info("setting model to " + autoCompletionList);
-			table.setModel(autoCompletionList);
-		}
-		
-		// no table header required 
-		table.setTableHeader(null);
-		
-		// set cell renderer 
-		//
-		table.setDefaultRenderer(Object.class, new AutoCompletionListRenderer());
-		
-		// embed in a scroll pane 
-		JScrollPane p  = new JScrollPane(table);
-		p.setBackground(Color.WHITE);
-		add(p, BorderLayout.CENTER);
-		
-		// only single selection allowed
-		//
-		table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-		
-		// fire item change event on double click
-		//
-		table.addMouseListener(
-				new MouseAdapter() {
-					@Override
-					public void mouseClicked(MouseEvent e) {
-						if (e.getClickCount() == 2) {
-							int row = table.getSelectedRow();
-							String item = autoCompletionList.getFilteredItem(row).getValue();
-							fireAutoCompletionListItemSelected(item);
-						}
-					}					
-				}
-		);
-	}
-	
-	/**
-	 * constructor 
-	 * 
-	 * @param list the auto completion list to be rendered. If null, the list is empty.
-	 *  
-	 */
-	public AutoCompletionListViewer(AutoCompletionList list) {		
-		this.autoCompletionList = list;
-		createGUI();
-		listener = new ArrayList<IAutoCompletionListListener>();
-	}
-	
-	/**
-	 * constructor 
-	 */
-	public AutoCompletionListViewer() {
-		this.autoCompletionList = null;
-		createGUI();
-		listener = new ArrayList<IAutoCompletionListListener>();
-	}
+    /** the table showing the auto completion list entries */
+    private JTable table = null;
+    
+    /** the auto completion list to be displayed */
+    private AutoCompletionList autoCompletionList = null;
+    
+    /** the listeners */
+    private ArrayList<IAutoCompletionListListener> listener = null;
+    
+    /**
+     * creates the GUI 
+     */
+    protected void createGUI() {
+        setBackground(Color.WHITE);
+        setLayout(new BorderLayout());
+    
+        table = new JTable();
+        
+        // the table model
+        //
+        if (autoCompletionList == null) {
+            //logger.info("setting model to default model");
+            table.setModel(new DefaultTableModel());
+        } else {
+            //logger.info("setting model to " + autoCompletionList);
+            table.setModel(autoCompletionList);
+        }
+        
+        // no table header required 
+        table.setTableHeader(null);
+        
+        // set cell renderer 
+        //
+        table.setDefaultRenderer(Object.class, new AutoCompletionListRenderer());
+        
+        // embed in a scroll pane 
+        JScrollPane p  = new JScrollPane(table);
+        p.setBackground(Color.WHITE);
+        add(p, BorderLayout.CENTER);
+        
+        // only single selection allowed
+        //
+        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        
+        // fire item change event on double click
+        //
+        table.addMouseListener(
+                new MouseAdapter() {
+                    @Override
+                    public void mouseClicked(MouseEvent e) {
+                        if (e.getClickCount() == 2) {
+                            int row = table.getSelectedRow();
+                            String item = autoCompletionList.getFilteredItem(row).getValue();
+                            fireAutoCompletionListItemSelected(item);
+                        }
+                    }                   
+                }
+        );
+    }
+    
+    /**
+     * constructor 
+     * 
+     * @param list the auto completion list to be rendered. If null, the list is empty.
+     *  
+     */
+    public AutoCompletionListViewer(AutoCompletionList list) {      
+        this.autoCompletionList = list;
+        createGUI();
+        listener = new ArrayList<IAutoCompletionListListener>();
+    }
+    
+    /**
+     * constructor 
+     */
+    public AutoCompletionListViewer() {
+        this.autoCompletionList = null;
+        createGUI();
+        listener = new ArrayList<IAutoCompletionListListener>();
+    }
 
-	/**
-	 * 
-	 */
-	@Override public Dimension getMaximumSize() {	    
-	    Dimension d = super.getMaximumSize();
-	    d.width = 100;
-	    return d;
+    /**
+     * 
+     */
+    @Override public Dimension getMaximumSize() {       
+        Dimension d = super.getMaximumSize();
+        d.width = 100;
+        return d;
     }
-	
-	/**
-	 * 
-	 */
-	@Override public Dimension getPreferredSize() {	    
-	    Dimension d = super.getMaximumSize();
-	    d.width = 150;
-	    return d;
+    
+    /**
+     * 
+     */
+    @Override public Dimension getPreferredSize() {     
+        Dimension d = super.getMaximumSize();
+        d.width = 150;
+        return d;
     }
 
 
-	/**
-	 * replies the auto completion list this viewer renders
-	 * 
-	 * @return the auto completion list; may be null 
-	 */
-	public AutoCompletionList getAutoCompletionList() {
-    	return autoCompletionList;
+    /**
+     * replies the auto completion list this viewer renders
+     * 
+     * @return the auto completion list; may be null 
+     */
+    public AutoCompletionList getAutoCompletionList() {
+        return autoCompletionList;
     }
 
 
-	/**
-	 * sets the auto completion list this viewer renders 
-	 * 
-	 * @param autoCompletionList  the auto completion list; may be null
-	 */
-	public void setAutoCompletionList(AutoCompletionList autoCompletionList) {
-    	this.autoCompletionList = autoCompletionList;
-    	if (autoCompletionList == null) {
-    		table.setModel(new DefaultTableModel());
-    	} else {
-    		table.setModel(autoCompletionList);
-    	}
+    /**
+     * sets the auto completion list this viewer renders 
+     * 
+     * @param autoCompletionList  the auto completion list; may be null
+     */
+    public void setAutoCompletionList(AutoCompletionList autoCompletionList) {
+        this.autoCompletionList = autoCompletionList;
+        if (autoCompletionList == null) {
+            table.setModel(new DefaultTableModel());
+        } else {
+            table.setModel(autoCompletionList);
+        }
     }
-	
-	/**
-	 * add an {@link IAutoCompletionListListener}
-	 * 
-	 * @param listener  the listener 
-	 */
-	public void addAutoCompletionListListener(IAutoCompletionListListener listener) {
-		if (listener != null && !this.listener.contains(listener)) {
-			synchronized(this.listener) {
-				this.listener.add(listener);
-			}
-		}
-	}
-	
-	/**
-	 * removes a {@link IAutoCompletionListListener} 
-	 * 
-	 * @param listener the listener 
-	 */
-	public void removeAutoCompletionListListener(IAutoCompletionListListener listener) {
-		if (listener != null && this.listener.contains(listener)) {
-			synchronized(this.listener) {
-				this.listener.remove(listener);
-			}
-		}
-	}
-	
-	/**
-	 * notifies listeners about a selected item in the auto completion list  
-	 */
-	protected void fireAutoCompletionListItemSelected(String item) {
-		synchronized(this.listener) {
-			for (IAutoCompletionListListener target: listener) {
-				target.autoCompletionItemSelected(item);
-			}			
-		}
-	}	
-	
-	public void installKeyAction(Action a) {
-		getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put((KeyStroke)a.getValue(AbstractAction.ACCELERATOR_KEY), a.getValue(AbstractAction.NAME));
-		getActionMap().put(a.getValue(AbstractAction.NAME), a);
+    
+    /**
+     * add an {@link IAutoCompletionListListener}
+     * 
+     * @param listener  the listener 
+     */
+    public void addAutoCompletionListListener(IAutoCompletionListListener listener) {
+        if (listener != null && !this.listener.contains(listener)) {
+            synchronized(this.listener) {
+                this.listener.add(listener);
+            }
+        }
+    }
+    
+    /**
+     * removes a {@link IAutoCompletionListListener} 
+     * 
+     * @param listener the listener 
+     */
+    public void removeAutoCompletionListListener(IAutoCompletionListListener listener) {
+        if (listener != null && this.listener.contains(listener)) {
+            synchronized(this.listener) {
+                this.listener.remove(listener);
+            }
+        }
+    }
+    
+    /**
+     * notifies listeners about a selected item in the auto completion list  
+     */
+    protected void fireAutoCompletionListItemSelected(String item) {
+        synchronized(this.listener) {
+            for (IAutoCompletionListListener target: listener) {
+                target.autoCompletionItemSelected(item);
+            }           
+        }
+    }   
+    
+    public void installKeyAction(Action a) {
+        getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put((KeyStroke)a.getValue(AbstractAction.ACCELERATOR_KEY), a.getValue(AbstractAction.NAME));
+        getActionMap().put(a.getValue(AbstractAction.NAME), a);
 
-	}
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/IAutoCompletionListListener.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/IAutoCompletionListListener.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/ac/IAutoCompletionListListener.java	(revision 23189)
@@ -2,4 +2,4 @@
 
 public interface IAutoCompletionListListener {
-	public void autoCompletionItemSelected(String item);
+    public void autoCompletionItemSelected(String item);
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetItemListCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetItemListCellRenderer.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetItemListCellRenderer.java	(revision 23189)
@@ -14,31 +14,31 @@
 
 public class PresetItemListCellRenderer extends JLabel implements ListCellRenderer {
-	private static final Logger logger = Logger.getLogger(PresetItemListCellRenderer.class.getName());
+    private static final Logger logger = Logger.getLogger(PresetItemListCellRenderer.class.getName());
 
-	public Component getListCellRendererComponent(JList list, Object value,
-			int index, boolean isSelected, boolean cellHasFocus) {
+    public Component getListCellRendererComponent(JList list, Object value,
+            int index, boolean isSelected, boolean cellHasFocus) {
 
-		Item item = (Item)value;
-		if (item == null) {
-			setText(tr("(none)"));
-			setIcon(null);
-		} else {
-			if (isSelected) {
-				setBackground(UIManager.getColor("Table.selectionBackground"));
-				setForeground(UIManager.getColor("Table.selectionForeground"));
-			} else {
-				setBackground(UIManager.getColor("Table.background"));
-				setForeground(UIManager.getColor("Table.foreground"));
-			}
-			setIcon(item.getIcon());
-			StringBuilder sb = new StringBuilder();
-			sb.append(item.getParent().getName())
-			.append("/")
-			.append(item.getName());
-			setText(sb.toString());
-			setOpaque(true);
-			setFont(UIManager.getFont("Table.font"));
-		}
-		return this;
-	}
+        Item item = (Item)value;
+        if (item == null) {
+            setText(tr("(none)"));
+            setIcon(null);
+        } else {
+            if (isSelected) {
+                setBackground(UIManager.getColor("Table.selectionBackground"));
+                setForeground(UIManager.getColor("Table.selectionForeground"));
+            } else {
+                setBackground(UIManager.getColor("Table.background"));
+                setForeground(UIManager.getColor("Table.foreground"));
+            }
+            setIcon(item.getIcon());
+            StringBuilder sb = new StringBuilder();
+            sb.append(item.getParent().getName())
+            .append("/")
+            .append(item.getName());
+            setText(sb.toString());
+            setOpaque(true);
+            setFont(UIManager.getFont("Table.font"));
+        }
+        return this;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetManager.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetManager.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/PresetManager.java	(revision 23189)
@@ -19,83 +19,83 @@
 public class PresetManager extends JPanel {
 
-	static private final Logger logger = Logger.getLogger(PresetManager.class.getName());
+    static private final Logger logger = Logger.getLogger(PresetManager.class.getName());
 
-	private JComboBox presets;
-	private JButton btnRemove;
-	private JButton btnHighlight;
-	private TagEditorModel model = null;
+    private JComboBox presets;
+    private JButton btnRemove;
+    private JButton btnHighlight;
+    private TagEditorModel model = null;
 
-	protected void build() {
-		setLayout(new FlowLayout(FlowLayout.LEFT));
+    protected void build() {
+        setLayout(new FlowLayout(FlowLayout.LEFT));
 
-		// create the combobox to display the list of applied presets
-		//
-		presets = new JComboBox() {
-			@Override
-			public Dimension getPreferredSize() {
-				Dimension d = super.getPreferredSize();
-				d.width = 200;
-				return d;
-			}
-		};
+        // create the combobox to display the list of applied presets
+        //
+        presets = new JComboBox() {
+            @Override
+            public Dimension getPreferredSize() {
+                Dimension d = super.getPreferredSize();
+                d.width = 200;
+                return d;
+            }
+        };
 
-		presets.addItemListener(
-				new ItemListener(){
-					public void itemStateChanged(ItemEvent e) {
-						syncWidgetStates();
-					}
-				}
-		);
+        presets.addItemListener(
+                new ItemListener(){
+                    public void itemStateChanged(ItemEvent e) {
+                        syncWidgetStates();
+                    }
+                }
+        );
 
-		presets.setRenderer(new PresetItemListCellRenderer());
-		add(presets);
+        presets.setRenderer(new PresetItemListCellRenderer());
+        add(presets);
 
-		btnHighlight = new JButton(tr("Highlight"));
-		btnHighlight.addActionListener(
-				new ActionListener()  {
-					public void actionPerformed(ActionEvent arg0) {
-						highlightCurrentPreset();
-					}
-				}
-		);
+        btnHighlight = new JButton(tr("Highlight"));
+        btnHighlight.addActionListener(
+                new ActionListener()  {
+                    public void actionPerformed(ActionEvent arg0) {
+                        highlightCurrentPreset();
+                    }
+                }
+        );
 
-		add(btnHighlight);
+        add(btnHighlight);
 
-		btnRemove = new JButton(tr("Remove"));
-		btnRemove.addActionListener(
-				new ActionListener()  {
-					public void actionPerformed(ActionEvent arg0) {
-						removeCurrentPreset();
-					}
-				}
-		);
+        btnRemove = new JButton(tr("Remove"));
+        btnRemove.addActionListener(
+                new ActionListener()  {
+                    public void actionPerformed(ActionEvent arg0) {
+                        removeCurrentPreset();
+                    }
+                }
+        );
 
-		add(btnRemove);
-		syncWidgetStates();
-	}
+        add(btnRemove);
+        syncWidgetStates();
+    }
 
-	protected void syncWidgetStates() {
-		btnRemove.setEnabled(presets.getSelectedItem() != null);
-		btnHighlight.setEnabled(presets.getSelectedItem() != null);
-	}
+    protected void syncWidgetStates() {
+        btnRemove.setEnabled(presets.getSelectedItem() != null);
+        btnHighlight.setEnabled(presets.getSelectedItem() != null);
+    }
 
-	protected void removeCurrentPreset() {
-		Item item= (Item)presets.getSelectedItem();
-		if (item != null && model !=null) {
-			model.removeAppliedPreset(item);
-		}
-	}
+    protected void removeCurrentPreset() {
+        Item item= (Item)presets.getSelectedItem();
+        if (item != null && model !=null) {
+            model.removeAppliedPreset(item);
+        }
+    }
 
-	protected void highlightCurrentPreset() {
-		model.highlightCurrentPreset();
-	}
+    protected void highlightCurrentPreset() {
+        model.highlightCurrentPreset();
+    }
 
-	public PresetManager() {
-		build();
-	}
+    public PresetManager() {
+        build();
+    }
 
-	public void setModel(TagEditorModel model) {
-		presets.setModel(model.getAppliedPresetsModel());
-		this.model = model;
-	}
+    public void setModel(TagEditorModel model) {
+        presets.setModel(model.getAppliedPresetsModel());
+        this.model = model;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TableCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TableCellRenderer.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TableCellRenderer.java	(revision 23189)
@@ -26,141 +26,141 @@
  */
 public class TableCellRenderer extends JLabel implements javax.swing.table.TableCellRenderer  {
-	
-	private static Logger logger = Logger.getLogger(TableCellRenderer.class.getName());
-	public static final Color BG_COLOR_HIGHLIGHTED = new Color(255,255,204);
-		
-	private Font fontStandard = null;
-	private Font fontItalic = null;
-	
-	public TableCellRenderer() {
-		fontStandard = getFont();
-		fontItalic = fontStandard.deriveFont(Font.ITALIC);
-		setOpaque(true);
-		setBorder(new EmptyBorder(5,5,5,5));
-	}
-	
-	/**
-	 * renders the name of a tag in the second column of
-	 * the table
-	 * 
-	 * @param tag  the tag 
-	 */
-	protected void renderTagName(TagModel tag) {
-		setText(tag.getName());
-	}
-	
-	/**
-	 * renders the value of a a tag in the third column of 
-	 * the table
-	 * 
-	 * @param tag  the  tag 
-	 */
-	protected void renderTagValue(TagModel tag) {
-		if (tag.getValueCount() == 0) {
-			setText("");
-		} else if (tag.getValueCount() == 1) {
-			setText(tag.getValues().get(0));
-		} else if (tag.getValueCount() >  1) {
-			setText(tr("multiple"));
-			setFont(fontItalic);
-		}
-	}
-	
-	/**
-	 * resets the renderer 
-	 */
-	protected void resetRenderer() {
-		setText("");
-		setIcon(null);
-		setFont(fontStandard);
-	}
-	
-	protected TagEditorModel getModel(JTable table) {
-		return (TagEditorModel)table.getModel();
-	}
-	
-	protected boolean belongsToSelectedPreset(TagModel tagModel, TagEditorModel model) {
-		
-		// current tag is empty or consists of whitespace only => can't belong to
-		// a selected preset
-		//
-		if (tagModel.getName().trim().equals("") && tagModel.getValue().equals("")) {
-			return false;
-		}
-		
-		// no current preset selected? 
-		//
-		Item item = (Item)model.getAppliedPresetsModel().getSelectedItem();
-		if (item == null) {
-			return false;
-		}
-		
-		for(Tag tag: item.getTags()) {
-			if (tag.getValue() == null) {
-				if (tagModel.getName().equals(tag.getKey())) {
-					return true; 
-				}
-			} else {
-				if (tagModel.getName().equals(tag.getKey())
-					&& tagModel.getValue().equals(tag.getValue())) {
-					return true; 
-				}
-			}
-		}		
-		return false;
-	}
-	
-	/**
-	 * renders the background color. The default color is white. It is
-	 * set to {@see TableCellRenderer#BG_COLOR_HIGHLIGHTED} if this cell
-	 * displays the tag which is suggested by the currently selected 
-	 * preset.
-	 * 
-	 * @param tagModel the tag model 
-	 * @param model the tag editor model 
-	 */
-	protected void renderColor(TagModel tagModel, TagEditorModel model, boolean isSelected) {
-		if (isSelected){
-			setBackground(UIManager.getColor("Table.selectionBackground"));
-			setForeground(UIManager.getColor("Table.selectionForeground"));
-		} else {
-			setBackground(UIManager.getColor("Table.background"));
-			setForeground(UIManager.getColor("Table.foreground"));
-		}		
-		if (belongsToSelectedPreset(tagModel, model)) {
-			setBackground(BG_COLOR_HIGHLIGHTED);
-		}
-	}
-	
-	/**
-	 * replies the cell renderer component for a specific cell 
-	 * 
-	 * @param table  the table
-	 * @param value the value to be rendered
-	 * @param isSelected  true, if the value is selected 
-	 * @param hasFocus true, if the cell has focus 
-	 * @param rowIndex the row index 
-	 * @param vColIndex the column index 
-	 * 
-	 * @return the renderer component 
-	 */
-	public Component getTableCellRendererComponent(JTable table, Object value,
+    
+    private static Logger logger = Logger.getLogger(TableCellRenderer.class.getName());
+    public static final Color BG_COLOR_HIGHLIGHTED = new Color(255,255,204);
+        
+    private Font fontStandard = null;
+    private Font fontItalic = null;
+    
+    public TableCellRenderer() {
+        fontStandard = getFont();
+        fontItalic = fontStandard.deriveFont(Font.ITALIC);
+        setOpaque(true);
+        setBorder(new EmptyBorder(5,5,5,5));
+    }
+    
+    /**
+     * renders the name of a tag in the second column of
+     * the table
+     * 
+     * @param tag  the tag 
+     */
+    protected void renderTagName(TagModel tag) {
+        setText(tag.getName());
+    }
+    
+    /**
+     * renders the value of a a tag in the third column of 
+     * the table
+     * 
+     * @param tag  the  tag 
+     */
+    protected void renderTagValue(TagModel tag) {
+        if (tag.getValueCount() == 0) {
+            setText("");
+        } else if (tag.getValueCount() == 1) {
+            setText(tag.getValues().get(0));
+        } else if (tag.getValueCount() >  1) {
+            setText(tr("multiple"));
+            setFont(fontItalic);
+        }
+    }
+    
+    /**
+     * resets the renderer 
+     */
+    protected void resetRenderer() {
+        setText("");
+        setIcon(null);
+        setFont(fontStandard);
+    }
+    
+    protected TagEditorModel getModel(JTable table) {
+        return (TagEditorModel)table.getModel();
+    }
+    
+    protected boolean belongsToSelectedPreset(TagModel tagModel, TagEditorModel model) {
+        
+        // current tag is empty or consists of whitespace only => can't belong to
+        // a selected preset
+        //
+        if (tagModel.getName().trim().equals("") && tagModel.getValue().equals("")) {
+            return false;
+        }
+        
+        // no current preset selected? 
+        //
+        Item item = (Item)model.getAppliedPresetsModel().getSelectedItem();
+        if (item == null) {
+            return false;
+        }
+        
+        for(Tag tag: item.getTags()) {
+            if (tag.getValue() == null) {
+                if (tagModel.getName().equals(tag.getKey())) {
+                    return true; 
+                }
+            } else {
+                if (tagModel.getName().equals(tag.getKey())
+                    && tagModel.getValue().equals(tag.getValue())) {
+                    return true; 
+                }
+            }
+        }       
+        return false;
+    }
+    
+    /**
+     * renders the background color. The default color is white. It is
+     * set to {@see TableCellRenderer#BG_COLOR_HIGHLIGHTED} if this cell
+     * displays the tag which is suggested by the currently selected 
+     * preset.
+     * 
+     * @param tagModel the tag model 
+     * @param model the tag editor model 
+     */
+    protected void renderColor(TagModel tagModel, TagEditorModel model, boolean isSelected) {
+        if (isSelected){
+            setBackground(UIManager.getColor("Table.selectionBackground"));
+            setForeground(UIManager.getColor("Table.selectionForeground"));
+        } else {
+            setBackground(UIManager.getColor("Table.background"));
+            setForeground(UIManager.getColor("Table.foreground"));
+        }       
+        if (belongsToSelectedPreset(tagModel, model)) {
+            setBackground(BG_COLOR_HIGHLIGHTED);
+        }
+    }
+    
+    /**
+     * replies the cell renderer component for a specific cell 
+     * 
+     * @param table  the table
+     * @param value the value to be rendered
+     * @param isSelected  true, if the value is selected 
+     * @param hasFocus true, if the cell has focus 
+     * @param rowIndex the row index 
+     * @param vColIndex the column index 
+     * 
+     * @return the renderer component 
+     */
+    public Component getTableCellRendererComponent(JTable table, Object value,
             boolean isSelected, boolean hasFocus, int rowIndex, int vColIndex) {
-		
-		resetRenderer();
-		TagModel tagModel  = (TagModel)value;
-		switch(vColIndex) { 
-			case 0: renderTagName(tagModel); break;
-			case 1: renderTagValue(tagModel); break;
-		}
-		renderColor(tagModel, (TagEditorModel)table.getModel(),isSelected);
-		if (hasFocus && isSelected) {
-			if (table.getSelectedColumnCount() == 1 && table.getSelectedRowCount() == 1) {
-				if (table.getEditorComponent() != null) {
-					table.getEditorComponent().requestFocusInWindow();
-				}
-			}
-		}
-		return this;
-	}
+        
+        resetRenderer();
+        TagModel tagModel  = (TagModel)value;
+        switch(vColIndex) { 
+            case 0: renderTagName(tagModel); break;
+            case 1: renderTagValue(tagModel); break;
+        }
+        renderColor(tagModel, (TagEditorModel)table.getModel(),isSelected);
+        if (hasFocus && isSelected) {
+            if (table.getSelectedColumnCount() == 1 && table.getSelectedRowCount() == 1) {
+                if (table.getEditorComponent() != null) {
+                    table.getEditorComponent().requestFocusInWindow();
+                }
+            }
+        }
+        return this;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditor.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditor.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditor.java	(revision 23189)
@@ -56,11 +56,11 @@
 public class TagEditor extends JPanel implements IAutoCompletionListListener {
 
-	private static final Logger logger = Logger.getLogger(TagEditor.class.getName());
-
-	private TagEditorModel tagEditorModel;
-	private TagTable tblTagEditor;
-	private PresetManager presetManager;
-	
-	 /**
+    private static final Logger logger = Logger.getLogger(TagEditor.class.getName());
+
+    private TagEditorModel tagEditorModel;
+    private TagTable tblTagEditor;
+    private PresetManager presetManager;
+    
+     /**
      * builds the panel with the button row
      *
@@ -85,5 +85,5 @@
     
     public void addComponentNotStoppingCellEditing(Component c) {
-    	tblTagEditor.addComponentNotStoppingCellEditing(c);
+        tblTagEditor.addComponentNotStoppingCellEditing(c);
     }
     
@@ -94,20 +94,20 @@
         JPanel pnl = new JPanel(new GridBagLayout());
 
-		DefaultListSelectionModel rowSelectionModel = new DefaultListSelectionModel();
-		DefaultListSelectionModel colSelectionModel = new DefaultListSelectionModel();
-		
-		tagEditorModel = new TagEditorModel(rowSelectionModel,colSelectionModel);
-		
-		// build the scrollable table for editing tag names and tag values
-		//
-		tblTagEditor = new TagTable(tagEditorModel);
-		tblTagEditor.setTagCellEditor(new TagSpecificationAwareTagCellEditor());
-		TableCellRenderer renderer = new TableCellRenderer();
-		tblTagEditor.getColumnModel().getColumn(0).setCellRenderer(renderer);
-		tblTagEditor.getColumnModel().getColumn(1).setCellRenderer(renderer);
-
-		final JScrollPane scrollPane = new JScrollPane(tblTagEditor);
-		JPanel pnlTagTable = new JPanel(new BorderLayout());
-		pnlTagTable.add(scrollPane, BorderLayout.CENTER);
+        DefaultListSelectionModel rowSelectionModel = new DefaultListSelectionModel();
+        DefaultListSelectionModel colSelectionModel = new DefaultListSelectionModel();
+        
+        tagEditorModel = new TagEditorModel(rowSelectionModel,colSelectionModel);
+        
+        // build the scrollable table for editing tag names and tag values
+        //
+        tblTagEditor = new TagTable(tagEditorModel);
+        tblTagEditor.setTagCellEditor(new TagSpecificationAwareTagCellEditor());
+        TableCellRenderer renderer = new TableCellRenderer();
+        tblTagEditor.getColumnModel().getColumn(0).setCellRenderer(renderer);
+        tblTagEditor.getColumnModel().getColumn(1).setCellRenderer(renderer);
+
+        final JScrollPane scrollPane = new JScrollPane(tblTagEditor);
+        JPanel pnlTagTable = new JPanel(new BorderLayout());
+        pnlTagTable.add(scrollPane, BorderLayout.CENTER);
 
         GridBagConstraints gc = new GridBagConstraints();
@@ -133,68 +133,68 @@
     }
     
-	/**
-	 * builds the GUI
-	 * 
-	 */
-	protected void build() {
-		setLayout(new BorderLayout());
-		
-		add(buildTagEditorPanel(), BorderLayout.CENTER);
-
-		// build the preset manager which shows a list of applied presets
-		//
-		presetManager = new PresetManager();
-		presetManager.setModel(tagEditorModel);
-		add(presetManager, BorderLayout.NORTH);
-	}
-
-	/**
-	 * constructor
-	 */
-	public TagEditor() {
-		build();
-	}
-
-	/**
-	 * replies the tag editor model
-	 * @return the tag editor model
-	 */
-	public TagEditorModel getTagEditorModel() {
-		return tagEditorModel;
-	}
-	
-	public void clearSelection() {
-		tblTagEditor.getSelectionModel().clearSelection();
-	}
-
-	public void stopEditing() {
-		TableCellEditor editor = tblTagEditor.getCellEditor();
-		if (editor != null) {
-			editor.stopCellEditing();
-		}
-	}
-	
-	public void setAutoCompletionList(AutoCompletionList autoCompletionList) {
-		tblTagEditor.setAutoCompletionList(autoCompletionList);
-	}
-
-	public void setAutoCompletionManager(AutoCompletionManager autocomplete) {
-		tblTagEditor.setAutoCompletionManager(autocomplete);
-	}
-
-	public void autoCompletionItemSelected(String item) {
-		logger.info("autocompletion item selected ...");
-		TagSpecificationAwareTagCellEditor editor = (TagSpecificationAwareTagCellEditor)tblTagEditor.getCellEditor();
-		if (editor != null) {
-			editor.autoCompletionItemSelected(item);
-		}
-	}
-
-	public void requestFocusInTopLeftCell() {
-		tblTagEditor.requestFocusInCell(0,0);
-	}
-	
-	public TagEditorModel getModel() {
-		return tagEditorModel;
-	}
+    /**
+     * builds the GUI
+     * 
+     */
+    protected void build() {
+        setLayout(new BorderLayout());
+        
+        add(buildTagEditorPanel(), BorderLayout.CENTER);
+
+        // build the preset manager which shows a list of applied presets
+        //
+        presetManager = new PresetManager();
+        presetManager.setModel(tagEditorModel);
+        add(presetManager, BorderLayout.NORTH);
+    }
+
+    /**
+     * constructor
+     */
+    public TagEditor() {
+        build();
+    }
+
+    /**
+     * replies the tag editor model
+     * @return the tag editor model
+     */
+    public TagEditorModel getTagEditorModel() {
+        return tagEditorModel;
+    }
+    
+    public void clearSelection() {
+        tblTagEditor.getSelectionModel().clearSelection();
+    }
+
+    public void stopEditing() {
+        TableCellEditor editor = tblTagEditor.getCellEditor();
+        if (editor != null) {
+            editor.stopCellEditing();
+        }
+    }
+    
+    public void setAutoCompletionList(AutoCompletionList autoCompletionList) {
+        tblTagEditor.setAutoCompletionList(autoCompletionList);
+    }
+
+    public void setAutoCompletionManager(AutoCompletionManager autocomplete) {
+        tblTagEditor.setAutoCompletionManager(autocomplete);
+    }
+
+    public void autoCompletionItemSelected(String item) {
+        logger.info("autocompletion item selected ...");
+        TagSpecificationAwareTagCellEditor editor = (TagSpecificationAwareTagCellEditor)tblTagEditor.getCellEditor();
+        if (editor != null) {
+            editor.autoCompletionItemSelected(item);
+        }
+    }
+
+    public void requestFocusInTopLeftCell() {
+        tblTagEditor.requestFocusInCell(0,0);
+    }
+    
+    public TagEditorModel getModel() {
+        return tagEditorModel;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditorModel.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditorModel.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagEditorModel.java	(revision 23189)
@@ -25,168 +25,168 @@
 @SuppressWarnings("serial")
 public class TagEditorModel extends org.openstreetmap.josm.gui.tagging.TagEditorModel  {
-	static private final Logger logger = Logger.getLogger(TagEditorModel.class.getName());
-	
-	private DefaultComboBoxModel appliedPresets = null;
+    static private final Logger logger = Logger.getLogger(TagEditorModel.class.getName());
+    
+    private DefaultComboBoxModel appliedPresets = null;
 
-	/**
-	 * constructor
-	 */
-	public TagEditorModel(DefaultListSelectionModel rowSelectionModel, DefaultListSelectionModel colSelectionModel){
-		super(rowSelectionModel, colSelectionModel);
-		appliedPresets = new DefaultComboBoxModel();
-	}
+    /**
+     * constructor
+     */
+    public TagEditorModel(DefaultListSelectionModel rowSelectionModel, DefaultListSelectionModel colSelectionModel){
+        super(rowSelectionModel, colSelectionModel);
+        appliedPresets = new DefaultComboBoxModel();
+    }
 
-	/**
-	 * applies the tags defined for a preset item to the tag model.
-	 * 
-	 * Mandatory tags are added to the list of currently edited tags.
-	 * Optional tags are not added.
-	 * The model remembers the currently applied presets.
-	 * 
-	 * @param item  the preset item. Must not be null.
-	 * @exception IllegalArgumentException thrown, if item is null
-	 * 
-	 */
-	public void applyPreset(Item item) {
-		if (item == null)
-			throw new IllegalArgumentException("argument 'item' must not be null");
-		// check whether item is already applied
-		//
-		for(int i=0; i < appliedPresets.getSize(); i++) {
-			if (appliedPresets.getElementAt(i).equals(item))
-				// abort - preset already applied
-				return;
-		}
+    /**
+     * applies the tags defined for a preset item to the tag model.
+     * 
+     * Mandatory tags are added to the list of currently edited tags.
+     * Optional tags are not added.
+     * The model remembers the currently applied presets.
+     * 
+     * @param item  the preset item. Must not be null.
+     * @exception IllegalArgumentException thrown, if item is null
+     * 
+     */
+    public void applyPreset(Item item) {
+        if (item == null)
+            throw new IllegalArgumentException("argument 'item' must not be null");
+        // check whether item is already applied
+        //
+        for(int i=0; i < appliedPresets.getSize(); i++) {
+            if (appliedPresets.getElementAt(i).equals(item))
+                // abort - preset already applied
+                return;
+        }
 
-		// apply the tags proposed by the preset
-		//
-		for(Tag tag : item.getTags()) {
-			if (!tag.isOptional()) {
-				if (!includesTag(tag.getKey())) {
-					TagModel tagModel = new TagModel(tag.getKey(),tag.getValue());
-					prepend(tagModel);
-				} else {
-					TagModel tagModel = get(tag.getKey());
-					// only overwrite an existing value if the preset
-					// proposes a value. I.e. don't overwrite
-					// existing values for tag 'name' with an empty string
-					//
-					if (tag.getValue() != null) {
-						tagModel.setValue(tag.getValue());
-					}
-				}
-			}
-		}
+        // apply the tags proposed by the preset
+        //
+        for(Tag tag : item.getTags()) {
+            if (!tag.isOptional()) {
+                if (!includesTag(tag.getKey())) {
+                    TagModel tagModel = new TagModel(tag.getKey(),tag.getValue());
+                    prepend(tagModel);
+                } else {
+                    TagModel tagModel = get(tag.getKey());
+                    // only overwrite an existing value if the preset
+                    // proposes a value. I.e. don't overwrite
+                    // existing values for tag 'name' with an empty string
+                    //
+                    if (tag.getValue() != null) {
+                        tagModel.setValue(tag.getValue());
+                    }
+                }
+            }
+        }
 
-		// remember the preset and make it the current preset
-		//
-		appliedPresets.addElement(item);
-		appliedPresets.setSelectedItem(item);
-		fireTableDataChanged();
-	}
+        // remember the preset and make it the current preset
+        //
+        appliedPresets.addElement(item);
+        appliedPresets.setSelectedItem(item);
+        fireTableDataChanged();
+    }
 
 
-	/**
-	 * applies a tag given by a {@see KeyValuePair} to the model
-	 * 
-	 * @param pair the key value pair
-	 */
-	public void applyKeyValuePair(KeyValuePair pair) {
-		TagModel tagModel = get(pair.getKey());
-		if (tagModel == null) {
-			tagModel = new TagModel(pair.getKey(), pair.getValue());
-			prepend(tagModel);
-		} else {
-			tagModel.setValue(pair.getValue());
-		}
-		fireTableDataChanged();
-	}
+    /**
+     * applies a tag given by a {@see KeyValuePair} to the model
+     * 
+     * @param pair the key value pair
+     */
+    public void applyKeyValuePair(KeyValuePair pair) {
+        TagModel tagModel = get(pair.getKey());
+        if (tagModel == null) {
+            tagModel = new TagModel(pair.getKey(), pair.getValue());
+            prepend(tagModel);
+        } else {
+            tagModel.setValue(pair.getValue());
+        }
+        fireTableDataChanged();
+    }
 
 
-	public DefaultComboBoxModel getAppliedPresetsModel() {
-		return appliedPresets;
-	}
+    public DefaultComboBoxModel getAppliedPresetsModel() {
+        return appliedPresets;
+    }
 
-	public void removeAppliedPreset(Item item) {
-		if (item == null)
-			return;
-		for (Tag tag: item.getTags()) {
-			if (tag.getValue() != null) {
-				// preset tag with explicit key and explicit value. Remove tag model
-				// from the current model if both the key and the value match
-				//
-				TagModel tagModel = get(tag.getKey());
-				if (tagModel !=null && tag.getValue().equals(tagModel.getValue())) {
-					tags.remove(tagModel);
-					setDirty(true);
-				}
-			} else {
-				// preset tag with required key. No explicit value given. Remove tag
-				// model with the respective key
-				//
-				TagModel tagModel = get(tag.getKey());
-				if (tagModel != null) {
-					tags.remove(tagModel);
-					setDirty(true);
-				}
-			}
-		}
-		appliedPresets.removeElement(item);
-		fireTableDataChanged();
-	}
+    public void removeAppliedPreset(Item item) {
+        if (item == null)
+            return;
+        for (Tag tag: item.getTags()) {
+            if (tag.getValue() != null) {
+                // preset tag with explicit key and explicit value. Remove tag model
+                // from the current model if both the key and the value match
+                //
+                TagModel tagModel = get(tag.getKey());
+                if (tagModel !=null && tag.getValue().equals(tagModel.getValue())) {
+                    tags.remove(tagModel);
+                    setDirty(true);
+                }
+            } else {
+                // preset tag with required key. No explicit value given. Remove tag
+                // model with the respective key
+                //
+                TagModel tagModel = get(tag.getKey());
+                if (tagModel != null) {
+                    tags.remove(tagModel);
+                    setDirty(true);
+                }
+            }
+        }
+        appliedPresets.removeElement(item);
+        fireTableDataChanged();
+    }
 
-	public void clearAppliedPresets() {
-		appliedPresets.removeAllElements();
-		fireTableDataChanged();
-	}
+    public void clearAppliedPresets() {
+        appliedPresets.removeAllElements();
+        fireTableDataChanged();
+    }
 
-	public void highlightCurrentPreset() {
-		fireTableDataChanged();
-	}
-	
-	/**
-	 * updates the tags of the primitives in the current selection with the
-	 * values in the current tag model
-	 * 
-	 */
-	public void updateJOSMSelection() {
-		ArrayList<Command> commands = new ArrayList<Command>();
-		Collection<OsmPrimitive> selection = Main.main.getCurrentDataSet().getSelected();
-		if (selection == null)
-			return;
-		for (TagModel tag : tags) {
-			Command command = createUpdateTagCommand(selection,tag);
-			if (command != null) {
-				commands.add(command);
-			}
-		}
-		Command deleteCommand = createDeleteTagsCommand(selection);
-		if (deleteCommand != null) {
-			commands.add(deleteCommand);
-		}
+    public void highlightCurrentPreset() {
+        fireTableDataChanged();
+    }
+    
+    /**
+     * updates the tags of the primitives in the current selection with the
+     * values in the current tag model
+     * 
+     */
+    public void updateJOSMSelection() {
+        ArrayList<Command> commands = new ArrayList<Command>();
+        Collection<OsmPrimitive> selection = Main.main.getCurrentDataSet().getSelected();
+        if (selection == null)
+            return;
+        for (TagModel tag : tags) {
+            Command command = createUpdateTagCommand(selection,tag);
+            if (command != null) {
+                commands.add(command);
+            }
+        }
+        Command deleteCommand = createDeleteTagsCommand(selection);
+        if (deleteCommand != null) {
+            commands.add(deleteCommand);
+        }
 
-		SequenceCommand command = new SequenceCommand(
-				trn("Updating properties of up to {0} object", "Updating properties of up to {0} objects", selection.size(), selection.size()),
-				commands
-		);
+        SequenceCommand command = new SequenceCommand(
+                trn("Updating properties of up to {0} object", "Updating properties of up to {0} objects", selection.size(), selection.size()),
+                commands
+        );
 
-		// executes the commands and adds them to the undo/redo chains
-		Main.main.undoRedo.add(command);
-	}
-	
-	/**
-	 * initializes the model with the tags in the current JOSM selection
-	 */
-	public void initFromJOSMSelection() {
-		Collection<OsmPrimitive> selection = Main.main.getCurrentDataSet().getSelected();
-		clear();
-		for (OsmPrimitive element : selection) {
-			for (String key : element.keySet()) {
-				String value = element.get(key);
-				add(key,value);
-			}
-		}
-		sort();
-		setDirty(false);
-	}
+        // executes the commands and adds them to the undo/redo chains
+        Main.main.undoRedo.add(command);
+    }
+    
+    /**
+     * initializes the model with the tags in the current JOSM selection
+     */
+    public void initFromJOSMSelection() {
+        Collection<OsmPrimitive> selection = Main.main.getCurrentDataSet().getSelected();
+        clear();
+        for (OsmPrimitive element : selection) {
+            for (String key : element.keySet()) {
+                String value = element.get(key);
+                add(key,value);
+            }
+        }
+        sort();
+        setDirty(false);
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagSpecificationAwareTagCellEditor.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagSpecificationAwareTagCellEditor.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/editor/TagSpecificationAwareTagCellEditor.java	(revision 23189)
@@ -12,90 +12,90 @@
 
 public class TagSpecificationAwareTagCellEditor extends TagCellEditor {
-	private static final Logger logger = Logger.getLogger(TagCellEditor.class.getName());
+    private static final Logger logger = Logger.getLogger(TagCellEditor.class.getName());
 
-	/**
-	 * initializes  the auto completion list when the table cell editor starts
-	 * to edit the key of a tag. In this case the auto completion list is
-	 * initialized with the set of standard key values and the set of current key
-	 * values from the the current JOSM data set. Keys already present in the
-	 * current tag model are removed from the auto completion list.
-	 * 
-	 * @param model  the tag editor model
-	 * @param currentTag  the current tag
-	 */
-	protected void initAutoCompletionListForKeys(TagEditorModel model, TagModel currentTag) {		
-		if (getAutoCompletionList() == null) {
-			logger.warning("autoCompletionList is null. Make sure an instance of AutoCompletionList is injected into TableCellEditor.");
-			return;
-		}
+    /**
+     * initializes  the auto completion list when the table cell editor starts
+     * to edit the key of a tag. In this case the auto completion list is
+     * initialized with the set of standard key values and the set of current key
+     * values from the the current JOSM data set. Keys already present in the
+     * current tag model are removed from the auto completion list.
+     * 
+     * @param model  the tag editor model
+     * @param currentTag  the current tag
+     */
+    protected void initAutoCompletionListForKeys(TagEditorModel model, TagModel currentTag) {       
+        if (getAutoCompletionList() == null) {
+            logger.warning("autoCompletionList is null. Make sure an instance of AutoCompletionList is injected into TableCellEditor.");
+            return;
+        }
 
-		autoCompletionList.clear();
+        autoCompletionList.clear();
 
-		// add the list of standard keys
-		//
-		try {
-			//autoCompletionList.add(TagSpecifications.getInstance().getKeysForAutoCompletion(context));
-		} catch(Exception e) {
-			logger.log(Level.WARNING, "failed to initialize auto completion list with standard keys.", e);
-		}
+        // add the list of standard keys
+        //
+        try {
+            //autoCompletionList.add(TagSpecifications.getInstance().getKeysForAutoCompletion(context));
+        } catch(Exception e) {
+            logger.log(Level.WARNING, "failed to initialize auto completion list with standard keys.", e);
+        }
 
-		// add the list of keys in the current data set
-		//
-		autocomplete.populateWithKeys(autoCompletionList);
-		AutoCompletionContext context = new AutoCompletionContext();
-		try {
-			context.initFromJOSMSelection();
-			autoCompletionList.add(TagSpecifications.getInstance().getKeysForAutoCompletion(context));
-		} catch(Exception e) {
-			System.out.println("Warning: failed to initialize auto completion list with tag specification keys. Exception was: " + e.toString());
-			e.printStackTrace();
-		}
+        // add the list of keys in the current data set
+        //
+        autocomplete.populateWithKeys(autoCompletionList);
+        AutoCompletionContext context = new AutoCompletionContext();
+        try {
+            context.initFromJOSMSelection();
+            autoCompletionList.add(TagSpecifications.getInstance().getKeysForAutoCompletion(context));
+        } catch(Exception e) {
+            System.out.println("Warning: failed to initialize auto completion list with tag specification keys. Exception was: " + e.toString());
+            e.printStackTrace();
+        }
 
-		// remove the keys already present in the current tag model
-		//
-		for (String key : model.getKeys()) {
-			if (! key.equals(currentTag.getName())) {
-				autoCompletionList.remove(key);
-			}
-		}
-		autoCompletionList.fireTableDataChanged();
-	}
+        // remove the keys already present in the current tag model
+        //
+        for (String key : model.getKeys()) {
+            if (! key.equals(currentTag.getName())) {
+                autoCompletionList.remove(key);
+            }
+        }
+        autoCompletionList.fireTableDataChanged();
+    }
 
-	/**
-	 * initializes the auto completion list when the cell editor starts to edit
-	 * a tag value. In this case the auto completion list is initialized with the
-	 * set of standard values for a given key and the set of values present in the
-	 * current data set for the given key.
-	 * 
-	 * @param forKey the key
-	 */
-	protected void initAutoCompletionListForValues(String forKey) {
+    /**
+     * initializes the auto completion list when the cell editor starts to edit
+     * a tag value. In this case the auto completion list is initialized with the
+     * set of standard values for a given key and the set of values present in the
+     * current data set for the given key.
+     * 
+     * @param forKey the key
+     */
+    protected void initAutoCompletionListForValues(String forKey) {
 
-		if (autoCompletionList == null) {
-			logger.warning("autoCompletionList is null. Make sure an instance of AutoCompletionList is injected into TableCellEditor.");
-			return;
-		}
-		autoCompletionList.clear();
-		autocomplete.populateWithTagValues(autoCompletionList, forKey);
-		
-		AutoCompletionContext context = new AutoCompletionContext();
-		try {
-			context.initFromJOSMSelection();
-			autoCompletionList.add(TagSpecifications.getInstance().getLabelsForAutoCompletion(forKey, context));
-		} catch(Exception e) {
-			System.out.println("Warning: failed to initialize auto completion list with tag specification values. Exception was: " + e.toString());
-			e.printStackTrace();
-		}
+        if (autoCompletionList == null) {
+            logger.warning("autoCompletionList is null. Make sure an instance of AutoCompletionList is injected into TableCellEditor.");
+            return;
+        }
+        autoCompletionList.clear();
+        autocomplete.populateWithTagValues(autoCompletionList, forKey);
+        
+        AutoCompletionContext context = new AutoCompletionContext();
+        try {
+            context.initFromJOSMSelection();
+            autoCompletionList.add(TagSpecifications.getInstance().getLabelsForAutoCompletion(forKey, context));
+        } catch(Exception e) {
+            System.out.println("Warning: failed to initialize auto completion list with tag specification values. Exception was: " + e.toString());
+            e.printStackTrace();
+        }
 
-		//  add the list of possible values for a key from the current selection
-		//
-		if (currentTag.getValueCount() > 1) {
-			for (String value : currentTag.getValues()) {
-				//logger.info("adding ac item " + value + " with priority IN_SELECTION");;
-				autoCompletionList.add(
-						new AutoCompletionListItem(value, AutoCompletionItemPritority.IS_IN_SELECTION)
-				);
-			}
-		}
-	}
+        //  add the list of possible values for a key from the current selection
+        //
+        if (currentTag.getValueCount() > 1) {
+            for (String value : currentTag.getValues()) {
+                //logger.info("adding ac item " + value + " with priority IN_SELECTION");;
+                autoCompletionList.add(
+                        new AutoCompletionListItem(value, AutoCompletionItemPritority.IS_IN_SELECTION)
+                );
+            }
+        }
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/AbstractNameIconProvider.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/AbstractNameIconProvider.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/AbstractNameIconProvider.java	(revision 23189)
@@ -12,35 +12,35 @@
 
 public abstract class AbstractNameIconProvider implements INameIconProvider {
-	
-	protected String name;
-	protected String iconName;
-	protected ImageIcon icon;
-	protected File zipIconArchive;
-	
-	public String getName() {
-		return name;
-	}
+    
+    protected String name;
+    protected String iconName;
+    protected ImageIcon icon;
+    protected File zipIconArchive;
+    
+    public String getName() {
+        return name;
+    }
 
-	public void setName(String name) {
-		this.name = name;
-	}
+    public void setName(String name) {
+        this.name = name;
+    }
 
-	public String getIconName() {
-		return iconName;
-	}
+    public String getIconName() {
+        return iconName;
+    }
 
-	public void setIconName(String iconName, File zipIconArchive) {
-		this.iconName = iconName;
-	}
-	
-	public Icon getIcon() {
-		if (icon == null) {
-			Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
-	        icon = ImageProvider.getIfAvailable(s, "presets", null, getIconName(), zipIconArchive);
-	        if (icon == null) return null;
-	        Image i = icon.getImage().getScaledInstance(16, 16, Image.SCALE_DEFAULT);
-			icon = new ImageIcon(i);
-		}
-		return icon;
-	}
+    public void setIconName(String iconName, File zipIconArchive) {
+        this.iconName = iconName;
+    }
+    
+    public Icon getIcon() {
+        if (icon == null) {
+            Collection<String> s = Main.pref.getCollection("taggingpreset.icon.sources", null);
+            icon = ImageProvider.getIfAvailable(s, "presets", null, getIconName(), zipIconArchive);
+            if (icon == null) return null;
+            Image i = icon.getImage().getScaledInstance(16, 16, Image.SCALE_DEFAULT);
+            icon = new ImageIcon(i);
+        }
+        return icon;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Group.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Group.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Group.java	(revision 23189)
@@ -10,29 +10,29 @@
  */
 public class Group extends AbstractNameIconProvider {
-	
-	static final private Logger logger = Logger.getLogger(Group.class.getName());
-	
-	private List<Item> items = null;
-	
-	public Group() {
-		items = new ArrayList<Item>();
-	}
-	
-	public Group(String name) {
-		this();
-		setName(name);
-	}
-	
-	public void addItem(Item item) {
-		item.setParent(this);
-		items.add(item);
-	}
-	
-	public void removeItem(Item item) {
-		items.remove(item);
-	}
-	
-	public List<Item> getItems() {
-		return items; 
-	}
+    
+    static final private Logger logger = Logger.getLogger(Group.class.getName());
+    
+    private List<Item> items = null;
+    
+    public Group() {
+        items = new ArrayList<Item>();
+    }
+    
+    public Group(String name) {
+        this();
+        setName(name);
+    }
+    
+    public void addItem(Item item) {
+        item.setParent(this);
+        items.add(item);
+    }
+    
+    public void removeItem(Item item) {
+        items.remove(item);
+    }
+    
+    public List<Item> getItems() {
+        return items; 
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/INameIconProvider.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/INameIconProvider.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/INameIconProvider.java	(revision 23189)
@@ -4,5 +4,5 @@
 
 public interface INameIconProvider {
-	public String getName();
-	public Icon  getIcon();
+    public String getName();
+    public Icon  getIcon();
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Item.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Item.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Item.java	(revision 23189)
@@ -7,53 +7,53 @@
 public class Item  extends AbstractNameIconProvider {
 
-	private final static Logger logger = Logger.getLogger(Item.class.getName());
+    private final static Logger logger = Logger.getLogger(Item.class.getName());
 
-	private String label;
-	private List<Tag> tags;
-	private Group parent;
+    private String label;
+    private List<Tag> tags;
+    private Group parent;
 
-	public Item() {
-		tags = new ArrayList<Tag>();
-	}
+    public Item() {
+        tags = new ArrayList<Tag>();
+    }
 
-	public Group getParent() {
-		return parent;
-	}
+    public Group getParent() {
+        return parent;
+    }
 
-	public void setParent(Group parent) {
-		this.parent = parent;
-	}
+    public void setParent(Group parent) {
+        this.parent = parent;
+    }
 
-	public String getLabel() {
-		return label;
-	}
+    public String getLabel() {
+        return label;
+    }
 
-	public void setLabel(String label) {
-		this.label = label;
-	}
+    public void setLabel(String label) {
+        this.label = label;
+    }
 
-	public Item(String name) {
-		setName(name);
-	}
+    public Item(String name) {
+        setName(name);
+    }
 
-	public void addTag(Tag tag) {
-		tags.add(tag);
-	}
+    public void addTag(Tag tag) {
+        tags.add(tag);
+    }
 
-	public List<Tag> getTags() {
-		return tags;
-	}
+    public List<Tag> getTags() {
+        return tags;
+    }
 
-	@Override
-	public String toString() {
-		StringBuilder builder  = new StringBuilder();
-		builder.append("[")
-		.append(getClass().getName())
-		.append(":")
-		.append("name=")
-		.append(name)
-		.append("]");
+    @Override
+    public String toString() {
+        StringBuilder builder  = new StringBuilder();
+        builder.append("[")
+        .append(getClass().getName())
+        .append(":")
+        .append("name=")
+        .append(name)
+        .append("]");
 
-		return builder.toString();
-	}
+        return builder.toString();
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Presets.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Presets.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Presets.java	(revision 23189)
@@ -25,103 +25,103 @@
 
 public class Presets {
-	private static Logger logger = Logger.getLogger(Presets.class.getName());
+    private static Logger logger = Logger.getLogger(Presets.class.getName());
 
-	private static Presets presets = null;
+    private static Presets presets = null;
 
-	static public void initPresets() {
+    static public void initPresets() {
 
-		presets = new Presets();
-		LinkedList<String> sources = new LinkedList<String>();
+        presets = new Presets();
+        LinkedList<String> sources = new LinkedList<String>();
 
-		// code copied from org.openstreetmap.josm.gui.tagging.TaggingPreset
-		// and slightly modified
-		//
-		if (Main.pref.getBoolean("taggingpreset.enable-defaults", true)) {
-			sources.add("resource://data/defaultpresets.xml");
-		}
-		sources.addAll(Main.pref.getCollection("taggingpreset.sources",
-				new LinkedList<String>()));
+        // code copied from org.openstreetmap.josm.gui.tagging.TaggingPreset
+        // and slightly modified
+        //
+        if (Main.pref.getBoolean("taggingpreset.enable-defaults", true)) {
+            sources.add("resource://data/defaultpresets.xml");
+        }
+        sources.addAll(Main.pref.getCollection("taggingpreset.sources",
+                new LinkedList<String>()));
 
-		File zipIconArchive = null;
-		for (String source : sources) {
-			try {
-				MirroredInputStream s = new MirroredInputStream(source);
+        File zipIconArchive = null;
+        for (String source : sources) {
+            try {
+                MirroredInputStream s = new MirroredInputStream(source);
                 InputStream zip = s.getZipEntry("xml","preset");
                 if(zip != null) {
-                	zipIconArchive = s.getFile();
+                    zipIconArchive = s.getFile();
                 }
-				InputStreamReader r;
-				try {
-					r = new InputStreamReader(s, "UTF-8");
-				} catch (UnsupportedEncodingException e) {
-					r = new InputStreamReader(s);
-				}
-				presets = loadPresets(r, presets, zipIconArchive);
-			} catch (PresetIOException e) {
-				logger
-						.log(Level.SEVERE, tr(
-								"Could not read tagging preset source: {0}",
-								source), e);
-				JOptionPane.showMessageDialog(Main.parent, tr(
-						"Could not read tagging preset source: {0}", source),
-						tr("Error"), JOptionPane.ERROR_MESSAGE);
-			} catch (IOException e) {
-				e.printStackTrace();
-				JOptionPane.showMessageDialog(Main.parent, tr(
-						"Could not read tagging preset source: {0}", source),
-						tr("Error"), JOptionPane.ERROR_MESSAGE);
-			}
-		}
-	}
+                InputStreamReader r;
+                try {
+                    r = new InputStreamReader(s, "UTF-8");
+                } catch (UnsupportedEncodingException e) {
+                    r = new InputStreamReader(s);
+                }
+                presets = loadPresets(r, presets, zipIconArchive);
+            } catch (PresetIOException e) {
+                logger
+                        .log(Level.SEVERE, tr(
+                                "Could not read tagging preset source: {0}",
+                                source), e);
+                JOptionPane.showMessageDialog(Main.parent, tr(
+                        "Could not read tagging preset source: {0}", source),
+                        tr("Error"), JOptionPane.ERROR_MESSAGE);
+            } catch (IOException e) {
+                e.printStackTrace();
+                JOptionPane.showMessageDialog(Main.parent, tr(
+                        "Could not read tagging preset source: {0}", source),
+                        tr("Error"), JOptionPane.ERROR_MESSAGE);
+            }
+        }
+    }
 
-	static public Presets loadPresets(URL from) throws PresetIOException {
-		try {
-			URLConnection con = from.openConnection();
-			con.connect();
-			Reader reader = new InputStreamReader(con.getInputStream());
-			return loadPresets(reader, null, null);
-		} catch (Exception e) {
-			logger.log(Level.SEVERE,
-					"exception caught while loading preset file", e);
-			throw new PresetIOException(e);
-		}
-	}
+    static public Presets loadPresets(URL from) throws PresetIOException {
+        try {
+            URLConnection con = from.openConnection();
+            con.connect();
+            Reader reader = new InputStreamReader(con.getInputStream());
+            return loadPresets(reader, null, null);
+        } catch (Exception e) {
+            logger.log(Level.SEVERE,
+                    "exception caught while loading preset file", e);
+            throw new PresetIOException(e);
+        }
+    }
 
-	static public Presets loadPresets(Reader reader, Presets p, File zipIconArchive) throws PresetIOException {
-		try {
-			Parser parser = new Parser();
-			parser.setReader(reader);
-			parser.setPresets(p);
-			parser.parse();
-			return parser.getPresets();
-		} catch (Exception e) {
-			logger.log(Level.SEVERE, "exception caught while loading presets",e);
-			throw new PresetIOException(e);
-		}
-	}
+    static public Presets loadPresets(Reader reader, Presets p, File zipIconArchive) throws PresetIOException {
+        try {
+            Parser parser = new Parser();
+            parser.setReader(reader);
+            parser.setPresets(p);
+            parser.parse();
+            return parser.getPresets();
+        } catch (Exception e) {
+            logger.log(Level.SEVERE, "exception caught while loading presets",e);
+            throw new PresetIOException(e);
+        }
+    }
 
-	static public Presets getPresets() {
-		if (presets == null) {
-			initPresets();
-		}
-		return presets;
-	}
+    static public Presets getPresets() {
+        if (presets == null) {
+            initPresets();
+        }
+        return presets;
+    }
 
-	private List<Group> groups;
+    private List<Group> groups;
 
-	public Presets() {
-		groups = new ArrayList<Group>();
-	}
+    public Presets() {
+        groups = new ArrayList<Group>();
+    }
 
-	public void addGroup(Group group) {
-		groups.add(group);
-	}
+    public void addGroup(Group group) {
+        groups.add(group);
+    }
 
-	public void removeGroup(Group group) {
-		groups.remove(group);
-	}
+    public void removeGroup(Group group) {
+        groups.remove(group);
+    }
 
-	public List<Group> getGroups() {
-		return groups;
-	}
+    public List<Group> getGroups() {
+        return groups;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Tag.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Tag.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/Tag.java	(revision 23189)
@@ -2,42 +2,42 @@
 
 public class Tag {
-	private String key;
-	private String value;
-	private String displayName;
-	private boolean optional = false;
-	
-	public Tag() {		
-	}
+    private String key;
+    private String value;
+    private String displayName;
+    private boolean optional = false;
+    
+    public Tag() {      
+    }
 
-	public String getKey() {
-		return key;
-	}
+    public String getKey() {
+        return key;
+    }
 
-	public void setKey(String key) {
-		this.key = key;
-	}
+    public void setKey(String key) {
+        this.key = key;
+    }
 
-	public String getValue() {
-		return value;
-	}
+    public String getValue() {
+        return value;
+    }
 
-	public void setValue(String value) {
-		this.value = value;
-	}
+    public void setValue(String value) {
+        this.value = value;
+    }
 
-	public String getDisplayName() {
-		return displayName;
-	}
+    public String getDisplayName() {
+        return displayName;
+    }
 
-	public void setDisplayName(String displayName) {
-		this.displayName = displayName;
-	}
+    public void setDisplayName(String displayName) {
+        this.displayName = displayName;
+    }
 
-	public boolean isOptional() {
-		return optional;
-	}
+    public boolean isOptional() {
+        return optional;
+    }
 
-	public void setOptional(boolean optional) {
-		this.optional = optional;
-	}
+    public void setOptional(boolean optional) {
+        this.optional = optional;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/io/Parser.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/io/Parser.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/io/Parser.java	(revision 23189)
@@ -22,251 +22,251 @@
 
 public class Parser {
-	
-	static final private Logger logger = Logger.getLogger(Parser.class.getName());
-	
+    
+    static final private Logger logger = Logger.getLogger(Parser.class.getName());
+    
     private Presets presets = null;
-	private Reader reader;
-	private Stack<Group> currentGroup;
-	private Item currentItem;
-	private boolean inOptionalKeys = false; 
-	private XMLReader parser;
-	private File zipIconArchive;
-
-	public Parser() {
-		currentGroup = new Stack<Group>();
-		currentItem = null;
-	}
-	
-	public Parser(Reader reader) {		
-		this();
-		if (reader == null) {
-			throw new IllegalArgumentException("reader must not be null");
-		}
-		this.reader = reader; 
-	}
-	
-	public void setReader(Reader reader) {
-		this.reader = reader;
-	}
-	
-	public Reader getReader() {
-		return reader;
-	}
-	
-	public void setZipIconArchive(File zipIconArchive) {
-		this.zipIconArchive = zipIconArchive;
-	}
-	
-	public Presets getPresets() {
-		return presets;
-	}
-
-	public void setPresets(Presets presets) {
-		this.presets = presets;
-	}
-
-	protected void init() throws PresetIOException {
-		try {
-			parser = XMLReaderFactory.createXMLReader();
-			Handler handler = new Handler();
-			parser.setContentHandler(handler);
-			parser.setErrorHandler(handler);
-			parser.setFeature( "http://xml.org/sax/features/validation", false);
-			parser.setFeature("http://xml.org/sax/features/namespaces", false);
-			parser.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
-		} catch(SAXException e) {
-			logger.log(Level.SEVERE, "exception while creating SAX parser", e);
-			throw new PresetIOException("exception while creating SAX parser",e);			
-		}
-	}
-
-	/**
-	 * parses the presets given by the input source in {@see #getReader()}. 
-	 * Creates a new set of presets if {@see #getPresets()} is null, otherwise
-	 * parses the presets into the set of presets given by {@see #getPresets()}.
-	 * 
-	 * Call {@see #getPresets()} to retrieve the parsed presets after parsing.
-	 * 
-	 * @throws IllegalStateException thrown, if {@see #getReader()} is null. Set a properly initialized reader first.
-	 * @throws PresetIOException if an exception is detected during parsing 
-	 */
-	public void parse()  throws PresetIOException {
-		if (getReader() == null) {
-			throw new IllegalStateException("reader is null. set reader first.");
-		}
-		if (getPresets() == null) {
-			logger.warning("presets is null. Creating a new set of presets");
-			setPresets(new Presets());
-		}
-		parse(getReader());
-		return;
-	}
-	
-	/**
-	 * parses the presets given by the input source in {@see #getReader()}. 
-	 * Creates a new set of presets if {@see #getPresets()} is null, otherwise
-	 * parses the presets into the set of presets given by {@see #getPresets()}.
-	 * 
-	 * Call {@see #getPresets()} to retrieve the parsed presets after parsing.
-	 * 
-	 * @param reader  a properly initialized reader 
-	 * @throws PresetIOException if an exception is detected during parsing 
-	 */
-	public void parse(Reader reader) throws PresetIOException {
-		init();
-		if (getPresets() == null) {
-			logger.warning("presets is null. Creating a new set of presets");
-			setPresets(new Presets());
-		}
-		try {
-			parser.parse(new InputSource(reader));
-		} catch(Exception e) {
-			logger.log(Level.SEVERE, "exception while parsing preset file", e);
-			throw new PresetIOException(e);
-		}
-		// "release" XML parser 
-		parser = null;		
-	}
-	
-	protected String translatedAttributeValue(String attrValue) {
-		if (attrValue == null) {
-			return null;
-		} else {
-			return tr(attrValue);
-		}
-	}
-	
-	protected void onStartGroup(String name, String iconName) {
-		Group g = new Group();
-		g.setName(translatedAttributeValue(name));
-		g.setIconName(iconName, zipIconArchive);
-		currentGroup.push(g);
-	}
-	
-	protected void onEndGroup() {
-		Group g = currentGroup.pop();
-		presets.addGroup(g); 
-	}
-	
-	protected void onStartItem(String name, String iconName) {
-		currentItem = new Item();
-		currentItem.setName(translatedAttributeValue(name));
-		currentItem.setIconName(iconName, zipIconArchive);
-	}
-	
-	protected void onEndItem() {
-		if (currentGroup == null) {
-			logger.log(Level.SEVERE, "illegal state. no current group defined");
-			throw new IllegalStateException("illegal state. no current group defined");
-		}
-		currentGroup.peek().addItem(currentItem);
-		currentItem = null; 
-	}
-	
-	protected void onStartOptionalKeys() {
-		this.inOptionalKeys = true; 
-	}
-	
-	protected void onEndOptionalKeys() {
-		this.inOptionalKeys = false; 
-	}
-	
-	protected void onTag(String key, String value, String displayName){
-		Tag tag = new Tag();
-		tag.setKey(key);
-		tag.setValue(value);
-		tag.setDisplayName(translatedAttributeValue(displayName));
-		tag.setOptional(inOptionalKeys);
-		
-		if (currentItem == null) {
-			logger.log(Level.SEVERE, "illegal state. no current item defined");
-			throw new IllegalStateException("illegal state. no current item defined");			
-		}
-		currentItem.addTag(tag);	
-	}
-	
-	protected void onLabel(String label) {
-		if (currentItem == null) {
-			logger.log(Level.SEVERE, "illegal state. no current item defined");
-			throw new IllegalStateException("illegal state. no current item defined");						
-		}
-		currentItem.setLabel(label);
-	}
-	
-	/**
-	 * The SAX handler for reading XML files with tag specifications 
-	 *
-	 *
-	 */
-	class Handler extends DefaultHandler {
-		
-		@Override
-		public void endDocument() throws SAXException {
-			logger.log(Level.FINE,"END");
-		}
-
-		@Override
-		public void error(SAXParseException e) throws SAXException {
-			logger.log(Level.SEVERE, "XML parsing error", e);
-		}
-
-		@Override
-		public void fatalError(SAXParseException e) throws SAXException {
-			logger.log(Level.SEVERE, "XML parsing error", e);
-		}
-
-		@Override
-		public void startDocument() throws SAXException {
-			logger.log(Level.FINE,"START");
-		}
-
-		protected String getAttribute(Attributes attributes, String qName) {
-			for (int i =0; i < attributes.getLength();i++) {
-				if (attributes.getQName(i).equals(qName)) {
-					return attributes.getValue(i);
-				}
-			}
-			return null;
-		}
-		
-		@Override
-		public void startElement(String namespaceURI, String localName, String qName,
-				Attributes atts) throws SAXException {
-			if ("group".equals(qName)) {
-				onStartGroup(getAttribute(atts, "name"), getAttribute(atts, "icon"));
-			} else if ("item".equals(qName)) {
-				onStartItem(getAttribute(atts, "name"), getAttribute(atts, "icon"));
-			} else if ("label".equals(qName)) {
-				onLabel(getAttribute(atts, "text")); 
-			} else if ("optional".equals(qName)) {
-				onStartOptionalKeys();
-			} else if ("key".equals(qName) || "text".equals(qName) || "combo".equals(qName) 
-					   || "check".equals(qName)) {
-				onTag(getAttribute(atts, "key"), getAttribute(atts, "value"), getAttribute(atts, "text"));
-			}			
-		}
-		
-		@Override
-		public void endElement(String namespaceURI, String localName, String qName)
-				throws SAXException {
-			if ("group".equals(qName)) {
-				onEndGroup();
-			} else if ("item".equals(qName)) {
-				onEndItem();
-			} else if ("label".equals(qName)) {
-				// do nothing
-			} else if ("optional".equals(qName)) {
-				onEndOptionalKeys();
-			}			
-		}
-
-		/* (non-Javadoc)
-		 * @see org.xml.sax.helpers.DefaultHandler#warning(org.xml.sax.SAXParseException)
-		 */
-		@Override
-		public void warning(SAXParseException e) throws SAXException {
-			// TODO Auto-generated method stub
-			logger.log(Level.WARNING, "XML parsing warning", e);
-		}
-	}
+    private Reader reader;
+    private Stack<Group> currentGroup;
+    private Item currentItem;
+    private boolean inOptionalKeys = false; 
+    private XMLReader parser;
+    private File zipIconArchive;
+
+    public Parser() {
+        currentGroup = new Stack<Group>();
+        currentItem = null;
+    }
+    
+    public Parser(Reader reader) {      
+        this();
+        if (reader == null) {
+            throw new IllegalArgumentException("reader must not be null");
+        }
+        this.reader = reader; 
+    }
+    
+    public void setReader(Reader reader) {
+        this.reader = reader;
+    }
+    
+    public Reader getReader() {
+        return reader;
+    }
+    
+    public void setZipIconArchive(File zipIconArchive) {
+        this.zipIconArchive = zipIconArchive;
+    }
+    
+    public Presets getPresets() {
+        return presets;
+    }
+
+    public void setPresets(Presets presets) {
+        this.presets = presets;
+    }
+
+    protected void init() throws PresetIOException {
+        try {
+            parser = XMLReaderFactory.createXMLReader();
+            Handler handler = new Handler();
+            parser.setContentHandler(handler);
+            parser.setErrorHandler(handler);
+            parser.setFeature( "http://xml.org/sax/features/validation", false);
+            parser.setFeature("http://xml.org/sax/features/namespaces", false);
+            parser.setFeature("http://xml.org/sax/features/namespace-prefixes", false);
+        } catch(SAXException e) {
+            logger.log(Level.SEVERE, "exception while creating SAX parser", e);
+            throw new PresetIOException("exception while creating SAX parser",e);           
+        }
+    }
+
+    /**
+     * parses the presets given by the input source in {@see #getReader()}. 
+     * Creates a new set of presets if {@see #getPresets()} is null, otherwise
+     * parses the presets into the set of presets given by {@see #getPresets()}.
+     * 
+     * Call {@see #getPresets()} to retrieve the parsed presets after parsing.
+     * 
+     * @throws IllegalStateException thrown, if {@see #getReader()} is null. Set a properly initialized reader first.
+     * @throws PresetIOException if an exception is detected during parsing 
+     */
+    public void parse()  throws PresetIOException {
+        if (getReader() == null) {
+            throw new IllegalStateException("reader is null. set reader first.");
+        }
+        if (getPresets() == null) {
+            logger.warning("presets is null. Creating a new set of presets");
+            setPresets(new Presets());
+        }
+        parse(getReader());
+        return;
+    }
+    
+    /**
+     * parses the presets given by the input source in {@see #getReader()}. 
+     * Creates a new set of presets if {@see #getPresets()} is null, otherwise
+     * parses the presets into the set of presets given by {@see #getPresets()}.
+     * 
+     * Call {@see #getPresets()} to retrieve the parsed presets after parsing.
+     * 
+     * @param reader  a properly initialized reader 
+     * @throws PresetIOException if an exception is detected during parsing 
+     */
+    public void parse(Reader reader) throws PresetIOException {
+        init();
+        if (getPresets() == null) {
+            logger.warning("presets is null. Creating a new set of presets");
+            setPresets(new Presets());
+        }
+        try {
+            parser.parse(new InputSource(reader));
+        } catch(Exception e) {
+            logger.log(Level.SEVERE, "exception while parsing preset file", e);
+            throw new PresetIOException(e);
+        }
+        // "release" XML parser 
+        parser = null;      
+    }
+    
+    protected String translatedAttributeValue(String attrValue) {
+        if (attrValue == null) {
+            return null;
+        } else {
+            return tr(attrValue);
+        }
+    }
+    
+    protected void onStartGroup(String name, String iconName) {
+        Group g = new Group();
+        g.setName(translatedAttributeValue(name));
+        g.setIconName(iconName, zipIconArchive);
+        currentGroup.push(g);
+    }
+    
+    protected void onEndGroup() {
+        Group g = currentGroup.pop();
+        presets.addGroup(g); 
+    }
+    
+    protected void onStartItem(String name, String iconName) {
+        currentItem = new Item();
+        currentItem.setName(translatedAttributeValue(name));
+        currentItem.setIconName(iconName, zipIconArchive);
+    }
+    
+    protected void onEndItem() {
+        if (currentGroup == null) {
+            logger.log(Level.SEVERE, "illegal state. no current group defined");
+            throw new IllegalStateException("illegal state. no current group defined");
+        }
+        currentGroup.peek().addItem(currentItem);
+        currentItem = null; 
+    }
+    
+    protected void onStartOptionalKeys() {
+        this.inOptionalKeys = true; 
+    }
+    
+    protected void onEndOptionalKeys() {
+        this.inOptionalKeys = false; 
+    }
+    
+    protected void onTag(String key, String value, String displayName){
+        Tag tag = new Tag();
+        tag.setKey(key);
+        tag.setValue(value);
+        tag.setDisplayName(translatedAttributeValue(displayName));
+        tag.setOptional(inOptionalKeys);
+        
+        if (currentItem == null) {
+            logger.log(Level.SEVERE, "illegal state. no current item defined");
+            throw new IllegalStateException("illegal state. no current item defined");          
+        }
+        currentItem.addTag(tag);    
+    }
+    
+    protected void onLabel(String label) {
+        if (currentItem == null) {
+            logger.log(Level.SEVERE, "illegal state. no current item defined");
+            throw new IllegalStateException("illegal state. no current item defined");                      
+        }
+        currentItem.setLabel(label);
+    }
+    
+    /**
+     * The SAX handler for reading XML files with tag specifications 
+     *
+     *
+     */
+    class Handler extends DefaultHandler {
+        
+        @Override
+        public void endDocument() throws SAXException {
+            logger.log(Level.FINE,"END");
+        }
+
+        @Override
+        public void error(SAXParseException e) throws SAXException {
+            logger.log(Level.SEVERE, "XML parsing error", e);
+        }
+
+        @Override
+        public void fatalError(SAXParseException e) throws SAXException {
+            logger.log(Level.SEVERE, "XML parsing error", e);
+        }
+
+        @Override
+        public void startDocument() throws SAXException {
+            logger.log(Level.FINE,"START");
+        }
+
+        protected String getAttribute(Attributes attributes, String qName) {
+            for (int i =0; i < attributes.getLength();i++) {
+                if (attributes.getQName(i).equals(qName)) {
+                    return attributes.getValue(i);
+                }
+            }
+            return null;
+        }
+        
+        @Override
+        public void startElement(String namespaceURI, String localName, String qName,
+                Attributes atts) throws SAXException {
+            if ("group".equals(qName)) {
+                onStartGroup(getAttribute(atts, "name"), getAttribute(atts, "icon"));
+            } else if ("item".equals(qName)) {
+                onStartItem(getAttribute(atts, "name"), getAttribute(atts, "icon"));
+            } else if ("label".equals(qName)) {
+                onLabel(getAttribute(atts, "text")); 
+            } else if ("optional".equals(qName)) {
+                onStartOptionalKeys();
+            } else if ("key".equals(qName) || "text".equals(qName) || "combo".equals(qName) 
+                       || "check".equals(qName)) {
+                onTag(getAttribute(atts, "key"), getAttribute(atts, "value"), getAttribute(atts, "text"));
+            }           
+        }
+        
+        @Override
+        public void endElement(String namespaceURI, String localName, String qName)
+                throws SAXException {
+            if ("group".equals(qName)) {
+                onEndGroup();
+            } else if ("item".equals(qName)) {
+                onEndItem();
+            } else if ("label".equals(qName)) {
+                // do nothing
+            } else if ("optional".equals(qName)) {
+                onEndOptionalKeys();
+            }           
+        }
+
+        /* (non-Javadoc)
+         * @see org.xml.sax.helpers.DefaultHandler#warning(org.xml.sax.SAXParseException)
+         */
+        @Override
+        public void warning(SAXParseException e) throws SAXException {
+            // TODO Auto-generated method stub
+            logger.log(Level.WARNING, "XML parsing warning", e);
+        }
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/io/PresetIOException.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/io/PresetIOException.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/io/PresetIOException.java	(revision 23189)
@@ -3,22 +3,22 @@
 public class PresetIOException extends Exception {
 
-	public PresetIOException() {
-		super();
-		// TODO Auto-generated constructor stub
-	}
+    public PresetIOException() {
+        super();
+        // TODO Auto-generated constructor stub
+    }
 
-	public PresetIOException(String arg0, Throwable arg1) {
-		super(arg0, arg1);
-		// TODO Auto-generated constructor stub
-	}
+    public PresetIOException(String arg0, Throwable arg1) {
+        super(arg0, arg1);
+        // TODO Auto-generated constructor stub
+    }
 
-	public PresetIOException(String arg0) {
-		super(arg0);
-		// TODO Auto-generated constructor stub
-	}
+    public PresetIOException(String arg0) {
+        super(arg0);
+        // TODO Auto-generated constructor stub
+    }
 
-	public PresetIOException(Throwable arg0) {
-		super(arg0);
-		// TODO Auto-generated constructor stub
-	}
+    public PresetIOException(Throwable arg0) {
+        super(arg0);
+        // TODO Auto-generated constructor stub
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/IPresetSelectorListener.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/IPresetSelectorListener.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/IPresetSelectorListener.java	(revision 23189)
@@ -5,4 +5,4 @@
 public interface IPresetSelectorListener {
 
-	public void itemSelected(Item item);
+    public void itemSelected(Item item);
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/NameIconCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/NameIconCellRenderer.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/NameIconCellRenderer.java	(revision 23189)
@@ -16,29 +16,29 @@
 public class NameIconCellRenderer extends JLabel implements TableCellRenderer {
 
-	private static Logger logger = Logger.getLogger(NameIconCellRenderer.class.getName());
-	public static final Color BG_COLOR_SELECTED = new Color(143,170,255);
+    private static Logger logger = Logger.getLogger(NameIconCellRenderer.class.getName());
+    public static final Color BG_COLOR_SELECTED = new Color(143,170,255);
 
 
-	protected void init() {
-		setOpaque(true);
-		setFont(new Font("SansSerif",Font.PLAIN,10));
-	}
+    protected void init() {
+        setOpaque(true);
+        setFont(new Font("SansSerif",Font.PLAIN,10));
+    }
 
-	public NameIconCellRenderer() {
-		init();
-	}
+    public NameIconCellRenderer() {
+        init();
+    }
 
-	public Component getTableCellRendererComponent(JTable table, Object value,
-			boolean isSelected, boolean hasFocus, int rowIndex, int colIndex) {
+    public Component getTableCellRendererComponent(JTable table, Object value,
+            boolean isSelected, boolean hasFocus, int rowIndex, int colIndex) {
 
-		if (isSelected) {
-			setBackground(BG_COLOR_SELECTED);
-		} else  {
-			setBackground(Color.WHITE);
-		}
-		INameIconProvider provider = (INameIconProvider) value;
-		setText(provider.getName());
-		setIcon(provider.getIcon());
-		return this;
-	}
+        if (isSelected) {
+            setBackground(BG_COLOR_SELECTED);
+        } else  {
+            setBackground(Color.WHITE);
+        }
+        INameIconProvider provider = (INameIconProvider) value;
+        setText(provider.getName());
+        setIcon(provider.getIcon());
+        return this;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTable.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTable.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTable.java	(revision 23189)
@@ -9,39 +9,39 @@
 public class PresetsTable extends JTable {
 
-	/**
-	 * initialize the table 
-	 */
-	protected void init() {				
-		setAutoResizeMode(JTable.AUTO_RESIZE_OFF);		
-		setRowSelectionAllowed(true);
-		setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-		setRowHeight(18); // icon height (=16) + minimal border
-		
-	}
-	
-	public PresetsTable(TableModel model, TableColumnModel columnModel) {
-		super(model,columnModel);
-		init();
-	}
-	
-	/**
-	 * adjusts the width of the columns for the tag name and the tag value
-	 * to the width of the scroll panes viewport.
-	 * 
-	 * Note: {@see #getPreferredScrollableViewportSize()} did not work as expected
-	 * 
-	 * @param scrollPaneWidth the width of the scroll panes viewport
-	 */
-	public void adjustColumnWidth(int scrollPaneWidth) {
-		TableColumnModel tcm = getColumnModel();
-		int width = scrollPaneWidth;
-		width = width / 2;
-		if (width > 0) {
-			tcm.getColumn(0).setMinWidth(width);
-			tcm.getColumn(0).setMaxWidth(width);
-			tcm.getColumn(1).setMinWidth(width);
-			tcm.getColumn(1).setMaxWidth(width);			
-		}
-	}
+    /**
+     * initialize the table 
+     */
+    protected void init() {             
+        setAutoResizeMode(JTable.AUTO_RESIZE_OFF);      
+        setRowSelectionAllowed(true);
+        setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        setRowHeight(18); // icon height (=16) + minimal border
+        
+    }
+    
+    public PresetsTable(TableModel model, TableColumnModel columnModel) {
+        super(model,columnModel);
+        init();
+    }
+    
+    /**
+     * adjusts the width of the columns for the tag name and the tag value
+     * to the width of the scroll panes viewport.
+     * 
+     * Note: {@see #getPreferredScrollableViewportSize()} did not work as expected
+     * 
+     * @param scrollPaneWidth the width of the scroll panes viewport
+     */
+    public void adjustColumnWidth(int scrollPaneWidth) {
+        TableColumnModel tcm = getColumnModel();
+        int width = scrollPaneWidth;
+        width = width / 2;
+        if (width > 0) {
+            tcm.getColumn(0).setMinWidth(width);
+            tcm.getColumn(0).setMaxWidth(width);
+            tcm.getColumn(1).setMinWidth(width);
+            tcm.getColumn(1).setMaxWidth(width);            
+        }
+    }
 
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableColumnModel.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableColumnModel.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableColumnModel.java	(revision 23189)
@@ -8,28 +8,28 @@
 public class PresetsTableColumnModel extends DefaultTableColumnModel  {
 
-	protected void createColumns() {
-		TableCellRenderer renderer = new NameIconCellRenderer();
-		
-		TableColumn col = null;
-		
-		// column 0 - Group   
-		col = new TableColumn(0);
-		col.setHeaderValue(tr("Group"));
-		col.setResizable(true);
-		col.setCellRenderer(renderer);
-		addColumn(col);
-		
-		// column 1 - Item   
-		col = new TableColumn(1);
-		col.setHeaderValue(tr("Item"));
-		col.setResizable(true);
-		col.setCellRenderer(renderer);
-		addColumn(col);
+    protected void createColumns() {
+        TableCellRenderer renderer = new NameIconCellRenderer();
+        
+        TableColumn col = null;
+        
+        // column 0 - Group   
+        col = new TableColumn(0);
+        col.setHeaderValue(tr("Group"));
+        col.setResizable(true);
+        col.setCellRenderer(renderer);
+        addColumn(col);
+        
+        // column 1 - Item   
+        col = new TableColumn(1);
+        col.setHeaderValue(tr("Item"));
+        col.setResizable(true);
+        col.setCellRenderer(renderer);
+        addColumn(col);
 
-	}
+    }
 
-	public PresetsTableColumnModel() {
-		createColumns();
-	}
-	
+    public PresetsTableColumnModel() {
+        createColumns();
+    }
+    
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableModel.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableModel.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/PresetsTableModel.java	(revision 23189)
@@ -14,117 +14,117 @@
 public class PresetsTableModel extends AbstractTableModel  {
 
-	private static final Logger logger = Logger.getLogger(PresetsTableModel.class.getName());
+    private static final Logger logger = Logger.getLogger(PresetsTableModel.class.getName());
 
-	private final ArrayList<TableModelListener> listeners = new ArrayList<TableModelListener>();
-	private final ArrayList<Item> items = new ArrayList<Item>();
-	private final ArrayList<Item> visibleItems = new ArrayList<Item>();
-	private Presets presets = null;
+    private final ArrayList<TableModelListener> listeners = new ArrayList<TableModelListener>();
+    private final ArrayList<Item> items = new ArrayList<Item>();
+    private final ArrayList<Item> visibleItems = new ArrayList<Item>();
+    private Presets presets = null;
 
-	protected void initModelFromPresets(Presets presets) {
-		for(Group group: presets.getGroups()) {
-			for(Item item: group.getItems()) {
-				items.add(item);
-				visibleItems.add(item);
-			}
-		}
-	}
+    protected void initModelFromPresets(Presets presets) {
+        for(Group group: presets.getGroups()) {
+            for(Item item: group.getItems()) {
+                items.add(item);
+                visibleItems.add(item);
+            }
+        }
+    }
 
-	public PresetsTableModel() {
-	}
+    public PresetsTableModel() {
+    }
 
-	public PresetsTableModel(Presets presets) {
-		setPresets(presets);
-	}
+    public PresetsTableModel(Presets presets) {
+        setPresets(presets);
+    }
 
 
-	public Presets getPresets() {
-		return presets;
-	}
+    public Presets getPresets() {
+        return presets;
+    }
 
-	public void setPresets(Presets presets) {
-		this.presets = presets;
-		initModelFromPresets(presets);
-		fireTableDataChanged();
-	}
+    public void setPresets(Presets presets) {
+        this.presets = presets;
+        initModelFromPresets(presets);
+        fireTableDataChanged();
+    }
 
-	@Override
-	public void addTableModelListener(TableModelListener l) {
-		synchronized(listeners) {
-			if (l == null)
-				return;
-			if (!listeners.contains(l)) {
-				listeners.add(l);
-			}
-		}
-	}
+    @Override
+    public void addTableModelListener(TableModelListener l) {
+        synchronized(listeners) {
+            if (l == null)
+                return;
+            if (!listeners.contains(l)) {
+                listeners.add(l);
+            }
+        }
+    }
 
-	@Override
-	public Class<?> getColumnClass(int columnIndex) {
-		return String.class;
-	}
+    @Override
+    public Class<?> getColumnClass(int columnIndex) {
+        return String.class;
+    }
 
-	public int getColumnCount() {
-		return 2;
-	}
+    public int getColumnCount() {
+        return 2;
+    }
 
-	public int getRowCount() {
-		return visibleItems.size();
-	}
+    public int getRowCount() {
+        return visibleItems.size();
+    }
 
-	public Object getValueAt(int rowIndex, int columnIndex) {
-		Item item = visibleItems.get(rowIndex);
-		switch(columnIndex) {
-		case 0: return item.getParent();
-		case 1: return item;
-		default: return "unknown";
+    public Object getValueAt(int rowIndex, int columnIndex) {
+        Item item = visibleItems.get(rowIndex);
+        switch(columnIndex) {
+        case 0: return item.getParent();
+        case 1: return item;
+        default: return "unknown";
 
-		}
-	}
+        }
+    }
 
-	@Override
-	public boolean isCellEditable(int rowIndex, int columnIndex) {
-		return false;
-	}
+    @Override
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+        return false;
+    }
 
-	@Override
-	public void removeTableModelListener(TableModelListener l) {
-		synchronized (listeners) {
-			if (listeners.contains(l)) {
-				listeners.remove(l);
-			}
-		}
-	}
+    @Override
+    public void removeTableModelListener(TableModelListener l) {
+        synchronized (listeners) {
+            if (listeners.contains(l)) {
+                listeners.remove(l);
+            }
+        }
+    }
 
-	@Override
-	public void setValueAt(Object value, int rowIndex, int columnIndex) {
-		// do nothing. No editing allowed
-	}
+    @Override
+    public void setValueAt(Object value, int rowIndex, int columnIndex) {
+        // do nothing. No editing allowed
+    }
 
-	public Item getVisibleItem(int idx) {
-		if (idx < 0 || idx >= this.visibleItems.size())
-			throw new IndexOutOfBoundsException("index out of bounds. idx=" + idx);
-		return visibleItems.get(idx);
-	}
+    public Item getVisibleItem(int idx) {
+        if (idx < 0 || idx >= this.visibleItems.size())
+            throw new IndexOutOfBoundsException("index out of bounds. idx=" + idx);
+        return visibleItems.get(idx);
+    }
 
-	public void filter(String filter) {
-		synchronized(this) {
-			if (filter == null || filter.trim().equals("")) {
-				visibleItems.clear();
-				for(Item item: items) {
-					visibleItems.add(item);
-				}
-			} else {
-				visibleItems.clear();
-				filter = filter.toLowerCase();
-				for(Item item: items) {
-					if (    (item.getName() != null && item.getName().toLowerCase().trim().startsWith(filter))
-							|| (item.getParent().getName() != null && item.getParent().getName().toLowerCase().trim().startsWith(filter))) {
-						visibleItems.add(item);
-					}
-				}
-			}
-			fireTableDataChanged();
-			fireTableStructureChanged();
-		}
-	}
+    public void filter(String filter) {
+        synchronized(this) {
+            if (filter == null || filter.trim().equals("")) {
+                visibleItems.clear();
+                for(Item item: items) {
+                    visibleItems.add(item);
+                }
+            } else {
+                visibleItems.clear();
+                filter = filter.toLowerCase();
+                for(Item item: items) {
+                    if (    (item.getName() != null && item.getName().toLowerCase().trim().startsWith(filter))
+                            || (item.getParent().getName() != null && item.getParent().getName().toLowerCase().trim().startsWith(filter))) {
+                        visibleItems.add(item);
+                    }
+                }
+            }
+            fireTableDataChanged();
+            fireTableStructureChanged();
+        }
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/TabularPresetSelector.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/TabularPresetSelector.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/preset/ui/TabularPresetSelector.java	(revision 23189)
@@ -37,248 +37,248 @@
 public class TabularPresetSelector extends JPanel {
 
-	private PresetsTable presetsTable = null;
-	private JTextField   tfFilter = null;
-	private final ArrayList<IPresetSelectorListener> listeners = new ArrayList<IPresetSelectorListener>();
-	private JScrollPane scrollPane;
-	private JButton btnApply;
-
-
-	protected JPanel buildFilterPanel() {
-		JPanel pnl = new JPanel();
-		JLabel lbl = new JLabel(tr("Search: "));
-		pnl.setLayout(new FlowLayout(FlowLayout.LEFT));
-		tfFilter = new JTextField(20);
-		pnl.add(lbl);
-		pnl.add(tfFilter,BorderLayout.CENTER);
-		JButton btn = new JButton(tr("Filter"));
-		pnl.add(btn);
-		btn.addActionListener(
-				new ActionListener() {
-					public void actionPerformed(ActionEvent e) {
-						filter(tfFilter.getText());
-					}
-
-				}
-		);
-		btn = new JButton(tr("Clear"));
-		pnl.add(btn);
-		btn.addActionListener(
-				new ActionListener() {
-					public void actionPerformed(ActionEvent e) {
-						tfFilter.setText("");
-						tfFilter.requestFocus();
-					}
-				}
-		);
-		return pnl;
-	}
-
-
-
-	protected JScrollPane buildPresetGrid() {
-
-		presetsTable = new PresetsTable(new PresetsTableModel(),new PresetsTableColumnModel());
-
-		scrollPane = new JScrollPane(presetsTable);
-
-		scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-		scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
-
-		// this adapters ensures that the width of the tag table columns is adjusted
-		// to the width of the scroll pane viewport. Also tried to overwrite
-		// getPreferredViewportSize() in JTable, but did not work.
-		//
-		scrollPane.addComponentListener(
-				new ComponentAdapter() {
-					@Override public void componentResized(ComponentEvent e) {
-						super.componentResized(e);
-						Dimension d = scrollPane.getViewport().getExtentSize();
-						presetsTable.adjustColumnWidth(d.width);
-					}
-				}
-		);
-
-		// add the double click listener
-		//
-		presetsTable.addMouseListener(new DoubleClickAdapter());
-
-		// replace Enter action. apply the current preset on enter
-		//
-		presetsTable.unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0));
-		ActionListener enterAction = new ActionListener() {
-			public void actionPerformed(ActionEvent e) {
-				int rowNum = presetsTable.getSelectedRow();
-				if (rowNum >= 0) {
-					Item item = getModel().getVisibleItem(rowNum);
-					fireItemSelected(item);
-				}
-			}
-		};
-
-		presetsTable.registerKeyboardAction(
-				enterAction,
-				"Enter",
-				KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0),
-				JComponent.WHEN_FOCUSED
-		);
-
-		return scrollPane;
-	}
-
-	protected JPanel buildControlButtonPanel() {
-		JPanel pnl = new JPanel();
-		pnl.setLayout(new FlowLayout(FlowLayout.LEFT));
-		btnApply = new JButton(tr("Apply"));
-		pnl.add(btnApply);
-		btnApply.addActionListener(
-				new ActionListener() {
-					public void actionPerformed(ActionEvent arg0) {
-						int row = presetsTable.getSelectedRow();
-						if (row >=0) {
-							Item item = getModel().getVisibleItem(row);
-							fireItemSelected(item);
-						}
-					}
-				}
-		);
-		return pnl;
-	}
-
-	protected void build() {
-		setLayout(new BorderLayout());
-		add(buildFilterPanel(), BorderLayout.NORTH);
-		add(buildPresetGrid(), BorderLayout.CENTER);
-		add(buildControlButtonPanel(), BorderLayout.SOUTH);
-
-		// wire the text field for filter expressions to the prests
-		// table
-		//
-		tfFilter.getDocument().addDocumentListener(
-				new DocumentListener() {
-					public void changedUpdate(DocumentEvent arg0) {
-						onUpdate();
-					}
-
-					public void insertUpdate(DocumentEvent arg0) {
-						onUpdate();
-					}
-
-					public void removeUpdate(DocumentEvent arg0) {
-						onUpdate();
-					}
-
-					protected void onUpdate() {
-						filter(tfFilter.getText());
-					}
-				}
-		);
-
-		tfFilter.addActionListener(
-				new ActionListener() {
-					public void actionPerformed(ActionEvent e) {
-						filter(tfFilter.getText());
-					}
-				}
-		);
-
-		// wire the apply button to the selection model of the preset table
-		//
-		presetsTable.getSelectionModel().addListSelectionListener(
-				new ListSelectionListener() {
-					public void valueChanged(ListSelectionEvent e) {
-						btnApply.setEnabled(presetsTable.getSelectedRowCount() != 0);
-					}
-				}
-		);
-
-
-		// load the set of presets and bind them to the preset table
-		//
-		Presets.initPresets();
-		bindTo(Presets.getPresets());
-		presetsTable.getSelectionModel().clearSelection();
-		btnApply.setEnabled(false);
-
-	}
-
-	public void bindTo(Presets presets) {
-		PresetsTableModel model = (PresetsTableModel)presetsTable.getModel();
-		model.setPresets(presets);
-	}
-
-	public TabularPresetSelector() {
-		build();
-	}
-
-	public void addPresetSelectorListener(IPresetSelectorListener listener) {
-		synchronized(this.listeners) {
-			if (listener != null && ! listeners.contains(listener)) {
-				listeners.add(listener);
-			}
-		}
-	}
-
-	public void removePresetSelectorListener(IPresetSelectorListener listener) {
-		synchronized(this.listeners) {
-			if (listener != null) {
-				listeners.remove(listener);
-			}
-		}
-	}
-
-	protected void fireItemSelected(Item item) {
-		synchronized(this.listeners) {
-			for(IPresetSelectorListener listener: listeners) {
-				listener.itemSelected(item);
-			}
-		}
-	}
-
-
-
-
-	private class DoubleClickAdapter extends MouseAdapter {
-		@Override
-		public void mouseClicked(MouseEvent e) {
-			if (e.getClickCount() == 2) {
-				int rowNum = presetsTable.rowAtPoint(e.getPoint());
-				Item item = getModel().getVisibleItem(rowNum);
-				fireItemSelected(item);
-			}
-		}
-	}
-
-
-	public void filter(String filter) {
-		presetsTable.getSelectionModel().clearSelection();
-		getModel().filter(filter);
-
-		presetsTable.scrollRectToVisible(presetsTable.getCellRect(0, 0, false));
-
-		// we change the number of rows by applying a filter condition. Because
-		// the table is embedded in a JScrollPane which again may be embedded in
-		// other JScrollPanes or JSplitPanes it seems that we have to recalculate
-		// the layout and repaint the component tree. Maybe there is a more efficient way
-		// to keep the GUI in sync with the number of rows in table. By trial
-		// and error I ended up with the following lines.
-		//
-		Component c = presetsTable;
-		while(c != null) {
-			c.doLayout();
-			c.repaint();
-			c = c.getParent();
-		}
-	}
-
-
-	protected PresetsTableModel getModel() {
-		return (PresetsTableModel)presetsTable.getModel();
-	}
-
-	public void installKeyAction(Action a) {
-		getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put((KeyStroke)a.getValue(AbstractAction.ACCELERATOR_KEY), a.getValue(AbstractAction.NAME));
-		getActionMap().put(a.getValue(AbstractAction.NAME), a);
-
-	}
+    private PresetsTable presetsTable = null;
+    private JTextField   tfFilter = null;
+    private final ArrayList<IPresetSelectorListener> listeners = new ArrayList<IPresetSelectorListener>();
+    private JScrollPane scrollPane;
+    private JButton btnApply;
+
+
+    protected JPanel buildFilterPanel() {
+        JPanel pnl = new JPanel();
+        JLabel lbl = new JLabel(tr("Search: "));
+        pnl.setLayout(new FlowLayout(FlowLayout.LEFT));
+        tfFilter = new JTextField(20);
+        pnl.add(lbl);
+        pnl.add(tfFilter,BorderLayout.CENTER);
+        JButton btn = new JButton(tr("Filter"));
+        pnl.add(btn);
+        btn.addActionListener(
+                new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        filter(tfFilter.getText());
+                    }
+
+                }
+        );
+        btn = new JButton(tr("Clear"));
+        pnl.add(btn);
+        btn.addActionListener(
+                new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        tfFilter.setText("");
+                        tfFilter.requestFocus();
+                    }
+                }
+        );
+        return pnl;
+    }
+
+
+
+    protected JScrollPane buildPresetGrid() {
+
+        presetsTable = new PresetsTable(new PresetsTableModel(),new PresetsTableColumnModel());
+
+        scrollPane = new JScrollPane(presetsTable);
+
+        scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
+
+        // this adapters ensures that the width of the tag table columns is adjusted
+        // to the width of the scroll pane viewport. Also tried to overwrite
+        // getPreferredViewportSize() in JTable, but did not work.
+        //
+        scrollPane.addComponentListener(
+                new ComponentAdapter() {
+                    @Override public void componentResized(ComponentEvent e) {
+                        super.componentResized(e);
+                        Dimension d = scrollPane.getViewport().getExtentSize();
+                        presetsTable.adjustColumnWidth(d.width);
+                    }
+                }
+        );
+
+        // add the double click listener
+        //
+        presetsTable.addMouseListener(new DoubleClickAdapter());
+
+        // replace Enter action. apply the current preset on enter
+        //
+        presetsTable.unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0));
+        ActionListener enterAction = new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                int rowNum = presetsTable.getSelectedRow();
+                if (rowNum >= 0) {
+                    Item item = getModel().getVisibleItem(rowNum);
+                    fireItemSelected(item);
+                }
+            }
+        };
+
+        presetsTable.registerKeyboardAction(
+                enterAction,
+                "Enter",
+                KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0),
+                JComponent.WHEN_FOCUSED
+        );
+
+        return scrollPane;
+    }
+
+    protected JPanel buildControlButtonPanel() {
+        JPanel pnl = new JPanel();
+        pnl.setLayout(new FlowLayout(FlowLayout.LEFT));
+        btnApply = new JButton(tr("Apply"));
+        pnl.add(btnApply);
+        btnApply.addActionListener(
+                new ActionListener() {
+                    public void actionPerformed(ActionEvent arg0) {
+                        int row = presetsTable.getSelectedRow();
+                        if (row >=0) {
+                            Item item = getModel().getVisibleItem(row);
+                            fireItemSelected(item);
+                        }
+                    }
+                }
+        );
+        return pnl;
+    }
+
+    protected void build() {
+        setLayout(new BorderLayout());
+        add(buildFilterPanel(), BorderLayout.NORTH);
+        add(buildPresetGrid(), BorderLayout.CENTER);
+        add(buildControlButtonPanel(), BorderLayout.SOUTH);
+
+        // wire the text field for filter expressions to the prests
+        // table
+        //
+        tfFilter.getDocument().addDocumentListener(
+                new DocumentListener() {
+                    public void changedUpdate(DocumentEvent arg0) {
+                        onUpdate();
+                    }
+
+                    public void insertUpdate(DocumentEvent arg0) {
+                        onUpdate();
+                    }
+
+                    public void removeUpdate(DocumentEvent arg0) {
+                        onUpdate();
+                    }
+
+                    protected void onUpdate() {
+                        filter(tfFilter.getText());
+                    }
+                }
+        );
+
+        tfFilter.addActionListener(
+                new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        filter(tfFilter.getText());
+                    }
+                }
+        );
+
+        // wire the apply button to the selection model of the preset table
+        //
+        presetsTable.getSelectionModel().addListSelectionListener(
+                new ListSelectionListener() {
+                    public void valueChanged(ListSelectionEvent e) {
+                        btnApply.setEnabled(presetsTable.getSelectedRowCount() != 0);
+                    }
+                }
+        );
+
+
+        // load the set of presets and bind them to the preset table
+        //
+        Presets.initPresets();
+        bindTo(Presets.getPresets());
+        presetsTable.getSelectionModel().clearSelection();
+        btnApply.setEnabled(false);
+
+    }
+
+    public void bindTo(Presets presets) {
+        PresetsTableModel model = (PresetsTableModel)presetsTable.getModel();
+        model.setPresets(presets);
+    }
+
+    public TabularPresetSelector() {
+        build();
+    }
+
+    public void addPresetSelectorListener(IPresetSelectorListener listener) {
+        synchronized(this.listeners) {
+            if (listener != null && ! listeners.contains(listener)) {
+                listeners.add(listener);
+            }
+        }
+    }
+
+    public void removePresetSelectorListener(IPresetSelectorListener listener) {
+        synchronized(this.listeners) {
+            if (listener != null) {
+                listeners.remove(listener);
+            }
+        }
+    }
+
+    protected void fireItemSelected(Item item) {
+        synchronized(this.listeners) {
+            for(IPresetSelectorListener listener: listeners) {
+                listener.itemSelected(item);
+            }
+        }
+    }
+
+
+
+
+    private class DoubleClickAdapter extends MouseAdapter {
+        @Override
+        public void mouseClicked(MouseEvent e) {
+            if (e.getClickCount() == 2) {
+                int rowNum = presetsTable.rowAtPoint(e.getPoint());
+                Item item = getModel().getVisibleItem(rowNum);
+                fireItemSelected(item);
+            }
+        }
+    }
+
+
+    public void filter(String filter) {
+        presetsTable.getSelectionModel().clearSelection();
+        getModel().filter(filter);
+
+        presetsTable.scrollRectToVisible(presetsTable.getCellRect(0, 0, false));
+
+        // we change the number of rows by applying a filter condition. Because
+        // the table is embedded in a JScrollPane which again may be embedded in
+        // other JScrollPanes or JSplitPanes it seems that we have to recalculate
+        // the layout and repaint the component tree. Maybe there is a more efficient way
+        // to keep the GUI in sync with the number of rows in table. By trial
+        // and error I ended up with the following lines.
+        //
+        Component c = presetsTable;
+        while(c != null) {
+            c.doLayout();
+            c.repaint();
+            c = c.getParent();
+        }
+    }
+
+
+    protected PresetsTableModel getModel() {
+        return (PresetsTableModel)presetsTable.getModel();
+    }
+
+    public void installKeyAction(Action a) {
+        getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put((KeyStroke)a.getValue(AbstractAction.ACCELERATOR_KEY), a.getValue(AbstractAction.NAME));
+        getActionMap().put(a.getValue(AbstractAction.NAME), a);
+
+    }
 
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/KeyValuePair.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/KeyValuePair.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/KeyValuePair.java	(revision 23189)
@@ -2,61 +2,61 @@
 
 public class KeyValuePair {
-	private String key = new String("");
-	private String value = new String("");
-	
-	public KeyValuePair() {}
-	
-	public KeyValuePair(String key, String value) {
-		setKey(key);
-		setValue(value);
-	}
+    private String key = new String("");
+    private String value = new String("");
+    
+    public KeyValuePair() {}
+    
+    public KeyValuePair(String key, String value) {
+        setKey(key);
+        setValue(value);
+    }
 
-	
-	public String getKey() {
-		return key;
-	}
+    
+    public String getKey() {
+        return key;
+    }
 
-	public void setKey(String key) {
-		this.key = key == null? ""  :key;
-	}
+    public void setKey(String key) {
+        this.key = key == null? ""  :key;
+    }
 
-	public String getValue() {
-		return value;
-	}
+    public String getValue() {
+        return value;
+    }
 
-	public void setValue(String value) {
-		this.value = value == null ? "" : value;
-	}
+    public void setValue(String value) {
+        this.value = value == null ? "" : value;
+    }
 
-	@Override
-	public int hashCode() {
-		final int prime = 31;
-		int result = 1;
-		result = prime * result + ((key == null) ? 0 : key.hashCode());
-		result = prime * result + ((value == null) ? 0 : value.hashCode());
-		return result;
-	}
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((key == null) ? 0 : key.hashCode());
+        result = prime * result + ((value == null) ? 0 : value.hashCode());
+        return result;
+    }
 
-	@Override
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		KeyValuePair other = (KeyValuePair) obj;
-		if (key == null) {
-			if (other.key != null)
-				return false;
-		} else if (!key.equals(other.key))
-			return false;
-		if (value == null) {
-			if (other.value != null)
-				return false;
-		} else if (!value.equals(other.value))
-			return false;
-		return true;
-	}
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        KeyValuePair other = (KeyValuePair) obj;
+        if (key == null) {
+            if (other.key != null)
+                return false;
+        } else if (!key.equals(other.key))
+            return false;
+        if (value == null) {
+            if (other.value != null)
+                return false;
+        } else if (!value.equals(other.value))
+            return false;
+        return true;
+    }
 
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/LableSpecification.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/LableSpecification.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/LableSpecification.java	(revision 23189)
@@ -5,68 +5,68 @@
 public class LableSpecification {
 
-	/** the key of the tag */
-	private String value;
-		
-	
-	private boolean applicableToNode = true;
-	private boolean applicableToWay = true;
-	private boolean applicableToRelation = true;
-	
-	/**
-	 * constructor 
-	 */
-	public LableSpecification() {
-	}
+    /** the key of the tag */
+    private String value;
+        
+    
+    private boolean applicableToNode = true;
+    private boolean applicableToWay = true;
+    private boolean applicableToRelation = true;
+    
+    /**
+     * constructor 
+     */
+    public LableSpecification() {
+    }
 
-	public boolean isApplicable(AutoCompletionContext context) {
-		boolean ret = false;
-		if (context.isSelectionEmpty()) {
-			ret = true;
-		} else {
-			ret = ret || (applicableToNode && context.isSelectionIncludesNodes());
-			ret = ret || (applicableToWay && context.isSelectionIncludesWays());
-			ret = ret || (applicableToRelation && context.isSelectionIncludesRelations());
-		}
-		return ret;
-	}
+    public boolean isApplicable(AutoCompletionContext context) {
+        boolean ret = false;
+        if (context.isSelectionEmpty()) {
+            ret = true;
+        } else {
+            ret = ret || (applicableToNode && context.isSelectionIncludesNodes());
+            ret = ret || (applicableToWay && context.isSelectionIncludesWays());
+            ret = ret || (applicableToRelation && context.isSelectionIncludesRelations());
+        }
+        return ret;
+    }
 
-	/* --------------------------------------------------------------------------- */
-	/* setters/getters                                                             */
-	/* --------------------------------------------------------------------------- */
+    /* --------------------------------------------------------------------------- */
+    /* setters/getters                                                             */
+    /* --------------------------------------------------------------------------- */
 
-	public String getValue() {
-		return value;
-	}
+    public String getValue() {
+        return value;
+    }
 
-	public void setValue(String value) {
-		this.value = value;
-	}
+    public void setValue(String value) {
+        this.value = value;
+    }
 
-	public boolean isApplicableToNode() {
-		return applicableToNode;
-	}
+    public boolean isApplicableToNode() {
+        return applicableToNode;
+    }
 
-	public void setApplicableToNode(boolean applicableToNode) {
-		this.applicableToNode = applicableToNode;
-	}
+    public void setApplicableToNode(boolean applicableToNode) {
+        this.applicableToNode = applicableToNode;
+    }
 
-	public boolean isApplicableToWay() {
-		return applicableToWay;
-	}
+    public boolean isApplicableToWay() {
+        return applicableToWay;
+    }
 
-	public void setApplicableToWay(boolean applicableToWay) {
-		this.applicableToWay = applicableToWay;
-	}
+    public void setApplicableToWay(boolean applicableToWay) {
+        this.applicableToWay = applicableToWay;
+    }
 
-	public boolean isApplicableToRelation() {
-		return applicableToRelation;
-	}
+    public boolean isApplicableToRelation() {
+        return applicableToRelation;
+    }
 
-	public void setApplicableToRelation(boolean applicableToRelation) {
-		this.applicableToRelation = applicableToRelation;
-	}
-	
+    public void setApplicableToRelation(boolean applicableToRelation) {
+        this.applicableToRelation = applicableToRelation;
+    }
+    
 
-	
-	
+    
+    
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecification.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecification.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecification.java	(revision 23189)
@@ -10,5 +10,5 @@
  * elements:
  * <ul>
- * 	 <li>the <strong>key</strong> the of the tag</li>
+ *   <li>the <strong>key</strong> the of the tag</li>
  *   <li>the <strong>type</strong> of the tag</li>
  *   <li>whether the tag is applicable to a node, a way or a relation</li>
@@ -19,121 +19,121 @@
 public class TagSpecification {
 
-	/** the key of the tag */
-	private String key;
+    /** the key of the tag */
+    private String key;
 
-	/** the type of the tag */
-	private String type;
+    /** the type of the tag */
+    private String type;
 
-	/** the type of the tag */
+    /** the type of the tag */
 
-	private boolean applicableToNode = true;
-	private boolean applicableToWay = true;
-	private boolean applicableToRelation = true;
+    private boolean applicableToNode = true;
+    private boolean applicableToWay = true;
+    private boolean applicableToRelation = true;
 
-	private ArrayList<LableSpecification> lables = null;
+    private ArrayList<LableSpecification> lables = null;
 
 
-	/**
-	 * constructor
-	 */
-	public TagSpecification() {
-		lables = new ArrayList<LableSpecification>();
-	}
+    /**
+     * constructor
+     */
+    public TagSpecification() {
+        lables = new ArrayList<LableSpecification>();
+    }
 
-	@Override
-	public String toString() {
-		StringBuilder builder = new StringBuilder();
-		builder.append("<TagSpecification ");
-		builder.append("key=\"").append(key).append("\"").append(", ");
-		builder.append("type=\"").append(type).append("\"").append(", ");
-		builder.append("applicable-to-node=\"").append(applicableToNode).append("\"").append(", ");
-		builder.append("applicable-to-way=\"").append(applicableToWay).append("\"").append(", ");
-		builder.append("applicable-to-relation=\"").append(applicableToRelation).append("\"");
-		builder.append(" />");
-		return builder.toString();
-	}
+    @Override
+    public String toString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("<TagSpecification ");
+        builder.append("key=\"").append(key).append("\"").append(", ");
+        builder.append("type=\"").append(type).append("\"").append(", ");
+        builder.append("applicable-to-node=\"").append(applicableToNode).append("\"").append(", ");
+        builder.append("applicable-to-way=\"").append(applicableToWay).append("\"").append(", ");
+        builder.append("applicable-to-relation=\"").append(applicableToRelation).append("\"");
+        builder.append(" />");
+        return builder.toString();
+    }
 
-	/**
-	 * @return th e list of predefined labels for this tag; an empty list if no
-	 *   labels are defined
-	 */
-	public List<LableSpecification> getLables() {
-		return lables;
-	}
+    /**
+     * @return th e list of predefined labels for this tag; an empty list if no
+     *   labels are defined
+     */
+    public List<LableSpecification> getLables() {
+        return lables;
+    }
 
-	/**
-	 * sets the list of lables for this tag specification
-	 * 
-	 * @param lables  the list of lables; must not be null
-	 * @exception IllegalArgumentException thrown, if lables is null
-	 */
-	public void setLables(List<LableSpecification> lables) throws IllegalArgumentException {
-		if (lables == null)
-			throw new IllegalArgumentException("argument 'lables' must not be null");
-		this.lables.clear();
-		for (LableSpecification l : lables) {
-			this.lables.add(l);
-		}
-	}
+    /**
+     * sets the list of lables for this tag specification
+     * 
+     * @param lables  the list of lables; must not be null
+     * @exception IllegalArgumentException thrown, if lables is null
+     */
+    public void setLables(List<LableSpecification> lables) throws IllegalArgumentException {
+        if (lables == null)
+            throw new IllegalArgumentException("argument 'lables' must not be null");
+        this.lables.clear();
+        for (LableSpecification l : lables) {
+            this.lables.add(l);
+        }
+    }
 
-	/**
-	 * Adds a label to the list of label for this tag specification. The label
-	 * is only added if i
-	 * 
-	 * @param lable the lalbe to add; must not be null
-	 * @exception IllegalArgumentException thrown, if lable is null
-	 */
-	public void addLable(LableSpecification lable) throws IllegalArgumentException  {
-		if (lable == null)
-			throw new IllegalArgumentException("argument 'lable' must not be null");
-		if (!this.lables.contains(lable)) {
-			this.lables.add(lable);
-		}
-	}
+    /**
+     * Adds a label to the list of label for this tag specification. The label
+     * is only added if i
+     * 
+     * @param lable the lalbe to add; must not be null
+     * @exception IllegalArgumentException thrown, if lable is null
+     */
+    public void addLable(LableSpecification lable) throws IllegalArgumentException  {
+        if (lable == null)
+            throw new IllegalArgumentException("argument 'lable' must not be null");
+        if (!this.lables.contains(lable)) {
+            this.lables.add(lable);
+        }
+    }
 
-	public boolean isApplicable(AutoCompletionContext context) {
-		boolean ret = false;
-		if (context.isSelectionEmpty()) {
-			ret = true;
-		} else {
-			ret = ret || (applicableToNode && context.isSelectionIncludesNodes());
-			ret = ret || (applicableToWay && context.isSelectionIncludesWays());
-			ret = ret || (applicableToRelation && context.isSelectionIncludesRelations());
-		}
-		return ret;
-	}
+    public boolean isApplicable(AutoCompletionContext context) {
+        boolean ret = false;
+        if (context.isSelectionEmpty()) {
+            ret = true;
+        } else {
+            ret = ret || (applicableToNode && context.isSelectionIncludesNodes());
+            ret = ret || (applicableToWay && context.isSelectionIncludesWays());
+            ret = ret || (applicableToRelation && context.isSelectionIncludesRelations());
+        }
+        return ret;
+    }
 
-	/* --------------------------------------------------------------------------- */
-	/* setters/getters                                                             */
-	/* --------------------------------------------------------------------------- */
-	public String getKey() {
-		return key;
-	}
-	public void setKey(String key) {
-		this.key = key;
-	}
-	public String getType() {
-		return type;
-	}
-	public void setType(String type) {
-		this.type = type;
-	}
-	public boolean isApplicableToNode() {
-		return applicableToNode;
-	}
-	public void setApplicableToNode(boolean applicableToNode) {
-		this.applicableToNode = applicableToNode;
-	}
-	public boolean isApplicableToWay() {
-		return applicableToWay;
-	}
-	public void setApplicableToWay(boolean applicableToWay) {
-		this.applicableToWay = applicableToWay;
-	}
-	public boolean isApplicableToRelation() {
-		return applicableToRelation;
-	}
-	public void setApplicableToRelation(boolean applicableToRelation) {
-		this.applicableToRelation = applicableToRelation;
-	}
+    /* --------------------------------------------------------------------------- */
+    /* setters/getters                                                             */
+    /* --------------------------------------------------------------------------- */
+    public String getKey() {
+        return key;
+    }
+    public void setKey(String key) {
+        this.key = key;
+    }
+    public String getType() {
+        return type;
+    }
+    public void setType(String type) {
+        this.type = type;
+    }
+    public boolean isApplicableToNode() {
+        return applicableToNode;
+    }
+    public void setApplicableToNode(boolean applicableToNode) {
+        this.applicableToNode = applicableToNode;
+    }
+    public boolean isApplicableToWay() {
+        return applicableToWay;
+    }
+    public void setApplicableToWay(boolean applicableToWay) {
+        this.applicableToWay = applicableToWay;
+    }
+    public boolean isApplicableToRelation() {
+        return applicableToRelation;
+    }
+    public void setApplicableToRelation(boolean applicableToRelation) {
+        this.applicableToRelation = applicableToRelation;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecifications.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecifications.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/TagSpecifications.java	(revision 23189)
@@ -35,343 +35,343 @@
 public class TagSpecifications {
 
-	final static public String ATTR_KEY = "key";
-	final static public String ATTR_TYPE = "type";
-	final static public String ATTR_FOR_NODE = "for-node";
-	final static public String ATTR_FOR_WAY = "for-way";
-	final static public String ATTR_FOR_RELATION = "for-relation";
-	final static public String ATTR_VALUE = "value";
-
-	final static public String ELEM_ROOT = "osm-tag-definitions";
-	final static public String ELEM_TAG = "tag";
-	final static public String ELEM_LABEL = "label";
-
-	final static public String DTD = "osm-tag-definitions.dtd";
-
-
-	/** the default name of the resource file with the  tag specifications */
-	static public final String RES_NAME_TAG_SPECIFICATIONS = "/resources/osm-tag-definitions.xml";
-
-	/** the logger object */
-	private static Logger logger = Logger.getLogger(TagSpecification.class.getName());
-
-	/** list of tag specifications managed list */
-	private ArrayList<TagSpecification> tagSpecifications = null;
-
-	private static TagSpecifications instance = null;
-
-	/**
-	 * loads the the tag specifications from the resource file given by
-	 * {@link #RES_NAME_TAG_SPECIFICATIONS}.
-	 * 
-	 * @return the list of {@link TagSpecification}s
-	 * @throws Exception thrown, if an exception occurs
-	 */
-	static public void loadFromResources() throws Exception  {
-		InputStream in = TagSpecifications.class.getResourceAsStream(RES_NAME_TAG_SPECIFICATIONS);
-		if (in == null) {
-			logger.log(Level.SEVERE, "failed to create input stream for resource '" + RES_NAME_TAG_SPECIFICATIONS + "'");
-		}
-		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
-		TagSpecifications spec = new TagSpecifications();
-		spec.load(reader);
-		reader.close();
-		instance = spec;
-
-	}
-
-	static public TagSpecifications getInstance() throws Exception {
-		if (instance == null) {
-			loadFromResources();
-		}
-		return instance;
-	}
-
-	/**
-	 * constructor
-	 */
-	public TagSpecifications() {
-		tagSpecifications = new ArrayList<TagSpecification>();
-	}
-
-
-	/**
-	 * loads the tag specifications from a specific reader
-	 * 
-	 * @param in  the reader to read from
-	 * @throws Exception thrown, if an exception occurs
-	 */
-	public void load(Reader in) throws Exception {
-		XMLReader parser;
-
-		try {
-			parser = XMLReaderFactory.createXMLReader();
-			Handler handler = new Handler();
-			parser.setContentHandler(handler);
-			parser.setErrorHandler(handler);
-			parser.setEntityResolver(new ResourceEntityResolver());
-			parser.setFeature( "http://xml.org/sax/features/validation", true);
-			parser.setFeature("http://xml.org/sax/features/namespaces", true);
-			parser.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
-			parser.parse(new InputSource(in));
-
-		} catch (Exception e) {
-			logger.log(Level.SEVERE, "failed to load tag specificatoin file", e);
-			throw e;
-		} finally {
-			parser = null;
-		}
-	}
-
-	public List<AutoCompletionListItem> getKeysForAutoCompletion(AutoCompletionContext context) {
-		ArrayList<AutoCompletionListItem> keys = new ArrayList<AutoCompletionListItem>();
-		for (TagSpecification spec : tagSpecifications) {
-			if (!spec.isApplicable(context)) {
-				continue;
-			}
-			AutoCompletionListItem item = new AutoCompletionListItem();
-			item.setValue(spec.getKey());
-			item.setPriority(AutoCompletionItemPritority.IS_IN_STANDARD);
-			keys.add(item);
-		}
-		return keys;
-	}
-
-	public List<AutoCompletionListItem> getLabelsForAutoCompletion(String forKey, AutoCompletionContext context) {
-		ArrayList<AutoCompletionListItem> items = new ArrayList<AutoCompletionListItem>();
-		for (TagSpecification spec : tagSpecifications) {
-			if (spec.getKey().equals(forKey)) {
-				List<LableSpecification> lables = spec.getLables();
-				for (LableSpecification l : lables) {
-					if (!l.isApplicable(context)) {
-						continue;
-					}
-					AutoCompletionListItem item = new AutoCompletionListItem();
-					item.setValue(l.getValue());
-					item.setPriority(AutoCompletionItemPritority.IS_IN_STANDARD);
-					items.add(item);
-				}
-			}
-		}
-		return items;
-	}
-	
-	/**
-	 * replies a list of {@see KeyValuePair}s for all {@see TagSpecification}s and
-	 * {@see LableSpecification}s.
-	 * 
-	 * @return the list
-	 */
-	public ArrayList<KeyValuePair> asList() {
-		ArrayList<KeyValuePair> entries = new ArrayList<KeyValuePair>();
-
-		for (TagSpecification s : tagSpecifications) {
-			for (LableSpecification l : s.getLables()) {
-				entries.add(new KeyValuePair(s.getKey(), l.getValue()));
-			}
-		}
-		return entries;
-	}
-
-
-
-	/**
-	 * The SAX handler for reading XML files with tag specifications
-	 * 
-	 * @author gubaer
-	 *
-	 */
-	class Handler extends DefaultHandler {
-
-		/**  the current tag specification. Not null, while parsing the content
-		 * between &lt;tag&gt; ... &lt;/tag&gt;
-		 */
-		private TagSpecification currentTagSpecification  = null;
-
-
-		@Override
-		public void endDocument() throws SAXException {
-			logger.log(Level.FINE,"END");
-		}
-
-
-
-		@Override
-		public void error(SAXParseException e) throws SAXException {
-			logger.log(Level.SEVERE, "XML parsing error", e);
-		}
-
-		@Override
-		public void fatalError(SAXParseException e) throws SAXException {
-			logger.log(Level.SEVERE, "XML parsing error", e);
-		}
-
-		@Override
-		public void startDocument() throws SAXException {
-			logger.log(Level.FINE,"START");
-		}
-
-
-		/**
-		 * parses a string value consisting of 'yes' or 'no' (exactly, case
-		 * sensitive)
-		 * 
-		 * @param value the string value
-		 * @return true, if value is <code>yes</code>; false, if value is <code>no</code>
-		 * @throws SAXException thrown, if value is neither <code>yes</code> nor <code>no</code>
-		 */
-		protected boolean parseYesNo(String value) throws SAXException {
-			if ("yes".equals(value))
-				return true;
-			else if ("no".equals(value))
-				return false;
-			else
-				throw new SAXException("expected 'yes' or 'no' as attribute value, got '" + value + "'");
-		}
-
-		/**
-		 * handles a start element with name <code>osm-tag-definitions</code>
-		 * 
-		 * @param atts  the XML attributes
-		 * @throws SAXException
-		 */
-		protected void startElementOsmTagDefinitions(Attributes atts) throws SAXException {
-			tagSpecifications = new ArrayList<TagSpecification>();
-		}
-
-		/**
-		 * handles an end element with name <code>osm-tag-specifications</code>
-		 * 
-		 * @throws SAXException
-		 */
-		protected void endElementOsmTagDefinitions() throws SAXException {
-			// do nothing
-		}
-
-		/**
-		 * handles a start element with name <code>tag</code>
-		 * 
-		 * @param atts the XML attributes of the element
-		 * @throws SAXException
-		 */
-		protected void startElementTag(Attributes atts) throws SAXException {
-			currentTagSpecification = new TagSpecification();
-			for (int i=0; i< atts.getLength(); i++) {
-				String name = atts.getQName(i);
-				String value = atts.getValue(i);
-
-				if (ATTR_KEY.equals(name)) {
-					currentTagSpecification.setKey(value);
-				} else if (ATTR_TYPE.equals(name)) {
-					currentTagSpecification.setType(value);
-				} else if (ATTR_FOR_NODE.equals(name)) {
-					currentTagSpecification.setApplicableToNode(parseYesNo(value));
-				} else if (ATTR_FOR_WAY.equals(name)) {
-					currentTagSpecification.setApplicableToWay(parseYesNo(value));
-				} else if (ATTR_FOR_RELATION.equals(name)) {
-					currentTagSpecification.setApplicableToRelation(parseYesNo(value));
-				} else
-					throw new SAXException("unknown attribut '" + name + "' on element 'tag'");
-			}
-		}
-
-
-		/**
-		 * handles an end element with name <code>tag</code>
-		 * @throws SAXException
-		 */
-		protected void endElementTag() throws SAXException {
-			tagSpecifications.add(currentTagSpecification);
-			currentTagSpecification = null;
-
-		}
-
-		/**
-		 * handles a start element with name <code>label</code>
-		 * 
-		 * @param atts the XML attributes
-		 * @throws SAXException
-		 */
-		protected void startElementLabel(Attributes atts) throws SAXException {
-			LableSpecification ls = new LableSpecification();
-			for (int i=0; i< atts.getLength(); i++) {
-				String name = atts.getQName(i);
-				String value = atts.getValue(i);
-
-				if (ATTR_VALUE.equals(name)) {
-					ls.setValue(value);
-				} else if (ATTR_FOR_NODE.equals(name)) {
-					ls.setApplicableToNode(parseYesNo(value));
-				} else if (ATTR_FOR_WAY.equals(name)) {
-					ls.setApplicableToWay(parseYesNo(value));
-				} else if (ATTR_FOR_RELATION.equals(name)) {
-					ls.setApplicableToRelation(parseYesNo(value));
-				} else
-					throw new SAXException("unknown attribut '" + name + "' on element 'lable'");
-			}
-			currentTagSpecification.addLable(ls);
-		}
-
-		/**
-		 * handles an end element with name <code>label</code>
-		 * 
-		 * @throws SAXException
-		 */
-		protected void endElementLabel() throws SAXException {
-			// do nothing
-		}
-
-		@Override
-		public void startElement(String namespaceURI, String localName, String qName,
-				Attributes atts) throws SAXException {
-			if (ELEM_ROOT.equals(qName)) {
-				startElementOsmTagDefinitions(atts);
-			} else if (ELEM_TAG.equals(qName)) {
-				startElementTag(atts);
-			} else if (ELEM_LABEL.equals(qName)) {
-				startElementLabel(atts);
-			} else
-				throw new SAXException("unknown element '" + qName + "'");
-		}
-
-		@Override
-		public void endElement(String namespaceURI, String localName, String qName)
-		throws SAXException {
-			if (ELEM_ROOT.equals(qName)) {
-				endElementOsmTagDefinitions();
-			} else if (ELEM_TAG.equals(qName)) {
-				endElementTag();
-			} else if (ELEM_LABEL.equals(qName)) {
-				endElementLabel();
-			} else
-				throw new SAXException("unknown element '" + qName + "'");
-		}
-
-		@Override
-		public void warning(SAXParseException e) throws SAXException {
-			// TODO Auto-generated method stub
-			logger.log(Level.WARNING, "XML parsing warning", e);
-		}
-	}
-
-	/**
-	 *
-	 *
-	 */
-	class ResourceEntityResolver implements EntityResolver {
-
-		public InputSource resolveEntity(String publicId, String systemId)
-		throws SAXException, IOException {
-			if (systemId != null && systemId.endsWith(DTD))
-				return new InputSource(
-						TagSpecifications.class.getResourceAsStream(DTD)
-				);
-			else
-				throw new SAXException("couldn't load external DTD '" + systemId + "'");
-		}
-
-	}
-
-	static public void main(String args[]) throws Exception{
-		TagSpecifications.loadFromResources();
-	}
+    final static public String ATTR_KEY = "key";
+    final static public String ATTR_TYPE = "type";
+    final static public String ATTR_FOR_NODE = "for-node";
+    final static public String ATTR_FOR_WAY = "for-way";
+    final static public String ATTR_FOR_RELATION = "for-relation";
+    final static public String ATTR_VALUE = "value";
+
+    final static public String ELEM_ROOT = "osm-tag-definitions";
+    final static public String ELEM_TAG = "tag";
+    final static public String ELEM_LABEL = "label";
+
+    final static public String DTD = "osm-tag-definitions.dtd";
+
+
+    /** the default name of the resource file with the  tag specifications */
+    static public final String RES_NAME_TAG_SPECIFICATIONS = "/resources/osm-tag-definitions.xml";
+
+    /** the logger object */
+    private static Logger logger = Logger.getLogger(TagSpecification.class.getName());
+
+    /** list of tag specifications managed list */
+    private ArrayList<TagSpecification> tagSpecifications = null;
+
+    private static TagSpecifications instance = null;
+
+    /**
+     * loads the the tag specifications from the resource file given by
+     * {@link #RES_NAME_TAG_SPECIFICATIONS}.
+     * 
+     * @return the list of {@link TagSpecification}s
+     * @throws Exception thrown, if an exception occurs
+     */
+    static public void loadFromResources() throws Exception  {
+        InputStream in = TagSpecifications.class.getResourceAsStream(RES_NAME_TAG_SPECIFICATIONS);
+        if (in == null) {
+            logger.log(Level.SEVERE, "failed to create input stream for resource '" + RES_NAME_TAG_SPECIFICATIONS + "'");
+        }
+        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
+        TagSpecifications spec = new TagSpecifications();
+        spec.load(reader);
+        reader.close();
+        instance = spec;
+
+    }
+
+    static public TagSpecifications getInstance() throws Exception {
+        if (instance == null) {
+            loadFromResources();
+        }
+        return instance;
+    }
+
+    /**
+     * constructor
+     */
+    public TagSpecifications() {
+        tagSpecifications = new ArrayList<TagSpecification>();
+    }
+
+
+    /**
+     * loads the tag specifications from a specific reader
+     * 
+     * @param in  the reader to read from
+     * @throws Exception thrown, if an exception occurs
+     */
+    public void load(Reader in) throws Exception {
+        XMLReader parser;
+
+        try {
+            parser = XMLReaderFactory.createXMLReader();
+            Handler handler = new Handler();
+            parser.setContentHandler(handler);
+            parser.setErrorHandler(handler);
+            parser.setEntityResolver(new ResourceEntityResolver());
+            parser.setFeature( "http://xml.org/sax/features/validation", true);
+            parser.setFeature("http://xml.org/sax/features/namespaces", true);
+            parser.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
+            parser.parse(new InputSource(in));
+
+        } catch (Exception e) {
+            logger.log(Level.SEVERE, "failed to load tag specificatoin file", e);
+            throw e;
+        } finally {
+            parser = null;
+        }
+    }
+
+    public List<AutoCompletionListItem> getKeysForAutoCompletion(AutoCompletionContext context) {
+        ArrayList<AutoCompletionListItem> keys = new ArrayList<AutoCompletionListItem>();
+        for (TagSpecification spec : tagSpecifications) {
+            if (!spec.isApplicable(context)) {
+                continue;
+            }
+            AutoCompletionListItem item = new AutoCompletionListItem();
+            item.setValue(spec.getKey());
+            item.setPriority(AutoCompletionItemPritority.IS_IN_STANDARD);
+            keys.add(item);
+        }
+        return keys;
+    }
+
+    public List<AutoCompletionListItem> getLabelsForAutoCompletion(String forKey, AutoCompletionContext context) {
+        ArrayList<AutoCompletionListItem> items = new ArrayList<AutoCompletionListItem>();
+        for (TagSpecification spec : tagSpecifications) {
+            if (spec.getKey().equals(forKey)) {
+                List<LableSpecification> lables = spec.getLables();
+                for (LableSpecification l : lables) {
+                    if (!l.isApplicable(context)) {
+                        continue;
+                    }
+                    AutoCompletionListItem item = new AutoCompletionListItem();
+                    item.setValue(l.getValue());
+                    item.setPriority(AutoCompletionItemPritority.IS_IN_STANDARD);
+                    items.add(item);
+                }
+            }
+        }
+        return items;
+    }
+    
+    /**
+     * replies a list of {@see KeyValuePair}s for all {@see TagSpecification}s and
+     * {@see LableSpecification}s.
+     * 
+     * @return the list
+     */
+    public ArrayList<KeyValuePair> asList() {
+        ArrayList<KeyValuePair> entries = new ArrayList<KeyValuePair>();
+
+        for (TagSpecification s : tagSpecifications) {
+            for (LableSpecification l : s.getLables()) {
+                entries.add(new KeyValuePair(s.getKey(), l.getValue()));
+            }
+        }
+        return entries;
+    }
+
+
+
+    /**
+     * The SAX handler for reading XML files with tag specifications
+     * 
+     * @author gubaer
+     *
+     */
+    class Handler extends DefaultHandler {
+
+        /**  the current tag specification. Not null, while parsing the content
+         * between &lt;tag&gt; ... &lt;/tag&gt;
+         */
+        private TagSpecification currentTagSpecification  = null;
+
+
+        @Override
+        public void endDocument() throws SAXException {
+            logger.log(Level.FINE,"END");
+        }
+
+
+
+        @Override
+        public void error(SAXParseException e) throws SAXException {
+            logger.log(Level.SEVERE, "XML parsing error", e);
+        }
+
+        @Override
+        public void fatalError(SAXParseException e) throws SAXException {
+            logger.log(Level.SEVERE, "XML parsing error", e);
+        }
+
+        @Override
+        public void startDocument() throws SAXException {
+            logger.log(Level.FINE,"START");
+        }
+
+
+        /**
+         * parses a string value consisting of 'yes' or 'no' (exactly, case
+         * sensitive)
+         * 
+         * @param value the string value
+         * @return true, if value is <code>yes</code>; false, if value is <code>no</code>
+         * @throws SAXException thrown, if value is neither <code>yes</code> nor <code>no</code>
+         */
+        protected boolean parseYesNo(String value) throws SAXException {
+            if ("yes".equals(value))
+                return true;
+            else if ("no".equals(value))
+                return false;
+            else
+                throw new SAXException("expected 'yes' or 'no' as attribute value, got '" + value + "'");
+        }
+
+        /**
+         * handles a start element with name <code>osm-tag-definitions</code>
+         * 
+         * @param atts  the XML attributes
+         * @throws SAXException
+         */
+        protected void startElementOsmTagDefinitions(Attributes atts) throws SAXException {
+            tagSpecifications = new ArrayList<TagSpecification>();
+        }
+
+        /**
+         * handles an end element with name <code>osm-tag-specifications</code>
+         * 
+         * @throws SAXException
+         */
+        protected void endElementOsmTagDefinitions() throws SAXException {
+            // do nothing
+        }
+
+        /**
+         * handles a start element with name <code>tag</code>
+         * 
+         * @param atts the XML attributes of the element
+         * @throws SAXException
+         */
+        protected void startElementTag(Attributes atts) throws SAXException {
+            currentTagSpecification = new TagSpecification();
+            for (int i=0; i< atts.getLength(); i++) {
+                String name = atts.getQName(i);
+                String value = atts.getValue(i);
+
+                if (ATTR_KEY.equals(name)) {
+                    currentTagSpecification.setKey(value);
+                } else if (ATTR_TYPE.equals(name)) {
+                    currentTagSpecification.setType(value);
+                } else if (ATTR_FOR_NODE.equals(name)) {
+                    currentTagSpecification.setApplicableToNode(parseYesNo(value));
+                } else if (ATTR_FOR_WAY.equals(name)) {
+                    currentTagSpecification.setApplicableToWay(parseYesNo(value));
+                } else if (ATTR_FOR_RELATION.equals(name)) {
+                    currentTagSpecification.setApplicableToRelation(parseYesNo(value));
+                } else
+                    throw new SAXException("unknown attribut '" + name + "' on element 'tag'");
+            }
+        }
+
+
+        /**
+         * handles an end element with name <code>tag</code>
+         * @throws SAXException
+         */
+        protected void endElementTag() throws SAXException {
+            tagSpecifications.add(currentTagSpecification);
+            currentTagSpecification = null;
+
+        }
+
+        /**
+         * handles a start element with name <code>label</code>
+         * 
+         * @param atts the XML attributes
+         * @throws SAXException
+         */
+        protected void startElementLabel(Attributes atts) throws SAXException {
+            LableSpecification ls = new LableSpecification();
+            for (int i=0; i< atts.getLength(); i++) {
+                String name = atts.getQName(i);
+                String value = atts.getValue(i);
+
+                if (ATTR_VALUE.equals(name)) {
+                    ls.setValue(value);
+                } else if (ATTR_FOR_NODE.equals(name)) {
+                    ls.setApplicableToNode(parseYesNo(value));
+                } else if (ATTR_FOR_WAY.equals(name)) {
+                    ls.setApplicableToWay(parseYesNo(value));
+                } else if (ATTR_FOR_RELATION.equals(name)) {
+                    ls.setApplicableToRelation(parseYesNo(value));
+                } else
+                    throw new SAXException("unknown attribut '" + name + "' on element 'lable'");
+            }
+            currentTagSpecification.addLable(ls);
+        }
+
+        /**
+         * handles an end element with name <code>label</code>
+         * 
+         * @throws SAXException
+         */
+        protected void endElementLabel() throws SAXException {
+            // do nothing
+        }
+
+        @Override
+        public void startElement(String namespaceURI, String localName, String qName,
+                Attributes atts) throws SAXException {
+            if (ELEM_ROOT.equals(qName)) {
+                startElementOsmTagDefinitions(atts);
+            } else if (ELEM_TAG.equals(qName)) {
+                startElementTag(atts);
+            } else if (ELEM_LABEL.equals(qName)) {
+                startElementLabel(atts);
+            } else
+                throw new SAXException("unknown element '" + qName + "'");
+        }
+
+        @Override
+        public void endElement(String namespaceURI, String localName, String qName)
+        throws SAXException {
+            if (ELEM_ROOT.equals(qName)) {
+                endElementOsmTagDefinitions();
+            } else if (ELEM_TAG.equals(qName)) {
+                endElementTag();
+            } else if (ELEM_LABEL.equals(qName)) {
+                endElementLabel();
+            } else
+                throw new SAXException("unknown element '" + qName + "'");
+        }
+
+        @Override
+        public void warning(SAXParseException e) throws SAXException {
+            // TODO Auto-generated method stub
+            logger.log(Level.WARNING, "XML parsing warning", e);
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    class ResourceEntityResolver implements EntityResolver {
+
+        public InputSource resolveEntity(String publicId, String systemId)
+        throws SAXException, IOException {
+            if (systemId != null && systemId.endsWith(DTD))
+                return new InputSource(
+                        TagSpecifications.class.getResourceAsStream(DTD)
+                );
+            else
+                throw new SAXException("couldn't load external DTD '" + systemId + "'");
+        }
+
+    }
+
+    static public void main(String args[]) throws Exception{
+        TagSpecifications.loadFromResources();
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/ITagSelectorListener.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/ITagSelectorListener.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/ITagSelectorListener.java	(revision 23189)
@@ -4,4 +4,4 @@
 
 public interface ITagSelectorListener {
-	public void itemSelected(KeyValuePair pair);
+    public void itemSelected(KeyValuePair pair);
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/KeyValueCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/KeyValueCellRenderer.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/KeyValueCellRenderer.java	(revision 23189)
@@ -12,28 +12,28 @@
 public class KeyValueCellRenderer extends JLabel implements TableCellRenderer  {
 
-	private static final Logger logger = Logger.getLogger(KeyValueCellRenderer.class.getName());
+    private static final Logger logger = Logger.getLogger(KeyValueCellRenderer.class.getName());
 
-	protected void init() {
-		setFont(new Font("Courier",Font.PLAIN,getFont().getSize()));
-		setOpaque(true);
-	}
+    protected void init() {
+        setFont(new Font("Courier",Font.PLAIN,getFont().getSize()));
+        setOpaque(true);
+    }
 
-	public KeyValueCellRenderer() {
-		init();
-	}
+    public KeyValueCellRenderer() {
+        init();
+    }
 
-	public Component getTableCellRendererComponent(JTable table, Object value,
-			boolean isSelected, boolean hasFocus, int rowIndex, int colIndex) {
+    public Component getTableCellRendererComponent(JTable table, Object value,
+            boolean isSelected, boolean hasFocus, int rowIndex, int colIndex) {
 
-		if (isSelected) {
-			setBackground(UIManager.getColor("Table.selectionBackground"));
-			setForeground(UIManager.getColor("Table.selectionForeground"));
-		} else  {
-			setBackground(UIManager.getColor("Table.background"));
-			setForeground(UIManager.getColor("Table.foreground"));
-		}
-		setText((String)value);
-		setIcon(null);
-		return this;
-	}
+        if (isSelected) {
+            setBackground(UIManager.getColor("Table.selectionBackground"));
+            setForeground(UIManager.getColor("Table.selectionForeground"));
+        } else  {
+            setBackground(UIManager.getColor("Table.background"));
+            setForeground(UIManager.getColor("Table.foreground"));
+        }
+        setText((String)value);
+        setIcon(null);
+        return this;
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TabularTagSelector.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TabularTagSelector.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TabularTagSelector.java	(revision 23189)
@@ -33,229 +33,229 @@
 public class TabularTagSelector extends JPanel {
 
-	private TagsTable tagsTable;
-	private JTextField tfFilter;
-	private JButton btnApply;
-	private JScrollPane scrollPane;
-	private final ArrayList<ITagSelectorListener> listeners = new ArrayList<ITagSelectorListener>();
-
-	protected JPanel buildFilterPanel() {
-		JPanel pnl = new JPanel();
-		JLabel lbl = new JLabel(tr("Search: "));
-		pnl.setLayout(new FlowLayout(FlowLayout.LEFT));
-		tfFilter = new JTextField(20);
-		pnl.add(lbl);
-		pnl.add(tfFilter,BorderLayout.CENTER);
-		JButton btn = new JButton(tr("Filter"));
-		pnl.add(btn);
-		btn.addActionListener(
-				new ActionListener() {
-					public void actionPerformed(ActionEvent e) {
-						filter(tfFilter.getText());
-					}
-
-				}
-		);
-		btn = new JButton(tr("Clear"));
-		pnl.add(btn);
-		btn.addActionListener(
-				new ActionListener() {
-					public void actionPerformed(ActionEvent e) {
-						tfFilter.setText("");
-						tfFilter.requestFocus();
-					}
-				}
-		);
-		return pnl;
-	}
-
-	protected JScrollPane buildPresetGrid() {
-
-		tagsTable = new TagsTable(new TagsTableModel(),new TagsTableColumnModel());
-		getModel().initFromTagSpecifications();
-
-		scrollPane = new JScrollPane(tagsTable);
-
-		scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-		scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
-
-		// this adapters ensures that the width of the tag table columns is adjusted
-		// to the width of the scroll pane viewport. Also tried to overwrite
-		// getPreferredViewportSize() in JTable, but did not work.
-		//
-		scrollPane.addComponentListener(
-				new ComponentAdapter() {
-					@Override public void componentResized(ComponentEvent e) {
-						super.componentResized(e);
-						Dimension d = scrollPane.getViewport().getExtentSize();
-						tagsTable.adjustColumnWidth(d.width);
-					}
-				}
-		);
-
-		// add the double click listener
-		//
-		tagsTable.addMouseListener(new DoubleClickAdapter());
-
-		// replace Enter action. apply the current preset on enter
-		//
-		tagsTable.unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0));
-		ActionListener enterAction = new ActionListener() {
-			public void actionPerformed(ActionEvent e) {
-				int rowNum = tagsTable.getSelectedRow();
-				if (rowNum >= 0) {
-					KeyValuePair item = getModel().getVisibleItem(rowNum);
-					fireItemSelected(item);
-				}
-			}
-		};
-
-		tagsTable.registerKeyboardAction(
-				enterAction,
-				"Enter",
-				KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0),
-				JComponent.WHEN_FOCUSED
-		);
-
-		return scrollPane;
-	}
-
-	protected JPanel buildControlButtonPanel() {
-		JPanel pnl = new JPanel();
-		pnl.setLayout(new FlowLayout(FlowLayout.LEFT));
-		btnApply = new JButton("Apply");
-		pnl.add(btnApply);
-		btnApply.addActionListener(
-				new ActionListener() {
-					public void actionPerformed(ActionEvent arg0) {
-						int row = tagsTable.getSelectedRow();
-						if (row >=0) {
-							KeyValuePair item = getModel().getVisibleItem(row);
-							fireItemSelected(item);
-						}
-					}
-				}
-		);
-		return pnl;
-	}
-
-	protected void build() {
-		setLayout(new BorderLayout());
-		add(buildFilterPanel(), BorderLayout.NORTH);
-		add(buildPresetGrid(), BorderLayout.CENTER);
-		add(buildControlButtonPanel(), BorderLayout.SOUTH);
-
-		// wire the text field for filter expressions to the prests
-		// table
-		//
-		tfFilter.getDocument().addDocumentListener(
-				new DocumentListener() {
-					public void changedUpdate(DocumentEvent arg0) {
-						onUpdate();
-					}
-
-					public void insertUpdate(DocumentEvent arg0) {
-						onUpdate();
-					}
-
-					public void removeUpdate(DocumentEvent arg0) {
-						onUpdate();
-					}
-
-					protected void onUpdate() {
-						filter(tfFilter.getText());
-					}
-				}
-		);
-
-		tfFilter.addActionListener(
-				new ActionListener() {
-					public void actionPerformed(ActionEvent e) {
-						filter(tfFilter.getText());
-					}
-				}
-		);
-
-		// wire the apply button to the selection model of the preset table
-		//
-		tagsTable.getSelectionModel().addListSelectionListener(
-				new ListSelectionListener() {
-					public void valueChanged(ListSelectionEvent e) {
-						btnApply.setEnabled(tagsTable.getSelectedRowCount() != 0);
-					}
-				}
-		);
-
-
-		// load the set of presets and bind them to the preset table
-		//
-		tagsTable.getSelectionModel().clearSelection();
-		btnApply.setEnabled(false);
-
-	}
-
-	public TabularTagSelector() {
-		build();
-	}
-
-
-	public void filter(String filter) {
-		tagsTable.getSelectionModel().clearSelection();
-		getModel().filter(filter);
-
-		tagsTable.scrollRectToVisible(tagsTable.getCellRect(0, 0, false));
-
-		// we change the number of rows by applying a filter condition. Because
-		// the table is embedded in a JScrollPane which again may be embedded in
-		// other JScrollPanes or JSplitPanes it seems that we have to recalculate
-		// the layout and repaint the component tree. Maybe there is a more efficient way
-		// to keep the GUI in sync with the number of rows in table. By trial
-		// and error I ended up with the following lines.
-		//
-		Component c = tagsTable;
-		while(c != null) {
-			c.doLayout();
-			c.repaint();
-			c = c.getParent();
-		}
-	}
-
-	protected TagsTableModel getModel() {
-		return (TagsTableModel)tagsTable.getModel();
-	}
-
-
-	public void addTagSelectorListener(ITagSelectorListener listener) {
-		synchronized(this.listeners) {
-			if (listener != null && ! listeners.contains(listener)) {
-				listeners.add(listener);
-			}
-		}
-	}
-
-	public void removeTagSelectorListener(ITagSelectorListener listener) {
-		synchronized(this.listeners) {
-			if (listener != null) {
-				listeners.remove(listener);
-			}
-		}
-	}
-
-	protected void fireItemSelected(KeyValuePair pair) {
-		synchronized(this.listeners) {
-			for(ITagSelectorListener listener: listeners) {
-				listener.itemSelected(pair);
-			}
-		}
-	}
-
-	private class DoubleClickAdapter extends MouseAdapter {
-		@Override
-		public void mouseClicked(MouseEvent e) {
-			if (e.getClickCount() == 2) {
-				int rowNum = tagsTable.rowAtPoint(e.getPoint());
-				KeyValuePair pair = getModel().getVisibleItem(rowNum);
-				fireItemSelected(pair);
-			}
-		}
-	}
+    private TagsTable tagsTable;
+    private JTextField tfFilter;
+    private JButton btnApply;
+    private JScrollPane scrollPane;
+    private final ArrayList<ITagSelectorListener> listeners = new ArrayList<ITagSelectorListener>();
+
+    protected JPanel buildFilterPanel() {
+        JPanel pnl = new JPanel();
+        JLabel lbl = new JLabel(tr("Search: "));
+        pnl.setLayout(new FlowLayout(FlowLayout.LEFT));
+        tfFilter = new JTextField(20);
+        pnl.add(lbl);
+        pnl.add(tfFilter,BorderLayout.CENTER);
+        JButton btn = new JButton(tr("Filter"));
+        pnl.add(btn);
+        btn.addActionListener(
+                new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        filter(tfFilter.getText());
+                    }
+
+                }
+        );
+        btn = new JButton(tr("Clear"));
+        pnl.add(btn);
+        btn.addActionListener(
+                new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        tfFilter.setText("");
+                        tfFilter.requestFocus();
+                    }
+                }
+        );
+        return pnl;
+    }
+
+    protected JScrollPane buildPresetGrid() {
+
+        tagsTable = new TagsTable(new TagsTableModel(),new TagsTableColumnModel());
+        getModel().initFromTagSpecifications();
+
+        scrollPane = new JScrollPane(tagsTable);
+
+        scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
+
+        // this adapters ensures that the width of the tag table columns is adjusted
+        // to the width of the scroll pane viewport. Also tried to overwrite
+        // getPreferredViewportSize() in JTable, but did not work.
+        //
+        scrollPane.addComponentListener(
+                new ComponentAdapter() {
+                    @Override public void componentResized(ComponentEvent e) {
+                        super.componentResized(e);
+                        Dimension d = scrollPane.getViewport().getExtentSize();
+                        tagsTable.adjustColumnWidth(d.width);
+                    }
+                }
+        );
+
+        // add the double click listener
+        //
+        tagsTable.addMouseListener(new DoubleClickAdapter());
+
+        // replace Enter action. apply the current preset on enter
+        //
+        tagsTable.unregisterKeyboardAction(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0));
+        ActionListener enterAction = new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                int rowNum = tagsTable.getSelectedRow();
+                if (rowNum >= 0) {
+                    KeyValuePair item = getModel().getVisibleItem(rowNum);
+                    fireItemSelected(item);
+                }
+            }
+        };
+
+        tagsTable.registerKeyboardAction(
+                enterAction,
+                "Enter",
+                KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0),
+                JComponent.WHEN_FOCUSED
+        );
+
+        return scrollPane;
+    }
+
+    protected JPanel buildControlButtonPanel() {
+        JPanel pnl = new JPanel();
+        pnl.setLayout(new FlowLayout(FlowLayout.LEFT));
+        btnApply = new JButton("Apply");
+        pnl.add(btnApply);
+        btnApply.addActionListener(
+                new ActionListener() {
+                    public void actionPerformed(ActionEvent arg0) {
+                        int row = tagsTable.getSelectedRow();
+                        if (row >=0) {
+                            KeyValuePair item = getModel().getVisibleItem(row);
+                            fireItemSelected(item);
+                        }
+                    }
+                }
+        );
+        return pnl;
+    }
+
+    protected void build() {
+        setLayout(new BorderLayout());
+        add(buildFilterPanel(), BorderLayout.NORTH);
+        add(buildPresetGrid(), BorderLayout.CENTER);
+        add(buildControlButtonPanel(), BorderLayout.SOUTH);
+
+        // wire the text field for filter expressions to the prests
+        // table
+        //
+        tfFilter.getDocument().addDocumentListener(
+                new DocumentListener() {
+                    public void changedUpdate(DocumentEvent arg0) {
+                        onUpdate();
+                    }
+
+                    public void insertUpdate(DocumentEvent arg0) {
+                        onUpdate();
+                    }
+
+                    public void removeUpdate(DocumentEvent arg0) {
+                        onUpdate();
+                    }
+
+                    protected void onUpdate() {
+                        filter(tfFilter.getText());
+                    }
+                }
+        );
+
+        tfFilter.addActionListener(
+                new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        filter(tfFilter.getText());
+                    }
+                }
+        );
+
+        // wire the apply button to the selection model of the preset table
+        //
+        tagsTable.getSelectionModel().addListSelectionListener(
+                new ListSelectionListener() {
+                    public void valueChanged(ListSelectionEvent e) {
+                        btnApply.setEnabled(tagsTable.getSelectedRowCount() != 0);
+                    }
+                }
+        );
+
+
+        // load the set of presets and bind them to the preset table
+        //
+        tagsTable.getSelectionModel().clearSelection();
+        btnApply.setEnabled(false);
+
+    }
+
+    public TabularTagSelector() {
+        build();
+    }
+
+
+    public void filter(String filter) {
+        tagsTable.getSelectionModel().clearSelection();
+        getModel().filter(filter);
+
+        tagsTable.scrollRectToVisible(tagsTable.getCellRect(0, 0, false));
+
+        // we change the number of rows by applying a filter condition. Because
+        // the table is embedded in a JScrollPane which again may be embedded in
+        // other JScrollPanes or JSplitPanes it seems that we have to recalculate
+        // the layout and repaint the component tree. Maybe there is a more efficient way
+        // to keep the GUI in sync with the number of rows in table. By trial
+        // and error I ended up with the following lines.
+        //
+        Component c = tagsTable;
+        while(c != null) {
+            c.doLayout();
+            c.repaint();
+            c = c.getParent();
+        }
+    }
+
+    protected TagsTableModel getModel() {
+        return (TagsTableModel)tagsTable.getModel();
+    }
+
+
+    public void addTagSelectorListener(ITagSelectorListener listener) {
+        synchronized(this.listeners) {
+            if (listener != null && ! listeners.contains(listener)) {
+                listeners.add(listener);
+            }
+        }
+    }
+
+    public void removeTagSelectorListener(ITagSelectorListener listener) {
+        synchronized(this.listeners) {
+            if (listener != null) {
+                listeners.remove(listener);
+            }
+        }
+    }
+
+    protected void fireItemSelected(KeyValuePair pair) {
+        synchronized(this.listeners) {
+            for(ITagSelectorListener listener: listeners) {
+                listener.itemSelected(pair);
+            }
+        }
+    }
+
+    private class DoubleClickAdapter extends MouseAdapter {
+        @Override
+        public void mouseClicked(MouseEvent e) {
+            if (e.getClickCount() == 2) {
+                int rowNum = tagsTable.rowAtPoint(e.getPoint());
+                KeyValuePair pair = getModel().getVisibleItem(rowNum);
+                fireItemSelected(pair);
+            }
+        }
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTable.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTable.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTable.java	(revision 23189)
@@ -7,36 +7,36 @@
 
 public class TagsTable extends JTable {
-	/**
-	 * initialize the table 
-	 */
-	protected void init() {				
-		setAutoResizeMode(JTable.AUTO_RESIZE_OFF);		
-		setRowSelectionAllowed(true);
-		setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-	}
-	
-	public TagsTable(TableModel model, TableColumnModel columnModel) {
-		super(model,columnModel);
-		init();
-	}
-	
-	/**
-	 * adjusts the width of the columns for the tag name and the tag value
-	 * to the width of the scroll panes viewport.
-	 * 
-	 * Note: {@see #getPreferredScrollableViewportSize()} did not work as expected
-	 * 
-	 * @param scrollPaneWidth the width of the scroll panes viewport
-	 */
-	public void adjustColumnWidth(int scrollPaneWidth) {
-		TableColumnModel tcm = getColumnModel();
-		int width = scrollPaneWidth;
-		width = width / 2;
-		if (width > 0) {
-			tcm.getColumn(0).setMinWidth(width);
-			tcm.getColumn(0).setMaxWidth(width);
-			tcm.getColumn(1).setMinWidth(width);
-			tcm.getColumn(1).setMaxWidth(width);			
-		}
-	}
+    /**
+     * initialize the table 
+     */
+    protected void init() {             
+        setAutoResizeMode(JTable.AUTO_RESIZE_OFF);      
+        setRowSelectionAllowed(true);
+        setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+    }
+    
+    public TagsTable(TableModel model, TableColumnModel columnModel) {
+        super(model,columnModel);
+        init();
+    }
+    
+    /**
+     * adjusts the width of the columns for the tag name and the tag value
+     * to the width of the scroll panes viewport.
+     * 
+     * Note: {@see #getPreferredScrollableViewportSize()} did not work as expected
+     * 
+     * @param scrollPaneWidth the width of the scroll panes viewport
+     */
+    public void adjustColumnWidth(int scrollPaneWidth) {
+        TableColumnModel tcm = getColumnModel();
+        int width = scrollPaneWidth;
+        width = width / 2;
+        if (width > 0) {
+            tcm.getColumn(0).setMinWidth(width);
+            tcm.getColumn(0).setMaxWidth(width);
+            tcm.getColumn(1).setMinWidth(width);
+            tcm.getColumn(1).setMaxWidth(width);            
+        }
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableColumnModel.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableColumnModel.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableColumnModel.java	(revision 23189)
@@ -8,27 +8,27 @@
 
 public class TagsTableColumnModel extends DefaultTableColumnModel {
-	
-	protected void createColumns() {
-		TableCellRenderer renderer = new KeyValueCellRenderer();
-		
-		TableColumn col = null;
-		
-		// column 0 - Key   
-		col = new TableColumn(0);
-		col.setHeaderValue(tr("Key"));
-		col.setResizable(true);
-		col.setCellRenderer(renderer);
-		addColumn(col);
-		
-		// column 1 - Value   
-		col = new TableColumn(1);
-		col.setHeaderValue(tr("Value"));
-		col.setResizable(true);
-		col.setCellRenderer(renderer);
-		addColumn(col);
-	}
+    
+    protected void createColumns() {
+        TableCellRenderer renderer = new KeyValueCellRenderer();
+        
+        TableColumn col = null;
+        
+        // column 0 - Key   
+        col = new TableColumn(0);
+        col.setHeaderValue(tr("Key"));
+        col.setResizable(true);
+        col.setCellRenderer(renderer);
+        addColumn(col);
+        
+        // column 1 - Value   
+        col = new TableColumn(1);
+        col.setHeaderValue(tr("Value"));
+        col.setResizable(true);
+        col.setCellRenderer(renderer);
+        addColumn(col);
+    }
 
-	public TagsTableColumnModel() {
-		createColumns();
-	}
+    public TagsTableColumnModel() {
+        createColumns();
+    }
 }
Index: /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableModel.java
===================================================================
--- /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableModel.java	(revision 23188)
+++ /applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/tagspec/ui/TagsTableModel.java	(revision 23189)
@@ -15,104 +15,104 @@
 public class TagsTableModel extends AbstractTableModel {
 
-	static private Logger logger = Logger.getLogger(TagsTableModel.class.getName());
+    static private Logger logger = Logger.getLogger(TagsTableModel.class.getName());
 
-	private ArrayList<KeyValuePair> items = null;
-	private ArrayList<KeyValuePair> visibleItems = null;
+    private ArrayList<KeyValuePair> items = null;
+    private ArrayList<KeyValuePair> visibleItems = null;
 
-	public TagsTableModel() {
-		items = new ArrayList<KeyValuePair>();
-		visibleItems = new ArrayList<KeyValuePair>();
-	}
+    public TagsTableModel() {
+        items = new ArrayList<KeyValuePair>();
+        visibleItems = new ArrayList<KeyValuePair>();
+    }
 
-	protected void sort() {
-		Collections.sort(
-				items,
-				new Comparator<KeyValuePair>() {
-					public int compare(KeyValuePair self,
-							KeyValuePair other) {
-						int ret =self.getKey().compareToIgnoreCase(other.getKey());
+    protected void sort() {
+        Collections.sort(
+                items,
+                new Comparator<KeyValuePair>() {
+                    public int compare(KeyValuePair self,
+                            KeyValuePair other) {
+                        int ret =self.getKey().compareToIgnoreCase(other.getKey());
 
-						if (ret == 0)
-							return self.getValue().compareToIgnoreCase(other.getValue());
-						else
-							return ret;
-					}
-				}
-		);
-	}
+                        if (ret == 0)
+                            return self.getValue().compareToIgnoreCase(other.getValue());
+                        else
+                            return ret;
+                    }
+                }
+        );
+    }
 
-	protected void clear() {
-		items.clear();
-		visibleItems.clear();
-	}
+    protected void clear() {
+        items.clear();
+        visibleItems.clear();
+    }
 
-	public void initFromTagSpecifications() {
-		clear();
-		TagSpecifications spec;
+    public void initFromTagSpecifications() {
+        clear();
+        TagSpecifications spec;
 
-		try {
-			spec = TagSpecifications.getInstance();
-		} catch(Exception e) {
-			logger.log(Level.SEVERE, "failed to init TagTableModel. Exception:" + e);
-			return;
-		}
+        try {
+            spec = TagSpecifications.getInstance();
+        } catch(Exception e) {
+            logger.log(Level.SEVERE, "failed to init TagTableModel. Exception:" + e);
+            return;
+        }
 
-		items = spec.asList();
-		sort();
-		for(KeyValuePair item : items) {
-			visibleItems.add(item);
-		}
-	}
+        items = spec.asList();
+        sort();
+        for(KeyValuePair item : items) {
+            visibleItems.add(item);
+        }
+    }
 
-	public int getColumnCount() {
-		return 2;
-	}
+    public int getColumnCount() {
+        return 2;
+    }
 
-	public int getRowCount() {
-		return visibleItems.size();
-	}
+    public int getRowCount() {
+        return visibleItems.size();
+    }
 
-	public Object getValueAt(int row, int col) {
-		KeyValuePair pair = visibleItems.get(row);
-		switch(col) {
-		case 0: return pair.getKey();
-		case 1: return pair.getValue();
-		default:
-			/* should not happen */
-			throw new IllegalArgumentException(tr("unexpected column number {0}",col));
-		}
-	}
+    public Object getValueAt(int row, int col) {
+        KeyValuePair pair = visibleItems.get(row);
+        switch(col) {
+        case 0: return pair.getKey();
+        case 1: return pair.getValue();
+        default:
+            /* should not happen */
+            throw new IllegalArgumentException(tr("unexpected column number {0}",col));
+        }
+    }
 
-	public void filter(String filter) {
-		synchronized(this) {
-			if (filter == null || filter.trim().equals("")) {
-				visibleItems.clear();
-				for(KeyValuePair pair: items) {
-					visibleItems.add(pair);
-				}
-			} else {
-				visibleItems.clear();
-				filter = filter.toLowerCase();
-				for(KeyValuePair pair: items) {
-					if (pair.getKey().toLowerCase().trim().startsWith(filter)
-							||  pair.getValue().toLowerCase().trim().startsWith(filter)) {
-						visibleItems.add(pair);
-					}
-				}
-			}
-			fireTableDataChanged();
-			fireTableStructureChanged();
-		}
-	}
+    public void filter(String filter) {
+        synchronized(this) {
+            if (filter == null || filter.trim().equals("")) {
+                visibleItems.clear();
+                for(KeyValuePair pair: items) {
+                    visibleItems.add(pair);
+                }
+            } else {
+                visibleItems.clear();
+                filter = filter.toLowerCase();
+                for(KeyValuePair pair: items) {
+                    if (pair.getKey().toLowerCase().trim().startsWith(filter)
+                            ||  pair.getValue().toLowerCase().trim().startsWith(filter)) {
+                        visibleItems.add(pair);
+                    }
+                }
+            }
+            fireTableDataChanged();
+            fireTableStructureChanged();
+        }
+    }
 
-	@Override
-	public boolean isCellEditable(int rowIndex, int columnIndex) {
-		return false;
-	}
+    @Override
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+        return false;
+    }
 
-	public KeyValuePair getVisibleItem(int row) {
-		if (row < 0 || row >= visibleItems.size())
-			throw new IndexOutOfBoundsException("row is out of bound: row=" + row);
-		return visibleItems.get(row);
-	}
+    public KeyValuePair getVisibleItem(int row) {
+        if (row < 0 || row >= visibleItems.size())
+            throw new IndexOutOfBoundsException("row is out of bound: row=" + row);
+        return visibleItems.get(row);
+    }
 }
Index: /applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTester.java
===================================================================
--- /applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTester.java	(revision 23188)
+++ /applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingPresetTester.java	(revision 23189)
@@ -55,5 +55,5 @@
         panel.repaint();
     }
-   
+
     public TaggingPresetTester(String[] args) {
         super(tr("Tagging Preset Tester"));
Index: /applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/Undelete.java
===================================================================
--- /applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/Undelete.java	(revision 23188)
+++ /applications/editors/josm/plugins/undelete/src/org/openstreetmap/josm/plugins/undelete/Undelete.java	(revision 23189)
@@ -50,16 +50,16 @@
 
     public Undelete(PluginInformation info) {
-    	super(info);
+        super(info);
         Undelete = MainMenu.add(Main.main.menu.fileMenu, new UndeleteAction());
 
     }
-    
-    
+
+
     private class UndeleteAction extends JosmAction {
         /**
-		 * 
-		 */
-		private static final long serialVersionUID = 1L;
-		public UndeleteAction() {
+         *
+         */
+        private static final long serialVersionUID = 1L;
+        public UndeleteAction() {
         super(tr("Undelete object..."), "undelete", tr("Undelete object by id"), Shortcut.registerShortcut("tools:undelete", tr("File: {0}", tr("Undelete object...")),
         KeyEvent.VK_U, Shortcut.GROUP_EDIT, KeyEvent.SHIFT_DOWN_MASK|KeyEvent.ALT_DOWN_MASK), true);
@@ -117,6 +117,6 @@
         undelete(layer.isSelected(), cbType.getType(), ids, 0);
       }
-    }      
-          
+    }
+
     /**
      * Download the given primitive.
@@ -128,8 +128,8 @@
             Main.main.addLayer(tmpLayer);
         }
-        
+
         final DataSet datas = tmpLayer.data;
         final OsmDataLayer layer=tmpLayer;
-        
+
         HistoryLoadTask task  = new HistoryLoadTask();
         for (long id: ids)
@@ -138,8 +138,8 @@
         }
 
-        
-        
+
+
         Main.worker.execute(task);
-        
+
         Runnable r = new Runnable() {
             public void run() {
@@ -149,20 +149,20 @@
 
                 History h = HistoryDataSet.getInstance().getHistory(id, type);
-                
+
                 OsmPrimitive primitive;
                 HistoryOsmPrimitive hPrimitive1=h.getLatest();
                 HistoryOsmPrimitive hPrimitive2;
-                
+
                 boolean visible=hPrimitive1.isVisible();
-                
+
                 if (visible)
                 {
                   // If the object is not deleted we get the real object
                   DownloadPrimitiveTask download=new DownloadPrimitiveTask(new SimplePrimitiveId(id, type), layer);
-                  System.out.println(tr("Will get {0}", id));                 
+                  System.out.println(tr("Will get {0}", id));
                   download.run();
-                  
-                  
-                  System.out.println(tr("Looking for {0}", id));                 
+
+
+                  System.out.println(tr("Looking for {0}", id));
                   primitive=datas.getPrimitiveById(id, type);
                   System.out.println(tr("Found {0}", primitive.getId()));
@@ -178,10 +178,10 @@
                     // We get all info from the latest version
                     hPrimitive2=hPrimitive1;
-                    
+
                     Node node = new Node(id, (int) hPrimitive1.getVersion());
 
                     HistoryNode hNode = (HistoryNode) hPrimitive1;
                     node.setCoor(hNode.getCoords());
-                    
+
                     primitive=node;
                     if (parent>0)
@@ -196,18 +196,18 @@
                     hPrimitive2 = h.getByVersion(h.getNumVersions()-1);
 
-                    
-                    
+
+
                     Way way = new Way(id, (int) hPrimitive1.getVersion());
-                    
+
                     HistoryWay hWay = (HistoryWay) hPrimitive2;
                     //System.out.println(tr("Primitive {0} version {1}: {2} nodes", hPrimitive2.getId(), hPrimitive2.getVersion(), hWay.getNumNodes()));
                     List<Long> nodeIds = hWay.getNodes();
                     undelete(false, OsmPrimitiveType.NODE, nodeIds, id);
-                    
+
                     primitive=way;
-                    
+
                   }
                   else
-                  { 
+                  {
                       primitive=new Node();
                       hPrimitive1=h.getLatest();
@@ -216,16 +216,16 @@
 
                   User user = User.createOsmUser(hPrimitive1.getUid(), hPrimitive1.getUser());
-                  
+
                   primitive.setUser(user);
-                  
+
                   primitive.setKeys(hPrimitive2.getTags());
-                  
+
                   primitive.put("history", "retrieved using undelete JOSM plugin");
-                  
+
                   primitive.setModified(true);
-                  
-                  datas.addPrimitive(primitive);                
+
+                  datas.addPrimitive(primitive);
                 }
-                  
+
 
                 //HistoryBrowserDialogManager.getInstance().show(h);
@@ -234,5 +234,5 @@
               {
                 Way parentWay=(Way)datas.getPrimitiveById(parent, OsmPrimitiveType.WAY);
-                
+
                 parentWay.setNodes(nodes);
               }
@@ -240,8 +240,8 @@
         };
         Main.worker.submit(r);
-        
+
         //if (downloadReferrers) {
         //    Main.worker.submit(new DownloadReferrersTask(layer, id, type));
         //}
-    }      
+    }
 }
Index: /applications/editors/josm/plugins/wayselector/src/org/openstreetmap/josm/plugins/wayselector/WaySelectorPlugin.java
===================================================================
--- /applications/editors/josm/plugins/wayselector/src/org/openstreetmap/josm/plugins/wayselector/WaySelectorPlugin.java	(revision 23188)
+++ /applications/editors/josm/plugins/wayselector/src/org/openstreetmap/josm/plugins/wayselector/WaySelectorPlugin.java	(revision 23189)
@@ -50,7 +50,7 @@
 
         public void actionPerformed(ActionEvent ev) {
-	    DataSet ds = Main.main.getCurrentDataSet();
-	    WaySelection ws = new WaySelection(ds.getSelectedWays());
-	    ws.extend(ds);
+        DataSet ds = Main.main.getCurrentDataSet();
+        WaySelection ws = new WaySelection(ds.getSelectedWays());
+        ws.extend(ds);
         }
 
