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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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 22547)
+++ 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);
+        }
 
-	}
+    }
 
 }
