Index: /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageImportPlugin.java
===================================================================
--- /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageImportPlugin.java	(revision 23191)
+++ /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageImportPlugin.java	(revision 23192)
@@ -31,261 +31,261 @@
  */
 public class ImageImportPlugin extends Plugin{
-	
-	private static Logger logger;
-	
-	JMenu mainmenu = null;
-	JosmAction loadFileAction = null;
-	
-	// custom Classloader
-	static ClassLoader pluginClassLoader;
-	
-	// plugin proerties
-	static Properties pluginProps;
-	
-	// path constants
-	static final String PLUGIN_DIR = Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/";
-	static final String PLUGINPROPERTIES_PATH = Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/pluginProperties.properties"; 
-	static final String PLUGINLIBRARIES_DIR = Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/lib/"; 
-	static final String PLUGINPROPERTIES_FILENAME = "pluginProperties.properties";
-	static final String LOGGING_PROPERTIES_FILEPATH = Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/log4j.properties/";
-	
-	
-	public Properties getPluginProps() {
-		return pluginProps;
-	}
-
-
-	/**
-	 * constructor
-	 * 
-	 * @param info
-	 */
-	public ImageImportPlugin(PluginInformation info){
-		super(info);
-		
-		try {
-			
-			// First create custom ClassLoader to load resources from the main JAR
-			pluginClassLoader = createPluginClassLoader();
-			
-			// Initialize logger
-			initializeLogger(pluginClassLoader);
-			
-			// Check whether plugin has already been installed. Otherwise install
-			checkInstallation();
-			
-			// If resources are available load properties from plugin directory
-			if(pluginProps == null || pluginProps.isEmpty())
-			{
-				pluginProps = new Properties();
-				pluginProps.load(new File(PLUGINPROPERTIES_PATH).toURI().toURL().openStream());
-				logger.debug("Plugin properties loaded");
-			}
-
-			/* Change class path:
-			 * Use java reflection methods to add URLs to the class-path.
-			 * Changes take effect when calling methods of other plugin classes
-			 * (new threads)
-			 * */
-			URLClassLoader sysLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
-			String[] libraryNames = pluginProps.getProperty("libraries").split(",");
-			Class<URLClassLoader> sysclass = URLClassLoader.class;
-			Method method = sysclass.getDeclaredMethod("addURL", new Class[]{URL.class});
-			method.setAccessible(true);
-			for (int i = 0; i < libraryNames.length; i++) {
-				File library = new File(PLUGINLIBRARIES_DIR + "/" + libraryNames[i]);
-				method.invoke(sysLoader, new Object[]{library.toURI().toURL()});
-			}
-	        
-	        
-			// load information about supported reference systems
-			PluginOperations.loadCRSData(pluginProps);
-			
-			// create new Action for menu entry
-			LoadImageAction loadFileAction = new LoadImageAction();
-			loadFileAction.setEnabled(true);
-			
-			// add menu entries
-			Main.main.menu.fileMenu.insert(loadFileAction, 8);
-			Main.main.menu.fileMenu.insertSeparator(9);
-			
-
-		} catch (Exception e) {
-			logger.fatal("Error while loading plugin", e);
-			try {
-				throw e;
-			} catch (Exception e1) {
-				e1.printStackTrace();
-			}
-		}
-
-		logger.info("Plugin successfully loaded.");
-		
-	}
-
-	
-	
-	/**
-	 * Checks whether plugin resources are available.
-	 * If not, start install procedure.
-	 * 
-	 * @throws IOException
-	 */
-	private void checkInstallation() throws IOException
-	{
-		
-		// check plugin resource state
-		boolean isInstalled = true;
-		if(!new File(PLUGINPROPERTIES_PATH).exists()
-				|| !new File(PLUGIN_DIR).exists()
-				|| !new File(PLUGINLIBRARIES_DIR).exists())
-			isInstalled = false;
-		
-		
-		// if properties file doesn't exist, install plugin
-		if(!isInstalled)
-		{
-			
-			/*----------- Begin installation ---------------*/
-			
-			// check if plugin directory exist
-			File pluginDir = new File(PLUGIN_DIR);
-			if(!pluginDir.exists()){
-				pluginDir.mkdir();
-			}
-			
-			// check if "lib" directory exist
-			File libDir = new File(PLUGINLIBRARIES_DIR);
-			if(!libDir.exists()){
-				libDir.mkdir();
-			}
-			
-			// create local properties file
-			if(pluginProps == null || pluginProps.isEmpty()){
-				
-				FileWriter fw = new FileWriter(new File(PLUGINPROPERTIES_PATH));
-				URL propertiesURL = pluginClassLoader.getResource("resources/" + PLUGINPROPERTIES_FILENAME);
-				pluginProps = new Properties();
-				pluginProps.load(propertiesURL.openStream());
-				pluginProps.store(fw, null);
-				fw.close();
-				logger.debug("Plugin properties loaded");
-			}
-			
-			if(!new File(LOGGING_PROPERTIES_FILEPATH).exists())
-			{
-				FileWriter fw = new FileWriter(new File(LOGGING_PROPERTIES_FILEPATH));
-				URL propertiesURL = pluginClassLoader.getResource("resources/log4j.properties");
-				Properties loggingProps = new Properties();
-				loggingProps.load(propertiesURL.openStream());
-				loggingProps.store(fw, null);
-				fw.close();
-				logger.debug("Logging properties created");
-			}
-
-			
-			// Copy all needed JAR files to $PLUGIN_DIR$/lib/  
-			String[] libStrings = pluginProps.getProperty("libraries").split(",");
-			
-			for (int i = 0; i < libStrings.length; i++) {
-				
-				URL url = pluginClassLoader.getResource("lib/" + libStrings[i]);
-				
-				FileOutputStream out = null;
-				
-				try{
-					out = new FileOutputStream(new File(libDir, libStrings[i]));
-				} catch (FileNotFoundException e) {
-					break;
-				}
-				
-				BufferedInputStream in = null;
-				try
-				{
-					in = new BufferedInputStream(url.openStream());
-
-					byte[] buffer = new byte[1024];
-					while (true)
-					{
-						int count = in.read(buffer);
-						if (count == -1)
-							break;
-						out.write(buffer, 0, count);
-					}
-				}
-				finally
-				{
-					if (in != null)
-						in.close();
-				}
-			}
-			logger.debug("Plugin successfully installed");
-		}
-	}
-
-
-	/**
-	 * Initialize logger using plugin classloader.
-	 * 
-	 * @param cl
-	 */
-	private void initializeLogger(ClassLoader cl) {
-
-		Properties props = new Properties();
-		try {
-			props.load(new File(LOGGING_PROPERTIES_FILEPATH).toURI().toURL().openStream());
-			
-			// Set file for logging here:
-			props.setProperty("log4j.appender.MyRoFiAppender.file",
-					(Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/" + "log.log"));
-			
-			PropertyConfigurator.configure(props);
-
-			logger = Logger.getLogger(ImageImportPlugin.class);
-			
-			logger.info("Logger successfully initialized.");
-			
-			return;
-		
-		} catch (IOException e) {
-			System.out.println("Logging properties file not found. Using standard settings.");
-		}
-		
-		// if no log4j.properties file can be found, initialize manually:
-		
-		props.setProperty("log4j.rootLogger", "INFO, A");
-		props.setProperty("log4j.appender.A", "org.apache.log4j.FileAppender");
-
-		props.setProperty("log4j.appender.A.layout",
-				"org.apache.log4j.PatternLayout ");
-		props.setProperty("log4j.appender.A.layout.ConversionPattern",
-				"%d{ISO8601} %-5p [%t] %c: %m%n");
-
-		// Set file for logging here:
-		props.setProperty("log4j.appender.A.file",
-				(Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/" + "log.log"));
-		
-		PropertyConfigurator.configure(props);
-		logger = Logger.getLogger(ImageImportPlugin.class);
-		logger.info("Logger successfully initialized with standard settings.");
-		
-	}
-	
-	/**
-	 * get a plugin-specific classloader.
-	 * 
-	 * @return
-	 * @throws MalformedURLException 
-	 */
-	private ClassLoader createPluginClassLoader() throws MalformedURLException 
-	{
-		ClassLoader loader = null;
-		loader = URLClassLoader.newInstance(
-			    new URL[] { new File(Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImportImagePlugin.jar").toURI().toURL()},
-			    ImageImportPlugin.class.getClassLoader()
-				);
-		
-		return loader;
-	}
-	
+    
+    private static Logger logger;
+    
+    JMenu mainmenu = null;
+    JosmAction loadFileAction = null;
+    
+    // custom Classloader
+    static ClassLoader pluginClassLoader;
+    
+    // plugin proerties
+    static Properties pluginProps;
+    
+    // path constants
+    static final String PLUGIN_DIR = Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/";
+    static final String PLUGINPROPERTIES_PATH = Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/pluginProperties.properties"; 
+    static final String PLUGINLIBRARIES_DIR = Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/lib/"; 
+    static final String PLUGINPROPERTIES_FILENAME = "pluginProperties.properties";
+    static final String LOGGING_PROPERTIES_FILEPATH = Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/log4j.properties/";
+    
+    
+    public Properties getPluginProps() {
+        return pluginProps;
+    }
+
+
+    /**
+     * constructor
+     * 
+     * @param info
+     */
+    public ImageImportPlugin(PluginInformation info){
+        super(info);
+        
+        try {
+            
+            // First create custom ClassLoader to load resources from the main JAR
+            pluginClassLoader = createPluginClassLoader();
+            
+            // Initialize logger
+            initializeLogger(pluginClassLoader);
+            
+            // Check whether plugin has already been installed. Otherwise install
+            checkInstallation();
+            
+            // If resources are available load properties from plugin directory
+            if(pluginProps == null || pluginProps.isEmpty())
+            {
+                pluginProps = new Properties();
+                pluginProps.load(new File(PLUGINPROPERTIES_PATH).toURI().toURL().openStream());
+                logger.debug("Plugin properties loaded");
+            }
+
+            /* Change class path:
+             * Use java reflection methods to add URLs to the class-path.
+             * Changes take effect when calling methods of other plugin classes
+             * (new threads)
+             * */
+            URLClassLoader sysLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
+            String[] libraryNames = pluginProps.getProperty("libraries").split(",");
+            Class<URLClassLoader> sysclass = URLClassLoader.class;
+            Method method = sysclass.getDeclaredMethod("addURL", new Class[]{URL.class});
+            method.setAccessible(true);
+            for (int i = 0; i < libraryNames.length; i++) {
+                File library = new File(PLUGINLIBRARIES_DIR + "/" + libraryNames[i]);
+                method.invoke(sysLoader, new Object[]{library.toURI().toURL()});
+            }
+            
+            
+            // load information about supported reference systems
+            PluginOperations.loadCRSData(pluginProps);
+            
+            // create new Action for menu entry
+            LoadImageAction loadFileAction = new LoadImageAction();
+            loadFileAction.setEnabled(true);
+            
+            // add menu entries
+            Main.main.menu.fileMenu.insert(loadFileAction, 8);
+            Main.main.menu.fileMenu.insertSeparator(9);
+            
+
+        } catch (Exception e) {
+            logger.fatal("Error while loading plugin", e);
+            try {
+                throw e;
+            } catch (Exception e1) {
+                e1.printStackTrace();
+            }
+        }
+
+        logger.info("Plugin successfully loaded.");
+        
+    }
+
+    
+    
+    /**
+     * Checks whether plugin resources are available.
+     * If not, start install procedure.
+     * 
+     * @throws IOException
+     */
+    private void checkInstallation() throws IOException
+    {
+        
+        // check plugin resource state
+        boolean isInstalled = true;
+        if(!new File(PLUGINPROPERTIES_PATH).exists()
+                || !new File(PLUGIN_DIR).exists()
+                || !new File(PLUGINLIBRARIES_DIR).exists())
+            isInstalled = false;
+        
+        
+        // if properties file doesn't exist, install plugin
+        if(!isInstalled)
+        {
+            
+            /*----------- Begin installation ---------------*/
+            
+            // check if plugin directory exist
+            File pluginDir = new File(PLUGIN_DIR);
+            if(!pluginDir.exists()){
+                pluginDir.mkdir();
+            }
+            
+            // check if "lib" directory exist
+            File libDir = new File(PLUGINLIBRARIES_DIR);
+            if(!libDir.exists()){
+                libDir.mkdir();
+            }
+            
+            // create local properties file
+            if(pluginProps == null || pluginProps.isEmpty()){
+                
+                FileWriter fw = new FileWriter(new File(PLUGINPROPERTIES_PATH));
+                URL propertiesURL = pluginClassLoader.getResource("resources/" + PLUGINPROPERTIES_FILENAME);
+                pluginProps = new Properties();
+                pluginProps.load(propertiesURL.openStream());
+                pluginProps.store(fw, null);
+                fw.close();
+                logger.debug("Plugin properties loaded");
+            }
+            
+            if(!new File(LOGGING_PROPERTIES_FILEPATH).exists())
+            {
+                FileWriter fw = new FileWriter(new File(LOGGING_PROPERTIES_FILEPATH));
+                URL propertiesURL = pluginClassLoader.getResource("resources/log4j.properties");
+                Properties loggingProps = new Properties();
+                loggingProps.load(propertiesURL.openStream());
+                loggingProps.store(fw, null);
+                fw.close();
+                logger.debug("Logging properties created");
+            }
+
+            
+            // Copy all needed JAR files to $PLUGIN_DIR$/lib/  
+            String[] libStrings = pluginProps.getProperty("libraries").split(",");
+            
+            for (int i = 0; i < libStrings.length; i++) {
+                
+                URL url = pluginClassLoader.getResource("lib/" + libStrings[i]);
+                
+                FileOutputStream out = null;
+                
+                try{
+                    out = new FileOutputStream(new File(libDir, libStrings[i]));
+                } catch (FileNotFoundException e) {
+                    break;
+                }
+                
+                BufferedInputStream in = null;
+                try
+                {
+                    in = new BufferedInputStream(url.openStream());
+
+                    byte[] buffer = new byte[1024];
+                    while (true)
+                    {
+                        int count = in.read(buffer);
+                        if (count == -1)
+                            break;
+                        out.write(buffer, 0, count);
+                    }
+                }
+                finally
+                {
+                    if (in != null)
+                        in.close();
+                }
+            }
+            logger.debug("Plugin successfully installed");
+        }
+    }
+
+
+    /**
+     * Initialize logger using plugin classloader.
+     * 
+     * @param cl
+     */
+    private void initializeLogger(ClassLoader cl) {
+
+        Properties props = new Properties();
+        try {
+            props.load(new File(LOGGING_PROPERTIES_FILEPATH).toURI().toURL().openStream());
+            
+            // Set file for logging here:
+            props.setProperty("log4j.appender.MyRoFiAppender.file",
+                    (Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/" + "log.log"));
+            
+            PropertyConfigurator.configure(props);
+
+            logger = Logger.getLogger(ImageImportPlugin.class);
+            
+            logger.info("Logger successfully initialized.");
+            
+            return;
+        
+        } catch (IOException e) {
+            System.out.println("Logging properties file not found. Using standard settings.");
+        }
+        
+        // if no log4j.properties file can be found, initialize manually:
+        
+        props.setProperty("log4j.rootLogger", "INFO, A");
+        props.setProperty("log4j.appender.A", "org.apache.log4j.FileAppender");
+
+        props.setProperty("log4j.appender.A.layout",
+                "org.apache.log4j.PatternLayout ");
+        props.setProperty("log4j.appender.A.layout.ConversionPattern",
+                "%d{ISO8601} %-5p [%t] %c: %m%n");
+
+        // Set file for logging here:
+        props.setProperty("log4j.appender.A.file",
+                (Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImageImportPlugin/" + "log.log"));
+        
+        PropertyConfigurator.configure(props);
+        logger = Logger.getLogger(ImageImportPlugin.class);
+        logger.info("Logger successfully initialized with standard settings.");
+        
+    }
+    
+    /**
+     * get a plugin-specific classloader.
+     * 
+     * @return
+     * @throws MalformedURLException 
+     */
+    private ClassLoader createPluginClassLoader() throws MalformedURLException 
+    {
+        ClassLoader loader = null;
+        loader = URLClassLoader.newInstance(
+                new URL[] { new File(Main.pref.getPluginsDirectory().getAbsolutePath() + "/ImportImagePlugin.jar").toURI().toURL()},
+                ImageImportPlugin.class.getClassLoader()
+                );
+        
+        return loader;
+    }
+    
 }
Index: /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java
===================================================================
--- /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java	(revision 23191)
+++ /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java	(revision 23192)
@@ -40,5 +40,5 @@
 
 /**
- * 	Layer which contains spatial referenced image data.
+ *  Layer which contains spatial referenced image data.
  * 
  * @author Christoph Beekmans, Fabian Kowitz, Anna Robaszkiewicz, Oliver Kuhn, Martin Ulitzny
@@ -47,183 +47,183 @@
 public class ImageLayer extends Layer {
 
-	private Logger logger = Logger.getLogger(ImageLayer.class);
-
-	private File imageFile;
-	
-	private BufferedImage image = null;
-
-	// coordinates of upper left corner
-	private EastNorth upperLeft;
-	// Angle of rotation of the image
-	private double angle = 0.0;
-
-	// current bbox
-	private Envelope2D bbox;
-	
-	// Layer icon
-	private Icon layericon = null;
-	
-	// reference system of the oringinal image
-	private CoordinateReferenceSystem sourceRefSys;
-
-
-
-	/**
-	 * Constructor
-	 * 
-	 * @param file
-	 * @throws IOException 
-	 */
-	public ImageLayer(File file) throws IOException {
-		super(file.getName());
-		
-		this.imageFile = file;
-		this.image = (BufferedImage) createImage();
-		layericon = new ImageIcon(ImageImportPlugin.pluginClassLoader.getResource("images/layericon.png"));
-		
-	}
-
-	/**
-	 * create spatial referenced image.
-	 * 
-	 * @return
-	 * @throws IOException
-	 */
-	private Image createImage() throws IOException {
-
-		// geotools type for images and value coverages
-		GridCoverage2D coverage = null;
-		try {
-			// create a grid coverage from the image
-			coverage = PluginOperations.createGridFromFile(imageFile, null);
-			this.sourceRefSys = coverage.getCoordinateReferenceSystem();
-			
-			// now reproject grid coverage
-			coverage = PluginOperations.reprojectCoverage(coverage, CRS.decode(Main.proj.toCode()));
-		
-		} catch (FactoryException e) {
-			logger.error("Error while creating GridCoverage:",e);
-			throw new IOException(e.getMessage());
-		} catch (Exception e) {
-			if(e.getMessage().contains("No projection file found"))
-			{
-				int useDefaultCRS = JOptionPane.showConfirmDialog(Main.parent, "<html>No projection file (.prj) found.<br>Use the default Coordinate Reference System instead?</html>", "Missing projection", JOptionPane.YES_NO_OPTION);
-				if (useDefaultCRS == 0)
-				{
-					try {
-						// create a grid coverage from the image
-						coverage = PluginOperations.createGridFromFile(imageFile, PluginOperations.defaultSourceCRS);
-						this.sourceRefSys = coverage.getCoordinateReferenceSystem();
-						
-						// now reproject grid coverage
-						coverage = PluginOperations.reprojectCoverage(coverage, CRS.decode(Main.proj.toCode()));
-					} catch (Exception e1) {
-						logger.error("Error while creating GridCoverage:",e1);
-						throw new IOException(e1);
-					}
-				}
-				else{
-					logger.debug("Layer creation cancled by user due to missing projection information.");
-					throw new LayerCreationCancledException();
-				}
-
-			}
-			else
-			{
-				logger.error("Error while creating GridCoverage:",e);
-				throw new IOException(e);
-			}
-
-		}
-		logger.debug("Coverage created: " + coverage);
-
-		// TODO
-		upperLeft = new EastNorth(coverage.getEnvelope2D().y, coverage
-				.getEnvelope2D().x
-				+ coverage.getEnvelope2D().width);
-		angle = 0;
-		bbox = coverage.getEnvelope2D();
-
-		// Refresh
-		// Main.map.mapView.repaint();
-//		PlanarImage image = (PlanarImage) coverage.getRenderedImage();
-//		logger.info("Color Model: " + coverage.getRenderedImage().getColorModel());
-		ImageWorker worker = new ImageWorker(coverage.getRenderedImage());
-
-		return worker.getBufferedImage();
-	}
-
-	@Override
-	public void paint(Graphics2D g2, MapView mv, Bounds bounds) {
-
-		if (image != null && g2 != null) {
-
-			// Position image at the right graphical place
-			EastNorth center = Main.map.mapView.getCenter();
-			EastNorth leftop = Main.map.mapView.getEastNorth(0, 0);
-			double pixel_per_lon_degree = (Main.map.mapView.getWidth() / 2.0)
-					/ (center.east() - leftop.east());
-			double pixel_per_lat_degree = (Main.map.mapView.getHeight() / 2.0)
-					/ (leftop.north() - center.north());
-
-			// This is now the offset in screen pixels
-			double pic_offset_x = ((upperLeft.east() - leftop.east()) * pixel_per_lon_degree);
-			double pic_offset_y = ((leftop.north() - upperLeft.north()) * pixel_per_lat_degree);
-
-			Graphics2D g = (Graphics2D) g2.create();
-
-			// Move picture by offset from upper left corner
-			g.translate(pic_offset_x, pic_offset_y);
-
-			// Rotate image by angle
-			g.rotate(angle * Math.PI / 180.0);
-			
-			// Determine scale to fit JOSM extents
-			ProjectionBounds projbounds = Main.map.mapView
-					.getProjectionBounds();
-
-			double width = projbounds.max.getX() - projbounds.min.getX();
-			double height = projbounds.max.getY() - projbounds.min.getY();
-
-			double ratio_x = (this.bbox.getMaxY() - this.bbox.getMinY())
-					/ width;
-			double ratio_y = (this.bbox.getMaxX() - this.bbox.getMinX())
-					/ height;
-
-			double pixels4bbox_width = ratio_x * Main.map.mapView.getWidth();
-			double pixels4bbox_height = ratio_y * Main.map.mapView.getHeight();
-
-			// Scale image to JOSM extents
-			double scalex = pixels4bbox_width / image.getWidth();
-			double scaley = pixels4bbox_height / image.getHeight();
-
-			g.scale(scalex, scaley);
-
-			// Draw picture
-			g.drawImage(image, 0, 0, null);
-			
-		} else {
-			logger.error("Error while dawing image: image == null or Graphics == null");
-		}
-	}
-	
-	public Envelope2D getBbox() {
-		return bbox;
-	}
-
-	@Override
-	public Icon getIcon() {
-		// TODO Auto-generated method stub
-		return this.layericon;
-	}
-
-	@Override
-	public Object getInfoComponent() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public Component[] getMenuEntries() {
+    private Logger logger = Logger.getLogger(ImageLayer.class);
+
+    private File imageFile;
+    
+    private BufferedImage image = null;
+
+    // coordinates of upper left corner
+    private EastNorth upperLeft;
+    // Angle of rotation of the image
+    private double angle = 0.0;
+
+    // current bbox
+    private Envelope2D bbox;
+    
+    // Layer icon
+    private Icon layericon = null;
+    
+    // reference system of the oringinal image
+    private CoordinateReferenceSystem sourceRefSys;
+
+
+
+    /**
+     * Constructor
+     * 
+     * @param file
+     * @throws IOException 
+     */
+    public ImageLayer(File file) throws IOException {
+        super(file.getName());
+        
+        this.imageFile = file;
+        this.image = (BufferedImage) createImage();
+        layericon = new ImageIcon(ImageImportPlugin.pluginClassLoader.getResource("images/layericon.png"));
+        
+    }
+
+    /**
+     * create spatial referenced image.
+     * 
+     * @return
+     * @throws IOException
+     */
+    private Image createImage() throws IOException {
+
+        // geotools type for images and value coverages
+        GridCoverage2D coverage = null;
+        try {
+            // create a grid coverage from the image
+            coverage = PluginOperations.createGridFromFile(imageFile, null);
+            this.sourceRefSys = coverage.getCoordinateReferenceSystem();
+            
+            // now reproject grid coverage
+            coverage = PluginOperations.reprojectCoverage(coverage, CRS.decode(Main.proj.toCode()));
+        
+        } catch (FactoryException e) {
+            logger.error("Error while creating GridCoverage:",e);
+            throw new IOException(e.getMessage());
+        } catch (Exception e) {
+            if(e.getMessage().contains("No projection file found"))
+            {
+                int useDefaultCRS = JOptionPane.showConfirmDialog(Main.parent, "<html>No projection file (.prj) found.<br>Use the default Coordinate Reference System instead?</html>", "Missing projection", JOptionPane.YES_NO_OPTION);
+                if (useDefaultCRS == 0)
+                {
+                    try {
+                        // create a grid coverage from the image
+                        coverage = PluginOperations.createGridFromFile(imageFile, PluginOperations.defaultSourceCRS);
+                        this.sourceRefSys = coverage.getCoordinateReferenceSystem();
+                        
+                        // now reproject grid coverage
+                        coverage = PluginOperations.reprojectCoverage(coverage, CRS.decode(Main.proj.toCode()));
+                    } catch (Exception e1) {
+                        logger.error("Error while creating GridCoverage:",e1);
+                        throw new IOException(e1);
+                    }
+                }
+                else{
+                    logger.debug("Layer creation cancled by user due to missing projection information.");
+                    throw new LayerCreationCancledException();
+                }
+
+            }
+            else
+            {
+                logger.error("Error while creating GridCoverage:",e);
+                throw new IOException(e);
+            }
+
+        }
+        logger.debug("Coverage created: " + coverage);
+
+        // TODO
+        upperLeft = new EastNorth(coverage.getEnvelope2D().y, coverage
+                .getEnvelope2D().x
+                + coverage.getEnvelope2D().width);
+        angle = 0;
+        bbox = coverage.getEnvelope2D();
+
+        // Refresh
+        // Main.map.mapView.repaint();
+//      PlanarImage image = (PlanarImage) coverage.getRenderedImage();
+//      logger.info("Color Model: " + coverage.getRenderedImage().getColorModel());
+        ImageWorker worker = new ImageWorker(coverage.getRenderedImage());
+
+        return worker.getBufferedImage();
+    }
+
+    @Override
+    public void paint(Graphics2D g2, MapView mv, Bounds bounds) {
+
+        if (image != null && g2 != null) {
+
+            // Position image at the right graphical place
+            EastNorth center = Main.map.mapView.getCenter();
+            EastNorth leftop = Main.map.mapView.getEastNorth(0, 0);
+            double pixel_per_lon_degree = (Main.map.mapView.getWidth() / 2.0)
+                    / (center.east() - leftop.east());
+            double pixel_per_lat_degree = (Main.map.mapView.getHeight() / 2.0)
+                    / (leftop.north() - center.north());
+
+            // This is now the offset in screen pixels
+            double pic_offset_x = ((upperLeft.east() - leftop.east()) * pixel_per_lon_degree);
+            double pic_offset_y = ((leftop.north() - upperLeft.north()) * pixel_per_lat_degree);
+
+            Graphics2D g = (Graphics2D) g2.create();
+
+            // Move picture by offset from upper left corner
+            g.translate(pic_offset_x, pic_offset_y);
+
+            // Rotate image by angle
+            g.rotate(angle * Math.PI / 180.0);
+            
+            // Determine scale to fit JOSM extents
+            ProjectionBounds projbounds = Main.map.mapView
+                    .getProjectionBounds();
+
+            double width = projbounds.max.getX() - projbounds.min.getX();
+            double height = projbounds.max.getY() - projbounds.min.getY();
+
+            double ratio_x = (this.bbox.getMaxY() - this.bbox.getMinY())
+                    / width;
+            double ratio_y = (this.bbox.getMaxX() - this.bbox.getMinX())
+                    / height;
+
+            double pixels4bbox_width = ratio_x * Main.map.mapView.getWidth();
+            double pixels4bbox_height = ratio_y * Main.map.mapView.getHeight();
+
+            // Scale image to JOSM extents
+            double scalex = pixels4bbox_width / image.getWidth();
+            double scaley = pixels4bbox_height / image.getHeight();
+
+            g.scale(scalex, scaley);
+
+            // Draw picture
+            g.drawImage(image, 0, 0, null);
+            
+        } else {
+            logger.error("Error while dawing image: image == null or Graphics == null");
+        }
+    }
+    
+    public Envelope2D getBbox() {
+        return bbox;
+    }
+
+    @Override
+    public Icon getIcon() {
+        // TODO Auto-generated method stub
+        return this.layericon;
+    }
+
+    @Override
+    public Object getInfoComponent() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public Component[] getMenuEntries() {
         return new Component[]{
                 new JMenuItem(LayerListDialog.getInstance().createActivateLayerAction(this)),
@@ -235,109 +235,109 @@
                 new JSeparator(),
                 new JMenuItem(new LayerListPopup.InfoAction(this))};
-	}
-
-	@Override
-	public boolean isMergable(Layer arg0) {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	@Override
-	public void mergeFrom(Layer arg0) {
-		// TODO Auto-generated method stub
-
-	}
-
-	@Override
-	public void visitBoundingBox(BoundingXYVisitor arg0) {
-		// TODO Auto-generated method stub
-	}
-	
-
-	@Override
-	public String getToolTipText() {
-		// TODO Auto-generated method stub
-		return this.getName();
-	}
-	
-
-	public File getImageFile() {
-		return imageFile;
-	}
-
-	public BufferedImage getImage() {
-		return image;
-	}
-	
-	/**
-	 * loads the image and reprojects it using a transformation
-	 * calculated by the new reference system.
-	 * 
-	 * @param newRefSys
-	 * @throws IOException 
-	 * @throws FactoryException 
-	 * @throws NoSuchAuthorityCodeException 
-	 */
-	void resample(CoordinateReferenceSystem refSys) throws IOException, NoSuchAuthorityCodeException, FactoryException
-	{
-		
-		GridCoverage2D coverage =  PluginOperations.createGridFromFile(this.imageFile, refSys);
-		coverage = PluginOperations.reprojectCoverage(coverage, CRS.decode(Main.proj.toCode()));
-		this.bbox = coverage.getEnvelope2D();
-		this.image = ((PlanarImage)coverage.getRenderedImage()).getAsBufferedImage();
-		
-		// TODO
-		upperLeft = new EastNorth(coverage.getEnvelope2D().y, coverage
-				.getEnvelope2D().x
-				+ coverage.getEnvelope2D().width);
-		angle = 0;
-
-		// repaint and zoom to new bbox
-		Main.map.mapView.repaint();
-		LatLon min = new LatLon(bbox.getMinX(), bbox.getMinY());
-		LatLon max = new LatLon(bbox.getMaxX(), bbox.getMaxY());
-		Main.map.mapView.zoomTo(new Bounds(min, max));
-		
-		
-	}
-	
-	/**
-	 * Action that creates a dialog GUI element with properties of a layer.
-	 * 
-	 */
-	public class LayerPropertiesAction extends AbstractAction
-	{
-		public ImageLayer imageLayer;
-		
-		public LayerPropertiesAction(ImageLayer imageLayer){
-			super(tr("Layer Properties"));
-			this.imageLayer = imageLayer;
-		}
-
-		public void actionPerformed(ActionEvent arg0) {
-			
-			LayerPropertiesDialog layerProps = new LayerPropertiesDialog(imageLayer, PluginOperations.crsDescriptions);
-			layerProps.setLocation(Main.parent.getWidth() / 4 , Main.parent.getHeight() / 4);
-			layerProps.setVisible(true);
-		}
-		
-	}
-	
-	/**
-	 * Exception which represents that the layer creation has been cancled by the
-	 * user.
-	 *
-	 */
-	class LayerCreationCancledException extends IOException{
-	}
-	
-	
-	
-	public CoordinateReferenceSystem getSourceRefSys() {
-		return sourceRefSys;
-	}
-
-	public void setSourceRefSys(CoordinateReferenceSystem sourceRefSys) {
-		this.sourceRefSys = sourceRefSys;
-	}
+    }
+
+    @Override
+    public boolean isMergable(Layer arg0) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    @Override
+    public void mergeFrom(Layer arg0) {
+        // TODO Auto-generated method stub
+
+    }
+
+    @Override
+    public void visitBoundingBox(BoundingXYVisitor arg0) {
+        // TODO Auto-generated method stub
+    }
+    
+
+    @Override
+    public String getToolTipText() {
+        // TODO Auto-generated method stub
+        return this.getName();
+    }
+    
+
+    public File getImageFile() {
+        return imageFile;
+    }
+
+    public BufferedImage getImage() {
+        return image;
+    }
+    
+    /**
+     * loads the image and reprojects it using a transformation
+     * calculated by the new reference system.
+     * 
+     * @param newRefSys
+     * @throws IOException 
+     * @throws FactoryException 
+     * @throws NoSuchAuthorityCodeException 
+     */
+    void resample(CoordinateReferenceSystem refSys) throws IOException, NoSuchAuthorityCodeException, FactoryException
+    {
+        
+        GridCoverage2D coverage =  PluginOperations.createGridFromFile(this.imageFile, refSys);
+        coverage = PluginOperations.reprojectCoverage(coverage, CRS.decode(Main.proj.toCode()));
+        this.bbox = coverage.getEnvelope2D();
+        this.image = ((PlanarImage)coverage.getRenderedImage()).getAsBufferedImage();
+        
+        // TODO
+        upperLeft = new EastNorth(coverage.getEnvelope2D().y, coverage
+                .getEnvelope2D().x
+                + coverage.getEnvelope2D().width);
+        angle = 0;
+
+        // repaint and zoom to new bbox
+        Main.map.mapView.repaint();
+        LatLon min = new LatLon(bbox.getMinX(), bbox.getMinY());
+        LatLon max = new LatLon(bbox.getMaxX(), bbox.getMaxY());
+        Main.map.mapView.zoomTo(new Bounds(min, max));
+        
+        
+    }
+    
+    /**
+     * Action that creates a dialog GUI element with properties of a layer.
+     * 
+     */
+    public class LayerPropertiesAction extends AbstractAction
+    {
+        public ImageLayer imageLayer;
+        
+        public LayerPropertiesAction(ImageLayer imageLayer){
+            super(tr("Layer Properties"));
+            this.imageLayer = imageLayer;
+        }
+
+        public void actionPerformed(ActionEvent arg0) {
+            
+            LayerPropertiesDialog layerProps = new LayerPropertiesDialog(imageLayer, PluginOperations.crsDescriptions);
+            layerProps.setLocation(Main.parent.getWidth() / 4 , Main.parent.getHeight() / 4);
+            layerProps.setVisible(true);
+        }
+        
+    }
+    
+    /**
+     * Exception which represents that the layer creation has been cancled by the
+     * user.
+     *
+     */
+    class LayerCreationCancledException extends IOException{
+    }
+    
+    
+    
+    public CoordinateReferenceSystem getSourceRefSys() {
+        return sourceRefSys;
+    }
+
+    public void setSourceRefSys(CoordinateReferenceSystem sourceRefSys) {
+        this.sourceRefSys = sourceRefSys;
+    }
 }
Index: /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java
===================================================================
--- /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java	(revision 23191)
+++ /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java	(revision 23192)
@@ -42,544 +42,544 @@
  */
 public class LayerPropertiesDialog extends JFrame{
-	
-	private Vector<String> supportedCRS;
-	private ImageLayer imageLayer;
-
-	private JPanel mainPanel = null;
-	private JPanel jPanel = null;
-	private JPanel buttonPanel = null;
-	private JTabbedPane jTabbedPane = null;
-	private JPanel infoPanel = null;
-	private JPanel crsPanel = null;
-	private JButton okButton = null;
-	private JLabel layerNameLabel = null;
-	private JLabel layerNameValueLabel = null;
-	private JLabel imageFileLabel = null;
-	private JLabel imageFileValueLabel = null;
-	private JLabel sizeLabel = null;
-	private JLabel sizeValueLabel = null;
-	private JLabel crsLabel = null;
-	private JLabel crsValueLabel = null;
-	private JLabel extentLabel = null;
-	private JLabel defaultCRSDescriptorLabel = null;
-	private JLabel defaultCRSLabel = null;
-	private JTextField searchField = null;
-	private JScrollPane crsListScrollPane = null;
-	private JList crsJList = null;
-	private JButton useDefaultCRSButton = null;
-	private JButton applySelectedCRSButton = null;
-	private JButton setSelectedCRSAsDefaultButton = null;
-	private JLabel searchFieldLabel = null;
-	private JCheckBox eastingFirstCheckBox = null;
-	private JLabel eastingFirstLabel = null;
-	private JLabel tabDescriptionLabel = null;
-	private JLabel upperLeftLabel = null;
-	private JLabel lowerLeftLabel = null;
-	private JLabel upperRightLabel = null;
-	private JLabel lowerRightLabel = null;
-	private JLabel upperLeftValueLabel = null;
-	private JLabel upperRightValueLabel = null;
-	private JLabel lowerLeftValueLabel = null;
-	private JLabel lowerRightValueLabel = null;
-	private JLabel currentCRSLabel = null;
-	private JLabel currentCRSValueLabel = null;
-
-	/**
-	 * This method initializes 
-	 * 
-	 */
-	public LayerPropertiesDialog(ImageLayer imageLayer, Vector<String> supportedCRS) {
-		super(imageLayer.getName());
-		this.supportedCRS = supportedCRS;
-		this.imageLayer = imageLayer;
-		initialize();
-	}
-	
-	/**
-	 * This method initializes 
-	 * 
-	 */
-	public LayerPropertiesDialog(Vector<String> supportedCRS) {
-		super();
-		this.supportedCRS = supportedCRS;
-		initialize();
-	}
-	
-
-	/**
-	 * This method initializes this
-	 * 
-	 */
-	private void initialize() {
+    
+    private Vector<String> supportedCRS;
+    private ImageLayer imageLayer;
+
+    private JPanel mainPanel = null;
+    private JPanel jPanel = null;
+    private JPanel buttonPanel = null;
+    private JTabbedPane jTabbedPane = null;
+    private JPanel infoPanel = null;
+    private JPanel crsPanel = null;
+    private JButton okButton = null;
+    private JLabel layerNameLabel = null;
+    private JLabel layerNameValueLabel = null;
+    private JLabel imageFileLabel = null;
+    private JLabel imageFileValueLabel = null;
+    private JLabel sizeLabel = null;
+    private JLabel sizeValueLabel = null;
+    private JLabel crsLabel = null;
+    private JLabel crsValueLabel = null;
+    private JLabel extentLabel = null;
+    private JLabel defaultCRSDescriptorLabel = null;
+    private JLabel defaultCRSLabel = null;
+    private JTextField searchField = null;
+    private JScrollPane crsListScrollPane = null;
+    private JList crsJList = null;
+    private JButton useDefaultCRSButton = null;
+    private JButton applySelectedCRSButton = null;
+    private JButton setSelectedCRSAsDefaultButton = null;
+    private JLabel searchFieldLabel = null;
+    private JCheckBox eastingFirstCheckBox = null;
+    private JLabel eastingFirstLabel = null;
+    private JLabel tabDescriptionLabel = null;
+    private JLabel upperLeftLabel = null;
+    private JLabel lowerLeftLabel = null;
+    private JLabel upperRightLabel = null;
+    private JLabel lowerRightLabel = null;
+    private JLabel upperLeftValueLabel = null;
+    private JLabel upperRightValueLabel = null;
+    private JLabel lowerLeftValueLabel = null;
+    private JLabel lowerRightValueLabel = null;
+    private JLabel currentCRSLabel = null;
+    private JLabel currentCRSValueLabel = null;
+
+    /**
+     * This method initializes 
+     * 
+     */
+    public LayerPropertiesDialog(ImageLayer imageLayer, Vector<String> supportedCRS) {
+        super(imageLayer.getName());
+        this.supportedCRS = supportedCRS;
+        this.imageLayer = imageLayer;
+        initialize();
+    }
+    
+    /**
+     * This method initializes 
+     * 
+     */
+    public LayerPropertiesDialog(Vector<String> supportedCRS) {
+        super();
+        this.supportedCRS = supportedCRS;
+        initialize();
+    }
+    
+
+    /**
+     * This method initializes this
+     * 
+     */
+    private void initialize() {
         this.setMinimumSize(new Dimension(404, 485));
         this.setContentPane(getMainPanel());
         this.setPreferredSize(new Dimension(404, 485));
-			
-	}
-
-	/**
-	 * This method initializes mainPanel	
-	 * 	
-	 * @return javax.swing.JPanel	
-	 */
-	private JPanel getMainPanel() {
-		if (mainPanel == null) {
-			mainPanel = new JPanel();
-			mainPanel.setLayout(null);
-			mainPanel.add(getJPanel(), null);
-			mainPanel.add(getButtonPanel(), null);
-		}
-		return mainPanel;
-	}
-
-	/**
-	 * This method initializes jPanel	
-	 * 	
-	 * @return javax.swing.JPanel	
-	 */
-	private JPanel getJPanel() {
-		if (jPanel == null) {
-			GridBagConstraints gridBagConstraints = new GridBagConstraints();
-			gridBagConstraints.fill = GridBagConstraints.BOTH;
-			gridBagConstraints.gridy = 0;
-			gridBagConstraints.weightx = 1.0;
-			gridBagConstraints.weighty = 1.0;
-			gridBagConstraints.gridx = 0;
-			jPanel = new JPanel();
-			jPanel.setLayout(new GridBagLayout());
-			jPanel.setBounds(new Rectangle(0, 0, 391, 406));
-			jPanel.add(getJTabbedPane(), gridBagConstraints);
-		}
-		return jPanel;
-	}
-
-	/**
-	 * This method initializes buttonPanel	
-	 * 	
-	 * @return javax.swing.JPanel	
-	 */
-	private JPanel getButtonPanel() {
-		if (buttonPanel == null) {
-			buttonPanel = new JPanel();
-			buttonPanel.setLayout(null);
-			buttonPanel.setBounds(new Rectangle(0, 405, 391, 46));
-			buttonPanel.add(getOkButton(), null);
-		}
-		return buttonPanel;
-	}
-
-	/**
-	 * This method initializes jTabbedPane	
-	 * 	
-	 * @return javax.swing.JTabbedPane	
-	 */
-	private JTabbedPane getJTabbedPane() {
-		if (jTabbedPane == null) {
-			jTabbedPane = new JTabbedPane();
-			jTabbedPane.addTab("General Information", null, getInfoPanel(), null);
-			jTabbedPane.addTab("Source Reference System", null, getCrsPanel(), null);
-		}
-		return jTabbedPane;
-	}
-
-	/**
-	 * This method initializes infoPanel	
-	 * 	
-	 * @return javax.swing.JPanel	
-	 */
-	private JPanel getInfoPanel() {
-		if (infoPanel == null) {
-			lowerRightValueLabel = new JLabel();
-			lowerRightValueLabel.setBounds(new Rectangle(210, 315, 134, 16));
-			lowerRightValueLabel.setHorizontalAlignment(SwingConstants.RIGHT);
-			lowerRightValueLabel.setText((float)imageLayer.getBbox().getMinX() + ", " + (float)imageLayer.getBbox().getMaxY());
-			lowerLeftValueLabel = new JLabel();
-			lowerLeftValueLabel.setBounds(new Rectangle(30, 315, 133, 16));
-			lowerLeftValueLabel.setHorizontalAlignment(SwingConstants.LEFT);
-			lowerLeftValueLabel.setText((float)imageLayer.getBbox().getMinX() + ", " + (float)imageLayer.getBbox().getMinY());
-			upperRightValueLabel = new JLabel();
-			upperRightValueLabel.setBounds(new Rectangle(210, 255, 138, 16));
-			upperRightValueLabel.setHorizontalAlignment(SwingConstants.RIGHT);
-			upperRightValueLabel.setText((float)imageLayer.getBbox().getMaxX() + ", " + (float)imageLayer.getBbox().getMaxY());
-			upperLeftValueLabel = new JLabel();
-			upperLeftValueLabel.setBounds(new Rectangle(30, 255, 133, 16));
-			upperLeftValueLabel.setHorizontalAlignment(SwingConstants.LEFT);
-			upperLeftValueLabel.setText((float)imageLayer.getBbox().getMaxX() + ", " + (float)imageLayer.getBbox().getMinY());
-			lowerRightLabel = new JLabel();
-			lowerRightLabel.setBounds(new Rectangle(287, 344, 74, 16));
-			lowerRightLabel.setText("Lower Right");
-			upperRightLabel = new JLabel();
-			upperRightLabel.setBounds(new Rectangle(285, 225, 91, 16));
-			upperRightLabel.setText("Upper Right");
-			lowerLeftLabel = new JLabel();
-			lowerLeftLabel.setBounds(new Rectangle(15, 345, 92, 16));
-			lowerLeftLabel.setText("Lower Left");
-			upperLeftLabel = new JLabel();
-			upperLeftLabel.setBounds(new Rectangle(15, 224, 91, 16));
-			upperLeftLabel.setText("Upper Left");
-			extentLabel = new JLabel();
-			extentLabel.setBounds(new Rectangle(120, 195, 136, 16));
-			extentLabel.setEnabled(false);
-			extentLabel.setHorizontalAlignment(SwingConstants.CENTER);
-			extentLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
-			extentLabel.setText("Extent");
-			crsValueLabel = new JLabel();
-			crsValueLabel.setBounds(new Rectangle(150, 150, 226, 16));
-			
-			String crsDescription = "";
-			try {
-				crsDescription = imageLayer.getBbox().getCoordinateReferenceSystem().getIdentifiers().iterator().next().toString();
-			} catch (Exception e) {
-			}
-			crsValueLabel.setText(crsDescription + "(" + imageLayer.getBbox().getCoordinateReferenceSystem().getName().toString() + ")");
-			
-			crsLabel = new JLabel();
-			crsLabel.setBounds(new Rectangle(15, 150, 118, 16));
-			crsLabel.setText("Reference System");
-			sizeValueLabel = new JLabel();
-			sizeValueLabel.setBounds(new Rectangle(150, 105, 226, 16));
-			sizeValueLabel.setText(imageLayer.getImage().getHeight() + " x " + imageLayer.getImage().getWidth());
-			sizeLabel = new JLabel();
-			sizeLabel.setBounds(new Rectangle(15, 105, 121, 16));
-			sizeLabel.setText("Image size");
-			imageFileValueLabel = new JLabel();
-			imageFileValueLabel.setBounds(new Rectangle(150, 60, 226, 16));
-			imageFileValueLabel.setText(imageLayer.getImageFile().getAbsolutePath());
-			imageFileValueLabel.setToolTipText(imageLayer.getImageFile().getAbsolutePath());
-			imageFileLabel = new JLabel();
-			imageFileLabel.setBounds(new Rectangle(15, 60, 121, 16));
-			imageFileLabel.setText("Image file");
-			layerNameValueLabel = new JLabel();
-			layerNameValueLabel.setBounds(new Rectangle(150, 15, 226, 16));
-			layerNameValueLabel.setText(imageLayer.getName());
-			layerNameLabel = new JLabel();
-			layerNameLabel.setBounds(new Rectangle(15, 15, 121, 16));
-			layerNameLabel.setText("Layer name");
-			infoPanel = new JPanel();
-			infoPanel.setLayout(null);
-			infoPanel.setFont(new Font("Dialog", Font.BOLD, 12));
-			infoPanel.add(layerNameLabel, null);
-			infoPanel.add(layerNameValueLabel, null);
-			infoPanel.add(imageFileLabel, null);
-			infoPanel.add(imageFileValueLabel, null);
-			infoPanel.add(sizeLabel, null);
-			infoPanel.add(sizeValueLabel, null);
-			infoPanel.add(crsLabel, null);
-			infoPanel.add(crsValueLabel, null);
-			infoPanel.add(extentLabel, null);
-			infoPanel.add(upperLeftLabel, null);
-			infoPanel.add(lowerLeftLabel, null);
-			infoPanel.add(upperRightLabel, null);
-			infoPanel.add(lowerRightLabel, null);
-			infoPanel.add(upperLeftValueLabel, null);
-			infoPanel.add(upperRightValueLabel, null);
-			infoPanel.add(lowerLeftValueLabel, null);
-			infoPanel.add(lowerRightValueLabel, null);
-		}
-		return infoPanel;
-	}
-
-	/**
-	 * This method initializes crsPanel	
-	 * 	
-	 * @return javax.swing.JPanel	
-	 */
-	private JPanel getCrsPanel() {
-		if (crsPanel == null) {
-			currentCRSValueLabel = new JLabel();
-			currentCRSValueLabel.setBounds(new Rectangle(78, 33, 297, 16));
-			String crsDescription = "unknown";
-			try {
-				crsDescription = imageLayer.getSourceRefSys().getIdentifiers().iterator().next().toString();
-			} catch (Exception e) {
-			}
-			currentCRSValueLabel.setText(crsDescription);
-			
-			currentCRSLabel = new JLabel();
-			currentCRSLabel.setBounds(new Rectangle(15, 33, 52, 16));
-			currentCRSLabel.setText("Current:");
-			tabDescriptionLabel = new JLabel();
-			tabDescriptionLabel.setBounds(new Rectangle(15, 9, 361, 16));
-			tabDescriptionLabel.setText("Set here the source reference system of the image");
-			eastingFirstLabel = new JLabel();
-			eastingFirstLabel.setBounds(new Rectangle(315, 210, 76, 46));
-			eastingFirstLabel.setHorizontalTextPosition(SwingConstants.TRAILING);
-			eastingFirstLabel.setHorizontalAlignment(SwingConstants.CENTER);
-			eastingFirstLabel.setText("<html>Easting<br>first</html>");
-			searchFieldLabel = new JLabel();
-			searchFieldLabel.setBounds(new Rectangle(298, 114, 84, 16));
-			searchFieldLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
-			searchFieldLabel.setHorizontalTextPosition(SwingConstants.TRAILING);
-			searchFieldLabel.setHorizontalAlignment(SwingConstants.CENTER);
-			searchFieldLabel.setText("Search");
-			defaultCRSLabel = new JLabel();
-			defaultCRSLabel.setBounds(new Rectangle(15, 89, 361, 16));
-			defaultCRSLabel.setText(PluginOperations.defaultSourceCRSDescription);
-			defaultCRSDescriptorLabel = new JLabel();
-			defaultCRSDescriptorLabel.setBounds(new Rectangle(15, 63, 226, 16));
-			defaultCRSDescriptorLabel.setText("Default Reference System:");
-			crsPanel = new JPanel();
-			crsPanel.setLayout(null);
-			crsPanel.add(defaultCRSDescriptorLabel, null);
-			crsPanel.add(defaultCRSLabel, null);
-			crsPanel.add(getSearchField(), null);
-			crsPanel.add(getCrsListScrollPane(), null);
-			crsPanel.add(getUseDefaultCRSButton(), null);
-			crsPanel.add(getApplySelectedCRSButton(), null);
-			crsPanel.add(getSetSelectedCRSAsDefaultButton(), null);
-			crsPanel.add(searchFieldLabel, null);
-			crsPanel.add(getEastingFirstCheckBox(), null);
-			crsPanel.add(eastingFirstLabel, null);
-			crsPanel.add(tabDescriptionLabel, null);
-			crsPanel.add(currentCRSLabel, null);
-			crsPanel.add(currentCRSValueLabel, null);
-		}
-		return crsPanel;
-	}
-
-	/**
-	 * This method initializes okButton	
-	 * 	
-	 * @return javax.swing.JButton	
-	 */
-	private JButton getOkButton() {
-		if (okButton == null) {
-			okButton = new JButton();
-			okButton.setBounds(new Rectangle(134, 5, 136, 31));
-			okButton.setText("OK");
-			okButton.addActionListener(new java.awt.event.ActionListener() {
-				public void actionPerformed(java.awt.event.ActionEvent e) {
-					
-					setVisible(false);
-					dispose();
-				}
-			});
-		}
-		return okButton;
-	}
-
-	/**
-	 * This method initializes searchField	
-	 * 	
-	 * @return javax.swing.JTextField	
-	 */
-	private JTextField getSearchField() {
-		if (searchField == null) {
-			searchField = new JTextField();
-			searchField.setBounds(new Rectangle(13, 111, 282, 20));
-			searchField.setToolTipText("Enter keywords or EPSG codes");
-			searchField.addKeyListener(new java.awt.event.KeyAdapter() {
-				public void keyTyped(java.awt.event.KeyEvent e) {
-					
-					for (Iterator iterator = supportedCRS.iterator(); iterator
-							.hasNext();) {
-						String type = (String) iterator.next();
-						if(type.contains(searchField.getText()))
-						{
-							crsJList.setSelectedIndex(supportedCRS.indexOf(type));
-							crsJList.ensureIndexIsVisible(supportedCRS.indexOf(type));
-							break;
-						}
-						
-					}
-				}
-			});
-		}
-		return searchField;
-	}
-
-	/**
-	 * This method initializes crsListScrollPane	
-	 * 	
-	 * @return javax.swing.JScrollPane	
-	 */
-	private JScrollPane getCrsListScrollPane() {
-		if (crsListScrollPane == null) {
-			crsListScrollPane = new JScrollPane();
-			crsListScrollPane.setBounds(new Rectangle(15, 135, 301, 241));
-			crsListScrollPane.setViewportView(getCrsJList());
-		}
-		return crsListScrollPane;
-	}
-
-	/**
-	 * This method initializes crsJList	
-	 * 	
-	 * @return javax.swing.JList	
-	 */
-	private JList getCrsJList() {
-		if (crsJList == null) {
-			crsJList = new JList(supportedCRS);
-			crsJList.addListSelectionListener(new ListSelectionHandler());
-		}
-		return crsJList;
-	}
-
-	/**
-	 * This method initializes useDefaultCRSButton	
-	 * 	
-	 * @return javax.swing.JButton	
-	 */
-	private JButton getUseDefaultCRSButton() {
-		if (useDefaultCRSButton == null) {
-			useDefaultCRSButton = new JButton();
-			useDefaultCRSButton.setBounds(new Rectangle(253, 54, 118, 28));
-			useDefaultCRSButton.setText("Apply Default");
-			useDefaultCRSButton.addActionListener(new java.awt.event.ActionListener() {
-				public void actionPerformed(java.awt.event.ActionEvent e) {
-					
-					try {
-						
-						setCursor(new Cursor(Cursor.WAIT_CURSOR));
-						if(PluginOperations.defaultSourceCRS != null){
-							imageLayer.resample(PluginOperations.defaultSourceCRS);
-						}else
-						{
-							JOptionPane.showMessageDialog(getContentPane(), "<html>No default reference system available.<br>Please select one from the list</html>");
-						}
-						
-					} catch (NoSuchAuthorityCodeException e1) {
-						// TODO Auto-generated catch block
-						e1.printStackTrace();
-					} catch (FactoryException e1) {
-						// TODO Auto-generated catch block
-						e1.printStackTrace();
-					} catch (IOException e2) {
-						// TODO Auto-generated catch block
-						e2.printStackTrace();
-					}
-					finally{
-						setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
-					}
-				}
-			});
-		}
-		return useDefaultCRSButton;
-	}
-
-	/**
-	 * This method initializes applySelectedCRSButton	
-	 * 	
-	 * @return javax.swing.JButton	
-	 */
-	private JButton getApplySelectedCRSButton() {
-		if (applySelectedCRSButton == null) {
-			applySelectedCRSButton = new JButton();
-			applySelectedCRSButton.setBounds(new Rectangle(315, 135, 69, 61));
-			applySelectedCRSButton.setHorizontalAlignment(SwingConstants.CENTER);
-			applySelectedCRSButton.setHorizontalTextPosition(SwingConstants.TRAILING);
-			applySelectedCRSButton.setText("<html>Apply<br>Selection</html>");
-			applySelectedCRSButton.addActionListener(new java.awt.event.ActionListener() {
-				public void actionPerformed(java.awt.event.ActionEvent e) {
-					
-					String selection = (String) crsJList.getSelectedValue();
-					String code = selection.substring(selection.indexOf("[-") + 2, selection.indexOf("-]"));
-					
-					CoordinateReferenceSystem newRefSys = null;
-					try {
-						newRefSys = CRS.decode(code, eastingFirstCheckBox.isSelected());
-						
-						setCursor(new Cursor(Cursor.WAIT_CURSOR));
-						
-						imageLayer.resample(newRefSys);
-
-					} catch (NoSuchAuthorityCodeException e1) {
-						// TODO Auto-generated catch block
-						e1.printStackTrace();
-					} catch (FactoryException e1) {
-						// TODO Auto-generated catch block
-						e1.printStackTrace();
-					} catch (IOException e2) {
-						// TODO Auto-generated catch block
-						e2.printStackTrace();
-					}
-					finally{
-						setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
-					}
-					
-					
-				}
-			});
-		}
-		return applySelectedCRSButton;
-	}
-
-	/**
-	 * This method initializes setSelectedCRSAsDefaultButton	
-	 * 	
-	 * @return javax.swing.JButton	
-	 */
-	private JButton getSetSelectedCRSAsDefaultButton() {
-		if (setSelectedCRSAsDefaultButton == null) {
-			setSelectedCRSAsDefaultButton = new JButton();
-			setSelectedCRSAsDefaultButton.setBounds(new Rectangle(315, 300, 69, 61));
-			setSelectedCRSAsDefaultButton.setText("<html>Set as<br>Default</html>");
-			setSelectedCRSAsDefaultButton
-					.addActionListener(new java.awt.event.ActionListener() {
-						public void actionPerformed(java.awt.event.ActionEvent e) {
-							
-							if(crsJList.getSelectedValue() != null){
-								String selection = (String) crsJList.getSelectedValue();
-								String code = selection.substring(selection.indexOf("[-") + 2, selection.indexOf("-]"));
-								
-								try {
-									PluginOperations.defaultSourceCRS = CRS.decode(code, eastingFirstCheckBox.isSelected());
-									PluginOperations.defaultSourceCRSDescription = selection;
-									
-									ImageImportPlugin.pluginProps.setProperty("default_crs_eastingfirst", "" + eastingFirstCheckBox.isSelected());
-									ImageImportPlugin.pluginProps.setProperty("default_crs_srid", code);
-									FileWriter fileWriter = new FileWriter(new File(ImageImportPlugin.PLUGINPROPERTIES_PATH));
-									ImageImportPlugin.pluginProps.store(fileWriter, null);
-									fileWriter.close();
-									
-									defaultCRSLabel.setText(selection);
-									
-								} catch (IOException e2) {
-									// TODO Auto-generated catch block
-									e2.printStackTrace();
-								} catch (NoSuchAuthorityCodeException e3) {
-									// TODO Auto-generated catch block
-									e3.printStackTrace();
-								} catch (FactoryException e4) {
-									// TODO Auto-generated catch block
-									e4.printStackTrace();
-								}
-							}else{
-								JOptionPane.showMessageDialog(getContentPane(), "Please make a selection from the list.");
-							}
-
-							
-						}
-					});
-		}
-		return setSelectedCRSAsDefaultButton;
-	}
-	
-	/**
-	 * This method initializes eastingFirstCheckBox	
-	 * 	
-	 * @return javax.swing.JCheckBox	
-	 */
-	private JCheckBox getEastingFirstCheckBox() {
-		if (eastingFirstCheckBox == null) {
-			eastingFirstCheckBox = new JCheckBox();
-			eastingFirstCheckBox.setBounds(new Rectangle(345, 255, 21, 21));
-		}
-		return eastingFirstCheckBox;
-	}
-
-	
-	
-	/**
-	 * Listener setting text in the search field if selection has changed.
-	 *
-	 */
+            
+    }
+
+    /**
+     * This method initializes mainPanel    
+     *  
+     * @return javax.swing.JPanel   
+     */
+    private JPanel getMainPanel() {
+        if (mainPanel == null) {
+            mainPanel = new JPanel();
+            mainPanel.setLayout(null);
+            mainPanel.add(getJPanel(), null);
+            mainPanel.add(getButtonPanel(), null);
+        }
+        return mainPanel;
+    }
+
+    /**
+     * This method initializes jPanel   
+     *  
+     * @return javax.swing.JPanel   
+     */
+    private JPanel getJPanel() {
+        if (jPanel == null) {
+            GridBagConstraints gridBagConstraints = new GridBagConstraints();
+            gridBagConstraints.fill = GridBagConstraints.BOTH;
+            gridBagConstraints.gridy = 0;
+            gridBagConstraints.weightx = 1.0;
+            gridBagConstraints.weighty = 1.0;
+            gridBagConstraints.gridx = 0;
+            jPanel = new JPanel();
+            jPanel.setLayout(new GridBagLayout());
+            jPanel.setBounds(new Rectangle(0, 0, 391, 406));
+            jPanel.add(getJTabbedPane(), gridBagConstraints);
+        }
+        return jPanel;
+    }
+
+    /**
+     * This method initializes buttonPanel  
+     *  
+     * @return javax.swing.JPanel   
+     */
+    private JPanel getButtonPanel() {
+        if (buttonPanel == null) {
+            buttonPanel = new JPanel();
+            buttonPanel.setLayout(null);
+            buttonPanel.setBounds(new Rectangle(0, 405, 391, 46));
+            buttonPanel.add(getOkButton(), null);
+        }
+        return buttonPanel;
+    }
+
+    /**
+     * This method initializes jTabbedPane  
+     *  
+     * @return javax.swing.JTabbedPane  
+     */
+    private JTabbedPane getJTabbedPane() {
+        if (jTabbedPane == null) {
+            jTabbedPane = new JTabbedPane();
+            jTabbedPane.addTab("General Information", null, getInfoPanel(), null);
+            jTabbedPane.addTab("Source Reference System", null, getCrsPanel(), null);
+        }
+        return jTabbedPane;
+    }
+
+    /**
+     * This method initializes infoPanel    
+     *  
+     * @return javax.swing.JPanel   
+     */
+    private JPanel getInfoPanel() {
+        if (infoPanel == null) {
+            lowerRightValueLabel = new JLabel();
+            lowerRightValueLabel.setBounds(new Rectangle(210, 315, 134, 16));
+            lowerRightValueLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+            lowerRightValueLabel.setText((float)imageLayer.getBbox().getMinX() + ", " + (float)imageLayer.getBbox().getMaxY());
+            lowerLeftValueLabel = new JLabel();
+            lowerLeftValueLabel.setBounds(new Rectangle(30, 315, 133, 16));
+            lowerLeftValueLabel.setHorizontalAlignment(SwingConstants.LEFT);
+            lowerLeftValueLabel.setText((float)imageLayer.getBbox().getMinX() + ", " + (float)imageLayer.getBbox().getMinY());
+            upperRightValueLabel = new JLabel();
+            upperRightValueLabel.setBounds(new Rectangle(210, 255, 138, 16));
+            upperRightValueLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+            upperRightValueLabel.setText((float)imageLayer.getBbox().getMaxX() + ", " + (float)imageLayer.getBbox().getMaxY());
+            upperLeftValueLabel = new JLabel();
+            upperLeftValueLabel.setBounds(new Rectangle(30, 255, 133, 16));
+            upperLeftValueLabel.setHorizontalAlignment(SwingConstants.LEFT);
+            upperLeftValueLabel.setText((float)imageLayer.getBbox().getMaxX() + ", " + (float)imageLayer.getBbox().getMinY());
+            lowerRightLabel = new JLabel();
+            lowerRightLabel.setBounds(new Rectangle(287, 344, 74, 16));
+            lowerRightLabel.setText("Lower Right");
+            upperRightLabel = new JLabel();
+            upperRightLabel.setBounds(new Rectangle(285, 225, 91, 16));
+            upperRightLabel.setText("Upper Right");
+            lowerLeftLabel = new JLabel();
+            lowerLeftLabel.setBounds(new Rectangle(15, 345, 92, 16));
+            lowerLeftLabel.setText("Lower Left");
+            upperLeftLabel = new JLabel();
+            upperLeftLabel.setBounds(new Rectangle(15, 224, 91, 16));
+            upperLeftLabel.setText("Upper Left");
+            extentLabel = new JLabel();
+            extentLabel.setBounds(new Rectangle(120, 195, 136, 16));
+            extentLabel.setEnabled(false);
+            extentLabel.setHorizontalAlignment(SwingConstants.CENTER);
+            extentLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
+            extentLabel.setText("Extent");
+            crsValueLabel = new JLabel();
+            crsValueLabel.setBounds(new Rectangle(150, 150, 226, 16));
+            
+            String crsDescription = "";
+            try {
+                crsDescription = imageLayer.getBbox().getCoordinateReferenceSystem().getIdentifiers().iterator().next().toString();
+            } catch (Exception e) {
+            }
+            crsValueLabel.setText(crsDescription + "(" + imageLayer.getBbox().getCoordinateReferenceSystem().getName().toString() + ")");
+            
+            crsLabel = new JLabel();
+            crsLabel.setBounds(new Rectangle(15, 150, 118, 16));
+            crsLabel.setText("Reference System");
+            sizeValueLabel = new JLabel();
+            sizeValueLabel.setBounds(new Rectangle(150, 105, 226, 16));
+            sizeValueLabel.setText(imageLayer.getImage().getHeight() + " x " + imageLayer.getImage().getWidth());
+            sizeLabel = new JLabel();
+            sizeLabel.setBounds(new Rectangle(15, 105, 121, 16));
+            sizeLabel.setText("Image size");
+            imageFileValueLabel = new JLabel();
+            imageFileValueLabel.setBounds(new Rectangle(150, 60, 226, 16));
+            imageFileValueLabel.setText(imageLayer.getImageFile().getAbsolutePath());
+            imageFileValueLabel.setToolTipText(imageLayer.getImageFile().getAbsolutePath());
+            imageFileLabel = new JLabel();
+            imageFileLabel.setBounds(new Rectangle(15, 60, 121, 16));
+            imageFileLabel.setText("Image file");
+            layerNameValueLabel = new JLabel();
+            layerNameValueLabel.setBounds(new Rectangle(150, 15, 226, 16));
+            layerNameValueLabel.setText(imageLayer.getName());
+            layerNameLabel = new JLabel();
+            layerNameLabel.setBounds(new Rectangle(15, 15, 121, 16));
+            layerNameLabel.setText("Layer name");
+            infoPanel = new JPanel();
+            infoPanel.setLayout(null);
+            infoPanel.setFont(new Font("Dialog", Font.BOLD, 12));
+            infoPanel.add(layerNameLabel, null);
+            infoPanel.add(layerNameValueLabel, null);
+            infoPanel.add(imageFileLabel, null);
+            infoPanel.add(imageFileValueLabel, null);
+            infoPanel.add(sizeLabel, null);
+            infoPanel.add(sizeValueLabel, null);
+            infoPanel.add(crsLabel, null);
+            infoPanel.add(crsValueLabel, null);
+            infoPanel.add(extentLabel, null);
+            infoPanel.add(upperLeftLabel, null);
+            infoPanel.add(lowerLeftLabel, null);
+            infoPanel.add(upperRightLabel, null);
+            infoPanel.add(lowerRightLabel, null);
+            infoPanel.add(upperLeftValueLabel, null);
+            infoPanel.add(upperRightValueLabel, null);
+            infoPanel.add(lowerLeftValueLabel, null);
+            infoPanel.add(lowerRightValueLabel, null);
+        }
+        return infoPanel;
+    }
+
+    /**
+     * This method initializes crsPanel 
+     *  
+     * @return javax.swing.JPanel   
+     */
+    private JPanel getCrsPanel() {
+        if (crsPanel == null) {
+            currentCRSValueLabel = new JLabel();
+            currentCRSValueLabel.setBounds(new Rectangle(78, 33, 297, 16));
+            String crsDescription = "unknown";
+            try {
+                crsDescription = imageLayer.getSourceRefSys().getIdentifiers().iterator().next().toString();
+            } catch (Exception e) {
+            }
+            currentCRSValueLabel.setText(crsDescription);
+            
+            currentCRSLabel = new JLabel();
+            currentCRSLabel.setBounds(new Rectangle(15, 33, 52, 16));
+            currentCRSLabel.setText("Current:");
+            tabDescriptionLabel = new JLabel();
+            tabDescriptionLabel.setBounds(new Rectangle(15, 9, 361, 16));
+            tabDescriptionLabel.setText("Set here the source reference system of the image");
+            eastingFirstLabel = new JLabel();
+            eastingFirstLabel.setBounds(new Rectangle(315, 210, 76, 46));
+            eastingFirstLabel.setHorizontalTextPosition(SwingConstants.TRAILING);
+            eastingFirstLabel.setHorizontalAlignment(SwingConstants.CENTER);
+            eastingFirstLabel.setText("<html>Easting<br>first</html>");
+            searchFieldLabel = new JLabel();
+            searchFieldLabel.setBounds(new Rectangle(298, 114, 84, 16));
+            searchFieldLabel.setDisplayedMnemonic(KeyEvent.VK_UNDEFINED);
+            searchFieldLabel.setHorizontalTextPosition(SwingConstants.TRAILING);
+            searchFieldLabel.setHorizontalAlignment(SwingConstants.CENTER);
+            searchFieldLabel.setText("Search");
+            defaultCRSLabel = new JLabel();
+            defaultCRSLabel.setBounds(new Rectangle(15, 89, 361, 16));
+            defaultCRSLabel.setText(PluginOperations.defaultSourceCRSDescription);
+            defaultCRSDescriptorLabel = new JLabel();
+            defaultCRSDescriptorLabel.setBounds(new Rectangle(15, 63, 226, 16));
+            defaultCRSDescriptorLabel.setText("Default Reference System:");
+            crsPanel = new JPanel();
+            crsPanel.setLayout(null);
+            crsPanel.add(defaultCRSDescriptorLabel, null);
+            crsPanel.add(defaultCRSLabel, null);
+            crsPanel.add(getSearchField(), null);
+            crsPanel.add(getCrsListScrollPane(), null);
+            crsPanel.add(getUseDefaultCRSButton(), null);
+            crsPanel.add(getApplySelectedCRSButton(), null);
+            crsPanel.add(getSetSelectedCRSAsDefaultButton(), null);
+            crsPanel.add(searchFieldLabel, null);
+            crsPanel.add(getEastingFirstCheckBox(), null);
+            crsPanel.add(eastingFirstLabel, null);
+            crsPanel.add(tabDescriptionLabel, null);
+            crsPanel.add(currentCRSLabel, null);
+            crsPanel.add(currentCRSValueLabel, null);
+        }
+        return crsPanel;
+    }
+
+    /**
+     * This method initializes okButton 
+     *  
+     * @return javax.swing.JButton  
+     */
+    private JButton getOkButton() {
+        if (okButton == null) {
+            okButton = new JButton();
+            okButton.setBounds(new Rectangle(134, 5, 136, 31));
+            okButton.setText("OK");
+            okButton.addActionListener(new java.awt.event.ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent e) {
+                    
+                    setVisible(false);
+                    dispose();
+                }
+            });
+        }
+        return okButton;
+    }
+
+    /**
+     * This method initializes searchField  
+     *  
+     * @return javax.swing.JTextField   
+     */
+    private JTextField getSearchField() {
+        if (searchField == null) {
+            searchField = new JTextField();
+            searchField.setBounds(new Rectangle(13, 111, 282, 20));
+            searchField.setToolTipText("Enter keywords or EPSG codes");
+            searchField.addKeyListener(new java.awt.event.KeyAdapter() {
+                public void keyTyped(java.awt.event.KeyEvent e) {
+                    
+                    for (Iterator iterator = supportedCRS.iterator(); iterator
+                            .hasNext();) {
+                        String type = (String) iterator.next();
+                        if(type.contains(searchField.getText()))
+                        {
+                            crsJList.setSelectedIndex(supportedCRS.indexOf(type));
+                            crsJList.ensureIndexIsVisible(supportedCRS.indexOf(type));
+                            break;
+                        }
+                        
+                    }
+                }
+            });
+        }
+        return searchField;
+    }
+
+    /**
+     * This method initializes crsListScrollPane    
+     *  
+     * @return javax.swing.JScrollPane  
+     */
+    private JScrollPane getCrsListScrollPane() {
+        if (crsListScrollPane == null) {
+            crsListScrollPane = new JScrollPane();
+            crsListScrollPane.setBounds(new Rectangle(15, 135, 301, 241));
+            crsListScrollPane.setViewportView(getCrsJList());
+        }
+        return crsListScrollPane;
+    }
+
+    /**
+     * This method initializes crsJList 
+     *  
+     * @return javax.swing.JList    
+     */
+    private JList getCrsJList() {
+        if (crsJList == null) {
+            crsJList = new JList(supportedCRS);
+            crsJList.addListSelectionListener(new ListSelectionHandler());
+        }
+        return crsJList;
+    }
+
+    /**
+     * This method initializes useDefaultCRSButton  
+     *  
+     * @return javax.swing.JButton  
+     */
+    private JButton getUseDefaultCRSButton() {
+        if (useDefaultCRSButton == null) {
+            useDefaultCRSButton = new JButton();
+            useDefaultCRSButton.setBounds(new Rectangle(253, 54, 118, 28));
+            useDefaultCRSButton.setText("Apply Default");
+            useDefaultCRSButton.addActionListener(new java.awt.event.ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent e) {
+                    
+                    try {
+                        
+                        setCursor(new Cursor(Cursor.WAIT_CURSOR));
+                        if(PluginOperations.defaultSourceCRS != null){
+                            imageLayer.resample(PluginOperations.defaultSourceCRS);
+                        }else
+                        {
+                            JOptionPane.showMessageDialog(getContentPane(), "<html>No default reference system available.<br>Please select one from the list</html>");
+                        }
+                        
+                    } catch (NoSuchAuthorityCodeException e1) {
+                        // TODO Auto-generated catch block
+                        e1.printStackTrace();
+                    } catch (FactoryException e1) {
+                        // TODO Auto-generated catch block
+                        e1.printStackTrace();
+                    } catch (IOException e2) {
+                        // TODO Auto-generated catch block
+                        e2.printStackTrace();
+                    }
+                    finally{
+                        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+                    }
+                }
+            });
+        }
+        return useDefaultCRSButton;
+    }
+
+    /**
+     * This method initializes applySelectedCRSButton   
+     *  
+     * @return javax.swing.JButton  
+     */
+    private JButton getApplySelectedCRSButton() {
+        if (applySelectedCRSButton == null) {
+            applySelectedCRSButton = new JButton();
+            applySelectedCRSButton.setBounds(new Rectangle(315, 135, 69, 61));
+            applySelectedCRSButton.setHorizontalAlignment(SwingConstants.CENTER);
+            applySelectedCRSButton.setHorizontalTextPosition(SwingConstants.TRAILING);
+            applySelectedCRSButton.setText("<html>Apply<br>Selection</html>");
+            applySelectedCRSButton.addActionListener(new java.awt.event.ActionListener() {
+                public void actionPerformed(java.awt.event.ActionEvent e) {
+                    
+                    String selection = (String) crsJList.getSelectedValue();
+                    String code = selection.substring(selection.indexOf("[-") + 2, selection.indexOf("-]"));
+                    
+                    CoordinateReferenceSystem newRefSys = null;
+                    try {
+                        newRefSys = CRS.decode(code, eastingFirstCheckBox.isSelected());
+                        
+                        setCursor(new Cursor(Cursor.WAIT_CURSOR));
+                        
+                        imageLayer.resample(newRefSys);
+
+                    } catch (NoSuchAuthorityCodeException e1) {
+                        // TODO Auto-generated catch block
+                        e1.printStackTrace();
+                    } catch (FactoryException e1) {
+                        // TODO Auto-generated catch block
+                        e1.printStackTrace();
+                    } catch (IOException e2) {
+                        // TODO Auto-generated catch block
+                        e2.printStackTrace();
+                    }
+                    finally{
+                        setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+                    }
+                    
+                    
+                }
+            });
+        }
+        return applySelectedCRSButton;
+    }
+
+    /**
+     * This method initializes setSelectedCRSAsDefaultButton    
+     *  
+     * @return javax.swing.JButton  
+     */
+    private JButton getSetSelectedCRSAsDefaultButton() {
+        if (setSelectedCRSAsDefaultButton == null) {
+            setSelectedCRSAsDefaultButton = new JButton();
+            setSelectedCRSAsDefaultButton.setBounds(new Rectangle(315, 300, 69, 61));
+            setSelectedCRSAsDefaultButton.setText("<html>Set as<br>Default</html>");
+            setSelectedCRSAsDefaultButton
+                    .addActionListener(new java.awt.event.ActionListener() {
+                        public void actionPerformed(java.awt.event.ActionEvent e) {
+                            
+                            if(crsJList.getSelectedValue() != null){
+                                String selection = (String) crsJList.getSelectedValue();
+                                String code = selection.substring(selection.indexOf("[-") + 2, selection.indexOf("-]"));
+                                
+                                try {
+                                    PluginOperations.defaultSourceCRS = CRS.decode(code, eastingFirstCheckBox.isSelected());
+                                    PluginOperations.defaultSourceCRSDescription = selection;
+                                    
+                                    ImageImportPlugin.pluginProps.setProperty("default_crs_eastingfirst", "" + eastingFirstCheckBox.isSelected());
+                                    ImageImportPlugin.pluginProps.setProperty("default_crs_srid", code);
+                                    FileWriter fileWriter = new FileWriter(new File(ImageImportPlugin.PLUGINPROPERTIES_PATH));
+                                    ImageImportPlugin.pluginProps.store(fileWriter, null);
+                                    fileWriter.close();
+                                    
+                                    defaultCRSLabel.setText(selection);
+                                    
+                                } catch (IOException e2) {
+                                    // TODO Auto-generated catch block
+                                    e2.printStackTrace();
+                                } catch (NoSuchAuthorityCodeException e3) {
+                                    // TODO Auto-generated catch block
+                                    e3.printStackTrace();
+                                } catch (FactoryException e4) {
+                                    // TODO Auto-generated catch block
+                                    e4.printStackTrace();
+                                }
+                            }else{
+                                JOptionPane.showMessageDialog(getContentPane(), "Please make a selection from the list.");
+                            }
+
+                            
+                        }
+                    });
+        }
+        return setSelectedCRSAsDefaultButton;
+    }
+    
+    /**
+     * This method initializes eastingFirstCheckBox 
+     *  
+     * @return javax.swing.JCheckBox    
+     */
+    private JCheckBox getEastingFirstCheckBox() {
+        if (eastingFirstCheckBox == null) {
+            eastingFirstCheckBox = new JCheckBox();
+            eastingFirstCheckBox.setBounds(new Rectangle(345, 255, 21, 21));
+        }
+        return eastingFirstCheckBox;
+    }
+
+    
+    
+    /**
+     * Listener setting text in the search field if selection has changed.
+     *
+     */
     class ListSelectionHandler implements ListSelectionListener {
         public void valueChanged(ListSelectionEvent e) {
-        	if(e.getValueIsAdjusting())
-        	{
-            	searchField.setText(supportedCRS.get(e.getLastIndex()));
-            	searchField.setEditable(true);
-        	}
+            if(e.getValueIsAdjusting())
+            {
+                searchField.setText(supportedCRS.get(e.getLastIndex()));
+                searchField.setEditable(true);
+            }
         }
     }
Index: /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java
===================================================================
--- /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java	(revision 23191)
+++ /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LoadImageAction.java	(revision 23192)
@@ -26,45 +26,45 @@
  */
 public class LoadImageAction extends JosmAction {
-	
-	private Logger logger = Logger.getLogger(LoadImageAction.class);
+    
+    private Logger logger = Logger.getLogger(LoadImageAction.class);
 
-	/**
-	 * Constructor...
-	 */
-	public LoadImageAction() {
-		super(tr("Import image"), null, tr("Import georeferenced image"), null, false);
-	}
+    /**
+     * Constructor...
+     */
+    public LoadImageAction() {
+        super(tr("Import image"), null, tr("Import georeferenced image"), null, false);
+    }
 
-	public void actionPerformed(ActionEvent arg0) {
+    public void actionPerformed(ActionEvent arg0) {
 
-		// Choose a file
-		JFileChooser fc = new JFileChooser();
-		fc.setAcceptAllFileFilterUsed(false);
-		int result = fc.showOpenDialog(Main.parent);
-		
-		ImageLayer layer = null;
-		if (result == JFileChooser.APPROVE_OPTION) {
-			logger.info("File choosed:" + fc.getSelectedFile());
-			try {
-				layer = new ImageLayer(fc.getSelectedFile());
-			} catch (LayerCreationCancledException e) {
-				// if user decides that layer should not be created just return.
-				return;
-			}catch (Exception e) {
-				logger.error("Error while creating image layer: \n" + e.getMessage());
-				JOptionPane.showMessageDialog(null, marktr("Error while creating image layer: " + e.getCause()));
-				return;
-				
-			}
-			
-			// Add layer:
-			Main.main.addLayer(layer);
-			LatLon min = new LatLon(layer.getBbox().getMinX(), layer.getBbox().getMinY());
-			LatLon max = new LatLon(layer.getBbox().getMaxX(), layer.getBbox().getMaxY());
-			BoundingXYVisitor boundingXYVisitor = new BoundingXYVisitor();
-			boundingXYVisitor.visit(new Bounds(min, max));
-			Main.map.mapView.recalculateCenterScale(boundingXYVisitor);
-			Main.map.mapView.zoomTo(new Bounds(min, max));
-		}
-	}
+        // Choose a file
+        JFileChooser fc = new JFileChooser();
+        fc.setAcceptAllFileFilterUsed(false);
+        int result = fc.showOpenDialog(Main.parent);
+        
+        ImageLayer layer = null;
+        if (result == JFileChooser.APPROVE_OPTION) {
+            logger.info("File choosed:" + fc.getSelectedFile());
+            try {
+                layer = new ImageLayer(fc.getSelectedFile());
+            } catch (LayerCreationCancledException e) {
+                // if user decides that layer should not be created just return.
+                return;
+            }catch (Exception e) {
+                logger.error("Error while creating image layer: \n" + e.getMessage());
+                JOptionPane.showMessageDialog(null, marktr("Error while creating image layer: " + e.getCause()));
+                return;
+                
+            }
+            
+            // Add layer:
+            Main.main.addLayer(layer);
+            LatLon min = new LatLon(layer.getBbox().getMinX(), layer.getBbox().getMinY());
+            LatLon max = new LatLon(layer.getBbox().getMaxX(), layer.getBbox().getMaxY());
+            BoundingXYVisitor boundingXYVisitor = new BoundingXYVisitor();
+            boundingXYVisitor.visit(new Bounds(min, max));
+            Main.map.mapView.recalculateCenterScale(boundingXYVisitor);
+            Main.map.mapView.zoomTo(new Bounds(min, max));
+        }
+    }
 }
Index: /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java
===================================================================
--- /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java	(revision 23191)
+++ /applications/editors/josm/plugins/00_plugin_dir_template/src/org/openstreetmap/josm/plugins/ImportImagePlugin/PluginOperations.java	(revision 23192)
@@ -47,349 +47,349 @@
 public class PluginOperations {
 
-	private static final Logger logger = Logger.getLogger(PluginOperations.class);
-	
-	// contains descriptions of all available CRS
-	static Vector<String> crsDescriptions;
-
-	// the standard native CRS of user images 
-	static CoordinateReferenceSystem defaultSourceCRS;
-	// description of 'defaultSourceCRS'
-	static String defaultSourceCRSDescription;
-	
-	
-	
-	public static enum SUPPORTEDIMAGETYPES {
-		tiff, tif, jpg, jpeg, bmp, png 
-	}
-
-	public static enum POSTFIXES_WORLDFILE {
-		wld, jgw, jpgw, pgw, pngw, tfw, tifw, bpw, bmpw, 
-	};
-	
-	/**
-	 * Reprojects a GridCoverage to a given CRS.
-	 * 
-	 * @param coverage
-	 * @param targetCrs
-	 * @return destination
-	 * @throws FactoryException 
-	 * @throws NoSuchAuthorityCodeException 
-	 */
-	public static GridCoverage2D reprojectCoverage(GridCoverage2D coverage,
-			CoordinateReferenceSystem targetCrs) throws NoSuchAuthorityCodeException, FactoryException {
-
-		// TODO: add category for NO_DATA values in coverage (transparency in
-		// image)
-		
-		GridCoverage2D destination = null;
-
-		DefaultProcessor processor = new DefaultProcessor(null);
-		ParameterValueGroup resampleParams = processor.getOperation("Resample")
-				.getParameters();
-
-		// set parameters
-		resampleParams.parameter("Source").setValue(coverage);
-		resampleParams.parameter("CoordinateReferenceSystem").setValue(
-				targetCrs);
-
-		// resample coverage with given parameters
-		destination = (GridCoverage2D) processor.doOperation(resampleParams);
-
-		return destination;
-	}
-
-	/**
-	 * Creates a org.geotools.coverage.grid.GridCoverage2D from a given file. 
-	 * 
-	 * @param file
-	 * @return
-	 * @throws IOException 
-	 * @throws Exception
-	 */
-	public static GridCoverage2D createGridFromFile(File file, CoordinateReferenceSystem refSys) throws IOException{
-
-		GridCoverage2D coverage = null;
-		
-		if (!file.exists()) throw new FileNotFoundException("File not found.");
-
-		String extension = null;
-		String fileNameWithoutExt = null;
-		int dotPos = file.getAbsolutePath().lastIndexOf(".");
-		extension = file.getAbsolutePath().substring(dotPos);
-		fileNameWithoutExt = file.getAbsolutePath().substring(0, dotPos);
-
-		/*------- switch for file type -----------*/
-		if (extension.equalsIgnoreCase(".tif")
-				|| extension.equalsIgnoreCase(".tiff"))
-		{
-			
-			// try to read GeoTIFF:
-			try{
-				coverage = readGeoTiff(file, refSys);
-				return coverage;
-			}catch (DataSourceException dse) {
-				if(!dse.getMessage().contains("Coordinate Reference System is not available")){
-					dse.printStackTrace();
-				}
-			} catch (FactoryException facte) {
-				logger.fatal("Error while reading from GeoTIFF:", facte);
-				throw new IOException(facte);
-			}
-			
-			// file is no GeoTiff, searching for Worldfile and projection file: 
-			String[] postfixes = {"wld", "tfw", "tifw"};
-			// try to read Worldfile:
-			WorldFileReader tfwReader = null;
-			for (int i = 0; i < postfixes.length; i++) {
-				File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
-				if(prjFile.exists()){
-					tfwReader = new WorldFileReader(prjFile);
-				}
-			}
-			if(tfwReader == null){
-				throw new IOException("No Worldfile found.");
-			}
-			
-			if(refSys == null){
-				// if no crs is delivered try to read projection file:
-				refSys = readPrjFile(file);
-				if(refSys == null) throw new IOException("No projection file found.");
-			}
-			
-			BufferedImage img = ImageIO.read(file);
-			
-			// create Envelope
-			double width = (double) (img.getWidth() * tfwReader.getXPixelSize());
-			double height = (double) (img.getHeight() * (-tfwReader.getYPixelSize()));
-			double lowerLeft_x = (double) tfwReader.getXULC();
-			double lowerLeft_y = (double) tfwReader.getYULC() - height;
-			Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
-			
-			coverage = createGridCoverage(img, bbox, refSys);
-			
-		}
-		// 
-		else if (extension.equalsIgnoreCase(".jpg")
-				|| extension.equalsIgnoreCase(".jpeg"))
-		{
-			String[] postfixes = {"wld", "jgw", "jpgw"};
-			// try to read Worldfile:
-			WorldFileReader tfwReader = null;
-			for (int i = 0; i < postfixes.length; i++) {
-				File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
-				if(prjFile.exists()){
-					tfwReader = new WorldFileReader(prjFile);
-				}
-			}
-			if(tfwReader == null) throw new IOException("No Worldfile found.");
-			
-			if(refSys == null){
-				// if no crs is delivered try to read projection file:
-				refSys = readPrjFile(file);
-				if(refSys == null) throw new IOException("No projection file found.");
-			}
-			
-			BufferedImage img = ImageIO.read(file);
-			
-			// create Envelope
-			double width = (double) (img.getWidth() * tfwReader.getXPixelSize());
-			double height = (double) (img.getHeight() * (-tfwReader.getYPixelSize()));
-			double lowerLeft_x = (double) tfwReader.getXULC();
-			double lowerLeft_y = (double) tfwReader.getYULC() - height;
-			Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
-			
-			coverage = createGridCoverage(img, bbox, refSys);
-			
-		}
-		else if(extension.equalsIgnoreCase(".bmp"))
-		{
-			String[] postfixes = {"wld", "bmpw", "bpw"};
-			// try to read Worldfile:
-			WorldFileReader tfwReader = null;
-			for (int i = 0; i < postfixes.length; i++) {
-				File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
-				if(prjFile.exists()){
-					tfwReader = new WorldFileReader(prjFile);
-				}
-			}
-			if(tfwReader == null) throw new IOException("No Worldfile found.");
-
-			if(refSys == null){
-				// if no crs is delivered try to read projection file:
-				refSys = readPrjFile(file);
-				if(refSys == null) throw new IOException("No projection file found.");
-			}
-			
-			BufferedImage img = ImageIO.read(file);
-			
-			// create Envelope
-			double width = (double) (img.getWidth() * tfwReader.getXPixelSize());
-			double height = (double) (img.getHeight() * (-tfwReader.getYPixelSize()));
-			double lowerLeft_x = (double) tfwReader.getXULC();
-			double lowerLeft_y = (double) tfwReader.getYULC() - height;
-			Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
-			
-			coverage = createGridCoverage(img, bbox, refSys);
-		}
-		else if(extension.equalsIgnoreCase(".png"))
-		{
-			
-			String[] postfixes = {"wld", "pgw", "pngw"};
-			// try to read Worldfile:
-			WorldFileReader tfwReader = null;
-			for (int i = 0; i < postfixes.length; i++) {
-				File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
-				if(prjFile.exists()){
-					tfwReader = new WorldFileReader(prjFile);
-				}
-			}
-			if(tfwReader == null) throw new IOException("No Worldfile found.");
-			
-			if(refSys == null){
-				// if no crs is delivered try to read projection file:
-				refSys = readPrjFile(file);
-				if(refSys == null) throw new IOException("No projection file found.");
-			}
-			
-			BufferedImage img = ImageIO.read(file);
-			
-			// create Envelope
-			double width = (double) (img.getWidth() * tfwReader.getXPixelSize());
-			double height = (double) (img.getHeight() * (-tfwReader.getYPixelSize()));
-			double lowerLeft_x = (double) tfwReader.getXULC();
-			double lowerLeft_y = (double) tfwReader.getYULC() - height;
-			Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
-			
-			coverage = createGridCoverage(img, bbox, refSys);
-		}
-		else{
-			throw new IOException("Image type not supported. Supported formats are: \n" +
-					Arrays.toString(SUPPORTEDIMAGETYPES.values()));
-		}
-
-		return coverage;
-	}
-	
-	/**
-	 * Searches for a projection file (.prj) with the same name of 'file' 
-	 * tries to parse it.
-	 * 
-	 * 
-	 * @param file image file, not the real world file (will be searched)
-	 * @return 
-	 * @throws IOException 
-	 */
-	public static CoordinateReferenceSystem readPrjFile(File file) throws IOException
-	{
-		
-		CoordinateReferenceSystem refSys = null;
-		
-		String prjFilename = null;
-		int dotPos = file.getAbsolutePath().lastIndexOf(".");
-		prjFilename = file.getAbsolutePath().substring(0, dotPos) + ".prj";
-		
-		File prjFile = new File(prjFilename);
-		if(!prjFile.exists()) throw new IOException("No projection file found (.prj) for image '" + file.getName() + "'");
-		logger.debug("Loading .prj file: " + prjFile.getAbsolutePath());
-		
-		StringBuilder sb = new StringBuilder();
-		String content = null;
-		BufferedReader br = new BufferedReader(new FileReader(prjFile));
-		while((content = br.readLine()) != null)
-		{
-			sb.append(content);
-		}
-		
-		try {
-			refSys = CRS.parseWKT(sb.toString().trim());
-		} catch (FactoryException e) {
-			throw new IOException("Unable to parse prj-file: '" + prjFile.getName() + "'");
-		}
-		
-		return refSys;
-		
-	}
-	
-	
-	/**
-	 * Method for external use.
-	 * 
-	 * @param img
-	 * @param bbox
-	 * @param crs
-	 * @return
-	 */
-	public static GridCoverage2D createGridCoverage(BufferedImage img, Envelope2D bbox, CoordinateReferenceSystem crs)
-	{
-		bbox.setCoordinateReferenceSystem(crs);
-		return new GridCoverageFactory().create("", img, bbox);
-	}
-	
-	/**
-	 * Method for reading a GeoTIFF file.
-	 * 
-	 * @param file 
-	 * @param refSys if delivered, the coverage will be forced to use this crs
-	 * @return
-	 * @throws IOException
-	 * @throws FactoryException
-	 */
-	public static GridCoverage2D readGeoTiff(File file, CoordinateReferenceSystem refSys) throws IOException, FactoryException
-	{
-		GridCoverage2D coverage = null;
-		Hints hints = new Hints();
-		if(refSys != null)
-		{
-			hints.put(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, refSys);
-
-		}
-		// dont't use the EPSG-Factory because of wrong behaviour
-		hints.put(Hints.CRS_AUTHORITY_FACTORY, CRS.getAuthorityFactory(true));
-		
-		GeoTiffReader reader = new GeoTiffReader(file, hints);
-		
-		coverage = (GridCoverage2D) reader.read(null);
-		
-		return coverage;
-	}
-	
-	
-	/**
-	 * Loads CRS data from an EPSG database and creates descrptions for each one. 
-	 * 
-	 * @param pluginProps
-	 * @throws Exception
-	 */
-	public static void loadCRSData(Properties pluginProps)
-	{
-		String defaultcrsString = pluginProps.getProperty("default_crs_srid");
-		
-		crsDescriptions = new Vector<String>();
-		Set<String> supportedCodes = CRS.getSupportedCodes("EPSG");
-		CRSAuthorityFactory fac = CRS.getAuthorityFactory(false);
-		
-		for (Iterator iterator = supportedCodes.iterator(); iterator.hasNext();) {
-			String string = (String) iterator.next();
-			try {
-				InternationalString desc = fac.getDescriptionText("EPSG:" + string);
-
-				String description = desc.toString() + " [-EPSG:" + string + "-]";
-				
-				crsDescriptions.add(description);
-				
-				if(defaultcrsString != null && defaultcrsString.equalsIgnoreCase("EPSG:" + string)){
-					boolean isEastingFirst = Boolean.valueOf(pluginProps.getProperty("default_crs_eastingfirst"));
-					defaultSourceCRS = CRS.decode("EPSG:" + string, isEastingFirst);
-					defaultSourceCRSDescription = description;
-				}
-			} catch (NoSuchAuthorityCodeException e) {
-				if(!string.equalsIgnoreCase("WGS84(DD)")){
-					logger.error("Error while loading EPSG data: " + e.getMessage());
-				}
-			} catch (FactoryException e) {
-				logger.error("Error while loading EPSG data: " + e.getMessage());
-			}
-		}
-	}
-	
+    private static final Logger logger = Logger.getLogger(PluginOperations.class);
+    
+    // contains descriptions of all available CRS
+    static Vector<String> crsDescriptions;
+
+    // the standard native CRS of user images 
+    static CoordinateReferenceSystem defaultSourceCRS;
+    // description of 'defaultSourceCRS'
+    static String defaultSourceCRSDescription;
+    
+    
+    
+    public static enum SUPPORTEDIMAGETYPES {
+        tiff, tif, jpg, jpeg, bmp, png 
+    }
+
+    public static enum POSTFIXES_WORLDFILE {
+        wld, jgw, jpgw, pgw, pngw, tfw, tifw, bpw, bmpw, 
+    };
+    
+    /**
+     * Reprojects a GridCoverage to a given CRS.
+     * 
+     * @param coverage
+     * @param targetCrs
+     * @return destination
+     * @throws FactoryException 
+     * @throws NoSuchAuthorityCodeException 
+     */
+    public static GridCoverage2D reprojectCoverage(GridCoverage2D coverage,
+            CoordinateReferenceSystem targetCrs) throws NoSuchAuthorityCodeException, FactoryException {
+
+        // TODO: add category for NO_DATA values in coverage (transparency in
+        // image)
+        
+        GridCoverage2D destination = null;
+
+        DefaultProcessor processor = new DefaultProcessor(null);
+        ParameterValueGroup resampleParams = processor.getOperation("Resample")
+                .getParameters();
+
+        // set parameters
+        resampleParams.parameter("Source").setValue(coverage);
+        resampleParams.parameter("CoordinateReferenceSystem").setValue(
+                targetCrs);
+
+        // resample coverage with given parameters
+        destination = (GridCoverage2D) processor.doOperation(resampleParams);
+
+        return destination;
+    }
+
+    /**
+     * Creates a org.geotools.coverage.grid.GridCoverage2D from a given file. 
+     * 
+     * @param file
+     * @return
+     * @throws IOException 
+     * @throws Exception
+     */
+    public static GridCoverage2D createGridFromFile(File file, CoordinateReferenceSystem refSys) throws IOException{
+
+        GridCoverage2D coverage = null;
+        
+        if (!file.exists()) throw new FileNotFoundException("File not found.");
+
+        String extension = null;
+        String fileNameWithoutExt = null;
+        int dotPos = file.getAbsolutePath().lastIndexOf(".");
+        extension = file.getAbsolutePath().substring(dotPos);
+        fileNameWithoutExt = file.getAbsolutePath().substring(0, dotPos);
+
+        /*------- switch for file type -----------*/
+        if (extension.equalsIgnoreCase(".tif")
+                || extension.equalsIgnoreCase(".tiff"))
+        {
+            
+            // try to read GeoTIFF:
+            try{
+                coverage = readGeoTiff(file, refSys);
+                return coverage;
+            }catch (DataSourceException dse) {
+                if(!dse.getMessage().contains("Coordinate Reference System is not available")){
+                    dse.printStackTrace();
+                }
+            } catch (FactoryException facte) {
+                logger.fatal("Error while reading from GeoTIFF:", facte);
+                throw new IOException(facte);
+            }
+            
+            // file is no GeoTiff, searching for Worldfile and projection file: 
+            String[] postfixes = {"wld", "tfw", "tifw"};
+            // try to read Worldfile:
+            WorldFileReader tfwReader = null;
+            for (int i = 0; i < postfixes.length; i++) {
+                File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
+                if(prjFile.exists()){
+                    tfwReader = new WorldFileReader(prjFile);
+                }
+            }
+            if(tfwReader == null){
+                throw new IOException("No Worldfile found.");
+            }
+            
+            if(refSys == null){
+                // if no crs is delivered try to read projection file:
+                refSys = readPrjFile(file);
+                if(refSys == null) throw new IOException("No projection file found.");
+            }
+            
+            BufferedImage img = ImageIO.read(file);
+            
+            // create Envelope
+            double width = (double) (img.getWidth() * tfwReader.getXPixelSize());
+            double height = (double) (img.getHeight() * (-tfwReader.getYPixelSize()));
+            double lowerLeft_x = (double) tfwReader.getXULC();
+            double lowerLeft_y = (double) tfwReader.getYULC() - height;
+            Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
+            
+            coverage = createGridCoverage(img, bbox, refSys);
+            
+        }
+        // 
+        else if (extension.equalsIgnoreCase(".jpg")
+                || extension.equalsIgnoreCase(".jpeg"))
+        {
+            String[] postfixes = {"wld", "jgw", "jpgw"};
+            // try to read Worldfile:
+            WorldFileReader tfwReader = null;
+            for (int i = 0; i < postfixes.length; i++) {
+                File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
+                if(prjFile.exists()){
+                    tfwReader = new WorldFileReader(prjFile);
+                }
+            }
+            if(tfwReader == null) throw new IOException("No Worldfile found.");
+            
+            if(refSys == null){
+                // if no crs is delivered try to read projection file:
+                refSys = readPrjFile(file);
+                if(refSys == null) throw new IOException("No projection file found.");
+            }
+            
+            BufferedImage img = ImageIO.read(file);
+            
+            // create Envelope
+            double width = (double) (img.getWidth() * tfwReader.getXPixelSize());
+            double height = (double) (img.getHeight() * (-tfwReader.getYPixelSize()));
+            double lowerLeft_x = (double) tfwReader.getXULC();
+            double lowerLeft_y = (double) tfwReader.getYULC() - height;
+            Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
+            
+            coverage = createGridCoverage(img, bbox, refSys);
+            
+        }
+        else if(extension.equalsIgnoreCase(".bmp"))
+        {
+            String[] postfixes = {"wld", "bmpw", "bpw"};
+            // try to read Worldfile:
+            WorldFileReader tfwReader = null;
+            for (int i = 0; i < postfixes.length; i++) {
+                File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
+                if(prjFile.exists()){
+                    tfwReader = new WorldFileReader(prjFile);
+                }
+            }
+            if(tfwReader == null) throw new IOException("No Worldfile found.");
+
+            if(refSys == null){
+                // if no crs is delivered try to read projection file:
+                refSys = readPrjFile(file);
+                if(refSys == null) throw new IOException("No projection file found.");
+            }
+            
+            BufferedImage img = ImageIO.read(file);
+            
+            // create Envelope
+            double width = (double) (img.getWidth() * tfwReader.getXPixelSize());
+            double height = (double) (img.getHeight() * (-tfwReader.getYPixelSize()));
+            double lowerLeft_x = (double) tfwReader.getXULC();
+            double lowerLeft_y = (double) tfwReader.getYULC() - height;
+            Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
+            
+            coverage = createGridCoverage(img, bbox, refSys);
+        }
+        else if(extension.equalsIgnoreCase(".png"))
+        {
+            
+            String[] postfixes = {"wld", "pgw", "pngw"};
+            // try to read Worldfile:
+            WorldFileReader tfwReader = null;
+            for (int i = 0; i < postfixes.length; i++) {
+                File prjFile = new File(fileNameWithoutExt + "." + postfixes[i]);
+                if(prjFile.exists()){
+                    tfwReader = new WorldFileReader(prjFile);
+                }
+            }
+            if(tfwReader == null) throw new IOException("No Worldfile found.");
+            
+            if(refSys == null){
+                // if no crs is delivered try to read projection file:
+                refSys = readPrjFile(file);
+                if(refSys == null) throw new IOException("No projection file found.");
+            }
+            
+            BufferedImage img = ImageIO.read(file);
+            
+            // create Envelope
+            double width = (double) (img.getWidth() * tfwReader.getXPixelSize());
+            double height = (double) (img.getHeight() * (-tfwReader.getYPixelSize()));
+            double lowerLeft_x = (double) tfwReader.getXULC();
+            double lowerLeft_y = (double) tfwReader.getYULC() - height;
+            Envelope2D bbox = new Envelope2D(null, new Rectangle2D.Double(lowerLeft_x, lowerLeft_y, width, height));
+            
+            coverage = createGridCoverage(img, bbox, refSys);
+        }
+        else{
+            throw new IOException("Image type not supported. Supported formats are: \n" +
+                    Arrays.toString(SUPPORTEDIMAGETYPES.values()));
+        }
+
+        return coverage;
+    }
+    
+    /**
+     * Searches for a projection file (.prj) with the same name of 'file' 
+     * tries to parse it.
+     * 
+     * 
+     * @param file image file, not the real world file (will be searched)
+     * @return 
+     * @throws IOException 
+     */
+    public static CoordinateReferenceSystem readPrjFile(File file) throws IOException
+    {
+        
+        CoordinateReferenceSystem refSys = null;
+        
+        String prjFilename = null;
+        int dotPos = file.getAbsolutePath().lastIndexOf(".");
+        prjFilename = file.getAbsolutePath().substring(0, dotPos) + ".prj";
+        
+        File prjFile = new File(prjFilename);
+        if(!prjFile.exists()) throw new IOException("No projection file found (.prj) for image '" + file.getName() + "'");
+        logger.debug("Loading .prj file: " + prjFile.getAbsolutePath());
+        
+        StringBuilder sb = new StringBuilder();
+        String content = null;
+        BufferedReader br = new BufferedReader(new FileReader(prjFile));
+        while((content = br.readLine()) != null)
+        {
+            sb.append(content);
+        }
+        
+        try {
+            refSys = CRS.parseWKT(sb.toString().trim());
+        } catch (FactoryException e) {
+            throw new IOException("Unable to parse prj-file: '" + prjFile.getName() + "'");
+        }
+        
+        return refSys;
+        
+    }
+    
+    
+    /**
+     * Method for external use.
+     * 
+     * @param img
+     * @param bbox
+     * @param crs
+     * @return
+     */
+    public static GridCoverage2D createGridCoverage(BufferedImage img, Envelope2D bbox, CoordinateReferenceSystem crs)
+    {
+        bbox.setCoordinateReferenceSystem(crs);
+        return new GridCoverageFactory().create("", img, bbox);
+    }
+    
+    /**
+     * Method for reading a GeoTIFF file.
+     * 
+     * @param file 
+     * @param refSys if delivered, the coverage will be forced to use this crs
+     * @return
+     * @throws IOException
+     * @throws FactoryException
+     */
+    public static GridCoverage2D readGeoTiff(File file, CoordinateReferenceSystem refSys) throws IOException, FactoryException
+    {
+        GridCoverage2D coverage = null;
+        Hints hints = new Hints();
+        if(refSys != null)
+        {
+            hints.put(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM, refSys);
+
+        }
+        // dont't use the EPSG-Factory because of wrong behaviour
+        hints.put(Hints.CRS_AUTHORITY_FACTORY, CRS.getAuthorityFactory(true));
+        
+        GeoTiffReader reader = new GeoTiffReader(file, hints);
+        
+        coverage = (GridCoverage2D) reader.read(null);
+        
+        return coverage;
+    }
+    
+    
+    /**
+     * Loads CRS data from an EPSG database and creates descrptions for each one. 
+     * 
+     * @param pluginProps
+     * @throws Exception
+     */
+    public static void loadCRSData(Properties pluginProps)
+    {
+        String defaultcrsString = pluginProps.getProperty("default_crs_srid");
+        
+        crsDescriptions = new Vector<String>();
+        Set<String> supportedCodes = CRS.getSupportedCodes("EPSG");
+        CRSAuthorityFactory fac = CRS.getAuthorityFactory(false);
+        
+        for (Iterator iterator = supportedCodes.iterator(); iterator.hasNext();) {
+            String string = (String) iterator.next();
+            try {
+                InternationalString desc = fac.getDescriptionText("EPSG:" + string);
+
+                String description = desc.toString() + " [-EPSG:" + string + "-]";
+                
+                crsDescriptions.add(description);
+                
+                if(defaultcrsString != null && defaultcrsString.equalsIgnoreCase("EPSG:" + string)){
+                    boolean isEastingFirst = Boolean.valueOf(pluginProps.getProperty("default_crs_eastingfirst"));
+                    defaultSourceCRS = CRS.decode("EPSG:" + string, isEastingFirst);
+                    defaultSourceCRSDescription = description;
+                }
+            } catch (NoSuchAuthorityCodeException e) {
+                if(!string.equalsIgnoreCase("WGS84(DD)")){
+                    logger.error("Error while loading EPSG data: " + e.getMessage());
+                }
+            } catch (FactoryException e) {
+                logger.error("Error while loading EPSG data: " + e.getMessage());
+            }
+        }
+    }
+    
 }
Index: /applications/editors/josm/plugins/Create_grid_of_ways/src/CreateGridOfWaysPlugin/CreateGridOfWaysPlugin.java
===================================================================
--- /applications/editors/josm/plugins/Create_grid_of_ways/src/CreateGridOfWaysPlugin/CreateGridOfWaysPlugin.java	(revision 23191)
+++ /applications/editors/josm/plugins/Create_grid_of_ways/src/CreateGridOfWaysPlugin/CreateGridOfWaysPlugin.java	(revision 23192)
@@ -8,5 +8,5 @@
 public class CreateGridOfWaysPlugin extends Plugin {
     public CreateGridOfWaysPlugin(PluginInformation info) {
-    	super(info);
+        super(info);
         MainMenu.add(Main.main.menu.toolsMenu, new CreateGridOfWaysAction());
     }
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java	(revision 23191)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java	(revision 23192)
@@ -38,240 +38,240 @@
 public class OhePlugin extends Plugin {
 
-	// Strings for choosing which key of an object with given tags should be
-	// edited
-	// the order is referencing the preference of the keys
-	// String[] -> {key, value, to-editing-key} key and value can contain regexp
-	private final String[][] TAG_EDIT_STRINGS = new String[][] {
-			{ "opening_hours", ".*", "opening_hours" },
-			{ "collection_times", ".*", "collection_times" },
-			{ "collection_times:local", ".*", "collection_times:local" },
-			{ "lit", ".*", "lit" },
-			{ "amenity", "post_box", "collection_times" },
-			{ "amenity", ".*", "opening_hours" },
-			{ "shop", ".*", "opening_hours" }, { "highway", ".*", "lit" } };
-
-	/**
-	 * Will be invoked by JOSM to bootstrap the plugin
-	 * 
-	 * @param info
-	 *            information about the plugin and its local installation
-	 */
-	public OhePlugin(PluginInformation info) {
-		super(info);
-		Main.main.menu.toolsMenu.add(new OheMenuAction());
-	}
-
-	class OheMenuAction extends JosmAction {
-		public OheMenuAction() {
-			super(
-					tr("Edit opening hours"),
-					"opening_hours.png",
-					tr("Edit time-tag of selected element in a graphical interface"),
-					Shortcut.registerShortcut("tools:opening_hourseditor", tr(
-							"Tool: {0}", tr("Edit opening hours")),
-							KeyEvent.VK_T, Shortcut.GROUP_MENU), false);
-		}
-
-		@Override
-		protected void updateEnabledState() {
-			if (getCurrentDataSet() == null) {
-				setEnabled(false);
-			} else {
-				updateEnabledState(getCurrentDataSet().getSelected());
-			}
-		}
-
-		@Override
-		protected void updateEnabledState(
-				Collection<? extends OsmPrimitive> selection) {
-			setEnabled(selection != null && !selection.isEmpty());
-		}
-
-		public void actionPerformed(ActionEvent evt) {
-			// fetch active Layer
-			OsmDataLayer osmlayer = Main.main.getEditLayer();
-			if (osmlayer != null) {
-				Collection<OsmPrimitive> selection = osmlayer.data
-						.getSelected();
-				if (selection.size() == 1) { // one object selected
-					OsmPrimitive object = selection.iterator().next();
-					String[] keyValuePair = editTimeTags(object.getKeys());
-					if (keyValuePair != null) {
-						String key = keyValuePair[0].trim();
-						String newkey = keyValuePair[1].trim();
-						String value = keyValuePair[2].trim();
-
-						if (value.equals("")) {
-							value = null; // delete the key
-						}
-						if (newkey.equals("")) {
-							newkey = key;
-							value = null; // delete the key instead
-						}
-						if (key.equals(newkey)
-								&& tr("<different>").equals(value))
-							return;
-						if (key.equals(newkey) || value == null) {
-							Main.main.undoRedo.add(new ChangePropertyCommand(
-									object, newkey, value));
-						} else {
-							Collection<Command> commands = new Vector<Command>();
-							commands.add(new ChangePropertyCommand(object, key,
-									null));
-							commands.add(new ChangePropertyCommand(object,
-									newkey, value));
-							Main.main.undoRedo.add(new SequenceCommand(
-									tr("Change properties of 1 object"),
-									commands));
-						}
-					}
-				} else { // Not possible to edit 0, 2 or more objects
-					JOptionPane
-							.showMessageDialog(
-									Main.parent,
-									tr(
-											"You have {0} Elements selected. But you can edit only one element!",
-											selection.size()),
-									"openingHoursEditor Warning",
-									JOptionPane.ERROR_MESSAGE);
-				}
-			}
-		}
-	}
-
-	// opens up dialogs to change one of the key-value-pairs and returns the
-	// changed pair
-	private String[] editTimeTags(Map<String, String> keyValueMap) {
-		String selectedKey = "";
-
-		if ((selectedKey = tagChooseDialog(keyValueMap)) == null)
-			return null;
-
-		final String value = (keyValueMap.containsKey(selectedKey)) ? keyValueMap
-				.get(selectedKey)
-				: "";
-		OheDialogPanel panel = new OheDialogPanel(this, selectedKey, value);
-
-		final JOptionPane optionPane = new JOptionPane(panel,
-				JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
-		final JDialog dlg = optionPane.createDialog(Main.parent, tr("Edit"));
-
-		dlg.setResizable(true);
-		dlg.setVisible(true);
-
-		Object answer = optionPane.getValue();
-		if (!(answer == null || answer == JOptionPane.UNINITIALIZED_VALUE || (answer instanceof Integer && (Integer) answer != JOptionPane.OK_OPTION)))
-			return panel.getChangedKeyValuePair();
-
-		return null;
-	}
-
-	// opens a dialog for choosing from a set of tags which can be edited
-	// the chosen one is returned
-	private String tagChooseDialog(Map<String, String> keyValueMap) {
-		String preSelectedKey = getPreSelectedKey(keyValueMap);
-		int preSelectedRow = -1;
-
-		String[][] rowData = new String[keyValueMap.size()][2];
-		int cnt = 0;
-		for (Object key : keyValueMap.keySet().toArray()) {
-			rowData[cnt][0] = key.toString();
-			rowData[cnt][1] = keyValueMap.get(key);
-			if (key.toString().equals(preSelectedKey))
-				preSelectedRow = cnt;
-			cnt++;
-		}
-
-		final JTable table = new JTable(rowData,
-				new String[] { "key", "value" }) {
-			public boolean isCellEditable(int rowIndex, int colIndex) {
-				return false; // Disallow the editing of any cell
-			}
-		};
-		table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-		JScrollPane sp = new JScrollPane(
-				JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
-				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-		sp.setViewportView(table);
-
-		final JTextField tf = new JTextField();
-
-		ActionListener al = new ActionListener() {
-			@Override
-			public void actionPerformed(ActionEvent e) {
-				if (e.getActionCommand().equals("edit")) {
-					table.setEnabled(true);
-					tf.setEnabled(false);
-				} else if (e.getActionCommand().equals("new")) {
-					table.setEnabled(false);
-					tf.setEnabled(true);
-				}
-			}
-		};
-
-		JRadioButton editButton = new JRadioButton("edit existing tag");
-		editButton.setActionCommand("edit");
-		editButton.addActionListener(al);
-		JRadioButton newButton = new JRadioButton("edit new tag");
-		newButton.setActionCommand("new");
-		newButton.addActionListener(al);
-		ButtonGroup group = new ButtonGroup();
-		group.add(newButton);
-		group.add(editButton);
-
-		if (preSelectedRow != -1) {
-			table.setEnabled(true);
-			tf.setEnabled(false);
-			table.setRowSelectionInterval(preSelectedRow, preSelectedRow);
-			editButton.setSelected(true);
-		} else {
-			table.setEnabled(false);
-			tf.setEnabled(true);
-			tf.setText(preSelectedKey);
-			newButton.setSelected(true);
-		}
-
-		JPanel dlgPanel = new JPanel(new GridBagLayout());
-		dlgPanel.add(editButton, GBC.std().anchor(GBC.CENTER));
-		dlgPanel.add(sp, GBC.eol().fill(GBC.BOTH));
-		dlgPanel.add(newButton, GBC.std().anchor(GBC.CENTER));
-		dlgPanel.add(tf, GBC.eol().fill(GBC.HORIZONTAL));
-
-		JOptionPane optionPane = new JOptionPane(dlgPanel,
-				JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
-		JDialog dlg = optionPane.createDialog(Main.parent, tr("Choose key"));
-
-		dlg.pack();
-		dlg.setResizable(true);
-		dlg.setVisible(true);
-
-		Object answer = optionPane.getValue();
-		if (answer != null
-				&& answer != JOptionPane.UNINITIALIZED_VALUE
-				&& (answer instanceof Integer && (Integer) answer == JOptionPane.OK_OPTION))
-			if (editButton.isSelected() && table.getSelectedRow() != -1)
-				return rowData[table.getSelectedRow()][0];
-			else if (newButton.isSelected())
-				return tf.getText();
-
-		return null;
-	}
-
-	private String getPreSelectedKey(Map<String, String> keyValueMap) {
-		for (String[] pattern : TAG_EDIT_STRINGS) {
-			Pattern keyPattern = Pattern.compile(pattern[0]);
-			Pattern valuePattern = Pattern.compile(pattern[1]);
-			for (Object key : keyValueMap.keySet().toArray()) {
-				Matcher keyMatcher = keyPattern.matcher(key.toString());
-				if (keyMatcher.matches()) {
-					Matcher valueMatcher = valuePattern.matcher(keyValueMap
-							.get(key));
-					if (valueMatcher.matches()) {
-						return pattern[2];
-					}
-				}
-			}
-		}
-		return "";
-	}
+    // Strings for choosing which key of an object with given tags should be
+    // edited
+    // the order is referencing the preference of the keys
+    // String[] -> {key, value, to-editing-key} key and value can contain regexp
+    private final String[][] TAG_EDIT_STRINGS = new String[][] {
+            { "opening_hours", ".*", "opening_hours" },
+            { "collection_times", ".*", "collection_times" },
+            { "collection_times:local", ".*", "collection_times:local" },
+            { "lit", ".*", "lit" },
+            { "amenity", "post_box", "collection_times" },
+            { "amenity", ".*", "opening_hours" },
+            { "shop", ".*", "opening_hours" }, { "highway", ".*", "lit" } };
+
+    /**
+     * Will be invoked by JOSM to bootstrap the plugin
+     *
+     * @param info
+     *            information about the plugin and its local installation
+     */
+    public OhePlugin(PluginInformation info) {
+        super(info);
+        Main.main.menu.toolsMenu.add(new OheMenuAction());
+    }
+
+    class OheMenuAction extends JosmAction {
+        public OheMenuAction() {
+            super(
+                    tr("Edit opening hours"),
+                    "opening_hours.png",
+                    tr("Edit time-tag of selected element in a graphical interface"),
+                    Shortcut.registerShortcut("tools:opening_hourseditor", tr(
+                            "Tool: {0}", tr("Edit opening hours")),
+                            KeyEvent.VK_T, Shortcut.GROUP_MENU), false);
+        }
+
+        @Override
+        protected void updateEnabledState() {
+            if (getCurrentDataSet() == null) {
+                setEnabled(false);
+            } else {
+                updateEnabledState(getCurrentDataSet().getSelected());
+            }
+        }
+
+        @Override
+        protected void updateEnabledState(
+                Collection<? extends OsmPrimitive> selection) {
+            setEnabled(selection != null && !selection.isEmpty());
+        }
+
+        public void actionPerformed(ActionEvent evt) {
+            // fetch active Layer
+            OsmDataLayer osmlayer = Main.main.getEditLayer();
+            if (osmlayer != null) {
+                Collection<OsmPrimitive> selection = osmlayer.data
+                        .getSelected();
+                if (selection.size() == 1) { // one object selected
+                    OsmPrimitive object = selection.iterator().next();
+                    String[] keyValuePair = editTimeTags(object.getKeys());
+                    if (keyValuePair != null) {
+                        String key = keyValuePair[0].trim();
+                        String newkey = keyValuePair[1].trim();
+                        String value = keyValuePair[2].trim();
+
+                        if (value.equals("")) {
+                            value = null; // delete the key
+                        }
+                        if (newkey.equals("")) {
+                            newkey = key;
+                            value = null; // delete the key instead
+                        }
+                        if (key.equals(newkey)
+                                && tr("<different>").equals(value))
+                            return;
+                        if (key.equals(newkey) || value == null) {
+                            Main.main.undoRedo.add(new ChangePropertyCommand(
+                                    object, newkey, value));
+                        } else {
+                            Collection<Command> commands = new Vector<Command>();
+                            commands.add(new ChangePropertyCommand(object, key,
+                                    null));
+                            commands.add(new ChangePropertyCommand(object,
+                                    newkey, value));
+                            Main.main.undoRedo.add(new SequenceCommand(
+                                    tr("Change properties of 1 object"),
+                                    commands));
+                        }
+                    }
+                } else { // Not possible to edit 0, 2 or more objects
+                    JOptionPane
+                            .showMessageDialog(
+                                    Main.parent,
+                                    tr(
+                                            "You have {0} Elements selected. But you can edit only one element!",
+                                            selection.size()),
+                                    "openingHoursEditor Warning",
+                                    JOptionPane.ERROR_MESSAGE);
+                }
+            }
+        }
+    }
+
+    // opens up dialogs to change one of the key-value-pairs and returns the
+    // changed pair
+    private String[] editTimeTags(Map<String, String> keyValueMap) {
+        String selectedKey = "";
+
+        if ((selectedKey = tagChooseDialog(keyValueMap)) == null)
+            return null;
+
+        final String value = (keyValueMap.containsKey(selectedKey)) ? keyValueMap
+                .get(selectedKey)
+                : "";
+        OheDialogPanel panel = new OheDialogPanel(this, selectedKey, value);
+
+        final JOptionPane optionPane = new JOptionPane(panel,
+                JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
+        final JDialog dlg = optionPane.createDialog(Main.parent, tr("Edit"));
+
+        dlg.setResizable(true);
+        dlg.setVisible(true);
+
+        Object answer = optionPane.getValue();
+        if (!(answer == null || answer == JOptionPane.UNINITIALIZED_VALUE || (answer instanceof Integer && (Integer) answer != JOptionPane.OK_OPTION)))
+            return panel.getChangedKeyValuePair();
+
+        return null;
+    }
+
+    // opens a dialog for choosing from a set of tags which can be edited
+    // the chosen one is returned
+    private String tagChooseDialog(Map<String, String> keyValueMap) {
+        String preSelectedKey = getPreSelectedKey(keyValueMap);
+        int preSelectedRow = -1;
+
+        String[][] rowData = new String[keyValueMap.size()][2];
+        int cnt = 0;
+        for (Object key : keyValueMap.keySet().toArray()) {
+            rowData[cnt][0] = key.toString();
+            rowData[cnt][1] = keyValueMap.get(key);
+            if (key.toString().equals(preSelectedKey))
+                preSelectedRow = cnt;
+            cnt++;
+        }
+
+        final JTable table = new JTable(rowData,
+                new String[] { "key", "value" }) {
+            public boolean isCellEditable(int rowIndex, int colIndex) {
+                return false; // Disallow the editing of any cell
+            }
+        };
+        table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        JScrollPane sp = new JScrollPane(
+                JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
+                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        sp.setViewportView(table);
+
+        final JTextField tf = new JTextField();
+
+        ActionListener al = new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (e.getActionCommand().equals("edit")) {
+                    table.setEnabled(true);
+                    tf.setEnabled(false);
+                } else if (e.getActionCommand().equals("new")) {
+                    table.setEnabled(false);
+                    tf.setEnabled(true);
+                }
+            }
+        };
+
+        JRadioButton editButton = new JRadioButton("edit existing tag");
+        editButton.setActionCommand("edit");
+        editButton.addActionListener(al);
+        JRadioButton newButton = new JRadioButton("edit new tag");
+        newButton.setActionCommand("new");
+        newButton.addActionListener(al);
+        ButtonGroup group = new ButtonGroup();
+        group.add(newButton);
+        group.add(editButton);
+
+        if (preSelectedRow != -1) {
+            table.setEnabled(true);
+            tf.setEnabled(false);
+            table.setRowSelectionInterval(preSelectedRow, preSelectedRow);
+            editButton.setSelected(true);
+        } else {
+            table.setEnabled(false);
+            tf.setEnabled(true);
+            tf.setText(preSelectedKey);
+            newButton.setSelected(true);
+        }
+
+        JPanel dlgPanel = new JPanel(new GridBagLayout());
+        dlgPanel.add(editButton, GBC.std().anchor(GBC.CENTER));
+        dlgPanel.add(sp, GBC.eol().fill(GBC.BOTH));
+        dlgPanel.add(newButton, GBC.std().anchor(GBC.CENTER));
+        dlgPanel.add(tf, GBC.eol().fill(GBC.HORIZONTAL));
+
+        JOptionPane optionPane = new JOptionPane(dlgPanel,
+                JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
+        JDialog dlg = optionPane.createDialog(Main.parent, tr("Choose key"));
+
+        dlg.pack();
+        dlg.setResizable(true);
+        dlg.setVisible(true);
+
+        Object answer = optionPane.getValue();
+        if (answer != null
+                && answer != JOptionPane.UNINITIALIZED_VALUE
+                && (answer instanceof Integer && (Integer) answer == JOptionPane.OK_OPTION))
+            if (editButton.isSelected() && table.getSelectedRow() != -1)
+                return rowData[table.getSelectedRow()][0];
+            else if (newButton.isSelected())
+                return tf.getText();
+
+        return null;
+    }
+
+    private String getPreSelectedKey(Map<String, String> keyValueMap) {
+        for (String[] pattern : TAG_EDIT_STRINGS) {
+            Pattern keyPattern = Pattern.compile(pattern[0]);
+            Pattern valuePattern = Pattern.compile(pattern[1]);
+            for (Object key : keyValueMap.keySet().toArray()) {
+                Matcher keyMatcher = keyPattern.matcher(key.toString());
+                if (keyMatcher.matches()) {
+                    Matcher valueMatcher = valuePattern.matcher(keyValueMap
+                            .get(key));
+                    if (valueMatcher.matches()) {
+                        return pattern[2];
+                    }
+                }
+            }
+        }
+        return "";
+    }
 }
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java	(revision 23191)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OpeningTimeUtils.java	(revision 23192)
@@ -7,218 +7,218 @@
 
 public class OpeningTimeUtils {
-	// implements the subtraction of daytimes in spans of days when a day in
-	// the list occurs direct afterwards
-	public static ArrayList<int[]> convert(ArrayList<DateTime> dateTimes) {
-		ArrayList<int[]> ret = new ArrayList<int[]>(); // the list which is
-		// returned
-		for (int i = 0; i < dateTimes.size(); ++i) { // iterate over every entry
-			DateTime dateTime = dateTimes.get(i);
-			ArrayList<DateTime> newDateTimes = new ArrayList<DateTime>();
-
-			// test if the given entry is a single dayspan
-			if (dateTime.daySpans.size() == 1
-					&& dateTime.daySpans.get(0).isSpan()) {
-				ArrayList<DaySpan> partDaySpans = new ArrayList<DaySpan>();
-				int start_day = dateTime.daySpans.get(0).startDay;
-
-				// look in every entry behind
-				while (i + 1 < dateTimes.size()) {
-					ArrayList<DaySpan> following = dateTimes.get(i + 1).daySpans;
-					if (following.size() == 1
-							&& following.get(0).startDay > dateTime.daySpans
-									.get(0).startDay
-							&& following.get(0).endDay < dateTime.daySpans
-									.get(0).endDay) {
-						partDaySpans.add(new DaySpan(start_day, following
-								.get(0).startDay - 1));
-						start_day = following.get(0).endDay + 1;
-						newDateTimes.add(dateTimes.get(i + 1));
-						i++;
-					} else
-						break;
-				}
-
-				partDaySpans.add(new DaySpan(start_day, dateTime.daySpans
-						.get(0).endDay));
-				newDateTimes.add(new DateTime(partDaySpans,
-						dateTime.daytimeSpans));
-			}
-			if (newDateTimes.isEmpty())
-				newDateTimes.add(dateTime);
-
-			// create the int-array
-			for (int j = 0; j < newDateTimes.size(); ++j) {
-				DateTime dateTime2 = newDateTimes.get(j);
-				for (DaySpan dayspan : dateTime2.daySpans) {
-					for (DaytimeSpan timespan : dateTime2.daytimeSpans) {
-						if (!timespan.isOff())
-							ret.add(new int[] { dayspan.startDay,
-									dayspan.endDay, timespan.startMinute,
-									timespan.endMinute });
-					}
-				}
-			}
-		}
-		return ret;
-	}
-
-	public static class DaySpan {
-		public int startDay;
-		public int endDay;
-
-		public DaySpan(int startDay, int endDay) {
-			this.startDay = startDay;
-			this.endDay = endDay;
-		}
-
-		public boolean isSpan() {
-			return endDay > startDay;
-		}
-
-		public boolean isSingleDay() {
-			return startDay == endDay;
-		}
-	}
-
-	public static class DaytimeSpan {
-		public int startMinute;
-		public int endMinute;
-
-		public DaytimeSpan(int startMinute, int endMinute) {
-			this.startMinute = startMinute;
-			this.endMinute = endMinute;
-		}
-
-		public boolean isOff() {
-			return startMinute == -1;
-		}
-
-		public boolean isSpan() {
-			return endMinute > startMinute;
-		}
-	}
-
-	public static class DateTime {
-		public ArrayList<DaySpan> daySpans;
-		public ArrayList<DaytimeSpan> daytimeSpans;
-
-		public DateTime(ArrayList<DaySpan> daySpans,
-				ArrayList<DaytimeSpan> daytimeSpans) {
-			this.daySpans = daySpans;
-			this.daytimeSpans = daytimeSpans;
-		}
-	}
-
-	// returns a String (e.g "Mo-Sa 10:00-20:00; Tu off") representing the
-	// TimeRects
-	public static String makeStringFromRects(ArrayList<TimeRect> givenTimeRects) {
-		// create an array of booleans representing every minute on all the days
-		// in a week
-		boolean[][] minuteArray = new boolean[7][24 * 60 + 2];
-		for (int day = 0; day < 7; ++day)
-			for (int minute = 0; minute < 24 * 60 + 2; ++minute)
-				minuteArray[day][minute] = false;
-		for (TimeRect timeRect : givenTimeRects)
-			for (int day = timeRect.getDayStart(); day <= timeRect.getDayEnd(); ++day)
-				for (int minute = timeRect.getMinuteStart(); minute <= timeRect
-						.getMinuteEnd(); ++minute)
-					minuteArray[day][minute] = true;
-
-		String ret = "";
-		int[] days = new int[7]; // an array representing the status of the days
-		// 0 means nothing done with this day yet
-		// 8 means the day is off
-		// 0<x<8 means the day have the openinghours of day x
-		// -8<x<0 means nothing done with this day yet, but it intersects a
-		// range of days with same opening_hours
-		for (int i = 0; i < 7; ++i) {
-			String add = "";
-
-			if (isArrayEmpty(minuteArray[i]) && days[i] == 0) {
-				days[i] = 8;
-			} else if (isArrayEmpty(minuteArray[i]) && days[i] < 0) {
-				add = OpeningTimeCompiler.WEEKDAYS[i] + " off";
-				days[i] = -8;
-			} else if (days[i] <= 0) {
-				days[i] = i + 1;
-				int lastSameDay = i;
-				int sameDayCount = 1;
-				for (int j = i + 1; j < 7; ++j) {
-					if (arraysEqual(minuteArray[i], minuteArray[j])) {
-						days[j] = i + 1;
-						lastSameDay = j;
-						sameDayCount++;
-					}
-				}
-				if (sameDayCount == 1) {
-					// a single Day with this special opening_hours
-					add = OpeningTimeCompiler.WEEKDAYS[i] + " "
-							+ makeStringFromMinuteArray(minuteArray[i]);
-				} else if (sameDayCount == 2) {
-					// exactly two Days with this special opening_hours
-					add = OpeningTimeCompiler.WEEKDAYS[i] + ","
-							+ OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
-							+ makeStringFromMinuteArray(minuteArray[i]);
-				} else if (sameDayCount > 2) {
-					// more than two Days with this special opening_hours
-					add = OpeningTimeCompiler.WEEKDAYS[i] + "-"
-							+ OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
-							+ makeStringFromMinuteArray(minuteArray[i]);
-					for (int j = i + 1; j < lastSameDay; ++j) {
-						if (days[j] == 0)
-							days[j] = -i - 1;
-					}
-				}
-			}
-
-			if (!add.isEmpty()) {
-				if (!ret.isEmpty())
-					ret += "; ";
-				ret += add;
-			}
-		}
-		return ret;
-	}
-
-	// returns a String representing the openinghours on one special day (e.g.
-	// "10:00-20:00")
-	private static String makeStringFromMinuteArray(boolean[] minutes) {
-		String ret = "";
-		for (int i = 0; i < minutes.length; ++i) {
-			if (minutes[i]) {
-				int start = i;
-				while (i < minutes.length && minutes[i])
-					++i;
-				String addString = timeString(start);
-				if (i - 1 == 24 * 60 + 1) // open end
-					addString += "+";
-				else if (start != i - 1) // closing time
-					addString += "-" + timeString(i - 1);
-				if (!ret.isEmpty())
-					ret += ",";
-				ret += addString;
-			}
-		}
-		return ret;
-	}
-
-	public static String timeString(int minutes) {
-		int h = minutes / 60;
-		int m = minutes % 60;
-		return (h < 10 ? "0" : "") + h + ":" + (m < 10 ? "0" : "") + m;
-	}
-
-	private static boolean isArrayEmpty(boolean[] bs) {
-		for (int i = 0; i < bs.length; i++)
-			if (bs[i])
-				return false;
-		return true;
-	}
-
-	private static boolean arraysEqual(boolean[] bs, boolean[] bs2) {
-		boolean ret = true;
-		for (int i = 0; i < bs.length; i++)
-			ret &= bs[i] == bs2[i];
-		return ret;
-	}
+    // implements the subtraction of daytimes in spans of days when a day in
+    // the list occurs direct afterwards
+    public static ArrayList<int[]> convert(ArrayList<DateTime> dateTimes) {
+        ArrayList<int[]> ret = new ArrayList<int[]>(); // the list which is
+        // returned
+        for (int i = 0; i < dateTimes.size(); ++i) { // iterate over every entry
+            DateTime dateTime = dateTimes.get(i);
+            ArrayList<DateTime> newDateTimes = new ArrayList<DateTime>();
+
+            // test if the given entry is a single dayspan
+            if (dateTime.daySpans.size() == 1
+                    && dateTime.daySpans.get(0).isSpan()) {
+                ArrayList<DaySpan> partDaySpans = new ArrayList<DaySpan>();
+                int start_day = dateTime.daySpans.get(0).startDay;
+
+                // look in every entry behind
+                while (i + 1 < dateTimes.size()) {
+                    ArrayList<DaySpan> following = dateTimes.get(i + 1).daySpans;
+                    if (following.size() == 1
+                            && following.get(0).startDay > dateTime.daySpans
+                                    .get(0).startDay
+                            && following.get(0).endDay < dateTime.daySpans
+                                    .get(0).endDay) {
+                        partDaySpans.add(new DaySpan(start_day, following
+                                .get(0).startDay - 1));
+                        start_day = following.get(0).endDay + 1;
+                        newDateTimes.add(dateTimes.get(i + 1));
+                        i++;
+                    } else
+                        break;
+                }
+
+                partDaySpans.add(new DaySpan(start_day, dateTime.daySpans
+                        .get(0).endDay));
+                newDateTimes.add(new DateTime(partDaySpans,
+                        dateTime.daytimeSpans));
+            }
+            if (newDateTimes.isEmpty())
+                newDateTimes.add(dateTime);
+
+            // create the int-array
+            for (int j = 0; j < newDateTimes.size(); ++j) {
+                DateTime dateTime2 = newDateTimes.get(j);
+                for (DaySpan dayspan : dateTime2.daySpans) {
+                    for (DaytimeSpan timespan : dateTime2.daytimeSpans) {
+                        if (!timespan.isOff())
+                            ret.add(new int[] { dayspan.startDay,
+                                    dayspan.endDay, timespan.startMinute,
+                                    timespan.endMinute });
+                    }
+                }
+            }
+        }
+        return ret;
+    }
+
+    public static class DaySpan {
+        public int startDay;
+        public int endDay;
+
+        public DaySpan(int startDay, int endDay) {
+            this.startDay = startDay;
+            this.endDay = endDay;
+        }
+
+        public boolean isSpan() {
+            return endDay > startDay;
+        }
+
+        public boolean isSingleDay() {
+            return startDay == endDay;
+        }
+    }
+
+    public static class DaytimeSpan {
+        public int startMinute;
+        public int endMinute;
+
+        public DaytimeSpan(int startMinute, int endMinute) {
+            this.startMinute = startMinute;
+            this.endMinute = endMinute;
+        }
+
+        public boolean isOff() {
+            return startMinute == -1;
+        }
+
+        public boolean isSpan() {
+            return endMinute > startMinute;
+        }
+    }
+
+    public static class DateTime {
+        public ArrayList<DaySpan> daySpans;
+        public ArrayList<DaytimeSpan> daytimeSpans;
+
+        public DateTime(ArrayList<DaySpan> daySpans,
+                ArrayList<DaytimeSpan> daytimeSpans) {
+            this.daySpans = daySpans;
+            this.daytimeSpans = daytimeSpans;
+        }
+    }
+
+    // returns a String (e.g "Mo-Sa 10:00-20:00; Tu off") representing the
+    // TimeRects
+    public static String makeStringFromRects(ArrayList<TimeRect> givenTimeRects) {
+        // create an array of booleans representing every minute on all the days
+        // in a week
+        boolean[][] minuteArray = new boolean[7][24 * 60 + 2];
+        for (int day = 0; day < 7; ++day)
+            for (int minute = 0; minute < 24 * 60 + 2; ++minute)
+                minuteArray[day][minute] = false;
+        for (TimeRect timeRect : givenTimeRects)
+            for (int day = timeRect.getDayStart(); day <= timeRect.getDayEnd(); ++day)
+                for (int minute = timeRect.getMinuteStart(); minute <= timeRect
+                        .getMinuteEnd(); ++minute)
+                    minuteArray[day][minute] = true;
+
+        String ret = "";
+        int[] days = new int[7]; // an array representing the status of the days
+        // 0 means nothing done with this day yet
+        // 8 means the day is off
+        // 0<x<8 means the day have the openinghours of day x
+        // -8<x<0 means nothing done with this day yet, but it intersects a
+        // range of days with same opening_hours
+        for (int i = 0; i < 7; ++i) {
+            String add = "";
+
+            if (isArrayEmpty(minuteArray[i]) && days[i] == 0) {
+                days[i] = 8;
+            } else if (isArrayEmpty(minuteArray[i]) && days[i] < 0) {
+                add = OpeningTimeCompiler.WEEKDAYS[i] + " off";
+                days[i] = -8;
+            } else if (days[i] <= 0) {
+                days[i] = i + 1;
+                int lastSameDay = i;
+                int sameDayCount = 1;
+                for (int j = i + 1; j < 7; ++j) {
+                    if (arraysEqual(minuteArray[i], minuteArray[j])) {
+                        days[j] = i + 1;
+                        lastSameDay = j;
+                        sameDayCount++;
+                    }
+                }
+                if (sameDayCount == 1) {
+                    // a single Day with this special opening_hours
+                    add = OpeningTimeCompiler.WEEKDAYS[i] + " "
+                            + makeStringFromMinuteArray(minuteArray[i]);
+                } else if (sameDayCount == 2) {
+                    // exactly two Days with this special opening_hours
+                    add = OpeningTimeCompiler.WEEKDAYS[i] + ","
+                            + OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
+                            + makeStringFromMinuteArray(minuteArray[i]);
+                } else if (sameDayCount > 2) {
+                    // more than two Days with this special opening_hours
+                    add = OpeningTimeCompiler.WEEKDAYS[i] + "-"
+                            + OpeningTimeCompiler.WEEKDAYS[lastSameDay] + " "
+                            + makeStringFromMinuteArray(minuteArray[i]);
+                    for (int j = i + 1; j < lastSameDay; ++j) {
+                        if (days[j] == 0)
+                            days[j] = -i - 1;
+                    }
+                }
+            }
+
+            if (!add.isEmpty()) {
+                if (!ret.isEmpty())
+                    ret += "; ";
+                ret += add;
+            }
+        }
+        return ret;
+    }
+
+    // returns a String representing the openinghours on one special day (e.g.
+    // "10:00-20:00")
+    private static String makeStringFromMinuteArray(boolean[] minutes) {
+        String ret = "";
+        for (int i = 0; i < minutes.length; ++i) {
+            if (minutes[i]) {
+                int start = i;
+                while (i < minutes.length && minutes[i])
+                    ++i;
+                String addString = timeString(start);
+                if (i - 1 == 24 * 60 + 1) // open end
+                    addString += "+";
+                else if (start != i - 1) // closing time
+                    addString += "-" + timeString(i - 1);
+                if (!ret.isEmpty())
+                    ret += ",";
+                ret += addString;
+            }
+        }
+        return ret;
+    }
+
+    public static String timeString(int minutes) {
+        int h = minutes / 60;
+        int m = minutes % 60;
+        return (h < 10 ? "0" : "") + h + ":" + (m < 10 ? "0" : "") + m;
+    }
+
+    private static boolean isArrayEmpty(boolean[] bs) {
+        for (int i = 0; i < bs.length; i++)
+            if (bs[i])
+                return false;
+        return true;
+    }
+
+    private static boolean arraysEqual(boolean[] bs, boolean[] bs2) {
+        boolean ret = true;
+        for (int i = 0; i < bs.length; i++)
+            ret &= bs[i] == bs2[i];
+        return ret;
+    }
 }
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java	(revision 23191)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheDialogPanel.java	(revision 23192)
@@ -26,133 +26,133 @@
 public class OheDialogPanel extends JPanel {
 
-	private final JTextField keyField;
+    private final JTextField keyField;
 
-	// The Component for showing the Time as a Text
-	private final JTextField valueField;
+    // The Component for showing the Time as a Text
+    private final JTextField valueField;
 
-	private final JButton twentyfourSevenButton;
-	private final JLabel actualPostionLabel;
+    private final JButton twentyfourSevenButton;
+    private final JLabel actualPostionLabel;
 
-	// The important Panel for showing/editing the Time graphical
-	private final OheEditor editorPanel;
+    // The important Panel for showing/editing the Time graphical
+    private final OheEditor editorPanel;
 
-	private final String oldkey;
+    private final String oldkey;
 
-	public OheDialogPanel(OhePlugin plugin, String key, String value) {
-		oldkey = key;
-		keyField = new JTextField(key);
+    public OheDialogPanel(OhePlugin plugin, String key, String value) {
+        oldkey = key;
+        keyField = new JTextField(key);
 
-		valueField = new JTextField(value);
-		valueField.addActionListener(new ActionListener() {
-			@Override
-			public void actionPerformed(ActionEvent evt) {
-				// on every action in the textfield the timeRects are reloaded
-				editorPanel.initTimeRects();
-			}
-		});
+        valueField = new JTextField(value);
+        valueField.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent evt) {
+                // on every action in the textfield the timeRects are reloaded
+                editorPanel.initTimeRects();
+            }
+        });
 
-		twentyfourSevenButton = new JButton(tr("apply {0}", "24/7"));
-		twentyfourSevenButton.addActionListener(new ActionListener() {
-			@Override
-			public void actionPerformed(ActionEvent arg0) {
-				valueField.setText("24/7");
-				editorPanel.initTimeRects();
-			}
-		});
+        twentyfourSevenButton = new JButton(tr("apply {0}", "24/7"));
+        twentyfourSevenButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent arg0) {
+                valueField.setText("24/7");
+                editorPanel.initTimeRects();
+            }
+        });
 
-		actualPostionLabel = new JLabel("Mo 00:00");
-		JPanel toolsPanel = new JPanel(new GridBagLayout());
-		toolsPanel.add(twentyfourSevenButton, GBC.std());
-		toolsPanel.add(Box.createGlue(), GBC.std().fill(GBC.HORIZONTAL));
-		toolsPanel.add(actualPostionLabel, GBC.eop());
+        actualPostionLabel = new JLabel("Mo 00:00");
+        JPanel toolsPanel = new JPanel(new GridBagLayout());
+        toolsPanel.add(twentyfourSevenButton, GBC.std());
+        toolsPanel.add(Box.createGlue(), GBC.std().fill(GBC.HORIZONTAL));
+        toolsPanel.add(actualPostionLabel, GBC.eop());
 
-		editorPanel = new OheEditor(this);
+        editorPanel = new OheEditor(this);
 
-		// adding all Components in a Gridbaglayout
-		setLayout(new GridBagLayout());
-		add(new JLabel(tr("Key")), GBC.std());
-		add(Box.createHorizontalStrut(10), GBC.std());
-		add(keyField, GBC.eol().fill(GBC.HORIZONTAL));
-		add(new JLabel(tr("Value")), GBC.std());
-		add(Box.createHorizontalStrut(10), GBC.std());
-		add(valueField, GBC.eop().fill(GBC.HORIZONTAL));
-		add(toolsPanel, GBC.eol().fill(GBC.HORIZONTAL));
-		add(editorPanel, GBC.eol().fill());
+        // adding all Components in a Gridbaglayout
+        setLayout(new GridBagLayout());
+        add(new JLabel(tr("Key")), GBC.std());
+        add(Box.createHorizontalStrut(10), GBC.std());
+        add(keyField, GBC.eol().fill(GBC.HORIZONTAL));
+        add(new JLabel(tr("Value")), GBC.std());
+        add(Box.createHorizontalStrut(10), GBC.std());
+        add(valueField, GBC.eop().fill(GBC.HORIZONTAL));
+        add(toolsPanel, GBC.eol().fill(GBC.HORIZONTAL));
+        add(editorPanel, GBC.eol().fill());
 
-		valueField.requestFocus();
-		setPreferredSize(new Dimension(480, 520));
-	}
+        valueField.requestFocus();
+        setPreferredSize(new Dimension(480, 520));
+    }
 
-	public String[] getChangedKeyValuePair() {
-		return new String[] { oldkey, keyField.getText(), valueField.getText() };
-	}
+    public String[] getChangedKeyValuePair() {
+        return new String[] { oldkey, keyField.getText(), valueField.getText() };
+    }
 
-	// returns the compiled Time from the valueField
-	public ArrayList<int[]> getTime() throws Exception {
-		String value = valueField.getText();
-		ArrayList<int[]> time = null;
-		if (value.length() > 0) {
-			OpeningTimeCompiler compiler = new OpeningTimeCompiler(value);
-			try {
-				time = OpeningTimeUtils.convert(compiler.startCompile());
-			} catch (Throwable t) {
-				int tColumns[] = null;
-				String info = null;
+    // returns the compiled Time from the valueField
+    public ArrayList<int[]> getTime() throws Exception {
+        String value = valueField.getText();
+        ArrayList<int[]> time = null;
+        if (value.length() > 0) {
+            OpeningTimeCompiler compiler = new OpeningTimeCompiler(value);
+            try {
+                time = OpeningTimeUtils.convert(compiler.startCompile());
+            } catch (Throwable t) {
+                int tColumns[] = null;
+                String info = null;
 
-				if (t instanceof ParseException) {
-					ParseException parserExc = (ParseException) t;
-					tColumns = new int[] {
-							parserExc.currentToken.beginColumn - 1,
-							parserExc.currentToken.endColumn + 1 };
-				} else if (t instanceof SyntaxException) {
-					SyntaxException syntaxError = (SyntaxException) t;
-					tColumns = new int[] { syntaxError.getStartColumn(),
-							syntaxError.getEndColumn() };
-					info = syntaxError.getInfo();
-				} else if (t instanceof TokenMgrError) {
-					TokenMgrError tokenMgrError = (TokenMgrError) t;
-					tColumns = new int[] { tokenMgrError.errorColumn - 1,
-							tokenMgrError.errorColumn + 1 };
-				} else {
-					t.printStackTrace();
-				}
+                if (t instanceof ParseException) {
+                    ParseException parserExc = (ParseException) t;
+                    tColumns = new int[] {
+                            parserExc.currentToken.beginColumn - 1,
+                            parserExc.currentToken.endColumn + 1 };
+                } else if (t instanceof SyntaxException) {
+                    SyntaxException syntaxError = (SyntaxException) t;
+                    tColumns = new int[] { syntaxError.getStartColumn(),
+                            syntaxError.getEndColumn() };
+                    info = syntaxError.getInfo();
+                } else if (t instanceof TokenMgrError) {
+                    TokenMgrError tokenMgrError = (TokenMgrError) t;
+                    tColumns = new int[] { tokenMgrError.errorColumn - 1,
+                            tokenMgrError.errorColumn + 1 };
+                } else {
+                    t.printStackTrace();
+                }
 
-				// shows a Information Dialog, where the Error occurred
-				if (tColumns != null) {
-					int first = Math.max(0, tColumns[0]);
-					int last = Math.min(value.length(), tColumns[1]);
-					String begin = value.substring(0, first);
-					String middle = value.substring(first, last);
-					String end = value.substring(last);
-					String message = "<html>"
-							+ tr("There is something wrong in the value near:")
-							+ "<br>" + begin
-							+ "<span style='background-color:red;'>" + middle
-							+ "</span>" + end;
-					if (info != null)
-						message += "<br>" + tr("Info: {0}", tr(info));
-					message += "<br>"
-							+ tr("Correct the value manually and than press Enter.");
-					message += "</html>";
-					JOptionPane.showMessageDialog(this, message,
-							tr("Error in timeformat"),
-							JOptionPane.INFORMATION_MESSAGE);
-				}
+                // shows a Information Dialog, where the Error occurred
+                if (tColumns != null) {
+                    int first = Math.max(0, tColumns[0]);
+                    int last = Math.min(value.length(), tColumns[1]);
+                    String begin = value.substring(0, first);
+                    String middle = value.substring(first, last);
+                    String end = value.substring(last);
+                    String message = "<html>"
+                            + tr("There is something wrong in the value near:")
+                            + "<br>" + begin
+                            + "<span style='background-color:red;'>" + middle
+                            + "</span>" + end;
+                    if (info != null)
+                        message += "<br>" + tr("Info: {0}", tr(info));
+                    message += "<br>"
+                            + tr("Correct the value manually and than press Enter.");
+                    message += "</html>";
+                    JOptionPane.showMessageDialog(this, message,
+                            tr("Error in timeformat"),
+                            JOptionPane.INFORMATION_MESSAGE);
+                }
 
-				throw new Exception("Error in the TimeValue");
-			}
-		}
+                throw new Exception("Error in the TimeValue");
+            }
+        }
 
-		return time;
-	}
+        return time;
+    }
 
-	// updates the valueField with the given timeRects
-	public void updateValueField(ArrayList<TimeRect> timeRects) {
-		if (valueField != null && timeRects != null)
-			valueField.setText(OpeningTimeUtils.makeStringFromRects(timeRects));
-	}
+    // updates the valueField with the given timeRects
+    public void updateValueField(ArrayList<TimeRect> timeRects) {
+        if (valueField != null && timeRects != null)
+            valueField.setText(OpeningTimeUtils.makeStringFromRects(timeRects));
+    }
 
-	public void setMousePositionText(String positionText) {
-		actualPostionLabel.setText(positionText);
-	}
+    public void setMousePositionText(String positionText) {
+        actualPostionLabel.setText(positionText);
+    }
 }
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java	(revision 23191)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/OheEditor.java	(revision 23192)
@@ -20,308 +20,308 @@
 
 public class OheEditor extends JPanel implements MouseListener,
-		MouseMotionListener {
-	final OheDialogPanel dialog;
-
-	final private JScrollPane scrollPane;
-	final JPanel contentPanel;
-
-	ArrayList<TimeRect> timeRects;
-
-	final private int dayAxisHeight = 20;
-	final private int timeAxisWidth = 45;
-
-	public OheEditor(OheDialogPanel oheDialogPanel) {
-		dialog = oheDialogPanel;
-
-		// the MainPanel for showing the TimeRects
-		contentPanel = new JPanel() {
-			@Override
-			public void setSize(Dimension d) {
-				super.setSize(d);
-				repositionTimeRects();
-			}
-
-			@Override
-			public void paintComponent(Graphics g) {
-				if (OheEditor.this.isEnabled()) {
-					g.setColor(Color.WHITE);
-					g.fillRect(0, 0, getWidth(), getHeight());
-
-					// horizontal Lines
-					for (int i = 1; i < 24; ++i) {
-						if (i % 3 == 0)
-							g.setColor(Color.BLACK);
-						else
-							g.setColor(Color.LIGHT_GRAY);
-
-						g.drawLine(0, getMinutePosition(i * 60), getWidth(),
-								getMinutePosition(i * 60));
-					}
-
-					// vertical Lines
-					g.setColor(Color.BLACK);
-					for (int i = 1; i < 7; ++i)
-						g.drawLine(getDayPosition(i), 0, getDayPosition(i),
-								getHeight());
-
-					// if a new Rect is dragged draw it
-					if (day0 >= 0) {
-						Graphics2D g2D = (Graphics2D) g;
-
-						int day2 = Math.min(day0, day1);
-						int day3 = Math.max(day0, day1);
-						int minute2 = Math.min(minute0, minute1);
-						int minute3 = Math.max(minute0, minute1);
-						Rectangle bounds = getPanelBoundsForTimeinterval(day2,
-								day3 + 1, minute2, minute3);
-
-						TimeRect.drawTimeRect(g2D, bounds, minute2 == minute3, false);
-					}
-				} else {
-					g.setColor(Color.LIGHT_GRAY);
-					g.fillRect(0, 0, getWidth(), getHeight());
-				}
-			}
-		};
-		contentPanel.addMouseListener(this);
-		contentPanel.addMouseMotionListener(this);
-		contentPanel.setLayout(null);
-		contentPanel.setPreferredSize(new Dimension(180, 384));
-
-		initTimeRects();
-
-		scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
-				JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
-		scrollPane.setViewportView(contentPanel);
-
-		// the upper Panel for showing Weekdays
-		scrollPane.setColumnHeaderView(new JPanel() {
-			@Override
-			public Dimension getPreferredSize() {
-				return new Dimension(contentPanel.getWidth(), dayAxisHeight);
-			}
-
-			@Override
-			public void paintComponent(Graphics g) {
-				g.setColor(Color.WHITE);
-				g.fillRect(0, 0, getWidth(), getHeight());
-
-				g.setColor(Color.BLACK);
-				for (int i = 0; i < 7; ++i) {
-					if (i > 0)
-						g.drawLine(getDayPosition(i) + 1, 0,
-								getDayPosition(i) + 1, getHeight());
-
-					String text = OpeningTimeCompiler.WEEKDAYS[i];
-					g.drawString(text, (int) (getDayPosition(i + 0.5) - g
-							.getFontMetrics().stringWidth(text) * 0.5),
-							(int) (dayAxisHeight * 0.5 + g.getFontMetrics()
-									.getHeight() * 0.35));
-				}
-			}
-		});
-
-		// the left Panel for showing the hours
-		scrollPane.setRowHeaderView(new JPanel() {
-			@Override
-			public Dimension getPreferredSize() {
-				return new Dimension(timeAxisWidth, contentPanel.getHeight());
-			}
-
-			@Override
-			public void paintComponent(Graphics g) {
-				g.setColor(Color.WHITE);
-				g.fillRect(0, 0, getWidth(), getHeight());
-
-				for (int i = 1; i < 24; ++i) {
-					if (i % 3 == 0) {
-						g.setColor(Color.BLACK);
-						String text = ((i < 10) ? "0" + i : i) + ":00";
-						g
-								.drawString(text, timeAxisWidth - 10
-										- g.getFontMetrics().stringWidth(text),
-										getMinutePosition(i * 60)
-												+ (int) (g.getFontMetrics()
-														.getHeight() * 0.35));
-					} else
-						g.setColor(Color.LIGHT_GRAY);
-
-					g.drawLine(getWidth() - 4, getMinutePosition(i * 60) + 1,
-							getWidth(), getMinutePosition(i * 60) + 1);
-				}
-			}
-		});
-
-		setLayout(new BorderLayout());
-		add(scrollPane, BorderLayout.CENTER);
-	}
-
-	// update all the TimeRects with new Data
-	public void initTimeRects() {
-		contentPanel.removeAll();
-
-		ArrayList<int[]> time;
-		try {
-			time = dialog.getTime();
-		} catch (Exception exc) {
-			setEnabled(false);
-			return;
-		}
-
-		setEnabled(true);
-		timeRects = new ArrayList<TimeRect>();
-		if (time != null) {
-			for (int[] timeRectValues : time) {
-				int day0 = timeRectValues[0];
-				int day1 = timeRectValues[1];
-				int minute0 = timeRectValues[2];
-				int minute1 = timeRectValues[3];
-				TimeRect timeRect = new TimeRect(OheEditor.this, day0, day1,
-						minute0, minute1);
-				timeRects.add(timeRect);
-				contentPanel.add(timeRect);
-			}
-		}
-
-		repositionTimeRects();
-		repaint();
-	}
-
-	protected void repositionTimeRects() {
-		if (timeRects != null)
-			for (TimeRect timeRect : timeRects)
-				timeRect.reposition();
-	}
-
-	// returns the physical Borders of the TimeRect on the mainPanel
-	public Rectangle getPanelBoundsForTimeinterval(int dayStart, int dayEnd,
-			int minutesStart, int minutesEnd) {
-		int x = getDayPosition(dayStart);
-		int y = getMinutePosition(minutesStart);
-		int width = getDayPosition(dayEnd) - getDayPosition(dayStart);
-		int height = getMinutePosition(minutesEnd)
-				- getMinutePosition(minutesStart);
-
-		// work around openjdk bug
-		if (Main.isOpenjdk) {
-			x++;
-			y++;
-		}
-
-		if (minutesStart == minutesEnd)
-			return new Rectangle(x, y - 2 - TimeRect.verticalNonDrawedPixels,
-					width, height + 5 + 2 * TimeRect.verticalNonDrawedPixels);
-
-		return new Rectangle(x, y, width, height + 1);
-	}
-
-	public double getDayWidth() {
-		return (contentPanel.getWidth() - 1) / 7.0;
-	}
-
-	public int getDayPosition(double d) {
-		return (int) (d * getDayWidth());
-	}
-
-	public double getMinuteHeight() {
-		return (contentPanel.getHeight() - 1) / (24.0 * 60);
-	}
-
-	public int getMinutePosition(int minute) {
-		return (int) (minute * getMinuteHeight());
-	}
-
-	// removes the given timerect from the panel and from the arraylist
-	public void removeTimeRect(TimeRect timeRectToRemove) {
-		timeRects.remove(timeRectToRemove);
-		contentPanel.remove(timeRectToRemove);
-		dialog.updateValueField(timeRects);
-		repaint();
-	}
-
-	// drawing a new Rect
-	private int day0 = -1;
-	private int minute0;
-	private int day1;
-	private int minute1;
-	private int xDragStart;
-	private int yDragStart;
-
-	@Override
-	public void mouseClicked(MouseEvent evt) {
-	}
-
-	@Override
-	public void mouseEntered(MouseEvent evt) {
-	}
-
-	@Override
-	public void mouseExited(MouseEvent evt) {
-	}
-
-	@Override
-	public void mousePressed(MouseEvent evt) {
-		day0 = (int) Math.floor(evt.getX() / getDayWidth());
-		minute0 = (int) Math.floor(evt.getY()
-				/ (getMinuteHeight() * TimeRect.minuteResterize))
-				* TimeRect.minuteResterize;
-		day1 = day0;
-		minute1 = minute0;
-		xDragStart = evt.getX();
-		yDragStart = evt.getY();
-	}
-
-	@Override
-	public void mouseReleased(MouseEvent evt) {
-		// mouse must be moved 5px before creating a rect
-		if (xDragStart == -1
-				|| Math.abs(evt.getX() - xDragStart)
-						+ Math.abs(evt.getY() - yDragStart) > 5) {
-			int day2 = Math.min(day0, day1);
-			int day3 = Math.max(day0, day1);
-			int minute2 = Math.min(minute0, minute1);
-			int minute3 = Math.max(minute0, minute1);
-
-			TimeRect timeRect = new TimeRect(OheEditor.this, day2, day3,
-					minute2, minute3);
-			timeRects.add(timeRect);
-			contentPanel.add(timeRect);
-			timeRect.reposition();
-			dialog.updateValueField(timeRects);
-
-			day0 = -1;
-			repaint();
-		}
-	}
-
-	@Override
-	public void mouseDragged(MouseEvent evt) {
-		// mouse must be moved 5px before drawing a rect
-		if (xDragStart == -1
-				|| Math.abs(evt.getX() - xDragStart)
-						+ Math.abs(evt.getY() - yDragStart) > 5) {
-			xDragStart = -1;
-			day1 = (int) Math.floor(evt.getX() / getDayWidth());
-			minute1 = (int) Math.floor(evt.getY()
-					/ (getMinuteHeight() * TimeRect.minuteResterize))
-					* TimeRect.minuteResterize;
-			repaint();
-		}
-	}
-
-	@Override
-	public void mouseMoved(MouseEvent evt) {
-		mousePositionChanged(evt.getX(), evt.getY());
-	}
-
-	public void mousePositionChanged(int x, int y) {
-		int actualDay = (int) Math.floor(x / getDayWidth());
-		int minutes = (int) Math.floor(y
-				/ (getMinuteHeight() * TimeRect.minuteResterize))
-				* TimeRect.minuteResterize;
-		actualDay = Math.max(0, Math.min(6, actualDay));
-		minutes = Math.max(0, Math.min(24 * 60, minutes));
-		dialog.setMousePositionText(OpeningTimeCompiler.WEEKDAYS[actualDay]
-				+ " " + OpeningTimeUtils.timeString(minutes));
-	}
+        MouseMotionListener {
+    final OheDialogPanel dialog;
+
+    final private JScrollPane scrollPane;
+    final JPanel contentPanel;
+
+    ArrayList<TimeRect> timeRects;
+
+    final private int dayAxisHeight = 20;
+    final private int timeAxisWidth = 45;
+
+    public OheEditor(OheDialogPanel oheDialogPanel) {
+        dialog = oheDialogPanel;
+
+        // the MainPanel for showing the TimeRects
+        contentPanel = new JPanel() {
+            @Override
+            public void setSize(Dimension d) {
+                super.setSize(d);
+                repositionTimeRects();
+            }
+
+            @Override
+            public void paintComponent(Graphics g) {
+                if (OheEditor.this.isEnabled()) {
+                    g.setColor(Color.WHITE);
+                    g.fillRect(0, 0, getWidth(), getHeight());
+
+                    // horizontal Lines
+                    for (int i = 1; i < 24; ++i) {
+                        if (i % 3 == 0)
+                            g.setColor(Color.BLACK);
+                        else
+                            g.setColor(Color.LIGHT_GRAY);
+
+                        g.drawLine(0, getMinutePosition(i * 60), getWidth(),
+                                getMinutePosition(i * 60));
+                    }
+
+                    // vertical Lines
+                    g.setColor(Color.BLACK);
+                    for (int i = 1; i < 7; ++i)
+                        g.drawLine(getDayPosition(i), 0, getDayPosition(i),
+                                getHeight());
+
+                    // if a new Rect is dragged draw it
+                    if (day0 >= 0) {
+                        Graphics2D g2D = (Graphics2D) g;
+
+                        int day2 = Math.min(day0, day1);
+                        int day3 = Math.max(day0, day1);
+                        int minute2 = Math.min(minute0, minute1);
+                        int minute3 = Math.max(minute0, minute1);
+                        Rectangle bounds = getPanelBoundsForTimeinterval(day2,
+                                day3 + 1, minute2, minute3);
+
+                        TimeRect.drawTimeRect(g2D, bounds, minute2 == minute3, false);
+                    }
+                } else {
+                    g.setColor(Color.LIGHT_GRAY);
+                    g.fillRect(0, 0, getWidth(), getHeight());
+                }
+            }
+        };
+        contentPanel.addMouseListener(this);
+        contentPanel.addMouseMotionListener(this);
+        contentPanel.setLayout(null);
+        contentPanel.setPreferredSize(new Dimension(180, 384));
+
+        initTimeRects();
+
+        scrollPane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
+                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
+        scrollPane.setViewportView(contentPanel);
+
+        // the upper Panel for showing Weekdays
+        scrollPane.setColumnHeaderView(new JPanel() {
+            @Override
+            public Dimension getPreferredSize() {
+                return new Dimension(contentPanel.getWidth(), dayAxisHeight);
+            }
+
+            @Override
+            public void paintComponent(Graphics g) {
+                g.setColor(Color.WHITE);
+                g.fillRect(0, 0, getWidth(), getHeight());
+
+                g.setColor(Color.BLACK);
+                for (int i = 0; i < 7; ++i) {
+                    if (i > 0)
+                        g.drawLine(getDayPosition(i) + 1, 0,
+                                getDayPosition(i) + 1, getHeight());
+
+                    String text = OpeningTimeCompiler.WEEKDAYS[i];
+                    g.drawString(text, (int) (getDayPosition(i + 0.5) - g
+                            .getFontMetrics().stringWidth(text) * 0.5),
+                            (int) (dayAxisHeight * 0.5 + g.getFontMetrics()
+                                    .getHeight() * 0.35));
+                }
+            }
+        });
+
+        // the left Panel for showing the hours
+        scrollPane.setRowHeaderView(new JPanel() {
+            @Override
+            public Dimension getPreferredSize() {
+                return new Dimension(timeAxisWidth, contentPanel.getHeight());
+            }
+
+            @Override
+            public void paintComponent(Graphics g) {
+                g.setColor(Color.WHITE);
+                g.fillRect(0, 0, getWidth(), getHeight());
+
+                for (int i = 1; i < 24; ++i) {
+                    if (i % 3 == 0) {
+                        g.setColor(Color.BLACK);
+                        String text = ((i < 10) ? "0" + i : i) + ":00";
+                        g
+                                .drawString(text, timeAxisWidth - 10
+                                        - g.getFontMetrics().stringWidth(text),
+                                        getMinutePosition(i * 60)
+                                                + (int) (g.getFontMetrics()
+                                                        .getHeight() * 0.35));
+                    } else
+                        g.setColor(Color.LIGHT_GRAY);
+
+                    g.drawLine(getWidth() - 4, getMinutePosition(i * 60) + 1,
+                            getWidth(), getMinutePosition(i * 60) + 1);
+                }
+            }
+        });
+
+        setLayout(new BorderLayout());
+        add(scrollPane, BorderLayout.CENTER);
+    }
+
+    // update all the TimeRects with new Data
+    public void initTimeRects() {
+        contentPanel.removeAll();
+
+        ArrayList<int[]> time;
+        try {
+            time = dialog.getTime();
+        } catch (Exception exc) {
+            setEnabled(false);
+            return;
+        }
+
+        setEnabled(true);
+        timeRects = new ArrayList<TimeRect>();
+        if (time != null) {
+            for (int[] timeRectValues : time) {
+                int day0 = timeRectValues[0];
+                int day1 = timeRectValues[1];
+                int minute0 = timeRectValues[2];
+                int minute1 = timeRectValues[3];
+                TimeRect timeRect = new TimeRect(OheEditor.this, day0, day1,
+                        minute0, minute1);
+                timeRects.add(timeRect);
+                contentPanel.add(timeRect);
+            }
+        }
+
+        repositionTimeRects();
+        repaint();
+    }
+
+    protected void repositionTimeRects() {
+        if (timeRects != null)
+            for (TimeRect timeRect : timeRects)
+                timeRect.reposition();
+    }
+
+    // returns the physical Borders of the TimeRect on the mainPanel
+    public Rectangle getPanelBoundsForTimeinterval(int dayStart, int dayEnd,
+            int minutesStart, int minutesEnd) {
+        int x = getDayPosition(dayStart);
+        int y = getMinutePosition(minutesStart);
+        int width = getDayPosition(dayEnd) - getDayPosition(dayStart);
+        int height = getMinutePosition(minutesEnd)
+                - getMinutePosition(minutesStart);
+
+        // work around openjdk bug
+        if (Main.isOpenjdk) {
+            x++;
+            y++;
+        }
+
+        if (minutesStart == minutesEnd)
+            return new Rectangle(x, y - 2 - TimeRect.verticalNonDrawedPixels,
+                    width, height + 5 + 2 * TimeRect.verticalNonDrawedPixels);
+
+        return new Rectangle(x, y, width, height + 1);
+    }
+
+    public double getDayWidth() {
+        return (contentPanel.getWidth() - 1) / 7.0;
+    }
+
+    public int getDayPosition(double d) {
+        return (int) (d * getDayWidth());
+    }
+
+    public double getMinuteHeight() {
+        return (contentPanel.getHeight() - 1) / (24.0 * 60);
+    }
+
+    public int getMinutePosition(int minute) {
+        return (int) (minute * getMinuteHeight());
+    }
+
+    // removes the given timerect from the panel and from the arraylist
+    public void removeTimeRect(TimeRect timeRectToRemove) {
+        timeRects.remove(timeRectToRemove);
+        contentPanel.remove(timeRectToRemove);
+        dialog.updateValueField(timeRects);
+        repaint();
+    }
+
+    // drawing a new Rect
+    private int day0 = -1;
+    private int minute0;
+    private int day1;
+    private int minute1;
+    private int xDragStart;
+    private int yDragStart;
+
+    @Override
+    public void mouseClicked(MouseEvent evt) {
+    }
+
+    @Override
+    public void mouseEntered(MouseEvent evt) {
+    }
+
+    @Override
+    public void mouseExited(MouseEvent evt) {
+    }
+
+    @Override
+    public void mousePressed(MouseEvent evt) {
+        day0 = (int) Math.floor(evt.getX() / getDayWidth());
+        minute0 = (int) Math.floor(evt.getY()
+                / (getMinuteHeight() * TimeRect.minuteResterize))
+                * TimeRect.minuteResterize;
+        day1 = day0;
+        minute1 = minute0;
+        xDragStart = evt.getX();
+        yDragStart = evt.getY();
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent evt) {
+        // mouse must be moved 5px before creating a rect
+        if (xDragStart == -1
+                || Math.abs(evt.getX() - xDragStart)
+                        + Math.abs(evt.getY() - yDragStart) > 5) {
+            int day2 = Math.min(day0, day1);
+            int day3 = Math.max(day0, day1);
+            int minute2 = Math.min(minute0, minute1);
+            int minute3 = Math.max(minute0, minute1);
+
+            TimeRect timeRect = new TimeRect(OheEditor.this, day2, day3,
+                    minute2, minute3);
+            timeRects.add(timeRect);
+            contentPanel.add(timeRect);
+            timeRect.reposition();
+            dialog.updateValueField(timeRects);
+
+            day0 = -1;
+            repaint();
+        }
+    }
+
+    @Override
+    public void mouseDragged(MouseEvent evt) {
+        // mouse must be moved 5px before drawing a rect
+        if (xDragStart == -1
+                || Math.abs(evt.getX() - xDragStart)
+                        + Math.abs(evt.getY() - yDragStart) > 5) {
+            xDragStart = -1;
+            day1 = (int) Math.floor(evt.getX() / getDayWidth());
+            minute1 = (int) Math.floor(evt.getY()
+                    / (getMinuteHeight() * TimeRect.minuteResterize))
+                    * TimeRect.minuteResterize;
+            repaint();
+        }
+    }
+
+    @Override
+    public void mouseMoved(MouseEvent evt) {
+        mousePositionChanged(evt.getX(), evt.getY());
+    }
+
+    public void mousePositionChanged(int x, int y) {
+        int actualDay = (int) Math.floor(x / getDayWidth());
+        int minutes = (int) Math.floor(y
+                / (getMinuteHeight() * TimeRect.minuteResterize))
+                * TimeRect.minuteResterize;
+        actualDay = Math.max(0, Math.min(6, actualDay));
+        minutes = Math.max(0, Math.min(24 * 60, minutes));
+        dialog.setMousePositionText(OpeningTimeCompiler.WEEKDAYS[actualDay]
+                + " " + OpeningTimeUtils.timeString(minutes));
+    }
 }
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/TimeRect.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/TimeRect.java	(revision 23191)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/gui/TimeRect.java	(revision 23192)
@@ -20,277 +20,277 @@
 
 public class TimeRect extends JPanel implements MouseListener,
-		MouseMotionListener {
-	public static final int[] transformCursorTypes = new int[] {
-			Cursor.MOVE_CURSOR, Cursor.N_RESIZE_CURSOR,
-			Cursor.NE_RESIZE_CURSOR, Cursor.E_RESIZE_CURSOR,
-			Cursor.SE_RESIZE_CURSOR, Cursor.S_RESIZE_CURSOR,
-			Cursor.SW_RESIZE_CURSOR, Cursor.W_RESIZE_CURSOR,
-			Cursor.NW_RESIZE_CURSOR };
-
-	public static final int minuteResterize = 15;
-	public static final int verticalNonDrawedPixels = 5;
-
-	public static final boolean[][] transformDirections = new boolean[][] {
-			{ true, true, true, true }, // Drag
-			{ true, false, false, false }, // N
-			{ true, true, false, false }, // NE
-			{ false, true, false, false }, // E
-			{ false, true, true, false }, // SE
-			{ false, false, true, false }, // S
-			{ false, false, true, true }, // SW
-			{ false, false, false, true }, // W
-			{ true, false, false, true }, // NW
-	};
-
-	public static final int roundCornerSize = 8;
-	private final int clickAreaSize = 16;
-
-	private OheEditor editor;
-
-	private int dayStart;
-	private int dayEnd;
-	private int minuteStart;
-	private int minuteEnd;
-
-	public TimeRect(OheEditor editor, int dayStart, int dayEnd,
-			int minutesStart, int minutesEnd) {
-		this.editor = editor;
-
-		this.dayStart = dayStart;
-		this.dayEnd = dayEnd;
-		this.minuteStart = minutesStart;
-		this.minuteEnd = minutesEnd;
-
-		transformType = -1;
-
-		setOpaque(true);
-
-		addMouseListener(this);
-		addMouseMotionListener(this);
-	}
-
-	public int getDayStart() {
-		return dayStart;
-	}
-
-	public int getDayEnd() {
-		return dayEnd;
-	}
-
-	public int getMinuteStart() {
-		return minuteStart;
-	}
-
-	public int getMinuteEnd() {
-		return minuteEnd;
-	}
-
-	public void reposition() {
-		setBounds(editor.getPanelBoundsForTimeinterval(dayStart, dayEnd + 1,
-				minuteStart, minuteEnd));
-		editor.contentPanel.repaint();
-	}
-
-	private boolean isZeroMinuteInterval() {
-		return minuteStart == minuteEnd;
-	}
-
-	private boolean isOpenEndInterval() {
-		return minuteEnd == 24 * 60 + 1;
-	}
-
-	private void updateTimeInterval(int newDayStart, int newDayEnd,
-			int newMinuteStart, int newMinuteEnd) {
-		dayStart = newDayStart;
-		dayEnd = newDayEnd;
-		minuteStart = newMinuteStart;
-		minuteEnd = newMinuteEnd;
-
-		editor.dialog.updateValueField(editor.timeRects);
-		reposition();
-	}
-
-	@Override
-	public void paintComponent(Graphics g) {
-		drawTimeRect((Graphics2D) g, new Rectangle(0, 0, getWidth(),
-				getHeight()), isZeroMinuteInterval(), isOpenEndInterval());
-	}
-
-	public static void drawTimeRect(Graphics2D g2D, Rectangle bounds,
-			boolean isZeroMinuteInterval, boolean isOpenEndInterval) {
-
-		Color innerColor = new Color(135, 135, 234);
-		if (isOpenEndInterval)
-			innerColor = new Color(234, 135, 135);
-
-		int tmpRoundCornerSize = TimeRect.roundCornerSize;
-		int verticalNonFilledBorder = 1;
-		if (isZeroMinuteInterval) {
-			innerColor = new Color(135, 234, 135);
-			tmpRoundCornerSize = 0;
-			verticalNonFilledBorder = verticalNonDrawedPixels;
-		}
-
-		g2D.setColor(innerColor);
-		g2D.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
-				.6f));
-		g2D.fillRoundRect(bounds.x + 1, bounds.y + verticalNonFilledBorder,
-				bounds.width - 2, bounds.height - 1 - 2
-						* verticalNonFilledBorder, tmpRoundCornerSize,
-				tmpRoundCornerSize);
-
-		g2D.setColor(new Color(255, 0, 0));
-		g2D.setComposite(AlphaComposite
-				.getInstance(AlphaComposite.SRC_OVER, 1f));
-		g2D.drawRoundRect(bounds.x + 1, bounds.y + verticalNonFilledBorder,
-				bounds.width - 2, bounds.height - 1 - 2
-						* verticalNonFilledBorder, tmpRoundCornerSize,
-				tmpRoundCornerSize);
-
-	}
-
-	private int actualDayDrag;
-	private int actualMinuteDrag;
-	private int dragX;
-	private int dragY;
-	private int transformType;
-
-	// Calculate where the Component was clicked and returns the
-	// transformtype
-	private int getTransformType(MouseEvent evt) {
-		int tmpClickAreaWidth = Math.min(clickAreaSize, getWidth() / 3);
-		int tmpClickAreaHeight = Math.min(clickAreaSize, getHeight() / 3);
-
-		boolean isInNorthernTransformClickArea = evt.getY() < tmpClickAreaHeight;
-		boolean isInEasternTransformClickArea = evt.getX() > getWidth()
-				- tmpClickAreaWidth;
-		boolean isInSouthernTransformClickArea = evt.getY() > getHeight()
-				- tmpClickAreaHeight;
-		boolean isInWesternTransformClickArea = evt.getX() < tmpClickAreaWidth;
-
-		if (isZeroMinuteInterval()) {
-			isInNorthernTransformClickArea = false;
-			isInSouthernTransformClickArea = false;
-		}
-
-		int tType = 0;
-		for (int i = 1; i < transformDirections.length && tType == 0; i++) {
-			if (isInNorthernTransformClickArea == transformDirections[i][0]
-					&& isInEasternTransformClickArea == transformDirections[i][1]
-					&& isInSouthernTransformClickArea == transformDirections[i][2]
-					&& isInWesternTransformClickArea == transformDirections[i][3])
-				tType = i;
-		}
-
-		return tType;
-	}
-
-	public void showMenu(MouseEvent evt) {
-		JPopupMenu menu = new JPopupMenu();
-		final JCheckBoxMenuItem cbMenuItem = new JCheckBoxMenuItem(
-				tr("open end"), isOpenEndInterval());
-		menu.add(cbMenuItem);
-		cbMenuItem.addActionListener(new ActionListener() {
-			@Override
-			public void actionPerformed(ActionEvent e) {
-				if (cbMenuItem.isSelected())
-					updateTimeInterval(dayStart, dayEnd, minuteStart,
-							24 * 60 + 1);
-				else
-					updateTimeInterval(dayStart, dayEnd, minuteStart, 24 * 60);
-			}
-		});
-		menu.show(this, evt.getX(), evt.getY());
-	}
-
-	@Override
-	public void mouseClicked(MouseEvent evt) {
-	}
-
-	@Override
-	public void mouseEntered(MouseEvent evt) {
-	}
-
-	@Override
-	public void mouseExited(MouseEvent evt) {
-		if (transformType < 0)
-			setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
-	}
-
-	@Override
-	public void mousePressed(MouseEvent evt) {
-		if (evt.isPopupTrigger()) {
-			showMenu(evt);
-		} else {
-			actualDayDrag = 0;
-			actualMinuteDrag = 0;
-			dragX = evt.getXOnScreen();
-			dragY = evt.getYOnScreen();
-			transformType = getTransformType(evt);
-		}
-	}
-
-	@Override
-	public void mouseReleased(MouseEvent evt) {
-		transformType = -1;
-	}
-
-	@Override
-	public void mouseDragged(MouseEvent evt) {
-		if (transformType >= 0) {
-			int xDiff = evt.getXOnScreen() - dragX;
-			int yDiff = evt.getYOnScreen() - dragY;
-
-			xDiff = (int) Math.round(xDiff / editor.getDayWidth())
-					- actualDayDrag;
-			yDiff = (int) Math.round(yDiff
-					/ (editor.getMinuteHeight() * minuteResterize))
-					* minuteResterize - actualMinuteDrag;
-
-			if (xDiff != 0) {
-				int newDayStart = dayStart;
-				int newDayEnd = dayEnd;
-
-				if (transformDirections[transformType][3])
-					newDayStart += xDiff;
-				if (transformDirections[transformType][1])
-					newDayEnd += xDiff;
-
-				if (newDayStart > newDayEnd) {
-					editor.removeTimeRect(this);
-					transformType = -1;
-					setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
-				} else if (newDayStart >= 0 && newDayEnd <= 6) {
-					actualDayDrag += xDiff;
-					updateTimeInterval(newDayStart, newDayEnd, minuteStart,
-							minuteEnd);
-				}
-			}
-			if (yDiff != 0 && transformType >= 0) {
-				int newMinutesStart = minuteStart;
-				int newMinutesEnd = minuteEnd;
-
-				if (transformDirections[transformType][0])
-					newMinutesStart = newMinutesStart + yDiff;
-				if (transformDirections[transformType][2]
-						&& !isOpenEndInterval())
-					newMinutesEnd = newMinutesEnd + yDiff;
-
-				if (newMinutesStart >= 0
-						&& (newMinutesEnd <= 24 * 60 || isOpenEndInterval())) {
-					actualMinuteDrag += yDiff;
-					updateTimeInterval(dayStart, dayEnd, newMinutesStart,
-							newMinutesEnd);
-				}
-			}
-		}
-		editor.mousePositionChanged(evt.getX() + getX(), evt.getY() + getY());
-	}
-
-	@Override
-	public void mouseMoved(MouseEvent evt) {
-		if (transformType < 0)
-			setCursor(new Cursor(transformCursorTypes[getTransformType(evt)]));
-		editor.mousePositionChanged(evt.getX() + getX(), evt.getY() + getY());
-	}
+        MouseMotionListener {
+    public static final int[] transformCursorTypes = new int[] {
+            Cursor.MOVE_CURSOR, Cursor.N_RESIZE_CURSOR,
+            Cursor.NE_RESIZE_CURSOR, Cursor.E_RESIZE_CURSOR,
+            Cursor.SE_RESIZE_CURSOR, Cursor.S_RESIZE_CURSOR,
+            Cursor.SW_RESIZE_CURSOR, Cursor.W_RESIZE_CURSOR,
+            Cursor.NW_RESIZE_CURSOR };
+
+    public static final int minuteResterize = 15;
+    public static final int verticalNonDrawedPixels = 5;
+
+    public static final boolean[][] transformDirections = new boolean[][] {
+            { true, true, true, true }, // Drag
+            { true, false, false, false }, // N
+            { true, true, false, false }, // NE
+            { false, true, false, false }, // E
+            { false, true, true, false }, // SE
+            { false, false, true, false }, // S
+            { false, false, true, true }, // SW
+            { false, false, false, true }, // W
+            { true, false, false, true }, // NW
+    };
+
+    public static final int roundCornerSize = 8;
+    private final int clickAreaSize = 16;
+
+    private OheEditor editor;
+
+    private int dayStart;
+    private int dayEnd;
+    private int minuteStart;
+    private int minuteEnd;
+
+    public TimeRect(OheEditor editor, int dayStart, int dayEnd,
+            int minutesStart, int minutesEnd) {
+        this.editor = editor;
+
+        this.dayStart = dayStart;
+        this.dayEnd = dayEnd;
+        this.minuteStart = minutesStart;
+        this.minuteEnd = minutesEnd;
+
+        transformType = -1;
+
+        setOpaque(true);
+
+        addMouseListener(this);
+        addMouseMotionListener(this);
+    }
+
+    public int getDayStart() {
+        return dayStart;
+    }
+
+    public int getDayEnd() {
+        return dayEnd;
+    }
+
+    public int getMinuteStart() {
+        return minuteStart;
+    }
+
+    public int getMinuteEnd() {
+        return minuteEnd;
+    }
+
+    public void reposition() {
+        setBounds(editor.getPanelBoundsForTimeinterval(dayStart, dayEnd + 1,
+                minuteStart, minuteEnd));
+        editor.contentPanel.repaint();
+    }
+
+    private boolean isZeroMinuteInterval() {
+        return minuteStart == minuteEnd;
+    }
+
+    private boolean isOpenEndInterval() {
+        return minuteEnd == 24 * 60 + 1;
+    }
+
+    private void updateTimeInterval(int newDayStart, int newDayEnd,
+            int newMinuteStart, int newMinuteEnd) {
+        dayStart = newDayStart;
+        dayEnd = newDayEnd;
+        minuteStart = newMinuteStart;
+        minuteEnd = newMinuteEnd;
+
+        editor.dialog.updateValueField(editor.timeRects);
+        reposition();
+    }
+
+    @Override
+    public void paintComponent(Graphics g) {
+        drawTimeRect((Graphics2D) g, new Rectangle(0, 0, getWidth(),
+                getHeight()), isZeroMinuteInterval(), isOpenEndInterval());
+    }
+
+    public static void drawTimeRect(Graphics2D g2D, Rectangle bounds,
+            boolean isZeroMinuteInterval, boolean isOpenEndInterval) {
+
+        Color innerColor = new Color(135, 135, 234);
+        if (isOpenEndInterval)
+            innerColor = new Color(234, 135, 135);
+
+        int tmpRoundCornerSize = TimeRect.roundCornerSize;
+        int verticalNonFilledBorder = 1;
+        if (isZeroMinuteInterval) {
+            innerColor = new Color(135, 234, 135);
+            tmpRoundCornerSize = 0;
+            verticalNonFilledBorder = verticalNonDrawedPixels;
+        }
+
+        g2D.setColor(innerColor);
+        g2D.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
+                .6f));
+        g2D.fillRoundRect(bounds.x + 1, bounds.y + verticalNonFilledBorder,
+                bounds.width - 2, bounds.height - 1 - 2
+                        * verticalNonFilledBorder, tmpRoundCornerSize,
+                tmpRoundCornerSize);
+
+        g2D.setColor(new Color(255, 0, 0));
+        g2D.setComposite(AlphaComposite
+                .getInstance(AlphaComposite.SRC_OVER, 1f));
+        g2D.drawRoundRect(bounds.x + 1, bounds.y + verticalNonFilledBorder,
+                bounds.width - 2, bounds.height - 1 - 2
+                        * verticalNonFilledBorder, tmpRoundCornerSize,
+                tmpRoundCornerSize);
+
+    }
+
+    private int actualDayDrag;
+    private int actualMinuteDrag;
+    private int dragX;
+    private int dragY;
+    private int transformType;
+
+    // Calculate where the Component was clicked and returns the
+    // transformtype
+    private int getTransformType(MouseEvent evt) {
+        int tmpClickAreaWidth = Math.min(clickAreaSize, getWidth() / 3);
+        int tmpClickAreaHeight = Math.min(clickAreaSize, getHeight() / 3);
+
+        boolean isInNorthernTransformClickArea = evt.getY() < tmpClickAreaHeight;
+        boolean isInEasternTransformClickArea = evt.getX() > getWidth()
+                - tmpClickAreaWidth;
+        boolean isInSouthernTransformClickArea = evt.getY() > getHeight()
+                - tmpClickAreaHeight;
+        boolean isInWesternTransformClickArea = evt.getX() < tmpClickAreaWidth;
+
+        if (isZeroMinuteInterval()) {
+            isInNorthernTransformClickArea = false;
+            isInSouthernTransformClickArea = false;
+        }
+
+        int tType = 0;
+        for (int i = 1; i < transformDirections.length && tType == 0; i++) {
+            if (isInNorthernTransformClickArea == transformDirections[i][0]
+                    && isInEasternTransformClickArea == transformDirections[i][1]
+                    && isInSouthernTransformClickArea == transformDirections[i][2]
+                    && isInWesternTransformClickArea == transformDirections[i][3])
+                tType = i;
+        }
+
+        return tType;
+    }
+
+    public void showMenu(MouseEvent evt) {
+        JPopupMenu menu = new JPopupMenu();
+        final JCheckBoxMenuItem cbMenuItem = new JCheckBoxMenuItem(
+                tr("open end"), isOpenEndInterval());
+        menu.add(cbMenuItem);
+        cbMenuItem.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (cbMenuItem.isSelected())
+                    updateTimeInterval(dayStart, dayEnd, minuteStart,
+                            24 * 60 + 1);
+                else
+                    updateTimeInterval(dayStart, dayEnd, minuteStart, 24 * 60);
+            }
+        });
+        menu.show(this, evt.getX(), evt.getY());
+    }
+
+    @Override
+    public void mouseClicked(MouseEvent evt) {
+    }
+
+    @Override
+    public void mouseEntered(MouseEvent evt) {
+    }
+
+    @Override
+    public void mouseExited(MouseEvent evt) {
+        if (transformType < 0)
+            setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+    }
+
+    @Override
+    public void mousePressed(MouseEvent evt) {
+        if (evt.isPopupTrigger()) {
+            showMenu(evt);
+        } else {
+            actualDayDrag = 0;
+            actualMinuteDrag = 0;
+            dragX = evt.getXOnScreen();
+            dragY = evt.getYOnScreen();
+            transformType = getTransformType(evt);
+        }
+    }
+
+    @Override
+    public void mouseReleased(MouseEvent evt) {
+        transformType = -1;
+    }
+
+    @Override
+    public void mouseDragged(MouseEvent evt) {
+        if (transformType >= 0) {
+            int xDiff = evt.getXOnScreen() - dragX;
+            int yDiff = evt.getYOnScreen() - dragY;
+
+            xDiff = (int) Math.round(xDiff / editor.getDayWidth())
+                    - actualDayDrag;
+            yDiff = (int) Math.round(yDiff
+                    / (editor.getMinuteHeight() * minuteResterize))
+                    * minuteResterize - actualMinuteDrag;
+
+            if (xDiff != 0) {
+                int newDayStart = dayStart;
+                int newDayEnd = dayEnd;
+
+                if (transformDirections[transformType][3])
+                    newDayStart += xDiff;
+                if (transformDirections[transformType][1])
+                    newDayEnd += xDiff;
+
+                if (newDayStart > newDayEnd) {
+                    editor.removeTimeRect(this);
+                    transformType = -1;
+                    setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+                } else if (newDayStart >= 0 && newDayEnd <= 6) {
+                    actualDayDrag += xDiff;
+                    updateTimeInterval(newDayStart, newDayEnd, minuteStart,
+                            minuteEnd);
+                }
+            }
+            if (yDiff != 0 && transformType >= 0) {
+                int newMinutesStart = minuteStart;
+                int newMinutesEnd = minuteEnd;
+
+                if (transformDirections[transformType][0])
+                    newMinutesStart = newMinutesStart + yDiff;
+                if (transformDirections[transformType][2]
+                        && !isOpenEndInterval())
+                    newMinutesEnd = newMinutesEnd + yDiff;
+
+                if (newMinutesStart >= 0
+                        && (newMinutesEnd <= 24 * 60 || isOpenEndInterval())) {
+                    actualMinuteDrag += yDiff;
+                    updateTimeInterval(dayStart, dayEnd, newMinutesStart,
+                            newMinutesEnd);
+                }
+            }
+        }
+        editor.mousePositionChanged(evt.getX() + getX(), evt.getY() + getY());
+    }
+
+    @Override
+    public void mouseMoved(MouseEvent evt) {
+        if (transformType < 0)
+            setCursor(new Cursor(transformCursorTypes[getTransformType(evt)]));
+        editor.mousePositionChanged(evt.getX() + getX(), evt.getY() + getY());
+    }
 }
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/OpeningTimeCompilerTokenManager.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/OpeningTimeCompilerTokenManager.java	(revision 23191)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/OpeningTimeCompilerTokenManager.java	(revision 23192)
@@ -274,5 +274,5 @@
 /** Token literal values. */
 public static final String[] jjstrLiteralImages = {
-"", null, null, "\53", "\157\146\146", "\62\64\57\67", "\73\40", "\40", "\54", 
+"", null, null, "\53", "\157\146\146", "\62\64\57\67", "\73\40", "\40", "\54",
 "\55", "\72", };
 
@@ -362,5 +362,5 @@
 
 /** Get the next Token. */
-public Token getNextToken() 
+public Token getNextToken()
 {
   Token matchedToken;
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/SyntaxException.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/SyntaxException.java	(revision 23191)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/SyntaxException.java	(revision 23192)
@@ -3,24 +3,24 @@
 public class SyntaxException extends Exception {
 
-	private int startColumn;
-	private int endColumn;
-	private String info;
+    private int startColumn;
+    private int endColumn;
+    private String info;
 
-	public int getStartColumn() {
-		return startColumn;
-	}
+    public int getStartColumn() {
+        return startColumn;
+    }
 
-	public int getEndColumn() {
-		return endColumn;
-	}
+    public int getEndColumn() {
+        return endColumn;
+    }
 
-	public String getInfo() {
-		return info;
-	}
+    public String getInfo() {
+        return info;
+    }
 
-	public SyntaxException(String info, int startColumn, int endColumn) {
-		this.startColumn = startColumn;
-		this.endColumn = endColumn;
-		this.info = info;
-	}
+    public SyntaxException(String info, int startColumn, int endColumn) {
+        this.startColumn = startColumn;
+        this.endColumn = endColumn;
+        this.info = info;
+    }
 }
Index: /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/TokenMgrError.java
===================================================================
--- /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/TokenMgrError.java	(revision 23191)
+++ /applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/TokenMgrError.java	(revision 23192)
@@ -6,160 +6,160 @@
 public class TokenMgrError extends Error {
 
-	/**
-	 * The version identifier for this Serializable class. Increment only if the
-	 * <i>serialized</i> form of the class changes.
-	 */
-	private static final long serialVersionUID = 1L;
+    /**
+     * The version identifier for this Serializable class. Increment only if the
+     * <i>serialized</i> form of the class changes.
+     */
+    private static final long serialVersionUID = 1L;
 
-	/*
-	 * Ordinals for various reasons why an Error of this type can be thrown.
-	 */
+    /*
+     * Ordinals for various reasons why an Error of this type can be thrown.
+     */
 
-	/**
-	 * Lexical error occurred.
-	 */
-	static final int LEXICAL_ERROR = 0;
+    /**
+     * Lexical error occurred.
+     */
+    static final int LEXICAL_ERROR = 0;
 
-	/**
-	 * An attempt was made to create a second instance of a static token
-	 * manager.
-	 */
-	static final int STATIC_LEXER_ERROR = 1;
+    /**
+     * An attempt was made to create a second instance of a static token
+     * manager.
+     */
+    static final int STATIC_LEXER_ERROR = 1;
 
-	/**
-	 * Tried to change to an invalid lexical state.
-	 */
-	static final int INVALID_LEXICAL_STATE = 2;
+    /**
+     * Tried to change to an invalid lexical state.
+     */
+    static final int INVALID_LEXICAL_STATE = 2;
 
-	/**
-	 * Detected (and bailed out of) an infinite loop in the token manager.
-	 */
-	static final int LOOP_DETECTED = 3;
+    /**
+     * Detected (and bailed out of) an infinite loop in the token manager.
+     */
+    static final int LOOP_DETECTED = 3;
 
-	/**
-	 * Indicates the reason why the exception is thrown. It will have one of the
-	 * above 4 values.
-	 */
-	int errorCode;
+    /**
+     * Indicates the reason why the exception is thrown. It will have one of the
+     * above 4 values.
+     */
+    int errorCode;
 
-	/**
-	 * Replaces unprintable characters by their escaped (or unicode escaped)
-	 * equivalents in the given string
-	 */
-	protected static final String addEscapes(String str) {
-		StringBuffer retval = new StringBuffer();
-		char ch;
-		for (int i = 0; i < str.length(); i++) {
-			switch (str.charAt(i)) {
-			case 0:
-				continue;
-			case '\b':
-				retval.append("\\b");
-				continue;
-			case '\t':
-				retval.append("\\t");
-				continue;
-			case '\n':
-				retval.append("\\n");
-				continue;
-			case '\f':
-				retval.append("\\f");
-				continue;
-			case '\r':
-				retval.append("\\r");
-				continue;
-			case '\"':
-				retval.append("\\\"");
-				continue;
-			case '\'':
-				retval.append("\\\'");
-				continue;
-			case '\\':
-				retval.append("\\\\");
-				continue;
-			default:
-				if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
-					String s = "0000" + Integer.toString(ch, 16);
-					retval.append("\\u"
-							+ s.substring(s.length() - 4, s.length()));
-				} else {
-					retval.append(ch);
-				}
-				continue;
-			}
-		}
-		return retval.toString();
-	}
+    /**
+     * Replaces unprintable characters by their escaped (or unicode escaped)
+     * equivalents in the given string
+     */
+    protected static final String addEscapes(String str) {
+        StringBuffer retval = new StringBuffer();
+        char ch;
+        for (int i = 0; i < str.length(); i++) {
+            switch (str.charAt(i)) {
+            case 0:
+                continue;
+            case '\b':
+                retval.append("\\b");
+                continue;
+            case '\t':
+                retval.append("\\t");
+                continue;
+            case '\n':
+                retval.append("\\n");
+                continue;
+            case '\f':
+                retval.append("\\f");
+                continue;
+            case '\r':
+                retval.append("\\r");
+                continue;
+            case '\"':
+                retval.append("\\\"");
+                continue;
+            case '\'':
+                retval.append("\\\'");
+                continue;
+            case '\\':
+                retval.append("\\\\");
+                continue;
+            default:
+                if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
+                    String s = "0000" + Integer.toString(ch, 16);
+                    retval.append("\\u"
+                            + s.substring(s.length() - 4, s.length()));
+                } else {
+                    retval.append(ch);
+                }
+                continue;
+            }
+        }
+        return retval.toString();
+    }
 
-	/**
-	 * Returns a detailed message for the Error when it is thrown by the token
-	 * manager to indicate a lexical error. Parameters : EOFSeen : indicates if
-	 * EOF caused the lexical error curLexState : lexical state in which this
-	 * error occurred errorLine : line number when the error occurred
-	 * errorColumn : column number when the error occurred errorAfter : prefix
-	 * that was seen before this error occurred curchar : the offending
-	 * character Note: You can customize the lexical error message by modifying
-	 * this method.
-	 */
-	protected static String LexicalError(boolean EOFSeen, int lexState,
-			int errorLine, int errorColumn, String errorAfter, char curChar) {
-		return ("Lexical error at line "
-				+ errorLine
-				+ ", column "
-				+ errorColumn
-				+ ".  Encountered: "
-				+ (EOFSeen ? "<EOF> " : ("\""
-						+ addEscapes(String.valueOf(curChar)) + "\"")
-						+ " (" + (int) curChar + "), ") + "after : \""
-				+ addEscapes(errorAfter) + "\"");
-	}
+    /**
+     * Returns a detailed message for the Error when it is thrown by the token
+     * manager to indicate a lexical error. Parameters : EOFSeen : indicates if
+     * EOF caused the lexical error curLexState : lexical state in which this
+     * error occurred errorLine : line number when the error occurred
+     * errorColumn : column number when the error occurred errorAfter : prefix
+     * that was seen before this error occurred curchar : the offending
+     * character Note: You can customize the lexical error message by modifying
+     * this method.
+     */
+    protected static String LexicalError(boolean EOFSeen, int lexState,
+            int errorLine, int errorColumn, String errorAfter, char curChar) {
+        return ("Lexical error at line "
+                + errorLine
+                + ", column "
+                + errorColumn
+                + ".  Encountered: "
+                + (EOFSeen ? "<EOF> " : ("\""
+                        + addEscapes(String.valueOf(curChar)) + "\"")
+                        + " (" + (int) curChar + "), ") + "after : \""
+                + addEscapes(errorAfter) + "\"");
+    }
 
-	/**
-	 * You can also modify the body of this method to customize your error
-	 * messages. For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE
-	 * are not of end-users concern, so you can return something like :
-	 *
-	 * "Internal Error : Please file a bug report .... "
-	 *
-	 * from this method for such cases in the release version of your parser.
-	 */
-	@Override
-	public String getMessage() {
-		return super.getMessage();
-	}
+    /**
+     * You can also modify the body of this method to customize your error
+     * messages. For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE
+     * are not of end-users concern, so you can return something like :
+     *
+     * "Internal Error : Please file a bug report .... "
+     *
+     * from this method for such cases in the release version of your parser.
+     */
+    @Override
+    public String getMessage() {
+        return super.getMessage();
+    }
 
-	/*
-	 * Constructors of various flavors follow.
-	 */
+    /*
+     * Constructors of various flavors follow.
+     */
 
-	/** No arg constructor. */
-	public TokenMgrError() {
-	}
+    /** No arg constructor. */
+    public TokenMgrError() {
+    }
 
-	/** Constructor with message and reason. */
-	public TokenMgrError(String message, int reason) {
-		super(message);
-		errorCode = reason;
-	}
+    /** Constructor with message and reason. */
+    public TokenMgrError(String message, int reason) {
+        super(message);
+        errorCode = reason;
+    }
 
-	public boolean EOFSeen;
-	public int lexState;
-	public int errorLine;
-	public int errorColumn;
-	public String errorAfter;
-	public char curChar;
-	public int reason;
+    public boolean EOFSeen;
+    public int lexState;
+    public int errorLine;
+    public int errorColumn;
+    public String errorAfter;
+    public char curChar;
+    public int reason;
 
-	/** Full Constructor. */
-	public TokenMgrError(boolean EOFSeen, int lexState, int errorLine,
-			int errorColumn, String errorAfter, char curChar, int reason) {
-		this.EOFSeen = EOFSeen;
-		this.lexState = lexState;
-		this.errorLine = errorLine;
-		this.errorColumn = errorColumn;
-		this.errorAfter = errorAfter;
-		this.curChar = curChar;
-		this.reason = reason;
-	}
+    /** Full Constructor. */
+    public TokenMgrError(boolean EOFSeen, int lexState, int errorLine,
+            int errorColumn, String errorAfter, char curChar, int reason) {
+        this.EOFSeen = EOFSeen;
+        this.lexState = lexState;
+        this.errorLine = errorLine;
+        this.errorColumn = errorColumn;
+        this.errorAfter = errorAfter;
+        this.curChar = curChar;
+        this.reason = reason;
+    }
 }
 /*
Index: /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysMode.java
===================================================================
--- /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysMode.java	(revision 23191)
+++ /applications/editors/josm/plugins/alignways/src/org/openstreetmap/josm/plugins/alignways/AlignWaysMode.java	(revision 23192)
@@ -28,158 +28,158 @@
 public class AlignWaysMode extends MapMode /* implements MapViewPaintable */{
 
-	private static final long serialVersionUID = -1090955708412011141L;
-	private final AlignWaysState noneSelected;
-	private final AlignWaysState referenceSelected;
-	private final AlignWaysState aligneeSelected;
-	private final AlignWaysState bothSelected;
-	private AlignWaysState currentState;
-	private AlignWaysSegmentMgr awSegs;
-	boolean tipShown;
+    private static final long serialVersionUID = -1090955708412011141L;
+    private final AlignWaysState noneSelected;
+    private final AlignWaysState referenceSelected;
+    private final AlignWaysState aligneeSelected;
+    private final AlignWaysState bothSelected;
+    private AlignWaysState currentState;
+    private AlignWaysSegmentMgr awSegs;
+    boolean tipShown;
 
-	public AlignWaysMode(MapFrame mapFrame, String name, String desc) {
-		super(tr(name), "alignways.png", tr(desc),
-				Shortcut.registerShortcut("mapmode:alignways",
-						tr("Mode: {0}", tr("Align Ways")),
-						KeyEvent.VK_N, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT),
-						mapFrame, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-		noneSelected = new AlignWaysSelNoneState();
-		referenceSelected = new AlignWaysSelRefState();
-		aligneeSelected = new AlignWaysSelAlgnState();
-		bothSelected = new AlignWaysSelBothState();
-		tipShown = false;
+    public AlignWaysMode(MapFrame mapFrame, String name, String desc) {
+        super(tr(name), "alignways.png", tr(desc),
+                Shortcut.registerShortcut("mapmode:alignways",
+                        tr("Mode: {0}", tr("Align Ways")),
+                        KeyEvent.VK_N, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT),
+                        mapFrame, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+        noneSelected = new AlignWaysSelNoneState();
+        referenceSelected = new AlignWaysSelRefState();
+        aligneeSelected = new AlignWaysSelAlgnState();
+        bothSelected = new AlignWaysSelBothState();
+        tipShown = false;
 
-	}
+    }
 
-	@Override
-	public void enterMode() {
-		super.enterMode();
-		boolean showTips = Boolean.parseBoolean(Main.pref.get("alignways.showtips", "true"));
-		if ((showTips) && (!tipShown)) {
-			showTips();
-		}
-		awSegs = AlignWaysSegmentMgr.getInstance(Main.map.mapView);
-		Main.map.mapView.addMouseListener(this);
-		setCurrentState(noneSelected);
-	}
+    @Override
+    public void enterMode() {
+        super.enterMode();
+        boolean showTips = Boolean.parseBoolean(Main.pref.get("alignways.showtips", "true"));
+        if ((showTips) && (!tipShown)) {
+            showTips();
+        }
+        awSegs = AlignWaysSegmentMgr.getInstance(Main.map.mapView);
+        Main.map.mapView.addMouseListener(this);
+        setCurrentState(noneSelected);
+    }
 
-	@Override
-	public void exitMode() {
-		super.exitMode();
-		setCurrentState(noneSelected);
-		Main.map.mapView.removeMouseListener(this);
-		AlignWaysPlugin.getAwAction().setEnabled(false);
-	}
+    @Override
+    public void exitMode() {
+        super.exitMode();
+        setCurrentState(noneSelected);
+        Main.map.mapView.removeMouseListener(this);
+        AlignWaysPlugin.getAwAction().setEnabled(false);
+    }
 
-	@Override
-	public void mouseClicked(MouseEvent e) {
+    @Override
+    public void mouseClicked(MouseEvent e) {
 
-		boolean ctrlPressed = (e.getModifiers() & ActionEvent.CTRL_MASK) != 0;
-		boolean altPressed = (e.getModifiers() & (ActionEvent.ALT_MASK | InputEvent.ALT_GRAPH_MASK)) != 0;
+        boolean ctrlPressed = (e.getModifiers() & ActionEvent.CTRL_MASK) != 0;
+        boolean altPressed = (e.getModifiers() & (ActionEvent.ALT_MASK | InputEvent.ALT_GRAPH_MASK)) != 0;
 
-		if (e.getButton() == MouseEvent.BUTTON1) {
+        if (e.getButton() == MouseEvent.BUTTON1) {
 
-			if (altPressed) {
-				currentState.altLClick(this);
+            if (altPressed) {
+                currentState.altLClick(this);
 
-			} else {
-				Point clickedPoint = new Point(e.getX(), e.getY());
+            } else {
+                Point clickedPoint = new Point(e.getX(), e.getY());
 
-				if (!ctrlPressed) {
-					// Alignee could change
+                if (!ctrlPressed) {
+                    // Alignee could change
 
-					if (awSegs.algnUpdate(clickedPoint)) {
-						currentState.leftClick(this);
-					}
+                    if (awSegs.algnUpdate(clickedPoint)) {
+                        currentState.leftClick(this);
+                    }
 
-				} else {
-					// Reference could change
-					if (awSegs.refUpdate(clickedPoint)) {
-						currentState.ctrlLClick(this);
-					}
-				}
-			}
-		}
+                } else {
+                    // Reference could change
+                    if (awSegs.refUpdate(clickedPoint)) {
+                        currentState.ctrlLClick(this);
+                    }
+                }
+            }
+        }
 
-		// Activate the Align Ways button if we have enough selections
-		if (currentState == bothSelected) {
-			AlignWaysPlugin.getAwAction().setEnabled(true);
-		} else {
-			AlignWaysPlugin.getAwAction().setEnabled(false);
-		}
-		Main.map.mapView.repaint();
-	}
+        // Activate the Align Ways button if we have enough selections
+        if (currentState == bothSelected) {
+            AlignWaysPlugin.getAwAction().setEnabled(true);
+        } else {
+            AlignWaysPlugin.getAwAction().setEnabled(false);
+        }
+        Main.map.mapView.repaint();
+    }
 
-	/**
-	 * @param currentState
-	 *            One of the AlignWays states
-	 */
-	public void setCurrentState(AlignWaysState currentState) {
-		this.currentState = currentState;
-		currentState.setHelpText();
+    /**
+     * @param currentState
+     *            One of the AlignWays states
+     */
+    public void setCurrentState(AlignWaysState currentState) {
+        this.currentState = currentState;
+        currentState.setHelpText();
 
-		if (currentState == noneSelected) {
-			awSegs.cleanupWays();
-			// FIX: getCurrentDataSet may return null when the editable layer had
-			// already been removed by JOSM. This happens e.g. when the user closes
-			// JOSM while AlignWays mode is still active.
-			if (getCurrentDataSet() != null) {
-				getCurrentDataSet().clearSelection();
-			}
-		}
-	}
+        if (currentState == noneSelected) {
+            awSegs.cleanupWays();
+            // FIX: getCurrentDataSet may return null when the editable layer had
+            // already been removed by JOSM. This happens e.g. when the user closes
+            // JOSM while AlignWays mode is still active.
+            if (getCurrentDataSet() != null) {
+                getCurrentDataSet().clearSelection();
+            }
+        }
+    }
 
-	/**
-	 * @return the noneSelected
-	 */
-	public AlignWaysState getNoneSelected() {
-		return noneSelected;
-	}
+    /**
+     * @return the noneSelected
+     */
+    public AlignWaysState getNoneSelected() {
+        return noneSelected;
+    }
 
-	/**
-	 * @return the referenceSelected
-	 */
-	public AlignWaysState getReferenceSelected() {
-		return referenceSelected;
-	}
+    /**
+     * @return the referenceSelected
+     */
+    public AlignWaysState getReferenceSelected() {
+        return referenceSelected;
+    }
 
-	/**
-	 * @return the aligneeSelected
-	 */
-	public AlignWaysState getAligneeSelected() {
-		return aligneeSelected;
-	}
+    /**
+     * @return the aligneeSelected
+     */
+    public AlignWaysState getAligneeSelected() {
+        return aligneeSelected;
+    }
 
-	/**
-	 * @return the bothSelected
-	 */
-	public AlignWaysState getBothSelected() {
-		return bothSelected;
-	}
+    /**
+     * @return the bothSelected
+     */
+    public AlignWaysState getBothSelected() {
+        return bothSelected;
+    }
 
-	/**
-	 * @return the current state
-	 */
-	public AlignWaysState getCurrentState() {
-		return currentState;
-	}
+    /**
+     * @return the current state
+     */
+    public AlignWaysState getCurrentState() {
+        return currentState;
+    }
 
-	private void showTips() {
+    private void showTips() {
 
-		AlignWaysTipsPanel atd = new AlignWaysTipsPanel();
-		Object[] okButton = {tr("I''m ready!")};
-		JOptionPane tipPane = new JOptionPane(atd, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, okButton, okButton[0]);
-		// JDialog tipDialog = tipPane.createDialog(null, tr("AlignWays Tips"));
-		// Take Main.map as frame as it's better to inherit its icon than the default Java cup
-		JDialog tipDialog = tipPane.createDialog(Main.parent, tr("AlignWays Tips"));
-		// ((Frame)tipDialog.getOwner()).setIconImage(new ImageIcon(getClass().getResource("/images/blank.png")).getImage());
+        AlignWaysTipsPanel atd = new AlignWaysTipsPanel();
+        Object[] okButton = {tr("I''m ready!")};
+        JOptionPane tipPane = new JOptionPane(atd, JOptionPane.PLAIN_MESSAGE, JOptionPane.DEFAULT_OPTION, null, okButton, okButton[0]);
+        // JDialog tipDialog = tipPane.createDialog(null, tr("AlignWays Tips"));
+        // Take Main.map as frame as it's better to inherit its icon than the default Java cup
+        JDialog tipDialog = tipPane.createDialog(Main.parent, tr("AlignWays Tips"));
+        // ((Frame)tipDialog.getOwner()).setIconImage(new ImageIcon(getClass().getResource("/images/blank.png")).getImage());
 
-		tipDialog.setResizable(true);
-		tipDialog.setVisible(true);
-		tipShown = true;
+        tipDialog.setResizable(true);
+        tipDialog.setVisible(true);
+        tipShown = true;
 
-		tipDialog.dispose();
+        tipDialog.dispose();
 
-		Main.pref.put("alignways.showtips", !atd.isChkBoxSelected());
+        Main.pref.put("alignways.showtips", !atd.isChkBoxSelected());
 
-	}
+    }
 }
Index: /applications/editors/josm/plugins/colorscheme/src/at/dallermassl/josm/plugin/colorscheme/ColorSchemePlugin.java
===================================================================
--- /applications/editors/josm/plugins/colorscheme/src/at/dallermassl/josm/plugin/colorscheme/ColorSchemePlugin.java	(revision 23191)
+++ /applications/editors/josm/plugins/colorscheme/src/at/dallermassl/josm/plugin/colorscheme/ColorSchemePlugin.java	(revision 23192)
@@ -20,5 +20,5 @@
      */
     public ColorSchemePlugin(PluginInformation info) {
-    	super(info);
+        super(info);
     }
 
Index: /applications/editors/josm/plugins/download_along/src/org/openstreetmap/josm/plugin/download_along/DownloadAlong.java
===================================================================
--- /applications/editors/josm/plugins/download_along/src/org/openstreetmap/josm/plugin/download_along/DownloadAlong.java	(revision 23191)
+++ /applications/editors/josm/plugins/download_along/src/org/openstreetmap/josm/plugin/download_along/DownloadAlong.java	(revision 23192)
@@ -48,6 +48,6 @@
   private static class DownloadAlongAction extends JosmAction {
     /**
-		 * 
-		 */
+         *
+         */
     private static final long serialVersionUID = 1L;
 
@@ -193,5 +193,5 @@
        * however we can only download rectangles, so the following is an attempt
        * at finding a number of rectangles to download.
-       * 
+       *
        * The idea is simply: Start out with the full bounding box. If it is too
        * large, then split it in half and repeat recursively for each half until
Index: /applications/editors/josm/plugins/nearclick/src/nearclick/NearClickPlugin.java
===================================================================
--- /applications/editors/josm/plugins/nearclick/src/nearclick/NearClickPlugin.java	(revision 23191)
+++ /applications/editors/josm/plugins/nearclick/src/nearclick/NearClickPlugin.java	(revision 23192)
@@ -13,52 +13,52 @@
 public class NearClickPlugin implements AWTEventListener {
 
-	private int mouseDownX = -1;
-	private int mouseDownY = -1;
-	private long mouseDownTime = -1;
-	private int radiussquared = 49;
-	private int delay = 250;
+    private int mouseDownX = -1;
+    private int mouseDownY = -1;
+    private long mouseDownTime = -1;
+    private int radiussquared = 49;
+    private int delay = 250;
 
-	public NearClickPlugin(PluginInformation info) {
-		Toolkit.getDefaultToolkit().addAWTEventListener(this,
-				AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
-		try {
-			int radius = Integer.parseInt(Main.pref
-					.get("nearclick.radius", "7"));
-			radiussquared = radius * radius;
-			delay = Integer.parseInt(Main.pref.get("nearclick.delay", "250"));
-		} catch (NumberFormatException ex) {
-			delay = 250;
-			radiussquared = 7 * 7;
-		}
-	}
+    public NearClickPlugin(PluginInformation info) {
+        Toolkit.getDefaultToolkit().addAWTEventListener(this,
+                AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK);
+        try {
+            int radius = Integer.parseInt(Main.pref
+                    .get("nearclick.radius", "7"));
+            radiussquared = radius * radius;
+            delay = Integer.parseInt(Main.pref.get("nearclick.delay", "250"));
+        } catch (NumberFormatException ex) {
+            delay = 250;
+            radiussquared = 7 * 7;
+        }
+    }
 
-	public void eventDispatched(AWTEvent event) {
-		if (event instanceof MouseEvent) {
-			MouseEvent e = (MouseEvent) event;
-			if (e.getButton() != MouseEvent.BUTTON1)
-				return;
-			int xdiff = e.getPoint().x - mouseDownX;
-			int ydiff = e.getPoint().y - mouseDownY;
+    public void eventDispatched(AWTEvent event) {
+        if (event instanceof MouseEvent) {
+            MouseEvent e = (MouseEvent) event;
+            if (e.getButton() != MouseEvent.BUTTON1)
+                return;
+            int xdiff = e.getPoint().x - mouseDownX;
+            int ydiff = e.getPoint().y - mouseDownY;
 
-			if (e.getID() == MouseEvent.MOUSE_RELEASED) {
-				if (e.getWhen() - mouseDownTime < delay
-						&& (e.getPoint().x != mouseDownX || e.getPoint().y != mouseDownY)
-						&& xdiff * xdiff + ydiff * ydiff < radiussquared) {
-					try {
-						Robot r = new Robot(GraphicsEnvironment
-								.getLocalGraphicsEnvironment()
-								.getDefaultScreenDevice());
-						r.mousePress(MouseEvent.BUTTON1_MASK);
-						r.mouseRelease(MouseEvent.BUTTON1_MASK);
-					} catch (AWTException e1) {
-					}
-				}
-			}
-			if (e.getID() == MouseEvent.MOUSE_PRESSED) {
-				mouseDownX = e.getPoint().x;
-				mouseDownY = e.getPoint().y;
-				mouseDownTime = e.getWhen();
-			}
-		}
-	}
+            if (e.getID() == MouseEvent.MOUSE_RELEASED) {
+                if (e.getWhen() - mouseDownTime < delay
+                        && (e.getPoint().x != mouseDownX || e.getPoint().y != mouseDownY)
+                        && xdiff * xdiff + ydiff * ydiff < radiussquared) {
+                    try {
+                        Robot r = new Robot(GraphicsEnvironment
+                                .getLocalGraphicsEnvironment()
+                                .getDefaultScreenDevice());
+                        r.mousePress(MouseEvent.BUTTON1_MASK);
+                        r.mouseRelease(MouseEvent.BUTTON1_MASK);
+                    } catch (AWTException e1) {
+                    }
+                }
+            }
+            if (e.getID() == MouseEvent.MOUSE_PRESSED) {
+                mouseDownX = e.getPoint().x;
+                mouseDownY = e.getPoint().y;
+                mouseDownTime = e.getWhen();
+            }
+        }
+    }
 }
Index: /applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java
===================================================================
--- /applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java	(revision 23191)
+++ /applications/editors/josm/plugins/osmarender/src/org/openstreetmap/josm/plugins/osmarender/OsmarenderPlugin.java	(revision 23192)
@@ -80,5 +80,5 @@
                         for (Node n : ((Way) p).getNodes()) {
                             if (n.getCoor().isWithin(b))
-                            	parents.add(n);
+                                parents.add(n);
                         }
                     }
@@ -87,14 +87,14 @@
                 // Write ways
                 for (OsmPrimitive p: parents) {
-                	if (p instanceof Way) {
-                		w.visit((Way)p);
-                	}
+                    if (p instanceof Way) {
+                        w.visit((Way)p);
+                    }
                 }
 
                 // Write relations (should be parent relation also written?)
                 for (OsmPrimitive p: parents) {
-                	if (p instanceof Relation) {
-                		w.visit((Relation)p);
-                	}
+                    if (p instanceof Relation) {
+                        w.visit((Relation)p);
+                    }
                 }
 
@@ -120,5 +120,5 @@
 
     public OsmarenderPlugin(PluginInformation info) throws IOException {
-    	super(info);
+        super(info);
         osmarenderMenu = MainMenu.add(Main.main.menu.viewMenu, new Action());
         osmarenderMenu.setVisible(false);
Index: /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java
===================================================================
--- /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(revision 23191)
+++ /applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java	(revision 23192)
@@ -50,10 +50,10 @@
 
     public GeotaggingAction() {
-    	super(tr("Write coordinates to image header"), ImageProvider.get("geotagging"));
+        super(tr("Write coordinates to image header"), ImageProvider.get("geotagging"));
     }
 
     public void actionPerformed(ActionEvent arg0) {
 
-    	GeoImageLayer layer = getLayer();
+        GeoImageLayer layer = getLayer();
 
         final List<ImageEntry> images = new ArrayList<ImageEntry>();
@@ -316,5 +316,5 @@
 
     private GeoImageLayer getLayer() {
-    	return (GeoImageLayer)LayerListDialog.getInstance().getModel().getSelectedLayers().get(0);
+        return (GeoImageLayer)LayerListDialog.getInstance().getModel().getSelectedLayers().get(0);
     }
 
@@ -330,12 +330,12 @@
     }
 
-	public Component createMenuComponent() {
+    public Component createMenuComponent() {
         JMenuItem geotaggingItem = new JMenuItem(this);
         geotaggingItem.setEnabled(enabled(getLayer()));
         return geotaggingItem;
-	}
-
-	public boolean supportLayers(List<Layer> layers) {
-		return layers.size() == 1 && layers.get(0) instanceof GeoImageLayer;
-	}
+    }
+
+    public boolean supportLayers(List<Layer> layers) {
+        return layers.size() == 1 && layers.get(0) instanceof GeoImageLayer;
+    }
 }
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSAddCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSAddCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSAddCommand.java	(revision 23192)
@@ -16,5 +16,5 @@
   private GTFSStopTableModel gtfsStopTM = null;
   private String type = null;
-  
+
   public GTFSAddCommand(GTFSImporterAction controller)
   {
@@ -23,5 +23,5 @@
     workingLines = new Vector< Integer >();
     typesForUndo = new Vector< String >();
-    
+
     // use either selected lines or all lines if no line is selected
     int[] selectedLines = controller.getDialog().getGTFSStopTable().getSelectedRows();
@@ -30,20 +30,20 @@
     {
       for (int i = 0; i < selectedLines.length; ++i)
-	consideredLines.add(selectedLines[i]);
+    consideredLines.add(selectedLines[i]);
     }
     else
     {
       for (int i = 0; i < gtfsStopTM.getRowCount(); ++i)
-	consideredLines.add(new Integer(i));
+    consideredLines.add(new Integer(i));
     }
-    
+
     // keep only lines where a node can be added
     for (int i = 0; i < consideredLines.size(); ++i)
     {
       if (gtfsStopTM.nodes.elementAt(consideredLines.elementAt(i)) == null)
-	workingLines.add(consideredLines.elementAt(i));
+    workingLines.add(consideredLines.elementAt(i));
     }
   }
-  
+
   public boolean executeCommand()
   {
@@ -61,5 +61,5 @@
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -71,10 +71,10 @@
       gtfsStopTM.setValueAt(typesForUndo.elementAt(i), j, 2);
       if (node == null)
-	continue;
+    continue;
       Main.main.getCurrentDataSet().removePrimitive(node);
       node.setDeleted(true);
     }
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -82,5 +82,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSCatchCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSCatchCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSCatchCommand.java	(revision 23192)
@@ -18,10 +18,10 @@
   private GTFSStopTableModel gtfsStopTM = null;
   private String type = null;
-  
+
   public GTFSCatchCommand(GTFSImporterAction controller)
   {
     gtfsStopTM = controller.getGTFSStopTableModel();
     workingLines = new Vector< Integer >();
-    
+
     // use either selected lines or all lines if no line is selected
     int[] selectedLines = controller.getDialog().getGTFSStopTable().getSelectedRows();
@@ -30,5 +30,5 @@
     workingLines.add(selectedLines[0]);
   }
-  
+
   public boolean executeCommand()
   {
@@ -43,7 +43,7 @@
       Node n = iter.next();
       if ((n != null) && (n.equals(gtfsStopTM.nodes.elementAt(j))))
-	continue;
+    continue;
       if (dest != null)
-	return false;
+    return false;
       dest = n;
     }
@@ -51,5 +51,5 @@
       return false;
     undoMapNode = new Node(dest);
-    
+
     Node node = gtfsStopTM.nodes.elementAt(j);
     undoTableNode = node;
@@ -59,5 +59,5 @@
       node.setDeleted(true);
     }
-    
+
     dest.setCoor(gtfsStopTM.coors.elementAt(j));
     dest.put("highway", "bus_stop");
@@ -69,8 +69,8 @@
     type = (String)gtfsStopTM.getValueAt(j, 2);
     gtfsStopTM.setValueAt("fed", j, 2);
-    
+
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -78,5 +78,5 @@
       return;
     int j = workingLines.elementAt(0);
-    
+
     Node node = gtfsStopTM.nodes.elementAt(j);
     if (node != null)
@@ -85,5 +85,5 @@
       node.setDeleted(true);
     }
-    
+
     if (undoMapNode != null)
     {
@@ -99,5 +99,5 @@
     gtfsStopTM.setValueAt(type, j, 2);
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -105,5 +105,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSDeleteCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSDeleteCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSDeleteCommand.java	(revision 23192)
@@ -16,5 +16,5 @@
   private Vector< String > typesForUndo = null;
   private GTFSStopTableModel gtfsStopTM = null;
-  
+
   public GTFSDeleteCommand(GTFSImporterAction controller)
   {
@@ -23,5 +23,5 @@
     nodesForUndo = new Vector< Node >();
     typesForUndo = new Vector< String >();
-    
+
     // use either selected lines or all lines if no line is selected
     int[] selectedLines = controller.getDialog().getGTFSStopTable().getSelectedRows();
@@ -30,20 +30,20 @@
     {
       for (int i = 0; i < selectedLines.length; ++i)
-	consideredLines.add(selectedLines[i]);
+    consideredLines.add(selectedLines[i]);
     }
     else
     {
       for (int i = 0; i < gtfsStopTM.getRowCount(); ++i)
-	consideredLines.add(new Integer(i));
+    consideredLines.add(new Integer(i));
     }
-    
+
     // keep only lines where a node can be added
     for (int i = 0; i < consideredLines.size(); ++i)
     {
       if (gtfsStopTM.nodes.elementAt(consideredLines.elementAt(i)) != null)
-	workingLines.add(consideredLines.elementAt(i));
+    workingLines.add(consideredLines.elementAt(i));
     }
   }
-  
+
   public boolean executeCommand()
   {
@@ -57,5 +57,5 @@
       typesForUndo.add((String)gtfsStopTM.getValueAt(j, 2));
       if (node == null)
-	continue;
+    continue;
       gtfsStopTM.nodes.set(j, null);
       gtfsStopTM.setValueAt("skipped", j, 2);
@@ -65,5 +65,5 @@
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -75,10 +75,10 @@
       gtfsStopTM.setValueAt(typesForUndo.elementAt(i), j, 2);
       if (node == null)
-	continue;
+    continue;
       node.setDeleted(false);
       Main.main.getCurrentDataSet().addPrimitive(node);
     }
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -86,5 +86,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSImporterAction.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSImporterAction.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSImporterAction.java	(revision 23192)
@@ -63,5 +63,5 @@
 
 public class GTFSImporterAction extends JosmAction
-{ 
+{
   private static GTFSImporterDialog dialog = null;
   private static DefaultListModel tracksListModel = null;
@@ -70,9 +70,9 @@
   private static GTFSStopTableModel gtfsStopTM = null;
   public boolean inEvent = false;
-  
+
   public GTFSImporterAction()
   {
     super(tr("Create Stops from GTFS ..."), null,
-	  tr("Create Stops from a GTFS file"), null, true);
+      tr("Create Stops from a GTFS file"), null, true);
   }
 
@@ -81,5 +81,5 @@
     return gtfsStopTM;
   }
-  
+
   public GTFSImporterDialog getDialog()
   {
@@ -93,5 +93,5 @@
     return tracksListModel;
   }
-  
+
   public TrackReference getCurrentTrack()
   {
@@ -102,8 +102,8 @@
   {
     DataSet mainDataSet = Main.main.getCurrentDataSet();
-    
+
     if (dialog == null)
       dialog = new GTFSImporterDialog(this);
-    
+
     dialog.setVisible(true);
 
@@ -113,19 +113,19 @@
       if (curDir.equals(""))
       {
-	curDir = ".";
+    curDir = ".";
       }
       JFileChooser fc = new JFileChooser(new File(curDir));
-      fc.setDialogTitle("Select GTFS file (stops.txt)");  
+      fc.setDialogTitle("Select GTFS file (stops.txt)");
       fc.setMultiSelectionEnabled(false);
-      
+
       int answer = fc.showOpenDialog(Main.parent);
       if (answer != JFileChooser.APPROVE_OPTION)
-	return;
-      
+    return;
+
       if (!fc.getCurrentDirectory().getAbsolutePath().equals(curDir))
-	Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
-      
+    Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
+
       importData(fc.getSelectedFile());
-      
+
       refreshData();
     }
@@ -133,20 +133,20 @@
     {
       if ((!inEvent) && (dialog.gpsTimeStartValid()) && (currentTrack != null))
-	Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
+    Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
     }
     else if ("stopImporter.settingsStopwatchStart".equals(event.getActionCommand()))
     {
       if ((!inEvent) && (dialog.stopwatchStartValid()) && (currentTrack != null))
-	Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
+    Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
     }
     else if ("stopImporter.settingsTimeWindow".equals(event.getActionCommand()))
     {
       if (currentTrack != null)
-	currentTrack.timeWindow = dialog.getTimeWindow();
+    currentTrack.timeWindow = dialog.getTimeWindow();
     }
     else if ("stopImporter.settingsThreshold".equals(event.getActionCommand()))
     {
       if (currentTrack != null)
-	currentTrack.threshold = dialog.getThreshold();
+    currentTrack.threshold = dialog.getThreshold();
     }
     else if ("stopImporter.settingsSuggestStops".equals(event.getActionCommand()))
@@ -181,18 +181,18 @@
   private void importData(final File file)
   {
-    try 
+    try
     {
       FileReader is = new FileReader(file);
       final BufferedReader r = new BufferedReader(is);
-      
+
       if (data == null)
-	data = new Vector< String >();
+    data = new Vector< String >();
       else
-	data.clear();
-      
+    data.clear();
+
       while (r.ready())
-	data.add(r.readLine());
-    }
-    catch (FileNotFoundException e) 
+    data.add(r.readLine());
+    }
+    catch (FileNotFoundException e)
     {
       e.printStackTrace();
@@ -211,11 +211,11 @@
     {
       Vector< Node > existingStops = new Vector< Node >();
-      
+
       if (Main.main.getCurrentDataSet() == null)
       {
         JOptionPane.showMessageDialog(null, "There exists no dataset."
-	    + " Try to download data from the server or open an OSM file.",
+        + " Try to download data from the server or open an OSM file.",
      "No data found", JOptionPane.ERROR_MESSAGE);
-      
+
         System.out.println("Public Transport: StopInserter: No data found");
 
@@ -224,32 +224,32 @@
       else
       {
-	Iterator< Node > iter =
-	    Main.main.getCurrentDataSet().getNodes().iterator();
-	while (iter.hasNext())
-	{
-	  Node node = iter.next();
-	  if ("bus_stop".equals(node.get("highway")))
-	    existingStops.add(node);
-	}
-      }
-      
+    Iterator< Node > iter =
+        Main.main.getCurrentDataSet().getNodes().iterator();
+    while (iter.hasNext())
+    {
+      Node node = iter.next();
+      if ("bus_stop".equals(node.get("highway")))
+        existingStops.add(node);
+    }
+      }
+
       Iterator< String > iter = data.iterator();
       if (iter.hasNext())
-	gtfsStopTM = new GTFSStopTableModel(this, iter.next());
+    gtfsStopTM = new GTFSStopTableModel(this, iter.next());
       else
       {
-	JOptionPane.showMessageDialog
-	(null, "The GTFS file was empty.", "No data found",
-	 JOptionPane.ERROR_MESSAGE);
-	 
+    JOptionPane.showMessageDialog
+    (null, "The GTFS file was empty.", "No data found",
+     JOptionPane.ERROR_MESSAGE);
+
         System.out.println("Public Transport: GTFSImporter: No data found");
 
         return;
       }
-      
+
       while (iter.hasNext())
       {
-	String s = iter.next();
-	gtfsStopTM.addRow(s, existingStops);
+    String s = iter.next();
+    gtfsStopTM.addRow(s, existingStops);
       }
       dialog.setGTFSStopTableModel(gtfsStopTM);
@@ -260,9 +260,9 @@
       (null, "The GTFS file was empty.", "No data found",
        JOptionPane.ERROR_MESSAGE);
-      
+
       System.out.println("Public Transport: GTFSImporter: No data found");
     }
   }
-  
+
 //   public void tracksSelectionChanged(int selectedPos)
 //   {
@@ -271,10 +271,10 @@
 //       currentTrack = ((TrackReference)tracksListModel.elementAt(selectedPos));
 //       dialog.setTrackValid(true);
-//       
+//
 //       //Prepare Settings
 //       dialog.setSettings
-// 	  (currentTrack.gpsSyncTime, currentTrack.stopwatchStart,
-// 	   currentTrack.timeWindow, currentTrack.threshold);
-//       
+//    (currentTrack.gpsSyncTime, currentTrack.stopwatchStart,
+//     currentTrack.timeWindow, currentTrack.threshold);
+//
 //       //Prepare Stoplist
 //       dialog.setStoplistTableModel
@@ -297,9 +297,9 @@
     {
       JOptionPane.showMessageDialog(null, "There exists no dataset."
-	  + " Try to download data from the server or open an OSM file.",
+      + " Try to download data from the server or open an OSM file.",
    "No data found", JOptionPane.ERROR_MESSAGE);
-      
+
       System.out.println("Public Transport: StopInserter: No data found");
-	    
+
       return null;
     }
@@ -317,10 +317,10 @@
     {
       for (int i = 0; i < selectedLines.length; ++i)
-	consideredLines.add(selectedLines[i]);
+    consideredLines.add(selectedLines[i]);
     }
     else
     {
       for (int i = 0; i < table.getRowCount(); ++i)
-	consideredLines.add(new Integer(i));
+    consideredLines.add(new Integer(i));
     }
     return consideredLines;
@@ -332,15 +332,15 @@
     if (Main.main.getCurrentDataSet() == null)
       return;
-      
+
     table.clearSelection();
-      
+
     for (int i = 0; i < table.getRowCount(); ++i)
     {
       if ((nodes.elementAt(i) != null) &&
-	   (Main.main.getCurrentDataSet().isSelected(nodes.elementAt(i))))
-	table.addRowSelectionInterval(i, i);
-    }
-  }
-  
+       (Main.main.getCurrentDataSet().isSelected(nodes.elementAt(i))))
+    table.addRowSelectionInterval(i, i);
+    }
+  }
+
   /* shows the nodes that correspond to the marked lines in the table.
      If no lines are marked in the table, show all nodes from the vector */
@@ -353,5 +353,5 @@
       int j = consideredLines.elementAt(i);
       if (nodes.elementAt(j) != null)
-	nodes.elementAt(j).visit(box);
+    nodes.elementAt(j).visit(box);
     }
     if (box.getBounds() == null)
@@ -360,5 +360,5 @@
     Main.map.mapView.recalculateCenterScale(box);
   }
-  
+
   /* marks the nodes that correspond to the marked lines in the table.
   If no lines are marked in the table, mark all nodes from the vector */
@@ -372,12 +372,12 @@
       int j = consideredLines.elementAt(i);
       if (nodes.elementAt(j) != null)
-	Main.main.getCurrentDataSet().addSelected(nodes.elementAt(j));
-    }
-  }
-  
+    Main.main.getCurrentDataSet().addSelected(nodes.elementAt(j));
+    }
+  }
+
   public static String timeOf(double t)
   {
     t -= Math.floor(t/24/60/60)*24*60*60;
-    
+
     int hour = (int)Math.floor(t/60/60);
     t -=  Math.floor(t/60/60)*60*60;
@@ -385,16 +385,16 @@
     t -=  Math.floor(t/60)*60;
     double second = t;
-    
+
     Format format = new DecimalFormat("00");
     Format formatS = new DecimalFormat("00.###");
     return (format.format(hour) + ":" + format.format(minute) + ":"
-	+ formatS.format(second));
-  }
-  
+    + formatS.format(second));
+  }
+
   public Action getFocusAddAction()
   {
     return new FocusAddAction();
   }
-  
+
   private class FocusAddAction extends AbstractAction
   {
@@ -405,5 +405,5 @@
     }
   };
-  
+
 /*  public Action getFocusWaypointShelterAction(String shelter)
   {
@@ -417,12 +417,12 @@
       public void actionPerformed(ActionEvent e)
       {
-	JTable table = dialog.getWaypointsTable();
-	int row = table.getEditingRow();
-	if (row < 0)
-	  return;
-	table.clearSelection();
-	table.addRowSelectionInterval(row, row);
-/*	Main.main.undoRedo.add
-	    (new WaypointsDisableCommand(GTFSImporterAction.this));*
+    JTable table = dialog.getWaypointsTable();
+    int row = table.getEditingRow();
+    if (row < 0)
+      return;
+    table.clearSelection();
+    table.addRowSelectionInterval(row, row);
+/*  Main.main.undoRedo.add
+        (new WaypointsDisableCommand(GTFSImporterAction.this));*
       }
     };
@@ -433,5 +433,5 @@
     return new FocusTrackStoplistNameAction();
   }
-  
+
   public Action getFocusTrackStoplistShelterAction(String shelter)
   {
@@ -445,12 +445,12 @@
       public void actionPerformed(ActionEvent e)
       {
-	JTable table = dialog.getStoplistTable();
-	int row = table.getEditingRow();
-	if (row < 0)
-	  return;
-	table.clearSelection();
-	table.addRowSelectionInterval(row, row);
-/*	Main.main.undoRedo.add
-	    (new TrackStoplistDeleteCommand(GTFSImporterAction.this));*
+    JTable table = dialog.getStoplistTable();
+    int row = table.getEditingRow();
+    if (row < 0)
+      return;
+    table.clearSelection();
+    table.addRowSelectionInterval(row, row);
+/*  Main.main.undoRedo.add
+        (new TrackStoplistDeleteCommand(GTFSImporterAction.this));*
       }
     };
@@ -466,27 +466,27 @@
       int row = table.getEditingRow();
       if (row < 0)
-	row = 0;
+    row = 0;
       waypointTM.inEvent = true;
       if (table.getCellEditor() != null)
       {
-	if (!table.getCellEditor().stopCellEditing())
-	  table.getCellEditor().cancelCellEditing();
+    if (!table.getCellEditor().stopCellEditing())
+      table.getCellEditor().cancelCellEditing();
       }
       table.editCellAt(row, 1);
       table.getCellEditor().getTableCellEditorComponent
-	  (table, "", true, row, 1);
+      (table, "", true, row, 1);
       waypointTM.inEvent = false;
     }
   };
-  
+
   private class FocusWaypointShelterAction extends AbstractAction
   {
     private String defaultShelter = null;
-    
+
     public FocusWaypointShelterAction(String defaultShelter)
     {
       this.defaultShelter = defaultShelter;
     }
-    
+
     public void actionPerformed(ActionEvent e)
     {
@@ -496,10 +496,10 @@
       int row = table.getEditingRow();
       if (row < 0)
-	row = 0;
+    row = 0;
       waypointTM.inEvent = true;
       if (table.getCellEditor() != null)
       {
-	if (!table.getCellEditor().stopCellEditing())
-	  table.getCellEditor().cancelCellEditing();
+    if (!table.getCellEditor().stopCellEditing())
+      table.getCellEditor().cancelCellEditing();
       }
       table.editCellAt(row, 2);
@@ -509,5 +509,5 @@
     }
   };
-  
+
   private class FocusTrackStoplistNameAction extends AbstractAction
   {
@@ -519,10 +519,10 @@
       int row = table.getEditingRow();
       if (row < 0)
-	row = 0;
+    row = 0;
       currentTrack.inEvent = true;
       if (table.getCellEditor() != null)
       {
-	if (!table.getCellEditor().stopCellEditing())
-	  table.getCellEditor().cancelCellEditing();
+    if (!table.getCellEditor().stopCellEditing())
+      table.getCellEditor().cancelCellEditing();
       }
       table.editCellAt(row, 1);
@@ -532,14 +532,14 @@
     }
   };
-  
+
   private class FocusTrackStoplistShelterAction extends AbstractAction
   {
     private String defaultShelter = null;
-    
+
     public FocusTrackStoplistShelterAction(String defaultShelter)
     {
       this.defaultShelter = defaultShelter;
     }
-    
+
     public void actionPerformed(ActionEvent e)
     {
@@ -549,10 +549,10 @@
       int row = table.getEditingRow();
       if (row < 0)
-	row = 0;
+    row = 0;
       currentTrack.inEvent = true;
       if (table.getCellEditor() != null)
       {
-	if (!table.getCellEditor().stopCellEditing())
-	  table.getCellEditor().cancelCellEditing();
+    if (!table.getCellEditor().stopCellEditing())
+      table.getCellEditor().cancelCellEditing();
       }
       table.editCellAt(row, 2);
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSImporterDialog.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSImporterDialog.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSImporterDialog.java	(revision 23192)
@@ -63,5 +63,5 @@
 
 public class GTFSImporterDialog
-{  
+{
   private JDialog jDialog = null;
   private JTabbedPane tabbedPane = null;
@@ -74,5 +74,5 @@
   private JTable stoplistTable = null;
   private JTable gtfsStopTable = null;
-  
+
   public GTFSImporterDialog(GTFSImporterAction controller)
   {
@@ -87,5 +87,5 @@
     tabbedPane.setEnabledAt(1, true);
     jDialog.add(tabbedPane);
-      
+
     //Settings Tab
     JPanel contentPane = tabSettings;
@@ -93,7 +93,7 @@
     GridBagConstraints layoutCons = new GridBagConstraints();
     contentPane.setLayout(gridbag);
-      
+
     JLabel label = new JLabel("Type of stops to add");
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 0;
@@ -104,5 +104,5 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-    
+
     cbStoptype = new JComboBox();
     cbStoptype.setEditable(false);
@@ -114,5 +114,5 @@
     cbStoptype.setActionCommand("gtfsImporter.settingsStoptype");
     cbStoptype.addActionListener(controller);
-    
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 1;
@@ -123,7 +123,7 @@
     gridbag.setConstraints(cbStoptype, layoutCons);
     contentPane.add(cbStoptype);
-      
+
     label = new JLabel("Time on your GPS device");
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 2;
@@ -134,9 +134,9 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     tfGPSTimeStart = new JTextField("00:00:00", 15);
     tfGPSTimeStart.setActionCommand("gtfsImporter.settingsGPSTimeStart");
     tfGPSTimeStart.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 3;
@@ -147,7 +147,7 @@
     gridbag.setConstraints(tfGPSTimeStart, layoutCons);
     contentPane.add(tfGPSTimeStart);
-      
+
     label = new JLabel("HH:MM:SS.sss");
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 3;
@@ -158,7 +158,7 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-            
+
     label = new JLabel("Time on your stopwatch");
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 4;
@@ -169,9 +169,9 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     tfStopwatchStart = new JTextField("00:00:00", 15);
     tfStopwatchStart.setActionCommand("gtfsImporter.settingsStopwatchStart");
     tfStopwatchStart.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 5;
@@ -182,7 +182,7 @@
     gridbag.setConstraints(tfStopwatchStart, layoutCons);
     contentPane.add(tfStopwatchStart);
-      
+
     label = new JLabel("HH:MM:SS.sss");
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 5;
@@ -193,7 +193,7 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     label = new JLabel("Time window");
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 6;
@@ -204,9 +204,9 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     tfTimeWindow = new JTextField("15", 4);
     tfTimeWindow.setActionCommand("gtfsImporter.settingsTimeWindow");
     tfTimeWindow.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 7;
@@ -217,7 +217,7 @@
     gridbag.setConstraints(tfTimeWindow, layoutCons);
     contentPane.add(tfTimeWindow);
-      
+
     label = new JLabel("seconds");
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 7;
@@ -228,7 +228,7 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     label = new JLabel("Move Threshold");
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 8;
@@ -239,9 +239,9 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     tfThreshold = new JTextField("20", 4);
     tfThreshold.setActionCommand("gtfsImporter.settingsThreshold");
     tfThreshold.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 9;
@@ -252,7 +252,7 @@
     gridbag.setConstraints(tfThreshold, layoutCons);
     contentPane.add(tfThreshold);
-      
+
     label = new JLabel("meters");
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 9;
@@ -263,9 +263,9 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     JButton bSuggestStops = new JButton("Suggest Stops");
     bSuggestStops.setActionCommand("gtfsImporter.settingsSuggestStops");
     bSuggestStops.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 10;
@@ -276,5 +276,5 @@
     gridbag.setConstraints(bSuggestStops, layoutCons);
     contentPane.add(bSuggestStops);
-      
+
     //Waypoints Tab
     contentPane = tabWaypoints;
@@ -285,29 +285,29 @@
         (KeyStroke.getKeyStroke("alt N"), "gtfsImporter.gtfsStopsFocusAdd");
     contentPane.getActionMap().put
-	("gtfsImporter.gtfsStopsFocusAdd", controller.getFocusAddAction());
+    ("gtfsImporter.gtfsStopsFocusAdd", controller.getFocusAddAction());
 /*    contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt S"), "gtfsImporter.focusShelterYes");
     contentPane.getActionMap().put
-	("gtfsImporter.focusShelterYes",
-	 controller.getFocusWaypointShelterAction("yes"));
+    ("gtfsImporter.focusShelterYes",
+     controller.getFocusWaypointShelterAction("yes"));
     contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt T"), "gtfsImporter.focusShelterNo");
     contentPane.getActionMap().put
-	("gtfsImporter.focusShelterNo",
-	 controller.getFocusWaypointShelterAction("no"));
+    ("gtfsImporter.focusShelterNo",
+     controller.getFocusWaypointShelterAction("no"));
     contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt U"), "gtfsImporter.focusShelterImplicit");
     contentPane.getActionMap().put
-	("gtfsImporter.focusShelterImplicit",
-	 controller.getFocusWaypointShelterAction("implicit"));
+    ("gtfsImporter.focusShelterImplicit",
+     controller.getFocusWaypointShelterAction("implicit"));
     contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt D"), "gtfsImporter.gtfsStopsDelete");
     contentPane.getActionMap().put
-	("gtfsImporter.gtfsStopsDelete",
-	 controller.getFocusWaypointDeleteAction());*/
-      
+    ("gtfsImporter.gtfsStopsDelete",
+     controller.getFocusWaypointDeleteAction());*/
+
     gtfsStopTable = new JTable();
     JScrollPane tableSP = new JScrollPane(gtfsStopTable);
-    
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 0;
@@ -318,9 +318,9 @@
     gridbag.setConstraints(tableSP, layoutCons);
     contentPane.add(tableSP);
-      
+
     JButton bFind = new JButton("Find");
     bFind.setActionCommand("gtfsImporter.gtfsStopsFind");
     bFind.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 1;
@@ -331,9 +331,9 @@
     gridbag.setConstraints(bFind, layoutCons);
     contentPane.add(bFind);
-      
+
     JButton bShow = new JButton("Show");
     bShow.setActionCommand("gtfsImporter.gtfsStopsShow");
     bShow.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 2;
@@ -344,9 +344,9 @@
     gridbag.setConstraints(bShow, layoutCons);
     contentPane.add(bShow);
-      
+
     JButton bMark = new JButton("Mark");
     bMark.setActionCommand("gtfsImporter.gtfsStopsMark");
     bMark.addActionListener(controller);
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 1;
@@ -358,9 +358,9 @@
     gridbag.setConstraints(bMark, layoutCons);
     contentPane.add(bMark);
-      
+
     JButton bCatch = new JButton("Catch");
     bCatch.setActionCommand("gtfsImporter.gtfsStopsCatch");
     bCatch.addActionListener(controller);
-      
+
     layoutCons.gridx = 2;
     layoutCons.gridy = 1;
@@ -372,9 +372,9 @@
     gridbag.setConstraints(bCatch, layoutCons);
     contentPane.add(bCatch);
-      
+
     JButton bJoin = new JButton("Join");
     bJoin.setActionCommand("gtfsImporter.gtfsStopsJoin");
     bJoin.addActionListener(controller);
-      
+
     layoutCons.gridx = 2;
     layoutCons.gridy = 2;
@@ -386,9 +386,9 @@
     gridbag.setConstraints(bJoin, layoutCons);
     contentPane.add(bJoin);
-      
+
     JButton bAdd = new JButton("Enable");
     bAdd.setActionCommand("gtfsImporter.gtfsStopsAdd");
     bAdd.addActionListener(controller);
-      
+
     layoutCons.gridx = 3;
     layoutCons.gridy = 1;
@@ -400,9 +400,9 @@
     gridbag.setConstraints(bAdd, layoutCons);
     contentPane.add(bAdd);
-      
+
     JButton bDelete = new JButton("Disable");
     bDelete.setActionCommand("gtfsImporter.gtfsStopsDelete");
     bDelete.addActionListener(controller);
-      
+
     layoutCons.gridx = 3;
     layoutCons.gridy = 2;
@@ -413,19 +413,19 @@
     gridbag.setConstraints(bDelete, layoutCons);
     contentPane.add(bDelete);
-      
+
     jDialog.pack();
     jDialog.setLocationRelativeTo(frame);
   }
-  
+
   public void setTrackValid(boolean valid)
   {
     tabbedPane.setEnabledAt(2, valid);
   }
-  
+
   public void setVisible(boolean visible)
   {
     jDialog.setVisible(visible);
   }
-  
+
   public void setSettings
       (String gpsSyncTime, String stopwatchStart,
@@ -437,10 +437,10 @@
     tfThreshold.setText(Double.toString(threshold));
   }
-  
+
   public String getStoptype()
   {
     return (String)cbStoptype.getSelectedItem();
   }
-  
+
   public boolean gpsTimeStartValid()
   {
@@ -452,20 +452,20 @@
     {
       JOptionPane.showMessageDialog
-	  (null, "Can't parse a time from this string.", "Invalid value",
-	   JOptionPane.ERROR_MESSAGE);
+      (null, "Can't parse a time from this string.", "Invalid value",
+       JOptionPane.ERROR_MESSAGE);
       return false;
     }
   }
-  
+
   public String getGpsTimeStart()
   {
     return tfGPSTimeStart.getText();
   }
-  
+
   public void setGpsTimeStart(String s)
   {
     tfGPSTimeStart.setText(s);
   }
-  
+
   public boolean stopwatchStartValid()
   {
@@ -477,35 +477,35 @@
     {
       JOptionPane.showMessageDialog
-	  (null, "Can't parse a time from this string.", "Invalid value",
-	   JOptionPane.ERROR_MESSAGE);
+      (null, "Can't parse a time from this string.", "Invalid value",
+       JOptionPane.ERROR_MESSAGE);
       return false;
     }
   }
-  
+
   public String getStopwatchStart()
   {
     return tfStopwatchStart.getText();
   }
-  
+
   public void setStopwatchStart(String s)
   {
     tfStopwatchStart.setText(s);
   }
-  
+
   public double getTimeWindow()
   {
     return Double.parseDouble(tfTimeWindow.getText());
   }
-  
+
   public double getThreshold()
   {
     return Double.parseDouble(tfThreshold.getText());
   }
-  
+
   public JTable getGTFSStopTable()
   {
     return gtfsStopTable;
   }
-  
+
   public void setGTFSStopTableModel(GTFSStopTableModel model)
   {
@@ -516,10 +516,10 @@
     gtfsStopTable.getColumnModel().getColumn(2).setPreferredWidth((int)(width * 0.1));
   }
-  
+
   public static double parseTime(String s)
   {
     double result = 0;
     if ((s.charAt(2) != ':') || (s.charAt(2) != ':')
-	 || (s.length() < 8))
+     || (s.length() < 8))
       return -1;
     int hour = Integer.parseInt(s.substring(0, 2));
@@ -527,25 +527,25 @@
     double second = Double.parseDouble(s.substring(6, s.length()));
     if ((hour < 0) || (hour > 23) || (minute < 0) || (minute > 59)
-	 || (second < 0) || (second >= 60.0))
+     || (second < 0) || (second >= 60.0))
       return -1;
     return (second + minute*60 + hour*60*60);
   }
-  
+
 /*  private class TracksLSL implements ListSelectionListener
   {
     GTFSImporterAction root = null;
-    
+
     public TracksLSL(GTFSImporterAction sia)
     {
       root = sia;
     }
-    
+
     public void valueChanged(ListSelectionEvent e)
     {
       int selectedPos = tracksList.getAnchorSelectionIndex();
       if (tracksList.isSelectedIndex(selectedPos))
-	root.tracksSelectionChanged(selectedPos);
+    root.tracksSelectionChanged(selectedPos);
       else
-	root.tracksSelectionChanged(-1);
+    root.tracksSelectionChanged(-1);
     }
   };*/
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSJoinCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSJoinCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSJoinCommand.java	(revision 23192)
@@ -18,10 +18,10 @@
   private GTFSStopTableModel gtfsStopTM = null;
   private String type = null;
-  
+
   public GTFSJoinCommand(GTFSImporterAction controller)
   {
     gtfsStopTM = controller.getGTFSStopTableModel();
     workingLines = new Vector< Integer >();
-    
+
     // use either selected lines or all lines if no line is selected
     int[] selectedLines = controller.getDialog().getGTFSStopTable().getSelectedRows();
@@ -30,5 +30,5 @@
     workingLines.add(selectedLines[0]);
   }
-  
+
   public boolean executeCommand()
   {
@@ -43,7 +43,7 @@
       Node n = iter.next();
       if ((n != null) && (n.equals(gtfsStopTM.nodes.elementAt(j))))
-	continue;
+    continue;
       if (dest != null)
-	return false;
+    return false;
       dest = n;
     }
@@ -51,5 +51,5 @@
       return false;
     undoMapNode = new Node(dest);
-    
+
     Node node = gtfsStopTM.nodes.elementAt(j);
     undoTableNode = node;
@@ -59,5 +59,5 @@
       node.setDeleted(true);
     }
-    
+
     dest.put("highway", "bus_stop");
     dest.put("stop_id", (String)gtfsStopTM.getValueAt(j, 0));
@@ -67,8 +67,8 @@
     type = (String)gtfsStopTM.getValueAt(j, 2);
     gtfsStopTM.setValueAt("moved", j, 2);
-    
+
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -76,5 +76,5 @@
       return;
     int j = workingLines.elementAt(0);
-    
+
     Node node = gtfsStopTM.nodes.elementAt(j);
     if (node != null)
@@ -83,5 +83,5 @@
       node.setDeleted(true);
     }
-    
+
     if (undoMapNode != null)
     {
@@ -97,5 +97,5 @@
     gtfsStopTM.setValueAt(type, j, 2);
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -103,5 +103,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSStopTableModel.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSStopTableModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/GTFSStopTableModel.java	(revision 23192)
@@ -27,7 +27,7 @@
   private int lonCol = -1;
   private char separator = ',';
-  
+
   public GTFSStopTableModel(GTFSImporterAction controller,
-			    String columnConfig)
+                String columnConfig)
   {
     int pos = columnConfig.indexOf(separator);
@@ -48,11 +48,11 @@
       String title = columnConfig.substring(oldPos, pos);
       if ("stop_id".equals(title))
-	idCol = i;
+    idCol = i;
       else if ("stop_name".equals(title))
-	nameCol = i;
+    nameCol = i;
       else if ("stop_lat".equals(title))
-	latCol = i;
+    latCol = i;
       else if ("stop_lon".equals(title))
-	lonCol = i;
+    lonCol = i;
       ++i;
       oldPos = pos + 1;
@@ -68,5 +68,5 @@
     else if ("stop_lon".equals(title))
       lonCol = i;
-    
+
     this.controller = controller;
     addColumn("Id");
@@ -75,25 +75,25 @@
     addTableModelListener(this);
   }
-    
+
   public boolean isCellEditable(int row, int column)
   {
     return false;
   }
-    
+
   public void addRow(Object[] obj)
   {
     throw new UnsupportedOperationException();
   }
-    
+
   public void insertRow(int insPos, Object[] obj)
   {
     throw new UnsupportedOperationException();
   }
-    
+
   public void addRow(String s)
   {
     insertRow(-1, s, new Vector< Node >());
   }
-  
+
   public void addRow(String s, Vector< Node > existingStops)
   {
@@ -135,5 +135,5 @@
     return s;
   }
-  
+
   public void insertRow(int insPos, String s, Vector< Node > existingStops)
   {
@@ -147,11 +147,11 @@
     {
       if (i == idCol)
-	buf[0] = stripQuot(s.substring(oldPos, pos));
+    buf[0] = stripQuot(s.substring(oldPos, pos));
       else if (i == nameCol)
-	buf[1] = stripQuot(s.substring(oldPos, pos));
+    buf[1] = stripQuot(s.substring(oldPos, pos));
       else if (i == latCol)
-	lat = Double.parseDouble(stripQuot(s.substring(oldPos, pos)));
+    lat = Double.parseDouble(stripQuot(s.substring(oldPos, pos)));
       else if (i == lonCol)
-	lon = Double.parseDouble(stripQuot(s.substring(oldPos, pos)));
+    lon = Double.parseDouble(stripQuot(s.substring(oldPos, pos)));
       ++i;
       oldPos = pos + 1;
@@ -166,7 +166,7 @@
     else if (i == lonCol)
       lon = Double.parseDouble(stripQuot(s.substring(oldPos)));
-    
+
     LatLon coor = new LatLon(lat, lon);
-    
+
     if (Main.main.getCurrentDataSet() != null)
     {
@@ -176,14 +176,14 @@
       while (iter.hasNext())
       {
-	if (iter.next().bounds.contains(coor))
-	{
-	  inside = true;
-	  break;
-	}
+    if (iter.next().bounds.contains(coor))
+    {
+      inside = true;
+      break;
+    }
       }
       if (!inside)
-	buf[2] = "outside";
-    }
-    
+    buf[2] = "outside";
+    }
+
     boolean nearBusStop = false;
     Iterator< Node > iter = existingStops.iterator();
@@ -193,18 +193,18 @@
       if (coor.greatCircleDistance(node.getCoor()) < 1000)
       {
-	nearBusStop = true;
-	break;
-      }
-    }
-    
+    nearBusStop = true;
+    break;
+      }
+    }
+
     if (insPos == -1)
     {
       if ((nearBusStop) || !("pending".equals(buf[2])))
-	nodes.addElement(null);
+    nodes.addElement(null);
       else
       {
-	Node node = GTFSImporterAction.createNode(coor, buf[0], buf[1]);
-	nodes.addElement(node);
-	buf[2] = "added";
+    Node node = GTFSImporterAction.createNode(coor, buf[0], buf[1]);
+    nodes.addElement(node);
+    buf[2] = "added";
       }
       coors.addElement(coor);
@@ -214,10 +214,10 @@
     {
       if ((nearBusStop) || !("pending".equals(buf[2])))
-	nodes.insertElementAt(null, insPos);
+    nodes.insertElementAt(null, insPos);
       else
       {
-	Node node = GTFSImporterAction.createNode(coor, buf[0], buf[1]);
-	nodes.insertElementAt(node, insPos);
-	buf[2] = "added";
+    Node node = GTFSImporterAction.createNode(coor, buf[0], buf[1]);
+    nodes.insertElementAt(node, insPos);
+    buf[2] = "added";
       }
       coors.insertElementAt(coor, insPos);
@@ -225,5 +225,5 @@
     }
   }
-    
+
   public void clear()
   {
@@ -231,5 +231,5 @@
     super.setRowCount(0);
   }
-  
+
   public void tableChanged(TableModelEvent e)
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/ItineraryTableModel.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/ItineraryTableModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/ItineraryTableModel.java	(revision 23192)
@@ -3,5 +3,5 @@
 // import static org.openstreetmap.josm.tools.I18n.marktr;
 // import static org.openstreetmap.josm.tools.I18n.tr;
-// 
+//
 // import java.awt.BorderLayout;
 // import java.awt.Container;
@@ -21,5 +21,5 @@
 // import java.util.TreeSet;
 import java.util.Vector;
-// 
+//
 // import javax.swing.DefaultCellEditor;
 // import javax.swing.DefaultListModel;
@@ -43,5 +43,5 @@
 import javax.swing.table.DefaultTableModel;
 // import javax.swing.table.TableCellEditor;
-// 
+//
 // import org.openstreetmap.josm.Main;
 // import org.openstreetmap.josm.actions.JosmAction;
@@ -64,5 +64,5 @@
   public Vector<Way> ways = new Vector<Way>();
   public boolean inEvent = false;
-  
+
   public boolean isCellEditable(int row, int column)
   {
@@ -73,5 +73,5 @@
     return true;
   }
-  
+
   public void addRow(Object[] obj)
   {
@@ -79,5 +79,5 @@
     super.addRow(obj);
   }
-  
+
   public void insertRow(int insPos, Object[] obj)
   {
@@ -93,10 +93,10 @@
     }
   }
-  
+
   public void addRow(Way way, String role)
   {
     insertRow(-1, way, role);
   }
-  
+
   public void insertRow(int insPos, Way way, String role)
   {
@@ -123,5 +123,5 @@
     }
   }
-  
+
   public void clear()
   {
@@ -129,43 +129,43 @@
     super.setRowCount(0);
   }
-  
+
   public void cleanupGaps()
   {
     inEvent = true;
     Node lastNode = null;
-    
+
     for (int i = 0; i < getRowCount(); ++i)
     {
       if (ways.elementAt(i) == null)
       {
-	++i;
-	if (i >= getRowCount())
-	  break;
+    ++i;
+    if (i >= getRowCount())
+      break;
       }
       while ((ways.elementAt(i) == null) &&
-	((i == 0) || (ways.elementAt(i-1) == null)))
-      {
-	ways.removeElementAt(i);
-	removeRow(i);
-	if (i >= getRowCount())
-	  break;
+    ((i == 0) || (ways.elementAt(i-1) == null)))
+      {
+    ways.removeElementAt(i);
+    removeRow(i);
+    if (i >= getRowCount())
+      break;
       }
       if (i >= getRowCount())
-	break;
-      
+    break;
+
       boolean gapRequired = gapNecessary
       (ways.elementAt(i), (String)(getValueAt(i, 1)), lastNode);
       if ((i > 0) && (!gapRequired) && (ways.elementAt(i-1) == null))
       {
-	ways.removeElementAt(i-1);
-	removeRow(i-1);
-	--i;
+    ways.removeElementAt(i-1);
+    removeRow(i-1);
+    --i;
       }
       else if ((i > 0) && gapRequired && (ways.elementAt(i-1) != null))
       {
-	String[] buf = { "", "" };
-	buf[0] = "[gap]";
-	insertRow(i, buf);
-	++i;
+    String[] buf = { "", "" };
+    buf[0] = "[gap]";
+    insertRow(i, buf);
+    ++i;
       }
       lastNode = getLastNode(ways.elementAt(i), (String)(getValueAt(i, 1)));
@@ -179,5 +179,5 @@
     inEvent = false;
   }
-  
+
   public void tableChanged(TableModelEvent e)
   {
@@ -185,10 +185,10 @@
     {
       if (inEvent)
-	return;
+    return;
       cleanupGaps();
       RoutePatternAction.rebuildWays();
     }
   }
-  
+
   private Node getLastNode(Way way, String role)
   {
@@ -200,8 +200,8 @@
       return way.getNode(0);
       else
-	return way.getNode(way.getNodesCount() - 1);
-    }
-  }
-  
+    return way.getNode(way.getNodesCount() - 1);
+    }
+  }
+
   private boolean gapNecessary(Way way, String role, Node lastNode)
   {
@@ -212,7 +212,7 @@
       firstNode = way.getNode(way.getNodesCount() - 1);
       else
-	firstNode = way.getNode(0);
+    firstNode = way.getNode(0);
       if ((lastNode != null) && (!lastNode.equals(firstNode)))
-	return true;
+    return true;
     }
     return false;
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/PublicTransportPlugin.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/PublicTransportPlugin.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/PublicTransportPlugin.java	(revision 23192)
@@ -23,5 +23,5 @@
 
 public class PublicTransportPlugin extends Plugin {
-    
+
   static JMenu jMenu;
 
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/RoutePatternAction.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/RoutePatternAction.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/RoutePatternAction.java	(revision 23192)
@@ -60,100 +60,100 @@
 
 public class RoutePatternAction extends JosmAction {
-  
+
   private class RoutesLSL implements ListSelectionListener {
     RoutePatternAction root = null;
-    
+
     public RoutesLSL(RoutePatternAction rpa) {
       root = rpa;
     }
-    
+
     public void valueChanged(ListSelectionEvent e) {
       root.routesSelectionChanged();
     }
   };
-  
+
   private class RouteReference implements Comparable< RouteReference > {
     Relation route;
-    
+
     public RouteReference(Relation route) {
       this.route = route;
     }
-    
+
     public int compareTo(RouteReference rr) {
       if (route.get("route") != null)
       {
-	if (rr.route.get("route") == null)
-	  return -1;
-	int result = route.get("route").compareTo(rr.route.get("route"));
-	if (result != 0)
-	  return result;
+    if (rr.route.get("route") == null)
+      return -1;
+    int result = route.get("route").compareTo(rr.route.get("route"));
+    if (result != 0)
+      return result;
       }
       else if (rr.route.get("route") != null)
-	return 1;
+    return 1;
       if (route.get("ref") != null)
       {
-	if (rr.route.get("ref") == null)
-	  return -1;
-	int result = route.get("ref").compareTo(rr.route.get("ref"));
-	if (result != 0)
-	  return result;
+    if (rr.route.get("ref") == null)
+      return -1;
+    int result = route.get("ref").compareTo(rr.route.get("ref"));
+    if (result != 0)
+      return result;
       }
       else if (rr.route.get("ref") != null)
-	return 1;
+    return 1;
       if (route.get("to") != null)
       {
-	if (rr.route.get("to") == null)
-	  return -1;
-	int result = route.get("to").compareTo(rr.route.get("to"));
-	if (result != 0)
-	  return result;
+    if (rr.route.get("to") == null)
+      return -1;
+    int result = route.get("to").compareTo(rr.route.get("to"));
+    if (result != 0)
+      return result;
       }
       else if (rr.route.get("to") != null)
-	return 1;
+    return 1;
       if (route.get("direction") != null)
       {
-	if (rr.route.get("direction") == null)
-	  return -1;
-	int result = route.get("direction").compareTo(rr.route.get("direction"));
-	if (result != 0)
-	  return result;
+    if (rr.route.get("direction") == null)
+      return -1;
+    int result = route.get("direction").compareTo(rr.route.get("direction"));
+    if (result != 0)
+      return result;
       }
       else if (rr.route.get("direction") != null)
-	return 1;
+    return 1;
       if (route.getId() < rr.route.getId())
-	return -1;
+    return -1;
       else if (route.getId() > rr.route.getId())
-	return 1;
+    return 1;
       return 0;
     }
-    
+
     public String toString() {
       String buf = route.get("route");
       if ((route.get("ref") != null) && (route.get("ref") != ""))
       {
-	if ((route.get("to") != null) && (route.get("to") != ""))
-	{
-	  buf += " " + route.get("ref") + ": " + route.get("to");
-	}
-	else if ((route.get("direction") != null) && (route.get("direction") != ""))
-	{
-	  buf += " " + route.get("ref") + ": " + route.get("direction");
-	}
-	else
-	{
-	  buf += " " + route.get("ref");
-	}
+    if ((route.get("to") != null) && (route.get("to") != ""))
+    {
+      buf += " " + route.get("ref") + ": " + route.get("to");
+    }
+    else if ((route.get("direction") != null) && (route.get("direction") != ""))
+    {
+      buf += " " + route.get("ref") + ": " + route.get("direction");
+    }
+    else
+    {
+      buf += " " + route.get("ref");
+    }
       }
       buf += " [ID " + Long.toString(route.getId()) + "]";
-      
+
       return buf;
     }
   };
-  
+
   private class TagTableModel extends DefaultTableModel implements TableModelListener {
     Relation relation = null;
     TreeSet< String > blacklist = null;
     boolean hasFixedKeys = true;
-    
+
     public TagTableModel(boolean hasFixedKeys) {
       this.hasFixedKeys = hasFixedKeys;
@@ -162,123 +162,123 @@
     public boolean isCellEditable(int row, int column) {
       if ((column == 0) && (hasFixedKeys))
-	return false;
+    return false;
       return true;
     }
-    
+
     public void readRelation(Relation rel) {
       relation = rel;
-      
+
       for (int i = 0; i < getRowCount(); ++i)
       {
-	String value = rel.get((String)getValueAt(i, 0));
-	if (value == null)
-	  value = "";
-	setValueAt(value, i, 1);
-      }
-    }
-    
+    String value = rel.get((String)getValueAt(i, 0));
+    if (value == null)
+      value = "";
+    setValueAt(value, i, 1);
+      }
+    }
+
     public void readRelation(Relation rel, TreeSet< String > blacklist) {
       relation = rel;
       this.blacklist = blacklist;
-      
+
       setRowCount(0);
       Iterator< Map.Entry< String, String > > iter = rel.getKeys().entrySet().iterator();
       while (iter.hasNext())
       {
-	Map.Entry< String, String > entry = iter.next();
-	if (!blacklist.contains(entry.getKey()))
-	{
-	  Vector< String > newRow = new Vector< String >();
-	  newRow.add(entry.getKey());
-	  newRow.add(entry.getValue());
-	  addRow(newRow);
-	}
-      }
-      
+    Map.Entry< String, String > entry = iter.next();
+    if (!blacklist.contains(entry.getKey()))
+    {
+      Vector< String > newRow = new Vector< String >();
+      newRow.add(entry.getKey());
+      newRow.add(entry.getValue());
+      addRow(newRow);
+    }
+      }
+
       for (int i = 0; i < getRowCount(); ++i)
       {
-	String value = rel.get((String)getValueAt(i, 0));
-	if (value == null)
-	  value = "";
-	setValueAt(value, i, 1);
-      }
-    }
-  
+    String value = rel.get((String)getValueAt(i, 0));
+    if (value == null)
+      value = "";
+    setValueAt(value, i, 1);
+      }
+    }
+
     public void tableChanged(TableModelEvent e)
     {
       if (e.getType() == TableModelEvent.UPDATE)
       {
-	relation.setModified(true);
-	
-	String key = (String)getValueAt(e.getFirstRow(), 0);
-	if (key == null)
-	  return;
-	if ((blacklist == null) || (!blacklist.contains(key)))
-	{
-	  relation.setModified(true);
-	  if ("".equals(getValueAt(e.getFirstRow(), 1)))
-	    relation.remove(key);
-	  else
-	    relation.put(key, (String)getValueAt(e.getFirstRow(), 1));
-	}
-	else
-	{
-	  if (e.getColumn() == 0)
-	    setValueAt("", e.getFirstRow(), 0);
-	}
+    relation.setModified(true);
+
+    String key = (String)getValueAt(e.getFirstRow(), 0);
+    if (key == null)
+      return;
+    if ((blacklist == null) || (!blacklist.contains(key)))
+    {
+      relation.setModified(true);
+      if ("".equals(getValueAt(e.getFirstRow(), 1)))
+        relation.remove(key);
+      else
+        relation.put(key, (String)getValueAt(e.getFirstRow(), 1));
+    }
+    else
+    {
+      if (e.getColumn() == 0)
+        setValueAt("", e.getFirstRow(), 0);
+    }
       }
     }
   };
-  
+
   private class CustomCellEditorTable extends JTable {
     TreeMap< Integer, TableCellEditor > col1 = null;
     TreeMap< Integer, TableCellEditor > col2 = null;
-    
+
     public CustomCellEditorTable() {
       col1 = new TreeMap< Integer, TableCellEditor >();
       col2 = new TreeMap< Integer, TableCellEditor >();
     }
-    
+
     public TableCellEditor getCellEditor(int row, int column) {
       TableCellEditor editor = null;
       if (column == 0)
-	editor = col1.get(new Integer(row));
+    editor = col1.get(new Integer(row));
       else
-	editor = col2.get(new Integer(row));
+    editor = col2.get(new Integer(row));
       if (editor == null)
-	return new DefaultCellEditor(new JTextField());
+    return new DefaultCellEditor(new JTextField());
       else
-	return editor;
-    }
-    
+    return editor;
+    }
+
     public void setCellEditor(int row, int column, TableCellEditor editor) {
       if (column == 0)
-	col1.put(new Integer(row), editor);
+    col1.put(new Integer(row), editor);
       else
-	col2.put(new Integer(row), editor);
+    col2.put(new Integer(row), editor);
     }
   };
-  
+
   private class StoplistTableModel extends DefaultTableModel {
     public Vector<Node> nodes = new Vector<Node>();
-    
+
     public boolean isCellEditable(int row, int column) {
       if (column != 1)
-	return false;
+    return false;
       return true;
     }
-  
+
     public void addRow(Object[] obj) {
       throw new UnsupportedOperationException();
     }
-    
+
     public void insertRow(int insPos, Object[] obj) {
       throw new UnsupportedOperationException();
     }
-    
+
     public void addRow(Node node, String role) {
       insertRow(-1, node, role);
     }
-    
+
     public void insertRow(int insPos, Node node, String role) {
       String[] buf = { "", "" };
@@ -286,23 +286,23 @@
       if (curName != null)
       {
-	buf[0] = curName;
+    buf[0] = curName;
       }
       else
       {
-	buf[0] = "[ID] " + (new Long(node.getId())).toString();
+    buf[0] = "[ID] " + (new Long(node.getId())).toString();
       }
       buf[1] = role;
       if (insPos == -1)
       {
-	nodes.addElement(node);
-	super.addRow(buf);
+    nodes.addElement(node);
+    super.addRow(buf);
       }
       else
       {
-	nodes.insertElementAt(node, insPos);
-	super.insertRow(insPos, buf);
-      }
-    }
-    
+    nodes.insertElementAt(node, insPos);
+    super.insertRow(insPos, buf);
+      }
+    }
+
     public void clear()
     {
@@ -311,5 +311,5 @@
     }
   };
-  
+
   private class StoplistTableModelListener implements TableModelListener {
     public void tableChanged(TableModelEvent e)
@@ -317,18 +317,18 @@
       if (e.getType() == TableModelEvent.UPDATE)
       {
-	rebuildNodes();
+    rebuildNodes();
       }
     }
   };
-  
+
   private class SegmentMetric {
     public double aLat, aLon;
     public double length;
     public double d1, d2, o1, o2;
-    
+
     public SegmentMetric(double fromLat, double fromLon, double toLat, double toLon) {
       aLat = fromLat;
       aLon = fromLon;
-      
+
       //Compute length and direction
       //length is in units of latitude degrees
@@ -336,13 +336,13 @@
       d2 = (toLon - fromLon) * Math.cos(fromLat * Math.PI/180.0);
       length = Math.sqrt(d1*d1 + d2*d2);
-    
+
       //Normalise direction
       d1 = d1 / length;
       d2 = d2 / length;
-    
+
       //Compute orthogonal direction (right hand size is positive)
       o1 = - d2;
       o2 = d1;
-    
+
       //Prepare lon direction to reduce the number of necessary multiplications
       d2 = d2 * Math.cos(fromLat * Math.PI/180.0);
@@ -350,5 +350,5 @@
     }
   };
-  
+
   private class StopReference implements Comparable< StopReference > {
     public int index = 0;
@@ -358,7 +358,7 @@
     public String role = "";
     public Node node;
-    
+
     public StopReference(int inIndex, double inPos, double inDistance,
-			 String inName, String inRole, Node inNode) {
+             String inName, String inRole, Node inNode) {
       index = inIndex;
       pos = inPos;
@@ -368,18 +368,18 @@
       node = inNode;
     }
-    
+
     public int compareTo(StopReference sr) {
       if (this.index < sr.index)
-	return -1;
+    return -1;
       if (this.index > sr.index)
-	return 1;
+    return 1;
       if (this.pos < sr.pos)
-	return -1;
+    return -1;
       if (this.pos > sr.pos)
-	return 1;
+    return 1;
       return 0;
     }
   };
-  
+
   private static JDialog jDialog = null;
   private static JTabbedPane tabbedPane = null;
@@ -403,10 +403,10 @@
   private static Vector< RelationMember > markedWays = new Vector< RelationMember >();
   private static Vector< RelationMember > markedNodes = new Vector< RelationMember >();
-  
+
   private static Relation copy = null;
-  
+
   public RoutePatternAction() {
     super(tr("Route patterns ..."), null,
-	  tr("Edit Route patterns for public transport"), null, true);
+      tr("Edit Route patterns for public transport"), null, true);
   }
 
@@ -414,5 +414,5 @@
     Frame frame = JOptionPane.getFrameForComponent(Main.parent);
     DataSet mainDataSet = Main.main.getCurrentDataSet();
-    
+
     if (jDialog == null)
     {
@@ -435,5 +435,5 @@
       tabbedPane.setEnabledAt(4, false);
       jDialog.add(tabbedPane);
-      
+
       //Overview Tab
       Container contentPane = tabOverview;
@@ -441,7 +441,7 @@
       GridBagConstraints layoutCons = new GridBagConstraints();
       contentPane.setLayout(gridbag);
-      
+
       JLabel headline = new JLabel("Existing route patterns:");
-	
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 0;
@@ -452,5 +452,5 @@
       gridbag.setConstraints(headline, layoutCons);
       contentPane.add(headline);
-	
+
       relsListModel = new DefaultListModel();
       relsList = new JList(relsListModel);
@@ -460,5 +460,5 @@
       relsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
       relsList.addListSelectionListener(new RoutesLSL(this));
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 1;
@@ -469,9 +469,9 @@
       gridbag.setConstraints(rpListSP, layoutCons);
       contentPane.add(rpListSP);
-	
+
       JButton bRefresh = new JButton("Refresh");
       bRefresh.setActionCommand("routePattern.refresh");
       bRefresh.addActionListener(this);
-	
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 2;
@@ -483,9 +483,9 @@
       gridbag.setConstraints(bRefresh, layoutCons);
       contentPane.add(bRefresh);
-	
+
       JButton bNew = new JButton("New");
       bNew.setActionCommand("routePattern.overviewNew");
       bNew.addActionListener(this);
-	
+
       layoutCons.gridx = 1;
       layoutCons.gridy = 2;
@@ -497,9 +497,9 @@
       gridbag.setConstraints(bNew, layoutCons);
       contentPane.add(bNew);
-	
+
       JButton bDelete = new JButton("Delete");
       bDelete.setActionCommand("routePattern.overviewDelete");
       bDelete.addActionListener(this);
-	
+
       layoutCons.gridx = 1;
       layoutCons.gridy = 3;
@@ -511,9 +511,9 @@
       gridbag.setConstraints(bDelete, layoutCons);
       contentPane.add(bDelete);
-      
+
       JButton bDuplicate = new JButton("Duplicate");
       bDuplicate.setActionCommand("routePattern.overviewDuplicate");
       bDuplicate.addActionListener(this);
-	
+
       layoutCons.gridx = 2;
       layoutCons.gridy = 2;
@@ -525,9 +525,9 @@
       gridbag.setConstraints(bDuplicate, layoutCons);
       contentPane.add(bDuplicate);
-	
+
       JButton bReflect = new JButton("Reflect");
       bReflect.setActionCommand("routePattern.overviewReflect");
       bReflect.addActionListener(this);
-	
+
       layoutCons.gridx = 2;
       layoutCons.gridy = 3;
@@ -539,5 +539,5 @@
       gridbag.setConstraints(bReflect, layoutCons);
       contentPane.add(bReflect);
-      
+
       //Tags Tab
       /*Container*/ contentPane = tabTags;
@@ -545,7 +545,7 @@
       /*GridBagConstraints*/ layoutCons = new GridBagConstraints();
       contentPane.setLayout(gridbag);
-      
+
       /*JLabel*/ headline = new JLabel("Required tags:");
-	
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 0;
@@ -555,5 +555,5 @@
       gridbag.setConstraints(headline, layoutCons);
       contentPane.add(headline);
-	
+
       requiredTagsTable = new CustomCellEditorTable();
       requiredTagsData = new TagTableModel(true);
@@ -600,5 +600,5 @@
       JScrollPane tableSP = new JScrollPane(requiredTagsTable);
       requiredTagsData.addTableModelListener(requiredTagsData);
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 1;
@@ -611,7 +611,7 @@
       tableSP.setPreferredSize(preferredSize);
       contentPane.add(tableSP);
-	
+
       headline = new JLabel("Common tags:");
-	
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 2;
@@ -621,5 +621,5 @@
       gridbag.setConstraints(headline, layoutCons);
       contentPane.add(headline);
-      
+
       commonTagsTable = new CustomCellEditorTable();
       commonTagsData = new TagTableModel(true);
@@ -654,5 +654,5 @@
       /*JScrollPane*/ tableSP = new JScrollPane(commonTagsTable);
       commonTagsData.addTableModelListener(commonTagsData);
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 3;
@@ -665,7 +665,7 @@
       tableSP.setPreferredSize(preferredSize);
       contentPane.add(tableSP);
-	
+
       headline = new JLabel("Additional tags:");
-	
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 4;
@@ -675,5 +675,5 @@
       gridbag.setConstraints(headline, layoutCons);
       contentPane.add(headline);
-	
+
       otherTagsTable = new CustomCellEditorTable();
       otherTagsData = new TagTableModel(false);
@@ -683,5 +683,5 @@
       /*JScrollPane*/ tableSP = new JScrollPane(otherTagsTable);
       otherTagsData.addTableModelListener(otherTagsData);
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 5;
@@ -694,9 +694,9 @@
       tableSP.setPreferredSize(preferredSize);
       contentPane.add(tableSP);
-      
+
       JButton bAddTag = new JButton("Add a new Tag");
       bAddTag.setActionCommand("routePattern.tagAddTag");
       bAddTag.addActionListener(this);
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 6;
@@ -707,5 +707,5 @@
       gridbag.setConstraints(bAddTag, layoutCons);
       contentPane.add(bAddTag);
-	
+
       //Itinerary Tab
       contentPane = tabItinerary;
@@ -713,5 +713,5 @@
       layoutCons = new GridBagConstraints();
       contentPane.setLayout(gridbag);
-      
+
       itineraryTable = new JTable();
       itineraryData = new ItineraryTableModel();
@@ -725,7 +725,7 @@
       comboBox.addItem("backward");
       itineraryTable.getColumnModel().getColumn(1)
-	  .setCellEditor(new DefaultCellEditor(comboBox));
+      .setCellEditor(new DefaultCellEditor(comboBox));
       itineraryData.addTableModelListener(itineraryData);
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 0;
@@ -736,9 +736,9 @@
       gridbag.setConstraints(tableSP, layoutCons);
       contentPane.add(tableSP);
-	
+
       JButton bFind = new JButton("Find");
       bFind.setActionCommand("routePattern.itineraryFind");
       bFind.addActionListener(this);
-	
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 1;
@@ -749,9 +749,9 @@
       gridbag.setConstraints(bFind, layoutCons);
       contentPane.add(bFind);
-      
+
       JButton bShow = new JButton("Show");
       bShow.setActionCommand("routePattern.itineraryShow");
       bShow.addActionListener(this);
-	
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 2;
@@ -762,9 +762,9 @@
       gridbag.setConstraints(bShow, layoutCons);
       contentPane.add(bShow);
-	
+
       JButton bMark = new JButton("Mark");
       bMark.setActionCommand("routePattern.itineraryMark");
       bMark.addActionListener(this);
-	
+
       layoutCons.gridx = 1;
       layoutCons.gridy = 1;
@@ -776,9 +776,9 @@
       gridbag.setConstraints(bMark, layoutCons);
       contentPane.add(bMark);
-	
+
       JButton bAdd = new JButton("Add");
       bAdd.setActionCommand("routePattern.itineraryAdd");
       bAdd.addActionListener(this);
-	
+
       layoutCons.gridx = 2;
       layoutCons.gridy = 1;
@@ -790,9 +790,9 @@
       gridbag.setConstraints(bAdd, layoutCons);
       contentPane.add(bAdd);
-	
+
       /*JButton*/ bDelete = new JButton("Delete");
       bDelete.setActionCommand("routePattern.itineraryDelete");
       bDelete.addActionListener(this);
-	
+
       layoutCons.gridx = 2;
       layoutCons.gridy = 2;
@@ -803,9 +803,9 @@
       gridbag.setConstraints(bDelete, layoutCons);
       contentPane.add(bDelete);
-	
+
       JButton bSort = new JButton("Sort");
       bSort.setActionCommand("routePattern.itinerarySort");
       bSort.addActionListener(this);
-	
+
       layoutCons.gridx = 3;
       layoutCons.gridy = 1;
@@ -816,9 +816,9 @@
       gridbag.setConstraints(bSort, layoutCons);
       contentPane.add(bSort);
-	
+
       /*JButton*/ bReflect = new JButton("Reflect");
       bReflect.setActionCommand("routePattern.itineraryReflect");
       bReflect.addActionListener(this);
-      
+
       layoutCons.gridx = 3;
       layoutCons.gridy = 2;
@@ -829,5 +829,5 @@
       gridbag.setConstraints(bReflect, layoutCons);
       contentPane.add(bReflect);
-      
+
       //Stoplist Tab
       contentPane = tabStoplist;
@@ -835,5 +835,5 @@
       layoutCons = new GridBagConstraints();
       contentPane.setLayout(gridbag);
-      
+
       stoplistTable = new JTable();
       stoplistData = new StoplistTableModel();
@@ -847,7 +847,7 @@
       comboBox.addItem("backward_stop");
       stoplistTable.getColumnModel().getColumn(1)
-	  .setCellEditor(new DefaultCellEditor(comboBox));
+      .setCellEditor(new DefaultCellEditor(comboBox));
       stoplistData.addTableModelListener(new StoplistTableModelListener());
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 0;
@@ -858,9 +858,9 @@
       gridbag.setConstraints(tableSP, layoutCons);
       contentPane.add(tableSP);
-	
+
       /*JButton*/ bFind = new JButton("Find");
       bFind.setActionCommand("routePattern.stoplistFind");
       bFind.addActionListener(this);
-	
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 1;
@@ -871,9 +871,9 @@
       gridbag.setConstraints(bFind, layoutCons);
       contentPane.add(bFind);
-	
+
       /*JButton*/ bShow = new JButton("Show");
       bShow.setActionCommand("routePattern.stoplistShow");
       bShow.addActionListener(this);
-	
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 2;
@@ -884,9 +884,9 @@
       gridbag.setConstraints(bShow, layoutCons);
       contentPane.add(bShow);
-	
+
       /*JButton*/ bMark = new JButton("Mark");
       bMark.setActionCommand("routePattern.stoplistMark");
       bMark.addActionListener(this);
-	
+
       layoutCons.gridx = 1;
       layoutCons.gridy = 1;
@@ -898,9 +898,9 @@
       gridbag.setConstraints(bMark, layoutCons);
       contentPane.add(bMark);
-	
+
       /*JButton*/ bAdd = new JButton("Add");
       bAdd.setActionCommand("routePattern.stoplistAdd");
       bAdd.addActionListener(this);
-	
+
       layoutCons.gridx = 2;
       layoutCons.gridy = 1;
@@ -912,9 +912,9 @@
       gridbag.setConstraints(bAdd, layoutCons);
       contentPane.add(bAdd);
-	
+
       /*JButton*/ bDelete = new JButton("Delete");
       bDelete.setActionCommand("routePattern.stoplistDelete");
       bDelete.addActionListener(this);
-	
+
       layoutCons.gridx = 2;
       layoutCons.gridy = 2;
@@ -925,9 +925,9 @@
       gridbag.setConstraints(bDelete, layoutCons);
       contentPane.add(bDelete);
-	
+
       /*JButton*/ bSort = new JButton("Sort");
       bSort.setActionCommand("routePattern.stoplistSort");
       bSort.addActionListener(this);
-	
+
       layoutCons.gridx = 3;
       layoutCons.gridy = 1;
@@ -938,9 +938,9 @@
       gridbag.setConstraints(bSort, layoutCons);
       contentPane.add(bSort);
-	
+
       /*JButton*/ bReflect = new JButton("Reflect");
       bReflect.setActionCommand("routePattern.stoplistReflect");
       bReflect.addActionListener(this);
-      
+
       layoutCons.gridx = 3;
       layoutCons.gridy = 2;
@@ -951,5 +951,5 @@
       gridbag.setConstraints(bReflect, layoutCons);
       contentPane.add(bReflect);
-      
+
       //Meta Tab
       contentPane = tabMeta;
@@ -957,7 +957,7 @@
       layoutCons = new GridBagConstraints();
       contentPane.setLayout(gridbag);
-      
+
       JLabel rightleft = new JLabel("Stops are possible on the");
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 1;
@@ -968,7 +968,7 @@
       gridbag.setConstraints(rightleft, layoutCons);
       contentPane.add(rightleft);
-	
+
       cbRight = new JCheckBox("right hand side", true);
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 2;
@@ -979,7 +979,7 @@
       gridbag.setConstraints(cbRight, layoutCons);
       contentPane.add(cbRight);
-	
+
       cbLeft = new JCheckBox("left hand side", false);
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 3;
@@ -990,7 +990,7 @@
       gridbag.setConstraints(cbLeft, layoutCons);
       contentPane.add(cbLeft);
-      
+
       JLabel maxdist = new JLabel("Maximum distance from route");
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 4;
@@ -1001,7 +1001,7 @@
       gridbag.setConstraints(maxdist, layoutCons);
       contentPane.add(maxdist);
-      
+
       tfSuggestStopsLimit = new JTextField("20", 4);
-      
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 5;
@@ -1012,7 +1012,7 @@
       gridbag.setConstraints(tfSuggestStopsLimit, layoutCons);
       contentPane.add(tfSuggestStopsLimit);
-      
+
       JLabel meters = new JLabel("meters");
-      
+
       layoutCons.gridx = 1;
       layoutCons.gridy = 5;
@@ -1023,9 +1023,9 @@
       gridbag.setConstraints(meters, layoutCons);
       contentPane.add(meters);
-      
+
       JButton bSuggestStops = new JButton("Suggest Stops");
       bSuggestStops.setActionCommand("routePattern.metaSuggestStops");
       bSuggestStops.addActionListener(this);
-	
+
       layoutCons.gridx = 0;
       layoutCons.gridy = 6;
@@ -1036,8 +1036,8 @@
       gridbag.setConstraints(bSuggestStops, layoutCons);
       contentPane.add(bSuggestStops);
-	
+
       jDialog.pack();
     }
-      
+
     if ("routePattern.refresh".equals(event.getActionCommand()))
     {
@@ -1050,11 +1050,11 @@
       currentRoute.put("route", "bus");
       mainDataSet.addPrimitive(currentRoute);
-      
+
       refreshData();
-      
+
       for (int i = 0; i < relsListModel.size(); ++i)
       {
-	if (currentRoute == ((RouteReference)relsListModel.elementAt(i)).route)
-	  relsList.setSelectedIndex(i);
+    if (currentRoute == ((RouteReference)relsListModel.elementAt(i)).route)
+      relsList.setSelectedIndex(i);
       }
     }
@@ -1065,11 +1065,11 @@
       currentRoute.put("route", "bus");
       mainDataSet.addPrimitive(currentRoute);
-      
+
       refreshData();
-      	
+
       for (int i = 0; i < relsListModel.size(); ++i)
       {
-	if (currentRoute == ((RouteReference)relsListModel.elementAt(i)).route)
-	  relsList.setSelectedIndex(i);
+    if (currentRoute == ((RouteReference)relsListModel.elementAt(i)).route)
+      relsList.setSelectedIndex(i);
       }
     }
@@ -1081,43 +1081,43 @@
       currentRoute.put("from", tag_to);
       currentRoute.put("to", tag_from);
-      
+
       Vector< RelationMember > itemsToReflect = new Vector< RelationMember >();
       Vector< RelationMember > otherItems = new Vector< RelationMember >();
       int insPos = itineraryTable.getSelectedRow();
-      
+
       for (int i = 0; i < currentRoute.getMembersCount(); ++i)
       {
-	RelationMember item = currentRoute.getMember(i);
-	
-	if (item.isWay())
-	{
-	  String role = item.getRole();
-	  if ("backward".equals(role))
-	    role = "forward";
-	  else if ("forward".equals(role))
-	    role = "backward";
-	  else
-	    role = "backward";
-	  
-	  itemsToReflect.add(new RelationMember(role, item.getWay()));
-	}
-	else if (item.isNode())
-	  itemsToReflect.add(item);
-	else
-	  otherItems.add(item);
-      }
-	
+    RelationMember item = currentRoute.getMember(i);
+
+    if (item.isWay())
+    {
+      String role = item.getRole();
+      if ("backward".equals(role))
+        role = "forward";
+      else if ("forward".equals(role))
+        role = "backward";
+      else
+        role = "backward";
+
+      itemsToReflect.add(new RelationMember(role, item.getWay()));
+    }
+    else if (item.isNode())
+      itemsToReflect.add(item);
+    else
+      otherItems.add(item);
+      }
+
       currentRoute.setMembers(null);
       for (int i = itemsToReflect.size()-1; i >= 0; --i)
-	currentRoute.addMember(itemsToReflect.elementAt(i));
+    currentRoute.addMember(itemsToReflect.elementAt(i));
       for (int i = 0; i < otherItems.size(); ++i)
-	currentRoute.addMember(otherItems.elementAt(i));
-      
+    currentRoute.addMember(otherItems.elementAt(i));
+
       refreshData();
-      
+
       for (int i = 0; i < relsListModel.size(); ++i)
       {
-	if (currentRoute == ((RouteReference)relsListModel.elementAt(i)).route)
-	  relsList.setSelectedIndex(i);
+    if (currentRoute == ((RouteReference)relsListModel.elementAt(i)).route)
+      relsList.setSelectedIndex(i);
       }
     }
@@ -1125,5 +1125,5 @@
     {
       DeleteAction.deleteRelation(Main.main.getEditLayer(), currentRoute);
-      
+
       currentRoute = null;
       tabbedPane.setEnabledAt(1, false);
@@ -1131,5 +1131,5 @@
       tabbedPane.setEnabledAt(3, false);
       tabbedPane.setEnabledAt(4, false);
-      
+
       refreshData();
     }
@@ -1144,13 +1144,13 @@
     {
       if (mainDataSet == null)
-	return;
-      
+    return;
+
       itineraryTable.clearSelection();
-      
+
       for (int i = 0; i < itineraryData.getRowCount(); ++i)
       {
-	if ((itineraryData.ways.elementAt(i) != null) &&
-	    (mainDataSet.isSelected(itineraryData.ways.elementAt(i))))
-	    itineraryTable.addRowSelectionInterval(i, i);
+    if ((itineraryData.ways.elementAt(i) != null) &&
+        (mainDataSet.isSelected(itineraryData.ways.elementAt(i))))
+        itineraryTable.addRowSelectionInterval(i, i);
       }
     }
@@ -1160,24 +1160,24 @@
       if (itineraryTable.getSelectedRowCount() > 0)
       {
-	for (int i = 0; i < itineraryData.getRowCount(); ++i)
-	{
-	  if ((itineraryTable.isRowSelected(i)) && (itineraryData.ways.elementAt(i) != null))
-	  {
-	    itineraryData.ways.elementAt(i).visit(box);
-	  }
-	}
+    for (int i = 0; i < itineraryData.getRowCount(); ++i)
+    {
+      if ((itineraryTable.isRowSelected(i)) && (itineraryData.ways.elementAt(i) != null))
+      {
+        itineraryData.ways.elementAt(i).visit(box);
+      }
+    }
       }
       else
       {
-	for (int i = 0; i < itineraryData.getRowCount(); ++i)
-	{
-	  if (itineraryData.ways.elementAt(i) != null)
-	  {
-	    itineraryData.ways.elementAt(i).visit(box);
-	  }
-	}
+    for (int i = 0; i < itineraryData.getRowCount(); ++i)
+    {
+      if (itineraryData.ways.elementAt(i) != null)
+      {
+        itineraryData.ways.elementAt(i).visit(box);
+      }
+    }
       }
       if (box.getBounds() == null)
-	return;
+    return;
       box.enlargeBoundingBox();
       Main.map.mapView.recalculateCenterScale(box);
@@ -1190,29 +1190,29 @@
       if (itineraryTable.getSelectedRowCount() > 0)
       {
-	for (int i = 0; i < itineraryData.getRowCount(); ++i)
-	{
-	  if ((itineraryTable.isRowSelected(i)) && (itineraryData.ways.elementAt(i) != null))
-	  {
-	    mainDataSet.addSelected(itineraryData.ways.elementAt(i));
-	    
-	    RelationMember markedWay = new RelationMember
-		((String)(itineraryData.getValueAt(i, 1)), itineraryData.ways.elementAt(i));
-	    markedWays.addElement(markedWay);
-	  }
-	}
+    for (int i = 0; i < itineraryData.getRowCount(); ++i)
+    {
+      if ((itineraryTable.isRowSelected(i)) && (itineraryData.ways.elementAt(i) != null))
+      {
+        mainDataSet.addSelected(itineraryData.ways.elementAt(i));
+
+        RelationMember markedWay = new RelationMember
+        ((String)(itineraryData.getValueAt(i, 1)), itineraryData.ways.elementAt(i));
+        markedWays.addElement(markedWay);
+      }
+    }
       }
       else
       {
-	for (int i = 0; i < itineraryData.getRowCount(); ++i)
-	{
-	  if (itineraryData.ways.elementAt(i) != null)
-	  {
-	    mainDataSet.addSelected(itineraryData.ways.elementAt(i));
-	    
-	    RelationMember markedWay = new RelationMember
-		((String)(itineraryData.getValueAt(i, 1)), itineraryData.ways.elementAt(i));
-	    markedWays.addElement(markedWay);
-	  }
-	}
+    for (int i = 0; i < itineraryData.getRowCount(); ++i)
+    {
+      if (itineraryData.ways.elementAt(i) != null)
+      {
+        mainDataSet.addSelected(itineraryData.ways.elementAt(i));
+
+        RelationMember markedWay = new RelationMember
+        ((String)(itineraryData.getValueAt(i, 1)), itineraryData.ways.elementAt(i));
+        markedWays.addElement(markedWay);
+      }
+    }
       }
     }
@@ -1223,41 +1223,41 @@
       TreeSet<Way> addedWays = new TreeSet<Way>();
       if (mainDataSet == null)
-	return;
-      
+    return;
+
       while (relIter.hasNext())
       {
-	RelationMember curMember = relIter.next();
-	if ((curMember.isWay()) && (mainDataSet.isSelected(curMember.getWay())))
-	{
-	  itineraryData.insertRow(insPos, curMember.getWay(), curMember.getRole());
-	  if (insPos >= 0)
-	    ++insPos;
-	  
-	  addedWays.add(curMember.getWay());
-	}
-      }
-      
+    RelationMember curMember = relIter.next();
+    if ((curMember.isWay()) && (mainDataSet.isSelected(curMember.getWay())))
+    {
+      itineraryData.insertRow(insPos, curMember.getWay(), curMember.getRole());
+      if (insPos >= 0)
+        ++insPos;
+
+      addedWays.add(curMember.getWay());
+    }
+      }
+
       Collection<Way> selectedWays = mainDataSet.getSelectedWays();
       Iterator<Way> wayIter = selectedWays.iterator();
-      
+
       while (wayIter.hasNext())
       {
-	Way curMember = wayIter.next();
-	if (!(addedWays.contains(curMember)))
-	{
-	  itineraryData.insertRow(insPos, curMember, "");
-	  if (insPos >= 0)
-	    ++insPos;
-	}
-      }
-      
+    Way curMember = wayIter.next();
+    if (!(addedWays.contains(curMember)))
+    {
+      itineraryData.insertRow(insPos, curMember, "");
+      if (insPos >= 0)
+        ++insPos;
+    }
+      }
+
       if ((insPos > 0) && (insPos < itineraryData.getRowCount()))
       {
-	while ((insPos < itineraryData.getRowCount())
-		       && (itineraryData.ways.elementAt(insPos) == null))
-	  ++insPos;
-	itineraryTable.removeRowSelectionInterval(0, itineraryData.getRowCount()-1);
-	if (insPos < itineraryData.getRowCount())
-	  itineraryTable.addRowSelectionInterval(insPos, insPos);
+    while ((insPos < itineraryData.getRowCount())
+               && (itineraryData.ways.elementAt(insPos) == null))
+      ++insPos;
+    itineraryTable.removeRowSelectionInterval(0, itineraryData.getRowCount()-1);
+    if (insPos < itineraryData.getRowCount())
+      itineraryTable.addRowSelectionInterval(insPos, insPos);
       }
 
@@ -1269,11 +1269,11 @@
       for (int i = itineraryData.getRowCount()-1; i >=0; --i)
       {
-	if ((itineraryTable.isRowSelected(i)) && (itineraryData.ways.elementAt(i) != null))
-	{
-	  itineraryData.ways.removeElementAt(i);
-	  itineraryData.removeRow(i);
-	}
-      }
-    
+    if ((itineraryTable.isRowSelected(i)) && (itineraryData.ways.elementAt(i) != null))
+    {
+      itineraryData.ways.removeElementAt(i);
+      itineraryData.removeRow(i);
+    }
+      }
+
       itineraryData.cleanupGaps();
       rebuildWays();
@@ -1283,74 +1283,74 @@
       TreeSet<Way> usedWays = new TreeSet<Way>();
       TreeMap<Node, LinkedList<RelationMember> > frontNodes =
-	  new TreeMap<Node, LinkedList<RelationMember> >();
+      new TreeMap<Node, LinkedList<RelationMember> >();
       TreeMap<Node, LinkedList<RelationMember> > backNodes =
-	  new TreeMap<Node, LinkedList<RelationMember> >();
+      new TreeMap<Node, LinkedList<RelationMember> >();
       Vector< LinkedList<RelationMember> > loops =
-	  new Vector< LinkedList<RelationMember> >();
+      new Vector< LinkedList<RelationMember> >();
       int insPos = itineraryTable.getSelectedRow();
-      
+
       if (itineraryTable.getSelectedRowCount() > 0)
       {
-	for (int i = itineraryData.getRowCount()-1; i >=0; --i)
-	{
-	  if ((itineraryTable.isRowSelected(i)) && (itineraryData.ways.elementAt(i) != null))
-	  {
-	    if (!(usedWays.contains(itineraryData.ways.elementAt(i))))
-	    {
-	      addWayToSortingData
-		  (itineraryData.ways.elementAt(i), frontNodes, backNodes, loops);
-	      usedWays.add(itineraryData.ways.elementAt(i));
-	    }
-	    
-	    itineraryData.ways.removeElementAt(i);
-	    itineraryData.removeRow(i);
-	  }
-	}
+    for (int i = itineraryData.getRowCount()-1; i >=0; --i)
+    {
+      if ((itineraryTable.isRowSelected(i)) && (itineraryData.ways.elementAt(i) != null))
+      {
+        if (!(usedWays.contains(itineraryData.ways.elementAt(i))))
+        {
+          addWayToSortingData
+          (itineraryData.ways.elementAt(i), frontNodes, backNodes, loops);
+          usedWays.add(itineraryData.ways.elementAt(i));
+        }
+
+        itineraryData.ways.removeElementAt(i);
+        itineraryData.removeRow(i);
+      }
+    }
       }
       else
       {
-	for (int i = itineraryData.getRowCount()-1; i >=0; --i)
-	{
-	  if (itineraryData.ways.elementAt(i) != null)
-	  {
-	    if (!(usedWays.contains(itineraryData.ways.elementAt(i))))
-	    {
-	      addWayToSortingData
-		  (itineraryData.ways.elementAt(i), frontNodes, backNodes, loops);
-	      usedWays.add(itineraryData.ways.elementAt(i));
-	    }
-	  }
-	}
-	
-	itineraryData.clear();
+    for (int i = itineraryData.getRowCount()-1; i >=0; --i)
+    {
+      if (itineraryData.ways.elementAt(i) != null)
+      {
+        if (!(usedWays.contains(itineraryData.ways.elementAt(i))))
+        {
+          addWayToSortingData
+          (itineraryData.ways.elementAt(i), frontNodes, backNodes, loops);
+          usedWays.add(itineraryData.ways.elementAt(i));
+        }
+      }
+    }
+
+    itineraryData.clear();
       }
 
       Iterator< Map.Entry< Node, LinkedList<RelationMember> > > entryIter
-	  = frontNodes.entrySet().iterator();
+      = frontNodes.entrySet().iterator();
       while (entryIter.hasNext())
       {
-	Iterator<RelationMember> relIter = entryIter.next().getValue().iterator();
-	while (relIter.hasNext())
-	{
-	  RelationMember curMember = relIter.next();
-	  itineraryData.insertRow(insPos, curMember.getWay(), curMember.getRole());
-	  if (insPos >= 0)
-	    ++insPos;
-	}
-      }
-      
+    Iterator<RelationMember> relIter = entryIter.next().getValue().iterator();
+    while (relIter.hasNext())
+    {
+      RelationMember curMember = relIter.next();
+      itineraryData.insertRow(insPos, curMember.getWay(), curMember.getRole());
+      if (insPos >= 0)
+        ++insPos;
+    }
+      }
+
       Iterator< LinkedList<RelationMember> > listIter = loops.iterator();
       while (listIter.hasNext())
       {
-	Iterator<RelationMember> relIter = listIter.next().iterator();
-	while (relIter.hasNext())
-	{
-	  RelationMember curMember = relIter.next();
-	  itineraryData.insertRow(insPos, curMember.getWay(), curMember.getRole());
-	  if (insPos >= 0)
-	    ++insPos;
-	}
-      }
-      
+    Iterator<RelationMember> relIter = listIter.next().iterator();
+    while (relIter.hasNext())
+    {
+      RelationMember curMember = relIter.next();
+      itineraryData.insertRow(insPos, curMember.getWay(), curMember.getRole());
+      if (insPos >= 0)
+        ++insPos;
+    }
+      }
+
       itineraryData.cleanupGaps();
       rebuildWays();
@@ -1360,47 +1360,47 @@
       Vector<RelationMember> itemsToReflect = new Vector<RelationMember>();
       int insPos = itineraryTable.getSelectedRow();
-      
+
       if (itineraryTable.getSelectedRowCount() > 0)
       {
-	for (int i = itineraryData.getRowCount()-1; i >=0; --i)
-	{
-	  if ((itineraryTable.isRowSelected(i)) && (itineraryData.ways.elementAt(i) != null))
-	  {
-	    String role = (String)(itineraryData.getValueAt(i, 1));
-	    if ("backward".equals(role))
-	      role = "forward";
-	    else if ("forward".equals(role))
-	      role = "backward";
-	    else
-	      role = "backward";
-	    RelationMember markedWay = new RelationMember
-		(role, itineraryData.ways.elementAt(i));
-	    itemsToReflect.addElement(markedWay);
-	    
-	    itineraryData.ways.removeElementAt(i);
-	    itineraryData.removeRow(i);
-	  }
-	}
+    for (int i = itineraryData.getRowCount()-1; i >=0; --i)
+    {
+      if ((itineraryTable.isRowSelected(i)) && (itineraryData.ways.elementAt(i) != null))
+      {
+        String role = (String)(itineraryData.getValueAt(i, 1));
+        if ("backward".equals(role))
+          role = "forward";
+        else if ("forward".equals(role))
+          role = "backward";
+        else
+          role = "backward";
+        RelationMember markedWay = new RelationMember
+        (role, itineraryData.ways.elementAt(i));
+        itemsToReflect.addElement(markedWay);
+
+        itineraryData.ways.removeElementAt(i);
+        itineraryData.removeRow(i);
+      }
+    }
       }
       else
       {
-	for (int i = itineraryData.getRowCount()-1; i >=0; --i)
-	{
-	  if (itineraryData.ways.elementAt(i) != null)
-	  {
-	    String role = (String)(itineraryData.getValueAt(i, 1));
-	    if ("backward".equals(role))
-	      role = "forward";
-	    else if ("forward".equals(role))
-	      role = "backward";
-	    else
-	      role = "backward";
-	    RelationMember markedWay = new RelationMember
-		(role, itineraryData.ways.elementAt(i));
-	    itemsToReflect.addElement(markedWay);
-	  }
-	}
-	
-	itineraryData.clear();
+    for (int i = itineraryData.getRowCount()-1; i >=0; --i)
+    {
+      if (itineraryData.ways.elementAt(i) != null)
+      {
+        String role = (String)(itineraryData.getValueAt(i, 1));
+        if ("backward".equals(role))
+          role = "forward";
+        else if ("forward".equals(role))
+          role = "backward";
+        else
+          role = "backward";
+        RelationMember markedWay = new RelationMember
+        (role, itineraryData.ways.elementAt(i));
+        itemsToReflect.addElement(markedWay);
+      }
+    }
+
+    itineraryData.clear();
       }
 
@@ -1409,15 +1409,15 @@
       while (relIter.hasNext())
       {
-	RelationMember curMember = relIter.next();
-	if (curMember.isWay())
-	{
-	  itineraryData.insertRow(insPos, curMember.getWay(), curMember.getRole());
-	  if (insPos >= 0)
-	    ++insPos;
-	}
-      }
+    RelationMember curMember = relIter.next();
+    if (curMember.isWay())
+    {
+      itineraryData.insertRow(insPos, curMember.getWay(), curMember.getRole());
       if (insPos >= 0)
-	itineraryTable.addRowSelectionInterval(startPos, insPos-1);
-      
+        ++insPos;
+    }
+      }
+      if (insPos >= 0)
+    itineraryTable.addRowSelectionInterval(startPos, insPos-1);
+
       itineraryData.cleanupGaps();
       rebuildWays();
@@ -1426,13 +1426,13 @@
     {
       if (mainDataSet == null)
-	return;
-      
+    return;
+
       stoplistTable.clearSelection();
-      
+
       for (int i = 0; i < stoplistData.getRowCount(); ++i)
       {
-	if ((stoplistData.nodes.elementAt(i) != null) &&
-	      (mainDataSet.isSelected(stoplistData.nodes.elementAt(i))))
-	  stoplistTable.addRowSelectionInterval(i, i);
+    if ((stoplistData.nodes.elementAt(i) != null) &&
+          (mainDataSet.isSelected(stoplistData.nodes.elementAt(i))))
+      stoplistTable.addRowSelectionInterval(i, i);
       }
     }
@@ -1442,21 +1442,21 @@
       if (stoplistTable.getSelectedRowCount() > 0)
       {
-	for (int i = 0; i < stoplistData.getRowCount(); ++i)
-	{
-	  if (stoplistTable.isRowSelected(i))
-	  {
-	    stoplistData.nodes.elementAt(i).visit(box);
-	  }
-	}
+    for (int i = 0; i < stoplistData.getRowCount(); ++i)
+    {
+      if (stoplistTable.isRowSelected(i))
+      {
+        stoplistData.nodes.elementAt(i).visit(box);
+      }
+    }
       }
       else
       {
-	for (int i = 0; i < stoplistData.getRowCount(); ++i)
-	{
-	  stoplistData.nodes.elementAt(i).visit(box);
-	}
+    for (int i = 0; i < stoplistData.getRowCount(); ++i)
+    {
+      stoplistData.nodes.elementAt(i).visit(box);
+    }
       }
       if (box.getBounds() == null)
-	return;
+    return;
       box.enlargeBoundingBox();
       Main.map.mapView.recalculateCenterScale(box);
@@ -1469,26 +1469,26 @@
       if (stoplistTable.getSelectedRowCount() > 0)
       {
-	for (int i = 0; i < stoplistData.getRowCount(); ++i)
-	{
-	  if (stoplistTable.isRowSelected(i))
-	  {
-	    mainDataSet.addSelected(stoplistData.nodes.elementAt(i));
-	    
-	    RelationMember markedNode = new RelationMember
-		((String)(stoplistData.getValueAt(i, 1)), stoplistData.nodes.elementAt(i));
-	    markedNodes.addElement(markedNode);
-	  }
-	}
+    for (int i = 0; i < stoplistData.getRowCount(); ++i)
+    {
+      if (stoplistTable.isRowSelected(i))
+      {
+        mainDataSet.addSelected(stoplistData.nodes.elementAt(i));
+
+        RelationMember markedNode = new RelationMember
+        ((String)(stoplistData.getValueAt(i, 1)), stoplistData.nodes.elementAt(i));
+        markedNodes.addElement(markedNode);
+      }
+    }
       }
       else
       {
-	for (int i = 0; i < stoplistData.getRowCount(); ++i)
-	{
-	  mainDataSet.addSelected(stoplistData.nodes.elementAt(i));
-	    
-	  RelationMember markedNode = new RelationMember
-	      ((String)(stoplistData.getValueAt(i, 1)), stoplistData.nodes.elementAt(i));
-	  markedNodes.addElement(markedNode);
-	}
+    for (int i = 0; i < stoplistData.getRowCount(); ++i)
+    {
+      mainDataSet.addSelected(stoplistData.nodes.elementAt(i));
+
+      RelationMember markedNode = new RelationMember
+          ((String)(stoplistData.getValueAt(i, 1)), stoplistData.nodes.elementAt(i));
+      markedNodes.addElement(markedNode);
+    }
       }
     }
@@ -1499,41 +1499,41 @@
       TreeSet<Node> addedNodes = new TreeSet<Node>();
       if (mainDataSet == null)
-	return;
-      
+    return;
+
       while (relIter.hasNext())
       {
-	RelationMember curMember = relIter.next();
-	if ((curMember.isNode()) && (mainDataSet.isSelected(curMember.getNode())))
-	{
-	  stoplistData.insertRow(insPos, curMember.getNode(), curMember.getRole());
-	  if (insPos >= 0)
-	    ++insPos;
-	  
-	  addedNodes.add(curMember.getNode());
-	}
-      }
-      
+    RelationMember curMember = relIter.next();
+    if ((curMember.isNode()) && (mainDataSet.isSelected(curMember.getNode())))
+    {
+      stoplistData.insertRow(insPos, curMember.getNode(), curMember.getRole());
+      if (insPos >= 0)
+        ++insPos;
+
+      addedNodes.add(curMember.getNode());
+    }
+      }
+
       Collection<Node> selectedNodes = mainDataSet.getSelectedNodes();
       Iterator<Node> nodeIter = selectedNodes.iterator();
-      
+
       while (nodeIter.hasNext())
       {
-	Node curMember = nodeIter.next();
-	if (!(addedNodes.contains(curMember)))
-	{
-	  stoplistData.insertRow(insPos, curMember, "");
-	  if (insPos >= 0)
-	    ++insPos;
-	}
-      }
-      
+    Node curMember = nodeIter.next();
+    if (!(addedNodes.contains(curMember)))
+    {
+      stoplistData.insertRow(insPos, curMember, "");
+      if (insPos >= 0)
+        ++insPos;
+    }
+      }
+
       if ((insPos > 0) && (insPos < stoplistData.getRowCount()))
       {
-	while ((insPos < stoplistData.getRowCount())
-		       && (stoplistData.nodes.elementAt(insPos) == null))
-	  ++insPos;
-	stoplistTable.removeRowSelectionInterval(0, stoplistData.getRowCount()-1);
-	if (insPos < stoplistData.getRowCount())
-	  stoplistTable.addRowSelectionInterval(insPos, insPos);
+    while ((insPos < stoplistData.getRowCount())
+               && (stoplistData.nodes.elementAt(insPos) == null))
+      ++insPos;
+    stoplistTable.removeRowSelectionInterval(0, stoplistData.getRowCount()-1);
+    if (insPos < stoplistData.getRowCount())
+      stoplistTable.addRowSelectionInterval(insPos, insPos);
       }
 
@@ -1544,11 +1544,11 @@
       for (int i = stoplistData.getRowCount()-1; i >=0; --i)
       {
-	if (stoplistTable.isRowSelected(i))
-	{
-	  stoplistData.nodes.removeElementAt(i);
-	  stoplistData.removeRow(i);
-	}
-      }
-    
+    if (stoplistTable.isRowSelected(i))
+    {
+      stoplistData.nodes.removeElementAt(i);
+      stoplistData.removeRow(i);
+    }
+      }
+
       rebuildNodes();
     }
@@ -1560,37 +1560,37 @@
       for (int i = 0; i < itineraryData.getRowCount(); ++i)
       {
-	if (itineraryData.ways.elementAt(i) != null)
-	{
-	  Way way = itineraryData.ways.elementAt(i);
-	  if (!(way.isIncomplete()))
-	  {
-	    if ("backward".equals((String)(itineraryData.getValueAt(i, 1))))
-	    {
-	      for (int j = way.getNodesCount()-2; j >= 0; --j)
-	      {
-		SegmentMetric sm = new SegmentMetric
-		    (way.getNode(j+1).getCoor().lat(), way.getNode(j+1).getCoor().lon(),
-		     way.getNode(j).getCoor().lat(), way.getNode(j).getCoor().lon());
-		segmentMetrics.add(sm);
-	      }
-	    }
-	    else
-	    {
-	      for (int j = 0; j < way.getNodesCount()-1; ++j)
-	      {
-		SegmentMetric sm = new SegmentMetric
-		    (way.getNode(j).getCoor().lat(), way.getNode(j).getCoor().lon(),
-		     way.getNode(j+1).getCoor().lat(), way.getNode(j+1).getCoor().lon());
-		segmentMetrics.add(sm);
-	      }
-	    }
-	  }
-	}
-	else
-	{
-	  segmentMetrics.add(null);
-	}
-      }
-      
+    if (itineraryData.ways.elementAt(i) != null)
+    {
+      Way way = itineraryData.ways.elementAt(i);
+      if (!(way.isIncomplete()))
+      {
+        if ("backward".equals((String)(itineraryData.getValueAt(i, 1))))
+        {
+          for (int j = way.getNodesCount()-2; j >= 0; --j)
+          {
+        SegmentMetric sm = new SegmentMetric
+            (way.getNode(j+1).getCoor().lat(), way.getNode(j+1).getCoor().lon(),
+             way.getNode(j).getCoor().lat(), way.getNode(j).getCoor().lon());
+        segmentMetrics.add(sm);
+          }
+        }
+        else
+        {
+          for (int j = 0; j < way.getNodesCount()-1; ++j)
+          {
+        SegmentMetric sm = new SegmentMetric
+            (way.getNode(j).getCoor().lat(), way.getNode(j).getCoor().lon(),
+             way.getNode(j+1).getCoor().lat(), way.getNode(j+1).getCoor().lon());
+        segmentMetrics.add(sm);
+          }
+        }
+      }
+    }
+    else
+    {
+      segmentMetrics.add(null);
+    }
+      }
+
       Vector< StopReference > srm = new Vector< StopReference >();
       int insPos = stoplistTable.getSelectedRow();
@@ -1599,73 +1599,73 @@
         // Determine for each member its position on the itinerary: position means here the
         // point on the itinerary that has minimal distance to the coor
-	for (int i = stoplistData.getRowCount()-1; i >= 0; --i)
-	{
-	  if (stoplistTable.isRowSelected(i))
-	  {
-	    StopReference sr = detectMinDistance
-		(stoplistData.nodes.elementAt(i), segmentMetrics,
-		 cbRight.isSelected(), cbLeft.isSelected());
-	    if (sr != null)
-	    {
-	      if (sr.distance <
-			 Double.parseDouble(tfSuggestStopsLimit.getText()) * 9.0 / 1000000.0 )
-	      {
-		sr.role = (String)stoplistData.getValueAt(i, 1);
-		srm.addElement(sr);
-	      }
-	      else
-	      {
-		sr.role = (String)stoplistData.getValueAt(i, 1);
-		sr.index = segmentMetrics.size()*2;
-		sr.pos = 0;
-		srm.addElement(sr);
-	      }
-	      
-	      stoplistData.nodes.removeElementAt(i);
-	      stoplistData.removeRow(i);
-	    }
-	  
-	  }
-	}
+    for (int i = stoplistData.getRowCount()-1; i >= 0; --i)
+    {
+      if (stoplistTable.isRowSelected(i))
+      {
+        StopReference sr = detectMinDistance
+        (stoplistData.nodes.elementAt(i), segmentMetrics,
+         cbRight.isSelected(), cbLeft.isSelected());
+        if (sr != null)
+        {
+          if (sr.distance <
+             Double.parseDouble(tfSuggestStopsLimit.getText()) * 9.0 / 1000000.0 )
+          {
+        sr.role = (String)stoplistData.getValueAt(i, 1);
+        srm.addElement(sr);
+          }
+          else
+          {
+        sr.role = (String)stoplistData.getValueAt(i, 1);
+        sr.index = segmentMetrics.size()*2;
+        sr.pos = 0;
+        srm.addElement(sr);
+          }
+
+          stoplistData.nodes.removeElementAt(i);
+          stoplistData.removeRow(i);
+        }
+
+      }
+    }
       }
       else
       {
-	// Determine for each member its position on the itinerary: position means here the
+    // Determine for each member its position on the itinerary: position means here the
         // point on the itinerary that has minimal distance to the coor
-	for (int i = stoplistData.getRowCount()-1; i >= 0; --i)
-	{
-	  StopReference sr = detectMinDistance
-	      (stoplistData.nodes.elementAt(i), segmentMetrics,
-	       cbRight.isSelected(), cbLeft.isSelected());
-	  if (sr != null)
-	  {
-	    if (sr.distance <
-		       Double.parseDouble(tfSuggestStopsLimit.getText()) * 9.0 / 1000000.0 )
-	    {
-	      sr.role = (String)stoplistData.getValueAt(i, 1);
-	      srm.addElement(sr);
-	    }
-	    else
-	    {
-	      sr.role = (String)stoplistData.getValueAt(i, 1);
-	      sr.index = segmentMetrics.size()*2;
-	      sr.pos = 0;
-	      srm.addElement(sr);
-	    }
-	  }
-	}
-      
-	stoplistData.clear();
+    for (int i = stoplistData.getRowCount()-1; i >= 0; --i)
+    {
+      StopReference sr = detectMinDistance
+          (stoplistData.nodes.elementAt(i), segmentMetrics,
+           cbRight.isSelected(), cbLeft.isSelected());
+      if (sr != null)
+      {
+        if (sr.distance <
+               Double.parseDouble(tfSuggestStopsLimit.getText()) * 9.0 / 1000000.0 )
+        {
+          sr.role = (String)stoplistData.getValueAt(i, 1);
+          srm.addElement(sr);
+        }
+        else
+        {
+          sr.role = (String)stoplistData.getValueAt(i, 1);
+          sr.index = segmentMetrics.size()*2;
+          sr.pos = 0;
+          srm.addElement(sr);
+        }
+      }
+    }
+
+    stoplistData.clear();
       }
 
       Collections.sort(srm);
-      
+
       for (int i = 0; i < srm.size(); ++i)
       {
-	stoplistData.insertRow(insPos, srm.elementAt(i).node, srm.elementAt(i).role);
-	if (insPos >= 0)
-	  ++insPos;
-      }
-      
+    stoplistData.insertRow(insPos, srm.elementAt(i).node, srm.elementAt(i).role);
+    if (insPos >= 0)
+      ++insPos;
+      }
+
       rebuildNodes();
     }
@@ -1674,32 +1674,32 @@
       Vector<RelationMember> itemsToReflect = new Vector<RelationMember>();
       int insPos = stoplistTable.getSelectedRow();
-      
+
       if (stoplistTable.getSelectedRowCount() > 0)
       {
-	for (int i = stoplistData.getRowCount()-1; i >=0; --i)
-	{
-	  if (stoplistTable.isRowSelected(i))
-	  {
-	    String role = (String)(stoplistData.getValueAt(i, 1));
-	    RelationMember markedNode = new RelationMember
-		(role, stoplistData.nodes.elementAt(i));
-	    itemsToReflect.addElement(markedNode);
-	    
-	    stoplistData.nodes.removeElementAt(i);
-	    stoplistData.removeRow(i);
-	  }
-	}
+    for (int i = stoplistData.getRowCount()-1; i >=0; --i)
+    {
+      if (stoplistTable.isRowSelected(i))
+      {
+        String role = (String)(stoplistData.getValueAt(i, 1));
+        RelationMember markedNode = new RelationMember
+        (role, stoplistData.nodes.elementAt(i));
+        itemsToReflect.addElement(markedNode);
+
+        stoplistData.nodes.removeElementAt(i);
+        stoplistData.removeRow(i);
+      }
+    }
       }
       else
       {
-	for (int i = stoplistData.getRowCount()-1; i >=0; --i)
-	{
-	  String role = (String)(stoplistData.getValueAt(i, 1));
-	  RelationMember markedNode = new RelationMember
-	      (role, stoplistData.nodes.elementAt(i));
-	  itemsToReflect.addElement(markedNode);
-	}
-	
-	stoplistData.clear();
+    for (int i = stoplistData.getRowCount()-1; i >=0; --i)
+    {
+      String role = (String)(stoplistData.getValueAt(i, 1));
+      RelationMember markedNode = new RelationMember
+          (role, stoplistData.nodes.elementAt(i));
+      itemsToReflect.addElement(markedNode);
+    }
+
+    stoplistData.clear();
       }
 
@@ -1708,15 +1708,15 @@
       while (relIter.hasNext())
       {
-	RelationMember curMember = relIter.next();
-	if (curMember.isNode())
-	{
-	  stoplistData.insertRow(insPos, curMember.getNode(), curMember.getRole());
-	  if (insPos >= 0)
-	    ++insPos;
-	}
-      }
+    RelationMember curMember = relIter.next();
+    if (curMember.isNode())
+    {
+      stoplistData.insertRow(insPos, curMember.getNode(), curMember.getRole());
       if (insPos >= 0)
-	stoplistTable.addRowSelectionInterval(startPos, insPos-1);
-      
+        ++insPos;
+    }
+      }
+      if (insPos >= 0)
+    stoplistTable.addRowSelectionInterval(startPos, insPos-1);
+
       rebuildNodes();
     }
@@ -1728,37 +1728,37 @@
       for (int i = 0; i < itineraryData.getRowCount(); ++i)
       {
-	if (itineraryData.ways.elementAt(i) != null)
-	{
-	  Way way = itineraryData.ways.elementAt(i);
-	  if (!(way.isIncomplete()))
-	  {
-	    if ("backward".equals((String)(itineraryData.getValueAt(i, 1))))
-	    {
-	      for (int j = way.getNodesCount()-2; j >= 0; --j)
-	      {
-		SegmentMetric sm = new SegmentMetric
-		    (way.getNode(j+1).getCoor().lat(), way.getNode(j+1).getCoor().lon(),
-		     way.getNode(j).getCoor().lat(), way.getNode(j).getCoor().lon());
-		segmentMetrics.add(sm);
-	      }
-	    }
-	    else
-	    {
-	      for (int j = 0; j < way.getNodesCount()-1; ++j)
-	      {
-		SegmentMetric sm = new SegmentMetric
-		    (way.getNode(j).getCoor().lat(), way.getNode(j).getCoor().lon(),
-		     way.getNode(j+1).getCoor().lat(), way.getNode(j+1).getCoor().lon());
-		segmentMetrics.add(sm);
-	      }
-	    }
-	  }
-	}
-	else
-	{
-	  segmentMetrics.add(null);
-	}
-      }
-      
+    if (itineraryData.ways.elementAt(i) != null)
+    {
+      Way way = itineraryData.ways.elementAt(i);
+      if (!(way.isIncomplete()))
+      {
+        if ("backward".equals((String)(itineraryData.getValueAt(i, 1))))
+        {
+          for (int j = way.getNodesCount()-2; j >= 0; --j)
+          {
+        SegmentMetric sm = new SegmentMetric
+            (way.getNode(j+1).getCoor().lat(), way.getNode(j+1).getCoor().lon(),
+             way.getNode(j).getCoor().lat(), way.getNode(j).getCoor().lon());
+        segmentMetrics.add(sm);
+          }
+        }
+        else
+        {
+          for (int j = 0; j < way.getNodesCount()-1; ++j)
+          {
+        SegmentMetric sm = new SegmentMetric
+            (way.getNode(j).getCoor().lat(), way.getNode(j).getCoor().lon(),
+             way.getNode(j+1).getCoor().lat(), way.getNode(j+1).getCoor().lon());
+        segmentMetrics.add(sm);
+          }
+        }
+      }
+    }
+    else
+    {
+      segmentMetrics.add(null);
+    }
+      }
+
       Vector< StopReference > srm = new Vector< StopReference >();
       // Determine for each member its position on the itinerary: position means here the
@@ -1767,64 +1767,64 @@
       if (mainDataSet != null)
       {
-	String stopKey = "";
-	String stopValue = "";
-	if ("bus".equals(currentRoute.get("route")))
-	{
-	  stopKey = "highway";
-	  stopValue = "bus_stop";
-	}
-	else if ("trolleybus".equals(currentRoute.get("route")))
-	{
-	  stopKey = "highway";
-	  stopValue = "bus_stop";
-	}
-	else if ("tram".equals(currentRoute.get("route")))
-	{
-	  stopKey = "railway";
-	  stopValue = "tram_stop";
-	}
-	else if ("light_rail".equals(currentRoute.get("route")))
-	{
-	  stopKey = "railway";
-	  stopValue = "station";
-	}
-	else if ("subway".equals(currentRoute.get("route")))
-	{
-	  stopKey = "railway";
-	  stopValue = "station";
-	}
-	else if ("rail".equals(currentRoute.get("route")))
-	{
-	  stopKey = "railway";
-	  stopValue = "station";
-	}
-
-	Collection< Node > nodeCollection = mainDataSet.getNodes();
-	Iterator< Node > nodeIter = nodeCollection.iterator();
-	while (nodeIter.hasNext())
-	{
-	  Node currentNode = nodeIter.next();
-	  if (!currentNode.isUsable())
-	    continue;
-	  if (stopValue.equals(currentNode.get(stopKey)))
-	  {
-	    StopReference sr = detectMinDistance
-		(currentNode, segmentMetrics,
-		 cbRight.isSelected(), cbLeft.isSelected());
-	    if ((sr != null) && (sr.distance < 
-			Double.parseDouble(tfSuggestStopsLimit.getText()) * 9.0 / 1000000.0 ))
-	      srm.addElement(sr);
-	  }
-	}
+    String stopKey = "";
+    String stopValue = "";
+    if ("bus".equals(currentRoute.get("route")))
+    {
+      stopKey = "highway";
+      stopValue = "bus_stop";
+    }
+    else if ("trolleybus".equals(currentRoute.get("route")))
+    {
+      stopKey = "highway";
+      stopValue = "bus_stop";
+    }
+    else if ("tram".equals(currentRoute.get("route")))
+    {
+      stopKey = "railway";
+      stopValue = "tram_stop";
+    }
+    else if ("light_rail".equals(currentRoute.get("route")))
+    {
+      stopKey = "railway";
+      stopValue = "station";
+    }
+    else if ("subway".equals(currentRoute.get("route")))
+    {
+      stopKey = "railway";
+      stopValue = "station";
+    }
+    else if ("rail".equals(currentRoute.get("route")))
+    {
+      stopKey = "railway";
+      stopValue = "station";
+    }
+
+    Collection< Node > nodeCollection = mainDataSet.getNodes();
+    Iterator< Node > nodeIter = nodeCollection.iterator();
+    while (nodeIter.hasNext())
+    {
+      Node currentNode = nodeIter.next();
+      if (!currentNode.isUsable())
+        continue;
+      if (stopValue.equals(currentNode.get(stopKey)))
+      {
+        StopReference sr = detectMinDistance
+        (currentNode, segmentMetrics,
+         cbRight.isSelected(), cbLeft.isSelected());
+        if ((sr != null) && (sr.distance <
+            Double.parseDouble(tfSuggestStopsLimit.getText()) * 9.0 / 1000000.0 ))
+          srm.addElement(sr);
+      }
+    }
       }
       else
       {
-	JOptionPane.showMessageDialog(null, "There exists no dataset."
-	    + " Try to download data from the server or open an OSM file.",
+    JOptionPane.showMessageDialog(null, "There exists no dataset."
+        + " Try to download data from the server or open an OSM file.",
      "No data found", JOptionPane.ERROR_MESSAGE);
-      
-	System.out.println("Public Transport: RoutePattern: No data found");
-      }
-      
+
+    System.out.println("Public Transport: RoutePattern: No data found");
+      }
+
       for (int i = 0; i < stoplistData.getRowCount(); ++i)
       {
@@ -1832,11 +1832,11 @@
 
       Collections.sort(srm);
-      
+
       stoplistData.clear();
       for (int i = 0; i < srm.size(); ++i)
       {
-	stoplistData.addRow(srm.elementAt(i).node, srm.elementAt(i).role);
-      }
-      
+    stoplistData.addRow(srm.elementAt(i).node, srm.elementAt(i).role);
+      }
+
       rebuildNodes();
     }
@@ -1844,15 +1844,15 @@
     {
       refreshData();
-      
+
       jDialog.setLocationRelativeTo(frame);
       jDialog.setVisible(true);
     }
   }
-  
+
   private void refreshData() {
     Relation copy = currentRoute;
     relsListModel.clear();
     currentRoute = copy;
-	
+
     DataSet mainDataSet = Main.main.getCurrentDataSet();
     if (mainDataSet != null)
@@ -1861,42 +1861,42 @@
       Collection< Relation > relCollection = mainDataSet.getRelations();
       Iterator< Relation > relIter = relCollection.iterator();
-      
+
       while (relIter.hasNext())
       {
-	Relation currentRel = relIter.next();
-	if (!currentRel.isDeleted())
-	{
-	  String routeVal = currentRel.get("route");
-	  if ("bus".equals(routeVal))
-	    relRefs.add(new RouteReference(currentRel));
-	  else if ("trolleybus".equals(routeVal))
-	    relRefs.add(new RouteReference(currentRel));
-	  else if ("tram".equals(routeVal))
-	    relRefs.add(new RouteReference(currentRel));
-	  else if ("light_rail".equals(routeVal))
-	    relRefs.add(new RouteReference(currentRel));
-	  else if ("subway".equals(routeVal))
-	    relRefs.add(new RouteReference(currentRel));
-	  else if ("rail".equals(routeVal))
-	    relRefs.add(new RouteReference(currentRel));
-	}
-      }
-      
+    Relation currentRel = relIter.next();
+    if (!currentRel.isDeleted())
+    {
+      String routeVal = currentRel.get("route");
+      if ("bus".equals(routeVal))
+        relRefs.add(new RouteReference(currentRel));
+      else if ("trolleybus".equals(routeVal))
+        relRefs.add(new RouteReference(currentRel));
+      else if ("tram".equals(routeVal))
+        relRefs.add(new RouteReference(currentRel));
+      else if ("light_rail".equals(routeVal))
+        relRefs.add(new RouteReference(currentRel));
+      else if ("subway".equals(routeVal))
+        relRefs.add(new RouteReference(currentRel));
+      else if ("rail".equals(routeVal))
+        relRefs.add(new RouteReference(currentRel));
+    }
+      }
+
       Collections.sort(relRefs);
 
       Iterator< RouteReference > iter = relRefs.iterator();
       while (iter.hasNext())
-	relsListModel.addElement(iter.next());
+    relsListModel.addElement(iter.next());
     }
     else
     {
       JOptionPane.showMessageDialog(null, "There exists no dataset."
-	  + " Try to download data from the server or open an OSM file.",
+      + " Try to download data from the server or open an OSM file.",
    "No data found", JOptionPane.ERROR_MESSAGE);
-      
+
       System.out.println("Public Transport: No data found");
     }
   }
-  
+
   //Rebuild ways in the relation currentRoute
   public static void rebuildWays() {
@@ -1907,5 +1907,5 @@
     {
       if (iter.next().isWay())
-	iter.remove();
+    iter.remove();
     }
     for (int i = 0; i < itineraryData.getRowCount(); ++i)
@@ -1913,13 +1913,13 @@
       if (itineraryData.ways.elementAt(i) != null)
       {
-	RelationMember member = new RelationMember
-	    ((String)(itineraryData.getValueAt(i, 1)),
-	     itineraryData.ways.elementAt(i));
-	members.add(member);
+    RelationMember member = new RelationMember
+        ((String)(itineraryData.getValueAt(i, 1)),
+         itineraryData.ways.elementAt(i));
+    members.add(member);
       }
     }
     currentRoute.setMembers(members);
   }
-  
+
   //Rebuild nodes in the relation currentRoute
   private void rebuildNodes() {
@@ -1929,5 +1929,5 @@
       if (currentRoute.getMember(i).isNode())
       {
-	currentRoute.removeMember(i);
+    currentRoute.removeMember(i);
       }
     }
@@ -1935,9 +1935,9 @@
     {
       RelationMember member = new RelationMember
-	  ((String)(stoplistData.getValueAt(i, 1)), stoplistData.nodes.elementAt(i));
+      ((String)(stoplistData.getValueAt(i, 1)), stoplistData.nodes.elementAt(i));
       currentRoute.addMember(member);
     }
   }
-  
+
   private void addWayToSortingData
       (Way way, TreeMap<Node, LinkedList<RelationMember> > frontNodes,
@@ -1947,8 +1947,8 @@
     if (way.getNodesCount() < 1)
       return;
-    
+
     Node firstNode = way.getNode(0);
     Node lastNode = way.getNode(way.getNodesCount() - 1);
-    
+
     if (frontNodes.get(firstNode) != null)
     {
@@ -1956,47 +1956,47 @@
       list.addFirst(new RelationMember("backward", way));
       frontNodes.remove(firstNode);
-      
+
       Node lastListNode = null;
       if ("backward".equals(list.getLast().getRole()))
-	lastListNode = list.getLast().getWay().getNode(0);
+    lastListNode = list.getLast().getWay().getNode(0);
       else
-	lastListNode = list.getLast().getWay().getNode
-	    (list.getLast().getWay().getNodesCount() - 1);
+    lastListNode = list.getLast().getWay().getNode
+        (list.getLast().getWay().getNodesCount() - 1);
       if (lastNode.equals(lastListNode))
       {
-	backNodes.remove(lastListNode);
-	loops.add(list);
+    backNodes.remove(lastListNode);
+    loops.add(list);
       }
       else if (frontNodes.get(lastNode) != null)
       {
-	backNodes.remove(lastListNode);
-	LinkedList<RelationMember> listToAppend = frontNodes.get(lastNode);
-	Iterator<RelationMember> memberIter = list.iterator();
-	while (memberIter.hasNext())
-	{
-	  RelationMember member = memberIter.next();
-	  if ("backward".equals(member.getRole()))
-	    listToAppend.addFirst(new RelationMember("forward", member.getWay()));
-	  else
-	    listToAppend.addFirst(new RelationMember("backward", member.getWay()));
-	}
-	frontNodes.remove(lastNode);
-	frontNodes.put(lastListNode, listToAppend);
+    backNodes.remove(lastListNode);
+    LinkedList<RelationMember> listToAppend = frontNodes.get(lastNode);
+    Iterator<RelationMember> memberIter = list.iterator();
+    while (memberIter.hasNext())
+    {
+      RelationMember member = memberIter.next();
+      if ("backward".equals(member.getRole()))
+        listToAppend.addFirst(new RelationMember("forward", member.getWay()));
+      else
+        listToAppend.addFirst(new RelationMember("backward", member.getWay()));
+    }
+    frontNodes.remove(lastNode);
+    frontNodes.put(lastListNode, listToAppend);
       }
       else if (backNodes.get(lastNode) != null)
       {
-	backNodes.remove(lastListNode);
-	LinkedList<RelationMember> listToAppend = backNodes.get(lastNode);
-	Iterator<RelationMember> memberIter = list.iterator();
-	while (memberIter.hasNext())
-	{
-	  RelationMember member = memberIter.next();
-	  listToAppend.addLast(member);
-	}
-	backNodes.remove(lastNode);
-	backNodes.put(lastListNode, listToAppend);
+    backNodes.remove(lastListNode);
+    LinkedList<RelationMember> listToAppend = backNodes.get(lastNode);
+    Iterator<RelationMember> memberIter = list.iterator();
+    while (memberIter.hasNext())
+    {
+      RelationMember member = memberIter.next();
+      listToAppend.addLast(member);
+    }
+    backNodes.remove(lastNode);
+    backNodes.put(lastListNode, listToAppend);
       }
       else
-	frontNodes.put(lastNode, list);
+    frontNodes.put(lastNode, list);
     }
     else if (backNodes.get(firstNode) != null)
@@ -2005,47 +2005,47 @@
       list.addLast(new RelationMember("forward", way));
       backNodes.remove(firstNode);
-      
+
       Node firstListNode = null;
       if ("backward".equals(list.getFirst().getRole()))
-	firstListNode = list.getFirst().getWay().getNode
-	    (list.getFirst().getWay().getNodesCount() - 1);
+    firstListNode = list.getFirst().getWay().getNode
+        (list.getFirst().getWay().getNodesCount() - 1);
       else
-	firstListNode = list.getFirst().getWay().getNode(0);
+    firstListNode = list.getFirst().getWay().getNode(0);
       if (lastNode.equals(firstListNode))
       {
-	frontNodes.remove(firstListNode);
-	loops.add(list);
+    frontNodes.remove(firstListNode);
+    loops.add(list);
       }
       else if (frontNodes.get(lastNode) != null)
       {
-	frontNodes.remove(firstListNode);
-	LinkedList<RelationMember> listToAppend = frontNodes.get(lastNode);
-	ListIterator<RelationMember> memberIter = list.listIterator(list.size());
-	while (memberIter.hasPrevious())
-	{
-	  RelationMember member = memberIter.previous();
-	  listToAppend.addFirst(member);
-	}
-	frontNodes.remove(lastNode);
-	frontNodes.put(firstListNode, listToAppend);
+    frontNodes.remove(firstListNode);
+    LinkedList<RelationMember> listToAppend = frontNodes.get(lastNode);
+    ListIterator<RelationMember> memberIter = list.listIterator(list.size());
+    while (memberIter.hasPrevious())
+    {
+      RelationMember member = memberIter.previous();
+      listToAppend.addFirst(member);
+    }
+    frontNodes.remove(lastNode);
+    frontNodes.put(firstListNode, listToAppend);
       }
       else if (backNodes.get(lastNode) != null)
       {
-	frontNodes.remove(firstListNode);
-	LinkedList<RelationMember> listToAppend = backNodes.get(lastNode);
-	ListIterator<RelationMember> memberIter = list.listIterator(list.size());
-	while (memberIter.hasPrevious())
-	{
-	  RelationMember member = memberIter.previous();
-	  if ("backward".equals(member.getRole()))
-	    listToAppend.addLast(new RelationMember("forward", member.getWay()));
-	  else
-	    listToAppend.addLast(new RelationMember("backward", member.getWay()));
-	}
-	backNodes.remove(lastNode);
-	backNodes.put(firstListNode, listToAppend);
-      }
+    frontNodes.remove(firstListNode);
+    LinkedList<RelationMember> listToAppend = backNodes.get(lastNode);
+    ListIterator<RelationMember> memberIter = list.listIterator(list.size());
+    while (memberIter.hasPrevious())
+    {
+      RelationMember member = memberIter.previous();
+      if ("backward".equals(member.getRole()))
+        listToAppend.addLast(new RelationMember("forward", member.getWay()));
       else
-	backNodes.put(lastNode, list);
+        listToAppend.addLast(new RelationMember("backward", member.getWay()));
+    }
+    backNodes.remove(lastNode);
+    backNodes.put(firstListNode, listToAppend);
+      }
+      else
+    backNodes.put(lastNode, list);
     }
     else if (frontNodes.get(lastNode) != null)
@@ -2071,5 +2071,5 @@
     }
   }
-  
+
   private void routesSelectionChanged() {
     int selectedPos = relsList.getAnchorSelectionIndex();
@@ -2081,10 +2081,10 @@
       tabbedPane.setEnabledAt(3, true);
       tabbedPane.setEnabledAt(4, true);
-      
+
       //Prepare Tags
       requiredTagsData.readRelation(currentRoute);
       commonTagsData.readRelation(currentRoute);
       otherTagsData.readRelation(currentRoute, tagBlacklist);
-      
+
       //Prepare Itinerary
       itineraryData.clear();
@@ -2092,5 +2092,5 @@
       Iterator<RelationMember> relIter = relMembers.iterator();
       fillItineraryTable(relIter, 0, -1);
-    
+
       //Prepare Stoplist
       stoplistData.clear();
@@ -2108,5 +2108,5 @@
     }
   }
-  
+
   private void fillItineraryTable
       (Iterator<RelationMember> relIter, long lastNodeId, int insPos) {
@@ -2116,12 +2116,12 @@
       if (curMember.isWay())
       {
-	itineraryData.insertRow(insPos, curMember.getWay(), curMember.getRole());
-	if (insPos >= 0)
-	  ++insPos;
+    itineraryData.insertRow(insPos, curMember.getWay(), curMember.getRole());
+    if (insPos >= 0)
+      ++insPos;
       }
     }
     itineraryData.cleanupGaps();
   }
-  
+
   private void fillStoplistTable
       (Iterator<RelationMember> relIter, int insPos) {
@@ -2131,11 +2131,11 @@
       if (curMember.isNode())
       {
-	stoplistData.insertRow(insPos, curMember.getNode(), curMember.getRole());
-	if (insPos >= 0)
-	  ++insPos;
+    stoplistData.insertRow(insPos, curMember.getNode(), curMember.getRole());
+    if (insPos >= 0)
+      ++insPos;
       }
     }
   }
-  
+
   private StopReference detectMinDistance
       (Node node, Vector< SegmentMetric > segmentMetrics,
@@ -2146,5 +2146,5 @@
     double lat = node.getCoor().lat();
     double lon = node.getCoor().lon();
-	
+
     int curIndex = -2;
     double angleLat = 100.0;
@@ -2155,79 +2155,79 @@
       curIndex += 2;
       SegmentMetric sm = iter.next();
-	  
+
       if (sm == null)
       {
-	angleLat = 100.0;
-	angleLon = 200.0;
-	    
-	continue;
-      }
-	  
+    angleLat = 100.0;
+    angleLon = 200.0;
+
+    continue;
+      }
+
       double curPosition = (lat - sm.aLat)*sm.d1 + (lon - sm.aLon)*sm.d2;
-	  
+
       if (curPosition < 0)
       {
-	if (angleLat <= 90.0)
-	{
-	  double lastSegAngle = Math.atan2(angleLat - sm.aLat, angleLon - sm.aLon);
-	  double segAngle = Math.atan2(sm.d1, -sm.o1);
-	  double vertexAngle = Math.atan2(lat - sm.aLat, lon - sm.aLon);
-
-	  boolean vertexOnSeg = (vertexAngle == segAngle) ||
-	      (vertexAngle == lastSegAngle);
-	  boolean vertexOnTheLeft = (!vertexOnSeg) &&
-	      (((lastSegAngle > vertexAngle) && (vertexAngle > segAngle))
-	      || ((vertexAngle > segAngle) && (segAngle > lastSegAngle))
-	      || ((segAngle > lastSegAngle) && (lastSegAngle > vertexAngle)));
-
-	  double currentDistance = Math.sqrt((lat - sm.aLat)*(lat - sm.aLat)
-		+ (lon - sm.aLon)*(lon - sm.aLon)
-		*Math.cos(sm.aLat * Math.PI/180.0)*Math.cos(sm.aLat * Math.PI/180.0));
-	  curPosition = vertexAngle - segAngle;
-	  if (vertexOnTheLeft)
-	    curPosition = -curPosition;
-	  if (curPosition < 0)
-	    curPosition += 2*Math.PI;
-	  if ((Math.abs(currentDistance) < distance)
-	    && (((!vertexOnTheLeft) && (rhsPossible))
-		|| ((vertexOnTheLeft) && (lhsPossible))
-	       || (vertexOnSeg)))
-	  {
-	    distance = Math.abs(currentDistance);
-	    minIndex = curIndex-1;
-	    position = curPosition;
-	  }
-	}
-	angleLat = 100.0;
-	angleLon = 200.0;
+    if (angleLat <= 90.0)
+    {
+      double lastSegAngle = Math.atan2(angleLat - sm.aLat, angleLon - sm.aLon);
+      double segAngle = Math.atan2(sm.d1, -sm.o1);
+      double vertexAngle = Math.atan2(lat - sm.aLat, lon - sm.aLon);
+
+      boolean vertexOnSeg = (vertexAngle == segAngle) ||
+          (vertexAngle == lastSegAngle);
+      boolean vertexOnTheLeft = (!vertexOnSeg) &&
+          (((lastSegAngle > vertexAngle) && (vertexAngle > segAngle))
+          || ((vertexAngle > segAngle) && (segAngle > lastSegAngle))
+          || ((segAngle > lastSegAngle) && (lastSegAngle > vertexAngle)));
+
+      double currentDistance = Math.sqrt((lat - sm.aLat)*(lat - sm.aLat)
+        + (lon - sm.aLon)*(lon - sm.aLon)
+        *Math.cos(sm.aLat * Math.PI/180.0)*Math.cos(sm.aLat * Math.PI/180.0));
+      curPosition = vertexAngle - segAngle;
+      if (vertexOnTheLeft)
+        curPosition = -curPosition;
+      if (curPosition < 0)
+        curPosition += 2*Math.PI;
+      if ((Math.abs(currentDistance) < distance)
+        && (((!vertexOnTheLeft) && (rhsPossible))
+        || ((vertexOnTheLeft) && (lhsPossible))
+           || (vertexOnSeg)))
+      {
+        distance = Math.abs(currentDistance);
+        minIndex = curIndex-1;
+        position = curPosition;
+      }
+    }
+    angleLat = 100.0;
+    angleLon = 200.0;
       }
       else if (curPosition > sm.length)
       {
-	angleLat = sm.aLat;
-	angleLon = sm.aLon;
+    angleLat = sm.aLat;
+    angleLon = sm.aLon;
       }
       else
       {
-	double currentDistance = (lat - sm.aLat)*sm.o1 + (lon - sm.aLon)*sm.o2;
-	if ((Math.abs(currentDistance) < distance)
-		    && (((currentDistance >= 0) && (rhsPossible))
-		    || ((currentDistance <= 0) && (lhsPossible))))
-	{
-	  distance = Math.abs(currentDistance);
-	  minIndex = curIndex;
-	  position = curPosition;
-	}
-	    
-	angleLat = 100.0;
-	angleLon = 200.0;
-      }
-    }
-	
+    double currentDistance = (lat - sm.aLat)*sm.o1 + (lon - sm.aLon)*sm.o2;
+    if ((Math.abs(currentDistance) < distance)
+            && (((currentDistance >= 0) && (rhsPossible))
+            || ((currentDistance <= 0) && (lhsPossible))))
+    {
+      distance = Math.abs(currentDistance);
+      minIndex = curIndex;
+      position = curPosition;
+    }
+
+    angleLat = 100.0;
+    angleLon = 200.0;
+      }
+    }
+
     if (minIndex == -1)
       return new StopReference(segmentMetrics.size()*2, 0, 180.0, node.get("name"),
-			       "", node);
-	  
+                   "", node);
+
     return new StopReference(minIndex, position, distance, node.get("name"),
-			     "", node);
+                 "", node);
   }
 }
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/SettingsStoptypeCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/SettingsStoptypeCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/SettingsStoptypeCommand.java	(revision 23192)
@@ -21,15 +21,15 @@
       railway = node.get("railway");
     }
-    
+
     public Node node;
     public String highway;
     public String railway;
   };
-  
+
   private Vector< HighwayRailway > oldStrings = null;
   private WaypointTableModel waypointTM = null;
   private DefaultListModel tracksListModel = null;
   private String type = null;
-  
+
   public SettingsStoptypeCommand(StopImporterAction controller)
   {
@@ -39,5 +39,5 @@
     oldStrings = new Vector< HighwayRailway >();
   }
-  
+
   public boolean executeCommand()
   {
@@ -47,7 +47,7 @@
       if ((Node)waypointTM.nodes.elementAt(i) != null)
       {
-	Node node = (Node)waypointTM.nodes.elementAt(i);
-	oldStrings.add(new HighwayRailway(node));
-	StopImporterAction.setTagsWrtType(node, type);
+    Node node = (Node)waypointTM.nodes.elementAt(i);
+    oldStrings.add(new HighwayRailway(node));
+    StopImporterAction.setTagsWrtType(node, type);
       }
     }
@@ -57,15 +57,15 @@
       for (int i = 0; i < track.stoplistTM.getRowCount(); ++i)
       {
-	if (track.stoplistTM.nodeAt(i) != null)
-	{
-	  Node node = track.stoplistTM.nodeAt(i);
-	  oldStrings.add(new HighwayRailway(node));
-	  StopImporterAction.setTagsWrtType(node, type);
-	}
+    if (track.stoplistTM.nodeAt(i) != null)
+    {
+      Node node = track.stoplistTM.nodeAt(i);
+      oldStrings.add(new HighwayRailway(node));
+      StopImporterAction.setTagsWrtType(node, type);
+    }
       }
     }
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -77,5 +77,5 @@
     }
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -83,9 +83,9 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
     return new JLabel("public_transport.Settings.ChangeStoptype");
   }
-  
+
 };
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java	(revision 23192)
@@ -62,5 +62,5 @@
 
 public class StopImporterAction extends JosmAction
-{ 
+{
   private static StopImporterDialog dialog = null;
   private static DefaultListModel tracksListModel = null;
@@ -69,9 +69,9 @@
   private static WaypointTableModel waypointTM = null;
   public boolean inEvent = false;
-  
+
   public StopImporterAction()
   {
     super(tr("Create Stops from GPX ..."), null,
-	  tr("Create Stops from a GPX file"), null, true);
+      tr("Create Stops from a GPX file"), null, true);
   }
 
@@ -80,5 +80,5 @@
     return waypointTM;
   }
-  
+
   public StopImporterDialog getDialog()
   {
@@ -92,5 +92,5 @@
     return tracksListModel;
   }
-  
+
   public TrackReference getCurrentTrack()
   {
@@ -101,8 +101,8 @@
   {
     DataSet mainDataSet = Main.main.getCurrentDataSet();
-    
+
     if (dialog == null)
       dialog = new StopImporterDialog(this);
-    
+
     dialog.setVisible(true);
 
@@ -112,19 +112,19 @@
       if (curDir.equals(""))
       {
-	curDir = ".";
+    curDir = ".";
       }
       JFileChooser fc = new JFileChooser(new File(curDir));
-      fc.setDialogTitle("Select GPX file");  
+      fc.setDialogTitle("Select GPX file");
       fc.setMultiSelectionEnabled(false);
-      
+
       int answer = fc.showOpenDialog(Main.parent);
       if (answer != JFileChooser.APPROVE_OPTION)
-	return;
-      
+    return;
+
       if (!fc.getCurrentDirectory().getAbsolutePath().equals(curDir))
-	Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
-      
+    Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
+
       importData(fc.getSelectedFile());
-      
+
       refreshData();
     }
@@ -132,20 +132,20 @@
     {
       if ((!inEvent) && (dialog.gpsTimeStartValid()) && (currentTrack != null))
-	Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
+    Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
     }
     else if ("stopImporter.settingsStopwatchStart".equals(event.getActionCommand()))
     {
       if ((!inEvent) && (dialog.stopwatchStartValid()) && (currentTrack != null))
-	Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
+    Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
     }
     else if ("stopImporter.settingsTimeWindow".equals(event.getActionCommand()))
     {
       if (currentTrack != null)
-	currentTrack.timeWindow = dialog.getTimeWindow();
+    currentTrack.timeWindow = dialog.getTimeWindow();
     }
     else if ("stopImporter.settingsThreshold".equals(event.getActionCommand()))
     {
       if (currentTrack != null)
-	currentTrack.threshold = dialog.getThreshold();
+    currentTrack.threshold = dialog.getThreshold();
     }
     else if ("stopImporter.settingsSuggestStops".equals(event.getActionCommand()))
@@ -189,31 +189,31 @@
   private void importData(final File file)
   {
-    try 
+    try
     {
       InputStream is;
       if (file.getName().endsWith(".gpx.gz"))
-	is = new GZIPInputStream(new FileInputStream(file));
+    is = new GZIPInputStream(new FileInputStream(file));
       else
-	is = new FileInputStream(file);
+    is = new FileInputStream(file);
       // Workaround for SAX BOM bug
       // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6206835
       if (!((is.read() == 0xef) && (is.read() == 0xbb) && (is.read() == 0xbf)))
       {
-	is.close();
-	if (file.getName().endsWith(".gpx.gz"))
-	  is = new GZIPInputStream(new FileInputStream(file));
-	else
-	  is = new FileInputStream(file);
+    is.close();
+    if (file.getName().endsWith(".gpx.gz"))
+      is = new GZIPInputStream(new FileInputStream(file));
+    else
+      is = new FileInputStream(file);
       }
       final GpxReader r = new GpxReader(is);
       final boolean parsedProperly = r.parse(true);
       data = r.data;
-      
+
       if (!parsedProperly)
       {
-	JOptionPane.showMessageDialog(null, tr("Error occured while parsing gpx file {0}. Only part of the file will be available", file.getName()));
-      }
-    }
-    catch (FileNotFoundException e) 
+    JOptionPane.showMessageDialog(null, tr("Error occured while parsing gpx file {0}. Only part of the file will be available", file.getName()));
+      }
+    }
+    catch (FileNotFoundException e)
     {
       e.printStackTrace();
@@ -241,20 +241,20 @@
       while (trackIter.hasNext())
       {
-	GpxTrack track = trackIter.next();
-	trackRefs.add(new TrackReference(track, this));
-      }
-      
+    GpxTrack track = trackIter.next();
+    trackRefs.add(new TrackReference(track, this));
+      }
+
       Collections.sort(trackRefs);
 
       Iterator< TrackReference > iter = trackRefs.iterator();
       while (iter.hasNext())
-	tracksListModel.addElement(iter.next());
-      
+    tracksListModel.addElement(iter.next());
+
       waypointTM = new WaypointTableModel(this);
       Iterator< WayPoint > waypointIter = data.waypoints.iterator();
       while (waypointIter.hasNext())
       {
-	WayPoint waypoint = waypointIter.next();
-	waypointTM.addRow(waypoint);
+    WayPoint waypoint = waypointIter.next();
+    waypointTM.addRow(waypoint);
       }
       dialog.setWaypointsTableModel(waypointTM);
@@ -265,9 +265,9 @@
       (null, "The GPX file contained no tracks or waypoints.", "No data found",
        JOptionPane.ERROR_MESSAGE);
-      
+
       System.out.println("Public Transport: StopImporter: No data found");
     }
   }
-  
+
   public void tracksSelectionChanged(int selectedPos)
   {
@@ -276,10 +276,10 @@
       currentTrack = ((TrackReference)tracksListModel.elementAt(selectedPos));
       dialog.setTrackValid(true);
-      
+
       //Prepare Settings
       dialog.setSettings
-	  (currentTrack.gpsSyncTime, currentTrack.stopwatchStart,
-	   currentTrack.timeWindow, currentTrack.threshold);
-      
+      (currentTrack.gpsSyncTime, currentTrack.stopwatchStart,
+       currentTrack.timeWindow, currentTrack.threshold);
+
       //Prepare Stoplist
       dialog.setStoplistTableModel
@@ -297,5 +297,5 @@
     return createNode(latLon, dialog.getStoptype(), name);
   }
-    
+
   public static Node createNode(LatLon latLon, String type, String name)
   {
@@ -306,9 +306,9 @@
     {
       JOptionPane.showMessageDialog(null, "There exists no dataset."
-	  + " Try to download data from the server or open an OSM file.",
+      + " Try to download data from the server or open an OSM file.",
    "No data found", JOptionPane.ERROR_MESSAGE);
-      
+
       System.out.println("Public Transport: StopInserter: No data found");
-	    
+
       return null;
     }
@@ -333,5 +333,5 @@
       node.put("railway", "station");
   }
-  
+
   /* returns a collection of all selected lines or
      a collection of all lines otherwise */
@@ -343,10 +343,10 @@
     {
       for (int i = 0; i < selectedLines.length; ++i)
-	consideredLines.add(selectedLines[i]);
+    consideredLines.add(selectedLines[i]);
     }
     else
     {
       for (int i = 0; i < table.getRowCount(); ++i)
-	consideredLines.add(new Integer(i));
+    consideredLines.add(new Integer(i));
     }
     return consideredLines;
@@ -358,15 +358,15 @@
     if (Main.main.getCurrentDataSet() == null)
       return;
-      
+
     table.clearSelection();
-      
+
     for (int i = 0; i < table.getRowCount(); ++i)
     {
       if ((nodes.elementAt(i) != null) &&
-	   (Main.main.getCurrentDataSet().isSelected(nodes.elementAt(i))))
-	table.addRowSelectionInterval(i, i);
-    }
-  }
-  
+       (Main.main.getCurrentDataSet().isSelected(nodes.elementAt(i))))
+    table.addRowSelectionInterval(i, i);
+    }
+  }
+
   /* shows the nodes that correspond to the marked lines in the table.
      If no lines are marked in the table, show all nodes from the vector */
@@ -379,5 +379,5 @@
       int j = consideredLines.elementAt(i);
       if (nodes.elementAt(j) != null)
-	nodes.elementAt(j).visit(box);
+    nodes.elementAt(j).visit(box);
     }
     if (box.getBounds() == null)
@@ -386,5 +386,5 @@
     Main.map.mapView.recalculateCenterScale(box);
   }
-  
+
   /* marks the nodes that correspond to the marked lines in the table.
   If no lines are marked in the table, mark all nodes from the vector */
@@ -398,12 +398,12 @@
       int j = consideredLines.elementAt(i);
       if (nodes.elementAt(j) != null)
-	Main.main.getCurrentDataSet().addSelected(nodes.elementAt(j));
-    }
-  }
-  
+    Main.main.getCurrentDataSet().addSelected(nodes.elementAt(j));
+    }
+  }
+
   public static String timeOf(double t)
   {
     t -= Math.floor(t/24/60/60)*24*60*60;
-    
+
     int hour = (int)Math.floor(t/60/60);
     t -=  Math.floor(t/60/60)*60*60;
@@ -411,16 +411,16 @@
     t -=  Math.floor(t/60)*60;
     double second = t;
-    
+
     Format format = new DecimalFormat("00");
     Format formatS = new DecimalFormat("00.###");
     return (format.format(hour) + ":" + format.format(minute) + ":"
-	+ formatS.format(second));
-  }
-  
+    + formatS.format(second));
+  }
+
   public Action getFocusWaypointNameAction()
   {
     return new FocusWaypointNameAction();
   }
-  
+
   public Action getFocusWaypointShelterAction(String shelter)
   {
@@ -434,12 +434,12 @@
       public void actionPerformed(ActionEvent e)
       {
-	JTable table = dialog.getWaypointsTable();
-	int row = table.getEditingRow();
-	if (row < 0)
-	  return;
-	table.clearSelection();
-	table.addRowSelectionInterval(row, row);
-	Main.main.undoRedo.add
-	    (new WaypointsDisableCommand(StopImporterAction.this));
+    JTable table = dialog.getWaypointsTable();
+    int row = table.getEditingRow();
+    if (row < 0)
+      return;
+    table.clearSelection();
+    table.addRowSelectionInterval(row, row);
+    Main.main.undoRedo.add
+        (new WaypointsDisableCommand(StopImporterAction.this));
       }
     };
@@ -450,5 +450,5 @@
     return new FocusTrackStoplistNameAction();
   }
-  
+
   public Action getFocusTrackStoplistShelterAction(String shelter)
   {
@@ -462,12 +462,12 @@
       public void actionPerformed(ActionEvent e)
       {
-	JTable table = dialog.getStoplistTable();
-	int row = table.getEditingRow();
-	if (row < 0)
-	  return;
-	table.clearSelection();
-	table.addRowSelectionInterval(row, row);
-	Main.main.undoRedo.add
-	    (new TrackStoplistDeleteCommand(StopImporterAction.this));
+    JTable table = dialog.getStoplistTable();
+    int row = table.getEditingRow();
+    if (row < 0)
+      return;
+    table.clearSelection();
+    table.addRowSelectionInterval(row, row);
+    Main.main.undoRedo.add
+        (new TrackStoplistDeleteCommand(StopImporterAction.this));
       }
     };
@@ -483,27 +483,27 @@
       int row = table.getEditingRow();
       if (row < 0)
-	row = 0;
+    row = 0;
       waypointTM.inEvent = true;
       if (table.getCellEditor() != null)
       {
-	if (!table.getCellEditor().stopCellEditing())
-	  table.getCellEditor().cancelCellEditing();
+    if (!table.getCellEditor().stopCellEditing())
+      table.getCellEditor().cancelCellEditing();
       }
       table.editCellAt(row, 1);
       table.getCellEditor().getTableCellEditorComponent
-	  (table, "", true, row, 1);
+      (table, "", true, row, 1);
       waypointTM.inEvent = false;
     }
   };
-  
+
   private class FocusWaypointShelterAction extends AbstractAction
   {
     private String defaultShelter = null;
-    
+
     public FocusWaypointShelterAction(String defaultShelter)
     {
       this.defaultShelter = defaultShelter;
     }
-    
+
     public void actionPerformed(ActionEvent e)
     {
@@ -513,10 +513,10 @@
       int row = table.getEditingRow();
       if (row < 0)
-	row = 0;
+    row = 0;
       waypointTM.inEvent = true;
       if (table.getCellEditor() != null)
       {
-	if (!table.getCellEditor().stopCellEditing())
-	  table.getCellEditor().cancelCellEditing();
+    if (!table.getCellEditor().stopCellEditing())
+      table.getCellEditor().cancelCellEditing();
       }
       table.editCellAt(row, 2);
@@ -526,5 +526,5 @@
     }
   };
-  
+
   private class FocusTrackStoplistNameAction extends AbstractAction
   {
@@ -536,10 +536,10 @@
       int row = table.getEditingRow();
       if (row < 0)
-	row = 0;
+    row = 0;
       currentTrack.inEvent = true;
       if (table.getCellEditor() != null)
       {
-	if (!table.getCellEditor().stopCellEditing())
-	  table.getCellEditor().cancelCellEditing();
+    if (!table.getCellEditor().stopCellEditing())
+      table.getCellEditor().cancelCellEditing();
       }
       table.editCellAt(row, 1);
@@ -549,14 +549,14 @@
     }
   };
-  
+
   private class FocusTrackStoplistShelterAction extends AbstractAction
   {
     private String defaultShelter = null;
-    
+
     public FocusTrackStoplistShelterAction(String defaultShelter)
     {
       this.defaultShelter = defaultShelter;
     }
-    
+
     public void actionPerformed(ActionEvent e)
     {
@@ -566,10 +566,10 @@
       int row = table.getEditingRow();
       if (row < 0)
-	row = 0;
+    row = 0;
       currentTrack.inEvent = true;
       if (table.getCellEditor() != null)
       {
-	if (!table.getCellEditor().stopCellEditing())
-	  table.getCellEditor().cancelCellEditing();
+    if (!table.getCellEditor().stopCellEditing())
+      table.getCellEditor().cancelCellEditing();
       }
       table.editCellAt(row, 2);
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterDialog.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterDialog.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterDialog.java	(revision 23192)
@@ -63,5 +63,5 @@
 
 public class StopImporterDialog
-{  
+{
   private JDialog jDialog = null;
   private JTabbedPane tabbedPane = null;
@@ -74,5 +74,5 @@
   private JTable stoplistTable = null;
   private JTable waypointTable = null;
-  
+
   public StopImporterDialog(StopImporterAction controller)
   {
@@ -93,5 +93,5 @@
     tabbedPane.setEnabledAt(3, true);
     jDialog.add(tabbedPane);
-      
+
     //Tracks Tab
     JPanel contentPane = tabTracks;
@@ -99,7 +99,7 @@
     GridBagConstraints layoutCons = new GridBagConstraints();
     contentPane.setLayout(gridbag);
-      
+
     JLabel label = new JLabel("Tracks in this GPX file:");
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 0;
@@ -110,5 +110,5 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     DefaultListModel tracksListModel = controller.getTracksListModel();
     tracksList = new JList(tracksListModel);
@@ -118,5 +118,5 @@
     tracksList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     tracksList.addListSelectionListener(new TracksLSL(controller));
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 1;
@@ -124,8 +124,8 @@
     layoutCons.weightx = 1.0;
     layoutCons.weighty = 1.0;
-    layoutCons.fill = GridBagConstraints.BOTH;      
+    layoutCons.fill = GridBagConstraints.BOTH;
     gridbag.setConstraints(rpListSP, layoutCons);
     contentPane.add(rpListSP);
-      
+
     //Settings Tab
     contentPane = tabSettings;
@@ -133,7 +133,7 @@
     layoutCons = new GridBagConstraints();
     contentPane.setLayout(gridbag);
-      
+
     label = new JLabel("Type of stops to add");
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 0;
@@ -144,5 +144,5 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-    
+
     cbStoptype = new JComboBox();
     cbStoptype.setEditable(false);
@@ -154,5 +154,5 @@
     cbStoptype.setActionCommand("stopImporter.settingsStoptype");
     cbStoptype.addActionListener(controller);
-    
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 1;
@@ -163,7 +163,7 @@
     gridbag.setConstraints(cbStoptype, layoutCons);
     contentPane.add(cbStoptype);
-      
+
     label = new JLabel("Time on your GPS device");
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 2;
@@ -174,9 +174,9 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     tfGPSTimeStart = new JTextField("00:00:00", 15);
     tfGPSTimeStart.setActionCommand("stopImporter.settingsGPSTimeStart");
     tfGPSTimeStart.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 3;
@@ -187,7 +187,7 @@
     gridbag.setConstraints(tfGPSTimeStart, layoutCons);
     contentPane.add(tfGPSTimeStart);
-      
+
     label = new JLabel("HH:MM:SS.sss");
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 3;
@@ -198,7 +198,7 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-            
+
     label = new JLabel("Time on your stopwatch");
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 4;
@@ -209,9 +209,9 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     tfStopwatchStart = new JTextField("00:00:00", 15);
     tfStopwatchStart.setActionCommand("stopImporter.settingsStopwatchStart");
     tfStopwatchStart.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 5;
@@ -222,7 +222,7 @@
     gridbag.setConstraints(tfStopwatchStart, layoutCons);
     contentPane.add(tfStopwatchStart);
-      
+
     label = new JLabel("HH:MM:SS.sss");
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 5;
@@ -233,7 +233,7 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     label = new JLabel("Time window");
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 6;
@@ -244,9 +244,9 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     tfTimeWindow = new JTextField("15", 4);
     tfTimeWindow.setActionCommand("stopImporter.settingsTimeWindow");
     tfTimeWindow.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 7;
@@ -257,7 +257,7 @@
     gridbag.setConstraints(tfTimeWindow, layoutCons);
     contentPane.add(tfTimeWindow);
-      
+
     label = new JLabel("seconds");
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 7;
@@ -268,7 +268,7 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     label = new JLabel("Move Threshold");
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 8;
@@ -279,9 +279,9 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     tfThreshold = new JTextField("20", 4);
     tfThreshold.setActionCommand("stopImporter.settingsThreshold");
     tfThreshold.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 9;
@@ -292,7 +292,7 @@
     gridbag.setConstraints(tfThreshold, layoutCons);
     contentPane.add(tfThreshold);
-      
+
     label = new JLabel("meters");
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 9;
@@ -303,9 +303,9 @@
     gridbag.setConstraints(label, layoutCons);
     contentPane.add(label);
-      
+
     JButton bSuggestStops = new JButton("Suggest Stops");
     bSuggestStops.setActionCommand("stopImporter.settingsSuggestStops");
     bSuggestStops.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 10;
@@ -316,5 +316,5 @@
     gridbag.setConstraints(bSuggestStops, layoutCons);
     contentPane.add(bSuggestStops);
-      
+
     //Stops Tab
     contentPane = tabStops;
@@ -325,29 +325,29 @@
         (KeyStroke.getKeyStroke("alt N"), "stopImporter.focusName");
     contentPane.getActionMap().put
-	("stopImporter.focusName", controller.getFocusTrackStoplistNameAction());
+    ("stopImporter.focusName", controller.getFocusTrackStoplistNameAction());
     contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt S"), "stopImporter.focusShelterYes");
     contentPane.getActionMap().put
-	("stopImporter.focusShelterYes",
-	 controller.getFocusTrackStoplistShelterAction("yes"));
+    ("stopImporter.focusShelterYes",
+     controller.getFocusTrackStoplistShelterAction("yes"));
     contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt T"), "stopImporter.focusShelterNo");
     contentPane.getActionMap().put
-	("stopImporter.focusShelterNo",
-	 controller.getFocusTrackStoplistShelterAction("no"));
+    ("stopImporter.focusShelterNo",
+     controller.getFocusTrackStoplistShelterAction("no"));
     contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt U"), "stopImporter.focusShelterImplicit");
     contentPane.getActionMap().put
-	("stopImporter.focusShelterImplicit",
-	 controller.getFocusTrackStoplistShelterAction("implicit"));
+    ("stopImporter.focusShelterImplicit",
+     controller.getFocusTrackStoplistShelterAction("implicit"));
     contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt D"), "stopImporter.stoplistDelete");
     contentPane.getActionMap().put
-	("stopImporter.stoplistDelete",
-	 controller.getFocusStoplistDeleteAction());
-      
+    ("stopImporter.stoplistDelete",
+     controller.getFocusStoplistDeleteAction());
+
     stoplistTable = new JTable();
     JScrollPane tableSP = new JScrollPane(stoplistTable);
-    
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 0;
@@ -358,9 +358,9 @@
     gridbag.setConstraints(tableSP, layoutCons);
     contentPane.add(tableSP);
-      
+
     JButton bFind = new JButton("Find");
     bFind.setActionCommand("stopImporter.stoplistFind");
     bFind.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 1;
@@ -371,9 +371,9 @@
     gridbag.setConstraints(bFind, layoutCons);
     contentPane.add(bFind);
-      
+
     JButton bShow = new JButton("Show");
     bShow.setActionCommand("stopImporter.stoplistShow");
     bShow.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 2;
@@ -384,9 +384,9 @@
     gridbag.setConstraints(bShow, layoutCons);
     contentPane.add(bShow);
-      
+
     JButton bMark = new JButton("Mark");
     bMark.setActionCommand("stopImporter.stoplistMark");
     bMark.addActionListener(controller);
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 1;
@@ -398,9 +398,9 @@
     gridbag.setConstraints(bMark, layoutCons);
     contentPane.add(bMark);
-      
+
     JButton bDetach = new JButton("Detach");
     bDetach.setActionCommand("stopImporter.stoplistDetach");
     bDetach.addActionListener(controller);
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 2;
@@ -412,9 +412,9 @@
     gridbag.setConstraints(bDetach, layoutCons);
     contentPane.add(bDetach);
-      
+
     JButton bAdd = new JButton("Add");
     bAdd.setActionCommand("stopImporter.stoplistAdd");
     bAdd.addActionListener(controller);
-      
+
     layoutCons.gridx = 2;
     layoutCons.gridy = 1;
@@ -426,9 +426,9 @@
     gridbag.setConstraints(bAdd, layoutCons);
     contentPane.add(bAdd);
-      
+
     JButton bDelete = new JButton("Delete");
     bDelete.setActionCommand("stopImporter.stoplistDelete");
     bDelete.addActionListener(controller);
-      
+
     layoutCons.gridx = 2;
     layoutCons.gridy = 2;
@@ -439,9 +439,9 @@
     gridbag.setConstraints(bDelete, layoutCons);
     contentPane.add(bDelete);
-      
+
     JButton bSort = new JButton("Sort");
     bSort.setActionCommand("stopImporter.stoplistSort");
     bSort.addActionListener(controller);
-      
+
     layoutCons.gridx = 3;
     layoutCons.gridy = 1;
@@ -453,5 +453,5 @@
     gridbag.setConstraints(bSort, layoutCons);
     contentPane.add(bSort);
-      
+
     //Waypoints Tab
     contentPane = tabWaypoints;
@@ -462,29 +462,29 @@
         (KeyStroke.getKeyStroke("alt N"), "stopImporter.focusName");
     contentPane.getActionMap().put
-	("stopImporter.focusName", controller.getFocusWaypointNameAction());
+    ("stopImporter.focusName", controller.getFocusWaypointNameAction());
     contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt S"), "stopImporter.focusShelterYes");
     contentPane.getActionMap().put
-	("stopImporter.focusShelterYes",
-	 controller.getFocusWaypointShelterAction("yes"));
+    ("stopImporter.focusShelterYes",
+     controller.getFocusWaypointShelterAction("yes"));
     contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt T"), "stopImporter.focusShelterNo");
     contentPane.getActionMap().put
-	("stopImporter.focusShelterNo",
-	 controller.getFocusWaypointShelterAction("no"));
+    ("stopImporter.focusShelterNo",
+     controller.getFocusWaypointShelterAction("no"));
     contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt U"), "stopImporter.focusShelterImplicit");
     contentPane.getActionMap().put
-	("stopImporter.focusShelterImplicit",
-	 controller.getFocusWaypointShelterAction("implicit"));
+    ("stopImporter.focusShelterImplicit",
+     controller.getFocusWaypointShelterAction("implicit"));
     contentPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put
         (KeyStroke.getKeyStroke("alt D"), "stopImporter.waypointsDelete");
     contentPane.getActionMap().put
-	("stopImporter.waypointsDelete",
-	 controller.getFocusWaypointDeleteAction());
-      
+    ("stopImporter.waypointsDelete",
+     controller.getFocusWaypointDeleteAction());
+
     waypointTable = new JTable();
     tableSP = new JScrollPane(waypointTable);
-    
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 0;
@@ -495,9 +495,9 @@
     gridbag.setConstraints(tableSP, layoutCons);
     contentPane.add(tableSP);
-      
+
     bFind = new JButton("Find");
     bFind.setActionCommand("stopImporter.waypointsFind");
     bFind.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 1;
@@ -508,9 +508,9 @@
     gridbag.setConstraints(bFind, layoutCons);
     contentPane.add(bFind);
-      
+
     bShow = new JButton("Show");
     bShow.setActionCommand("stopImporter.waypointsShow");
     bShow.addActionListener(controller);
-      
+
     layoutCons.gridx = 0;
     layoutCons.gridy = 2;
@@ -521,9 +521,9 @@
     gridbag.setConstraints(bShow, layoutCons);
     contentPane.add(bShow);
-      
+
     bMark = new JButton("Mark");
     bMark.setActionCommand("stopImporter.waypointsMark");
     bMark.addActionListener(controller);
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 1;
@@ -535,9 +535,9 @@
     gridbag.setConstraints(bMark, layoutCons);
     contentPane.add(bMark);
-      
+
     bDetach = new JButton("Detach");
     bDetach.setActionCommand("stopImporter.waypointsDetach");
     bDetach.addActionListener(controller);
-      
+
     layoutCons.gridx = 1;
     layoutCons.gridy = 2;
@@ -549,9 +549,9 @@
     gridbag.setConstraints(bDetach, layoutCons);
     contentPane.add(bDetach);
-      
+
     bAdd = new JButton("Enable");
     bAdd.setActionCommand("stopImporter.waypointsAdd");
     bAdd.addActionListener(controller);
-      
+
     layoutCons.gridx = 2;
     layoutCons.gridy = 1;
@@ -563,9 +563,9 @@
     gridbag.setConstraints(bAdd, layoutCons);
     contentPane.add(bAdd);
-      
+
     bDelete = new JButton("Disable");
     bDelete.setActionCommand("stopImporter.waypointsDelete");
     bDelete.addActionListener(controller);
-      
+
     layoutCons.gridx = 2;
     layoutCons.gridy = 2;
@@ -576,19 +576,19 @@
     gridbag.setConstraints(bDelete, layoutCons);
     contentPane.add(bDelete);
-      
+
     jDialog.pack();
     jDialog.setLocationRelativeTo(frame);
   }
-  
+
   public void setTrackValid(boolean valid)
   {
     tabbedPane.setEnabledAt(2, valid);
   }
-  
+
   public void setVisible(boolean visible)
   {
     jDialog.setVisible(visible);
   }
-  
+
   public void setSettings
       (String gpsSyncTime, String stopwatchStart,
@@ -600,10 +600,10 @@
     tfThreshold.setText(Double.toString(threshold));
   }
-  
+
   public String getStoptype()
   {
     return (String)cbStoptype.getSelectedItem();
   }
-  
+
   public boolean gpsTimeStartValid()
   {
@@ -615,20 +615,20 @@
     {
       JOptionPane.showMessageDialog
-	  (null, "Can't parse a time from this string.", "Invalid value",
-	   JOptionPane.ERROR_MESSAGE);
+      (null, "Can't parse a time from this string.", "Invalid value",
+       JOptionPane.ERROR_MESSAGE);
       return false;
     }
   }
-  
+
   public String getGpsTimeStart()
   {
     return tfGPSTimeStart.getText();
   }
-  
+
   public void setGpsTimeStart(String s)
   {
     tfGPSTimeStart.setText(s);
   }
-  
+
   public boolean stopwatchStartValid()
   {
@@ -640,35 +640,35 @@
     {
       JOptionPane.showMessageDialog
-	  (null, "Can't parse a time from this string.", "Invalid value",
-	   JOptionPane.ERROR_MESSAGE);
+      (null, "Can't parse a time from this string.", "Invalid value",
+       JOptionPane.ERROR_MESSAGE);
       return false;
     }
   }
-  
+
   public String getStopwatchStart()
   {
     return tfStopwatchStart.getText();
   }
-  
+
   public void setStopwatchStart(String s)
   {
     tfStopwatchStart.setText(s);
   }
-  
+
   public double getTimeWindow()
   {
     return Double.parseDouble(tfTimeWindow.getText());
   }
-  
+
   public double getThreshold()
   {
     return Double.parseDouble(tfThreshold.getText());
   }
-  
+
   public JTable getStoplistTable()
   {
     return stoplistTable;
   }
-  
+
   public void setStoplistTableModel(TrackStoplistTableModel model)
   {
@@ -680,5 +680,5 @@
     comboBox.addItem("implicit");
     stoplistTable.getColumnModel().getColumn(2)
-	.setCellEditor(new DefaultCellEditor(comboBox));
+    .setCellEditor(new DefaultCellEditor(comboBox));
     int width = stoplistTable.getPreferredSize().width;
     stoplistTable.getColumnModel().getColumn(0).setPreferredWidth((int)(width * 0.4));
@@ -686,10 +686,10 @@
     stoplistTable.getColumnModel().getColumn(2).setPreferredWidth((int)(width * 0.1));
   }
-  
+
   public JTable getWaypointsTable()
   {
     return waypointTable;
   }
-  
+
   public void setWaypointsTableModel(WaypointTableModel model)
   {
@@ -701,5 +701,5 @@
     comboBox.addItem("implicit");
     waypointTable.getColumnModel().getColumn(2)
-	.setCellEditor(new DefaultCellEditor(comboBox));
+    .setCellEditor(new DefaultCellEditor(comboBox));
     int width = waypointTable.getPreferredSize().width;
     waypointTable.getColumnModel().getColumn(0).setPreferredWidth((int)(width * 0.4));
@@ -707,10 +707,10 @@
     waypointTable.getColumnModel().getColumn(2).setPreferredWidth((int)(width * 0.1));
   }
-  
+
   public static double parseTime(String s)
   {
     double result = 0;
     if ((s.charAt(2) != ':') || (s.charAt(2) != ':')
-	 || (s.length() < 8))
+     || (s.length() < 8))
       return -1;
     int hour = Integer.parseInt(s.substring(0, 2));
@@ -718,25 +718,25 @@
     double second = Double.parseDouble(s.substring(6, s.length()));
     if ((hour < 0) || (hour > 23) || (minute < 0) || (minute > 59)
-	 || (second < 0) || (second >= 60.0))
+     || (second < 0) || (second >= 60.0))
       return -1;
     return (second + minute*60 + hour*60*60);
   }
-  
+
   private class TracksLSL implements ListSelectionListener
   {
     StopImporterAction root = null;
-    
+
     public TracksLSL(StopImporterAction sia)
     {
       root = sia;
     }
-    
+
     public void valueChanged(ListSelectionEvent e)
     {
       int selectedPos = tracksList.getAnchorSelectionIndex();
       if (tracksList.isSelectedIndex(selectedPos))
-	root.tracksSelectionChanged(selectedPos);
+    root.tracksSelectionChanged(selectedPos);
       else
-	root.tracksSelectionChanged(-1);
+    root.tracksSelectionChanged(-1);
     }
   };
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackReference.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackReference.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackReference.java	(revision 23192)
@@ -32,5 +32,5 @@
   private StopImporterAction controller = null;
   public boolean inEvent = false;
-    
+
   public TrackReference(GpxTrack track, StopImporterAction controller)
   {
@@ -46,21 +46,21 @@
       while ((siter.hasNext()) && (this.gpsSyncTime == null))
       {
-	Iterator< WayPoint > witer = siter.next().getWayPoints().iterator();
-	if (witer.hasNext())
-	{
-	  this.gpsStartTime = witer.next().getString("time");
-	  if (this.gpsStartTime != null)
-	    this.gpsSyncTime = this.gpsStartTime.substring(11, 19);
-	}
+    Iterator< WayPoint > witer = siter.next().getWayPoints().iterator();
+    if (witer.hasNext())
+    {
+      this.gpsStartTime = witer.next().getString("time");
+      if (this.gpsStartTime != null)
+        this.gpsSyncTime = this.gpsStartTime.substring(11, 19);
+    }
       }
       if (this.gpsSyncTime == null)
       {
-	JOptionPane.showMessageDialog
-	    (null, "The GPX file doesn't contain valid trackpoints. "
-	    + "Please use a GPX file that has trackpoints.", "GPX File Trouble",
+    JOptionPane.showMessageDialog
+        (null, "The GPX file doesn't contain valid trackpoints. "
+        + "Please use a GPX file that has trackpoints.", "GPX File Trouble",
      JOptionPane.ERROR_MESSAGE);
-	  
-	this.gpsStartTime = "1970-01-01T00:00:00Z";
-	this.gpsSyncTime = this.stopwatchStart;
+
+    this.gpsStartTime = "1970-01-01T00:00:00Z";
+    this.gpsSyncTime = this.stopwatchStart;
       }
     }
@@ -70,10 +70,10 @@
     this.threshold = 20;
   }
-  
+
   public GpxTrack getGpxTrack()
   {
     return track;
   }
-    
+
   public int compareTo(TrackReference tr)
   {
@@ -83,10 +83,10 @@
     {
       if (tr_name == null)
-	return -1;
+    return -1;
       return name.compareTo(tr_name);
     }
     return 1;
   }
-    
+
   public String toString()
   {
@@ -96,5 +96,5 @@
     return buf;
   }
-    
+
   public void tableChanged(TableModelEvent e)
   {
@@ -102,16 +102,16 @@
     {
       if (inEvent)
-	return;
-      
+    return;
+
       double time = StopImporterDialog.parseTime
-	    ((String)stoplistTM.getValueAt(e.getFirstRow(), 0));
+        ((String)stoplistTM.getValueAt(e.getFirstRow(), 0));
       if (time < 0)
       {
-	stoplistTM.setValueAt
-	    (stoplistTM.timeAt(e.getFirstRow()), e.getFirstRow(), 0);
-	JOptionPane.showMessageDialog
-	    (null, "Can't parse a time from this string.", "Invalid value",
-	     JOptionPane.ERROR_MESSAGE);
-	return;
+    stoplistTM.setValueAt
+        (stoplistTM.timeAt(e.getFirstRow()), e.getFirstRow(), 0);
+    JOptionPane.showMessageDialog
+        (null, "Can't parse a time from this string.", "Invalid value",
+         JOptionPane.ERROR_MESSAGE);
+    return;
       }
 
@@ -119,8 +119,8 @@
               (this, e.getFirstRow()));
       stoplistTM.setTimeAt
-	  (e.getFirstRow(), (String)stoplistTM.getValueAt(e.getFirstRow(), 0));
+      (e.getFirstRow(), (String)stoplistTM.getValueAt(e.getFirstRow(), 0));
     }
   }
-    
+
   public LatLon computeCoor(double time)
   {
@@ -131,5 +131,5 @@
     double timeDelta = gpsSyncTime - StopImporterDialog.parseTime(stopwatchStart);
     time += timeDelta;
-	
+
     WayPoint wayPoint = null;
     WayPoint lastWayPoint = null;
@@ -142,18 +142,18 @@
       while (witer.hasNext())
       {
-	wayPoint = witer.next();
-	String startTime = wayPoint.getString("time");
-	wayPointTime = StopImporterDialog.parseTime(startTime.substring(11, 19));
-	if (startTime.substring(11, 19).compareTo(gpsStartTime.substring(11, 19)) == -1)
-	  wayPointTime += 24*60*60;
-	if (wayPointTime >= time)
-	  break;
-	lastWayPoint = wayPoint;
-	lastWayPointTime = wayPointTime;
+    wayPoint = witer.next();
+    String startTime = wayPoint.getString("time");
+    wayPointTime = StopImporterDialog.parseTime(startTime.substring(11, 19));
+    if (startTime.substring(11, 19).compareTo(gpsStartTime.substring(11, 19)) == -1)
+      wayPointTime += 24*60*60;
+    if (wayPointTime >= time)
+      break;
+    lastWayPoint = wayPoint;
+    lastWayPointTime = wayPointTime;
       }
       if (wayPointTime >= time)
-	break;
+    break;
     }
-	
+
     double lat = 0;
     if ((wayPointTime == lastWayPointTime) || (lastWayPoint == null))
@@ -161,7 +161,7 @@
     else
       lat = wayPoint.getCoor().lat()
-	  *(time - lastWayPointTime)/(wayPointTime - lastWayPointTime)
-	  + lastWayPoint.getCoor().lat()
-	  *(wayPointTime - time)/(wayPointTime - lastWayPointTime);
+      *(time - lastWayPointTime)/(wayPointTime - lastWayPointTime)
+      + lastWayPoint.getCoor().lat()
+      *(wayPointTime - time)/(wayPointTime - lastWayPointTime);
     double lon = 0;
     if ((wayPointTime == lastWayPointTime) || (lastWayPoint == null))
@@ -169,11 +169,11 @@
     else
       lon = wayPoint.getCoor().lon()
-	  *(time - lastWayPointTime)/(wayPointTime - lastWayPointTime)
-	  + lastWayPoint.getCoor().lon()
-	  *(wayPointTime - time)/(wayPointTime - lastWayPointTime);
-      
+      *(time - lastWayPointTime)/(wayPointTime - lastWayPointTime)
+      + lastWayPoint.getCoor().lon()
+      *(wayPointTime - time)/(wayPointTime - lastWayPointTime);
+
     return new LatLon(lat, lon);
   }
-    
+
   public void relocateNodes()
   {
@@ -182,8 +182,8 @@
       Node node = stoplistTM.nodeAt(i);
       if (node == null)
-	continue;
-	
+    continue;
+
       double time = StopImporterDialog.parseTime
-	    ((String)stoplistTM.getValueAt(i, 0));
+        ((String)stoplistTM.getValueAt(i, 0));
       LatLon latLon = computeCoor(time);
 
@@ -193,5 +193,5 @@
       if (cmd != null)
       {
-	Main.main.undoRedo.add(cmd);
+    Main.main.undoRedo.add(cmd);
       }
     }
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistAddCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistAddCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistAddCommand.java	(revision 23192)
@@ -14,5 +14,5 @@
   private int workingLine;
   private TrackStoplistTableModel stoplistTM = null;
-  
+
   public TrackStoplistAddCommand(StopImporterAction controller)
   {
@@ -20,5 +20,5 @@
     workingLine = controller.getDialog().getStoplistTable().getSelectedRow();
   }
-  
+
   public boolean executeCommand()
   {
@@ -26,5 +26,5 @@
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -34,5 +34,5 @@
     stoplistTM.removeRow(workingLine);
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -40,5 +40,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDeleteCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDeleteCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDeleteCommand.java	(revision 23192)
@@ -21,5 +21,5 @@
       this.shelter = shelter;
     }
-    
+
     public Node node;
     public String time;
@@ -27,9 +27,9 @@
     public String shelter;
   };
-  
+
   private Vector< Integer > workingLines = null;
   private Vector< NodeTimeName > nodesForUndo = null;
   private TrackStoplistTableModel stoplistTM = null;
-  
+
   public TrackStoplistDeleteCommand(StopImporterAction controller)
   {
@@ -37,5 +37,5 @@
     workingLines = new Vector< Integer >();
     nodesForUndo = new Vector< NodeTimeName >();
-    
+
     // use selected lines or all lines if no line is selected
     int[] selectedLines = controller.getDialog().getStoplistTable().getSelectedRows();
@@ -44,5 +44,5 @@
       for (int i = 0; i < selectedLines.length; ++i)
       {
-	workingLines.add(selectedLines[i]);
+    workingLines.add(selectedLines[i]);
       }
     }
@@ -50,8 +50,8 @@
     {
       for (int i = 0; i < stoplistTM.getRowCount(); ++i)
-	workingLines.add(new Integer(i));
+    workingLines.add(new Integer(i));
     }
   }
-  
+
   public boolean executeCommand()
   {
@@ -62,10 +62,10 @@
       Node node = stoplistTM.nodeAt(j);
       nodesForUndo.add(new NodeTimeName
-	  (node, (String)stoplistTM.getValueAt(j, 0),
-	   (String)stoplistTM.getValueAt(j, 1),
-	   (String)stoplistTM.getValueAt(j, 2)));
+      (node, (String)stoplistTM.getValueAt(j, 0),
+       (String)stoplistTM.getValueAt(j, 1),
+       (String)stoplistTM.getValueAt(j, 2)));
       stoplistTM.removeRow(j);
       if (node == null)
-	continue;
+    continue;
       Main.main.getCurrentDataSet().removePrimitive(node);
       node.setDeleted(true);
@@ -73,5 +73,5 @@
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -82,10 +82,10 @@
       stoplistTM.insertRow(j, ntn.node, ntn.time, ntn.name, ntn.shelter);
       if (ntn.node == null)
-	continue;
+    continue;
       ntn.node.setDeleted(false);
       Main.main.getCurrentDataSet().addPrimitive(ntn.node);
     }
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -93,5 +93,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDetachCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDetachCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDetachCommand.java	(revision 23192)
@@ -15,5 +15,5 @@
   private Vector< Node > nodesForUndo = null;
   private TrackStoplistTableModel stoplistTM = null;
-  
+
   public TrackStoplistDetachCommand(StopImporterAction controller)
   {
@@ -21,5 +21,5 @@
     workingLines = new Vector< Integer >();
     nodesForUndo = new Vector< Node >();
-    
+
     // use either selected lines or all lines if no line is selected
     int[] selectedLines = controller.getDialog().getStoplistTable().getSelectedRows();
@@ -28,20 +28,20 @@
     {
       for (int i = 0; i < selectedLines.length; ++i)
-	consideredLines.add(selectedLines[i]);
+    consideredLines.add(selectedLines[i]);
     }
     else
     {
       for (int i = 0; i < stoplistTM.getRowCount(); ++i)
-	consideredLines.add(new Integer(i));
+    consideredLines.add(new Integer(i));
     }
-    
+
     // keep only lines where a node can be added
     for (int i = 0; i < consideredLines.size(); ++i)
     {
       if (stoplistTM.nodeAt(consideredLines.elementAt(i)) != null)
-	workingLines.add(consideredLines.elementAt(i));
+    workingLines.add(consideredLines.elementAt(i));
     }
   }
-  
+
   public boolean executeCommand()
   {
@@ -56,5 +56,5 @@
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -66,5 +66,5 @@
     }
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -72,5 +72,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistNameCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistNameCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistNameCommand.java	(revision 23192)
@@ -22,5 +22,5 @@
   private String shelter = null;
   private LatLon oldLatLon = null;
-  
+
   @SuppressWarnings("unchecked")
   public TrackStoplistNameCommand(TrackReference trackref, int workingLine)
@@ -42,5 +42,5 @@
       this.shelter = null;
   }
-  
+
   public boolean executeCommand()
   {
@@ -69,5 +69,5 @@
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -94,5 +94,5 @@
     trackref.inEvent = false;
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -100,5 +100,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistRelocateCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistRelocateCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistRelocateCommand.java	(revision 23192)
@@ -21,5 +21,5 @@
   private String gpsSyncTime = null;
   private String stopwatchStart = null;
-  
+
   public TrackStoplistRelocateCommand(StopImporterAction controller)
   {
@@ -31,5 +31,5 @@
     this.oldStopwatchStart = currentTrack.stopwatchStart;
   }
-  
+
   public boolean executeCommand()
   {
@@ -40,8 +40,8 @@
       Node node = currentTrack.stoplistTM.nodeAt(i);
       if (node == null)
-	continue;
-	
+    continue;
+
       double time = StopImporterDialog.parseTime
-	    ((String)currentTrack.stoplistTM.getValueAt(i, 0));
+        ((String)currentTrack.stoplistTM.getValueAt(i, 0));
       node.setCoor(currentTrack.computeCoor(time));
     }
@@ -53,8 +53,8 @@
       controller.inEvent = false;
     }
-    
+
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -65,8 +65,8 @@
       Node node = currentTrack.stoplistTM.nodeAt(i);
       if (node == null)
-	continue;
-	
+    continue;
+
       double time = StopImporterDialog.parseTime
-	    ((String)currentTrack.stoplistTM.getValueAt(i, 0));
+        ((String)currentTrack.stoplistTM.getValueAt(i, 0));
       node.setCoor(currentTrack.computeCoor(time));
     }
@@ -79,5 +79,5 @@
     }
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -85,5 +85,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistSortCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistSortCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistSortCommand.java	(revision 23192)
@@ -22,5 +22,5 @@
   private int insPos;
   private String stopwatchStart;
-  
+
   public TrackStoplistSortCommand(StopImporterAction controller)
   {
@@ -29,5 +29,5 @@
     insPos = controller.getDialog().getStoplistTable().getSelectedRow();
     stopwatchStart = controller.getCurrentTrack().stopwatchStart;
-    
+
     // use either selected lines or all lines if no line is selected
     int[] selectedLines = controller.getDialog().getStoplistTable().getSelectedRows();
@@ -35,21 +35,21 @@
     {
       for (int i = 0; i < selectedLines.length; ++i)
-	workingLines.add(selectedLines[i]);
+    workingLines.add(selectedLines[i]);
     }
     else
     {
       for (int i = 0; i < stoplistTM.getRowCount(); ++i)
-	workingLines.add(new Integer(i));
+    workingLines.add(new Integer(i));
     }
   }
-  
+
   @SuppressWarnings("unchecked")
   public boolean executeCommand()
   {
     tableDataModel = (Vector< Vector< Object > >)stoplistTM.getDataVector()
-	.clone();
+    .clone();
     nodes = (Vector< Node >)stoplistTM.getNodes().clone();
     times = (Vector< String >)stoplistTM.getTimes().clone();
-    
+
     Vector< NodeSortEntry > nodesToSort = new Vector< NodeSortEntry >();
     for (int i = workingLines.size()-1; i >= 0; --i)
@@ -57,13 +57,13 @@
       int j = workingLines.elementAt(i).intValue();
       nodesToSort.add(new NodeSortEntry
-	  (stoplistTM.nodeAt(j), (String)stoplistTM.getValueAt(j, 0),
-	    (String)stoplistTM.getValueAt(j, 1),
-	    (String)stoplistTM.getValueAt(j, 2),
-	     StopImporterDialog.parseTime(stopwatchStart)));
+      (stoplistTM.nodeAt(j), (String)stoplistTM.getValueAt(j, 0),
+        (String)stoplistTM.getValueAt(j, 1),
+        (String)stoplistTM.getValueAt(j, 2),
+         StopImporterDialog.parseTime(stopwatchStart)));
       stoplistTM.removeRow(j);
     }
-    
+
     Collections.sort(nodesToSort);
-    
+
     int insPos = this.insPos;
     Iterator< NodeSortEntry > iter = nodesToSort.iterator();
@@ -73,9 +73,9 @@
       stoplistTM.insertRow(insPos, nse.node, nse.time, nse.name, nse.shelter);
       if (insPos >= 0)
-	++insPos;
+    ++insPos;
     }
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -84,5 +84,5 @@
     stoplistTM.setTimes(times);
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -90,10 +90,10 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
     return new JLabel("public_transport.TrackStoplist.Sort");
   }
-  
+
   private class NodeSortEntry implements Comparable< NodeSortEntry >
   {
@@ -103,5 +103,5 @@
     public String shelter = null;
     public double startTime = 0;
-    
+
     public NodeSortEntry
         (Node node, String time, String name, String shelter, double startTime)
@@ -112,21 +112,21 @@
       this.shelter = shelter;
     }
-    
+
     public int compareTo(NodeSortEntry nse)
     {
       double time = StopImporterDialog.parseTime(this.time);
       if (time - startTime > 12*60*60)
-	time -= 24*60*60;
-      
+    time -= 24*60*60;
+
       double nseTime = StopImporterDialog.parseTime(nse.time);
       if (nseTime - startTime > 12*60*60)
-	nseTime -= 24*60*60;
-      
+    nseTime -= 24*60*60;
+
       if (time < nseTime)
-	return -1;
+    return -1;
       else if (time > nseTime)
-	return 1;
+    return 1;
       else
-	return 0;
+    return 0;
     }
   };
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistTableModel.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistTableModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistTableModel.java	(revision 23192)
@@ -14,5 +14,5 @@
   private Vector< String > times = null;
   private static Vector< String > columns = null;
-    
+
   public TrackStoplistTableModel(TrackReference tr)
   {
@@ -26,25 +26,25 @@
     nodes = new Vector< Node >();
     times = new Vector< String >();
-      
+
     setColumnIdentifiers(columns);
     addTableModelListener(tr);
   }
-    
+
   public boolean isCellEditable(int row, int column) {
     return true;
   }
-    
+
   public void addRow(Object[] obj) {
     throw new UnsupportedOperationException();
   }
-    
+
   public void insertRow(int insPos, Object[] obj) {
     throw new UnsupportedOperationException();
   }
-    
+
   public void addRow(String time) {
     insertRow(-1, time);
   }
-    
+
   public void insertRow(int insPos, String time)
   {
@@ -118,5 +118,5 @@
     }
   }
-    
+
   public void clear()
   {
@@ -125,5 +125,5 @@
     super.setRowCount(0);
   }
-    
+
   public void setDataVector(Vector< Vector< Object > > dataVector)
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackSuggestStopsCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackSuggestStopsCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackSuggestStopsCommand.java	(revision 23192)
@@ -29,5 +29,5 @@
   private Vector< Node > nodes = null;
   private Vector< String > times = null;
-  
+
   public TrackSuggestStopsCommand(StopImporterAction controller)
   {
@@ -43,5 +43,5 @@
     segments = controller.getCurrentTrack().getGpxTrack().getSegments();
   }
-  
+
   @SuppressWarnings("unchecked")
   public boolean executeCommand()
@@ -50,13 +50,13 @@
       return false;
     tableDataModel = (Vector< Vector< Object > >)stoplistTM.getDataVector()
-	.clone();
+    .clone();
     nodes = (Vector< Node >)stoplistTM.getNodes().clone();
     times = (Vector< String >)stoplistTM.getTimes().clone();
-    
+
     for (int i = 0; i < stoplistTM.getNodes().size(); ++i)
     {
       Node node = stoplistTM.nodeAt(i);
       if (node == null)
-	continue;
+    continue;
       Main.main.getCurrentDataSet().removePrimitive(node);
       node.setDeleted(true);
@@ -70,8 +70,8 @@
       Iterator< WayPoint > witer = siter.next().getWayPoints().iterator();
       while (witer.hasNext())
-	wayPoints.add(witer.next());
+    wayPoints.add(witer.next());
     }
     Vector< Double > wayPointsDist = new Vector< Double >(wayPoints.size());
-      
+
     int i = 0;
     double time = -48*60*60;
@@ -80,8 +80,8 @@
     {
       if (wayPoints.elementAt(i).getString("time") != null)
-	time = StopImporterDialog.parseTime(wayPoints.elementAt(i)
-	    .getString("time").substring(11,19));
+    time = StopImporterDialog.parseTime(wayPoints.elementAt(i)
+        .getString("time").substring(11,19));
       if (time < dGpsStartTime)
-	time += 24*60*60;
+    time += 24*60*60;
       wayPointsDist.add(Double.valueOf(Double.POSITIVE_INFINITY));
       ++i;
@@ -93,10 +93,10 @@
       while ((j > 0) && (time - timeWindow/2 < time2))
       {
-	--j;
-	if (wayPoints.elementAt(j).getString("time") != null)
-	  time2 = StopImporterDialog.parseTime(wayPoints.elementAt(j)
-	      .getString("time").substring(11,19));
-	if (time2 < dGpsStartTime)
-	  time2 += 24*60*60;
+    --j;
+    if (wayPoints.elementAt(j).getString("time") != null)
+      time2 = StopImporterDialog.parseTime(wayPoints.elementAt(j)
+          .getString("time").substring(11,19));
+    if (time2 < dGpsStartTime)
+      time2 += 24*60*60;
       }
       int k = i + 1;
@@ -104,67 +104,67 @@
       while ((k < wayPoints.size()) && (time + timeWindow/2 > time2))
       {
-	if (wayPoints.elementAt(k).getString("time") != null)
-	  time2 = StopImporterDialog.parseTime(wayPoints.elementAt(k)
-	      .getString("time").substring(11,19));
-	if (time2 < dGpsStartTime)
-	  time2 += 24*60*60;
-	++k;
-      }
-	
+    if (wayPoints.elementAt(k).getString("time") != null)
+      time2 = StopImporterDialog.parseTime(wayPoints.elementAt(k)
+          .getString("time").substring(11,19));
+    if (time2 < dGpsStartTime)
+      time2 += 24*60*60;
+    ++k;
+      }
+
       if (j < k)
       {
-	double dist = 0;
-	LatLon latLonI = wayPoints.elementAt(i).getCoor();
-	for (int l = j; l < k; ++l)
-	{
-	  double distL = latLonI.greatCircleDistance(wayPoints.elementAt(l).getCoor());
-	  if (distL > dist)
-	    dist = distL;
-	}
-	wayPointsDist.add(Double.valueOf(dist));
+    double dist = 0;
+    LatLon latLonI = wayPoints.elementAt(i).getCoor();
+    for (int l = j; l < k; ++l)
+    {
+      double distL = latLonI.greatCircleDistance(wayPoints.elementAt(l).getCoor());
+      if (distL > dist)
+        dist = distL;
+    }
+    wayPointsDist.add(Double.valueOf(dist));
       }
       else
-	wayPointsDist.add(Double.valueOf(Double.POSITIVE_INFINITY));
-	
+    wayPointsDist.add(Double.valueOf(Double.POSITIVE_INFINITY));
+
       if (wayPoints.elementAt(i).getString("time") != null)
-	time = StopImporterDialog.parseTime(wayPoints.elementAt(i)
-	    .getString("time").substring(11,19));
+    time = StopImporterDialog.parseTime(wayPoints.elementAt(i)
+        .getString("time").substring(11,19));
       if (time < dGpsStartTime)
-	time += 24*60*60;
+    time += 24*60*60;
       ++i;
     }
-      
+
     LatLon lastStopCoor = null;
     for (i = 1; i < wayPoints.size()-1; ++i)
     {
       if (wayPointsDist.elementAt(i).doubleValue() >= threshold)
-	continue;
+    continue;
       if ((wayPointsDist.elementAt(i).compareTo(wayPointsDist.elementAt(i-1)) != -1)
-	   || (wayPointsDist.elementAt(i).compareTo(wayPointsDist.elementAt(i+1)) != -1))
-	continue;
-	
+       || (wayPointsDist.elementAt(i).compareTo(wayPointsDist.elementAt(i+1)) != -1))
+    continue;
+
       LatLon latLon = wayPoints.elementAt(i).getCoor();
       if ((lastStopCoor != null) &&  (lastStopCoor.greatCircleDistance(latLon) < threshold))
-	continue;
-	
+    continue;
+
       if (wayPoints.elementAt(i).getString("time") != null)
       {
-	time = StopImporterDialog.parseTime(wayPoints.elementAt(i)
-	    .getString("time").substring(11,19));
-	double gpsSyncTime = StopImporterDialog.parseTime(this.gpsSyncTime);
-	if (gpsSyncTime < dGpsStartTime - 12*60*60)
-	  gpsSyncTime += 24*60*60;
-	double timeDelta = gpsSyncTime - StopImporterDialog.parseTime(stopwatchStart);
-	time -= timeDelta;
-	Node node = StopImporterAction.createNode(latLon, type, "");
-	stoplistTM.insertRow(-1, node, StopImporterAction.timeOf(time), "", "");
-      }
-	
+    time = StopImporterDialog.parseTime(wayPoints.elementAt(i)
+        .getString("time").substring(11,19));
+    double gpsSyncTime = StopImporterDialog.parseTime(this.gpsSyncTime);
+    if (gpsSyncTime < dGpsStartTime - 12*60*60)
+      gpsSyncTime += 24*60*60;
+    double timeDelta = gpsSyncTime - StopImporterDialog.parseTime(stopwatchStart);
+    time -= timeDelta;
+    Node node = StopImporterAction.createNode(latLon, type, "");
+    stoplistTM.insertRow(-1, node, StopImporterAction.timeOf(time), "", "");
+      }
+
       lastStopCoor = latLon;
     }
-    
+
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -175,23 +175,23 @@
       Node node = stoplistTM.nodeAt(i);
       if (node == null)
-	continue;
+    continue;
       Main.main.getCurrentDataSet().removePrimitive(node);
       node.setDeleted(true);
     }
-    
+
     stoplistTM.setDataVector(tableDataModel);
     stoplistTM.setNodes(nodes);
     stoplistTM.setTimes(times);
-    
+
     for (int i = 0; i < stoplistTM.getNodes().size(); ++i)
     {
       Node node = stoplistTM.nodeAt(i);
       if (node == null)
-	continue;
+    continue;
       node.setDeleted(false);
       Main.main.getCurrentDataSet().addPrimitive(node);
     }
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -199,10 +199,10 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
     return new JLabel("public_transport.TrackStoplist.SuggestStops");
   }
-  
+
   private class NodeSortEntry implements Comparable< NodeSortEntry >
   {
@@ -211,5 +211,5 @@
     public String name = null;
     public double startTime = 0;
-    
+
     public NodeSortEntry(Node node, String time, String name, double startTime)
     {
@@ -218,21 +218,21 @@
       this.name = name;
     }
-    
+
     public int compareTo(NodeSortEntry nse)
     {
       double time = StopImporterDialog.parseTime(this.time);
       if (time - startTime > 12*60*60)
-	time -= 24*60*60;
-      
+    time -= 24*60*60;
+
       double nseTime = StopImporterDialog.parseTime(nse.time);
       if (nseTime - startTime > 12*60*60)
-	nseTime -= 24*60*60;
-      
+    nseTime -= 24*60*60;
+
       if (time < nseTime)
-	return -1;
+    return -1;
       else if (time > nseTime)
-	return 1;
+    return 1;
       else
-	return 0;
+    return 0;
     }
   };
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointTableModel.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointTableModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointTableModel.java	(revision 23192)
@@ -21,5 +21,5 @@
   public Vector< Node > nodes = new Vector< Node >();
   public Vector< LatLon > coors = new Vector< LatLon >();
-    
+
   public WaypointTableModel(StopImporterAction controller)
   {
@@ -30,5 +30,5 @@
     addTableModelListener(this);
   }
-    
+
   public boolean isCellEditable(int row, int column)
   {
@@ -37,20 +37,20 @@
     return false;
   }
-    
+
   public void addRow(Object[] obj)
   {
     throw new UnsupportedOperationException();
   }
-    
+
   public void insertRow(int insPos, Object[] obj)
   {
     throw new UnsupportedOperationException();
   }
-    
+
   public void addRow(WayPoint wp)
   {
     insertRow(-1, wp);
   }
-    
+
   public void insertRow(int insPos, WayPoint wp)
   {
@@ -64,5 +64,5 @@
 
     Node node = controller.createNode(wp.getCoor(), buf[1]);
-    
+
     if (insPos == -1)
     {
@@ -78,5 +78,5 @@
     }
   }
-    
+
   public void clear()
   {
@@ -84,5 +84,5 @@
     super.setRowCount(0);
   }
-  
+
   public void tableChanged(TableModelEvent e)
   {
@@ -90,8 +90,8 @@
     {
       if (inEvent)
-	return;
+    return;
       Main.main.undoRedo.add(new WaypointsNameCommand
-	  (this, e.getFirstRow(), (String)getValueAt(e.getFirstRow(), 1),
-	   (String)getValueAt(e.getFirstRow(), 2)));
+      (this, e.getFirstRow(), (String)getValueAt(e.getFirstRow(), 1),
+       (String)getValueAt(e.getFirstRow(), 2)));
     }
   }
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsDetachCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsDetachCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsDetachCommand.java	(revision 23192)
@@ -15,5 +15,5 @@
   private Vector< Node > nodesForUndo = null;
   private WaypointTableModel waypointTM = null;
-  
+
   public WaypointsDetachCommand(StopImporterAction controller)
   {
@@ -21,5 +21,5 @@
     workingLines = new Vector< Integer >();
     nodesForUndo = new Vector< Node >();
-    
+
     // use either selected lines or all lines if no line is selected
     int[] selectedLines = controller.getDialog().getWaypointsTable().getSelectedRows();
@@ -28,20 +28,20 @@
     {
       for (int i = 0; i < selectedLines.length; ++i)
-	consideredLines.add(selectedLines[i]);
+    consideredLines.add(selectedLines[i]);
     }
     else
     {
       for (int i = 0; i < waypointTM.getRowCount(); ++i)
-	consideredLines.add(new Integer(i));
+    consideredLines.add(new Integer(i));
     }
-    
+
     // keep only lines where a node can be added
     for (int i = 0; i < consideredLines.size(); ++i)
     {
       if (waypointTM.nodes.elementAt(consideredLines.elementAt(i)) != null)
-	workingLines.add(consideredLines.elementAt(i));
+    workingLines.add(consideredLines.elementAt(i));
     }
   }
-  
+
   public boolean executeCommand()
   {
@@ -56,5 +56,5 @@
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -66,5 +66,5 @@
     }
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -72,5 +72,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsDisableCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsDisableCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsDisableCommand.java	(revision 23192)
@@ -15,5 +15,5 @@
   private Vector< Node > nodesForUndo = null;
   private WaypointTableModel waypointTM = null;
-  
+
   public WaypointsDisableCommand(StopImporterAction controller)
   {
@@ -21,5 +21,5 @@
     workingLines = new Vector< Integer >();
     nodesForUndo = new Vector< Node >();
-    
+
     // use either selected lines or all lines if no line is selected
     int[] selectedLines = controller.getDialog().getWaypointsTable().getSelectedRows();
@@ -28,20 +28,20 @@
     {
       for (int i = 0; i < selectedLines.length; ++i)
-	consideredLines.add(selectedLines[i]);
+    consideredLines.add(selectedLines[i]);
     }
     else
     {
       for (int i = 0; i < waypointTM.getRowCount(); ++i)
-	consideredLines.add(new Integer(i));
+    consideredLines.add(new Integer(i));
     }
-    
+
     // keep only lines where a node can be added
     for (int i = 0; i < consideredLines.size(); ++i)
     {
       if (waypointTM.nodes.elementAt(consideredLines.elementAt(i)) != null)
-	workingLines.add(consideredLines.elementAt(i));
+    workingLines.add(consideredLines.elementAt(i));
     }
   }
-  
+
   public boolean executeCommand()
   {
@@ -53,5 +53,5 @@
       nodesForUndo.add(node);
       if (node == null)
-	continue;
+    continue;
       waypointTM.nodes.set(j, null);
       Main.main.getCurrentDataSet().removePrimitive(node);
@@ -60,5 +60,5 @@
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -69,10 +69,10 @@
       waypointTM.nodes.set(j, node);
       if (node == null)
-	continue;
+    continue;
       node.setDeleted(false);
       Main.main.getCurrentDataSet().addPrimitive(node);
     }
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -80,5 +80,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsEnableCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsEnableCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsEnableCommand.java	(revision 23192)
@@ -15,5 +15,5 @@
   private WaypointTableModel waypointTM = null;
   private String type = null;
-  
+
   public WaypointsEnableCommand(StopImporterAction controller)
   {
@@ -21,5 +21,5 @@
     type = controller.getDialog().getStoptype();
     workingLines = new Vector< Integer >();
-    
+
     // use either selected lines or all lines if no line is selected
     int[] selectedLines = controller.getDialog().getWaypointsTable().getSelectedRows();
@@ -28,20 +28,20 @@
     {
       for (int i = 0; i < selectedLines.length; ++i)
-	consideredLines.add(selectedLines[i]);
+    consideredLines.add(selectedLines[i]);
     }
     else
     {
       for (int i = 0; i < waypointTM.getRowCount(); ++i)
-	consideredLines.add(new Integer(i));
+    consideredLines.add(new Integer(i));
     }
-    
+
     // keep only lines where a node can be added
     for (int i = 0; i < consideredLines.size(); ++i)
     {
       if (waypointTM.nodes.elementAt(consideredLines.elementAt(i)) == null)
-	workingLines.add(consideredLines.elementAt(i));
+    workingLines.add(consideredLines.elementAt(i));
     }
   }
-  
+
   public boolean executeCommand()
   {
@@ -52,12 +52,12 @@
         (waypointTM.coors.elementAt(j), type, (String)waypointTM.getValueAt(j, 1));
       if ("".equals((String)waypointTM.getValueAt(j, 2)))
-	node.put("shelter", null);
+    node.put("shelter", null);
       else
-	node.put("shelter", (String)waypointTM.getValueAt(j, 2));
+    node.put("shelter", (String)waypointTM.getValueAt(j, 2));
       waypointTM.nodes.set(j, node);
     }
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -68,10 +68,10 @@
       waypointTM.nodes.set(j, null);
       if (node == null)
-	continue;
+    continue;
       Main.main.getCurrentDataSet().removePrimitive(node);
       node.setDeleted(true);
     }
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -79,5 +79,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsNameCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsNameCommand.java	(revision 23191)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/WaypointsNameCommand.java	(revision 23192)
@@ -18,5 +18,5 @@
   private String oldShelter = null;
   private String shelter = null;
-  
+
   public WaypointsNameCommand
       (WaypointTableModel waypointTM, int workingLine, String name, String shelter)
@@ -34,5 +34,5 @@
       this.shelter = null;
   }
-  
+
   public boolean executeCommand()
   {
@@ -54,5 +54,5 @@
     return true;
   }
-  
+
   public void undoCommand()
   {
@@ -73,5 +73,5 @@
     waypointTM.inEvent = false;
   }
-  
+
   public void fillModifiedData
     (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
@@ -79,5 +79,5 @@
   {
   }
-  
+
   @Override public JLabel getDescription()
   {
Index: /applications/editors/josm/plugins/reverter/src/reverter/ChangesetIdQuery.java
===================================================================
--- /applications/editors/josm/plugins/reverter/src/reverter/ChangesetIdQuery.java	(revision 23191)
+++ /applications/editors/josm/plugins/reverter/src/reverter/ChangesetIdQuery.java	(revision 23192)
@@ -31,5 +31,5 @@
         try {
           return NumberFormat.getInstance().parse(tcid.getText()).intValue();
-        } catch (ParseException e) {            
+        } catch (ParseException e) {
           return 0;
         }
@@ -50,16 +50,16 @@
         panel.add(new JLabel(tr("Changeset id:")));
         panel.add(tcid, GBC.eol().fill(GBC.HORIZONTAL));
-        
+
         bgRevertType.add(rbFull);
         bgRevertType.add(rbSelection);
         bgRevertType.add(rbSelectionUndelete);
-        
+
         rbFull.setSelected(true);
         panel.add(rbFull, GBC.eol().insets(0,10,0,0).fill(GBC.HORIZONTAL));
         panel.add(rbSelection, GBC.eol().fill(GBC.HORIZONTAL));
         panel.add(rbSelectionUndelete, GBC.eol().fill(GBC.HORIZONTAL));
-        
+
         setContent(panel);
-        setupDialog();        
+        setupDialog();
     }
 }
Index: /applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java
===================================================================
--- /applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java	(revision 23191)
+++ /applications/editors/josm/plugins/reverter/src/reverter/ChangesetReverter.java	(revision 23192)
@@ -54,7 +54,7 @@
     public final RevertType revertType;
 
-    private final OsmDataLayer layer; // data layer associated with reverter 
-    private final DataSet ds; // DataSet associated with reverter 
-    private final ChangesetDataSet cds; // Current changeset data 
+    private final OsmDataLayer layer; // data layer associated with reverter
+    private final DataSet ds; // DataSet associated with reverter
+    private final ChangesetDataSet cds; // Current changeset data
     private DataSet nds; // Dataset that contains new objects downloaded by reverter
 
@@ -68,5 +68,5 @@
     ////////////////////////////////////////
     private void addIfMissing(PrimitiveId id) {
-        OsmPrimitive p = ds.getPrimitiveById(id); 
+        OsmPrimitive p = ds.getPrimitiveById(id);
         if (p == null || p.isIncomplete()) {
             missing.add(id);
@@ -94,9 +94,9 @@
         }
     }
-    
+
     /**
      * Checks if {@see ChangesetDataSetEntry} conforms to current RevertType
      * @param entry entry to be checked
-     * @return <code>true</code> if {@see ChangesetDataSetEntry} conforms to current RevertType 
+     * @return <code>true</code> if {@see ChangesetDataSetEntry} conforms to current RevertType
      */
     private boolean CheckOsmChangeEntry(ChangesetDataSetEntry entry) {
@@ -110,5 +110,5 @@
         return p.isSelected();
     }
-    
+
     /**
      * creates a reverter for specific changeset and fetches initial data
@@ -132,5 +132,5 @@
             monitor.finishTask();
         }
-        
+
         // Build our own lists of created/updated/modified objects for better performance
         for (Iterator<ChangesetDataSetEntry> it = cds.iterator();it.hasNext();) {
@@ -163,5 +163,5 @@
     public void downloadObjectsHistory(ProgressMonitor progressMonitor) throws OsmTransferException {
         final OsmServerMultiObjectReader rdr = new OsmServerMultiObjectReader();
-        
+
         progressMonitor.beginTask("Downloading objects history",updated.size()+deleted.size()+1);
         try {
@@ -182,5 +182,5 @@
         }
     }
-    
+
     public void downloadMissingPrimitives(ProgressMonitor monitor) throws OsmTransferException {
         if (!hasMissingObjects()) return;
@@ -200,5 +200,5 @@
             }
         }
-        DataSet source = rdr.parseOsm(monitor); 
+        DataSet source = rdr.parseOsm(monitor);
         for (OsmPrimitive p : source.allPrimitives()) {
             if (!p.isVisible() && !p.isDeleted()) {
@@ -210,5 +210,5 @@
         missing.clear();
     }
-    
+
     private static Conflict<? extends OsmPrimitive> CreateConflict(OsmPrimitive p, boolean isMyDeleted) {
         switch (p.getType()) {
@@ -222,5 +222,5 @@
         }
     }
-    
+
     private static boolean hasEqualSemanticAttributes(OsmPrimitive current,HistoryOsmPrimitive history) {
         if (!current.getKeys().equals(history.getTags())) return false;
@@ -237,10 +237,10 @@
             return true;
         case RELATION:
-            List<org.openstreetmap.josm.data.osm.RelationMember> currentMembers = 
+            List<org.openstreetmap.josm.data.osm.RelationMember> currentMembers =
                 ((Relation)current).getMembers();
             List<RelationMember> historyMembers = ((HistoryRelation)history).getMembers();
             if (currentMembers.size() != historyMembers.size()) return false;
             for (int i = 0; i < currentMembers.size(); i++) {
-                org.openstreetmap.josm.data.osm.RelationMember currentMember = 
+                org.openstreetmap.josm.data.osm.RelationMember currentMember =
                     currentMembers.get(i);
                 RelationMember historyMember = historyMembers.get(i);
@@ -253,12 +253,12 @@
         }
     }
-    
+
     /**
      * Builds a list of commands that will revert the changeset
-     * 
+     *
      */
     public List<Command> getCommands() {
         if (this.nds == null) return null;
-        
+
         //////////////////////////////////////////////////////////////////////////
         // Create commands to restore/update all affected objects
@@ -282,15 +282,15 @@
             if (p != null) toDelete.add(p);
         }
-        
+
 
         //////////////////////////////////////////////////////////////////////////
         // Check reversion against current dataset and create necessary conflicts
-        
+
         HashSet<OsmPrimitive> conflicted = new HashSet<OsmPrimitive>();
-        
+
         for (Conflict<? extends OsmPrimitive> conflict : merger.getConflicts()) {
             cmds.add(new ConflictAddCommand(layer,conflict));
         }
-        
+
         // Check objects versions
         for (Iterator<ChangesetDataSetEntry> it = cds.iterator();it.hasNext();) {
@@ -302,5 +302,5 @@
                 throw new IllegalStateException(tr("Missing merge target for {0} with id {1}",
                         hp.getType(), hp.getId()));
-            
+
             if (hp.getVersion() != dp.getVersion()
                     && (hp.isVisible() || dp.isVisible()) &&
@@ -309,12 +309,12 @@
                      */
                     !hasEqualSemanticAttributes(dp,hp)) {
-                
-                
-                cmds.add(new ConflictAddCommand(layer,CreateConflict(dp, 
+
+
+                cmds.add(new ConflictAddCommand(layer,CreateConflict(dp,
                         entry.getModificationType() == ChangesetModificationType.CREATED)));
                 conflicted.add(dp);
             }
         }
-        
+
         /* Check referrers for deleted objects: if object is referred by another object that
          * isn't going to be deleted or modified, create a conflict.
@@ -340,5 +340,5 @@
             }
         }
-        
+
         // Create a Command to delete all marked objects
         List<? extends OsmPrimitive> list;
Index: /applications/editors/josm/plugins/reverter/src/reverter/MultiOsmReader.java
===================================================================
--- /applications/editors/josm/plugins/reverter/src/reverter/MultiOsmReader.java	(revision 23191)
+++ /applications/editors/josm/plugins/reverter/src/reverter/MultiOsmReader.java	(revision 23192)
@@ -561,5 +561,5 @@
         processRelationsAfterParsing();
     }
-    
-    
+
+
 }
Index: /applications/editors/josm/plugins/reverter/src/reverter/ObjectsHistoryAction.java
===================================================================
--- /applications/editors/josm/plugins/reverter/src/reverter/ObjectsHistoryAction.java	(revision 23191)
+++ /applications/editors/josm/plugins/reverter/src/reverter/ObjectsHistoryAction.java	(revision 23192)
@@ -16,5 +16,5 @@
                 Shortcut.registerShortcut("tool:history",
                         "Tool: Display objects history dialog",
-                        KeyEvent.VK_H, Shortcut.GROUP_EDIT, 
+                        KeyEvent.VK_H, Shortcut.GROUP_EDIT,
                         Shortcut.SHIFT_DEFAULT),
                 true);
Index: /applications/editors/josm/plugins/reverter/src/reverter/ObjectsHistoryDialog.java
===================================================================
--- /applications/editors/josm/plugins/reverter/src/reverter/ObjectsHistoryDialog.java	(revision 23191)
+++ /applications/editors/josm/plugins/reverter/src/reverter/ObjectsHistoryDialog.java	(revision 23192)
@@ -18,5 +18,5 @@
         setButtonIcons(new String[] {"ok.png", "cancel.png" });
         setContent(new JPanel(new GridBagLayout()));
-        setupDialog();        
+        setupDialog();
     }
 }
Index: /applications/editors/josm/plugins/reverter/src/reverter/PrimitiveIdVersion.java
===================================================================
--- /applications/editors/josm/plugins/reverter/src/reverter/PrimitiveIdVersion.java	(revision 23191)
+++ /applications/editors/josm/plugins/reverter/src/reverter/PrimitiveIdVersion.java	(revision 23192)
@@ -20,5 +20,5 @@
         return version;
     }
-    
+
     @Override
     public int hashCode() {
Index: /applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetAction.java
===================================================================
--- /applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetAction.java	(revision 23191)
+++ /applications/editors/josm/plugins/reverter/src/reverter/RevertChangesetAction.java	(revision 23192)
@@ -27,9 +27,9 @@
                 Shortcut.registerShortcut("tool:revert",
                         tr("Tool: {0}", tr("Revert changeset")),
-                        KeyEvent.VK_T, Shortcut.GROUP_EDIT, 
-                        Shortcut.SHIFT_DEFAULT),  
+                        KeyEvent.VK_T, Shortcut.GROUP_EDIT,
+                        Shortcut.SHIFT_DEFAULT),
                 true);
     }
-    
+
     @Override
     protected void updateEnabledState() {
@@ -47,19 +47,19 @@
         if (changesetId == 0) return;
         if (revertType == null) return;
-        
+
         Main.worker.submit(new PleaseWaitRunnable(tr("Reverting...")) {
             private ChangesetReverter rev;
             private boolean downloadConfirmed = false;
-            
+
             private boolean checkAndDownloadMissing() throws OsmTransferException {
                 if (!rev.hasMissingObjects()) return true;
                 if (!downloadConfirmed) {
                     downloadConfirmed = JOptionPane.showConfirmDialog(Main.parent,
-                            tr("This changeset has objects that are not present in current dataset.\n" + 
+                            tr("This changeset has objects that are not present in current dataset.\n" +
                                     "It is needed to download them before reverting. Do you want to continue?"),
                             tr("Confirm"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
                     if (!downloadConfirmed) return false;
                 }
-                final PleaseWaitProgressMonitor monitor = 
+                final PleaseWaitProgressMonitor monitor =
                     new PleaseWaitProgressMonitor(tr("Fetching missing primitives"));
                 try {
@@ -70,5 +70,5 @@
                 return !monitor.isCancelled();
             }
-            
+
             @Override
             protected void realRun() throws OsmTransferException {
@@ -90,5 +90,5 @@
                     rev.downloadMissingPrimitives(progressMonitor.createSubTaskMonitor(0, false));
                 }
-                
+
                 if (progressMonitor.isCancelled()) return;
                 rev.downloadObjectsHistory(progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false));
@@ -96,5 +96,5 @@
                 if (!checkAndDownloadMissing()) return;
                 List<Command> cmds = rev.getCommands();
-                Command cmd = new SequenceCommand(tr(revertType == RevertType.FULL ? "Revert changeset #{0}" : 
+                Command cmd = new SequenceCommand(tr(revertType == RevertType.FULL ? "Revert changeset #{0}" :
                         "Partially revert changeset #{0}",changesetId),cmds);
                 Main.main.undoRedo.add(cmd);
Index: /applications/editors/josm/plugins/reverter/src/reverter/ReverterPlugin.java
===================================================================
--- /applications/editors/josm/plugins/reverter/src/reverter/ReverterPlugin.java	(revision 23191)
+++ /applications/editors/josm/plugins/reverter/src/reverter/ReverterPlugin.java	(revision 23192)
@@ -18,5 +18,5 @@
         JMenu historyMenu = Main.main.menu.addMenu(marktr("History"), KeyEvent.VK_R,
                 Main.main.menu.defaultMenuPos,ht("/Plugin/Reverter"));
-        //MainMenu.add(historyMenu, new ObjectsHistoryAction());       
+        //MainMenu.add(historyMenu, new ObjectsHistoryAction());
         MainMenu.add(historyMenu, new RevertChangesetAction());
     }
Index: /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java
===================================================================
--- /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java	(revision 23191)
+++ /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java	(revision 23192)
@@ -471,5 +471,5 @@
     public JComponent buildPreviewPanel() {
         JPanel previewPanel = new JPanel(new GridBagLayout());
-        
+
         String[] columnNames = {tr("Key"), tr("Value")};
         String[][] data = {{}};
@@ -495,5 +495,5 @@
         scroll.setPreferredSize(dim);
         scroll.setMinimumSize(dim); /* minimum size is relevant for multisplit layout */
-        
+
         addTrafficSignTag = new JCheckBox(tr("{0} tag", "traffic_sign"));
         addTrafficSignTag.setSelected(Main.pref.getBoolean("plugin.roadsigns.addTrafficSignTag"));
@@ -503,5 +503,5 @@
             }
         });
-        
+
         previewPanel.add(scroll, GBC.eol().fill());
         previewPanel.add(addTrafficSignTag, GBC.eol());
@@ -544,5 +544,5 @@
             final TreeMap<String, String> map= new TreeMap<String, String>();
             String traffic_sign = "";
-            
+
             for (SignCombination sc : sel.combos) {
                 final Map<String, String> env = new HashMap<String, String>();
@@ -596,5 +596,5 @@
                     }
                 }
-                
+
                 Map<String, TagEvaluater> tags = new LinkedHashMap<String, TagEvaluater>();
                 for (SignWrapper sw : sc.signs) {
@@ -654,5 +654,5 @@
                     map.putAll(result);
                 }
-                
+
                 if (combo_traffic_sign.length() != 0) {
                     if (traffic_sign.length() != 0) {
Index: /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignsReader.java
===================================================================
--- /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignsReader.java	(revision 23191)
+++ /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignsReader.java	(revision 23192)
@@ -104,9 +104,9 @@
                 }
                 curSign.iconURL = iconURL;
-                 
+
                 if ("yes".equals(atts.getValue("supplementary"))) {
                     curSign.isSupplementing = true;
                 }
-                
+
                 curSign.wiki = atts.getValue("wiki");
                 curSign.loc_wiki = getLocalized(atts, "wiki");
@@ -296,5 +296,5 @@
         }
     }
-    
+
     /**
      *
Index: /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/ParamStringScannerConstants.java
===================================================================
--- /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/ParamStringScannerConstants.java	(revision 23191)
+++ /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/ParamStringScannerConstants.java	(revision 23192)
@@ -3,5 +3,5 @@
 
 
-/** 
+/**
  * Token literal values and constants.
  * Generated by org.javacc.parser.OtherFilesGen#start()
Index: /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/ParamStringScannerTokenManager.java
===================================================================
--- /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/ParamStringScannerTokenManager.java	(revision 23191)
+++ /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/ParamStringScannerTokenManager.java	(revision 23192)
@@ -167,5 +167,5 @@
 }
 static final int[] jjnextStates = {
-   1, 3, 5, 6, 9, 10, 
+   1, 3, 5, 6, 9, 10,
 };
 
@@ -176,5 +176,5 @@
 /** Lexer state names. */
 public static final String[] lexStateNames = {
-   "DEFAULT", 
+   "DEFAULT",
 };
 protected SimpleCharStream input_stream;
@@ -259,5 +259,5 @@
 
 /** Get the next Token. */
-public Token getNextToken() 
+public Token getNextToken()
 {
   Token matchedToken;
@@ -266,11 +266,11 @@
   EOFLoop :
   for (;;)
-  {   
-   try   
-   {     
+  {
+   try
+   {
       curChar = input_stream.BeginToken();
-   }     
+   }
    catch(java.io.IOException e)
-   {        
+   {
       jjmatchedKind = 0;
       matchedToken = jjFillToken();
Index: /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/ParseException.java
===================================================================
--- /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/ParseException.java	(revision 23191)
+++ /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/ParseException.java	(revision 23192)
@@ -127,5 +127,5 @@
       retval += add_escapes(tok.image);
       retval += " \"";
-      tok = tok.next; 
+      tok = tok.next;
     }
     retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
@@ -144,5 +144,5 @@
    */
   protected String eol = System.getProperty("line.separator", "\n");
- 
+
   /**
    * Used to convert raw characters to their escaped version
Index: /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/SimpleCharStream.java
===================================================================
--- /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/SimpleCharStream.java	(revision 23191)
+++ /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/SimpleCharStream.java	(revision 23192)
@@ -205,5 +205,5 @@
 
   /**
-   * @deprecated 
+   * @deprecated
    * @see #getEndColumn
    */
@@ -214,5 +214,5 @@
 
   /**
-   * @deprecated 
+   * @deprecated
    * @see #getEndLine
    */
@@ -449,5 +449,5 @@
         columnDiff = nextColDiff;
         i++;
-     } 
+     }
 
      if (i < len)
Index: /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/TokenMgrError.java
===================================================================
--- /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/TokenMgrError.java	(revision 23191)
+++ /applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/javacc/TokenMgrError.java	(revision 23192)
@@ -89,5 +89,5 @@
     * Returns a detailed message for the Error when it is thrown by the
     * token manager to indicate a lexical error.
-    * Parameters : 
+    * Parameters :
     *    EOFSeen     : indicates if EOF caused the lexical error
     *    curLexState : lexical state in which this error occurred
@@ -109,5 +109,5 @@
     * You can also modify the body of this method to customize your error messages.
     * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
-    * of end-users concern, so you can return something like : 
+    * of end-users concern, so you can return something like :
     *
     *     "Internal Error : Please file a bug report .... "
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/CreateOrEditTurnRestrictionAction.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/CreateOrEditTurnRestrictionAction.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/CreateOrEditTurnRestrictionAction.java	(revision 23192)
@@ -29,93 +29,93 @@
  */
 public class CreateOrEditTurnRestrictionAction extends JosmAction {
-	static private final Logger logger = Logger.getLogger(CreateOrEditTurnRestrictionAction.class.getName());
-	
-	/**
-	 * Installs the global key stroke with which creating/editing a turn restriction
-	 * is triggered.
-	 * 
-	 * @param keyStroke the key stroke 
-	 */
-	static public void install(KeyStroke keyStroke){
-		InputMap im = Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
-		Object actionMapKey = im.get(keyStroke);
-		if (actionMapKey != null && !actionMapKey.toString().equals("turnrestrictions:create-or-edit")) {
-			System.out.println(tr("Warning: turnrestrictions plugin replaces already existing action ''{0}'' behind shortcut ''{1}'' by action ''{2}''", actionMapKey.toString(), keyStroke.toString(), "turnrestrictions:create-or-edit"));			
-		}
-		KeyStroke[] keys = im.keys();
-		if (keys != null){
-			for(KeyStroke ks: im.keys()){
-				if (im.get(ks).equals("turnrestrictions:create-or-edit")) {
-					im.remove(ks);
-				}
-			}
-		}
-		im.put(keyStroke, "turnrestrictions:create-or-edit");
-		ActionMap am = Main.contentPane.getActionMap();
-		am.put("turnrestrictions:create-or-edit", getInstance());
-	}
-	
-	/**
-	 * Installs  global key stroke configured in the preferences.
-	 * 
-	 * @param keyStroke the key stroke 
-	 */
-	static public void install(){
-		String value = Main.pref.get(PreferenceKeys.EDIT_SHORTCUT, "shift ctrl T");
-		KeyStroke key = KeyStroke.getKeyStroke(value);
-		if (key == null){
-			System.out.println(tr("Warning: illegal value ''{0}'' for preference key ''{1}''. Falling back to default value ''shift ctrl T''.", value, PreferenceKeys.EDIT_SHORTCUT));
-			key = KeyStroke.getKeyStroke("shift ctrl T");
-		}
-		install(key);
-	}
-	
-	/** the singleton instance of this action */
-	private static CreateOrEditTurnRestrictionAction instance;
-	
-	/**
-	 * Replies the unique instance of this action
-	 * 
-	 * @return
-	 */
-	public static CreateOrEditTurnRestrictionAction getInstance() {
-		if (instance == null){
-			instance = new CreateOrEditTurnRestrictionAction();
-		}
-		return instance;
-	}
-	
-	protected CreateOrEditTurnRestrictionAction() {
-		super(
-		    tr("Create/Edit turn restriction..."),
-		    null,
-		    tr("Create or edit a turn restriction."),
-		    null, // shortcut is going to be registered later 
-			false 
-	    );
-	}	
-	
-	public void actionPerformed(ActionEvent e) {
-		OsmDataLayer layer = Main.main.getEditLayer();
-		if (layer == null) return;
-		Collection<Relation> trs = TurnRestrictionSelectionPopupPanel.getTurnRestrictionsParticipatingIn(layer.data.getSelected());
-		if (layer == null) return;
-		if (trs.isEmpty()){
-			// current selection isn't participating in turn restrictions. Launch
-			// an editor for a new turn restriction 
-			//
-			Relation tr = new TurnRestrictionBuilder().buildFromSelection(layer);
-			TurnRestrictionEditor editor = new TurnRestrictionEditor(Main.map.mapView,layer,tr);
-			TurnRestrictionEditorManager.getInstance().positionOnScreen(editor);
-			TurnRestrictionEditorManager.getInstance().register(layer, tr, editor);
-			editor.setVisible(true);
-		} else {
-			// let the user choose whether he wants to create a new turn restriction or
-			// edit one of the turn restrictions participating in the current selection 
-			TurnRestrictionSelectionPopupPanel pnl = new TurnRestrictionSelectionPopupPanel(
-					layer
-			);
-			pnl.launch();
-		}
-	}
+    static private final Logger logger = Logger.getLogger(CreateOrEditTurnRestrictionAction.class.getName());
+    
+    /**
+     * Installs the global key stroke with which creating/editing a turn restriction
+     * is triggered.
+     * 
+     * @param keyStroke the key stroke 
+     */
+    static public void install(KeyStroke keyStroke){
+        InputMap im = Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
+        Object actionMapKey = im.get(keyStroke);
+        if (actionMapKey != null && !actionMapKey.toString().equals("turnrestrictions:create-or-edit")) {
+            System.out.println(tr("Warning: turnrestrictions plugin replaces already existing action ''{0}'' behind shortcut ''{1}'' by action ''{2}''", actionMapKey.toString(), keyStroke.toString(), "turnrestrictions:create-or-edit"));            
+        }
+        KeyStroke[] keys = im.keys();
+        if (keys != null){
+            for(KeyStroke ks: im.keys()){
+                if (im.get(ks).equals("turnrestrictions:create-or-edit")) {
+                    im.remove(ks);
+                }
+            }
+        }
+        im.put(keyStroke, "turnrestrictions:create-or-edit");
+        ActionMap am = Main.contentPane.getActionMap();
+        am.put("turnrestrictions:create-or-edit", getInstance());
+    }
+    
+    /**
+     * Installs  global key stroke configured in the preferences.
+     * 
+     * @param keyStroke the key stroke 
+     */
+    static public void install(){
+        String value = Main.pref.get(PreferenceKeys.EDIT_SHORTCUT, "shift ctrl T");
+        KeyStroke key = KeyStroke.getKeyStroke(value);
+        if (key == null){
+            System.out.println(tr("Warning: illegal value ''{0}'' for preference key ''{1}''. Falling back to default value ''shift ctrl T''.", value, PreferenceKeys.EDIT_SHORTCUT));
+            key = KeyStroke.getKeyStroke("shift ctrl T");
+        }
+        install(key);
+    }
+    
+    /** the singleton instance of this action */
+    private static CreateOrEditTurnRestrictionAction instance;
+    
+    /**
+     * Replies the unique instance of this action
+     * 
+     * @return
+     */
+    public static CreateOrEditTurnRestrictionAction getInstance() {
+        if (instance == null){
+            instance = new CreateOrEditTurnRestrictionAction();
+        }
+        return instance;
+    }
+    
+    protected CreateOrEditTurnRestrictionAction() {
+        super(
+            tr("Create/Edit turn restriction..."),
+            null,
+            tr("Create or edit a turn restriction."),
+            null, // shortcut is going to be registered later 
+            false 
+        );
+    }   
+    
+    public void actionPerformed(ActionEvent e) {
+        OsmDataLayer layer = Main.main.getEditLayer();
+        if (layer == null) return;
+        Collection<Relation> trs = TurnRestrictionSelectionPopupPanel.getTurnRestrictionsParticipatingIn(layer.data.getSelected());
+        if (layer == null) return;
+        if (trs.isEmpty()){
+            // current selection isn't participating in turn restrictions. Launch
+            // an editor for a new turn restriction 
+            //
+            Relation tr = new TurnRestrictionBuilder().buildFromSelection(layer);
+            TurnRestrictionEditor editor = new TurnRestrictionEditor(Main.map.mapView,layer,tr);
+            TurnRestrictionEditorManager.getInstance().positionOnScreen(editor);
+            TurnRestrictionEditorManager.getInstance().register(layer, tr, editor);
+            editor.setVisible(true);
+        } else {
+            // let the user choose whether he wants to create a new turn restriction or
+            // edit one of the turn restrictions participating in the current selection 
+            TurnRestrictionSelectionPopupPanel pnl = new TurnRestrictionSelectionPopupPanel(
+                    layer
+            );
+            pnl.launch();
+        }
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionBuilder.java	(revision 23192)
@@ -21,142 +21,142 @@
 public class TurnRestrictionBuilder {
 
-	private Way from;
-	private Way to;
-	private final ArrayList<OsmPrimitive> vias = new ArrayList<OsmPrimitive>();
-	
-	public TurnRestrictionBuilder(){
-	}
-	
-	/**
-	 * Initializes the 'from' leg. Proposes the  first element
-	 * in {@code primitives} as 'from' leg if this element is a
-	 * non-deleted, visible way.
-	 * 
-	 * @param primitives
-	 */
-	protected void initFromLeg(List<OsmPrimitive> primitives){
-		if (primitives == null || primitives.isEmpty()) return;
-		OsmPrimitive p = primitives.get(0);
-		if (! (p instanceof Way)) return;
-		Way fromLeg = (Way)p;
-		if (fromLeg.isDeleted() || ! fromLeg.isVisible()) return;
-		this.from = fromLeg;
-	}
+    private Way from;
+    private Way to;
+    private final ArrayList<OsmPrimitive> vias = new ArrayList<OsmPrimitive>();
+    
+    public TurnRestrictionBuilder(){
+    }
+    
+    /**
+     * Initializes the 'from' leg. Proposes the  first element
+     * in {@code primitives} as 'from' leg if this element is a
+     * non-deleted, visible way.
+     * 
+     * @param primitives
+     */
+    protected void initFromLeg(List<OsmPrimitive> primitives){
+        if (primitives == null || primitives.isEmpty()) return;
+        OsmPrimitive p = primitives.get(0);
+        if (! (p instanceof Way)) return;
+        Way fromLeg = (Way)p;
+        if (fromLeg.isDeleted() || ! fromLeg.isVisible()) return;
+        this.from = fromLeg;
+    }
 
-	/**
-	 * Initializes the 'to' leg. Proposes the last element 
-	 * in {@code primitives} as 'to' leg if this element is a
-	 * non-deleted, visible way.
-	 *
-	 * @param primitives
-	 */
-	protected void initToLeg(List<OsmPrimitive> primitives){
-		if (primitives == null || primitives.isEmpty()) return;
-		if (primitives.size() < 2) return;
-		OsmPrimitive p = primitives.get(primitives.size()-1);
-		if (! (p instanceof Way)) return;
-		Way toLeg = (Way)p;
-		if (toLeg.isDeleted() || ! toLeg.isVisible()) return;
-		this.to = toLeg;
-	}
-	
-	/**
-	 * Initializes the vias from the two turn restriction legs. The two
-	 * legs have to be defined, otherwise no via is proposed. This methods
-	 * proposes exactly one node as via, if the two turn restriction
-	 * legs intersect at exactly one node. 
-	 */
-	protected void initViaFromLegs(){
-		if (from == null || to == null) return;		
-		// check whether 'from' and 'to' have exactly one intersecting 
-		// node. This node is proposed as via node. The turn restriction
-		// node will also provide functionality to split either or both
-		// of 'from' and 'to' way if they aren't connected from tail to
-		// head
-		//
-		HashSet<Node> nodes = new HashSet<Node>();
-		nodes.addAll(from.getNodes());
-		nodes.retainAll(to.getNodes());
-		if (nodes.size() == 1){
-			vias.add(nodes.iterator().next());
-		}		
-	}
-	
-	/**
-	 * Initializes the vias with the primitives (1..size-2), provided
-	 * these primitives aren't relations and they are visible and non-deleted.
-	 * 
-	 * @param primitives
-	 */
-	protected void initViasFromPrimitives(List<OsmPrimitive> primitives) {
-		if (primitives == null || primitives.size() <=2) return;
-		// if we didn't find a from or a to way, we don't propose via objects
-		// either
-		if (from == null || to == null) return;
-		for(int i=1; i< primitives.size() -2;i++){
-			OsmPrimitive p = primitives.get(i);
-			if (p == null) continue;
-			if (p instanceof Relation) continue;
-			if (p.isDeleted() || ! p.isVisible()) continue;
-			vias.add(p);
-		}
-	}
-	
-	/**
-	 * Resets the builder 
-	 */
-	protected void reset() {
-		this.from = null;
-		this.to = null;
-		this.vias.clear();
-	}
-	
-	/**
-	 * Creates and initializes a new turn restriction based on the primitives
-	 * currently selected in layer {@code layer}.
-	 *  
-	 * @param layer the layer. Must not be null.
-	 * @return the new initialized turn restriction. The turn restriction isn't
-	 * added to the layer yet.
-	 * @throws IllegalArgumentException thrown if layer is null
-	 */
-	public synchronized Relation buildFromSelection(OsmDataLayer layer) {
-		CheckParameterUtil.ensureParameterNotNull(layer, "layer");
-		List<OsmPrimitive> selection = new ArrayList<OsmPrimitive>(layer.data.getSelected());
-		return build(selection);
-	}
+    /**
+     * Initializes the 'to' leg. Proposes the last element 
+     * in {@code primitives} as 'to' leg if this element is a
+     * non-deleted, visible way.
+     *
+     * @param primitives
+     */
+    protected void initToLeg(List<OsmPrimitive> primitives){
+        if (primitives == null || primitives.isEmpty()) return;
+        if (primitives.size() < 2) return;
+        OsmPrimitive p = primitives.get(primitives.size()-1);
+        if (! (p instanceof Way)) return;
+        Way toLeg = (Way)p;
+        if (toLeg.isDeleted() || ! toLeg.isVisible()) return;
+        this.to = toLeg;
+    }
+    
+    /**
+     * Initializes the vias from the two turn restriction legs. The two
+     * legs have to be defined, otherwise no via is proposed. This methods
+     * proposes exactly one node as via, if the two turn restriction
+     * legs intersect at exactly one node. 
+     */
+    protected void initViaFromLegs(){
+        if (from == null || to == null) return;     
+        // check whether 'from' and 'to' have exactly one intersecting 
+        // node. This node is proposed as via node. The turn restriction
+        // node will also provide functionality to split either or both
+        // of 'from' and 'to' way if they aren't connected from tail to
+        // head
+        //
+        HashSet<Node> nodes = new HashSet<Node>();
+        nodes.addAll(from.getNodes());
+        nodes.retainAll(to.getNodes());
+        if (nodes.size() == 1){
+            vias.add(nodes.iterator().next());
+        }       
+    }
+    
+    /**
+     * Initializes the vias with the primitives (1..size-2), provided
+     * these primitives aren't relations and they are visible and non-deleted.
+     * 
+     * @param primitives
+     */
+    protected void initViasFromPrimitives(List<OsmPrimitive> primitives) {
+        if (primitives == null || primitives.size() <=2) return;
+        // if we didn't find a from or a to way, we don't propose via objects
+        // either
+        if (from == null || to == null) return;
+        for(int i=1; i< primitives.size() -2;i++){
+            OsmPrimitive p = primitives.get(i);
+            if (p == null) continue;
+            if (p instanceof Relation) continue;
+            if (p.isDeleted() || ! p.isVisible()) continue;
+            vias.add(p);
+        }
+    }
+    
+    /**
+     * Resets the builder 
+     */
+    protected void reset() {
+        this.from = null;
+        this.to = null;
+        this.vias.clear();
+    }
+    
+    /**
+     * Creates and initializes a new turn restriction based on the primitives
+     * currently selected in layer {@code layer}.
+     *  
+     * @param layer the layer. Must not be null.
+     * @return the new initialized turn restriction. The turn restriction isn't
+     * added to the layer yet.
+     * @throws IllegalArgumentException thrown if layer is null
+     */
+    public synchronized Relation buildFromSelection(OsmDataLayer layer) {
+        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
+        List<OsmPrimitive> selection = new ArrayList<OsmPrimitive>(layer.data.getSelected());
+        return build(selection);
+    }
 
-	/**
-	 * Creates and initializes a new turn restriction based on primitives 
-	 * in {@code primitives}.
-	 * 
-	 * @param primitives the primitives 
-	 * @return the new initialized turn restriction. The turn restriction isn't
-	 * added to the layer yet.
-	 */
-	public synchronized Relation build(List<OsmPrimitive> primitives){
-		Relation tr = new Relation();
-		tr.put("type", "restriction");
-		if (primitives == null || primitives.isEmpty()) return tr;
-		if (primitives.size() <=2){
-			initFromLeg(primitives);
-			initToLeg(primitives);
-			initViaFromLegs();
-		} else if (primitives.size() > 2) {
-			initFromLeg(primitives);
-			initToLeg(primitives);
-			initViasFromPrimitives(primitives);
-		}
-		
-		if (from != null){
-			tr.addMember(new RelationMember("from", from));
-		}
-		if (to != null){
-			tr.addMember(new RelationMember("to", to));
-		}
-		for(OsmPrimitive via: vias){
-			tr.addMember(new RelationMember("via", via));
-		}
-		return tr;
-	}		
+    /**
+     * Creates and initializes a new turn restriction based on primitives 
+     * in {@code primitives}.
+     * 
+     * @param primitives the primitives 
+     * @return the new initialized turn restriction. The turn restriction isn't
+     * added to the layer yet.
+     */
+    public synchronized Relation build(List<OsmPrimitive> primitives){
+        Relation tr = new Relation();
+        tr.put("type", "restriction");
+        if (primitives == null || primitives.isEmpty()) return tr;
+        if (primitives.size() <=2){
+            initFromLeg(primitives);
+            initToLeg(primitives);
+            initViaFromLegs();
+        } else if (primitives.size() > 2) {
+            initFromLeg(primitives);
+            initToLeg(primitives);
+            initViasFromPrimitives(primitives);
+        }
+        
+        if (from != null){
+            tr.addMember(new RelationMember("from", from));
+        }
+        if (to != null){
+            tr.addMember(new RelationMember("to", to));
+        }
+        for(OsmPrimitive via: vias){
+            tr.addMember(new RelationMember("via", via));
+        }
+        return tr;
+    }       
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionsPlugin.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionsPlugin.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/TurnRestrictionsPlugin.java	(revision 23192)
@@ -13,25 +13,25 @@
  */
 public class TurnRestrictionsPlugin extends Plugin{
-	
-	public TurnRestrictionsPlugin(PluginInformation info) {
-		super(info);		
-	}
-	
-	/**
-	 * Called when the JOSM map frame is created or destroyed. 
-	 */
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {				
-		if (oldFrame == null && newFrame != null) { // map frame added
-			TurnRestrictionsListDialog dialog  = new TurnRestrictionsListDialog();
-			// add the dialog
-			newFrame.addToggleDialog(dialog);
-			CreateOrEditTurnRestrictionAction.install();
-		}
-	}
+    
+    public TurnRestrictionsPlugin(PluginInformation info) {
+        super(info);        
+    }
+    
+    /**
+     * Called when the JOSM map frame is created or destroyed. 
+     */
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {             
+        if (oldFrame == null && newFrame != null) { // map frame added
+            TurnRestrictionsListDialog dialog  = new TurnRestrictionsListDialog();
+            // add the dialog
+            newFrame.addToggleDialog(dialog);
+            CreateOrEditTurnRestrictionAction.install();
+        }
+    }
 
-	@Override
-	public PreferenceSetting getPreferenceSetting() {
-		return new PreferenceEditor();
-	}
+    @Override
+    public PreferenceSetting getPreferenceSetting() {
+        return new PreferenceEditor();
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdListProvider.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdListProvider.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdListProvider.java	(revision 23192)
@@ -5,10 +5,10 @@
 import org.openstreetmap.josm.data.osm.PrimitiveId;;
 public interface PrimitiveIdListProvider {
-	/**
-	 * Replies the list of currently selected primitive IDs. Replies an empty list if no primitive IDs
-	 * are selected.
-	 * 
-	 * @return the list of currently selected primitive IDs
-	 */
-	List<PrimitiveId> getSelectedPrimitiveIds();
+    /**
+     * Replies the list of currently selected primitive IDs. Replies an empty list if no primitive IDs
+     * are selected.
+     * 
+     * @return the list of currently selected primitive IDs
+     */
+    List<PrimitiveId> getSelectedPrimitiveIds();
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdListTransferHandler.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdListTransferHandler.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdListTransferHandler.java	(revision 23192)
@@ -20,44 +20,44 @@
  */
 public class PrimitiveIdListTransferHandler extends TransferHandler {
-	static private final Logger logger = Logger.getLogger(PrimitiveIdListTransferHandler.class.getName());
-	private PrimitiveIdListProvider provider;
-	
-	/**
-	 * Replies true if {@code transferFlavors} includes the data flavor {@see PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
+    static private final Logger logger = Logger.getLogger(PrimitiveIdListTransferHandler.class.getName());
+    private PrimitiveIdListProvider provider;
+    
+    /**
+     * Replies true if {@code transferFlavors} includes the data flavor {@see PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
 
-	 * @param transferFlavors an array of transferFlavors
-	 * @return true if {@code transferFlavors} includes the data flavor {@see PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
-	 */
-	public static boolean isSupportedFlavor(DataFlavor[] transferFlavors) {
-		for (DataFlavor df: transferFlavors) {
-			if (df.equals(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR)) return true;
-		}
-		return false;
-	}
-	
-	/**
-	 * Creates the transfer handler 
-	 * 
-	 * @param provider the provider of the primitive IDs. Must not be null.
-	 * @throws IllegalArgumentException thrown if provider is null.
-	 */
-	public PrimitiveIdListTransferHandler(PrimitiveIdListProvider provider) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(provider, "provider");
-		this.provider = provider;
-	}
+     * @param transferFlavors an array of transferFlavors
+     * @return true if {@code transferFlavors} includes the data flavor {@see PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
+     */
+    public static boolean isSupportedFlavor(DataFlavor[] transferFlavors) {
+        for (DataFlavor df: transferFlavors) {
+            if (df.equals(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR)) return true;
+        }
+        return false;
+    }
+    
+    /**
+     * Creates the transfer handler 
+     * 
+     * @param provider the provider of the primitive IDs. Must not be null.
+     * @throws IllegalArgumentException thrown if provider is null.
+     */
+    public PrimitiveIdListTransferHandler(PrimitiveIdListProvider provider) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(provider, "provider");
+        this.provider = provider;
+    }
 
-	
-	
-	protected Transferable createTransferable(JComponent c) {
-		return new PrimitiveIdTransferable(provider.getSelectedPrimitiveIds());			
-	}
+    
+    
+    protected Transferable createTransferable(JComponent c) {
+        return new PrimitiveIdTransferable(provider.getSelectedPrimitiveIds());         
+    }
 
-	public int getSourceActions(JComponent c) {
-		return COPY;
-	}
+    public int getSourceActions(JComponent c) {
+        return COPY;
+    }
 
-	@Override
-	public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
-		return isSupportedFlavor(transferFlavors);	
-	}	
+    @Override
+    public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
+        return isSupportedFlavor(transferFlavors);  
+    }   
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdTransferable.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdTransferable.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/dnd/PrimitiveIdTransferable.java	(revision 23192)
@@ -18,84 +18,84 @@
  */
 public class PrimitiveIdTransferable implements Transferable{
-	
-	/** the data flower for the set of of primitive ids */
-	static public final DataFlavor PRIMITIVE_ID_LIST_FLAVOR = 
-		new DataFlavor(Set.class, "a set of OSM primitive ids");
-	
-	/** 
-	 * this transferable supports two flavors: (1) {@see #PRIMITIVE_ID_LIST_FLAVOR} and
-	 * (2) {@see DataFlavor#stringFlavor}.
-	 * 
-	 * See also {@see #getPrimitiveIds()} and {@see #getAsString()}
-	 */
-	static public final DataFlavor[] SUPPORTED_FLAVORS = new DataFlavor[] {
-		PRIMITIVE_ID_LIST_FLAVOR,
-		DataFlavor.stringFlavor
-	};
+    
+    /** the data flower for the set of of primitive ids */
+    static public final DataFlavor PRIMITIVE_ID_LIST_FLAVOR = 
+        new DataFlavor(Set.class, "a set of OSM primitive ids");
+    
+    /** 
+     * this transferable supports two flavors: (1) {@see #PRIMITIVE_ID_LIST_FLAVOR} and
+     * (2) {@see DataFlavor#stringFlavor}.
+     * 
+     * See also {@see #getPrimitiveIds()} and {@see #getAsString()}
+     */
+    static public final DataFlavor[] SUPPORTED_FLAVORS = new DataFlavor[] {
+        PRIMITIVE_ID_LIST_FLAVOR,
+        DataFlavor.stringFlavor
+    };
 
-	
-	private List<PrimitiveId> ids = new ArrayList<PrimitiveId>();
-	
-	/**
-	 * Creates a transferable from a collection of {@see PrimitiveId}s
-	 * 
-	 * @param ids
-	 */
-	public PrimitiveIdTransferable(List<PrimitiveId> ids) {
-		if (ids == null) return;
-		for(PrimitiveId id: ids) {
-			this.ids.add(new SimplePrimitiveId(id.getUniqueId(), id.getType()));
-		}
-	}
-	
-	/**
-	 * If flavor is {@see #PRIMITIVE_ID_SET_FLAVOR}, replies a the list of
-	 * transferred {@see PrimitiveId}s 
-	 * 
-	 * If flavor is {@see DataFlavor#stringFlavor}, replies a string representation
-	 * of the list of transferred {@see PrimitiveId}s
-	 */
-	public Object getTransferData(DataFlavor flavor)
-			throws UnsupportedFlavorException, IOException {
-		if (PRIMITIVE_ID_LIST_FLAVOR.equals(flavor)) {
-			return getPrimitiveIds();
-		} else if (DataFlavor.stringFlavor.equals(flavor)) {
-			return getAsString();
-		}
-		throw new UnsupportedFlavorException(flavor);
-	}
-	
-	/**
-	 * Replies the list of OSM primitive ids
-	 * 
-	 * @return the list of OSM primitive ids
-	 */
-	public List<PrimitiveId> getPrimitiveIds() {
-		return ids;
-	}
-	
-	/**
-	 * Replies a string representation of the list of OSM primitive ids
-	 *  
-	 * @return a string representation of the list of OSM primitive ids
-	 */
-	public String getAsString() {
-		StringBuffer sb = new StringBuffer();
-		for(PrimitiveId id: ids) {
-			if (sb.length() > 0) sb.append(",");
-			sb.append(id.getType().getAPIName()).append("/").append(id.getUniqueId());
-		}
-		return sb.toString();
-	}
+    
+    private List<PrimitiveId> ids = new ArrayList<PrimitiveId>();
+    
+    /**
+     * Creates a transferable from a collection of {@see PrimitiveId}s
+     * 
+     * @param ids
+     */
+    public PrimitiveIdTransferable(List<PrimitiveId> ids) {
+        if (ids == null) return;
+        for(PrimitiveId id: ids) {
+            this.ids.add(new SimplePrimitiveId(id.getUniqueId(), id.getType()));
+        }
+    }
+    
+    /**
+     * If flavor is {@see #PRIMITIVE_ID_SET_FLAVOR}, replies a the list of
+     * transferred {@see PrimitiveId}s 
+     * 
+     * If flavor is {@see DataFlavor#stringFlavor}, replies a string representation
+     * of the list of transferred {@see PrimitiveId}s
+     */
+    public Object getTransferData(DataFlavor flavor)
+            throws UnsupportedFlavorException, IOException {
+        if (PRIMITIVE_ID_LIST_FLAVOR.equals(flavor)) {
+            return getPrimitiveIds();
+        } else if (DataFlavor.stringFlavor.equals(flavor)) {
+            return getAsString();
+        }
+        throw new UnsupportedFlavorException(flavor);
+    }
+    
+    /**
+     * Replies the list of OSM primitive ids
+     * 
+     * @return the list of OSM primitive ids
+     */
+    public List<PrimitiveId> getPrimitiveIds() {
+        return ids;
+    }
+    
+    /**
+     * Replies a string representation of the list of OSM primitive ids
+     *  
+     * @return a string representation of the list of OSM primitive ids
+     */
+    public String getAsString() {
+        StringBuffer sb = new StringBuffer();
+        for(PrimitiveId id: ids) {
+            if (sb.length() > 0) sb.append(",");
+            sb.append(id.getType().getAPIName()).append("/").append(id.getUniqueId());
+        }
+        return sb.toString();
+    }
 
-	public DataFlavor[] getTransferDataFlavors() {
-		return SUPPORTED_FLAVORS;
-	}
+    public DataFlavor[] getTransferDataFlavors() {
+        return SUPPORTED_FLAVORS;
+    }
 
-	public boolean isDataFlavorSupported(DataFlavor flavor) {
-		for(DataFlavor df: SUPPORTED_FLAVORS) {
-			if (df.equals(flavor)) return true;
-		}
-		return false;
-	}			
+    public boolean isDataFlavorSupported(DataFlavor flavor) {
+        for(DataFlavor df: SUPPORTED_FLAVORS) {
+            if (df.equals(flavor)) return true;
+        }
+        return false;
+    }           
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/AdvancedEditorPanel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/AdvancedEditorPanel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/AdvancedEditorPanel.java	(revision 23192)
@@ -23,100 +23,100 @@
  */
 public class AdvancedEditorPanel extends JPanel {
-	private static final Logger logger = Logger.getLogger(AdvancedEditorPanel.class.getName());
+    private static final Logger logger = Logger.getLogger(AdvancedEditorPanel.class.getName());
 
-	private TurnRestrictionEditorModel model;
-	private TagEditorPanel pnlTagEditor; 
-	private JPanel pnlRelationMemberEditor;
-	private JTable tblRelationMemberEditor;
-	private JSplitPane spEditors;
-	
-	/**
-	 * Creates the panel with the tag editor 
-	 * 
-	 * @return
-	 */
-	protected JPanel buildTagEditorPanel() {
-		JPanel pnl = new JPanel(new BorderLayout());
-		HtmlPanel msg = new HtmlPanel();
-		msg.setText("<html><body>" + 
-				tr("In the following table you can edit the <strong>raw tags</strong>"
-			  + " of the OSM relation representing this turn restriction.")
-			  + "</body></html>"
-		);
-		pnl.add(msg, BorderLayout.NORTH);
-		pnlTagEditor = new TagEditorPanel(model.getTagEditorModel());	
-		pnlTagEditor.initAutoCompletion(model.getLayer());
-		pnl.add(pnlTagEditor, BorderLayout.CENTER);
-		return pnl;
-	}
-	
-	/**
-	 * Builds the panel with the table for editing relation members
-	 * 
-	 * @return
-	 */
-	protected JPanel buildMemberEditorPanel() {
-		JPanel pnl = new JPanel(new BorderLayout());
-		HtmlPanel msg = new HtmlPanel();
-		msg.setText("<html><body>"  
-			  + tr("In the following table you can edit the <strong>raw members</strong>"
-			  + " of the OSM relation representing this turn restriction.") + "</body></html>"
-		);
-		pnl.add(msg, BorderLayout.NORTH);
-		
-		tblRelationMemberEditor = new RelationMemberTable(model);
-		JScrollPane pane = new JScrollPane(tblRelationMemberEditor);
-		pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
-		pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
-		pnl.add(pane);
-		return pnl;
-	}
-	
-	/**
-	 * Creates the main split panel 
-	 * @return
-	 */
-	protected JSplitPane buildSplitPane() {
-		spEditors = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
-		spEditors.setTopComponent(buildTagEditorPanel());
-		spEditors.setBottomComponent(buildMemberEditorPanel());
-		spEditors.setOneTouchExpandable(false);
-		spEditors.setDividerSize(5);
-		spEditors.addHierarchyListener(new SplitPaneDividerInitializer());
-		return spEditors;
-	}
-	
-	/**
-	 * Builds the user interface
-	 */
-	protected void build() {
-		setLayout(new BorderLayout());
-		add(buildSplitPane(), BorderLayout.CENTER);
-	}
-	
-	/**
-	 * Creates the advanced editor
-	 * 
-	 * @param model the editor model. Must not be null.
-	 * @throws IllegalArgumentException thrown if model is null
-	 */
-	public AdvancedEditorPanel(TurnRestrictionEditorModel model) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(model, "model");
-		this.model = model;
-		build();
-		HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#AdvancedEditor"));
-	}
-	
-	/**
-	 * Initializes the divider location when the components becomes visible the
-	 * first time 
-	 */
-	class SplitPaneDividerInitializer implements HierarchyListener {
-		public void hierarchyChanged(HierarchyEvent e) {
-			if (isShowing()) {
-				spEditors.setDividerLocation(0.5);
-				spEditors.removeHierarchyListener(this);
-			}			
-		}		
-	}
+    private TurnRestrictionEditorModel model;
+    private TagEditorPanel pnlTagEditor; 
+    private JPanel pnlRelationMemberEditor;
+    private JTable tblRelationMemberEditor;
+    private JSplitPane spEditors;
+    
+    /**
+     * Creates the panel with the tag editor 
+     * 
+     * @return
+     */
+    protected JPanel buildTagEditorPanel() {
+        JPanel pnl = new JPanel(new BorderLayout());
+        HtmlPanel msg = new HtmlPanel();
+        msg.setText("<html><body>" + 
+                tr("In the following table you can edit the <strong>raw tags</strong>"
+              + " of the OSM relation representing this turn restriction.")
+              + "</body></html>"
+        );
+        pnl.add(msg, BorderLayout.NORTH);
+        pnlTagEditor = new TagEditorPanel(model.getTagEditorModel());   
+        pnlTagEditor.initAutoCompletion(model.getLayer());
+        pnl.add(pnlTagEditor, BorderLayout.CENTER);
+        return pnl;
+    }
+    
+    /**
+     * Builds the panel with the table for editing relation members
+     * 
+     * @return
+     */
+    protected JPanel buildMemberEditorPanel() {
+        JPanel pnl = new JPanel(new BorderLayout());
+        HtmlPanel msg = new HtmlPanel();
+        msg.setText("<html><body>"  
+              + tr("In the following table you can edit the <strong>raw members</strong>"
+              + " of the OSM relation representing this turn restriction.") + "</body></html>"
+        );
+        pnl.add(msg, BorderLayout.NORTH);
+        
+        tblRelationMemberEditor = new RelationMemberTable(model);
+        JScrollPane pane = new JScrollPane(tblRelationMemberEditor);
+        pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
+        pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+        pnl.add(pane);
+        return pnl;
+    }
+    
+    /**
+     * Creates the main split panel 
+     * @return
+     */
+    protected JSplitPane buildSplitPane() {
+        spEditors = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
+        spEditors.setTopComponent(buildTagEditorPanel());
+        spEditors.setBottomComponent(buildMemberEditorPanel());
+        spEditors.setOneTouchExpandable(false);
+        spEditors.setDividerSize(5);
+        spEditors.addHierarchyListener(new SplitPaneDividerInitializer());
+        return spEditors;
+    }
+    
+    /**
+     * Builds the user interface
+     */
+    protected void build() {
+        setLayout(new BorderLayout());
+        add(buildSplitPane(), BorderLayout.CENTER);
+    }
+    
+    /**
+     * Creates the advanced editor
+     * 
+     * @param model the editor model. Must not be null.
+     * @throws IllegalArgumentException thrown if model is null
+     */
+    public AdvancedEditorPanel(TurnRestrictionEditorModel model) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(model, "model");
+        this.model = model;
+        build();
+        HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#AdvancedEditor"));
+    }
+    
+    /**
+     * Initializes the divider location when the components becomes visible the
+     * first time 
+     */
+    class SplitPaneDividerInitializer implements HierarchyListener {
+        public void hierarchyChanged(HierarchyEvent e) {
+            if (isShowing()) {
+                spEditors.setDividerLocation(0.5);
+                spEditors.removeHierarchyListener(this);
+            }           
+        }       
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanel.java	(revision 23192)
@@ -28,152 +28,152 @@
 public class BasicEditorPanel extends VerticallyScrollablePanel {
 
-	/** the turn restriction model */
-	private TurnRestrictionEditorModel model;
-	
-	/** the UI widgets */
-	private TurnRestrictionLegEditor fromEditor;
-	private TurnRestrictionLegEditor toEditor;
-	private ViaList lstVias;
-	private JLabel lblVias;
-	private JScrollPane spVias;
-	private TurnRestrictionComboBox cbTurnRestrictions;
-	private VehicleExceptionEditor vehicleExceptionsEditor;
-	
-	/**
-	 * builds the UI
-	 */
-	protected void build() {
-		setLayout(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.WEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 0.0;
-		
-		// the editor for selecting the 'from' leg
-	    gc.insets = new Insets(0,0,5,5);	
-	    add(new JLabel(tr("Type:")), gc);
-	    
-	    gc.gridx = 1;
-	    gc.weightx = 1.0;
-	    add(cbTurnRestrictions = new TurnRestrictionComboBox(new TurnRestrictionComboBoxModel(model)), gc);
+    /** the turn restriction model */
+    private TurnRestrictionEditorModel model;
+    
+    /** the UI widgets */
+    private TurnRestrictionLegEditor fromEditor;
+    private TurnRestrictionLegEditor toEditor;
+    private ViaList lstVias;
+    private JLabel lblVias;
+    private JScrollPane spVias;
+    private TurnRestrictionComboBox cbTurnRestrictions;
+    private VehicleExceptionEditor vehicleExceptionsEditor;
+    
+    /**
+     * builds the UI
+     */
+    protected void build() {
+        setLayout(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.WEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 0.0;
+        
+        // the editor for selecting the 'from' leg
+        gc.insets = new Insets(0,0,5,5);    
+        add(new JLabel(tr("Type:")), gc);
+        
+        gc.gridx = 1;
+        gc.weightx = 1.0;
+        add(cbTurnRestrictions = new TurnRestrictionComboBox(new TurnRestrictionComboBoxModel(model)), gc);
 
-		// the editor for selecting the 'from' leg
-	    gc.gridx = 0;
-	    gc.gridy = 1;	
-	    gc.weightx = 0.0;
-	    add(new JLabel(tr("From:")), gc);
-	    
-	    gc.gridx = 1;
-	    gc.weightx = 1.0;
-	    add(fromEditor = new TurnRestrictionLegEditor(model, TurnRestrictionLegRole.FROM),gc);
+        // the editor for selecting the 'from' leg
+        gc.gridx = 0;
+        gc.gridy = 1;   
+        gc.weightx = 0.0;
+        add(new JLabel(tr("From:")), gc);
+        
+        gc.gridx = 1;
+        gc.weightx = 1.0;
+        add(fromEditor = new TurnRestrictionLegEditor(model, TurnRestrictionLegRole.FROM),gc);
 
-	    // the editor for selecting the 'to' leg
-	    gc.gridx = 0;
-	    gc.gridy = 2;
-		gc.weightx = 0.0;
-	    gc.insets = new Insets(0,0,5,5);	
-	    add(new JLabel(tr("To:")), gc);
-	    
-	    gc.gridx = 1;
-	    gc.weightx = 1.0;
-	    add(toEditor = new TurnRestrictionLegEditor(model, TurnRestrictionLegRole.TO),gc);
-	    
-	    // the editor for selecting the 'vias' 
-	    gc.gridx = 0;
-	    gc.gridy = 3;
-		gc.weightx = 0.0;
-	    gc.insets = new Insets(0,0,5,5);	
-	    add(lblVias = new JLabel(tr("Vias:")), gc);
-	    
-	    gc.gridx = 1;
-	    gc.weightx = 1.0;
-	    DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
-	    add(spVias = new JScrollPane(lstVias = new ViaList(new ViaListModel(model, selectionModel), selectionModel)),gc);
-	    if (!Main.pref.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false)) {
-	    	lblVias.setVisible(false);
-	    	spVias.setVisible(false);
-	    }
-	    
-	    // the editor for vehicle exceptions
-	    vehicleExceptionsEditor = new VehicleExceptionEditor(model);
-	    gc.gridx = 0;
-	    gc.gridy = 4;
-		gc.weightx = 1.0;
-		gc.gridwidth = 2;
-	    gc.insets = new Insets(0,0,5,5);	
-	    add(vehicleExceptionsEditor, gc);
-	    
-	    // just a filler - grabs remaining space 
-	    gc.gridx = 0;
-	    gc.gridy = 5;
-	    gc.gridwidth = 2;
-	    gc.weighty = 1.0;
-	    gc.fill = GridBagConstraints.BOTH;
-	    add(new JPanel(), gc);
-	   	    
-	    setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-	}
-	
-	
-	/**
-	 * Creates the panel. 
-	 * 
-	 * @param model the editor model. Must not be null.
-	 * @throws IllegalArgumentException thrown if model is null
-	 */
-	public BasicEditorPanel(TurnRestrictionEditorModel model) {
-		CheckParameterUtil.ensureParameterNotNull(model, "model");
-		this.model = model;
-		build();
-		HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#BasicEditor"));
-	}
-	
-	/**
-	 * Requests the focus on one of the input widgets for turn
-	 * restriction data.
-	 * 
-	 * @param focusTarget the target component to request focus for.
-	 * Ignored if null.
-	 */
-	public void requestFocusFor(BasicEditorFokusTargets focusTarget){
-		if (focusTarget == null) return;
-		switch(focusTarget){
-		case RESTRICION_TYPE:
-			cbTurnRestrictions.requestFocusInWindow();
-			break;
-		case FROM:
-			fromEditor.requestFocusInWindow();
-			break;
-		case TO:
-			toEditor.requestFocusInWindow();
-			break;
-		case VIA:
-			lstVias.requestFocusInWindow();
-			break;
-		}
-	}	
-	
-	/**
-	 * Initializes the set of icons used from the preference key
-	 * {@see PreferenceKeys#ROAD_SIGNS}.
-	 * 
-	 * @param prefs the JOSM preferences 
-	 */
-	public void initIconSetFromPreferences(Preferences prefs){		
-		cbTurnRestrictions.initIconSetFromPreferences(prefs);
-	}
-	
-	/**
-	 * Initializes the visibility of the list of via-objects depending
-	 * on values in the JOSM preferences
-	 * 
-	 * @param prefs the JOSM preferences
-	 */
-	public void initViasVisibilityFromPreferences(Preferences prefs){
-		boolean value = prefs.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false);
-		if (value != lblVias.isVisible()){
-			lblVias.setVisible(value);
-			spVias.setVisible(value);
-		}
-	}
+        // the editor for selecting the 'to' leg
+        gc.gridx = 0;
+        gc.gridy = 2;
+        gc.weightx = 0.0;
+        gc.insets = new Insets(0,0,5,5);    
+        add(new JLabel(tr("To:")), gc);
+        
+        gc.gridx = 1;
+        gc.weightx = 1.0;
+        add(toEditor = new TurnRestrictionLegEditor(model, TurnRestrictionLegRole.TO),gc);
+        
+        // the editor for selecting the 'vias' 
+        gc.gridx = 0;
+        gc.gridy = 3;
+        gc.weightx = 0.0;
+        gc.insets = new Insets(0,0,5,5);    
+        add(lblVias = new JLabel(tr("Vias:")), gc);
+        
+        gc.gridx = 1;
+        gc.weightx = 1.0;
+        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
+        add(spVias = new JScrollPane(lstVias = new ViaList(new ViaListModel(model, selectionModel), selectionModel)),gc);
+        if (!Main.pref.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false)) {
+            lblVias.setVisible(false);
+            spVias.setVisible(false);
+        }
+        
+        // the editor for vehicle exceptions
+        vehicleExceptionsEditor = new VehicleExceptionEditor(model);
+        gc.gridx = 0;
+        gc.gridy = 4;
+        gc.weightx = 1.0;
+        gc.gridwidth = 2;
+        gc.insets = new Insets(0,0,5,5);    
+        add(vehicleExceptionsEditor, gc);
+        
+        // just a filler - grabs remaining space 
+        gc.gridx = 0;
+        gc.gridy = 5;
+        gc.gridwidth = 2;
+        gc.weighty = 1.0;
+        gc.fill = GridBagConstraints.BOTH;
+        add(new JPanel(), gc);
+            
+        setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
+    }
+    
+    
+    /**
+     * Creates the panel. 
+     * 
+     * @param model the editor model. Must not be null.
+     * @throws IllegalArgumentException thrown if model is null
+     */
+    public BasicEditorPanel(TurnRestrictionEditorModel model) {
+        CheckParameterUtil.ensureParameterNotNull(model, "model");
+        this.model = model;
+        build();
+        HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#BasicEditor"));
+    }
+    
+    /**
+     * Requests the focus on one of the input widgets for turn
+     * restriction data.
+     * 
+     * @param focusTarget the target component to request focus for.
+     * Ignored if null.
+     */
+    public void requestFocusFor(BasicEditorFokusTargets focusTarget){
+        if (focusTarget == null) return;
+        switch(focusTarget){
+        case RESTRICION_TYPE:
+            cbTurnRestrictions.requestFocusInWindow();
+            break;
+        case FROM:
+            fromEditor.requestFocusInWindow();
+            break;
+        case TO:
+            toEditor.requestFocusInWindow();
+            break;
+        case VIA:
+            lstVias.requestFocusInWindow();
+            break;
+        }
+    }   
+    
+    /**
+     * Initializes the set of icons used from the preference key
+     * {@see PreferenceKeys#ROAD_SIGNS}.
+     * 
+     * @param prefs the JOSM preferences 
+     */
+    public void initIconSetFromPreferences(Preferences prefs){      
+        cbTurnRestrictions.initIconSetFromPreferences(prefs);
+    }
+    
+    /**
+     * Initializes the visibility of the list of via-objects depending
+     * on values in the JOSM preferences
+     * 
+     * @param prefs the JOSM preferences
+     */
+    public void initViasVisibilityFromPreferences(Preferences prefs){
+        boolean value = prefs.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false);
+        if (value != lblVias.isVisible()){
+            lblVias.setVisible(value);
+            spVias.setVisible(value);
+        }
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ExceptValueModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ExceptValueModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ExceptValueModel.java	(revision 23192)
@@ -14,200 +14,200 @@
  */
 public class ExceptValueModel {
-	/**
-	 * The set of standard vehicle types which can be used in the
-	 * 'except' tag 
-	 */
-	static public final Set<String> STANDARD_VEHICLE_EXCEPTION_VALUES;
-	static {
-		HashSet<String> s = new HashSet<String>();
-		s.add("psv");
-		s.add("hgv");
-		s.add("bicycle");
-		s.add("motorcar");
-		STANDARD_VEHICLE_EXCEPTION_VALUES = Collections.unmodifiableSet(s);
-	}
-	
-	/**
-	 * Replies true, if {@code v} is a standard vehicle type. Replies
-	 * false if {@code v} is null
-	 * 
-	 * @param v the vehicle type. 
-	 * @return true, if {@code v} is a standard vehicle type.
-	 */
-	static public boolean isStandardVehicleExceptionValue(String v){
-		if (v == null) return false;
-		v = v.trim().toLowerCase();
-		return STANDARD_VEHICLE_EXCEPTION_VALUES.contains(v);
-	}
-		
-	private String value = "";
-	private boolean isStandard = true;
-	private final Set<String> vehicleExceptions = new HashSet<String>();
-	
-	
-	protected void parseValue(String value) {
-		if (value == null || value.trim().equals("")) value = "";
-		this.value = value;
-		isStandard = true;
-		vehicleExceptions.clear();
-		if (value.equals("")) return;
-		String[] values = value.split(";");
-		for (String v: values){
-			v = v.trim().toLowerCase();
-			if (isStandardVehicleExceptionValue(v)) {
-				vehicleExceptions.add(v);
-			} else {
-				isStandard = false;
-			}
-		}
-	}
-	
-	/**
-	 * Creates a new model for an empty standard value 
-	 */
-	public ExceptValueModel() {}
-	
-	/**
-	 * Creates a new model for the tag value {@code value}. 
-	 * 
-	 * @param value the tag value
-	 * @see #parseValue(String)
-	 */
-	public ExceptValueModel(String value){
-		if (value == null || value.trim().equals("")) 
-			return;
-		parseValue(value);
-	}
-
-	/**
-	 * Replies the tag value representing the state of this model.
-	 * 
-	 * @return 
-	 */
-	public String getValue() {
-		if (isStandard){
-			StringBuffer sb = new StringBuffer();
-			// we use an ordered list because equals()
-			// is based on getValue()
-			//
-			List<String> values = new ArrayList<String>(vehicleExceptions);
-			Collections.sort(values);
-			for (String v: values){
-				if (sb.length() > 0) {
-					sb.append(";");
-				}
-				sb.append(v);
-			}
-			return sb.toString();
-		} else {
-			return value;
-		}
-	}
-
-	/**
-	 * Sets the value in this model
-	 * 
-	 * @param value
-	 */
-	public void setValue(String value) {
-		parseValue(value);
-	}
-
-	/**
-	 * Replies true if this model currently holds a standard 'except' value
-	 * 
-	 * @return
-	 */
-	public boolean isStandard() {
-		return isStandard;
-	}	
-	
-	/**
-	 * Tells this model to use standard values only.
-	 * 
-	 */
-	public void setStandard(boolean isStandard) {
-		this.isStandard = isStandard;
-	}
-	
-	/**
-	 * Replies true if {@code vehicleType} is currently set as exception in this
-	 * model.
-	 * 
-	 * @param vehicleType one of the standard vehicle types from {@see #STANDARD_VEHICLE_EXCEPTION_VALUES}
-	 * @return true if {@code vehicleType} is currently set as exception in this
-	 * model.
-	 * @exception IllegalArgumentException thrown if {@code vehicleType} isn't a standard vehicle type 
-	 */
-	public boolean isVehicleException(String vehicleType) throws IllegalArgumentException{
-		if (vehicleType == null) return false;
-		if (!isStandardVehicleExceptionValue(vehicleType)) {
-			throw new IllegalArgumentException(MessageFormat.format("vehicleType ''{0}'' isn''t a valid standard vehicle type", vehicleType));
-		}
-		vehicleType = vehicleType.trim().toLowerCase();
-		return vehicleExceptions.contains(vehicleType);
-	}
-	
-	/**
-	 * Sets the {@code vehicleType} as exception in this turn restriction.
-	 * 
-	 * @param vehicleType one of the standard vehicle types from {@see #STANDARD_VEHICLE_EXCEPTION_VALUES}
-	 * @exception IllegalArgumentException thrown if {@code vehicleType} isn't a standard vehicle type 
-	 */
-	public void setVehicleException(String vehicleType) throws IllegalArgumentException{
-		if (!isStandardVehicleExceptionValue(vehicleType)) {
-			throw new IllegalArgumentException(MessageFormat.format("vehicleType ''{0}'' isn''t a valid standard vehicle type", vehicleType));
-		}
-		vehicleExceptions.add(vehicleType.trim().toLowerCase());
-	}
-	
-
-	/**
-	 * Sets or removes the {@code vehicleType} as exception in this turn restriction, depending
-	 * on whether {@code setOrRemove} is true or false, respectively.
-	 * 
-	 * @param vehicleType one of the standard vehicle types from {@see #STANDARD_VEHICLE_EXCEPTION_VALUES}
-	 * @param setOrRemove if true, the exception is set; otherwise, it is removed
-	 * @exception IllegalArgumentException thrown if {@code vehicleType} isn't a standard vehicle type 
-	 */
-	public void setVehicleException(String vehicleType, boolean setOrRemove) throws IllegalArgumentException{
-		if (setOrRemove){
-			setVehicleException(vehicleType);
-		} else {
-			removeVehicleException(vehicleType);
-		}
-	}
-	
-	/**
-	 * Removes the {@code vehicleType} as exception in this turn restriction
-	 * 
-	 * @param vehicleType one of the standard vehicle types from {@see #STANDARD_VEHICLE_EXCEPTION_VALUES}
-	 * @exception IllegalArgumentException thrown if {@code vehicleType} isn't a standard vehicle type 
-	 */
-	public void removeVehicleException(String vehicleType) throws IllegalArgumentException{
-		if (!isStandardVehicleExceptionValue(vehicleType)) {
-			throw new IllegalArgumentException(MessageFormat.format("vehicleType ''{0}'' isn''t a valid standard vehicle type", vehicleType));
-		}
-		vehicleExceptions.remove(vehicleType.trim().toLowerCase());
-	}
-
-	@Override
-	public int hashCode() {
-		final int prime = 31;
-		int result = 1;
-		result = prime * result + getValue().hashCode();
-		return result;
-	}
-
-	@Override
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		ExceptValueModel other = (ExceptValueModel) obj;
-		return getValue().equals(other.getValue());
-	}		
+    /**
+     * The set of standard vehicle types which can be used in the
+     * 'except' tag 
+     */
+    static public final Set<String> STANDARD_VEHICLE_EXCEPTION_VALUES;
+    static {
+        HashSet<String> s = new HashSet<String>();
+        s.add("psv");
+        s.add("hgv");
+        s.add("bicycle");
+        s.add("motorcar");
+        STANDARD_VEHICLE_EXCEPTION_VALUES = Collections.unmodifiableSet(s);
+    }
+    
+    /**
+     * Replies true, if {@code v} is a standard vehicle type. Replies
+     * false if {@code v} is null
+     * 
+     * @param v the vehicle type. 
+     * @return true, if {@code v} is a standard vehicle type.
+     */
+    static public boolean isStandardVehicleExceptionValue(String v){
+        if (v == null) return false;
+        v = v.trim().toLowerCase();
+        return STANDARD_VEHICLE_EXCEPTION_VALUES.contains(v);
+    }
+        
+    private String value = "";
+    private boolean isStandard = true;
+    private final Set<String> vehicleExceptions = new HashSet<String>();
+    
+    
+    protected void parseValue(String value) {
+        if (value == null || value.trim().equals("")) value = "";
+        this.value = value;
+        isStandard = true;
+        vehicleExceptions.clear();
+        if (value.equals("")) return;
+        String[] values = value.split(";");
+        for (String v: values){
+            v = v.trim().toLowerCase();
+            if (isStandardVehicleExceptionValue(v)) {
+                vehicleExceptions.add(v);
+            } else {
+                isStandard = false;
+            }
+        }
+    }
+    
+    /**
+     * Creates a new model for an empty standard value 
+     */
+    public ExceptValueModel() {}
+    
+    /**
+     * Creates a new model for the tag value {@code value}. 
+     * 
+     * @param value the tag value
+     * @see #parseValue(String)
+     */
+    public ExceptValueModel(String value){
+        if (value == null || value.trim().equals("")) 
+            return;
+        parseValue(value);
+    }
+
+    /**
+     * Replies the tag value representing the state of this model.
+     * 
+     * @return 
+     */
+    public String getValue() {
+        if (isStandard){
+            StringBuffer sb = new StringBuffer();
+            // we use an ordered list because equals()
+            // is based on getValue()
+            //
+            List<String> values = new ArrayList<String>(vehicleExceptions);
+            Collections.sort(values);
+            for (String v: values){
+                if (sb.length() > 0) {
+                    sb.append(";");
+                }
+                sb.append(v);
+            }
+            return sb.toString();
+        } else {
+            return value;
+        }
+    }
+
+    /**
+     * Sets the value in this model
+     * 
+     * @param value
+     */
+    public void setValue(String value) {
+        parseValue(value);
+    }
+
+    /**
+     * Replies true if this model currently holds a standard 'except' value
+     * 
+     * @return
+     */
+    public boolean isStandard() {
+        return isStandard;
+    }   
+    
+    /**
+     * Tells this model to use standard values only.
+     * 
+     */
+    public void setStandard(boolean isStandard) {
+        this.isStandard = isStandard;
+    }
+    
+    /**
+     * Replies true if {@code vehicleType} is currently set as exception in this
+     * model.
+     * 
+     * @param vehicleType one of the standard vehicle types from {@see #STANDARD_VEHICLE_EXCEPTION_VALUES}
+     * @return true if {@code vehicleType} is currently set as exception in this
+     * model.
+     * @exception IllegalArgumentException thrown if {@code vehicleType} isn't a standard vehicle type 
+     */
+    public boolean isVehicleException(String vehicleType) throws IllegalArgumentException{
+        if (vehicleType == null) return false;
+        if (!isStandardVehicleExceptionValue(vehicleType)) {
+            throw new IllegalArgumentException(MessageFormat.format("vehicleType ''{0}'' isn''t a valid standard vehicle type", vehicleType));
+        }
+        vehicleType = vehicleType.trim().toLowerCase();
+        return vehicleExceptions.contains(vehicleType);
+    }
+    
+    /**
+     * Sets the {@code vehicleType} as exception in this turn restriction.
+     * 
+     * @param vehicleType one of the standard vehicle types from {@see #STANDARD_VEHICLE_EXCEPTION_VALUES}
+     * @exception IllegalArgumentException thrown if {@code vehicleType} isn't a standard vehicle type 
+     */
+    public void setVehicleException(String vehicleType) throws IllegalArgumentException{
+        if (!isStandardVehicleExceptionValue(vehicleType)) {
+            throw new IllegalArgumentException(MessageFormat.format("vehicleType ''{0}'' isn''t a valid standard vehicle type", vehicleType));
+        }
+        vehicleExceptions.add(vehicleType.trim().toLowerCase());
+    }
+    
+
+    /**
+     * Sets or removes the {@code vehicleType} as exception in this turn restriction, depending
+     * on whether {@code setOrRemove} is true or false, respectively.
+     * 
+     * @param vehicleType one of the standard vehicle types from {@see #STANDARD_VEHICLE_EXCEPTION_VALUES}
+     * @param setOrRemove if true, the exception is set; otherwise, it is removed
+     * @exception IllegalArgumentException thrown if {@code vehicleType} isn't a standard vehicle type 
+     */
+    public void setVehicleException(String vehicleType, boolean setOrRemove) throws IllegalArgumentException{
+        if (setOrRemove){
+            setVehicleException(vehicleType);
+        } else {
+            removeVehicleException(vehicleType);
+        }
+    }
+    
+    /**
+     * Removes the {@code vehicleType} as exception in this turn restriction
+     * 
+     * @param vehicleType one of the standard vehicle types from {@see #STANDARD_VEHICLE_EXCEPTION_VALUES}
+     * @exception IllegalArgumentException thrown if {@code vehicleType} isn't a standard vehicle type 
+     */
+    public void removeVehicleException(String vehicleType) throws IllegalArgumentException{
+        if (!isStandardVehicleExceptionValue(vehicleType)) {
+            throw new IllegalArgumentException(MessageFormat.format("vehicleType ''{0}'' isn''t a valid standard vehicle type", vehicleType));
+        }
+        vehicleExceptions.remove(vehicleType.trim().toLowerCase());
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + getValue().hashCode();
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        ExceptValueModel other = (ExceptValueModel) obj;
+        return getValue().equals(other.getValue());
+    }       
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionListModel.java	(revision 23192)
@@ -40,6 +40,6 @@
  */
 public class JosmSelectionListModel extends AbstractListModel implements EditLayerChangeListener, SelectionChangedListener, DataSetListener, PrimitiveIdListProvider{
-	static private final Logger logger = Logger.getLogger(JosmSelectionListModel.class.getName());
-	
+    static private final Logger logger = Logger.getLogger(JosmSelectionListModel.class.getName());
+    
     private final List<OsmPrimitive> selection = new ArrayList<OsmPrimitive>();
     private DefaultListSelectionModel selectionModel;
@@ -55,7 +55,7 @@
      */
     public JosmSelectionListModel(OsmDataLayer layer, DefaultListSelectionModel selectionModel) {
-    	CheckParameterUtil.ensureParameterNotNull(selectionModel, "selectionModel");
-    	CheckParameterUtil.ensureParameterNotNull(layer, "layer");
-    	this.layer = layer;
+        CheckParameterUtil.ensureParameterNotNull(selectionModel, "selectionModel");
+        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
+        this.layer = layer;
         this.selectionModel = selectionModel;
         setJOSMSelection(layer.data.getSelected());
@@ -115,5 +115,5 @@
      */
     public void setJOSMSelection(Collection<? extends OsmPrimitive> selection) {
-    	Collection<OsmPrimitive> sel = getSelected();
+        Collection<OsmPrimitive> sel = getSelected();
         this.selection.clear();
         if (selection == null) {
@@ -150,10 +150,10 @@
     public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) {
         if (newLayer == null) {
-        	// don't show a JOSM selection if we don't have a data layer 
+            // don't show a JOSM selection if we don't have a data layer 
             setJOSMSelection(null);
         } else if (newLayer != layer){
-        	// don't show a JOSM selection if this turn restriction editor doesn't
-        	// manipulate data in the current data layer
-        	setJOSMSelection(null);
+            // don't show a JOSM selection if this turn restriction editor doesn't
+            // manipulate data in the current data layer
+            setJOSMSelection(null);
         } else {
             setJOSMSelection(newLayer.data.getSelected());
@@ -165,9 +165,9 @@
     /* ------------------------------------------------------------------------ */
     public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-    	// only update the JOSM selection if it is changed in the same data layer
-    	// this turn restriction editor is working on
-    	OsmDataLayer layer = Main.main.getEditLayer();
-    	if(layer == null) return;
-    	if (layer != this.layer) return;
+        // only update the JOSM selection if it is changed in the same data layer
+        // this turn restriction editor is working on
+        OsmDataLayer layer = Main.main.getEditLayer();
+        if(layer == null) return;
+        if (layer != this.layer) return;
         setJOSMSelection(newSelection);
     }
@@ -184,5 +184,5 @@
         if (event.getDataset() != layer.data) return;
         // may influence the display name of primitives, update the data
-    	update(event.getPrimitives());
+        update(event.getPrimitives());
     }
 
@@ -217,12 +217,12 @@
     /* interface PrimitiveIdListProvider                                        */
     /* ------------------------------------------------------------------------ */
-	public List<PrimitiveId> getSelectedPrimitiveIds() {
-		List<PrimitiveId> ret = new ArrayList<PrimitiveId>(getSelected().size());
-		for(int i=0; i< selection.size(); i++) {
-			if (selectionModel.isSelectedIndex(i)) {
-				ret.add(selection.get(i).getPrimitiveId());
-			}
-		}
-		return ret;
-	}
+    public List<PrimitiveId> getSelectedPrimitiveIds() {
+        List<PrimitiveId> ret = new ArrayList<PrimitiveId>(getSelected().size());
+        for(int i=0; i< selection.size(); i++) {
+            if (selectionModel.isSelectedIndex(i)) {
+                ret.add(selection.get(i).getPrimitiveId());
+            }
+        }
+        return ret;
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionPanel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionPanel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/JosmSelectionPanel.java	(revision 23192)
@@ -42,105 +42,105 @@
  */
 public class JosmSelectionPanel extends JPanel {
-	/**  the list view */
-	private JList lstSelection;
-	/** the model managing the selection */
-	private JosmSelectionListModel model;
-	
-	private CopyAction actCopy;
-	private TransferHandler transferHandler;
-	
-	/**
-	 * builds the UI for the panel 
-	 */
-	protected void build(OsmDataLayer layer) {
-		setLayout(new BorderLayout());
-		DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
-		model = new JosmSelectionListModel(layer,selectionModel);
-		lstSelection = new JList(model);
-		lstSelection.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-		lstSelection.setSelectionModel(selectionModel);
-		lstSelection.setCellRenderer(new OsmPrimitivRenderer());
-		lstSelection.setTransferHandler(transferHandler = new JosmSelectionTransferHandler(model));
-		lstSelection.setDragEnabled(true);
-		
-		add(new JScrollPane(lstSelection), BorderLayout.CENTER);
-		add(new JLabel(tr("Selection")), BorderLayout.NORTH);
-		
-		setBorder(BorderFactory.createEmptyBorder(5,5,5,5));		
-		actCopy = new CopyAction();
-		lstSelection.addMouseListener(new PopupLauncher());
-	}
-	
-	/**
-	 * Creates the JOSM selection panel for the selection in an OSM data layer
-	 * 
-	 * @param layer the data layer. Must not be null.
-	 * @exception IllegalArgumentException thrown if {@code layer} is null
-	 */
-	public JosmSelectionPanel(OsmDataLayer layer) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(layer, "layer");
-		build(layer); 
-	}
-	
-	/**
-	 * wires the UI as listener to global event sources 
-	 */
-	public void wireListeners() {
-		MapView.addEditLayerChangeListener(model);
-		DatasetEventManager.getInstance().addDatasetListener(model, FireMode.IN_EDT);
-		SelectionEventManager.getInstance().addSelectionListener(model, FireMode.IN_EDT_CONSOLIDATED);
-	}
-	
-	/**
-	 * removes the UI as listener to global event sources 
-	 */
-	public void unwireListeners() {
-		MapView.removeEditLayerChangeListener(model);
-		DatasetEventManager.getInstance().removeDatasetListener(model);
-		SelectionEventManager.getInstance().removeSelectionListener(model);		
-	}
-	
-	class PopupLauncher extends PopupMenuLauncher {
-		@Override
-		public void launch(MouseEvent evt) {
-			new PopupMenu().show(lstSelection, evt.getX(), evt.getY());
-		}		
-	}
-	
-	class PopupMenu extends JPopupMenu {
-		public PopupMenu() {
-			JMenuItem item = add(actCopy);
-			item.setTransferHandler(transferHandler);
-			actCopy.setEnabled(!model.getSelected().isEmpty());
-		}
-	}
+    /**  the list view */
+    private JList lstSelection;
+    /** the model managing the selection */
+    private JosmSelectionListModel model;
+    
+    private CopyAction actCopy;
+    private TransferHandler transferHandler;
+    
+    /**
+     * builds the UI for the panel 
+     */
+    protected void build(OsmDataLayer layer) {
+        setLayout(new BorderLayout());
+        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
+        model = new JosmSelectionListModel(layer,selectionModel);
+        lstSelection = new JList(model);
+        lstSelection.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+        lstSelection.setSelectionModel(selectionModel);
+        lstSelection.setCellRenderer(new OsmPrimitivRenderer());
+        lstSelection.setTransferHandler(transferHandler = new JosmSelectionTransferHandler(model));
+        lstSelection.setDragEnabled(true);
+        
+        add(new JScrollPane(lstSelection), BorderLayout.CENTER);
+        add(new JLabel(tr("Selection")), BorderLayout.NORTH);
+        
+        setBorder(BorderFactory.createEmptyBorder(5,5,5,5));        
+        actCopy = new CopyAction();
+        lstSelection.addMouseListener(new PopupLauncher());
+    }
+    
+    /**
+     * Creates the JOSM selection panel for the selection in an OSM data layer
+     * 
+     * @param layer the data layer. Must not be null.
+     * @exception IllegalArgumentException thrown if {@code layer} is null
+     */
+    public JosmSelectionPanel(OsmDataLayer layer) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
+        build(layer); 
+    }
+    
+    /**
+     * wires the UI as listener to global event sources 
+     */
+    public void wireListeners() {
+        MapView.addEditLayerChangeListener(model);
+        DatasetEventManager.getInstance().addDatasetListener(model, FireMode.IN_EDT);
+        SelectionEventManager.getInstance().addSelectionListener(model, FireMode.IN_EDT_CONSOLIDATED);
+    }
+    
+    /**
+     * removes the UI as listener to global event sources 
+     */
+    public void unwireListeners() {
+        MapView.removeEditLayerChangeListener(model);
+        DatasetEventManager.getInstance().removeDatasetListener(model);
+        SelectionEventManager.getInstance().removeSelectionListener(model);     
+    }
+    
+    class PopupLauncher extends PopupMenuLauncher {
+        @Override
+        public void launch(MouseEvent evt) {
+            new PopupMenu().show(lstSelection, evt.getX(), evt.getY());
+        }       
+    }
+    
+    class PopupMenu extends JPopupMenu {
+        public PopupMenu() {
+            JMenuItem item = add(actCopy);
+            item.setTransferHandler(transferHandler);
+            actCopy.setEnabled(!model.getSelected().isEmpty());
+        }
+    }
 
-	class CopyAction extends AbstractAction {
-		private Action delegate;
-		
-		public CopyAction(){
-			putValue(NAME, tr("Copy"));
-			putValue(SHORT_DESCRIPTION, tr("Copy to the clipboard"));
-			putValue(SMALL_ICON, ImageProvider.get("copy"));
-			putValue(ACCELERATOR_KEY, Shortcut.getCopyKeyStroke());
-			delegate = lstSelection.getActionMap().get("copy");
-		}
+    class CopyAction extends AbstractAction {
+        private Action delegate;
+        
+        public CopyAction(){
+            putValue(NAME, tr("Copy"));
+            putValue(SHORT_DESCRIPTION, tr("Copy to the clipboard"));
+            putValue(SMALL_ICON, ImageProvider.get("copy"));
+            putValue(ACCELERATOR_KEY, Shortcut.getCopyKeyStroke());
+            delegate = lstSelection.getActionMap().get("copy");
+        }
 
-		public void actionPerformed(ActionEvent e) {
-			delegate.actionPerformed(e);
-		}
-	}
-	
-	static private class JosmSelectionTransferHandler extends PrimitiveIdListTransferHandler {
-		public JosmSelectionTransferHandler(PrimitiveIdListProvider provider) {
-			super(provider);
-		}
+        public void actionPerformed(ActionEvent e) {
+            delegate.actionPerformed(e);
+        }
+    }
+    
+    static private class JosmSelectionTransferHandler extends PrimitiveIdListTransferHandler {
+        public JosmSelectionTransferHandler(PrimitiveIdListProvider provider) {
+            super(provider);
+        }
 
-		@Override
-		public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
-			// the JOSM selection list is read-only. Don't allow to drop or paste
-			// data on it
-			return false;
-		}
-	}
+        @Override
+        public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
+            // the JOSM selection list is read-only. Don't allow to drop or paste
+            // data on it
+            return false;
+        }
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/NavigationControler.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/NavigationControler.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/NavigationControler.java	(revision 23192)
@@ -2,12 +2,12 @@
 
 public interface NavigationControler {
-	public enum BasicEditorFokusTargets {
-		RESTRICION_TYPE,
-		FROM,
-		TO,
-		VIA
-	}	
-	void gotoBasicEditor();	
-	void gotoAdvancedEditor();
-	void gotoBasicEditor(BasicEditorFokusTargets focusTarget);	
+    public enum BasicEditorFokusTargets {
+        RESTRICION_TYPE,
+        FROM,
+        TO,
+        VIA
+    }   
+    void gotoBasicEditor(); 
+    void gotoAdvancedEditor();
+    void gotoBasicEditor(BasicEditorFokusTargets focusTarget);  
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberColumnModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberColumnModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberColumnModel.java	(revision 23192)
@@ -14,34 +14,34 @@
  */
 public class RelationMemberColumnModel extends DefaultTableColumnModel{
-	protected void build() {
-		TableColumn col = new TableColumn();
-		
-		 // the role column
-		 col.setHeaderValue(tr("Role"));
-		 col.setResizable(true);
-		 col.setPreferredWidth(100);	
-		 col.setCellEditor(new MemberRoleCellEditor());
-		 col.setCellRenderer(new RelationMemberRoleCellRenderer());
-		 addColumn(col);
-		 
-		  // column 1 - the member
-	      col = new TableColumn(1);
-	      col.setHeaderValue(tr("Refers to"));
-	      col.setResizable(true);
-	      col.setPreferredWidth(300);
-	      col.setCellRenderer(new RelationMemberTargetCellRenderer());
-	      addColumn(col);	      
-	}
-	
-	/**
-	 * Creates the column model with a given column selection model.
-	 * 
-	 * @param colSelectionModel the column selection model. Must not be null.
-	 * @throws IllegalArgumentException thrown if {@code colSelectionModel} is null
-	 */
-	public RelationMemberColumnModel(DefaultListSelectionModel colSelectionModel) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(colSelectionModel, "colSelectionModel");
-		setSelectionModel(colSelectionModel);
-		build();
-	}
+    protected void build() {
+        TableColumn col = new TableColumn();
+        
+         // the role column
+         col.setHeaderValue(tr("Role"));
+         col.setResizable(true);
+         col.setPreferredWidth(100);    
+         col.setCellEditor(new MemberRoleCellEditor());
+         col.setCellRenderer(new RelationMemberRoleCellRenderer());
+         addColumn(col);
+         
+          // column 1 - the member
+          col = new TableColumn(1);
+          col.setHeaderValue(tr("Refers to"));
+          col.setResizable(true);
+          col.setPreferredWidth(300);
+          col.setCellRenderer(new RelationMemberTargetCellRenderer());
+          addColumn(col);         
+    }
+    
+    /**
+     * Creates the column model with a given column selection model.
+     * 
+     * @param colSelectionModel the column selection model. Must not be null.
+     * @throws IllegalArgumentException thrown if {@code colSelectionModel} is null
+     */
+    public RelationMemberColumnModel(DefaultListSelectionModel colSelectionModel) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(colSelectionModel, "colSelectionModel");
+        setSelectionModel(colSelectionModel);
+        build();
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberEditorModel.java	(revision 23192)
@@ -24,469 +24,469 @@
 import org.openstreetmap.josm.tools.CheckParameterUtil;
 
-public class RelationMemberEditorModel extends AbstractTableModel{	
-	static private final Logger logger = Logger.getLogger(RelationMemberEditorModel.class.getName());
-	private final ArrayList<RelationMemberModel> members = new ArrayList<RelationMemberModel>();
-	private OsmDataLayer layer;
-	private DefaultListSelectionModel rowSelectionModel;
-	private DefaultListSelectionModel colSelectionModel;
-	
-	/**
-	 * Creates a new model in the context of an {@see OsmDataLayer}. Internally allocates
-	 * a row and a column selection model, see {@see #getRowSelectionModel()} and 
-	 * {@see #getColSelectionModel()}.
-	 * 
-	 * @param layer the data layer. Must not be null.
-	 * @exception IllegalArgumentException thrown if layer is null
-	 */
-	public RelationMemberEditorModel(OsmDataLayer layer) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(layer, "layer");
-		this.layer = layer;
-		rowSelectionModel = new DefaultListSelectionModel();
-		colSelectionModel = new DefaultListSelectionModel();
-	}
-
-	/**
-	 *  Creates a new model in the context of an {@see OsmDataLayer}
-	 *  
-	 * @param layer layer the data layer. Must not be null.
-	 * @param rowSelectionModel the row selection model. Must not be null.
-	 * @param colSelectionModel the column selection model. Must not be null.
-	 * @throws IllegalArgumentException thrown if layer is null
-	 * @throws IllegalArgumentException thrown if rowSelectionModel is null
-	 * @throws IllegalArgumentException thrown if colSelectionModel is null
-	 */
-	public RelationMemberEditorModel(OsmDataLayer layer, DefaultListSelectionModel rowSelectionModel, DefaultListSelectionModel colSelectionModel) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(layer, "layer");
-		CheckParameterUtil.ensureParameterNotNull(rowSelectionModel, "rowSelectionModel");
-		CheckParameterUtil.ensureParameterNotNull(colSelectionModel, "colSelectionModel");
-		this.layer = layer;
-		this.rowSelectionModel = rowSelectionModel;
-		this.colSelectionModel = colSelectionModel;
-	}
-
-	/**
-	 * Replies the row selection model used in this table model.
-	 * 
-	 * @return the row selection model 
-	 */
-	public DefaultListSelectionModel getRowSelectionModel() {
-		return rowSelectionModel;
-	}
-	
-	/**
-	 * Replies the column selection model used in this table model.
-	 * 
-	 * @return the col selection model
-	 */
-	public DefaultListSelectionModel getColSelectionModel() {
-		return colSelectionModel;
-	}
-	
-	/**
-	 * Replies the set of {@see OsmPrimitive}s with the role {@code role}. If no
-	 * such primitives exists, the empty set is returned.
-	 * 
-	 * @return the set of {@see OsmPrimitive}s with the role {@code role}
-	 */
-	protected Set<OsmPrimitive> getPrimitivesWithRole(String role) {
-		HashSet<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
-		for (RelationMemberModel rm: members){
-			if (rm.getRole().equals(role)){
-				OsmPrimitive p = layer.data.getPrimitiveById(rm.getTarget());
-				if (p != null){
-					ret.add(p);
-				}
-			}
-		}
-		return ret;
-	}
-	
-	/**
-	 * Replies the list of {@see RelationMemberModel}s with the role {@code role}. If no
-	 * such primitives exists, the empty set is returned.
-	 * 
-	 * @return the set of {@see RelationMemberModel}s with the role {@code role}
-	 */
-	protected List<RelationMemberModel> getRelationMembersWithRole(String role) {
-		ArrayList<RelationMemberModel> ret = new ArrayList<RelationMemberModel>();
-		for (RelationMemberModel rm: members){
-			if (rm.getRole().equals(role)){
-				ret.add(rm);
-			}
-		}
-		return ret;
-	}
-	
-	/**
-	 * Removes all members with role {@code role}.
-	 * 
-	 * @param role the role. Ignored if null.
-	 * @return true if the list of members was modified; false, otherwise
-	 */
-	protected boolean removeMembersWithRole(String role){
-		if (role == null) return false;
-		boolean isChanged = false;
-		for(Iterator<RelationMemberModel> it = members.iterator(); it.hasNext(); ){
-			RelationMemberModel rm = it.next();
-			if (rm.getRole().equals(role)) {
-				it.remove();
-				isChanged = true;
-			}
-		}
-		return isChanged;
-	}
-		
-	/**
-	 * Replies the set of {@see OsmPrimitive}s with the role 'from'. If no
-	 * such primitives exists, the empty set is returned.
-	 * 
-	 * @return the set of {@see OsmPrimitive}s with the role 'from'
-	 */
-	public Set<OsmPrimitive> getFromPrimitives() {
-		return getPrimitivesWithRole("from");		
-	}
-	
-	/**
-	 * Replies the set of {@see OsmPrimitive}s with the role 'to'. If no
-	 * such primitives exists, the empty set is returned.
-	 * 
-	 * @return the set of {@see OsmPrimitive}s with the role 'from'
-	 */
-	public Set<OsmPrimitive> getToPrimitives() {
-		return getPrimitivesWithRole("to");
-	}
-	
-	/**
-	 * Replies the list of 'via' objects in the order they occur in the
-	 * member list. Replies an empty list if no vias exist
-	 * 
-	 * @return 
-	 */
-	public List<OsmPrimitive> getVias() {
-		ArrayList<OsmPrimitive> ret = new ArrayList<OsmPrimitive>();
-		for (RelationMemberModel rm: getRelationMembersWithRole("via")){
-			ret.add(layer.data.getPrimitiveById(rm.getTarget()));
-		}
-		return ret;
-	}
-	
-	/**
-	 * Sets the list of vias. Removes all 'vias' if {@code vias} is null.
-	 * 
-	 * null vias are skipped. A via must belong to the dataset of the layer in whose context
-	 * this editor is working, otherwise an {@see IllegalArgumentException} is thrown.
-	 * 
-	 * @param vias the vias.
-	 * @exception IllegalArgumentException thrown if a via doesn't belong to the dataset of the layer
-	 * in whose context this editor is working 
-	 */
-	public void setVias(List<OsmPrimitive> vias) throws IllegalArgumentException{
-		boolean viasDeleted = removeMembersWithRole("via");
-		if (vias == null || vias.isEmpty()){
-			if (viasDeleted){
-				fireTableDataChanged();
-			}
-			return;
-		}
-		// check vias 
-		for (OsmPrimitive via: vias) {
-			if (via == null) continue;
-			if (via.getDataSet() == null || via.getDataSet() != layer.data){
-				throw new IllegalArgumentException(MessageFormat.format("via object ''{0}'' must belong to dataset of layer ''{1}''", via.getDisplayName(DefaultNameFormatter.getInstance()), layer.getName()));
-			}
-		}
-		// add vias 
-		for (OsmPrimitive via: vias) {
-			if (via == null) continue;
-			RelationMemberModel model = new RelationMemberModel("via", via);
-			members.add(model);
-		}
-		fireTableDataChanged();
-	}
-	
-	/**
-	 * Sets the turn restriction member with role {@code role}. Removes all
-	 * members with role {@code role} if {@code id} is null.
-	 * 
-	 * @param id the id 
-	 * @return true if the model was modified; false, otherwise
-	 */
-	protected boolean setPrimitiveWithRole(PrimitiveId id, String role){
-		if (id == null){
-			return removeMembersWithRole(role);
-		}
-		
-		List<RelationMemberModel> fromMembers = getRelationMembersWithRole(role);
-		if (fromMembers.isEmpty()){
-			RelationMemberModel rm = new RelationMemberModel(role, id);
-			members.add(rm);
-			return true;
-		} else if (fromMembers.size() == 1){
-			RelationMemberModel rm = fromMembers.get(0);
-			if (!rm.getTarget().equals(id)){
-				rm.setTarget(id);
-				return true;
-			}
-			return false;
-		} else {
-			removeMembersWithRole(role);
-			RelationMemberModel rm = new RelationMemberModel(role, id);
-			members.add(rm);
-			return true;
-		}
-	}
-	
-	/**
-	 * Sets the turn restriction member with role 'from'. Removes all
-	 * members with role 'from' if {@code id} is null.
-	 * 
-	 * @param id the id 
-	 */
-	public void setFromPrimitive(PrimitiveId id){
-		if (setPrimitiveWithRole(id, "from")) {
-			fireTableDataChanged();
-		}
-	}
-	
-	/**
-	 * Sets the turn restriction member with role 'to'. Removes all
-	 * members with role 'to' if {@code id} is null.
-	 * 
-	 * @param id the id 
-	 */
-	public void setToPrimitive(PrimitiveId id){
-		if (setPrimitiveWithRole(id, "to")) {
-			fireTableDataChanged();
-		}
-	}
-	
-	/**
-	 * Replies the set of {@see OsmPrimitive}s referred to by members in
-	 * this model.
-	 * 
-	 * @return the set of {@see OsmPrimitive}s referred to by members in
-	 * this model.
-	 */
-	public Set<OsmPrimitive> getMemberPrimitives() {
-		Set<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
-		for (RelationMemberModel rm: members){
-			OsmPrimitive p = layer.data.getPrimitiveById(rm.getTarget());
-			if (p != null) ret.add(p);
-		}
-		return ret;
-	}
-	
-	/**
-	 * Populates the model with the relation member of a turn restriction. Clears
-	 * the model if {@code tr} is null. 
-	 * 
-	 * @param tr the turn restriction
-	 */
-	public void populate(Relation tr){
-		members.clear();
-		if (tr == null){
-			fireTableDataChanged();
-			return;
-		}
-		for(RelationMember rm: tr.getMembers()){
-			members.add(new RelationMemberModel(rm));
-		}
-		fireTableDataChanged();
-	}
-	
-	/**
-	 * Replaces the member of turn restriction {@code tr} by the relation members currently
-	 * edited in this model.
-	 * 
-	 * @param tr the turn restriction. Ignored if null.
-	 */
-	public void applyTo(Relation tr){
-		if (tr == null) return;
-		List<RelationMember> newMembers = new ArrayList<RelationMember>();
-		for(RelationMemberModel model: members){
-			RelationMember rm = new RelationMember(model.getRole(), layer.data.getPrimitiveById(model.getTarget()));
-			newMembers.add(rm);
-		}
-		tr.setMembers(newMembers);
-	}
-	
-	/**
-	 * Clears the roles of all relation members currently selected in the 
-	 * table.
-	 */
-	protected void clearSelectedRoles(){
-		for(int i=0; i < getRowCount();i++){
-			if (rowSelectionModel.isSelectedIndex(i)) {
-				members.get(i).setRole("");
-			}
-		}		
-	}
-	
-	/**
-	 * Removes the currently selected rows from the model 
-	 */
-	protected void removedSelectedMembers() {
-		for(int i=getRowCount()-1; i >= 0;i--){
-			if (rowSelectionModel.isSelectedIndex(i)) {
-				members.remove(i);
-			}
-		}
-	}
-	
-	/**
-	 * Deletes the current selection.
-	 * 
-	 * If only cells in the first column are selected, the roles of the selected
-	 * members are reset to the empty string. Otherwise the selected members are
-	 * removed from the model. 
-	 * 
-	 */
-	public void deleteSelected() {
-		if (colSelectionModel.isSelectedIndex(0) && !colSelectionModel.isSelectedIndex(1)) {
-			clearSelectedRoles();
-		} else if (rowSelectionModel.getMinSelectionIndex() >= 0){
-			removedSelectedMembers();
-		}
-		fireTableDataChanged();
-	}
-	
-	protected List<Integer> getSelectedIndices() {
-		ArrayList<Integer> ret = new ArrayList<Integer>();
-		for(int i =0; i < members.size(); i++){
-			if (rowSelectionModel.isSelectedIndex(i)) 
-				ret.add(i);
-		}
-		return ret;
-	}
-	
-	public boolean canMoveUp() {
-		List<Integer> sel = getSelectedIndices();
-		if (sel.isEmpty()) return false;
-		return sel.get(0) > 0;
-	}
-	
-	public boolean canMoveDown() {
-		List<Integer> sel = getSelectedIndices();
-		if (sel.isEmpty()) return false;
-		return sel.get(sel.size()-1) < members.size()-1;
-	}
-	
-	public void moveUpSelected() {
-		if (!canMoveUp()) return;
-		List<Integer> sel = getSelectedIndices();
-		for (int idx: sel){
-			RelationMemberModel m = members.remove(idx);
-			members.add(idx-1, m);
-		}
-		fireTableDataChanged();
-		rowSelectionModel.clearSelection();
-		colSelectionModel.setSelectionInterval(0, 1);
-		for (int idx: sel){
-			rowSelectionModel.addSelectionInterval(idx-1, idx-1);
-		}
-	}
-	
-	public void moveDownSelected() {
-		if (!canMoveDown()) return;
-		List<Integer> sel = getSelectedIndices();
-		for (int i = sel.size()-1; i>=0;i--){
-			int idx = sel.get(i);
-			RelationMemberModel m = members.remove(idx);
-			members.add(idx+1, m);
-		}
-		fireTableDataChanged();
-		rowSelectionModel.clearSelection();
-		colSelectionModel.setSelectionInterval(0, 1);
-		for (int idx: sel){
-			rowSelectionModel.addSelectionInterval(idx+1, idx+1);
-		}
-	}
-	
-	/**
-	 * Inserts a list of new relation members with the empty role for the primitives
-	 * with id in {@code ids}. Inserts the new primitives at the position of the first
-	 * selected row. If no row is selected, at the end of the list. 
-	 * 
-	 *  null values are skipped. If there is an id for which there is no primitive in the context 
-	 *  layer, if the primitive is deleted or invisible, an {@see IllegalArgumentException}
-	 *  is thrown and nothing is inserted. 
-	 * 
-	 * @param ids the list of ids. Ignored if null.
-	 * @throws IllegalArgumentException thrown if one of the ids can't be inserted
-	 */
-	public void insertMembers(Collection<PrimitiveId> ids) throws IllegalArgumentException {
-		if (ids == null) return;	
-		ArrayList<RelationMemberModel> newMembers = new ArrayList<RelationMemberModel>();
-		for (PrimitiveId id: ids){
-			OsmPrimitive p = layer.data.getPrimitiveById(id);
-			if (p == null){
-				throw new IllegalArgumentException(tr("Cannot find object with id ''{0}'' in layer ''{1}''", id.toString(), layer.getName()));
-			}
-			if (p.isDeleted() || ! p.isVisible()) {
-				throw new IllegalArgumentException(tr("Cannot add object ''{0}'' as relation member because it is deleted or invisible in layer ''{1}''", p.getDisplayName(DefaultNameFormatter.getInstance()), layer.getName()));				
-			}
-			newMembers.add(new RelationMemberModel("",id));
-		}
-		if (newMembers.isEmpty()) return;
-		int insertPos = rowSelectionModel.getMinSelectionIndex();
-		if ( insertPos >=0){
-			members.addAll(insertPos, newMembers);
-		} else {
-			members.addAll(newMembers);
-		}
-		fireTableDataChanged();
-		if (insertPos < 0) insertPos = 0;		
-		colSelectionModel.setSelectionInterval(0, 1); // select both columns
-		rowSelectionModel.setSelectionInterval(insertPos, insertPos + newMembers.size()-1);
-	}
-
-	public int getColumnCount() {
-		return 2;
-	}
-
-	public int getRowCount() {
-		if (members.size() > 0) return members.size();
-		
-		// we display an empty row if the model is empty because otherwise
-		// we can't drag/drop into the empty table.
-		// FIXME: use JTable.setFillsViewportHeight(boolean) after the migration
-		// to Java 6.
-		return 1;
-	}
-
-	public Object getValueAt(int rowIndex, int columnIndex) {
-		if (members.size() == 0 && rowIndex == 0){
-			// we display an empty row if the model is empty because otherwise
-			// we can't drag/drop into the empty table.
-			// FIXME: use JTable.setFillsViewportHeight(boolean) after the migration
-			// to Java 6.
-			return null;
-		}
-		switch(columnIndex){
-		case 0: return members.get(rowIndex).getRole();
-		case 1: return layer.data.getPrimitiveById(members.get(rowIndex).getTarget());
-		}
-		return null;
-	}
-
-	@Override
-	public boolean isCellEditable(int rowIndex, int columnIndex) {
-		// we display an empty row if the model is empty because otherwise
-		// we can't drag/drop into the empty table. This row isn't editable
-		// FIXME: use JTable.setFillsViewportHeight(boolean) after the migration
-		// to Java 6.
-		if (members.size() == 0 && rowIndex == 0) return false;
-		
-		// otherwise only the column with the member roles is editable
-		return columnIndex == 0;
-	}
-
-	@Override
-	public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
-		if (columnIndex !=0)return;
-		String role = (String)aValue;
-		RelationMemberModel model = members.get(rowIndex);
-		model.setRole(role);
-		fireTableCellUpdated(rowIndex, columnIndex);
-	}
+public class RelationMemberEditorModel extends AbstractTableModel{  
+    static private final Logger logger = Logger.getLogger(RelationMemberEditorModel.class.getName());
+    private final ArrayList<RelationMemberModel> members = new ArrayList<RelationMemberModel>();
+    private OsmDataLayer layer;
+    private DefaultListSelectionModel rowSelectionModel;
+    private DefaultListSelectionModel colSelectionModel;
+    
+    /**
+     * Creates a new model in the context of an {@see OsmDataLayer}. Internally allocates
+     * a row and a column selection model, see {@see #getRowSelectionModel()} and 
+     * {@see #getColSelectionModel()}.
+     * 
+     * @param layer the data layer. Must not be null.
+     * @exception IllegalArgumentException thrown if layer is null
+     */
+    public RelationMemberEditorModel(OsmDataLayer layer) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
+        this.layer = layer;
+        rowSelectionModel = new DefaultListSelectionModel();
+        colSelectionModel = new DefaultListSelectionModel();
+    }
+
+    /**
+     *  Creates a new model in the context of an {@see OsmDataLayer}
+     *  
+     * @param layer layer the data layer. Must not be null.
+     * @param rowSelectionModel the row selection model. Must not be null.
+     * @param colSelectionModel the column selection model. Must not be null.
+     * @throws IllegalArgumentException thrown if layer is null
+     * @throws IllegalArgumentException thrown if rowSelectionModel is null
+     * @throws IllegalArgumentException thrown if colSelectionModel is null
+     */
+    public RelationMemberEditorModel(OsmDataLayer layer, DefaultListSelectionModel rowSelectionModel, DefaultListSelectionModel colSelectionModel) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
+        CheckParameterUtil.ensureParameterNotNull(rowSelectionModel, "rowSelectionModel");
+        CheckParameterUtil.ensureParameterNotNull(colSelectionModel, "colSelectionModel");
+        this.layer = layer;
+        this.rowSelectionModel = rowSelectionModel;
+        this.colSelectionModel = colSelectionModel;
+    }
+
+    /**
+     * Replies the row selection model used in this table model.
+     * 
+     * @return the row selection model 
+     */
+    public DefaultListSelectionModel getRowSelectionModel() {
+        return rowSelectionModel;
+    }
+    
+    /**
+     * Replies the column selection model used in this table model.
+     * 
+     * @return the col selection model
+     */
+    public DefaultListSelectionModel getColSelectionModel() {
+        return colSelectionModel;
+    }
+    
+    /**
+     * Replies the set of {@see OsmPrimitive}s with the role {@code role}. If no
+     * such primitives exists, the empty set is returned.
+     * 
+     * @return the set of {@see OsmPrimitive}s with the role {@code role}
+     */
+    protected Set<OsmPrimitive> getPrimitivesWithRole(String role) {
+        HashSet<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
+        for (RelationMemberModel rm: members){
+            if (rm.getRole().equals(role)){
+                OsmPrimitive p = layer.data.getPrimitiveById(rm.getTarget());
+                if (p != null){
+                    ret.add(p);
+                }
+            }
+        }
+        return ret;
+    }
+    
+    /**
+     * Replies the list of {@see RelationMemberModel}s with the role {@code role}. If no
+     * such primitives exists, the empty set is returned.
+     * 
+     * @return the set of {@see RelationMemberModel}s with the role {@code role}
+     */
+    protected List<RelationMemberModel> getRelationMembersWithRole(String role) {
+        ArrayList<RelationMemberModel> ret = new ArrayList<RelationMemberModel>();
+        for (RelationMemberModel rm: members){
+            if (rm.getRole().equals(role)){
+                ret.add(rm);
+            }
+        }
+        return ret;
+    }
+    
+    /**
+     * Removes all members with role {@code role}.
+     * 
+     * @param role the role. Ignored if null.
+     * @return true if the list of members was modified; false, otherwise
+     */
+    protected boolean removeMembersWithRole(String role){
+        if (role == null) return false;
+        boolean isChanged = false;
+        for(Iterator<RelationMemberModel> it = members.iterator(); it.hasNext(); ){
+            RelationMemberModel rm = it.next();
+            if (rm.getRole().equals(role)) {
+                it.remove();
+                isChanged = true;
+            }
+        }
+        return isChanged;
+    }
+        
+    /**
+     * Replies the set of {@see OsmPrimitive}s with the role 'from'. If no
+     * such primitives exists, the empty set is returned.
+     * 
+     * @return the set of {@see OsmPrimitive}s with the role 'from'
+     */
+    public Set<OsmPrimitive> getFromPrimitives() {
+        return getPrimitivesWithRole("from");       
+    }
+    
+    /**
+     * Replies the set of {@see OsmPrimitive}s with the role 'to'. If no
+     * such primitives exists, the empty set is returned.
+     * 
+     * @return the set of {@see OsmPrimitive}s with the role 'from'
+     */
+    public Set<OsmPrimitive> getToPrimitives() {
+        return getPrimitivesWithRole("to");
+    }
+    
+    /**
+     * Replies the list of 'via' objects in the order they occur in the
+     * member list. Replies an empty list if no vias exist
+     * 
+     * @return 
+     */
+    public List<OsmPrimitive> getVias() {
+        ArrayList<OsmPrimitive> ret = new ArrayList<OsmPrimitive>();
+        for (RelationMemberModel rm: getRelationMembersWithRole("via")){
+            ret.add(layer.data.getPrimitiveById(rm.getTarget()));
+        }
+        return ret;
+    }
+    
+    /**
+     * Sets the list of vias. Removes all 'vias' if {@code vias} is null.
+     * 
+     * null vias are skipped. A via must belong to the dataset of the layer in whose context
+     * this editor is working, otherwise an {@see IllegalArgumentException} is thrown.
+     * 
+     * @param vias the vias.
+     * @exception IllegalArgumentException thrown if a via doesn't belong to the dataset of the layer
+     * in whose context this editor is working 
+     */
+    public void setVias(List<OsmPrimitive> vias) throws IllegalArgumentException{
+        boolean viasDeleted = removeMembersWithRole("via");
+        if (vias == null || vias.isEmpty()){
+            if (viasDeleted){
+                fireTableDataChanged();
+            }
+            return;
+        }
+        // check vias 
+        for (OsmPrimitive via: vias) {
+            if (via == null) continue;
+            if (via.getDataSet() == null || via.getDataSet() != layer.data){
+                throw new IllegalArgumentException(MessageFormat.format("via object ''{0}'' must belong to dataset of layer ''{1}''", via.getDisplayName(DefaultNameFormatter.getInstance()), layer.getName()));
+            }
+        }
+        // add vias 
+        for (OsmPrimitive via: vias) {
+            if (via == null) continue;
+            RelationMemberModel model = new RelationMemberModel("via", via);
+            members.add(model);
+        }
+        fireTableDataChanged();
+    }
+    
+    /**
+     * Sets the turn restriction member with role {@code role}. Removes all
+     * members with role {@code role} if {@code id} is null.
+     * 
+     * @param id the id 
+     * @return true if the model was modified; false, otherwise
+     */
+    protected boolean setPrimitiveWithRole(PrimitiveId id, String role){
+        if (id == null){
+            return removeMembersWithRole(role);
+        }
+        
+        List<RelationMemberModel> fromMembers = getRelationMembersWithRole(role);
+        if (fromMembers.isEmpty()){
+            RelationMemberModel rm = new RelationMemberModel(role, id);
+            members.add(rm);
+            return true;
+        } else if (fromMembers.size() == 1){
+            RelationMemberModel rm = fromMembers.get(0);
+            if (!rm.getTarget().equals(id)){
+                rm.setTarget(id);
+                return true;
+            }
+            return false;
+        } else {
+            removeMembersWithRole(role);
+            RelationMemberModel rm = new RelationMemberModel(role, id);
+            members.add(rm);
+            return true;
+        }
+    }
+    
+    /**
+     * Sets the turn restriction member with role 'from'. Removes all
+     * members with role 'from' if {@code id} is null.
+     * 
+     * @param id the id 
+     */
+    public void setFromPrimitive(PrimitiveId id){
+        if (setPrimitiveWithRole(id, "from")) {
+            fireTableDataChanged();
+        }
+    }
+    
+    /**
+     * Sets the turn restriction member with role 'to'. Removes all
+     * members with role 'to' if {@code id} is null.
+     * 
+     * @param id the id 
+     */
+    public void setToPrimitive(PrimitiveId id){
+        if (setPrimitiveWithRole(id, "to")) {
+            fireTableDataChanged();
+        }
+    }
+    
+    /**
+     * Replies the set of {@see OsmPrimitive}s referred to by members in
+     * this model.
+     * 
+     * @return the set of {@see OsmPrimitive}s referred to by members in
+     * this model.
+     */
+    public Set<OsmPrimitive> getMemberPrimitives() {
+        Set<OsmPrimitive> ret = new HashSet<OsmPrimitive>();
+        for (RelationMemberModel rm: members){
+            OsmPrimitive p = layer.data.getPrimitiveById(rm.getTarget());
+            if (p != null) ret.add(p);
+        }
+        return ret;
+    }
+    
+    /**
+     * Populates the model with the relation member of a turn restriction. Clears
+     * the model if {@code tr} is null. 
+     * 
+     * @param tr the turn restriction
+     */
+    public void populate(Relation tr){
+        members.clear();
+        if (tr == null){
+            fireTableDataChanged();
+            return;
+        }
+        for(RelationMember rm: tr.getMembers()){
+            members.add(new RelationMemberModel(rm));
+        }
+        fireTableDataChanged();
+    }
+    
+    /**
+     * Replaces the member of turn restriction {@code tr} by the relation members currently
+     * edited in this model.
+     * 
+     * @param tr the turn restriction. Ignored if null.
+     */
+    public void applyTo(Relation tr){
+        if (tr == null) return;
+        List<RelationMember> newMembers = new ArrayList<RelationMember>();
+        for(RelationMemberModel model: members){
+            RelationMember rm = new RelationMember(model.getRole(), layer.data.getPrimitiveById(model.getTarget()));
+            newMembers.add(rm);
+        }
+        tr.setMembers(newMembers);
+    }
+    
+    /**
+     * Clears the roles of all relation members currently selected in the 
+     * table.
+     */
+    protected void clearSelectedRoles(){
+        for(int i=0; i < getRowCount();i++){
+            if (rowSelectionModel.isSelectedIndex(i)) {
+                members.get(i).setRole("");
+            }
+        }       
+    }
+    
+    /**
+     * Removes the currently selected rows from the model 
+     */
+    protected void removedSelectedMembers() {
+        for(int i=getRowCount()-1; i >= 0;i--){
+            if (rowSelectionModel.isSelectedIndex(i)) {
+                members.remove(i);
+            }
+        }
+    }
+    
+    /**
+     * Deletes the current selection.
+     * 
+     * If only cells in the first column are selected, the roles of the selected
+     * members are reset to the empty string. Otherwise the selected members are
+     * removed from the model. 
+     * 
+     */
+    public void deleteSelected() {
+        if (colSelectionModel.isSelectedIndex(0) && !colSelectionModel.isSelectedIndex(1)) {
+            clearSelectedRoles();
+        } else if (rowSelectionModel.getMinSelectionIndex() >= 0){
+            removedSelectedMembers();
+        }
+        fireTableDataChanged();
+    }
+    
+    protected List<Integer> getSelectedIndices() {
+        ArrayList<Integer> ret = new ArrayList<Integer>();
+        for(int i =0; i < members.size(); i++){
+            if (rowSelectionModel.isSelectedIndex(i)) 
+                ret.add(i);
+        }
+        return ret;
+    }
+    
+    public boolean canMoveUp() {
+        List<Integer> sel = getSelectedIndices();
+        if (sel.isEmpty()) return false;
+        return sel.get(0) > 0;
+    }
+    
+    public boolean canMoveDown() {
+        List<Integer> sel = getSelectedIndices();
+        if (sel.isEmpty()) return false;
+        return sel.get(sel.size()-1) < members.size()-1;
+    }
+    
+    public void moveUpSelected() {
+        if (!canMoveUp()) return;
+        List<Integer> sel = getSelectedIndices();
+        for (int idx: sel){
+            RelationMemberModel m = members.remove(idx);
+            members.add(idx-1, m);
+        }
+        fireTableDataChanged();
+        rowSelectionModel.clearSelection();
+        colSelectionModel.setSelectionInterval(0, 1);
+        for (int idx: sel){
+            rowSelectionModel.addSelectionInterval(idx-1, idx-1);
+        }
+    }
+    
+    public void moveDownSelected() {
+        if (!canMoveDown()) return;
+        List<Integer> sel = getSelectedIndices();
+        for (int i = sel.size()-1; i>=0;i--){
+            int idx = sel.get(i);
+            RelationMemberModel m = members.remove(idx);
+            members.add(idx+1, m);
+        }
+        fireTableDataChanged();
+        rowSelectionModel.clearSelection();
+        colSelectionModel.setSelectionInterval(0, 1);
+        for (int idx: sel){
+            rowSelectionModel.addSelectionInterval(idx+1, idx+1);
+        }
+    }
+    
+    /**
+     * Inserts a list of new relation members with the empty role for the primitives
+     * with id in {@code ids}. Inserts the new primitives at the position of the first
+     * selected row. If no row is selected, at the end of the list. 
+     * 
+     *  null values are skipped. If there is an id for which there is no primitive in the context 
+     *  layer, if the primitive is deleted or invisible, an {@see IllegalArgumentException}
+     *  is thrown and nothing is inserted. 
+     * 
+     * @param ids the list of ids. Ignored if null.
+     * @throws IllegalArgumentException thrown if one of the ids can't be inserted
+     */
+    public void insertMembers(Collection<PrimitiveId> ids) throws IllegalArgumentException {
+        if (ids == null) return;    
+        ArrayList<RelationMemberModel> newMembers = new ArrayList<RelationMemberModel>();
+        for (PrimitiveId id: ids){
+            OsmPrimitive p = layer.data.getPrimitiveById(id);
+            if (p == null){
+                throw new IllegalArgumentException(tr("Cannot find object with id ''{0}'' in layer ''{1}''", id.toString(), layer.getName()));
+            }
+            if (p.isDeleted() || ! p.isVisible()) {
+                throw new IllegalArgumentException(tr("Cannot add object ''{0}'' as relation member because it is deleted or invisible in layer ''{1}''", p.getDisplayName(DefaultNameFormatter.getInstance()), layer.getName()));              
+            }
+            newMembers.add(new RelationMemberModel("",id));
+        }
+        if (newMembers.isEmpty()) return;
+        int insertPos = rowSelectionModel.getMinSelectionIndex();
+        if ( insertPos >=0){
+            members.addAll(insertPos, newMembers);
+        } else {
+            members.addAll(newMembers);
+        }
+        fireTableDataChanged();
+        if (insertPos < 0) insertPos = 0;       
+        colSelectionModel.setSelectionInterval(0, 1); // select both columns
+        rowSelectionModel.setSelectionInterval(insertPos, insertPos + newMembers.size()-1);
+    }
+
+    public int getColumnCount() {
+        return 2;
+    }
+
+    public int getRowCount() {
+        if (members.size() > 0) return members.size();
+        
+        // we display an empty row if the model is empty because otherwise
+        // we can't drag/drop into the empty table.
+        // FIXME: use JTable.setFillsViewportHeight(boolean) after the migration
+        // to Java 6.
+        return 1;
+    }
+
+    public Object getValueAt(int rowIndex, int columnIndex) {
+        if (members.size() == 0 && rowIndex == 0){
+            // we display an empty row if the model is empty because otherwise
+            // we can't drag/drop into the empty table.
+            // FIXME: use JTable.setFillsViewportHeight(boolean) after the migration
+            // to Java 6.
+            return null;
+        }
+        switch(columnIndex){
+        case 0: return members.get(rowIndex).getRole();
+        case 1: return layer.data.getPrimitiveById(members.get(rowIndex).getTarget());
+        }
+        return null;
+    }
+
+    @Override
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+        // we display an empty row if the model is empty because otherwise
+        // we can't drag/drop into the empty table. This row isn't editable
+        // FIXME: use JTable.setFillsViewportHeight(boolean) after the migration
+        // to Java 6.
+        if (members.size() == 0 && rowIndex == 0) return false;
+        
+        // otherwise only the column with the member roles is editable
+        return columnIndex == 0;
+    }
+
+    @Override
+    public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+        if (columnIndex !=0)return;
+        String role = (String)aValue;
+        RelationMemberModel model = members.get(rowIndex);
+        model.setRole(role);
+        fireTableCellUpdated(rowIndex, columnIndex);
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberModel.java	(revision 23192)
@@ -16,99 +16,99 @@
  */
 public class RelationMemberModel implements Serializable{
-	private String role;
-	private SimplePrimitiveId target;
-	
-	/**
-	 * Creates a new relation member model
-	 * 
-	 * @param role the member role. Reset to "" if null.
-	 * @param target the id of the target object. Must not be null.
-	 * @throws IllegalArgumentException thrown if {@code target} is null
-	 */
-	public RelationMemberModel(String role, PrimitiveId target) throws IllegalArgumentException {
-		CheckParameterUtil.ensureParameterNotNull(target, "target");
-		this.role = role == null? "" : role;
-		this.target = new SimplePrimitiveId(target.getUniqueId(), target.getType());
-	}
-	
-	/**
-	 * Creates a new relation member model from a relation member 
-	 * 
-	 * @param member the relation member. Must not be null.
-	 * @throws IllegalArgumentException thrown if {@code member} is null
-	 */
-	public RelationMemberModel(RelationMember member) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(member, "member");
-		this.role = member.getRole();
-		setTarget(member.getMember().getPrimitiveId());
-	}
+    private String role;
+    private SimplePrimitiveId target;
+    
+    /**
+     * Creates a new relation member model
+     * 
+     * @param role the member role. Reset to "" if null.
+     * @param target the id of the target object. Must not be null.
+     * @throws IllegalArgumentException thrown if {@code target} is null
+     */
+    public RelationMemberModel(String role, PrimitiveId target) throws IllegalArgumentException {
+        CheckParameterUtil.ensureParameterNotNull(target, "target");
+        this.role = role == null? "" : role;
+        this.target = new SimplePrimitiveId(target.getUniqueId(), target.getType());
+    }
+    
+    /**
+     * Creates a new relation member model from a relation member 
+     * 
+     * @param member the relation member. Must not be null.
+     * @throws IllegalArgumentException thrown if {@code member} is null
+     */
+    public RelationMemberModel(RelationMember member) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(member, "member");
+        this.role = member.getRole();
+        setTarget(member.getMember().getPrimitiveId());
+    }
 
-	/**
-	 * Replies the current role in this model. Never null.
-	 * 
-	 * @return the current role in this model
-	 */
-	public String getRole() {
-		return role;
-	}
+    /**
+     * Replies the current role in this model. Never null.
+     * 
+     * @return the current role in this model
+     */
+    public String getRole() {
+        return role;
+    }
 
-	/**
-	 * Sets the current role in this model. 
-	 * 
-	 * @param role the role. Reset to "" if null.
-	 */
-	public void setRole(String role) {
-		this.role = role == null? "" : role;
-	}
+    /**
+     * Sets the current role in this model. 
+     * 
+     * @param role the role. Reset to "" if null.
+     */
+    public void setRole(String role) {
+        this.role = role == null? "" : role;
+    }
 
-	/**
-	 * Replies the id of the target object of this relation member.
-	 * 
-	 * @return the id of the target object of this relation member.
-	 */
-	public PrimitiveId getTarget() {
-		return target;
-	}
+    /**
+     * Replies the id of the target object of this relation member.
+     * 
+     * @return the id of the target object of this relation member.
+     */
+    public PrimitiveId getTarget() {
+        return target;
+    }
 
-	/**
-	 * Sets the id of the target object.  
-	 * 
-	 * @param target the id of the target object. Must not be null.
-	 * @throws IllegalArgumentException thrown if {@code target} is null
-	 */
-	public void setTarget(PrimitiveId target) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(target, "target");
-		this.target = new SimplePrimitiveId(target.getUniqueId(), target.getType());
-	}
-	
-	@Override
-	public int hashCode() {
-		final int prime = 31;
-		int result = 1;
-		result = prime * result + ((role == null) ? 0 : role.hashCode());
-		result = prime * result + ((target == null) ? 0 : target.hashCode());
-		return result;
-	}
+    /**
+     * Sets the id of the target object.  
+     * 
+     * @param target the id of the target object. Must not be null.
+     * @throws IllegalArgumentException thrown if {@code target} is null
+     */
+    public void setTarget(PrimitiveId target) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(target, "target");
+        this.target = new SimplePrimitiveId(target.getUniqueId(), target.getType());
+    }
+    
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((role == null) ? 0 : role.hashCode());
+        result = prime * result + ((target == null) ? 0 : target.hashCode());
+        return result;
+    }
 
-	@Override
-	public boolean equals(Object obj) {
-		if (this == obj)
-			return true;
-		if (obj == null)
-			return false;
-		if (getClass() != obj.getClass())
-			return false;
-		RelationMemberModel other = (RelationMemberModel) obj;
-		if (role == null) {
-			if (other.role != null)
-				return false;
-		} else if (!role.equals(other.role))
-			return false;
-		if (target == null) {
-			if (other.target != null)
-				return false;
-		} else if (!target.equals(other.target))
-			return false;
-		return true;
-	}
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null)
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        RelationMemberModel other = (RelationMemberModel) obj;
+        if (role == null) {
+            if (other.role != null)
+                return false;
+        } else if (!role.equals(other.role))
+            return false;
+        if (target == null) {
+            if (other.target != null)
+                return false;
+        } else if (!target.equals(other.target))
+            return false;
+        return true;
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberRoleCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberRoleCellRenderer.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberRoleCellRenderer.java	(revision 23192)
@@ -10,29 +10,29 @@
 public class RelationMemberRoleCellRenderer extends DefaultTableCellRenderer{
 private JLabel mockCell;
-	
-	public RelationMemberRoleCellRenderer() {
-		mockCell = new JLabel();
-		mockCell.setText("");
-		mockCell.setOpaque(true);
-	}
-	
-	public Component getTableCellRendererComponent(JTable table, Object value,
-			boolean isSelected, boolean hasFocus, int row, int column) {
-		if (value != null){
-			return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
-		}
-		
-		// FIXME: required to always draw a mock row, even if the table is empty.
-		// Otherwise, drag and drop onto the table fails.
-		// Replace with JTable.setFillsViewportHeight(boolean) after the migration
-		// to Java 6.
-		if (isSelected){
-			mockCell.setBackground(UIManager.getColor("Table.selectionBackground"));
-			mockCell.setForeground(UIManager.getColor("Table.selectionForeground"));
-		} else {
-			mockCell.setBackground(UIManager.getColor("Panel.background"));
-			mockCell.setForeground(UIManager.getColor("Panel.foreground"));
-		}		
-		return mockCell;
-	}
+    
+    public RelationMemberRoleCellRenderer() {
+        mockCell = new JLabel();
+        mockCell.setText("");
+        mockCell.setOpaque(true);
+    }
+    
+    public Component getTableCellRendererComponent(JTable table, Object value,
+            boolean isSelected, boolean hasFocus, int row, int column) {
+        if (value != null){
+            return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+        }
+        
+        // FIXME: required to always draw a mock row, even if the table is empty.
+        // Otherwise, drag and drop onto the table fails.
+        // Replace with JTable.setFillsViewportHeight(boolean) after the migration
+        // to Java 6.
+        if (isSelected){
+            mockCell.setBackground(UIManager.getColor("Table.selectionBackground"));
+            mockCell.setForeground(UIManager.getColor("Table.selectionForeground"));
+        } else {
+            mockCell.setBackground(UIManager.getColor("Panel.background"));
+            mockCell.setForeground(UIManager.getColor("Panel.foreground"));
+        }       
+        return mockCell;
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberTable.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberTable.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberTable.java	(revision 23192)
@@ -46,314 +46,314 @@
  */
 public class RelationMemberTable extends JTable {
-	static private final Logger logger = Logger.getLogger(RelationMemberTable.class.getName());
-	
-	private TurnRestrictionEditorModel model;
-	private DeleteAction actDelete;
-	private PasteAction actPaste;
-	private MoveUpAction actMoveUp;
-	private MoveDownAction actMoveDown;
-	private TransferHandler transferHandler;
-	
-	public RelationMemberTable(TurnRestrictionEditorModel model) {
-		super(
-				model.getRelationMemberEditorModel(),
-				new RelationMemberColumnModel(model.getRelationMemberEditorModel().getColSelectionModel()),
-				model.getRelationMemberEditorModel().getRowSelectionModel()
-		);
-		this.model = model;
-		setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+    static private final Logger logger = Logger.getLogger(RelationMemberTable.class.getName());
+    
+    private TurnRestrictionEditorModel model;
+    private DeleteAction actDelete;
+    private PasteAction actPaste;
+    private MoveUpAction actMoveUp;
+    private MoveDownAction actMoveDown;
+    private TransferHandler transferHandler;
+    
+    public RelationMemberTable(TurnRestrictionEditorModel model) {
+        super(
+                model.getRelationMemberEditorModel(),
+                new RelationMemberColumnModel(model.getRelationMemberEditorModel().getColSelectionModel()),
+                model.getRelationMemberEditorModel().getRowSelectionModel()
+        );
+        this.model = model;
+        setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
         setRowSelectionAllowed(true);
         setColumnSelectionAllowed(true);
 
-		// register the popup menu launcher
-		addMouseListener(new TablePopupLauncher());
-		
-		// transfer handling
-		setDragEnabled(true);
-		setTransferHandler(new RelationMemberTransferHandler());
-		setDropTarget(new RelationMemberTableDropTarget());
-		
-		// initialize the delete action
-		//
-		actDelete = new DeleteAction();
-		model.getRelationMemberEditorModel().getRowSelectionModel().addListSelectionListener(actDelete);
-		registerKeyboardAction(actDelete, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-		
-		// initialize the paste action (will be used in the popup, the action map already includes
-		// the standard paste action for transfer handling) 
-		actPaste = new PasteAction();
-		
-		actMoveUp = new MoveUpAction();
-		model.getRelationMemberEditorModel().getRowSelectionModel().addListSelectionListener(actMoveUp);
-		registerKeyboardAction(actMoveUp,actMoveUp.getKeyStroke(), WHEN_FOCUSED);
-		
-		actMoveDown = new MoveDownAction();
-		model.getRelationMemberEditorModel().getRowSelectionModel().addListSelectionListener(actMoveDown);
-		registerKeyboardAction(actMoveDown, actMoveDown.getKeyStroke(), WHEN_FOCUSED);
-	}
-
-	/**
-	 * The action for deleting the selected table cells 
-	 * 
-	 */
-	class DeleteAction extends AbstractAction implements ListSelectionListener{
-		public DeleteAction() {
-			putValue(NAME, tr("Delete"));
-			putValue(SHORT_DESCRIPTION, tr("Clear the selected roles or delete the selected members"));
-			putValue(SMALL_ICON, ImageProvider.get("deletesmall"));
-			putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0));
-			updateEnabledState();
-		}
-		
-		public void updateEnabledState() {
-			setEnabled(model.getRelationMemberEditorModel().getRowSelectionModel().getMinSelectionIndex()>=0);
-		}
-
-		public void actionPerformed(ActionEvent e) {
-			model.getRelationMemberEditorModel().deleteSelected();
-		}
-
-		public void valueChanged(ListSelectionEvent e) {
-			updateEnabledState();
-		}
-	}	
-	
-	/**
-	 * The action for pasting into the relation member table
-	 * 
-	 */
-	class PasteAction extends AbstractAction{		
-		public PasteAction() {
-			putValue(NAME, tr("Paste"));
-			putValue(SHORT_DESCRIPTION, tr("Insert new relation members from object in the clipboard"));
-			putValue(SMALL_ICON, ImageProvider.get("paste"));
-			putValue(ACCELERATOR_KEY, Shortcut.getPasteKeyStroke());
-			updateEnabledState();
-		}
-		
-		public void updateEnabledState() {
-			DataFlavor[] flavors = Toolkit.getDefaultToolkit().getSystemClipboard().getAvailableDataFlavors();
-			setEnabled(PrimitiveIdListTransferHandler.isSupportedFlavor(flavors));
-		}
-
-		public void actionPerformed(ActionEvent evt) {
-			// tried to delegate to 'paste' action in the action map of the
-			// table, but didn't work. Now duplicating the logic of importData(...) in
-			// the transfer handler.
-			//
-			Clipboard cp = Toolkit.getDefaultToolkit().getSystemClipboard();
-			if (!PrimitiveIdListTransferHandler.isSupportedFlavor(cp.getAvailableDataFlavors())) return;
-			try {
-				List<PrimitiveId> ids;
-				ids = (List<PrimitiveId>)cp.getData(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR);
-				try {
-					model.getRelationMemberEditorModel().insertMembers(ids);
-				} catch(IllegalArgumentException e){
-					e.printStackTrace();
-					// FIXME: provide user feedback
-				}
-			} catch(IOException e){
-				e.printStackTrace();
-			} catch(UnsupportedFlavorException e){
-				e.printStackTrace();
-			} 
-		}
-	}	
-
-	class MoveDownAction extends AbstractAction implements ListSelectionListener{	
-		private KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.ALT_DOWN_MASK);
-		public MoveDownAction(){
-			putValue(NAME, tr("Move down"));
-			putValue(SHORT_DESCRIPTION, tr("Move the selected relation members down by one position"));
-			putValue(ACCELERATOR_KEY,keyStroke);
-			putValue(SMALL_ICON, ImageProvider.get("dialogs", "movedown"));
-			updateEnabledState();
-		}
-		
-		public void actionPerformed(ActionEvent e) {
-			model.getRelationMemberEditorModel().moveDownSelected();
-		}
-
-		public void updateEnabledState(){
-			setEnabled(model.getRelationMemberEditorModel().canMoveDown());
-		}
-		
-		public void valueChanged(ListSelectionEvent e) {
-			updateEnabledState();			
-		}
-		public KeyStroke getKeyStroke() {
-			return keyStroke;
-		}
-	}
-	
-	class MoveUpAction extends AbstractAction implements ListSelectionListener{
-		private KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.ALT_DOWN_MASK);
-
-		public MoveUpAction() {
-			putValue(NAME, tr("Move up"));
-			putValue(SHORT_DESCRIPTION, tr("Move the selected relation members up by one position"));
-			putValue(ACCELERATOR_KEY,keyStroke);
-			putValue(SMALL_ICON, ImageProvider.get("dialogs", "moveup"));
-			updateEnabledState();
-		}
-		
-		public void actionPerformed(ActionEvent e) {
-			model.getRelationMemberEditorModel().moveUpSelected();
-		}
-
-		public void updateEnabledState(){
-			setEnabled(model.getRelationMemberEditorModel().canMoveUp());
-		}
-		
-		public void valueChanged(ListSelectionEvent e) {
-			updateEnabledState();			
-		}
-		public KeyStroke getKeyStroke() {
-			return keyStroke;
-		}
-	}
-	
-	class TablePopupLauncher extends PopupMenuLauncher {
-		@Override
-		public void launch(MouseEvent evt) {
-			int row = rowAtPoint(evt.getPoint());
-			if (getSelectionModel().getMinSelectionIndex() < 0 && row >=0){
-				getSelectionModel().setSelectionInterval(row, row);
-				getColumnModel().getSelectionModel().setSelectionInterval(0, 1);
-			}
-			new PopupMenu().show(RelationMemberTable.this, evt.getX(), evt.getY());
-		}		
-	}
-	
-	class PopupMenu extends JPopupMenu {
-		public PopupMenu() {
-			JMenuItem item = add(actPaste);
-			item.setTransferHandler(transferHandler);
-			actPaste.updateEnabledState();
-			addSeparator();
-			add(actDelete);
-			addSeparator();
-			add(actMoveUp);
-			add(actMoveDown);
-		}
-	}
-	
-	/**
-	 * The transfer handler for the relation member table. 
-	 *
-	 */
-	class RelationMemberTransferHandler extends TransferHandler {
-		
-		@Override
-		public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
-			return PrimitiveIdListTransferHandler.isSupportedFlavor(transferFlavors);
-		}
-
-		@Override
-		public boolean importData(JComponent comp, Transferable t) {
-			try {
-				List<PrimitiveId> ids;
-				ids = (List<PrimitiveId>)t.getTransferData(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR);
-				try {
-					model.getRelationMemberEditorModel().insertMembers(ids);
-				} catch(IllegalArgumentException e){
-					e.printStackTrace();
-					// FIXME: provide user feedback
-					return false;
-				}
-				return true;
-			} catch(IOException e){
-				e.printStackTrace();
-			} catch(UnsupportedFlavorException e){
-				e.printStackTrace();
-			} 
-			return false;
-		}
-
-		@Override
-		public int getSourceActions(JComponent c) {
-			return  COPY_OR_MOVE;
-		}
-	}
-	
-	/**
-	 * A custom drop target for the relation member table. During dragging we need to
-	 * disable colum selection model.  
-	 *
-	 */
-	class RelationMemberTableDropTarget extends DropTarget{		
-		private boolean dropAccepted = false;	
-		
-		/**
-		 * Replies true if {@code transferFlavors} includes the data flavor {@see PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
-
-		 * @param transferFlavors an array of transferFlavors
-		 * @return
-		 */
-		protected boolean isSupportedFlavor(DataFlavor[] transferFlavors) {
-			for (DataFlavor df: transferFlavors) {
-				if (df.equals(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR)) return true;
-			}
-			return false;
-		}		
-		
-		public synchronized void dragEnter(DropTargetDragEvent dtde) {
-			if (isSupportedFlavor(dtde.getCurrentDataFlavors())) {
-				if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY_OR_MOVE) != 0){
-					dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);		
-					setColumnSelectionAllowed(false);
-					dropAccepted  = true;
-				} else {
-					dtde.rejectDrag();
-				}
-			} else {
-				dtde.rejectDrag();
-			}
-		}
-		
-		public synchronized void dragExit(DropTargetEvent dte) {
-			setColumnSelectionAllowed(true);
-			dropAccepted = false;
-		}
-		
-		@Override
-		public synchronized void dragOver(DropTargetDragEvent dtde) {
-			int row = rowAtPoint(dtde.getLocation());
-			int selectedRow = getSelectionModel().getMinSelectionIndex();
-			if (row >= 0 && row != selectedRow){
-				getSelectionModel().setSelectionInterval(row, row);
-			}			
-		}
-
-		public synchronized void drop(DropTargetDropEvent dtde) {
-			try {
-				if (!dropAccepted) return; 
-				if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY_OR_MOVE) == 0) {
-					return;
-				}
-				List<PrimitiveId> ids;
-				ids = (List<PrimitiveId>)dtde.getTransferable().getTransferData(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR);
-				try {
-					model.getRelationMemberEditorModel().insertMembers(ids);
-				} catch(IllegalArgumentException e){
-					e.printStackTrace();
-					// FIXME: provide user feedback
-				}
-			} catch(IOException e){
-				e.printStackTrace();
-			} catch(UnsupportedFlavorException e){
-				e.printStackTrace();
-			} finally {
-				setColumnSelectionAllowed(true);
-			}
-		}
-		
-		public synchronized void dropActionChanged(DropTargetDragEvent dtde) {
-			if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY_OR_MOVE) == 0) {
-				dtde.rejectDrag();
-			} else {
-				dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
-			}
-		}
-	}
+        // register the popup menu launcher
+        addMouseListener(new TablePopupLauncher());
+        
+        // transfer handling
+        setDragEnabled(true);
+        setTransferHandler(new RelationMemberTransferHandler());
+        setDropTarget(new RelationMemberTableDropTarget());
+        
+        // initialize the delete action
+        //
+        actDelete = new DeleteAction();
+        model.getRelationMemberEditorModel().getRowSelectionModel().addListSelectionListener(actDelete);
+        registerKeyboardAction(actDelete, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        
+        // initialize the paste action (will be used in the popup, the action map already includes
+        // the standard paste action for transfer handling) 
+        actPaste = new PasteAction();
+        
+        actMoveUp = new MoveUpAction();
+        model.getRelationMemberEditorModel().getRowSelectionModel().addListSelectionListener(actMoveUp);
+        registerKeyboardAction(actMoveUp,actMoveUp.getKeyStroke(), WHEN_FOCUSED);
+        
+        actMoveDown = new MoveDownAction();
+        model.getRelationMemberEditorModel().getRowSelectionModel().addListSelectionListener(actMoveDown);
+        registerKeyboardAction(actMoveDown, actMoveDown.getKeyStroke(), WHEN_FOCUSED);
+    }
+
+    /**
+     * The action for deleting the selected table cells 
+     * 
+     */
+    class DeleteAction extends AbstractAction implements ListSelectionListener{
+        public DeleteAction() {
+            putValue(NAME, tr("Delete"));
+            putValue(SHORT_DESCRIPTION, tr("Clear the selected roles or delete the selected members"));
+            putValue(SMALL_ICON, ImageProvider.get("deletesmall"));
+            putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0));
+            updateEnabledState();
+        }
+        
+        public void updateEnabledState() {
+            setEnabled(model.getRelationMemberEditorModel().getRowSelectionModel().getMinSelectionIndex()>=0);
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            model.getRelationMemberEditorModel().deleteSelected();
+        }
+
+        public void valueChanged(ListSelectionEvent e) {
+            updateEnabledState();
+        }
+    }   
+    
+    /**
+     * The action for pasting into the relation member table
+     * 
+     */
+    class PasteAction extends AbstractAction{       
+        public PasteAction() {
+            putValue(NAME, tr("Paste"));
+            putValue(SHORT_DESCRIPTION, tr("Insert new relation members from object in the clipboard"));
+            putValue(SMALL_ICON, ImageProvider.get("paste"));
+            putValue(ACCELERATOR_KEY, Shortcut.getPasteKeyStroke());
+            updateEnabledState();
+        }
+        
+        public void updateEnabledState() {
+            DataFlavor[] flavors = Toolkit.getDefaultToolkit().getSystemClipboard().getAvailableDataFlavors();
+            setEnabled(PrimitiveIdListTransferHandler.isSupportedFlavor(flavors));
+        }
+
+        public void actionPerformed(ActionEvent evt) {
+            // tried to delegate to 'paste' action in the action map of the
+            // table, but didn't work. Now duplicating the logic of importData(...) in
+            // the transfer handler.
+            //
+            Clipboard cp = Toolkit.getDefaultToolkit().getSystemClipboard();
+            if (!PrimitiveIdListTransferHandler.isSupportedFlavor(cp.getAvailableDataFlavors())) return;
+            try {
+                List<PrimitiveId> ids;
+                ids = (List<PrimitiveId>)cp.getData(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR);
+                try {
+                    model.getRelationMemberEditorModel().insertMembers(ids);
+                } catch(IllegalArgumentException e){
+                    e.printStackTrace();
+                    // FIXME: provide user feedback
+                }
+            } catch(IOException e){
+                e.printStackTrace();
+            } catch(UnsupportedFlavorException e){
+                e.printStackTrace();
+            } 
+        }
+    }   
+
+    class MoveDownAction extends AbstractAction implements ListSelectionListener{   
+        private KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.ALT_DOWN_MASK);
+        public MoveDownAction(){
+            putValue(NAME, tr("Move down"));
+            putValue(SHORT_DESCRIPTION, tr("Move the selected relation members down by one position"));
+            putValue(ACCELERATOR_KEY,keyStroke);
+            putValue(SMALL_ICON, ImageProvider.get("dialogs", "movedown"));
+            updateEnabledState();
+        }
+        
+        public void actionPerformed(ActionEvent e) {
+            model.getRelationMemberEditorModel().moveDownSelected();
+        }
+
+        public void updateEnabledState(){
+            setEnabled(model.getRelationMemberEditorModel().canMoveDown());
+        }
+        
+        public void valueChanged(ListSelectionEvent e) {
+            updateEnabledState();           
+        }
+        public KeyStroke getKeyStroke() {
+            return keyStroke;
+        }
+    }
+    
+    class MoveUpAction extends AbstractAction implements ListSelectionListener{
+        private KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.ALT_DOWN_MASK);
+
+        public MoveUpAction() {
+            putValue(NAME, tr("Move up"));
+            putValue(SHORT_DESCRIPTION, tr("Move the selected relation members up by one position"));
+            putValue(ACCELERATOR_KEY,keyStroke);
+            putValue(SMALL_ICON, ImageProvider.get("dialogs", "moveup"));
+            updateEnabledState();
+        }
+        
+        public void actionPerformed(ActionEvent e) {
+            model.getRelationMemberEditorModel().moveUpSelected();
+        }
+
+        public void updateEnabledState(){
+            setEnabled(model.getRelationMemberEditorModel().canMoveUp());
+        }
+        
+        public void valueChanged(ListSelectionEvent e) {
+            updateEnabledState();           
+        }
+        public KeyStroke getKeyStroke() {
+            return keyStroke;
+        }
+    }
+    
+    class TablePopupLauncher extends PopupMenuLauncher {
+        @Override
+        public void launch(MouseEvent evt) {
+            int row = rowAtPoint(evt.getPoint());
+            if (getSelectionModel().getMinSelectionIndex() < 0 && row >=0){
+                getSelectionModel().setSelectionInterval(row, row);
+                getColumnModel().getSelectionModel().setSelectionInterval(0, 1);
+            }
+            new PopupMenu().show(RelationMemberTable.this, evt.getX(), evt.getY());
+        }       
+    }
+    
+    class PopupMenu extends JPopupMenu {
+        public PopupMenu() {
+            JMenuItem item = add(actPaste);
+            item.setTransferHandler(transferHandler);
+            actPaste.updateEnabledState();
+            addSeparator();
+            add(actDelete);
+            addSeparator();
+            add(actMoveUp);
+            add(actMoveDown);
+        }
+    }
+    
+    /**
+     * The transfer handler for the relation member table. 
+     *
+     */
+    class RelationMemberTransferHandler extends TransferHandler {
+        
+        @Override
+        public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
+            return PrimitiveIdListTransferHandler.isSupportedFlavor(transferFlavors);
+        }
+
+        @Override
+        public boolean importData(JComponent comp, Transferable t) {
+            try {
+                List<PrimitiveId> ids;
+                ids = (List<PrimitiveId>)t.getTransferData(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR);
+                try {
+                    model.getRelationMemberEditorModel().insertMembers(ids);
+                } catch(IllegalArgumentException e){
+                    e.printStackTrace();
+                    // FIXME: provide user feedback
+                    return false;
+                }
+                return true;
+            } catch(IOException e){
+                e.printStackTrace();
+            } catch(UnsupportedFlavorException e){
+                e.printStackTrace();
+            } 
+            return false;
+        }
+
+        @Override
+        public int getSourceActions(JComponent c) {
+            return  COPY_OR_MOVE;
+        }
+    }
+    
+    /**
+     * A custom drop target for the relation member table. During dragging we need to
+     * disable colum selection model.  
+     *
+     */
+    class RelationMemberTableDropTarget extends DropTarget{     
+        private boolean dropAccepted = false;   
+        
+        /**
+         * Replies true if {@code transferFlavors} includes the data flavor {@see PrimitiveIdTransferable#PRIMITIVE_ID_LIST_FLAVOR}.
+
+         * @param transferFlavors an array of transferFlavors
+         * @return
+         */
+        protected boolean isSupportedFlavor(DataFlavor[] transferFlavors) {
+            for (DataFlavor df: transferFlavors) {
+                if (df.equals(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR)) return true;
+            }
+            return false;
+        }       
+        
+        public synchronized void dragEnter(DropTargetDragEvent dtde) {
+            if (isSupportedFlavor(dtde.getCurrentDataFlavors())) {
+                if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY_OR_MOVE) != 0){
+                    dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);      
+                    setColumnSelectionAllowed(false);
+                    dropAccepted  = true;
+                } else {
+                    dtde.rejectDrag();
+                }
+            } else {
+                dtde.rejectDrag();
+            }
+        }
+        
+        public synchronized void dragExit(DropTargetEvent dte) {
+            setColumnSelectionAllowed(true);
+            dropAccepted = false;
+        }
+        
+        @Override
+        public synchronized void dragOver(DropTargetDragEvent dtde) {
+            int row = rowAtPoint(dtde.getLocation());
+            int selectedRow = getSelectionModel().getMinSelectionIndex();
+            if (row >= 0 && row != selectedRow){
+                getSelectionModel().setSelectionInterval(row, row);
+            }           
+        }
+
+        public synchronized void drop(DropTargetDropEvent dtde) {
+            try {
+                if (!dropAccepted) return; 
+                if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY_OR_MOVE) == 0) {
+                    return;
+                }
+                List<PrimitiveId> ids;
+                ids = (List<PrimitiveId>)dtde.getTransferable().getTransferData(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR);
+                try {
+                    model.getRelationMemberEditorModel().insertMembers(ids);
+                } catch(IllegalArgumentException e){
+                    e.printStackTrace();
+                    // FIXME: provide user feedback
+                }
+            } catch(IOException e){
+                e.printStackTrace();
+            } catch(UnsupportedFlavorException e){
+                e.printStackTrace();
+            } finally {
+                setColumnSelectionAllowed(true);
+            }
+        }
+        
+        public synchronized void dropActionChanged(DropTargetDragEvent dtde) {
+            if ((dtde.getSourceActions() & DnDConstants.ACTION_COPY_OR_MOVE) == 0) {
+                dtde.rejectDrag();
+            } else {
+                dtde.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
+            }
+        }
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberTargetCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberTargetCellRenderer.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/RelationMemberTargetCellRenderer.java	(revision 23192)
@@ -11,32 +11,32 @@
 
 public class RelationMemberTargetCellRenderer extends OsmPrimitivRenderer{
-	static private final Logger logger = Logger.getLogger(RelationMemberTargetCellRenderer.class.getName());
-	private JLabel mockCell;
-	
-	public RelationMemberTargetCellRenderer() {
-		mockCell = new JLabel();
-		mockCell.setText("");
-		mockCell.setOpaque(true);
-	}
-	
-	@Override
-	public Component getTableCellRendererComponent(JTable table, Object value,
-			boolean isSelected, boolean hasFocus, int row, int column) {
-		if (value != null){
-			return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
-		}
-		
-		// FIXME: required to always draw a mock row, even if the table is empty.
-		// Otherwise, drag and drop onto the table fails.
-		// Replace with JTable.setFillsViewportHeight(boolean) after the migration
-		// to Java 6.
-		if (isSelected){
-			mockCell.setBackground(UIManager.getColor("Table.selectionBackground"));
-			mockCell.setForeground(UIManager.getColor("Table.selectionForeground"));
-		} else {
-			mockCell.setBackground(UIManager.getColor("Panel.background"));
-			mockCell.setForeground(UIManager.getColor("Panel.foreground"));
-		}		
-		return mockCell;		
-	}
+    static private final Logger logger = Logger.getLogger(RelationMemberTargetCellRenderer.class.getName());
+    private JLabel mockCell;
+    
+    public RelationMemberTargetCellRenderer() {
+        mockCell = new JLabel();
+        mockCell.setText("");
+        mockCell.setOpaque(true);
+    }
+    
+    @Override
+    public Component getTableCellRendererComponent(JTable table, Object value,
+            boolean isSelected, boolean hasFocus, int row, int column) {
+        if (value != null){
+            return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+        }
+        
+        // FIXME: required to always draw a mock row, even if the table is empty.
+        // Otherwise, drag and drop onto the table fails.
+        // Replace with JTable.setFillsViewportHeight(boolean) after the migration
+        // to Java 6.
+        if (isSelected){
+            mockCell.setBackground(UIManager.getColor("Table.selectionBackground"));
+            mockCell.setForeground(UIManager.getColor("Table.selectionForeground"));
+        } else {
+            mockCell.setBackground(UIManager.getColor("Panel.background"));
+            mockCell.setForeground(UIManager.getColor("Panel.foreground"));
+        }       
+        return mockCell;        
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBox.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBox.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBox.java	(revision 23192)
@@ -9,35 +9,35 @@
  */
 public class TurnRestrictionComboBox extends JComboBox{
-	
-	/**
-	 * Constructor 
-	 * 
-	 * @param model the combo box model. Must not be null.
-	 */
-	public TurnRestrictionComboBox(TurnRestrictionComboBoxModel model){
-		super(model);
-		setEditable(false);
-		setRenderer(new TurnRestrictionTypeRenderer());
-	}
-	
-	/**
-	 * Replies the turn restriction combo box model 
-	 * 
-	 * @return the turn restriction combo box model
-	 */
-	public TurnRestrictionComboBoxModel getTurnRestrictionComboBoxModel() {
-		return (TurnRestrictionComboBoxModel)getModel();
-	}
-	
-	/**
-	 * Initializes the set of icons used from the preference key
-	 * {@see PreferenceKeys#ROAD_SIGNS}.
-	 * 
-	 * @param prefs the JOSM preferences 
-	 */
-	public void initIconSetFromPreferences(Preferences prefs){
-		TurnRestrictionTypeRenderer renderer = (TurnRestrictionTypeRenderer)getRenderer();
-		renderer.initIconSetFromPreferences(prefs);
-		repaint();
-	}
+    
+    /**
+     * Constructor 
+     * 
+     * @param model the combo box model. Must not be null.
+     */
+    public TurnRestrictionComboBox(TurnRestrictionComboBoxModel model){
+        super(model);
+        setEditable(false);
+        setRenderer(new TurnRestrictionTypeRenderer());
+    }
+    
+    /**
+     * Replies the turn restriction combo box model 
+     * 
+     * @return the turn restriction combo box model
+     */
+    public TurnRestrictionComboBoxModel getTurnRestrictionComboBoxModel() {
+        return (TurnRestrictionComboBoxModel)getModel();
+    }
+    
+    /**
+     * Initializes the set of icons used from the preference key
+     * {@see PreferenceKeys#ROAD_SIGNS}.
+     * 
+     * @param prefs the JOSM preferences 
+     */
+    public void initIconSetFromPreferences(Preferences prefs){
+        TurnRestrictionTypeRenderer renderer = (TurnRestrictionTypeRenderer)getRenderer();
+        renderer.initIconSetFromPreferences(prefs);
+        repaint();
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBoxModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBoxModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBoxModel.java	(revision 23192)
@@ -21,101 +21,101 @@
  */
 public class TurnRestrictionComboBoxModel implements ComboBoxModel, Observer{
-	static private final Logger logger = Logger.getLogger(TurnRestrictionComboBoxModel.class.getName());
-	
-	private TurnRestrictionEditorModel model;
-	final private List<Object> values = new ArrayList<Object>();
-	private String selectedTagValue = null;
-	private final transient EventListenerList listeners = new EventListenerList();
-	
-	/**
-	 * Populates the model with the list of standard values. If the
-	 * data contains a non-standard value it is displayed in the combo
-	 * box as an additional element. 
-	 */
-	protected void populate() {
-		values.clear();
-		for (TurnRestrictionType type: TurnRestrictionType.values()) {
-			values.add(type);
-		}		
-		
-		String tagValue = model.getRestrictionTagValue();
-		if (tagValue.trim().equals("")) {
-			selectedTagValue = null;
-		} else {
-			TurnRestrictionType type = TurnRestrictionType.fromTagValue(tagValue);
-			if (type == null) {
-				values.add(0, tagValue);
-				selectedTagValue = tagValue;
-			} else {
-				selectedTagValue = type.getTagValue();
-			}
-		}
-		fireContentsChanged();
-	}
-	
-	/**
-	 * Creates the combo box model. 
-	 * 
-	 * @param model the turn restriction editor model. Must not be null.
-	 */
-	public TurnRestrictionComboBoxModel(TurnRestrictionEditorModel model){
-		CheckParameterUtil.ensureParameterNotNull(model, "model");
-		this.model = model;
-		model.addObserver(this);
-		populate();
-	}
+    static private final Logger logger = Logger.getLogger(TurnRestrictionComboBoxModel.class.getName());
+    
+    private TurnRestrictionEditorModel model;
+    final private List<Object> values = new ArrayList<Object>();
+    private String selectedTagValue = null;
+    private final transient EventListenerList listeners = new EventListenerList();
+    
+    /**
+     * Populates the model with the list of standard values. If the
+     * data contains a non-standard value it is displayed in the combo
+     * box as an additional element. 
+     */
+    protected void populate() {
+        values.clear();
+        for (TurnRestrictionType type: TurnRestrictionType.values()) {
+            values.add(type);
+        }       
+        
+        String tagValue = model.getRestrictionTagValue();
+        if (tagValue.trim().equals("")) {
+            selectedTagValue = null;
+        } else {
+            TurnRestrictionType type = TurnRestrictionType.fromTagValue(tagValue);
+            if (type == null) {
+                values.add(0, tagValue);
+                selectedTagValue = tagValue;
+            } else {
+                selectedTagValue = type.getTagValue();
+            }
+        }
+        fireContentsChanged();
+    }
+    
+    /**
+     * Creates the combo box model. 
+     * 
+     * @param model the turn restriction editor model. Must not be null.
+     */
+    public TurnRestrictionComboBoxModel(TurnRestrictionEditorModel model){
+        CheckParameterUtil.ensureParameterNotNull(model, "model");
+        this.model = model;
+        model.addObserver(this);
+        populate();
+    }
 
-	public Object getSelectedItem() {
-		TurnRestrictionType type = TurnRestrictionType.fromTagValue(selectedTagValue);
-		if (type != null) return type;
-		return selectedTagValue;
-	}
+    public Object getSelectedItem() {
+        TurnRestrictionType type = TurnRestrictionType.fromTagValue(selectedTagValue);
+        if (type != null) return type;
+        return selectedTagValue;
+    }
 
-	public void setSelectedItem(Object anItem) {
-		String tagValue = null;
-		if (anItem instanceof String) {
-			tagValue = (String)anItem;
-		} else if (anItem instanceof TurnRestrictionType){
-			tagValue = ((TurnRestrictionType)anItem).getTagValue();
-		}
-		model.setRestrictionTagValue(tagValue);
-	}
+    public void setSelectedItem(Object anItem) {
+        String tagValue = null;
+        if (anItem instanceof String) {
+            tagValue = (String)anItem;
+        } else if (anItem instanceof TurnRestrictionType){
+            tagValue = ((TurnRestrictionType)anItem).getTagValue();
+        }
+        model.setRestrictionTagValue(tagValue);
+    }
 
-	public Object getElementAt(int index) {
-		return values.get(index);
-	}
+    public Object getElementAt(int index) {
+        return values.get(index);
+    }
 
-	public int getSize() {
-		return values.size();
-	}
-	
-	public void addListDataListener(ListDataListener l) {
-		listeners.add(ListDataListener.class, l);		
-	}
-	
-	public void removeListDataListener(ListDataListener l) {
-		listeners.remove(ListDataListener.class, l);		
-	}
-	
-	protected void fireContentsChanged() {
-		for(ListDataListener l: listeners.getListeners(ListDataListener.class)) {
-			l.contentsChanged(new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, getSize()));
-		}
-	}
-	
-	/* ------------------------------------------------------------------------------------ */
-	/* interface Observer                                                                   */
-	/* ------------------------------------------------------------------------------------ */
-	public void update(Observable o, Object arg) {		
-		String tagValue = model.getRestrictionTagValue();
-		if (tagValue == null && selectedTagValue != null) {
-			populate();
-		} else if (tagValue != null && selectedTagValue == null){
-			populate();
-		} else if (tagValue != null) {
-			if (!tagValue.equals(selectedTagValue)) {
-				populate();
-			}
-		} 
-	}
+    public int getSize() {
+        return values.size();
+    }
+    
+    public void addListDataListener(ListDataListener l) {
+        listeners.add(ListDataListener.class, l);       
+    }
+    
+    public void removeListDataListener(ListDataListener l) {
+        listeners.remove(ListDataListener.class, l);        
+    }
+    
+    protected void fireContentsChanged() {
+        for(ListDataListener l: listeners.getListeners(ListDataListener.class)) {
+            l.contentsChanged(new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, getSize()));
+        }
+    }
+    
+    /* ------------------------------------------------------------------------------------ */
+    /* interface Observer                                                                   */
+    /* ------------------------------------------------------------------------------------ */
+    public void update(Observable o, Object arg) {      
+        String tagValue = model.getRestrictionTagValue();
+        if (tagValue == null && selectedTagValue != null) {
+            populate();
+        } else if (tagValue != null && selectedTagValue == null){
+            populate();
+        } else if (tagValue != null) {
+            if (!tagValue.equals(selectedTagValue)) {
+                populate();
+            }
+        } 
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditor.java	(revision 23192)
@@ -58,6 +58,6 @@
 
 public class TurnRestrictionEditor extends JDialog implements NavigationControler{
-	final private static Logger logger = Logger.getLogger(TurnRestrictionEditor.class.getName());
-	
+    final private static Logger logger = Logger.getLogger(TurnRestrictionEditor.class.getName());
+    
     /** the property name for the current turn restriction
      * @see #setRelation(Relation)
@@ -84,5 +84,5 @@
     /** the data layer the turn restriction belongs to */
     private OsmDataLayer layer;
-	
+    
     private JosmSelectionPanel pnlJosmSelection;
     private BasicEditorPanel pnlBasicEditor;
@@ -114,6 +114,6 @@
      */
     protected JPanel buildJOSMSelectionPanel() {
-    	pnlJosmSelection = new JosmSelectionPanel(layer);
-    	return pnlJosmSelection;
+        pnlJosmSelection = new JosmSelectionPanel(layer);
+        return pnlJosmSelection;
     }
     
@@ -125,23 +125,23 @@
      */
     protected JPanel buildEditorPanel() {
-    	JPanel pnl = new JPanel(new BorderLayout());
-    	tpEditors = new JTabbedPane();
-    	JScrollPane pane = new JScrollPane(pnlBasicEditor =new BasicEditorPanel(editorModel));
-    	pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
-    	pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
-    	tpEditors.add(pane);
-    	tpEditors.setTitleAt(0, tr("Basic"));
-    	tpEditors.setToolTipTextAt(0, tr("Edit basic attributes of a turn restriction"));
-    	
-    	tpEditors.add(pnlAdvancedEditor = new AdvancedEditorPanel(editorModel));
-    	tpEditors.setTitleAt(1, tr("Advanced"));
-    	tpEditors.setToolTipTextAt(1, tr("Edit the raw tags and members of this turn restriction"));
-    	
-    	tpEditors.add(pnlIssuesView = new IssuesView(editorModel.getIssuesModel()));
-    	tpEditors.setTitleAt(2, tr("Errors/Warnings"));
-    	tpEditors.setToolTipTextAt(2, tr("Show errors and warnings related to this turn restriction"));
-    	
-    	pnl.add(tpEditors, BorderLayout.CENTER);
-    	return pnl;
+        JPanel pnl = new JPanel(new BorderLayout());
+        tpEditors = new JTabbedPane();
+        JScrollPane pane = new JScrollPane(pnlBasicEditor =new BasicEditorPanel(editorModel));
+        pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+        pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
+        tpEditors.add(pane);
+        tpEditors.setTitleAt(0, tr("Basic"));
+        tpEditors.setToolTipTextAt(0, tr("Edit basic attributes of a turn restriction"));
+        
+        tpEditors.add(pnlAdvancedEditor = new AdvancedEditorPanel(editorModel));
+        tpEditors.setTitleAt(1, tr("Advanced"));
+        tpEditors.setToolTipTextAt(1, tr("Edit the raw tags and members of this turn restriction"));
+        
+        tpEditors.add(pnlIssuesView = new IssuesView(editorModel.getIssuesModel()));
+        tpEditors.setTitleAt(2, tr("Errors/Warnings"));
+        tpEditors.setToolTipTextAt(2, tr("Show errors and warnings related to this turn restriction"));
+        
+        pnl.add(tpEditors, BorderLayout.CENTER);
+        return pnl;
     }
     
@@ -153,9 +153,9 @@
      */
     protected JPanel buildContentPanel() {
-    	JPanel pnl = new JPanel(new BorderLayout());
-    	final JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
-    	pnl.add(sp, BorderLayout.CENTER);
-    	sp.setLeftComponent(buildEditorPanel());
-    	sp.setRightComponent(buildJOSMSelectionPanel());
+        JPanel pnl = new JPanel(new BorderLayout());
+        final JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+        pnl.add(sp, BorderLayout.CENTER);
+        sp.setLeftComponent(buildEditorPanel());
+        sp.setRightComponent(buildJOSMSelectionPanel());
         addWindowListener(new WindowAdapter() {
             @Override
@@ -167,5 +167,5 @@
         });
 
-    	return pnl;
+        return pnl;
     }
     
@@ -197,17 +197,17 @@
      * builds the UI
      */
-    protected void build() {    	
-    	editorModel = new TurnRestrictionEditorModel(getLayer(), this);
-    	Container c = getContentPane();
-    	c.setLayout(new BorderLayout());
-    	c.add(buildToolBar(), BorderLayout.NORTH);
-    	c.add(buildContentPanel(), BorderLayout.CENTER);    	
-    	c.add(buildOkCancelButtonPanel(), BorderLayout.SOUTH);
-    	
-    	editorModel.getIssuesModel().addObserver(new IssuesModelObserver());
-    	setSize(600,600);    	
+    protected void build() {        
+        editorModel = new TurnRestrictionEditorModel(getLayer(), this);
+        Container c = getContentPane();
+        c.setLayout(new BorderLayout());
+        c.add(buildToolBar(), BorderLayout.NORTH);
+        c.add(buildContentPanel(), BorderLayout.CENTER);        
+        c.add(buildOkCancelButtonPanel(), BorderLayout.SOUTH);
+        
+        editorModel.getIssuesModel().addObserver(new IssuesModelObserver());
+        setSize(600,600);       
     }    
-	
-	/**
+    
+    /**
     * Creates a new turn restriction editor
     *
@@ -216,9 +216,9 @@
     * @throws IllegalArgumentException thrown if layer is null
     */
-	public TurnRestrictionEditor(Component owner, OsmDataLayer layer) {
-		this(owner, layer, null);
-	}
-	
-	 /**
+    public TurnRestrictionEditor(Component owner, OsmDataLayer layer) {
+        this(owner, layer, null);
+    }
+    
+     /**
      * Creates a new turn restriction editor
      *
@@ -229,5 +229,5 @@
      */
     public TurnRestrictionEditor(Component owner, OsmDataLayer layer, Relation turnRestriction)  throws IllegalArgumentException{
-    	super(JOptionPane.getFrameForComponent(owner),false /* not modal */);
+        super(JOptionPane.getFrameForComponent(owner),false /* not modal */);
         CheckParameterUtil.ensureParameterNotNull(layer, "layer");
         this.layer = layer;
@@ -260,9 +260,9 @@
     protected void setTurnRestriction(Relation turnRestriction) {      
         if (turnRestriction == null) {
-        	editorModel.populate(new Relation());
+            editorModel.populate(new Relation());
         } else if (turnRestriction.getDataSet() == null || turnRestriction.getDataSet() == getLayer().data) {
-        	editorModel.populate(turnRestriction);
+            editorModel.populate(turnRestriction);
         } else {
-        	throw new IllegalArgumentException(MessageFormat.format("turnRestriction must belong to layer ''{0}''", getLayer().getName()));
+            throw new IllegalArgumentException(MessageFormat.format("turnRestriction must belong to layer ''{0}''", getLayer().getName()));
         }
         setTurnRestrictionSnapshot(turnRestriction == null ? null : new Relation(turnRestriction));
@@ -332,22 +332,22 @@
      */
     public TurnRestrictionEditorModel getModel() {
-    	return editorModel;
+        return editorModel;
     }
     
     public void setVisible(boolean visible) {
-    	if (visible && ! isVisible()) {
-    		pnlJosmSelection.wireListeners();
-    		editorModel.registerAsEventListener();
-        	Main.pref.addPreferenceChangeListener(this.preferenceChangeHandler = new PreferenceChangeHandler());
-        	pnlBasicEditor.initIconSetFromPreferences(Main.pref);
-    	} else if (!visible && isVisible()) {
-    		pnlJosmSelection.unwireListeners();
-    		editorModel.unregisterAsEventListener();
-    		Main.pref.removePreferenceChangeListener(preferenceChangeHandler);
-    	}
-    	super.setVisible(visible);
-    	if (!visible){
-    		dispose();
-    	}
+        if (visible && ! isVisible()) {
+            pnlJosmSelection.wireListeners();
+            editorModel.registerAsEventListener();
+            Main.pref.addPreferenceChangeListener(this.preferenceChangeHandler = new PreferenceChangeHandler());
+            pnlBasicEditor.initIconSetFromPreferences(Main.pref);
+        } else if (!visible && isVisible()) {
+            pnlJosmSelection.unwireListeners();
+            editorModel.unregisterAsEventListener();
+            Main.pref.removePreferenceChangeListener(preferenceChangeHandler);
+        }
+        super.setVisible(visible);
+        if (!visible){
+            dispose();
+        }
     }
     
@@ -371,163 +371,163 @@
     /* ----------------------------------------------------------------------- */
     public void gotoBasicEditor() {
-    	tpEditors.setSelectedIndex(0);
-	}
+        tpEditors.setSelectedIndex(0);
+    }
 
     public void gotoAdvancedEditor() {
-    	tpEditors.setSelectedIndex(1);
-	}
-
-	public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
-		tpEditors.setSelectedIndex(0);
-		pnlBasicEditor.requestFocusFor(focusTarget);
-	}
-
-	/**
+        tpEditors.setSelectedIndex(1);
+    }
+
+    public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+        tpEditors.setSelectedIndex(0);
+        pnlBasicEditor.requestFocusFor(focusTarget);
+    }
+
+    /**
      * The abstract base action for applying the updates of a turn restriction
      * to the dataset.
      */
-    abstract class SavingAction extends AbstractAction {    	
-    	protected boolean confirmSaveDespiteOfErrorsAndWarnings(){
-    		int numErrors = editorModel.getIssuesModel().getNumErrors();
-    		int numWarnings = editorModel.getIssuesModel().getNumWarnings();
-    		if (numErrors + numWarnings == 0) return true;
-    		
-    		StringBuffer sb = new StringBuffer();
-    		sb.append("<html>");
-    		sb.append(trn(
-				"There is still an unresolved error or warning identified for this turn restriction. "
-    				+ "You are recommended to resolve this issue first.",
-				  "There are still {0} errors and/or warnings identified for this turn restriction. "
-    				+ "You are recommended to resolve these issues first.",
-				  numErrors + numWarnings,
-				  numErrors + numWarnings
-    		));
-    		sb.append("<br>");
-    		sb.append(tr("Do you want to save anyway?"));
-    		ButtonSpec[] options = new ButtonSpec[] {
-    				new ButtonSpec(
-    						tr("Yes, save anyway"),
-    						ImageProvider.get("ok"),
-    						tr("Save the turn restriction despite of errors and/or warnings"),
-    						null // no specific help topic
-    				),
-    				new ButtonSpec(
-    						tr("No, resolve issues first"),
-    						ImageProvider.get("cancel"),
-    						tr("Cancel saving and start resolving pending issues first"),
-    						null // no specific help topic
-    				)
-    		};
-    		
-    		int ret = HelpAwareOptionPane.showOptionDialog(
-    				JOptionPane.getFrameForComponent(TurnRestrictionEditor.this),
-    				sb.toString(),
-    				tr("Pending errors and warnings"),
-    				JOptionPane.WARNING_MESSAGE,
-    				null, // no special icon
-    				options,
-    				options[1], // cancel is default operation
-    				HelpUtil.ht("/Plugins/turnrestrictions#PendingErrorsAndWarnings")
-    		);
-    		return ret == 0 /* OK */;    		
-    	}
-    	
-    	/**
-    	 * Replies the list of relation members in {@code r} which refer to
-    	 * a deleted or invisible primitives.
-    	 * 
-    	 * @param r the relation 
-    	 * @return the list of relation members in {@code r} which refer to
-    	 * a deleted or invisible member
-    	 */
-    	protected List<RelationMember> getDeletedRelationMembers(Relation r) {
-    		List<RelationMember> ret = new ArrayList<RelationMember>();
-    		for(RelationMember rm: r.getMembers()) {
-    			if (rm.getMember().isDeleted() || !rm.getMember().isVisible()) {
-    				ret.add(rm);
-    			}
-    		}
-    		return ret;
-    	}
-    	
-    	/**
-    	 * Removes all members referring to deleted or invisible primitives
-    	 * from the turn restriction {@code tr}.
-    	 * 
-    	 * @param tr  the turn restriction
-    	 */
-    	protected void removeDeletedMembers(Relation tr) {
-    		List<RelationMember> members = tr.getMembers();
-    		for(Iterator<RelationMember> it = members.iterator(); it.hasNext();) {
-    			RelationMember rm = it.next();
-    			if (rm.getMember().isDeleted() || !rm.getMember().isVisible()) {
-    				it.remove();
-    			}
-    		}
-    		tr.setMembers(members);
-    	}
-    	
-    	/**
-    	 * Asks the user how to proceed if a turn restriction refers to deleted or invisible
-    	 * primitives.
-    	 * 
-    	 * If this method returns true the respective members should be removed and the turn
-    	 * restriction should be saved anyway. If it replies false, the turn restriction must not
-    	 * be saved.  
-    	 * 
-    	 * @param deletedMembers the list of members referring to deleted or invisible primitives  
-    	 * @return the confirmation 
-    	 */
-    	protected boolean confirmSaveTurnRestrictionWithDeletePrimitives(List<RelationMember> deletedMembers) {    		    		
-    		StringBuffer sb = new StringBuffer();
-    		sb.append("<html>");
-    		sb.append(trn("This turn restriction refers to an object which was deleted outside "
-    		           + "of this turn restriction editor:",
-    		           "This turn restriction refers to {0} which were deleted outside "
-    		           + "of this turn restriction editor:", deletedMembers.size(), deletedMembers.size()));
-    		sb.append("<ul>");
-    		for(RelationMember rm: deletedMembers){
-    			sb.append("<li>");
-    			if (!rm.getRole().equals("")) {
-    				sb.append(rm.getRole()).append(": ");
-    			}
-    			sb.append(rm.getMember().getDisplayName(DefaultNameFormatter.getInstance()));
-    			sb.append("</li>");
-    		}
-    		sb.append(tr("Updates to this turn restriction can''t be saved unless deleted members are removed.<br>"
-    				+ "How to you want to proceed?"));
-    		
-    		ButtonSpec[] options = new ButtonSpec[] {
-    				new ButtonSpec(
-    					tr("Remove deleted members and save"),
-    					ImageProvider.get("OK"),
-    					tr("Remove deleted members and save"),
-    					null
-    			     ),
-     				  new ButtonSpec(
-        					tr("Cancel and return to editor"),
-        					ImageProvider.get("cancel"),
-        					tr("Cancel and return to editor"),
-        					null
-        			   )
-    		};
-    		
-    		int ret = HelpAwareOptionPane.showOptionDialog(
-    				TurnRestrictionEditor.this,
-    				sb.toString(),
-    				tr("Deleted members in turn restriction"),
-    				JOptionPane.WARNING_MESSAGE,
-    				null, // no special icon
-    				options,
-    				options[1], // cancel is default
-    				null // FIXME: provide help topic
-    		);    		
-    		return ret == 0 /* OK button */; 
-    	}
-    	
+    abstract class SavingAction extends AbstractAction {        
+        protected boolean confirmSaveDespiteOfErrorsAndWarnings(){
+            int numErrors = editorModel.getIssuesModel().getNumErrors();
+            int numWarnings = editorModel.getIssuesModel().getNumWarnings();
+            if (numErrors + numWarnings == 0) return true;
+            
+            StringBuffer sb = new StringBuffer();
+            sb.append("<html>");
+            sb.append(trn(
+                "There is still an unresolved error or warning identified for this turn restriction. "
+                    + "You are recommended to resolve this issue first.",
+                  "There are still {0} errors and/or warnings identified for this turn restriction. "
+                    + "You are recommended to resolve these issues first.",
+                  numErrors + numWarnings,
+                  numErrors + numWarnings
+            ));
+            sb.append("<br>");
+            sb.append(tr("Do you want to save anyway?"));
+            ButtonSpec[] options = new ButtonSpec[] {
+                    new ButtonSpec(
+                            tr("Yes, save anyway"),
+                            ImageProvider.get("ok"),
+                            tr("Save the turn restriction despite of errors and/or warnings"),
+                            null // no specific help topic
+                    ),
+                    new ButtonSpec(
+                            tr("No, resolve issues first"),
+                            ImageProvider.get("cancel"),
+                            tr("Cancel saving and start resolving pending issues first"),
+                            null // no specific help topic
+                    )
+            };
+            
+            int ret = HelpAwareOptionPane.showOptionDialog(
+                    JOptionPane.getFrameForComponent(TurnRestrictionEditor.this),
+                    sb.toString(),
+                    tr("Pending errors and warnings"),
+                    JOptionPane.WARNING_MESSAGE,
+                    null, // no special icon
+                    options,
+                    options[1], // cancel is default operation
+                    HelpUtil.ht("/Plugins/turnrestrictions#PendingErrorsAndWarnings")
+            );
+            return ret == 0 /* OK */;           
+        }
+        
+        /**
+         * Replies the list of relation members in {@code r} which refer to
+         * a deleted or invisible primitives.
+         * 
+         * @param r the relation 
+         * @return the list of relation members in {@code r} which refer to
+         * a deleted or invisible member
+         */
+        protected List<RelationMember> getDeletedRelationMembers(Relation r) {
+            List<RelationMember> ret = new ArrayList<RelationMember>();
+            for(RelationMember rm: r.getMembers()) {
+                if (rm.getMember().isDeleted() || !rm.getMember().isVisible()) {
+                    ret.add(rm);
+                }
+            }
+            return ret;
+        }
+        
+        /**
+         * Removes all members referring to deleted or invisible primitives
+         * from the turn restriction {@code tr}.
+         * 
+         * @param tr  the turn restriction
+         */
+        protected void removeDeletedMembers(Relation tr) {
+            List<RelationMember> members = tr.getMembers();
+            for(Iterator<RelationMember> it = members.iterator(); it.hasNext();) {
+                RelationMember rm = it.next();
+                if (rm.getMember().isDeleted() || !rm.getMember().isVisible()) {
+                    it.remove();
+                }
+            }
+            tr.setMembers(members);
+        }
+        
+        /**
+         * Asks the user how to proceed if a turn restriction refers to deleted or invisible
+         * primitives.
+         * 
+         * If this method returns true the respective members should be removed and the turn
+         * restriction should be saved anyway. If it replies false, the turn restriction must not
+         * be saved.  
+         * 
+         * @param deletedMembers the list of members referring to deleted or invisible primitives  
+         * @return the confirmation 
+         */
+        protected boolean confirmSaveTurnRestrictionWithDeletePrimitives(List<RelationMember> deletedMembers) {                     
+            StringBuffer sb = new StringBuffer();
+            sb.append("<html>");
+            sb.append(trn("This turn restriction refers to an object which was deleted outside "
+                       + "of this turn restriction editor:",
+                       "This turn restriction refers to {0} which were deleted outside "
+                       + "of this turn restriction editor:", deletedMembers.size(), deletedMembers.size()));
+            sb.append("<ul>");
+            for(RelationMember rm: deletedMembers){
+                sb.append("<li>");
+                if (!rm.getRole().equals("")) {
+                    sb.append(rm.getRole()).append(": ");
+                }
+                sb.append(rm.getMember().getDisplayName(DefaultNameFormatter.getInstance()));
+                sb.append("</li>");
+            }
+            sb.append(tr("Updates to this turn restriction can''t be saved unless deleted members are removed.<br>"
+                    + "How to you want to proceed?"));
+            
+            ButtonSpec[] options = new ButtonSpec[] {
+                    new ButtonSpec(
+                        tr("Remove deleted members and save"),
+                        ImageProvider.get("OK"),
+                        tr("Remove deleted members and save"),
+                        null
+                     ),
+                      new ButtonSpec(
+                            tr("Cancel and return to editor"),
+                            ImageProvider.get("cancel"),
+                            tr("Cancel and return to editor"),
+                            null
+                       )
+            };
+            
+            int ret = HelpAwareOptionPane.showOptionDialog(
+                    TurnRestrictionEditor.this,
+                    sb.toString(),
+                    tr("Deleted members in turn restriction"),
+                    JOptionPane.WARNING_MESSAGE,
+                    null, // no special icon
+                    options,
+                    options[1], // cancel is default
+                    null // FIXME: provide help topic
+            );          
+            return ret == 0 /* OK button */; 
+        }
+        
         /**
          * apply updates to a new turn restriction
          */
-        protected boolean applyNewTurnRestriction() {        	
+        protected boolean applyNewTurnRestriction() {           
             Relation newTurnRestriction = new Relation();
             editorModel.apply(newTurnRestriction);
@@ -541,8 +541,8 @@
             List<RelationMember> deletedMembers = getDeletedRelationMembers(newTurnRestriction);
             if (!deletedMembers.isEmpty()) {
-            	if (!confirmSaveTurnRestrictionWithDeletePrimitives(deletedMembers)) {
-            		return false;
-            	}
-            	removeDeletedMembers(newTurnRestriction);
+                if (!confirmSaveTurnRestrictionWithDeletePrimitives(deletedMembers)) {
+                    return false;
+                }
+                removeDeletedMembers(newTurnRestriction);
             }
             
@@ -576,12 +576,12 @@
          * outside of the turn restriction editor.
          */
-        protected void applyExistingNonConflictingTurnRestriction() {        	
+        protected void applyExistingNonConflictingTurnRestriction() {           
             if (getTurnRestriction().getDataSet() == null) {
-            	editorModel.apply(getTurnRestriction());
-            	Main.main.undoRedo.add(new AddCommand(getTurnRestriction()));
+                editorModel.apply(getTurnRestriction());
+                Main.main.undoRedo.add(new AddCommand(getTurnRestriction()));
             } else {
-            	Relation toUpdate = new Relation(getTurnRestriction());
+                Relation toUpdate = new Relation(getTurnRestriction());
                 editorModel.apply(toUpdate);            
-            	Main.main.undoRedo.add(new ChangeCommand(getTurnRestriction(), toUpdate));
+                Main.main.undoRedo.add(new ChangeCommand(getTurnRestriction(), toUpdate));
             }
             // this will refresh the snapshot and update the dialog title
@@ -646,8 +646,8 @@
 
         public void run() {
-        	if (!confirmSaveDespiteOfErrorsAndWarnings()){
-        		tpEditors.setSelectedIndex(2); // show the errors and warnings
-        		return;
-        	}
+            if (!confirmSaveDespiteOfErrorsAndWarnings()){
+                tpEditors.setSelectedIndex(2); // show the errors and warnings
+                return;
+            }
             if (getTurnRestriction() == null) {
                 applyNewTurnRestriction();
@@ -658,6 +658,6 @@
             editorModel.apply(toUpdate);
             if (TurnRestrictionEditorModel.hasSameMembersAndTags(toUpdate, getTurnRestriction()))
-            	// nothing to update 
-            	return;
+                // nothing to update 
+                return;
             
             if (isDirtyTurnRestriction()) {
@@ -689,12 +689,12 @@
 
         public void run() {
-        	if (!confirmSaveDespiteOfErrorsAndWarnings()){
-        		tpEditors.setSelectedIndex(2); // show the errors and warnings
-        		return;
-        	}
+            if (!confirmSaveDespiteOfErrorsAndWarnings()){
+                tpEditors.setSelectedIndex(2); // show the errors and warnings
+                return;
+            }
             if (getTurnRestriction() == null) {
-            	// it's a new turn restriction. Try to save it and close the dialog
+                // it's a new turn restriction. Try to save it and close the dialog
                 if (applyNewTurnRestriction()) {
-                	setVisible(false);
+                    setVisible(false);
                 }
                 return;
@@ -704,12 +704,12 @@
             editorModel.apply(toUpdate);
             if (TurnRestrictionEditorModel.hasSameMembersAndTags(toUpdate, getTurnRestriction())){
-            	// nothing to update 
-            	setVisible(false);
-            	return;
+                // nothing to update 
+                setVisible(false);
+                return;
             }
             
             if (isDirtyTurnRestriction()) {
-            	// the turn restriction this editor is working on has changed outside
-            	// of the editor. 
+                // the turn restriction this editor is working on has changed outside
+                // of the editor. 
                 if (confirmClosingBecauseOfDirtyState()) {
                     if (getLayer().getConflicts().hasConflictForMy(getTurnRestriction())) {
@@ -750,117 +750,117 @@
     
     class DeleteAction extends AbstractAction implements PropertyChangeListener{
-    	public DeleteAction() {
-    		putValue(NAME, tr("Delete"));
-    		putValue(SHORT_DESCRIPTION, tr("Delete this turn restriction"));
-    		putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
-    		updateEnabledState();
-    	}
-    	
-    	protected void updateEnabledState() {    		
-    		Relation tr = getTurnRestriction();
-    		setEnabled(tr != null && tr.getDataSet() != null);
-    	}
-
-    	public void actionPerformed(ActionEvent e) {
-    		Relation tr = getTurnRestriction();
-    		if (tr == null || tr.getDataSet() == null) return;
-    		org.openstreetmap.josm.actions.mapmode.DeleteAction.deleteRelation(
+        public DeleteAction() {
+            putValue(NAME, tr("Delete"));
+            putValue(SHORT_DESCRIPTION, tr("Delete this turn restriction"));
+            putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
+            updateEnabledState();
+        }
+        
+        protected void updateEnabledState() {           
+            Relation tr = getTurnRestriction();
+            setEnabled(tr != null && tr.getDataSet() != null);
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            Relation tr = getTurnRestriction();
+            if (tr == null || tr.getDataSet() == null) return;
+            org.openstreetmap.josm.actions.mapmode.DeleteAction.deleteRelation(
                     getLayer(),
                     tr
             );
-    		setVisible(false);
-		}
-
-		public void propertyChange(PropertyChangeEvent evt) {
-			if (evt.getPropertyName().equals(TURN_RESTRICION_PROP)){
-				updateEnabledState();
-			}
-		}
+            setVisible(false);
+        }
+
+        public void propertyChange(PropertyChangeEvent evt) {
+            if (evt.getPropertyName().equals(TURN_RESTRICION_PROP)){
+                updateEnabledState();
+            }
+        }
     }
     
     class SelectAction extends AbstractAction implements PropertyChangeListener{
-    	public SelectAction() {
-    		putValue(NAME, tr("Select"));
-    		putValue(SHORT_DESCRIPTION, tr("Select this turn restriction"));
-    		putValue(SMALL_ICON, ImageProvider.get("dialogs", "select"));
-    		updateEnabledState();
-    	}
-    	
-    	protected void updateEnabledState() {
-    		Relation tr = getTurnRestriction();
-    		setEnabled(tr != null && tr.getDataSet() != null);
-    	}
-
-    	public void actionPerformed(ActionEvent e) {
-    		Relation tr = getTurnRestriction();
-    		if (tr == null || tr.getDataSet() == null) return;
-    		getLayer().data.setSelected(tr);
-		}
-
-		public void propertyChange(PropertyChangeEvent evt) {
-			if (evt.getPropertyName().equals(TURN_RESTRICION_PROP)){
-				updateEnabledState();
-			}
-		}
+        public SelectAction() {
+            putValue(NAME, tr("Select"));
+            putValue(SHORT_DESCRIPTION, tr("Select this turn restriction"));
+            putValue(SMALL_ICON, ImageProvider.get("dialogs", "select"));
+            updateEnabledState();
+        }
+        
+        protected void updateEnabledState() {
+            Relation tr = getTurnRestriction();
+            setEnabled(tr != null && tr.getDataSet() != null);
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            Relation tr = getTurnRestriction();
+            if (tr == null || tr.getDataSet() == null) return;
+            getLayer().data.setSelected(tr);
+        }
+
+        public void propertyChange(PropertyChangeEvent evt) {
+            if (evt.getPropertyName().equals(TURN_RESTRICION_PROP)){
+                updateEnabledState();
+            }
+        }
     }
     
     class ZoomToAction extends AbstractAction implements PropertyChangeListener{
-    	public ZoomToAction() {
-    		putValue(NAME, tr("Zoom to"));
-    		putValue(SHORT_DESCRIPTION, tr("Activate the layer this turn restriction belongs to and zoom to it"));
-    		putValue(SMALL_ICON, ImageProvider.get("dialogs/autoscale", "data"));
-    		updateEnabledState();
-    	}
-    	
-    	protected void updateEnabledState() {
-    		Relation tr = getTurnRestriction();
-    		setEnabled(tr != null && tr.getDataSet() != null);
-    	}
-
-    	public void actionPerformed(ActionEvent e) {
-    		if (Main.main.getActiveLayer() != getLayer()){
-    			Main.map.mapView.setActiveLayer(getLayer());
-    		}
-    		Relation tr = getTurnRestriction();
-    		if (tr == null || tr.getDataSet() == null) return;
-    		getLayer().data.setSelected(tr);    		
-    		AutoScaleAction.zoomToSelection();
-		}
-
-		public void propertyChange(PropertyChangeEvent evt) {
-			if (evt.getPropertyName().equals(TURN_RESTRICION_PROP)){
-				updateEnabledState();
-			}
-		}
+        public ZoomToAction() {
+            putValue(NAME, tr("Zoom to"));
+            putValue(SHORT_DESCRIPTION, tr("Activate the layer this turn restriction belongs to and zoom to it"));
+            putValue(SMALL_ICON, ImageProvider.get("dialogs/autoscale", "data"));
+            updateEnabledState();
+        }
+        
+        protected void updateEnabledState() {
+            Relation tr = getTurnRestriction();
+            setEnabled(tr != null && tr.getDataSet() != null);
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            if (Main.main.getActiveLayer() != getLayer()){
+                Main.map.mapView.setActiveLayer(getLayer());
+            }
+            Relation tr = getTurnRestriction();
+            if (tr == null || tr.getDataSet() == null) return;
+            getLayer().data.setSelected(tr);            
+            AutoScaleAction.zoomToSelection();
+        }
+
+        public void propertyChange(PropertyChangeEvent evt) {
+            if (evt.getPropertyName().equals(TURN_RESTRICION_PROP)){
+                updateEnabledState();
+            }
+        }
     }
     
     class IssuesModelObserver implements Observer {
-		public void update(Observable o, Object arg) {
-			int numWarnings = editorModel.getIssuesModel().getNumWarnings();
-			int numErrors = editorModel.getIssuesModel().getNumErrors();
-			String warningText = null;
-			if (numWarnings > 0){
-				warningText = trn("{0} warning", "{0} warnings", numWarnings, numWarnings);
-			}
-			String errorText = null;
-			if (numErrors > 0){
-				errorText = trn("{0} error", "{0} errors", numErrors, numErrors);
-			}
-			String title = "";
-			if (errorText != null) {
-				title += errorText;
-			}
-			if (warningText != null){
-				if (title.length() > 0){
-					title += "/";
-				}
-				title += warningText;
-			}
-			if (title.length() == 0){
-				title = tr("no issues");
-			}
-			tpEditors.setTitleAt(2, title);
-			tpEditors.setEnabledAt(2, numWarnings + numErrors > 0);
-		}    	
+        public void update(Observable o, Object arg) {
+            int numWarnings = editorModel.getIssuesModel().getNumWarnings();
+            int numErrors = editorModel.getIssuesModel().getNumErrors();
+            String warningText = null;
+            if (numWarnings > 0){
+                warningText = trn("{0} warning", "{0} warnings", numWarnings, numWarnings);
+            }
+            String errorText = null;
+            if (numErrors > 0){
+                errorText = trn("{0} error", "{0} errors", numErrors, numErrors);
+            }
+            String title = "";
+            if (errorText != null) {
+                title += errorText;
+            }
+            if (warningText != null){
+                if (title.length() > 0){
+                    title += "/";
+                }
+                title += warningText;
+            }
+            if (title.length() == 0){
+                title = tr("no issues");
+            }
+            tpEditors.setTitleAt(2, title);
+            tpEditors.setEnabledAt(2, numWarnings + numErrors > 0);
+        }       
     }
     
@@ -874,16 +874,16 @@
      *
      */
-    class PreferenceChangeHandler implements PreferenceChangedListener {    	
-    	public void refreshIconSet() {
-    		pnlBasicEditor.initIconSetFromPreferences(Main.pref);
-    	}
-    	
-		public void preferenceChanged(PreferenceChangeEvent evt) {			
-			if (evt.getKey().equals(PreferenceKeys.ROAD_SIGNS)){
-				refreshIconSet();
-			} else if (evt.getKey().equals(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR)) {
-				pnlBasicEditor.initViasVisibilityFromPreferences(Main.pref);
-			}			
-		}
+    class PreferenceChangeHandler implements PreferenceChangedListener {        
+        public void refreshIconSet() {
+            pnlBasicEditor.initIconSetFromPreferences(Main.pref);
+        }
+        
+        public void preferenceChanged(PreferenceChangeEvent evt) {          
+            if (evt.getKey().equals(PreferenceKeys.ROAD_SIGNS)){
+                refreshIconSet();
+            } else if (evt.getKey().equals(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR)) {
+                pnlBasicEditor.initViasVisibilityFromPreferences(Main.pref);
+            }           
+        }
     }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorManager.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorManager.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorManager.java	(revision 23192)
@@ -23,5 +23,5 @@
  */
 public class TurnRestrictionEditorManager extends WindowAdapter implements MapView.LayerChangeListener{
-	static private final Logger logger = Logger.getLogger(TurnRestrictionEditorManager.class.getName());
+    static private final Logger logger = Logger.getLogger(TurnRestrictionEditorManager.class.getName());
 
     /** keeps track of open relation editors */
@@ -55,36 +55,36 @@
 
         @Override
-		public int hashCode() {
-			final int prime = 31;
-			int result = 1;
-			result = prime * result + ((layer == null) ? 0 : layer.hashCode());
-			result = prime * result
-					+ ((primitiveId == null) ? 0 : primitiveId.hashCode());
-			return result;
-		}
-
-		@Override
-		public boolean equals(Object obj) {
-			if (this == obj)
-				return true;
-			if (obj == null)
-				return false;
-			if (getClass() != obj.getClass())
-				return false;
-			DialogContext other = (DialogContext) obj;
-			if (layer == null) {
-				if (other.layer != null)
-					return false;
-			} else if (!layer.equals(other.layer))
-				return false;
-			if (primitiveId == null) {
-				if (other.primitiveId != null)
-					return false;
-			} else if (!primitiveId.equals(other.primitiveId))
-				return false;
-			return true;
-		}
-
-		public boolean matchesLayer(OsmDataLayer layer) {
+        public int hashCode() {
+            final int prime = 31;
+            int result = 1;
+            result = prime * result + ((layer == null) ? 0 : layer.hashCode());
+            result = prime * result
+                    + ((primitiveId == null) ? 0 : primitiveId.hashCode());
+            return result;
+        }
+
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj)
+                return true;
+            if (obj == null)
+                return false;
+            if (getClass() != obj.getClass())
+                return false;
+            DialogContext other = (DialogContext) obj;
+            if (layer == null) {
+                if (other.layer != null)
+                    return false;
+            } else if (!layer.equals(other.layer))
+                return false;
+            if (primitiveId == null) {
+                if (other.primitiveId != null)
+                    return false;
+            } else if (!primitiveId.equals(other.primitiveId))
+                return false;
+            return true;
+        }
+
+        public boolean matchesLayer(OsmDataLayer layer) {
             if (layer == null) return false;
             return this.layer.equals(layer);
@@ -187,5 +187,5 @@
     @Override
     public void windowClosed(WindowEvent e) {
-    	TurnRestrictionEditor editor = (TurnRestrictionEditor)e.getWindow();
+        TurnRestrictionEditor editor = (TurnRestrictionEditor)e.getWindow();
         DialogContext context = null;
         for (DialogContext c : openDialogs.keySet()) {
@@ -200,5 +200,5 @@
     }
 
-	/**
+    /**
      * Positions an {@see TurnRestrictionEditor} centered on the screen
      *
@@ -286,5 +286,5 @@
             Entry<DialogContext,TurnRestrictionEditor> entry = it.next();
             if (entry.getKey().matchesLayer(dataLayer)) {
-            	TurnRestrictionEditor editor = entry.getValue();
+                TurnRestrictionEditor editor = entry.getValue();
                 it.remove();
                 editor.setVisible(false);
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorModel.java	(revision 23192)
@@ -40,404 +40,404 @@
  */
 public class TurnRestrictionEditorModel extends Observable implements DataSetListener{
-	static private final Logger logger = Logger.getLogger(TurnRestrictionEditorModel.class.getName());
-	
-	/**
-	 * Replies true if {@code tp1} and {@code tp2} have the same tags and
-	 * the same members 
-	 * 
-	 * @param tp1 a turn restriction. Must not be null. 
-	 * @param tp2 a turn restriction . Must not be null.
-	 * @return true if {@code tp1} and {@code tp2} have the same tags and
-	 * the same members
-	 * @throws IllegalArgumentException thrown if {@code tp1} is null
-	 * @throws IllegalArgumentException thrown if {@code tp2} is null
-	 */
-	static public boolean hasSameMembersAndTags(Relation tp1, Relation tp2) throws IllegalArgumentException {
-		CheckParameterUtil.ensureParameterNotNull(tp1, "tp1");
-		CheckParameterUtil.ensureParameterNotNull(tp2, "tp2");
-		if (!TagCollection.from(tp1).asSet().equals(TagCollection.from(tp2).asSet())) return false;
-		if (tp1.getMembersCount() != tp2.getMembersCount()) return false;
-		for(int i=0; i < tp1.getMembersCount();i++){
-			if (!tp1.getMember(i).equals(tp2.getMember(i))) return false;
-		}
-		return true;
-	}
-	
-	private OsmDataLayer layer;
-	private final TagEditorModel tagEditorModel = new TagEditorModel();
-	private  RelationMemberEditorModel memberModel;
-	private  IssuesModel issuesModel;
-	private NavigationControler navigationControler;
-	
-	/**
-	 * Creates a model in the context of a {@see OsmDataLayer}
-	 * 
-	 * @param layer the layer. Must not be null.
-	 * @param navigationControler control to direct the user to specific UI components. Must not be null 
-	 * @throws IllegalArgumentException thrown if {@code layer} is null
-	 */
-	public TurnRestrictionEditorModel(OsmDataLayer layer, NavigationControler navigationControler) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(layer, "layer");
-		CheckParameterUtil.ensureParameterNotNull(navigationControler, "navigationControler");
-		this.layer = layer;
-		this.navigationControler = navigationControler;
-		memberModel = new RelationMemberEditorModel(layer);
-		memberModel.addTableModelListener(new RelationMemberModelListener());
-		issuesModel = new IssuesModel(this);
-		addObserver(issuesModel);
-		tagEditorModel.addTableModelListener(new TagEditorModelObserver());
-	}
-	
-	/**
-	 * Sets the way participating in the turn restriction in a given role.
-	 * 
-	 * @param role the role. Must not be null.  
-	 * @param way the way which participates in the turn restriction in the respective role.
-	 * null, to remove the way with the given role.
-	 * @exception IllegalArgumentException thrown if role is null
-	 */
-	public void setTurnRestrictionLeg(TurnRestrictionLegRole role, Way way) {
-		CheckParameterUtil.ensureParameterNotNull(role, "role");
-		switch(role){
-		case FROM:
-			memberModel.setFromPrimitive(way);
-			break;
-		case TO:
-			memberModel.setToPrimitive(way);
-			break;
-		}
-	}	
-		
-	/**
-	 * Sets the way participating in the turn restriction in a given role.
-	 * 
-	 * @param role the role. Must not be null.  
-	 * @param wayId the id of the way to set
-	 * @exception IllegalArgumentException thrown if role is null
-	 * @exception IllegalArgumentException thrown if wayId != null isn't the id of a way
-	 * @exception IllegalStateException thrown the no way with this id was found in the dataset 
-	 */
-	public void setTurnRestrictionLeg(TurnRestrictionLegRole role, PrimitiveId wayId) {
-		CheckParameterUtil.ensureParameterNotNull(role, "role");
-		if (wayId == null) {
-			setTurnRestrictionLeg(role, (Way)null);
-			return;
-		}
-		if (!wayId.getType().equals(OsmPrimitiveType.WAY)) {
-			throw new IllegalArgumentException(MessageFormat.format("parameter ''wayId'' of type {0} expected, got {1}", OsmPrimitiveType.WAY, wayId.getType()));
-		}
-
-		OsmPrimitive p = layer.data.getPrimitiveById(wayId);
-		if (p == null) {
-			throw new IllegalStateException(MessageFormat.format("didn''t find way with id {0} in layer ''{1}''", wayId, layer.getName()));			
-		}
-		setTurnRestrictionLeg(role, (Way)p);
-	}	
-	
-	/**
-	 * "Officially" a turn restriction should have exactly one member with 
-	 * role {@see TurnRestrictionLegRole#FROM} and one member with role {@see TurnRestrictionLegRole#TO},
-	 * both referring to an OSM {@see Way}. In order to deals with turn restrictions where these
-	 * integrity constraints are violated, this model also supports relation with multiple or no
-	 * 'from' or 'to' members.
-	 * 
-	 * Replies the turn restriction legs with role {@code role}. If no leg with this
-	 * role exists, an empty set is returned. If multiple legs exists, the set of referred
-	 * primitives is returned.  
-	 * 
-	 * @param role the role. Must not be null.
-	 * @return the set of turn restriction legs with role {@code role}. The empty set, if
-	 * no such turn restriction leg exists
-	 * @throws IllegalArgumentException thrown if role is null
-	 */
-	public Set<OsmPrimitive>getTurnRestrictionLeg(TurnRestrictionLegRole role){
-		CheckParameterUtil.ensureParameterNotNull(role, "role");
-		switch(role){
-		case FROM: return memberModel.getFromPrimitives();
-		case TO: return memberModel.getToPrimitives();
-		}
-		// should not happen
-		return null;
-	}
-	
-	/**
-	 * Initializes the model from a relation representing a turn
-	 * restriction
-	 * 
-	 * @param turnRestriction the turn restriction
-	 */
-	protected void initFromTurnRestriction(Relation turnRestriction) {
-		
-		// populate the member model
-		memberModel.populate(turnRestriction);
-		
-		// make sure we have a restriction tag
-		TagCollection tags = TagCollection.from(turnRestriction);
-		tags.setUniqueForKey("type", "restriction");
-		tagEditorModel.initFromTags(tags);
-				
-		setChanged();
-		notifyObservers();
-	}
-	
-	/**
-	 * Populates the turn restriction editor model with a turn restriction. 
-	 * {@code turnRestriction} is an arbitrary relation. A tag type=restriction
-	 * isn't required. If it is missing, it is added here. {@code turnRestriction}
-	 * must not be null and it must belong to a dataset. 
-	 * 
-	 * @param turnRestriction the turn restriction
-	 * @throws IllegalArgumentException thrown if turnRestriction is null
-	 * @throws IllegalArgumentException thrown if turnRestriction doesn't belong to a dataset  
-	 */
-	public void populate(Relation turnRestriction) {
-		CheckParameterUtil.ensureParameterNotNull(turnRestriction, "turnRestriction");
-		if (turnRestriction.getDataSet() != null && turnRestriction.getDataSet() != layer.data) {			
-			throw new IllegalArgumentException(
-				// don't translate - it's a technical message
-				MessageFormat.format("turnRestriction {0} must not belong to a different dataset than the dataset of layer ''{1}''", turnRestriction.getId(), layer.getName())
-			);
-		}
-		initFromTurnRestriction(turnRestriction);
-	}
-	
-	
-	/**
-	 * Applies the current state in the model to a turn restriction
-	 * 
-	 * @param turnRestriction the turn restriction. Must not be null.
-	 */
-	public void apply(Relation turnRestriction) {
-		CheckParameterUtil.ensureParameterNotNull(turnRestriction, "turnRestriction");		
-		TagCollection tags = tagEditorModel.getTagCollection();
-		turnRestriction.removeAll();
-		tags.applyTo(turnRestriction);
-		memberModel.applyTo(turnRestriction);		
-	}
-	
-	/**
-	 * Replies the current tag value for the tag <tt>restriction</tt>.
-	 * The empty tag, if there isn't a tag <tt>restriction</tt>.  
-	 * 
-	 * @return the tag value
-	 */
-	public String getRestrictionTagValue() {
-		TagCollection tags = tagEditorModel.getTagCollection();
-		if (!tags.hasTagsFor("restriction")) return "";
-		return tags.getJoinedValues("restriction");
-	}
-	
-	/**
-	 * Sets the current value for the restriction tag. If {@code value} is
-	 * null or an empty string, the restriction tag is removed. 
-	 * 
-	 * @param value the value of the restriction tag 
-	 */
-	public void setRestrictionTagValue(String value){
-		if (value == null || value.trim().equals("")) {
-			tagEditorModel.delete("restriction");			
-		} else {
-			TagModel  tm = tagEditorModel.get("restriction");
-			if (tm != null){
-				tm.setValue(value);
-			} else {
-				tagEditorModel.prepend(new TagModel("restriction", value.trim().toLowerCase()));
-			}
-		}
-		setChanged();
-		notifyObservers();
-	}
-	
-	/**
-	 * Replies the list of 'via' objects. The return value is an
-	 * unmodifiable list.
-	 *  
-	 * @return the list of 'via' objects
-	 */
-	public List<OsmPrimitive> getVias() {
-		return memberModel.getVias();
-	}
-	
-	/**
-	 * Sets the list of vias for the edited turn restriction.
-	 * 
-	 * If {@code vias} is null, all vias are removed. All primitives
-	 * in {@code vias} must be assigned to a dataset and the dataset
-	 * must be equal to the dataset of this editor model, see {@see #getDataSet()}
-	 * 
-	 * null values in {@see vias} are skipped. 
-	 * 
-	 * @param vias the list of vias 
-	 * @throws IllegalArgumentException thrown if one of the via objects belongs to the wrong dataset 
-	 */
-	public void setVias(List<OsmPrimitive> vias) throws IllegalArgumentException{
-		memberModel.setVias(vias);
-	}
-	
-	/**
-	 * Replies the layer in whose context this editor is working
-	 * 
-	 * @return the layer in whose context this editor is working
-	 */
-	public OsmDataLayer getLayer() {
-		return layer;
-	}
-	
-	/**
-	 * Registers this model with global event sources like {@see DatasetEventManager}
-	 */
-	public void registerAsEventListener(){
-		DatasetEventManager.getInstance().addDatasetListener(this, FireMode.IN_EDT);
-	}
-	
-	/**
-	 * Removes this model as listener from global event sources like  {@see DatasetEventManager}
-	 */
-	public void unregisterAsEventListener() {
-		DatasetEventManager.getInstance().removeDatasetListener(this);
-	}
-	
-	/**
-	 * Replies the tag  editor model 
-	 * 
-	 * @return the tag  editor model
-	 */
-	public TagEditorModel getTagEditorModel() {
-		return tagEditorModel;
-	}
-	
-	/**
-	 * Replies the editor model for the relation members
-	 * 
-	 * @return the editor model for the relation members
-	 */
-	public RelationMemberEditorModel getRelationMemberEditorModel() {
-		return memberModel;
-	}
-	
-	/**
-	 * Replies the model for the open issues in this turn restriction
-	 * editor.
-	 * 
-	 * @return the model for the open issues in this turn restriction
-	 * editor
-	 */
-	public IssuesModel getIssuesModel() {
-		return issuesModel;
-	}
-	
-	public NavigationControler getNavigationControler() {
-		return navigationControler;
-	}
-	
-	/**
-	 * Replies the current value of the tag "except", or the empty string
-	 * if the tag doesn't exist.
-	 * 
-	 * @return
-	 */
-	public ExceptValueModel getExcept() {
-		TagModel tag = tagEditorModel.get("except");
-		if (tag == null) return new ExceptValueModel("");
-		return new ExceptValueModel(tag.getValue());
-	}
-	
-	/**
-	 * Sets the current value of the tag "except". Removes the
-	 * tag is {@code value} is null or consists of white
-	 * space only. 
-	 * 
-	 * @param value the new value for 'except'
-	 */
-	public void setExcept(ExceptValueModel value){
-		if (value == null || value.getValue().equals("")) {
-			if (tagEditorModel.get("except") != null){
-				tagEditorModel.delete("except");
-				setChanged();
-				notifyObservers();				
-			}
-			return;			
-		}
-		TagModel tag = tagEditorModel.get("except");
-		if (tag == null) {
-			tagEditorModel.prepend(new TagModel("except", value.getValue()));
-			setChanged();
-			notifyObservers();
-		} else {
-			if (!tag.getValue().equals(value.getValue())) {
-				tag.setValue(value.getValue().trim());
-				setChanged();
-				notifyObservers();
-			}
-		}		
-	}
-
-	/* ----------------------------------------------------------------------------------------- */
-	/* interface DataSetListener                                                                 */
-	/* ----------------------------------------------------------------------------------------- */	
-	protected boolean isAffectedByDataSetUpdate(DataSet ds, List<? extends OsmPrimitive> updatedPrimitives) {
-		if (ds != layer.data) return false;
-		if (updatedPrimitives == null || updatedPrimitives.isEmpty()) return false;
-		Set<OsmPrimitive> myPrimitives = memberModel.getMemberPrimitives();
-		int size1 = myPrimitives.size();
-		myPrimitives.retainAll(updatedPrimitives);
-		return size1 != myPrimitives.size();
-	}
-	
-	public void dataChanged(DataChangedEvent event) {
-		// refresh the views
-		setChanged();
-		notifyObservers();		
-	}
-
-	public void nodeMoved(NodeMovedEvent event) {
-		// may affect the display name of node in the list of vias
-		if (isAffectedByDataSetUpdate(event.getDataset(), event.getPrimitives())) {
-			setChanged();
-			notifyObservers();
-		}
-	}
-
-	public void otherDatasetChange(AbstractDatasetChangedEvent event) {/* irrelevant in this context */}
-
-	public void primtivesAdded(PrimitivesAddedEvent event) {/* irrelevant in this context */}
-	public void primtivesRemoved(PrimitivesRemovedEvent event) {
-		// relevant for the state of this model but not handled here. When the 
-		// state of this model is applied to the dataset we check whether the 
-		// the turn restriction refers to deleted or invisible primitives 
-	}
-
-	public void relationMembersChanged(RelationMembersChangedEvent event) {/* irrelevant in this context */}
-	public void tagsChanged(TagsChangedEvent event) {
-		// may affect the display name of 'from', 'to' or 'via' elements
-		if (isAffectedByDataSetUpdate(event.getDataset(), event.getPrimitives())) {
-			setChanged();
-			notifyObservers();
-		}
-	}
-
-	public void wayNodesChanged(WayNodesChangedEvent event) {
-		// may affect the display name of 'from', 'to' or 'via' elements
-		if (isAffectedByDataSetUpdate(event.getDataset(), event.getPrimitives())) {
-			setChanged();
-			notifyObservers();
-		}		
-	}	
-	
-	class RelationMemberModelListener implements TableModelListener {
-		public void tableChanged(TableModelEvent e) {
-			setChanged();
-			notifyObservers();
-		}		
-	}
-
-	/* ----------------------------------------------------------------------------------------- */
-	/* inner classes                                                                             */
-	/* ----------------------------------------------------------------------------------------- */	
-	class TagEditorModelObserver implements TableModelListener {
-		public void tableChanged(TableModelEvent e) {
-			setChanged();
-			notifyObservers();
-		}		
-	}
+    static private final Logger logger = Logger.getLogger(TurnRestrictionEditorModel.class.getName());
+    
+    /**
+     * Replies true if {@code tp1} and {@code tp2} have the same tags and
+     * the same members 
+     * 
+     * @param tp1 a turn restriction. Must not be null. 
+     * @param tp2 a turn restriction . Must not be null.
+     * @return true if {@code tp1} and {@code tp2} have the same tags and
+     * the same members
+     * @throws IllegalArgumentException thrown if {@code tp1} is null
+     * @throws IllegalArgumentException thrown if {@code tp2} is null
+     */
+    static public boolean hasSameMembersAndTags(Relation tp1, Relation tp2) throws IllegalArgumentException {
+        CheckParameterUtil.ensureParameterNotNull(tp1, "tp1");
+        CheckParameterUtil.ensureParameterNotNull(tp2, "tp2");
+        if (!TagCollection.from(tp1).asSet().equals(TagCollection.from(tp2).asSet())) return false;
+        if (tp1.getMembersCount() != tp2.getMembersCount()) return false;
+        for(int i=0; i < tp1.getMembersCount();i++){
+            if (!tp1.getMember(i).equals(tp2.getMember(i))) return false;
+        }
+        return true;
+    }
+    
+    private OsmDataLayer layer;
+    private final TagEditorModel tagEditorModel = new TagEditorModel();
+    private  RelationMemberEditorModel memberModel;
+    private  IssuesModel issuesModel;
+    private NavigationControler navigationControler;
+    
+    /**
+     * Creates a model in the context of a {@see OsmDataLayer}
+     * 
+     * @param layer the layer. Must not be null.
+     * @param navigationControler control to direct the user to specific UI components. Must not be null 
+     * @throws IllegalArgumentException thrown if {@code layer} is null
+     */
+    public TurnRestrictionEditorModel(OsmDataLayer layer, NavigationControler navigationControler) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
+        CheckParameterUtil.ensureParameterNotNull(navigationControler, "navigationControler");
+        this.layer = layer;
+        this.navigationControler = navigationControler;
+        memberModel = new RelationMemberEditorModel(layer);
+        memberModel.addTableModelListener(new RelationMemberModelListener());
+        issuesModel = new IssuesModel(this);
+        addObserver(issuesModel);
+        tagEditorModel.addTableModelListener(new TagEditorModelObserver());
+    }
+    
+    /**
+     * Sets the way participating in the turn restriction in a given role.
+     * 
+     * @param role the role. Must not be null.  
+     * @param way the way which participates in the turn restriction in the respective role.
+     * null, to remove the way with the given role.
+     * @exception IllegalArgumentException thrown if role is null
+     */
+    public void setTurnRestrictionLeg(TurnRestrictionLegRole role, Way way) {
+        CheckParameterUtil.ensureParameterNotNull(role, "role");
+        switch(role){
+        case FROM:
+            memberModel.setFromPrimitive(way);
+            break;
+        case TO:
+            memberModel.setToPrimitive(way);
+            break;
+        }
+    }   
+        
+    /**
+     * Sets the way participating in the turn restriction in a given role.
+     * 
+     * @param role the role. Must not be null.  
+     * @param wayId the id of the way to set
+     * @exception IllegalArgumentException thrown if role is null
+     * @exception IllegalArgumentException thrown if wayId != null isn't the id of a way
+     * @exception IllegalStateException thrown the no way with this id was found in the dataset 
+     */
+    public void setTurnRestrictionLeg(TurnRestrictionLegRole role, PrimitiveId wayId) {
+        CheckParameterUtil.ensureParameterNotNull(role, "role");
+        if (wayId == null) {
+            setTurnRestrictionLeg(role, (Way)null);
+            return;
+        }
+        if (!wayId.getType().equals(OsmPrimitiveType.WAY)) {
+            throw new IllegalArgumentException(MessageFormat.format("parameter ''wayId'' of type {0} expected, got {1}", OsmPrimitiveType.WAY, wayId.getType()));
+        }
+
+        OsmPrimitive p = layer.data.getPrimitiveById(wayId);
+        if (p == null) {
+            throw new IllegalStateException(MessageFormat.format("didn''t find way with id {0} in layer ''{1}''", wayId, layer.getName()));         
+        }
+        setTurnRestrictionLeg(role, (Way)p);
+    }   
+    
+    /**
+     * "Officially" a turn restriction should have exactly one member with 
+     * role {@see TurnRestrictionLegRole#FROM} and one member with role {@see TurnRestrictionLegRole#TO},
+     * both referring to an OSM {@see Way}. In order to deals with turn restrictions where these
+     * integrity constraints are violated, this model also supports relation with multiple or no
+     * 'from' or 'to' members.
+     * 
+     * Replies the turn restriction legs with role {@code role}. If no leg with this
+     * role exists, an empty set is returned. If multiple legs exists, the set of referred
+     * primitives is returned.  
+     * 
+     * @param role the role. Must not be null.
+     * @return the set of turn restriction legs with role {@code role}. The empty set, if
+     * no such turn restriction leg exists
+     * @throws IllegalArgumentException thrown if role is null
+     */
+    public Set<OsmPrimitive>getTurnRestrictionLeg(TurnRestrictionLegRole role){
+        CheckParameterUtil.ensureParameterNotNull(role, "role");
+        switch(role){
+        case FROM: return memberModel.getFromPrimitives();
+        case TO: return memberModel.getToPrimitives();
+        }
+        // should not happen
+        return null;
+    }
+    
+    /**
+     * Initializes the model from a relation representing a turn
+     * restriction
+     * 
+     * @param turnRestriction the turn restriction
+     */
+    protected void initFromTurnRestriction(Relation turnRestriction) {
+        
+        // populate the member model
+        memberModel.populate(turnRestriction);
+        
+        // make sure we have a restriction tag
+        TagCollection tags = TagCollection.from(turnRestriction);
+        tags.setUniqueForKey("type", "restriction");
+        tagEditorModel.initFromTags(tags);
+                
+        setChanged();
+        notifyObservers();
+    }
+    
+    /**
+     * Populates the turn restriction editor model with a turn restriction. 
+     * {@code turnRestriction} is an arbitrary relation. A tag type=restriction
+     * isn't required. If it is missing, it is added here. {@code turnRestriction}
+     * must not be null and it must belong to a dataset. 
+     * 
+     * @param turnRestriction the turn restriction
+     * @throws IllegalArgumentException thrown if turnRestriction is null
+     * @throws IllegalArgumentException thrown if turnRestriction doesn't belong to a dataset  
+     */
+    public void populate(Relation turnRestriction) {
+        CheckParameterUtil.ensureParameterNotNull(turnRestriction, "turnRestriction");
+        if (turnRestriction.getDataSet() != null && turnRestriction.getDataSet() != layer.data) {           
+            throw new IllegalArgumentException(
+                // don't translate - it's a technical message
+                MessageFormat.format("turnRestriction {0} must not belong to a different dataset than the dataset of layer ''{1}''", turnRestriction.getId(), layer.getName())
+            );
+        }
+        initFromTurnRestriction(turnRestriction);
+    }
+    
+    
+    /**
+     * Applies the current state in the model to a turn restriction
+     * 
+     * @param turnRestriction the turn restriction. Must not be null.
+     */
+    public void apply(Relation turnRestriction) {
+        CheckParameterUtil.ensureParameterNotNull(turnRestriction, "turnRestriction");      
+        TagCollection tags = tagEditorModel.getTagCollection();
+        turnRestriction.removeAll();
+        tags.applyTo(turnRestriction);
+        memberModel.applyTo(turnRestriction);       
+    }
+    
+    /**
+     * Replies the current tag value for the tag <tt>restriction</tt>.
+     * The empty tag, if there isn't a tag <tt>restriction</tt>.  
+     * 
+     * @return the tag value
+     */
+    public String getRestrictionTagValue() {
+        TagCollection tags = tagEditorModel.getTagCollection();
+        if (!tags.hasTagsFor("restriction")) return "";
+        return tags.getJoinedValues("restriction");
+    }
+    
+    /**
+     * Sets the current value for the restriction tag. If {@code value} is
+     * null or an empty string, the restriction tag is removed. 
+     * 
+     * @param value the value of the restriction tag 
+     */
+    public void setRestrictionTagValue(String value){
+        if (value == null || value.trim().equals("")) {
+            tagEditorModel.delete("restriction");           
+        } else {
+            TagModel  tm = tagEditorModel.get("restriction");
+            if (tm != null){
+                tm.setValue(value);
+            } else {
+                tagEditorModel.prepend(new TagModel("restriction", value.trim().toLowerCase()));
+            }
+        }
+        setChanged();
+        notifyObservers();
+    }
+    
+    /**
+     * Replies the list of 'via' objects. The return value is an
+     * unmodifiable list.
+     *  
+     * @return the list of 'via' objects
+     */
+    public List<OsmPrimitive> getVias() {
+        return memberModel.getVias();
+    }
+    
+    /**
+     * Sets the list of vias for the edited turn restriction.
+     * 
+     * If {@code vias} is null, all vias are removed. All primitives
+     * in {@code vias} must be assigned to a dataset and the dataset
+     * must be equal to the dataset of this editor model, see {@see #getDataSet()}
+     * 
+     * null values in {@see vias} are skipped. 
+     * 
+     * @param vias the list of vias 
+     * @throws IllegalArgumentException thrown if one of the via objects belongs to the wrong dataset 
+     */
+    public void setVias(List<OsmPrimitive> vias) throws IllegalArgumentException{
+        memberModel.setVias(vias);
+    }
+    
+    /**
+     * Replies the layer in whose context this editor is working
+     * 
+     * @return the layer in whose context this editor is working
+     */
+    public OsmDataLayer getLayer() {
+        return layer;
+    }
+    
+    /**
+     * Registers this model with global event sources like {@see DatasetEventManager}
+     */
+    public void registerAsEventListener(){
+        DatasetEventManager.getInstance().addDatasetListener(this, FireMode.IN_EDT);
+    }
+    
+    /**
+     * Removes this model as listener from global event sources like  {@see DatasetEventManager}
+     */
+    public void unregisterAsEventListener() {
+        DatasetEventManager.getInstance().removeDatasetListener(this);
+    }
+    
+    /**
+     * Replies the tag  editor model 
+     * 
+     * @return the tag  editor model
+     */
+    public TagEditorModel getTagEditorModel() {
+        return tagEditorModel;
+    }
+    
+    /**
+     * Replies the editor model for the relation members
+     * 
+     * @return the editor model for the relation members
+     */
+    public RelationMemberEditorModel getRelationMemberEditorModel() {
+        return memberModel;
+    }
+    
+    /**
+     * Replies the model for the open issues in this turn restriction
+     * editor.
+     * 
+     * @return the model for the open issues in this turn restriction
+     * editor
+     */
+    public IssuesModel getIssuesModel() {
+        return issuesModel;
+    }
+    
+    public NavigationControler getNavigationControler() {
+        return navigationControler;
+    }
+    
+    /**
+     * Replies the current value of the tag "except", or the empty string
+     * if the tag doesn't exist.
+     * 
+     * @return
+     */
+    public ExceptValueModel getExcept() {
+        TagModel tag = tagEditorModel.get("except");
+        if (tag == null) return new ExceptValueModel("");
+        return new ExceptValueModel(tag.getValue());
+    }
+    
+    /**
+     * Sets the current value of the tag "except". Removes the
+     * tag is {@code value} is null or consists of white
+     * space only. 
+     * 
+     * @param value the new value for 'except'
+     */
+    public void setExcept(ExceptValueModel value){
+        if (value == null || value.getValue().equals("")) {
+            if (tagEditorModel.get("except") != null){
+                tagEditorModel.delete("except");
+                setChanged();
+                notifyObservers();              
+            }
+            return;         
+        }
+        TagModel tag = tagEditorModel.get("except");
+        if (tag == null) {
+            tagEditorModel.prepend(new TagModel("except", value.getValue()));
+            setChanged();
+            notifyObservers();
+        } else {
+            if (!tag.getValue().equals(value.getValue())) {
+                tag.setValue(value.getValue().trim());
+                setChanged();
+                notifyObservers();
+            }
+        }       
+    }
+
+    /* ----------------------------------------------------------------------------------------- */
+    /* interface DataSetListener                                                                 */
+    /* ----------------------------------------------------------------------------------------- */ 
+    protected boolean isAffectedByDataSetUpdate(DataSet ds, List<? extends OsmPrimitive> updatedPrimitives) {
+        if (ds != layer.data) return false;
+        if (updatedPrimitives == null || updatedPrimitives.isEmpty()) return false;
+        Set<OsmPrimitive> myPrimitives = memberModel.getMemberPrimitives();
+        int size1 = myPrimitives.size();
+        myPrimitives.retainAll(updatedPrimitives);
+        return size1 != myPrimitives.size();
+    }
+    
+    public void dataChanged(DataChangedEvent event) {
+        // refresh the views
+        setChanged();
+        notifyObservers();      
+    }
+
+    public void nodeMoved(NodeMovedEvent event) {
+        // may affect the display name of node in the list of vias
+        if (isAffectedByDataSetUpdate(event.getDataset(), event.getPrimitives())) {
+            setChanged();
+            notifyObservers();
+        }
+    }
+
+    public void otherDatasetChange(AbstractDatasetChangedEvent event) {/* irrelevant in this context */}
+
+    public void primtivesAdded(PrimitivesAddedEvent event) {/* irrelevant in this context */}
+    public void primtivesRemoved(PrimitivesRemovedEvent event) {
+        // relevant for the state of this model but not handled here. When the 
+        // state of this model is applied to the dataset we check whether the 
+        // the turn restriction refers to deleted or invisible primitives 
+    }
+
+    public void relationMembersChanged(RelationMembersChangedEvent event) {/* irrelevant in this context */}
+    public void tagsChanged(TagsChangedEvent event) {
+        // may affect the display name of 'from', 'to' or 'via' elements
+        if (isAffectedByDataSetUpdate(event.getDataset(), event.getPrimitives())) {
+            setChanged();
+            notifyObservers();
+        }
+    }
+
+    public void wayNodesChanged(WayNodesChangedEvent event) {
+        // may affect the display name of 'from', 'to' or 'via' elements
+        if (isAffectedByDataSetUpdate(event.getDataset(), event.getPrimitives())) {
+            setChanged();
+            notifyObservers();
+        }       
+    }   
+    
+    class RelationMemberModelListener implements TableModelListener {
+        public void tableChanged(TableModelEvent e) {
+            setChanged();
+            notifyObservers();
+        }       
+    }
+
+    /* ----------------------------------------------------------------------------------------- */
+    /* inner classes                                                                             */
+    /* ----------------------------------------------------------------------------------------- */ 
+    class TagEditorModelObserver implements TableModelListener {
+        public void tableChanged(TableModelEvent e) {
+            setChanged();
+            notifyObservers();
+        }       
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditor.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditor.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditor.java	(revision 23192)
@@ -55,314 +55,314 @@
  */
 public class TurnRestrictionLegEditor extends JPanel implements Observer, PrimitiveIdListProvider {
-	static private final Logger logger = Logger.getLogger(TurnRestrictionLegEditor.class.getName());
+    static private final Logger logger = Logger.getLogger(TurnRestrictionLegEditor.class.getName());
  
-	private JLabel lblOsmObject;
-	private final Set<OsmPrimitive> legs = new HashSet<OsmPrimitive>();
-	private TurnRestrictionEditorModel model;
-	private TurnRestrictionLegRole role; 
-	private DeleteAction actDelete;
-	private CopyAction actCopy;
-	private PasteAction actPaste;
-	private TransferHandler transferHandler;
-	
-	/**
-	 * builds the UI 
-	 */
-	protected void build() {
-		setLayout(new BorderLayout());
-		add(lblOsmObject = new JLabel(), BorderLayout.CENTER);		
-		lblOsmObject.setOpaque(true);
-		lblOsmObject.setBorder(null);
-		setBorder(
-				BorderFactory.createCompoundBorder(
-						BorderFactory.createEtchedBorder(),
-						BorderFactory.createEmptyBorder(1,1,1,1)
-				)
-		);
-		
-		JButton btn;
-		actDelete = new DeleteAction();
-		add(btn = new JButton(actDelete), BorderLayout.EAST);
-		btn.setFocusable(false);
-		btn.setText(null);
-		btn.setBorder(BorderFactory.createRaisedBevelBorder());
-				
-		// focus handling
-		FocusHandler fh  = new FocusHandler();
-		lblOsmObject.setFocusable(true);	
-		lblOsmObject.addFocusListener(fh);		
-		this.addFocusListener(fh);
-
-		// mouse event handling
-		MouseEventHandler meh = new MouseEventHandler();
-		lblOsmObject.addMouseListener(meh);
-		addMouseListener(meh);
-		lblOsmObject.addMouseListener(new PopupLauncher());
-		
-		// enable DEL to remove the object from the turn restriction
-		registerKeyboardAction(actDelete,KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0) , JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-
-		getInputMap().put(Shortcut.getCopyKeyStroke(), TransferHandler.getCopyAction().getValue(Action.NAME));;
-		getInputMap().put(Shortcut.getPasteKeyStroke(), TransferHandler.getPasteAction().getValue(Action.NAME));;
-		getActionMap().put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction());
-		getActionMap().put(TransferHandler.getPasteAction().getValue(Action.NAME), TransferHandler.getPasteAction());
-		lblOsmObject.setTransferHandler(transferHandler = new LegEditorTransferHandler(this));
-		lblOsmObject.addMouseMotionListener(new MouseMotionAdapter(){
-			@Override
-			public void mouseDragged(MouseEvent e) {
-				JComponent c = (JComponent)e.getSource();
-				TransferHandler th = c.getTransferHandler();
-				th.exportAsDrag(c, e, TransferHandler.COPY);				
-			}					
-		});
-		actCopy = new CopyAction();
-		actPaste = new PasteAction();
-	}
-	
-	/**
-	 * Constructor 
-	 * 
-	 * @param model the model. Must not be null.
-	 * @param role the leg role of the leg this editor is editing. Must not be null.
-	 * @exception IllegalArgumentException thrown if model is null
-	 * @exception IllegalArgumentException thrown if role is null
-	 */
-	public TurnRestrictionLegEditor(TurnRestrictionEditorModel model, TurnRestrictionLegRole role) {
-		CheckParameterUtil.ensureParameterNotNull(model, "model");
-		CheckParameterUtil.ensureParameterNotNull(role, "role");
-		
-		this.model = model;
-		this.role = role;
-		build();
-		model.addObserver(this);
-		refresh();	
-	}
-
-	protected void refresh(){
-		legs.clear();
-		legs.addAll(model.getTurnRestrictionLeg(role));
-		if (legs.isEmpty()) {
-			lblOsmObject.setFont(UIManager.getFont("Label.font").deriveFont(Font.ITALIC));
-			lblOsmObject.setIcon(null);
-			lblOsmObject.setText(tr("please select a way"));
-			lblOsmObject.setToolTipText(null);
-		} else if (legs.size() == 1){
-			OsmPrimitive leg = legs.iterator().next();
-			lblOsmObject.setFont(UIManager.getFont("Label.font"));
-			lblOsmObject.setIcon(ImageProvider.get("data", "way"));
-			lblOsmObject.setText(leg.getDisplayName(DefaultNameFormatter.getInstance()));
-			lblOsmObject.setToolTipText(DefaultNameFormatter.getInstance().buildDefaultToolTip(leg));
-		} else {
-			lblOsmObject.setFont(UIManager.getFont("Label.font").deriveFont(Font.ITALIC));
-			lblOsmObject.setIcon(null);
-			lblOsmObject.setText(tr("multiple objects with role ''{0}''",this.role.getOsmRole()));
-			lblOsmObject.setToolTipText(null);			
-		}
-		renderColors();
-		actDelete.updateEnabledState();
-	}
-	
-	/**
-	 * Render the foreground and background color
-	 */
-	protected void renderColors() {
-		if (lblOsmObject.hasFocus()) {
-			setBackground(UIManager.getColor("List.selectionBackground"));
-			setForeground(UIManager.getColor("List.selectionForeground"));
-			lblOsmObject.setBackground(UIManager.getColor("List.selectionBackground"));
-			lblOsmObject.setForeground(UIManager.getColor("List.selectionForeground"));
-		} else {
-			lblOsmObject.setBackground(UIManager.getColor("List.background"));
-			lblOsmObject.setForeground(UIManager.getColor("List.foreground"));
-		}
-	}
-	
-	/**
-	 * Replies the model for this editor
-	 * 
-	 * @return the model 
-	 */
-	public TurnRestrictionEditorModel getModel() {
-		return model;
-	}
-	
-	/**
-	 * Replies the role of this editor 
-	 * 
-	 * @return the role 
-	 */
-	public TurnRestrictionLegRole getRole() {
-		return role;
-	}		
-	
-	/* ----------------------------------------------------------------------------- */
-	/* interface Observer                                                            */
-	/* ----------------------------------------------------------------------------- */
-	public void update(Observable o, Object arg) {
-		refresh();		
-	}
-	
-	/* ----------------------------------------------------------------------------- */
-	/* interface PrimitiveIdListProvider                                                            */
-	/* ----------------------------------------------------------------------------- */
-	public List<PrimitiveId> getSelectedPrimitiveIds() {
-		if (legs.size() == 1) {
-			return Collections.singletonList(legs.iterator().next().getPrimitiveId());
-		}
-		return Collections.emptyList();
-	}
-	
-	/* ----------------------------------------------------------------------------- */
-	/* inner classes                                                                 */
-	/* ----------------------------------------------------------------------------- */	
-	/**
-	 * Responds to focus change events  
-	 */
-	class FocusHandler extends FocusAdapter {
-		@Override
-		public void focusGained(FocusEvent e) {
-			renderColors();
-		}
-
-		@Override
-		public void focusLost(FocusEvent e) {
-			renderColors();
-		}		
-	}
-	
-	class MouseEventHandler extends MouseAdapter {
-		@Override
-		public void mouseClicked(MouseEvent e) {
-			lblOsmObject.requestFocusInWindow();
-		}		
-	}
-	
-	/**
-	 * Deletes the way from the turn restriction 
-	 */
-	class DeleteAction extends AbstractAction {
-		public DeleteAction() {
-			putValue(SHORT_DESCRIPTION, tr("Delete from turn restriction"));
-			putValue(NAME, tr("Delete"));
-			putValue(SMALL_ICON, ImageProvider.get("deletesmall"));
-			putValue(ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0));
-			updateEnabledState();
-		}
-		
-		public void actionPerformed(ActionEvent e) {
-			model.setTurnRestrictionLeg(role, null);			
-		}		
-		
-		public void updateEnabledState() {
-			setEnabled(legs.size()>0);
-		}
-	}
-	
-	/**
-	 * The transfer handler for Drag-and-Drop. 
-	 */
-	class LegEditorTransferHandler extends PrimitiveIdListTransferHandler {
-		Logger logger = Logger.getLogger(LegEditorTransferHandler.class.getName());
-		
-		public LegEditorTransferHandler(PrimitiveIdListProvider provider){
-			super(provider);
-		}
-
-		@SuppressWarnings("unchecked")
-		@Override
-		public boolean importData(JComponent comp, Transferable t) {
-			try {
-				List<PrimitiveId> ids = (List<PrimitiveId>)t.getTransferData(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR);
-				if (ids.size() !=1) {
-					return false;
-				}
-				PrimitiveId id = ids.get(0);
-				if (!id.getType().equals(OsmPrimitiveType.WAY)) return false;
-				model.setTurnRestrictionLeg(role, id);
-				return true;
-			} catch(IOException e) {
-				// ignore
-				return false;
-			} catch(UnsupportedFlavorException e) {
-				// ignore
-				return false;
-			}
-		}
-
-		@Override
-		protected Transferable createTransferable(JComponent c) {
-			if (legs.size() != 1) return null;
-			return super.createTransferable(c);
-		}
-	}
-	
-	class PopupLauncher extends PopupMenuLauncher {
-		@Override
-		public void launch(MouseEvent evt) {
-			new PopupMenu().show(lblOsmObject, evt.getX(), evt.getY());
-		}		
-	}
-	
-	class PopupMenu extends JPopupMenu {
-		public PopupMenu() {
-			actCopy.updateEnabledState();
-			JMenuItem item = add(actCopy);
-			item.setTransferHandler(transferHandler);
-			actPaste.updateEnabledState();
-			item = add(actPaste);			
-			item.setTransferHandler(transferHandler);
-			addSeparator();
-			add(actDelete);
-		}
-	}
-	
-	class CopyAction extends AbstractAction {
-		private Action delegate;
-		
-		public CopyAction(){
-			putValue(NAME, tr("Copy"));
-			putValue(SHORT_DESCRIPTION, tr("Copy to the clipboard"));
-			putValue(SMALL_ICON, ImageProvider.get("copy"));
-			putValue(ACCELERATOR_KEY, Shortcut.getCopyKeyStroke());
-			delegate = TurnRestrictionLegEditor.this.getActionMap().get("copy");
-			updateEnabledState();
-		}
-
-		public void actionPerformed(ActionEvent e) {
-			delegate.actionPerformed(e);
-		}
-		
-		public void updateEnabledState() {
-			setEnabled(legs.size() == 1);
-		}
-	}
-	
-	class PasteAction extends AbstractAction {
-		private Action delegate;
-		
-		public boolean canPaste() {
-			Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
-			for (DataFlavor df: clipboard.getAvailableDataFlavors()) {
-				if (df.equals(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR)) return true;
-			}			
-			// FIXME: check whether there are selected objects in the JOSM copy/paste buffer  
-			return false;
-		}
-		
-		public PasteAction(){
-			putValue(NAME, tr("Paste"));
-			putValue(SHORT_DESCRIPTION, tr("Paste from the clipboard"));
-			putValue(SMALL_ICON, ImageProvider.get("paste"));
-			putValue(ACCELERATOR_KEY, Shortcut.getPasteKeyStroke());
-			delegate = TurnRestrictionLegEditor.this.getActionMap().get("paste");
-		}
-		
-		public void updateEnabledState() {
-			setEnabled(canPaste());
-		}
-
-		public void actionPerformed(ActionEvent e) {
-			delegate.actionPerformed(e);			
-		}
-	}
+    private JLabel lblOsmObject;
+    private final Set<OsmPrimitive> legs = new HashSet<OsmPrimitive>();
+    private TurnRestrictionEditorModel model;
+    private TurnRestrictionLegRole role; 
+    private DeleteAction actDelete;
+    private CopyAction actCopy;
+    private PasteAction actPaste;
+    private TransferHandler transferHandler;
+    
+    /**
+     * builds the UI 
+     */
+    protected void build() {
+        setLayout(new BorderLayout());
+        add(lblOsmObject = new JLabel(), BorderLayout.CENTER);      
+        lblOsmObject.setOpaque(true);
+        lblOsmObject.setBorder(null);
+        setBorder(
+                BorderFactory.createCompoundBorder(
+                        BorderFactory.createEtchedBorder(),
+                        BorderFactory.createEmptyBorder(1,1,1,1)
+                )
+        );
+        
+        JButton btn;
+        actDelete = new DeleteAction();
+        add(btn = new JButton(actDelete), BorderLayout.EAST);
+        btn.setFocusable(false);
+        btn.setText(null);
+        btn.setBorder(BorderFactory.createRaisedBevelBorder());
+                
+        // focus handling
+        FocusHandler fh  = new FocusHandler();
+        lblOsmObject.setFocusable(true);    
+        lblOsmObject.addFocusListener(fh);      
+        this.addFocusListener(fh);
+
+        // mouse event handling
+        MouseEventHandler meh = new MouseEventHandler();
+        lblOsmObject.addMouseListener(meh);
+        addMouseListener(meh);
+        lblOsmObject.addMouseListener(new PopupLauncher());
+        
+        // enable DEL to remove the object from the turn restriction
+        registerKeyboardAction(actDelete,KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0) , JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+
+        getInputMap().put(Shortcut.getCopyKeyStroke(), TransferHandler.getCopyAction().getValue(Action.NAME));;
+        getInputMap().put(Shortcut.getPasteKeyStroke(), TransferHandler.getPasteAction().getValue(Action.NAME));;
+        getActionMap().put(TransferHandler.getCopyAction().getValue(Action.NAME), TransferHandler.getCopyAction());
+        getActionMap().put(TransferHandler.getPasteAction().getValue(Action.NAME), TransferHandler.getPasteAction());
+        lblOsmObject.setTransferHandler(transferHandler = new LegEditorTransferHandler(this));
+        lblOsmObject.addMouseMotionListener(new MouseMotionAdapter(){
+            @Override
+            public void mouseDragged(MouseEvent e) {
+                JComponent c = (JComponent)e.getSource();
+                TransferHandler th = c.getTransferHandler();
+                th.exportAsDrag(c, e, TransferHandler.COPY);                
+            }                   
+        });
+        actCopy = new CopyAction();
+        actPaste = new PasteAction();
+    }
+    
+    /**
+     * Constructor 
+     * 
+     * @param model the model. Must not be null.
+     * @param role the leg role of the leg this editor is editing. Must not be null.
+     * @exception IllegalArgumentException thrown if model is null
+     * @exception IllegalArgumentException thrown if role is null
+     */
+    public TurnRestrictionLegEditor(TurnRestrictionEditorModel model, TurnRestrictionLegRole role) {
+        CheckParameterUtil.ensureParameterNotNull(model, "model");
+        CheckParameterUtil.ensureParameterNotNull(role, "role");
+        
+        this.model = model;
+        this.role = role;
+        build();
+        model.addObserver(this);
+        refresh();  
+    }
+
+    protected void refresh(){
+        legs.clear();
+        legs.addAll(model.getTurnRestrictionLeg(role));
+        if (legs.isEmpty()) {
+            lblOsmObject.setFont(UIManager.getFont("Label.font").deriveFont(Font.ITALIC));
+            lblOsmObject.setIcon(null);
+            lblOsmObject.setText(tr("please select a way"));
+            lblOsmObject.setToolTipText(null);
+        } else if (legs.size() == 1){
+            OsmPrimitive leg = legs.iterator().next();
+            lblOsmObject.setFont(UIManager.getFont("Label.font"));
+            lblOsmObject.setIcon(ImageProvider.get("data", "way"));
+            lblOsmObject.setText(leg.getDisplayName(DefaultNameFormatter.getInstance()));
+            lblOsmObject.setToolTipText(DefaultNameFormatter.getInstance().buildDefaultToolTip(leg));
+        } else {
+            lblOsmObject.setFont(UIManager.getFont("Label.font").deriveFont(Font.ITALIC));
+            lblOsmObject.setIcon(null);
+            lblOsmObject.setText(tr("multiple objects with role ''{0}''",this.role.getOsmRole()));
+            lblOsmObject.setToolTipText(null);          
+        }
+        renderColors();
+        actDelete.updateEnabledState();
+    }
+    
+    /**
+     * Render the foreground and background color
+     */
+    protected void renderColors() {
+        if (lblOsmObject.hasFocus()) {
+            setBackground(UIManager.getColor("List.selectionBackground"));
+            setForeground(UIManager.getColor("List.selectionForeground"));
+            lblOsmObject.setBackground(UIManager.getColor("List.selectionBackground"));
+            lblOsmObject.setForeground(UIManager.getColor("List.selectionForeground"));
+        } else {
+            lblOsmObject.setBackground(UIManager.getColor("List.background"));
+            lblOsmObject.setForeground(UIManager.getColor("List.foreground"));
+        }
+    }
+    
+    /**
+     * Replies the model for this editor
+     * 
+     * @return the model 
+     */
+    public TurnRestrictionEditorModel getModel() {
+        return model;
+    }
+    
+    /**
+     * Replies the role of this editor 
+     * 
+     * @return the role 
+     */
+    public TurnRestrictionLegRole getRole() {
+        return role;
+    }       
+    
+    /* ----------------------------------------------------------------------------- */
+    /* interface Observer                                                            */
+    /* ----------------------------------------------------------------------------- */
+    public void update(Observable o, Object arg) {
+        refresh();      
+    }
+    
+    /* ----------------------------------------------------------------------------- */
+    /* interface PrimitiveIdListProvider                                                            */
+    /* ----------------------------------------------------------------------------- */
+    public List<PrimitiveId> getSelectedPrimitiveIds() {
+        if (legs.size() == 1) {
+            return Collections.singletonList(legs.iterator().next().getPrimitiveId());
+        }
+        return Collections.emptyList();
+    }
+    
+    /* ----------------------------------------------------------------------------- */
+    /* inner classes                                                                 */
+    /* ----------------------------------------------------------------------------- */ 
+    /**
+     * Responds to focus change events  
+     */
+    class FocusHandler extends FocusAdapter {
+        @Override
+        public void focusGained(FocusEvent e) {
+            renderColors();
+        }
+
+        @Override
+        public void focusLost(FocusEvent e) {
+            renderColors();
+        }       
+    }
+    
+    class MouseEventHandler extends MouseAdapter {
+        @Override
+        public void mouseClicked(MouseEvent e) {
+            lblOsmObject.requestFocusInWindow();
+        }       
+    }
+    
+    /**
+     * Deletes the way from the turn restriction 
+     */
+    class DeleteAction extends AbstractAction {
+        public DeleteAction() {
+            putValue(SHORT_DESCRIPTION, tr("Delete from turn restriction"));
+            putValue(NAME, tr("Delete"));
+            putValue(SMALL_ICON, ImageProvider.get("deletesmall"));
+            putValue(ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0));
+            updateEnabledState();
+        }
+        
+        public void actionPerformed(ActionEvent e) {
+            model.setTurnRestrictionLeg(role, null);            
+        }       
+        
+        public void updateEnabledState() {
+            setEnabled(legs.size()>0);
+        }
+    }
+    
+    /**
+     * The transfer handler for Drag-and-Drop. 
+     */
+    class LegEditorTransferHandler extends PrimitiveIdListTransferHandler {
+        Logger logger = Logger.getLogger(LegEditorTransferHandler.class.getName());
+        
+        public LegEditorTransferHandler(PrimitiveIdListProvider provider){
+            super(provider);
+        }
+
+        @SuppressWarnings("unchecked")
+        @Override
+        public boolean importData(JComponent comp, Transferable t) {
+            try {
+                List<PrimitiveId> ids = (List<PrimitiveId>)t.getTransferData(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR);
+                if (ids.size() !=1) {
+                    return false;
+                }
+                PrimitiveId id = ids.get(0);
+                if (!id.getType().equals(OsmPrimitiveType.WAY)) return false;
+                model.setTurnRestrictionLeg(role, id);
+                return true;
+            } catch(IOException e) {
+                // ignore
+                return false;
+            } catch(UnsupportedFlavorException e) {
+                // ignore
+                return false;
+            }
+        }
+
+        @Override
+        protected Transferable createTransferable(JComponent c) {
+            if (legs.size() != 1) return null;
+            return super.createTransferable(c);
+        }
+    }
+    
+    class PopupLauncher extends PopupMenuLauncher {
+        @Override
+        public void launch(MouseEvent evt) {
+            new PopupMenu().show(lblOsmObject, evt.getX(), evt.getY());
+        }       
+    }
+    
+    class PopupMenu extends JPopupMenu {
+        public PopupMenu() {
+            actCopy.updateEnabledState();
+            JMenuItem item = add(actCopy);
+            item.setTransferHandler(transferHandler);
+            actPaste.updateEnabledState();
+            item = add(actPaste);           
+            item.setTransferHandler(transferHandler);
+            addSeparator();
+            add(actDelete);
+        }
+    }
+    
+    class CopyAction extends AbstractAction {
+        private Action delegate;
+        
+        public CopyAction(){
+            putValue(NAME, tr("Copy"));
+            putValue(SHORT_DESCRIPTION, tr("Copy to the clipboard"));
+            putValue(SMALL_ICON, ImageProvider.get("copy"));
+            putValue(ACCELERATOR_KEY, Shortcut.getCopyKeyStroke());
+            delegate = TurnRestrictionLegEditor.this.getActionMap().get("copy");
+            updateEnabledState();
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            delegate.actionPerformed(e);
+        }
+        
+        public void updateEnabledState() {
+            setEnabled(legs.size() == 1);
+        }
+    }
+    
+    class PasteAction extends AbstractAction {
+        private Action delegate;
+        
+        public boolean canPaste() {
+            Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+            for (DataFlavor df: clipboard.getAvailableDataFlavors()) {
+                if (df.equals(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR)) return true;
+            }           
+            // FIXME: check whether there are selected objects in the JOSM copy/paste buffer  
+            return false;
+        }
+        
+        public PasteAction(){
+            putValue(NAME, tr("Paste"));
+            putValue(SHORT_DESCRIPTION, tr("Paste from the clipboard"));
+            putValue(SMALL_ICON, ImageProvider.get("paste"));
+            putValue(ACCELERATOR_KEY, Shortcut.getPasteKeyStroke());
+            delegate = TurnRestrictionLegEditor.this.getActionMap().get("paste");
+        }
+        
+        public void updateEnabledState() {
+            setEnabled(canPaste());
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            delegate.actionPerformed(e);            
+        }
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegRole.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegRole.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegRole.java	(revision 23192)
@@ -4,16 +4,16 @@
  * Enumerates the two roles a "leg" in a turn restriction can have.
  */
-public enum TurnRestrictionLegRole {	
-	FROM("from"),
-	TO("to");
-	
-	private String osmRoleName;
-	
-	private TurnRestrictionLegRole(String osmRoleName) {
-		this.osmRoleName = osmRoleName;
-	}
-	
-	public String getOsmRole() {
-		return osmRoleName;
-	}
+public enum TurnRestrictionLegRole {    
+    FROM("from"),
+    TO("to");
+    
+    private String osmRoleName;
+    
+    private TurnRestrictionLegRole(String osmRoleName) {
+        this.osmRoleName = osmRoleName;
+    }
+    
+    public String getOsmRole() {
+        return osmRoleName;
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionSelectionPopupPanel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionSelectionPopupPanel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionSelectionPopupPanel.java	(revision 23192)
@@ -50,315 +50,315 @@
  */
 public class TurnRestrictionSelectionPopupPanel extends JPanel{
-	static private final Logger logger = Logger.getLogger(TurnRestrictionSelectionPopupPanel.class.getName());
-
-	/** the parent popup */
-	private Popup parentPopup;
-	/** the button for creating a new turn restriction */
-	private JButton btnNew;
-	/** the table with the turn restrictions which can be edited */
-	private JTable tblTurnRestrictions;	
-	private OsmDataLayer layer;
-	
-	
-	
-	/**
-	 * Replies the collection of turn restrictions the primitives in {@code primitives}
-	 * currently participate in.
-	 * 
-	 * @param primitives the collection of primitives. May be null.
-	 * @return the collection of "parent" turn restrictions. 
-	 */
-	static public Collection<Relation> getTurnRestrictionsParticipatingIn(Collection<OsmPrimitive> primitives){
-		HashSet<Relation> ret = new HashSet<Relation>();
-		if (primitives == null) return ret;
-		for (OsmPrimitive p: primitives){
-			if (p == null) continue;
-			if (p.isDeleted() || !p.isVisible()) continue;
-			for (OsmPrimitive parent: p.getReferrers()){
-				if (!(parent instanceof Relation)) continue;
-				String type = parent.get("type");
-				if (type == null || ! type.equals("restriction")) continue;
-				if (parent.isDeleted() || ! parent.isVisible()) continue;
-				ret.add((Relation)parent);
-			}
-		}
-		return ret;
-	}
-	
-	/**
-	 * Registers 1..9 shortcuts for the first 9 turn restrictions to
-	 * edit
-	 * 
-	 * @param editCandiates the edit candidates 
-	 */
-	protected void registerEditShortcuts(Collection<Relation> editCandiates){
-		for(int i=1; i <= Math.min(editCandiates.size(),9);i++){
-			int vkey = 0;
-			switch(i){
-			case 1: vkey = KeyEvent.VK_1; break;
-			case 2: vkey = KeyEvent.VK_2; break;
-			case 3: vkey = KeyEvent.VK_3; break;
-			case 4: vkey = KeyEvent.VK_4; break;
-			case 5: vkey = KeyEvent.VK_5; break;
-			case 6: vkey = KeyEvent.VK_6; break;
-			case 7: vkey = KeyEvent.VK_7; break;
-			case 8: vkey = KeyEvent.VK_8; break;
-			case 9: vkey = KeyEvent.VK_9; break;
-			}
-			registerKeyboardAction(new EditTurnRestrictionAction(i-1), KeyStroke.getKeyStroke(vkey,0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-		}
-	}
-	/**
-	 * Builds the panel with the turn restrictions table 
-	 * 
-	 * @param editCandiates the list of edit candiates  
-	 * @return the panel 
-	 */
-	protected JPanel buildTurnRestrictionTablePanel(Collection<Relation> editCandiates) {
-		tblTurnRestrictions = new JTable(new TurnRestrictionTableModel(editCandiates), new TurnRestrictionTableColumnModel());
-		tblTurnRestrictions.setColumnSelectionAllowed(false);
-		tblTurnRestrictions.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
-		TurnRestrictionCellRenderer renderer = new TurnRestrictionCellRenderer();
-		tblTurnRestrictions.setRowHeight((int)renderer.getPreferredSize().getHeight());
-		
-		// create a scroll pane, remove the table header 
-		JScrollPane pane = new JScrollPane(tblTurnRestrictions);
-		pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
-		pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
-		tblTurnRestrictions.setTableHeader(null);
-		pane.setColumnHeaderView(null);
-		
-		// respond to double click and ENTER 
-		EditSelectedTurnRestrictionAction action = new EditSelectedTurnRestrictionAction();
-		tblTurnRestrictions.addMouseListener(action);
-		tblTurnRestrictions.registerKeyboardAction(action, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), WHEN_FOCUSED);
-		
-		tblTurnRestrictions.addFocusListener(new FocusHandler());
-		
-		JPanel pnl = new JPanel(new BorderLayout());
-		pnl.add(pane, BorderLayout.CENTER);
-		
-		pnl.setBackground(UIManager.getColor("Table.background"));
-		pane.setBackground(UIManager.getColor("Table.background"));
-		return pnl;		
-	}
-	
-	/**
-	 * Builds the panel 
-	 * 
-	 * @param editCandiates the edit candidates
-	 */
-	protected void build(Collection<Relation> editCandiates) {
-		setLayout(new BorderLayout());
-		add(btnNew = new JButton(new NewAction()), BorderLayout.NORTH);
-		btnNew.setFocusable(true);
-		btnNew.registerKeyboardAction(btnNew.getAction(), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), WHEN_FOCUSED);
-		registerKeyboardAction(new CloseAction(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-		registerKeyboardAction(btnNew.getAction(), KeyStroke.getKeyStroke(KeyEvent.VK_N,0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-		
-		btnNew.addFocusListener(new FocusHandler());
-		
-		if (editCandiates != null && ! editCandiates.isEmpty()) {
-			add(buildTurnRestrictionTablePanel(editCandiates), BorderLayout.CENTER);	
-			registerEditShortcuts(editCandiates);
-		}
-		
-		setBackground(UIManager.getColor("Table.background"));		
-	}
-
-	
-	/**
-	 * Creates the panel
-	 * 
-	 * @param layer the reference OSM data layer. Must not be null.
-	 * @throws IllegalArgumentException thrown if {@code layer} is null
-	 */
-	public TurnRestrictionSelectionPopupPanel(OsmDataLayer layer) throws IllegalArgumentException {
-		CheckParameterUtil.ensureParameterNotNull(layer, "layer");
-		this.layer = layer;
-		build(getTurnRestrictionsParticipatingIn(layer.data.getSelected()));
-	}
-	
-	/**
-	 * Creates the panel
-	 * 
-	 * @param layer the reference OSM data layer. Must not be null.
-	 * @param editCandidates a collection of turn restrictions as edit candidates. May be null. 
-	 * @throws IllegalArgumentException thrown if {@code layer} is null
-	 */
-	public TurnRestrictionSelectionPopupPanel(OsmDataLayer layer, Collection<Relation> editCandiates) {
-		CheckParameterUtil.ensureParameterNotNull(layer, "layer");
-		this.layer = layer;
-		build(editCandiates);
-	}
-	
-	/**
-	 * Launches a popup with this panel as content 
-	 */
-	public void launch(){
-		PointerInfo info = MouseInfo.getPointerInfo();
-		Point pt = info.getLocation();
-		parentPopup = PopupFactory.getSharedInstance().getPopup(Main.map.mapView,this, pt.x, pt.y);
-		parentPopup.show();
-		btnNew.requestFocusInWindow();
-	}
-
-	@Override
-	public Dimension getPreferredSize() {
-		int bestheight = (int)btnNew.getPreferredSize().getHeight()
-		      + Math.min(2, tblTurnRestrictions.getRowCount()) * tblTurnRestrictions.getRowHeight()
-		      + 5;
-		return new Dimension(300, bestheight);
-	}
-	
-	/* --------------------------------------------------------------------------------------- */
-	/* inner classes                                                                           */
-	/* --------------------------------------------------------------------------------------- */
-	
-	private class NewAction extends AbstractAction {
-		public NewAction() {
-			putValue(NAME, tr("Create new turn restriction"));
-			putValue(SHORT_DESCRIPTION, tr("Launch the turn restriction editor to create a new turn restriction"));
-			putValue(SMALL_ICON, ImageProvider.get("new"));
-			putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_N, 0));
-		}
-
-		public void actionPerformed(ActionEvent e) {
-			Relation tr = new TurnRestrictionBuilder().buildFromSelection(layer);
-			TurnRestrictionEditor editor = new TurnRestrictionEditor(Main.map.mapView,layer,tr);
-			TurnRestrictionEditorManager.getInstance().positionOnScreen(editor);
-			TurnRestrictionEditorManager.getInstance().register(layer, tr, editor);
-			if (parentPopup != null){
-				parentPopup.hide();
-			}
-			editor.setVisible(true);
-		}
-	}
-	
-	abstract private  class AbstractEditTurnRestrictionAction extends AbstractAction {
-		protected void launchEditor(Relation tr){
-			TurnRestrictionEditorManager manager = TurnRestrictionEditorManager.getInstance();
-			TurnRestrictionEditor editor = manager.getEditorForRelation(layer, tr);
-			if (parentPopup != null){
-				parentPopup.hide();
-			}
-			if (editor != null) {
-				editor.setVisible(true);
-				editor.toFront();
-			} else {
-				editor = new TurnRestrictionEditor(Main.map.mapView, layer,tr);
-				manager.positionOnScreen(editor);
-				manager.register(layer, tr,editor);
-				editor.setVisible(true);
-			}
-		}
-	}
-	
-	private class EditTurnRestrictionAction extends AbstractEditTurnRestrictionAction {
-		private int idx;
-		
-		public EditTurnRestrictionAction(int idx){
-			this.idx = idx;
-		}
-		
-		public void actionPerformed(ActionEvent e) {
-			Relation tr = (Relation)tblTurnRestrictions.getModel().getValueAt(idx, 1);
-			launchEditor(tr);
-		}		
-	}
-	
-	private class EditSelectedTurnRestrictionAction extends AbstractEditTurnRestrictionAction implements MouseListener{
-		public void editTurnRestrictionAtRow(int row){
-			if (row < 0) return;
-			Relation tr = (Relation)tblTurnRestrictions.getModel().getValueAt(row, 1);
-			launchEditor(tr);
-		}
-		public void actionPerformed(ActionEvent e) {
-			int row = tblTurnRestrictions.getSelectedRow();
-			editTurnRestrictionAtRow(row);
-		}
-		public void mouseClicked(MouseEvent e) {
-			if (!(SwingUtilities.isLeftMouseButton(e) && e.getClickCount() >= 2)) return;
-			int row = tblTurnRestrictions.rowAtPoint(e.getPoint());
-			if (row < 0) return;
-			editTurnRestrictionAtRow(row);			
-		}
-		public void mouseEntered(MouseEvent e) {}
-		public void mouseExited(MouseEvent e) {}
-		public void mousePressed(MouseEvent e) {}
-		public void mouseReleased(MouseEvent e) {}
-	}
-	
-	private class CloseAction extends AbstractAction {
-		public void actionPerformed(ActionEvent e) {
-			if (parentPopup != null){
-				parentPopup.hide();
-			}
-		}		
-	}
-	
-	private static class TurnRestrictionTableModel extends AbstractTableModel {
-		private final ArrayList<Relation> turnrestrictions = new ArrayList<Relation>();
-
-		public TurnRestrictionTableModel(Collection<Relation> turnrestrictions){
-			this.turnrestrictions.clear();
-			if (turnrestrictions != null){
-				this.turnrestrictions.addAll(turnrestrictions);
-			}
-			fireTableDataChanged();
-		}
-		
-		public int getRowCount() {
-			return turnrestrictions.size();
-		}
-
-		public int getColumnCount() {
-			return 2;
-		}
-
-		public Object getValueAt(int rowIndex, int columnIndex) {
-			switch(columnIndex){
-			case 0:
-				if (rowIndex <=8 ) {
-					return Integer.toString(rowIndex+1);
-				} else {
-					return "";
-				}
-			case 1:
-				return turnrestrictions.get(rowIndex);
-			}
-			// should not happen
-			return null;
-		}
-	}
-	
-	private static class TurnRestrictionTableColumnModel extends DefaultTableColumnModel {		
-		public TurnRestrictionTableColumnModel() {			
-			// the idx column
-			TableColumn col = new TableColumn(0);			
-			col.setResizable(false);
-			col.setWidth(50);
-			addColumn(col);
-			
-			// the column displaying turn restrictions 
-			col = new TableColumn(1);			
-			col.setResizable(false);
-			col.setPreferredWidth(400);
-			col.setCellRenderer(new TurnRestrictionCellRenderer());
-			addColumn(col);			
-		}
-	}
-	
-	private class FocusHandler extends FocusAdapter {		
-		@Override
-		public void focusLost(FocusEvent e) {
-			// if we loose the focus to a component outside of the popup panel
-			// we hide the popup			
-			if (e.getOppositeComponent() == null ||!SwingUtilities.isDescendingFrom(e.getOppositeComponent(), TurnRestrictionSelectionPopupPanel.this)) {
-				if (parentPopup != null){
-					parentPopup.hide();
-				}
-			}
-		}
-	}
+    static private final Logger logger = Logger.getLogger(TurnRestrictionSelectionPopupPanel.class.getName());
+
+    /** the parent popup */
+    private Popup parentPopup;
+    /** the button for creating a new turn restriction */
+    private JButton btnNew;
+    /** the table with the turn restrictions which can be edited */
+    private JTable tblTurnRestrictions; 
+    private OsmDataLayer layer;
+    
+    
+    
+    /**
+     * Replies the collection of turn restrictions the primitives in {@code primitives}
+     * currently participate in.
+     * 
+     * @param primitives the collection of primitives. May be null.
+     * @return the collection of "parent" turn restrictions. 
+     */
+    static public Collection<Relation> getTurnRestrictionsParticipatingIn(Collection<OsmPrimitive> primitives){
+        HashSet<Relation> ret = new HashSet<Relation>();
+        if (primitives == null) return ret;
+        for (OsmPrimitive p: primitives){
+            if (p == null) continue;
+            if (p.isDeleted() || !p.isVisible()) continue;
+            for (OsmPrimitive parent: p.getReferrers()){
+                if (!(parent instanceof Relation)) continue;
+                String type = parent.get("type");
+                if (type == null || ! type.equals("restriction")) continue;
+                if (parent.isDeleted() || ! parent.isVisible()) continue;
+                ret.add((Relation)parent);
+            }
+        }
+        return ret;
+    }
+    
+    /**
+     * Registers 1..9 shortcuts for the first 9 turn restrictions to
+     * edit
+     * 
+     * @param editCandiates the edit candidates 
+     */
+    protected void registerEditShortcuts(Collection<Relation> editCandiates){
+        for(int i=1; i <= Math.min(editCandiates.size(),9);i++){
+            int vkey = 0;
+            switch(i){
+            case 1: vkey = KeyEvent.VK_1; break;
+            case 2: vkey = KeyEvent.VK_2; break;
+            case 3: vkey = KeyEvent.VK_3; break;
+            case 4: vkey = KeyEvent.VK_4; break;
+            case 5: vkey = KeyEvent.VK_5; break;
+            case 6: vkey = KeyEvent.VK_6; break;
+            case 7: vkey = KeyEvent.VK_7; break;
+            case 8: vkey = KeyEvent.VK_8; break;
+            case 9: vkey = KeyEvent.VK_9; break;
+            }
+            registerKeyboardAction(new EditTurnRestrictionAction(i-1), KeyStroke.getKeyStroke(vkey,0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        }
+    }
+    /**
+     * Builds the panel with the turn restrictions table 
+     * 
+     * @param editCandiates the list of edit candiates  
+     * @return the panel 
+     */
+    protected JPanel buildTurnRestrictionTablePanel(Collection<Relation> editCandiates) {
+        tblTurnRestrictions = new JTable(new TurnRestrictionTableModel(editCandiates), new TurnRestrictionTableColumnModel());
+        tblTurnRestrictions.setColumnSelectionAllowed(false);
+        tblTurnRestrictions.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
+        TurnRestrictionCellRenderer renderer = new TurnRestrictionCellRenderer();
+        tblTurnRestrictions.setRowHeight((int)renderer.getPreferredSize().getHeight());
+        
+        // create a scroll pane, remove the table header 
+        JScrollPane pane = new JScrollPane(tblTurnRestrictions);
+        pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+        pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
+        tblTurnRestrictions.setTableHeader(null);
+        pane.setColumnHeaderView(null);
+        
+        // respond to double click and ENTER 
+        EditSelectedTurnRestrictionAction action = new EditSelectedTurnRestrictionAction();
+        tblTurnRestrictions.addMouseListener(action);
+        tblTurnRestrictions.registerKeyboardAction(action, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), WHEN_FOCUSED);
+        
+        tblTurnRestrictions.addFocusListener(new FocusHandler());
+        
+        JPanel pnl = new JPanel(new BorderLayout());
+        pnl.add(pane, BorderLayout.CENTER);
+        
+        pnl.setBackground(UIManager.getColor("Table.background"));
+        pane.setBackground(UIManager.getColor("Table.background"));
+        return pnl;     
+    }
+    
+    /**
+     * Builds the panel 
+     * 
+     * @param editCandiates the edit candidates
+     */
+    protected void build(Collection<Relation> editCandiates) {
+        setLayout(new BorderLayout());
+        add(btnNew = new JButton(new NewAction()), BorderLayout.NORTH);
+        btnNew.setFocusable(true);
+        btnNew.registerKeyboardAction(btnNew.getAction(), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0), WHEN_FOCUSED);
+        registerKeyboardAction(new CloseAction(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        registerKeyboardAction(btnNew.getAction(), KeyStroke.getKeyStroke(KeyEvent.VK_N,0), WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        
+        btnNew.addFocusListener(new FocusHandler());
+        
+        if (editCandiates != null && ! editCandiates.isEmpty()) {
+            add(buildTurnRestrictionTablePanel(editCandiates), BorderLayout.CENTER);    
+            registerEditShortcuts(editCandiates);
+        }
+        
+        setBackground(UIManager.getColor("Table.background"));      
+    }
+
+    
+    /**
+     * Creates the panel
+     * 
+     * @param layer the reference OSM data layer. Must not be null.
+     * @throws IllegalArgumentException thrown if {@code layer} is null
+     */
+    public TurnRestrictionSelectionPopupPanel(OsmDataLayer layer) throws IllegalArgumentException {
+        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
+        this.layer = layer;
+        build(getTurnRestrictionsParticipatingIn(layer.data.getSelected()));
+    }
+    
+    /**
+     * Creates the panel
+     * 
+     * @param layer the reference OSM data layer. Must not be null.
+     * @param editCandidates a collection of turn restrictions as edit candidates. May be null. 
+     * @throws IllegalArgumentException thrown if {@code layer} is null
+     */
+    public TurnRestrictionSelectionPopupPanel(OsmDataLayer layer, Collection<Relation> editCandiates) {
+        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
+        this.layer = layer;
+        build(editCandiates);
+    }
+    
+    /**
+     * Launches a popup with this panel as content 
+     */
+    public void launch(){
+        PointerInfo info = MouseInfo.getPointerInfo();
+        Point pt = info.getLocation();
+        parentPopup = PopupFactory.getSharedInstance().getPopup(Main.map.mapView,this, pt.x, pt.y);
+        parentPopup.show();
+        btnNew.requestFocusInWindow();
+    }
+
+    @Override
+    public Dimension getPreferredSize() {
+        int bestheight = (int)btnNew.getPreferredSize().getHeight()
+              + Math.min(2, tblTurnRestrictions.getRowCount()) * tblTurnRestrictions.getRowHeight()
+              + 5;
+        return new Dimension(300, bestheight);
+    }
+    
+    /* --------------------------------------------------------------------------------------- */
+    /* inner classes                                                                           */
+    /* --------------------------------------------------------------------------------------- */
+    
+    private class NewAction extends AbstractAction {
+        public NewAction() {
+            putValue(NAME, tr("Create new turn restriction"));
+            putValue(SHORT_DESCRIPTION, tr("Launch the turn restriction editor to create a new turn restriction"));
+            putValue(SMALL_ICON, ImageProvider.get("new"));
+            putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_N, 0));
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            Relation tr = new TurnRestrictionBuilder().buildFromSelection(layer);
+            TurnRestrictionEditor editor = new TurnRestrictionEditor(Main.map.mapView,layer,tr);
+            TurnRestrictionEditorManager.getInstance().positionOnScreen(editor);
+            TurnRestrictionEditorManager.getInstance().register(layer, tr, editor);
+            if (parentPopup != null){
+                parentPopup.hide();
+            }
+            editor.setVisible(true);
+        }
+    }
+    
+    abstract private  class AbstractEditTurnRestrictionAction extends AbstractAction {
+        protected void launchEditor(Relation tr){
+            TurnRestrictionEditorManager manager = TurnRestrictionEditorManager.getInstance();
+            TurnRestrictionEditor editor = manager.getEditorForRelation(layer, tr);
+            if (parentPopup != null){
+                parentPopup.hide();
+            }
+            if (editor != null) {
+                editor.setVisible(true);
+                editor.toFront();
+            } else {
+                editor = new TurnRestrictionEditor(Main.map.mapView, layer,tr);
+                manager.positionOnScreen(editor);
+                manager.register(layer, tr,editor);
+                editor.setVisible(true);
+            }
+        }
+    }
+    
+    private class EditTurnRestrictionAction extends AbstractEditTurnRestrictionAction {
+        private int idx;
+        
+        public EditTurnRestrictionAction(int idx){
+            this.idx = idx;
+        }
+        
+        public void actionPerformed(ActionEvent e) {
+            Relation tr = (Relation)tblTurnRestrictions.getModel().getValueAt(idx, 1);
+            launchEditor(tr);
+        }       
+    }
+    
+    private class EditSelectedTurnRestrictionAction extends AbstractEditTurnRestrictionAction implements MouseListener{
+        public void editTurnRestrictionAtRow(int row){
+            if (row < 0) return;
+            Relation tr = (Relation)tblTurnRestrictions.getModel().getValueAt(row, 1);
+            launchEditor(tr);
+        }
+        public void actionPerformed(ActionEvent e) {
+            int row = tblTurnRestrictions.getSelectedRow();
+            editTurnRestrictionAtRow(row);
+        }
+        public void mouseClicked(MouseEvent e) {
+            if (!(SwingUtilities.isLeftMouseButton(e) && e.getClickCount() >= 2)) return;
+            int row = tblTurnRestrictions.rowAtPoint(e.getPoint());
+            if (row < 0) return;
+            editTurnRestrictionAtRow(row);          
+        }
+        public void mouseEntered(MouseEvent e) {}
+        public void mouseExited(MouseEvent e) {}
+        public void mousePressed(MouseEvent e) {}
+        public void mouseReleased(MouseEvent e) {}
+    }
+    
+    private class CloseAction extends AbstractAction {
+        public void actionPerformed(ActionEvent e) {
+            if (parentPopup != null){
+                parentPopup.hide();
+            }
+        }       
+    }
+    
+    private static class TurnRestrictionTableModel extends AbstractTableModel {
+        private final ArrayList<Relation> turnrestrictions = new ArrayList<Relation>();
+
+        public TurnRestrictionTableModel(Collection<Relation> turnrestrictions){
+            this.turnrestrictions.clear();
+            if (turnrestrictions != null){
+                this.turnrestrictions.addAll(turnrestrictions);
+            }
+            fireTableDataChanged();
+        }
+        
+        public int getRowCount() {
+            return turnrestrictions.size();
+        }
+
+        public int getColumnCount() {
+            return 2;
+        }
+
+        public Object getValueAt(int rowIndex, int columnIndex) {
+            switch(columnIndex){
+            case 0:
+                if (rowIndex <=8 ) {
+                    return Integer.toString(rowIndex+1);
+                } else {
+                    return "";
+                }
+            case 1:
+                return turnrestrictions.get(rowIndex);
+            }
+            // should not happen
+            return null;
+        }
+    }
+    
+    private static class TurnRestrictionTableColumnModel extends DefaultTableColumnModel {      
+        public TurnRestrictionTableColumnModel() {          
+            // the idx column
+            TableColumn col = new TableColumn(0);           
+            col.setResizable(false);
+            col.setWidth(50);
+            addColumn(col);
+            
+            // the column displaying turn restrictions 
+            col = new TableColumn(1);           
+            col.setResizable(false);
+            col.setPreferredWidth(400);
+            col.setCellRenderer(new TurnRestrictionCellRenderer());
+            addColumn(col);         
+        }
+    }
+    
+    private class FocusHandler extends FocusAdapter {       
+        @Override
+        public void focusLost(FocusEvent e) {
+            // if we loose the focus to a component outside of the popup panel
+            // we hide the popup            
+            if (e.getOppositeComponent() == null ||!SwingUtilities.isDescendingFrom(e.getOppositeComponent(), TurnRestrictionSelectionPopupPanel.this)) {
+                if (parentPopup != null){
+                    parentPopup.hide();
+                }
+            }
+        }
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionType.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionType.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionType.java	(revision 23192)
@@ -9,60 +9,60 @@
  */
 public enum TurnRestrictionType {
-	NO_RIGHT_TURN("no_right_turn", tr("No Right Turn")),
-	NO_LEFT_TURN("no_left_turn", tr("No Left Turn")),
-	NO_U_TURN("no_u_turn", tr("No U-Turn")),
-	NO_STRAIGHT_ON("no_straight_on", tr("No Straight On")),	
-	ONLY_RIGHT_TURN("only_right_turn", tr("Only Right Turn")),
-	ONLY_LEFT_TURN("only_left_turn", tr("Only Left Turn")),
-	ONLY_STRAIGHT_ON("only_straight_on", tr("Only Straight On"));
-	
-	private String tagValue;
-	private String displayName;
-	
-	TurnRestrictionType(String tagValue, String displayName) {
-		this.tagValue = tagValue;
-		this.displayName = displayName;
-	}
-	
-	/**
-	 * Replies the tag value for a specific turn restriction type
-	 * 
-	 * @return the tag value for a specific turn restriction type
-	 */
-	public String getTagValue() {
-		return tagValue;
-	}
-	
-	/**
-	 * Replies the localized display name for a turn restriction type
-	 */
-	public String getDisplayName() {
-		return displayName;
-	}	
-	
-	/**
-	 * Replies the enumeration value for a given tag value. null,
-	 * if {@code tagValue} is null or if there isnt an enumeration value
-	 * for this {@code tagValue}
-	 *  
-	 * @param tagValue the tag value, i.e. <tt>no_left_turn</tt>
-	 * @return the enumeration value
-	 */
-	static public TurnRestrictionType fromTagValue(String tagValue) {
-		if (tagValue == null) return null;
-		for(TurnRestrictionType type: values()) {
-			if(type.getTagValue().equals(tagValue)) return type;
-		}
-		return null;
-	}
+    NO_RIGHT_TURN("no_right_turn", tr("No Right Turn")),
+    NO_LEFT_TURN("no_left_turn", tr("No Left Turn")),
+    NO_U_TURN("no_u_turn", tr("No U-Turn")),
+    NO_STRAIGHT_ON("no_straight_on", tr("No Straight On")), 
+    ONLY_RIGHT_TURN("only_right_turn", tr("Only Right Turn")),
+    ONLY_LEFT_TURN("only_left_turn", tr("Only Left Turn")),
+    ONLY_STRAIGHT_ON("only_straight_on", tr("Only Straight On"));
+    
+    private String tagValue;
+    private String displayName;
+    
+    TurnRestrictionType(String tagValue, String displayName) {
+        this.tagValue = tagValue;
+        this.displayName = displayName;
+    }
+    
+    /**
+     * Replies the tag value for a specific turn restriction type
+     * 
+     * @return the tag value for a specific turn restriction type
+     */
+    public String getTagValue() {
+        return tagValue;
+    }
+    
+    /**
+     * Replies the localized display name for a turn restriction type
+     */
+    public String getDisplayName() {
+        return displayName;
+    }   
+    
+    /**
+     * Replies the enumeration value for a given tag value. null,
+     * if {@code tagValue} is null or if there isnt an enumeration value
+     * for this {@code tagValue}
+     *  
+     * @param tagValue the tag value, i.e. <tt>no_left_turn</tt>
+     * @return the enumeration value
+     */
+    static public TurnRestrictionType fromTagValue(String tagValue) {
+        if (tagValue == null) return null;
+        for(TurnRestrictionType type: values()) {
+            if(type.getTagValue().equals(tagValue)) return type;
+        }
+        return null;
+    }
 
-	/**
-	 * Replies true if {@code tagValue} is a standard restriction type. 
-	 * 
-	 * @param tagValue the tag value 
-	 * @return true if {@code tagValue} is a standard restriction type
-	 */
-	static public boolean isStandardTagValue(String tagValue){
-		return fromTagValue(tagValue) != null;
-	}
+    /**
+     * Replies true if {@code tagValue} is a standard restriction type. 
+     * 
+     * @param tagValue the tag value 
+     * @return true if {@code tagValue} is a standard restriction type
+     */
+    static public boolean isStandardTagValue(String tagValue){
+        return fromTagValue(tagValue) != null;
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRenderer.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRenderer.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionTypeRenderer.java	(revision 23192)
@@ -20,68 +20,68 @@
 public class TurnRestrictionTypeRenderer extends JLabel implements ListCellRenderer{
  
-	final private Map<TurnRestrictionType, ImageIcon> icons = new HashMap<TurnRestrictionType, ImageIcon>();
-	private String iconSet = "set-a";
-	
-	/**
-	 * Loads the image icons for the rendered turn restriction types 
-	 */
-	protected void loadImages() {
-		for(TurnRestrictionType type: TurnRestrictionType.values()) {
-			try {
-				ImageIcon icon = new ImageIcon(ImageProvider.get("types/" + iconSet, type.getTagValue()).getImage().getScaledInstance(16, 16, Image.SCALE_SMOOTH));
-				icons.put(type,icon);
-			} catch(Exception e){
-				System.out.println(tr("Warning: failed to load icon for turn restriction type ''{0}''", type.getTagValue()));
-				e.printStackTrace();				
-			}
-		}
-	}
-	
-	public TurnRestrictionTypeRenderer() {
-		setOpaque(true);
-		loadImages();
-	}
-	
-	protected void renderColors(boolean isSelected){
-		if (isSelected){
-			setBackground(UIManager.getColor("List.selectionBackground"));
-			setForeground(UIManager.getColor("List.selectionForeground"));
-		} else {
-			setBackground(UIManager.getColor("List.background"));
-			setForeground(UIManager.getColor("List.foreground"));			
-		}
-	}
-	
-	/**
-	 * Initializes the set of icons used from the preference key
-	 * {@see PreferenceKeys#ROAD_SIGNS}.
-	 * 
-	 * @param prefs the JOSM preferences 
-	 */
-	public void initIconSetFromPreferences(Preferences prefs){		
-		iconSet = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a");
-		iconSet = iconSet.trim().toLowerCase();
-		if (!iconSet.equals("set-a") && !iconSet.equals("set-b")) {
-			iconSet = "set-a";
-		}
-		loadImages();
-	}
-	
-	public Component getListCellRendererComponent(JList list, Object value,
-			int index, boolean isSelected, boolean cellHasFocus) {
-		
-		renderColors(isSelected);
-		if (value == null) {
-			setText(tr("please select a turn restriction type"));
-			setIcon(null);
-		} else if (value instanceof String){
-			setText((String)value);
-			setIcon(null); // FIXME: special icon for non-standard types? 
-		} else if (value instanceof TurnRestrictionType){
-			TurnRestrictionType type = (TurnRestrictionType)value;
-			setText(type.getDisplayName());
-			setIcon(icons.get(type));
-		}
-		return this;
-	}	
+    final private Map<TurnRestrictionType, ImageIcon> icons = new HashMap<TurnRestrictionType, ImageIcon>();
+    private String iconSet = "set-a";
+    
+    /**
+     * Loads the image icons for the rendered turn restriction types 
+     */
+    protected void loadImages() {
+        for(TurnRestrictionType type: TurnRestrictionType.values()) {
+            try {
+                ImageIcon icon = new ImageIcon(ImageProvider.get("types/" + iconSet, type.getTagValue()).getImage().getScaledInstance(16, 16, Image.SCALE_SMOOTH));
+                icons.put(type,icon);
+            } catch(Exception e){
+                System.out.println(tr("Warning: failed to load icon for turn restriction type ''{0}''", type.getTagValue()));
+                e.printStackTrace();                
+            }
+        }
+    }
+    
+    public TurnRestrictionTypeRenderer() {
+        setOpaque(true);
+        loadImages();
+    }
+    
+    protected void renderColors(boolean isSelected){
+        if (isSelected){
+            setBackground(UIManager.getColor("List.selectionBackground"));
+            setForeground(UIManager.getColor("List.selectionForeground"));
+        } else {
+            setBackground(UIManager.getColor("List.background"));
+            setForeground(UIManager.getColor("List.foreground"));           
+        }
+    }
+    
+    /**
+     * Initializes the set of icons used from the preference key
+     * {@see PreferenceKeys#ROAD_SIGNS}.
+     * 
+     * @param prefs the JOSM preferences 
+     */
+    public void initIconSetFromPreferences(Preferences prefs){      
+        iconSet = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a");
+        iconSet = iconSet.trim().toLowerCase();
+        if (!iconSet.equals("set-a") && !iconSet.equals("set-b")) {
+            iconSet = "set-a";
+        }
+        loadImages();
+    }
+    
+    public Component getListCellRendererComponent(JList list, Object value,
+            int index, boolean isSelected, boolean cellHasFocus) {
+        
+        renderColors(isSelected);
+        if (value == null) {
+            setText(tr("please select a turn restriction type"));
+            setIcon(null);
+        } else if (value instanceof String){
+            setText((String)value);
+            setIcon(null); // FIXME: special icon for non-standard types? 
+        } else if (value instanceof TurnRestrictionType){
+            TurnRestrictionType type = (TurnRestrictionType)value;
+            setText(type.getDisplayName());
+            setIcon(icons.get(type));
+        }
+        return this;
+    }   
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/VehicleExceptionEditor.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/VehicleExceptionEditor.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/VehicleExceptionEditor.java	(revision 23192)
@@ -36,292 +36,292 @@
  */
 public class VehicleExceptionEditor extends JPanel implements Observer{
-	static private final Logger logger = Logger.getLogger(VehicleExceptionEditor.class.getName());
-	
-	private TurnRestrictionEditorModel model;
-	private JCheckBox cbPsv;
-	private JCheckBox cbBicyle;
-	private JCheckBox cbHgv;
-	private JCheckBox cbMotorcar;
-	private JTextField tfNonStandardValue;
-	private ButtonGroup bgStandardOrNonStandard;
-	private JRadioButton rbStandardException;
-	private JRadioButton rbNonStandardException;
-	private JPanel pnlStandard;
-	private JPanel pnlNonStandard;
-	private ExceptValueModel exceptValue = new ExceptValueModel();
-	
-	private JPanel buildMessagePanel() {
-		JPanel pnl = new JPanel(new BorderLayout());
-		HtmlPanel msg = new HtmlPanel();
-		pnl.add(msg, BorderLayout.CENTER);
-		msg.setText(
-				"<html><body>"
-				+ tr("Select the vehicle types this turn restriction is <strong>not</strong> applicable for.")
-				+ "</body></html>"
-	    );
-		return pnl;
-	}
-	
-	private JPanel buildStandardInputPanel() {
-		if (pnlStandard != null)
-			return pnlStandard;
-		
-		StandardVehicleTypeChangeListener changeHandler = new StandardVehicleTypeChangeListener();
-		
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.gridx = 0;
-		gc.gridy = 0;
-		
-		pnlStandard = new JPanel(new GridBagLayout());
-		JLabel lbl;
-		cbPsv = new JCheckBox();
-		cbPsv.addItemListener(changeHandler);
-		lbl = new JLabel();
-		lbl.setText(tr("Public Service Vehicles"));
-		lbl.setToolTipText(tr("Public service vehicles like buses, tramways, etc."));
-		lbl.setIcon(ImageProvider.get("vehicle", "psv"));
-		
-		gc.weightx = 0.0;
-		pnlStandard.add(cbPsv, gc);
-		gc.weightx = 1.0;
-		gc.gridx++;
-		pnlStandard.add(lbl, gc);
-		
-		cbHgv = new JCheckBox();
-		cbHgv.addItemListener(changeHandler);
-		lbl = new JLabel();
-		lbl.setText(tr("Heavy Goods Vehicles"));
-		lbl.setIcon(ImageProvider.get("vehicle", "hgv"));
-
-		gc.weightx = 0.0;
-		gc.gridx++;
-		pnlStandard.add(cbHgv, gc);
-		gc.weightx = 1.0;
-		gc.gridx++;
-		pnlStandard.add(lbl, gc);
-
-		cbMotorcar = new JCheckBox();
-		cbMotorcar.addItemListener(changeHandler);
-		lbl = new JLabel();
-		lbl.setText(tr("Motorcars"));
-		lbl.setIcon(ImageProvider.get("vehicle", "motorcar"));
-		
-		gc.weightx = 0.0;
-		gc.gridx = 0;
-		gc.gridy = 1;
-		pnlStandard.add(cbMotorcar, gc);
-		gc.weightx = 1.0;
-		gc.gridx++;
-		pnlStandard.add(lbl, gc);
-		
-		cbBicyle = new JCheckBox();
-		cbBicyle.addItemListener(changeHandler);
-		lbl = new JLabel();
-		lbl.setText(tr("Bicycles"));
-		lbl.setIcon(ImageProvider.get("vehicle", "bicycle"));
-		
-
-		gc.weightx = 0.0;
-		gc.gridx++;
-		pnlStandard.add(cbBicyle, gc);
-		gc.weightx = 1.0;
-		gc.gridx++;
-		pnlStandard.add(lbl, gc);
-		
-		return pnlStandard;
-	}
-	
-	private JPanel buildNonStandardInputPanel() {
-		if (pnlNonStandard != null)
-			return pnlNonStandard;
-		pnlNonStandard = new JPanel(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 0.0;
-		gc.insets = new Insets(0, 0, 4, 0);
-		gc.gridx = 0;
-		gc.gridy = 0;
-		
-		pnlNonStandard.add(new JLabel(tr("Value:")), gc);
-		gc.gridx = 1;
-		gc.weightx = 1.0;
-		pnlNonStandard.add(tfNonStandardValue = new JTextField(), gc);
-		SelectAllOnFocusGainedDecorator.decorate(tfNonStandardValue);
-		
-		NonStandardVehicleTypesHandler inputChangedHandler = new NonStandardVehicleTypesHandler();
-		tfNonStandardValue.addActionListener(inputChangedHandler);
-		tfNonStandardValue.addFocusListener(inputChangedHandler);
-		return pnlNonStandard;
-	}
-		
-	/**
-	 * Builds the UI for entering standard values 
-	 */
-	protected void buildStandard() {
-		setLayout(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 1.0;
-		gc.gridx = 0;
-		gc.gridy = 0;
-		add(buildMessagePanel(), gc);
-		
-		gc.gridy=1;
-		add(buildStandardInputPanel(), gc);		
-	}
-	
-	/**
-	 * Builds the UI for entering either standard or non-standard values 
-	 */
-	protected void buildNonStandard() {
-		setLayout(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 1.0;
-		gc.gridx = 0;
-		gc.gridy = 0;
-		add(buildMessagePanel(), gc);
-				
-		gc.gridx=0;
-		gc.gridy=1;
-		gc.insets = new Insets(0,0,0,0);
-		add(rbStandardException = new JRadioButton(tr("Use standard exceptions")), gc);
-
-		gc.gridx=0;
-		gc.gridy=2;
-		gc.insets = new Insets(0, 20, 0,0);
-		add(buildStandardInputPanel(), gc);
-
-		gc.gridx=0;
-		gc.gridy=3;
-		gc.insets = new Insets(0,0,0,0);
-		add(rbNonStandardException = new JRadioButton(tr("Use non-standard exceptions")), gc);
-
-		gc.gridx=0;
-		gc.gridy=4;
-		gc.insets = new Insets(0, 20, 0,0);
-		add(buildNonStandardInputPanel(), gc);
-		
-		bgStandardOrNonStandard = new ButtonGroup();
-		bgStandardOrNonStandard.add(rbNonStandardException);
-		bgStandardOrNonStandard.add(rbStandardException);
-		
-		StandardNonStandardChangeHander changeHandler = new StandardNonStandardChangeHander();
-		rbNonStandardException.addItemListener(changeHandler);
-		rbStandardException.addItemListener(changeHandler);
-	}
-	
-	protected void build() {
-		removeAll();
-		buildNonStandardInputPanel();
-		buildStandardInputPanel();
-		if (exceptValue.isStandard()){
-			buildStandard();
-		} else {
-			buildNonStandard();
-		}
-		init();
-		invalidate();
-	}
-	
-	protected void init() {
-		cbPsv.setSelected(exceptValue.isVehicleException("psv"));
-		cbBicyle.setSelected(exceptValue.isVehicleException("bicycle"));
-		cbMotorcar.setSelected(exceptValue.isVehicleException("motorcar"));
-		cbHgv.setSelected(exceptValue.isVehicleException("hgv"));
-		if (!exceptValue.isStandard()){
-			rbNonStandardException.setSelected(true);
-			tfNonStandardValue.setText(exceptValue.getValue());
-			setEnabledNonStandardInputPanel(true);
-			setEnabledStandardInputPanel(false);
-		} else {
-			setEnabledNonStandardInputPanel(false);
-			setEnabledStandardInputPanel(true);
-		}
-	}
-	
-	protected void setEnabledStandardInputPanel(boolean enabled) {
-		for (Component c: pnlStandard.getComponents()){
-			c.setEnabled(enabled);
-		}
-	}
-	
-	protected void setEnabledNonStandardInputPanel(boolean enabled) {
-		for (Component c: pnlNonStandard.getComponents()){
-			c.setEnabled(enabled);
-		}
-	}
-
-	
-	/**
-	 * Creates the editor 
-	 * 
-	 * @param model the editor model. Must not be null.
-	 * @throws IllegalArgumentException thrown if {@code model} is null
-	 */
-	public VehicleExceptionEditor(TurnRestrictionEditorModel model) throws IllegalArgumentException {
-		CheckParameterUtil.ensureParameterNotNull(model, "model");
-		this.model = model;
-		build();
-		model.addObserver(this);
-	}
-	
-	/* ------------------------------------------------------------------------------------ */
-	/* interface Observer                                                                   */
-	/* ------------------------------------------------------------------------------------ */
-	public void update(Observable o, Object arg) {
-		if (!this.exceptValue.equals(model.getExcept())) {
-			this.exceptValue = model.getExcept();
-			build();
-		}
-	}
-
-	/* ------------------------------------------------------------------------------------ */
-	/* inner classes                                                                        */
-	/* ------------------------------------------------------------------------------------ */
-	class StandardNonStandardChangeHander implements ItemListener {
-		public void itemStateChanged(ItemEvent e) {
-			if (rbNonStandardException.isSelected()){
-				setEnabledNonStandardInputPanel(true);
-				setEnabledStandardInputPanel(false);
-				exceptValue.setStandard(false);
-			} else {
-				setEnabledNonStandardInputPanel(false);
-				setEnabledStandardInputPanel(true);
-				exceptValue.setStandard(true);
-			}
-			model.setExcept(exceptValue);
-		}
-	}
-	
-	class StandardVehicleTypeChangeListener implements ItemListener {
-		public void itemStateChanged(ItemEvent e) {
-			exceptValue.setVehicleException("bicycle", cbBicyle.isSelected());
-			exceptValue.setVehicleException("hgv", cbHgv.isSelected());
-			exceptValue.setVehicleException("psv", cbPsv.isSelected());
-			exceptValue.setVehicleException("motorcar", cbMotorcar.isSelected());
-			model.setExcept(exceptValue);
-		}
-	}
-	
-	class NonStandardVehicleTypesHandler implements ActionListener, FocusListener {
-		public void persist() {
-			exceptValue.setValue(tfNonStandardValue.getText());
-			model.setExcept(exceptValue);
-		}
-		
-		public void focusGained(FocusEvent e) {}
-		public void focusLost(FocusEvent e) {
-			persist();
-		}
-
-		public void actionPerformed(ActionEvent e) {
-			persist();			
-		}
-	}
+    static private final Logger logger = Logger.getLogger(VehicleExceptionEditor.class.getName());
+    
+    private TurnRestrictionEditorModel model;
+    private JCheckBox cbPsv;
+    private JCheckBox cbBicyle;
+    private JCheckBox cbHgv;
+    private JCheckBox cbMotorcar;
+    private JTextField tfNonStandardValue;
+    private ButtonGroup bgStandardOrNonStandard;
+    private JRadioButton rbStandardException;
+    private JRadioButton rbNonStandardException;
+    private JPanel pnlStandard;
+    private JPanel pnlNonStandard;
+    private ExceptValueModel exceptValue = new ExceptValueModel();
+    
+    private JPanel buildMessagePanel() {
+        JPanel pnl = new JPanel(new BorderLayout());
+        HtmlPanel msg = new HtmlPanel();
+        pnl.add(msg, BorderLayout.CENTER);
+        msg.setText(
+                "<html><body>"
+                + tr("Select the vehicle types this turn restriction is <strong>not</strong> applicable for.")
+                + "</body></html>"
+        );
+        return pnl;
+    }
+    
+    private JPanel buildStandardInputPanel() {
+        if (pnlStandard != null)
+            return pnlStandard;
+        
+        StandardVehicleTypeChangeListener changeHandler = new StandardVehicleTypeChangeListener();
+        
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.gridx = 0;
+        gc.gridy = 0;
+        
+        pnlStandard = new JPanel(new GridBagLayout());
+        JLabel lbl;
+        cbPsv = new JCheckBox();
+        cbPsv.addItemListener(changeHandler);
+        lbl = new JLabel();
+        lbl.setText(tr("Public Service Vehicles"));
+        lbl.setToolTipText(tr("Public service vehicles like buses, tramways, etc."));
+        lbl.setIcon(ImageProvider.get("vehicle", "psv"));
+        
+        gc.weightx = 0.0;
+        pnlStandard.add(cbPsv, gc);
+        gc.weightx = 1.0;
+        gc.gridx++;
+        pnlStandard.add(lbl, gc);
+        
+        cbHgv = new JCheckBox();
+        cbHgv.addItemListener(changeHandler);
+        lbl = new JLabel();
+        lbl.setText(tr("Heavy Goods Vehicles"));
+        lbl.setIcon(ImageProvider.get("vehicle", "hgv"));
+
+        gc.weightx = 0.0;
+        gc.gridx++;
+        pnlStandard.add(cbHgv, gc);
+        gc.weightx = 1.0;
+        gc.gridx++;
+        pnlStandard.add(lbl, gc);
+
+        cbMotorcar = new JCheckBox();
+        cbMotorcar.addItemListener(changeHandler);
+        lbl = new JLabel();
+        lbl.setText(tr("Motorcars"));
+        lbl.setIcon(ImageProvider.get("vehicle", "motorcar"));
+        
+        gc.weightx = 0.0;
+        gc.gridx = 0;
+        gc.gridy = 1;
+        pnlStandard.add(cbMotorcar, gc);
+        gc.weightx = 1.0;
+        gc.gridx++;
+        pnlStandard.add(lbl, gc);
+        
+        cbBicyle = new JCheckBox();
+        cbBicyle.addItemListener(changeHandler);
+        lbl = new JLabel();
+        lbl.setText(tr("Bicycles"));
+        lbl.setIcon(ImageProvider.get("vehicle", "bicycle"));
+        
+
+        gc.weightx = 0.0;
+        gc.gridx++;
+        pnlStandard.add(cbBicyle, gc);
+        gc.weightx = 1.0;
+        gc.gridx++;
+        pnlStandard.add(lbl, gc);
+        
+        return pnlStandard;
+    }
+    
+    private JPanel buildNonStandardInputPanel() {
+        if (pnlNonStandard != null)
+            return pnlNonStandard;
+        pnlNonStandard = new JPanel(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 0.0;
+        gc.insets = new Insets(0, 0, 4, 0);
+        gc.gridx = 0;
+        gc.gridy = 0;
+        
+        pnlNonStandard.add(new JLabel(tr("Value:")), gc);
+        gc.gridx = 1;
+        gc.weightx = 1.0;
+        pnlNonStandard.add(tfNonStandardValue = new JTextField(), gc);
+        SelectAllOnFocusGainedDecorator.decorate(tfNonStandardValue);
+        
+        NonStandardVehicleTypesHandler inputChangedHandler = new NonStandardVehicleTypesHandler();
+        tfNonStandardValue.addActionListener(inputChangedHandler);
+        tfNonStandardValue.addFocusListener(inputChangedHandler);
+        return pnlNonStandard;
+    }
+        
+    /**
+     * Builds the UI for entering standard values 
+     */
+    protected void buildStandard() {
+        setLayout(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 1.0;
+        gc.gridx = 0;
+        gc.gridy = 0;
+        add(buildMessagePanel(), gc);
+        
+        gc.gridy=1;
+        add(buildStandardInputPanel(), gc);     
+    }
+    
+    /**
+     * Builds the UI for entering either standard or non-standard values 
+     */
+    protected void buildNonStandard() {
+        setLayout(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 1.0;
+        gc.gridx = 0;
+        gc.gridy = 0;
+        add(buildMessagePanel(), gc);
+                
+        gc.gridx=0;
+        gc.gridy=1;
+        gc.insets = new Insets(0,0,0,0);
+        add(rbStandardException = new JRadioButton(tr("Use standard exceptions")), gc);
+
+        gc.gridx=0;
+        gc.gridy=2;
+        gc.insets = new Insets(0, 20, 0,0);
+        add(buildStandardInputPanel(), gc);
+
+        gc.gridx=0;
+        gc.gridy=3;
+        gc.insets = new Insets(0,0,0,0);
+        add(rbNonStandardException = new JRadioButton(tr("Use non-standard exceptions")), gc);
+
+        gc.gridx=0;
+        gc.gridy=4;
+        gc.insets = new Insets(0, 20, 0,0);
+        add(buildNonStandardInputPanel(), gc);
+        
+        bgStandardOrNonStandard = new ButtonGroup();
+        bgStandardOrNonStandard.add(rbNonStandardException);
+        bgStandardOrNonStandard.add(rbStandardException);
+        
+        StandardNonStandardChangeHander changeHandler = new StandardNonStandardChangeHander();
+        rbNonStandardException.addItemListener(changeHandler);
+        rbStandardException.addItemListener(changeHandler);
+    }
+    
+    protected void build() {
+        removeAll();
+        buildNonStandardInputPanel();
+        buildStandardInputPanel();
+        if (exceptValue.isStandard()){
+            buildStandard();
+        } else {
+            buildNonStandard();
+        }
+        init();
+        invalidate();
+    }
+    
+    protected void init() {
+        cbPsv.setSelected(exceptValue.isVehicleException("psv"));
+        cbBicyle.setSelected(exceptValue.isVehicleException("bicycle"));
+        cbMotorcar.setSelected(exceptValue.isVehicleException("motorcar"));
+        cbHgv.setSelected(exceptValue.isVehicleException("hgv"));
+        if (!exceptValue.isStandard()){
+            rbNonStandardException.setSelected(true);
+            tfNonStandardValue.setText(exceptValue.getValue());
+            setEnabledNonStandardInputPanel(true);
+            setEnabledStandardInputPanel(false);
+        } else {
+            setEnabledNonStandardInputPanel(false);
+            setEnabledStandardInputPanel(true);
+        }
+    }
+    
+    protected void setEnabledStandardInputPanel(boolean enabled) {
+        for (Component c: pnlStandard.getComponents()){
+            c.setEnabled(enabled);
+        }
+    }
+    
+    protected void setEnabledNonStandardInputPanel(boolean enabled) {
+        for (Component c: pnlNonStandard.getComponents()){
+            c.setEnabled(enabled);
+        }
+    }
+
+    
+    /**
+     * Creates the editor 
+     * 
+     * @param model the editor model. Must not be null.
+     * @throws IllegalArgumentException thrown if {@code model} is null
+     */
+    public VehicleExceptionEditor(TurnRestrictionEditorModel model) throws IllegalArgumentException {
+        CheckParameterUtil.ensureParameterNotNull(model, "model");
+        this.model = model;
+        build();
+        model.addObserver(this);
+    }
+    
+    /* ------------------------------------------------------------------------------------ */
+    /* interface Observer                                                                   */
+    /* ------------------------------------------------------------------------------------ */
+    public void update(Observable o, Object arg) {
+        if (!this.exceptValue.equals(model.getExcept())) {
+            this.exceptValue = model.getExcept();
+            build();
+        }
+    }
+
+    /* ------------------------------------------------------------------------------------ */
+    /* inner classes                                                                        */
+    /* ------------------------------------------------------------------------------------ */
+    class StandardNonStandardChangeHander implements ItemListener {
+        public void itemStateChanged(ItemEvent e) {
+            if (rbNonStandardException.isSelected()){
+                setEnabledNonStandardInputPanel(true);
+                setEnabledStandardInputPanel(false);
+                exceptValue.setStandard(false);
+            } else {
+                setEnabledNonStandardInputPanel(false);
+                setEnabledStandardInputPanel(true);
+                exceptValue.setStandard(true);
+            }
+            model.setExcept(exceptValue);
+        }
+    }
+    
+    class StandardVehicleTypeChangeListener implements ItemListener {
+        public void itemStateChanged(ItemEvent e) {
+            exceptValue.setVehicleException("bicycle", cbBicyle.isSelected());
+            exceptValue.setVehicleException("hgv", cbHgv.isSelected());
+            exceptValue.setVehicleException("psv", cbPsv.isSelected());
+            exceptValue.setVehicleException("motorcar", cbMotorcar.isSelected());
+            model.setExcept(exceptValue);
+        }
+    }
+    
+    class NonStandardVehicleTypesHandler implements ActionListener, FocusListener {
+        public void persist() {
+            exceptValue.setValue(tfNonStandardValue.getText());
+            model.setExcept(exceptValue);
+        }
+        
+        public void focusGained(FocusEvent e) {}
+        public void focusLost(FocusEvent e) {
+            persist();
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            persist();          
+        }
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaList.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaList.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaList.java	(revision 23192)
@@ -46,262 +46,262 @@
  */
 public class ViaList extends JList{
-	
-	static private final Logger logger = Logger.getLogger(ViaList.class.getName());
-
-	private ViaListModel model;
-	private DeleteAction actDelete;
-	private MoveUpAction actMoveUp;
-	private MoveDownAction actMoveDown;
-	private CopyAction actCopy;
-	private PasteAction actPaste;
-	private TransferHandler transferHandler;
-	
-	/**
-	 * Constructor 
-	 * 
-	 * @param model the via list model. Must not be null.
-	 * @param selectionModel the selection model. Must not be null.
-	 * 
-	 */
-	public ViaList(ViaListModel model, DefaultListSelectionModel selectionModel) {
-		super(model);
-		this.model = model;
-		setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-		setSelectionModel(selectionModel);
-		setCellRenderer(new OsmPrimitivRenderer());
-		setDragEnabled(true);		
-		setTransferHandler(transferHandler =new ViaListTransferHandler(model));
-		setVisibleRowCount(4);
-		
-		actDelete = new DeleteAction();
-		selectionModel.addListSelectionListener(actDelete);
-		registerKeyboardAction(actDelete, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-		
-		actMoveDown = new MoveDownAction();
-		selectionModel.addListSelectionListener(actMoveDown);
-		registerKeyboardAction(actMoveDown, KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.ALT_DOWN_MASK), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-
-		actMoveUp = new MoveUpAction();
-		selectionModel.addListSelectionListener(actMoveUp);
-		registerKeyboardAction(actMoveUp, KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.ALT_DOWN_MASK), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
-		
-		actCopy = new CopyAction();
-		actPaste = new PasteAction();
-		getSelectionModel().addListSelectionListener(actCopy);
-        
-		addMouseListener(new ViaListPopupMenuLaucher());			
-	}
-	
-	/**
-	 * The transfer handler for Drag-and-Drop. 
-	 */
-	class ViaListTransferHandler extends PrimitiveIdListTransferHandler {
-		Logger logger = Logger.getLogger(ViaListTransferHandler.class.getName());
-		
-		private boolean isViaListInDragOperation = false;
-		private List<Integer> selectedRowsMemento = null;
-		
-		public ViaListTransferHandler(PrimitiveIdListProvider provider) {
-			super(provider);
-		}
-
-		@Override
-		public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
-			// a drag operation on itself is always allowed
-			if (isViaListInDragOperation) return true;
-			return isSupportedFlavor(transferFlavors);			
-		}
-
-		@SuppressWarnings("unchecked")
-		@Override
-		public boolean importData(JComponent comp, Transferable t) {	
-			if (!isSupportedFlavor(t.getTransferDataFlavors())) return false;
-			if (isViaListInDragOperation) {
-				// this is a drag operation on itself
-				int targetRow = getSelectedIndex();
-				if (targetRow <0) return true;
-				model.moveVias(selectedRowsMemento, targetRow);				
-			} else {
-				// this is a drag operation from another component
-				try {
-					List<PrimitiveId> idsToAdd = (List<PrimitiveId>)t.getTransferData(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR);
-					model.insertVias(idsToAdd);
-				} catch(IOException e){
-					e.printStackTrace();
-				} catch(UnsupportedFlavorException e){
-					e.printStackTrace();
-				}
-			}
-			return true;
-		}
-
-		@Override
-		protected void exportDone(JComponent source, Transferable data, int action) {
-			isViaListInDragOperation = false;
-			super.exportDone(source, data, action);
-		}
-
-		@Override
-		public void exportAsDrag(JComponent comp, InputEvent e, int action) {
-			isViaListInDragOperation = true;
-			selectedRowsMemento = model.getSelectedRows();
-			super.exportAsDrag(comp, e, action);
-		}		
-	}	
-	
-	class DeleteAction extends AbstractAction implements ListSelectionListener {
-		public DeleteAction() {
-			putValue(NAME, tr("Remove"));
-			putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
-			putValue(SHORT_DESCRIPTION,tr("Remove the currently selected vias"));		
-			putValue(ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0));			
-			updateEnabledState();
-		}
-		
-		public void valueChanged(ListSelectionEvent e) {
-			updateEnabledState();			
-		}
-		
-		public void updateEnabledState() {
-			setEnabled(getSelectedIndex() >= 0);
-		}
-
-		public void actionPerformed(ActionEvent e) {
-			model.removeSelectedVias();			
-		}
-	}
-	
-	class MoveDownAction extends AbstractAction implements ListSelectionListener{		
-		public MoveDownAction(){
-			putValue(NAME, tr("Move down"));
-			putValue(SHORT_DESCRIPTION, tr("Move the selected vias down by one position"));
-			putValue(ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.ALT_DOWN_MASK));
-			putValue(SMALL_ICON, ImageProvider.get("dialogs", "movedown"));
-			updateEnabledState();
-		}
-		
-		public void actionPerformed(ActionEvent e) {
-			model.moveDown();
-		}
-
-		public void updateEnabledState(){
-			if (getSelectedIndex() < 0) {
-				setEnabled(false);
-				return;
-			}
-			setEnabled(getSelectionModel().getMaxSelectionIndex() < getModel().getSize() -1);
-		}
-		
-		public void valueChanged(ListSelectionEvent e) {
-			updateEnabledState();			
-		}
-	}
-	
-	class MoveUpAction extends AbstractAction implements ListSelectionListener{		
-		public MoveUpAction() {
-			putValue(NAME, tr("Move up"));
-			putValue(SHORT_DESCRIPTION, tr("Move the selected vias up by one position"));
-			putValue(ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.ALT_DOWN_MASK));
-			putValue(SMALL_ICON, ImageProvider.get("dialogs", "moveup"));
-			updateEnabledState();
-		}
-		
-		public void actionPerformed(ActionEvent e) {
-			model.moveUp();
-		}
-
-		public void updateEnabledState(){
-			if (getSelectedIndex() < 0) {
-				setEnabled(false);
-				return;
-			}
-			setEnabled(getSelectionModel().getMinSelectionIndex() > 0);
-		}
-		
-		public void valueChanged(ListSelectionEvent e) {
-			updateEnabledState();			
-		}
-	}
-
-	class CopyAction extends AbstractAction implements ListSelectionListener {
-		private Action delegate;
-		
-		public CopyAction(){
-			putValue(NAME, tr("Copy"));
-			putValue(SHORT_DESCRIPTION, tr("Copy the selected vias to the clipboard"));
-			putValue(SMALL_ICON, ImageProvider.get("copy"));
-			putValue(ACCELERATOR_KEY, Shortcut.getCopyKeyStroke());
-			delegate = ViaList.this.getActionMap().get("copy");
-		}
-
-		public void actionPerformed(ActionEvent e) {			
-			delegate.actionPerformed(e);
-		}
-
-		protected void updateEnabledState() {
-			setEnabled(!model.getSelectedVias().isEmpty());
-		}
-		
-		public void valueChanged(ListSelectionEvent e) {
-			updateEnabledState();
-		}
-	}
-	
-	class PasteAction extends AbstractAction {
-		private Action delegate;
-		
-		public boolean canPaste() {
-			Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
-			for (DataFlavor df: clipboard.getAvailableDataFlavors()) {
-				if (df.equals(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR)) return true;
-			}			
-			// FIXME: check whether there are selected objects in the JOSM copy/paste buffer  
-			return false;
-		}
-		
-		public PasteAction(){
-			putValue(NAME, tr("Paste"));
-			putValue(SHORT_DESCRIPTION, tr("Insert 'via' objects from the clipboard"));
-			putValue(SMALL_ICON, ImageProvider.get("paste"));
-			putValue(ACCELERATOR_KEY, Shortcut.getPasteKeyStroke());
-			delegate = ViaList.this.getActionMap().get("paste");
-			updateEnabledState();
-		}
-
-		public void updateEnabledState() {
-			setEnabled(canPaste());
-		}
-		
-		public void actionPerformed(ActionEvent e) {
-			delegate.actionPerformed(e);			
-		}
-	}
-	
-	class ViaListPopupMenu extends JPopupMenu {
-		public ViaListPopupMenu() {
-			JMenuItem item = add(actCopy);
-			item.setTransferHandler(transferHandler);			
-			item = add(actPaste);
-			actPaste.updateEnabledState();
-			item.setTransferHandler(transferHandler);
-			addSeparator();
-			add(actDelete);
-			addSeparator();
-			add(actMoveUp);
-			add(actMoveDown);
-		}
-	}
-	
-	class ViaListPopupMenuLaucher extends PopupMenuLauncher {
-		@Override
-		public void launch(MouseEvent evt) {
-			if (getSelectedIndex() <0) {
-				int idx = locationToIndex(evt.getPoint());
-				if (idx >=0) {
-					setSelectedIndex(idx);
-				}
-			}
-			new ViaListPopupMenu().show(ViaList.this, evt.getX(), evt.getY());
-		}		
-	}	
+    
+    static private final Logger logger = Logger.getLogger(ViaList.class.getName());
+
+    private ViaListModel model;
+    private DeleteAction actDelete;
+    private MoveUpAction actMoveUp;
+    private MoveDownAction actMoveDown;
+    private CopyAction actCopy;
+    private PasteAction actPaste;
+    private TransferHandler transferHandler;
+    
+    /**
+     * Constructor 
+     * 
+     * @param model the via list model. Must not be null.
+     * @param selectionModel the selection model. Must not be null.
+     * 
+     */
+    public ViaList(ViaListModel model, DefaultListSelectionModel selectionModel) {
+        super(model);
+        this.model = model;
+        setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+        setSelectionModel(selectionModel);
+        setCellRenderer(new OsmPrimitivRenderer());
+        setDragEnabled(true);       
+        setTransferHandler(transferHandler =new ViaListTransferHandler(model));
+        setVisibleRowCount(4);
+        
+        actDelete = new DeleteAction();
+        selectionModel.addListSelectionListener(actDelete);
+        registerKeyboardAction(actDelete, KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        
+        actMoveDown = new MoveDownAction();
+        selectionModel.addListSelectionListener(actMoveDown);
+        registerKeyboardAction(actMoveDown, KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.ALT_DOWN_MASK), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+
+        actMoveUp = new MoveUpAction();
+        selectionModel.addListSelectionListener(actMoveUp);
+        registerKeyboardAction(actMoveUp, KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.ALT_DOWN_MASK), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
+        
+        actCopy = new CopyAction();
+        actPaste = new PasteAction();
+        getSelectionModel().addListSelectionListener(actCopy);
+        
+        addMouseListener(new ViaListPopupMenuLaucher());            
+    }
+    
+    /**
+     * The transfer handler for Drag-and-Drop. 
+     */
+    class ViaListTransferHandler extends PrimitiveIdListTransferHandler {
+        Logger logger = Logger.getLogger(ViaListTransferHandler.class.getName());
+        
+        private boolean isViaListInDragOperation = false;
+        private List<Integer> selectedRowsMemento = null;
+        
+        public ViaListTransferHandler(PrimitiveIdListProvider provider) {
+            super(provider);
+        }
+
+        @Override
+        public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
+            // a drag operation on itself is always allowed
+            if (isViaListInDragOperation) return true;
+            return isSupportedFlavor(transferFlavors);          
+        }
+
+        @SuppressWarnings("unchecked")
+        @Override
+        public boolean importData(JComponent comp, Transferable t) {    
+            if (!isSupportedFlavor(t.getTransferDataFlavors())) return false;
+            if (isViaListInDragOperation) {
+                // this is a drag operation on itself
+                int targetRow = getSelectedIndex();
+                if (targetRow <0) return true;
+                model.moveVias(selectedRowsMemento, targetRow);             
+            } else {
+                // this is a drag operation from another component
+                try {
+                    List<PrimitiveId> idsToAdd = (List<PrimitiveId>)t.getTransferData(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR);
+                    model.insertVias(idsToAdd);
+                } catch(IOException e){
+                    e.printStackTrace();
+                } catch(UnsupportedFlavorException e){
+                    e.printStackTrace();
+                }
+            }
+            return true;
+        }
+
+        @Override
+        protected void exportDone(JComponent source, Transferable data, int action) {
+            isViaListInDragOperation = false;
+            super.exportDone(source, data, action);
+        }
+
+        @Override
+        public void exportAsDrag(JComponent comp, InputEvent e, int action) {
+            isViaListInDragOperation = true;
+            selectedRowsMemento = model.getSelectedRows();
+            super.exportAsDrag(comp, e, action);
+        }       
+    }   
+    
+    class DeleteAction extends AbstractAction implements ListSelectionListener {
+        public DeleteAction() {
+            putValue(NAME, tr("Remove"));
+            putValue(SMALL_ICON, ImageProvider.get("dialogs", "delete"));
+            putValue(SHORT_DESCRIPTION,tr("Remove the currently selected vias"));       
+            putValue(ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0));         
+            updateEnabledState();
+        }
+        
+        public void valueChanged(ListSelectionEvent e) {
+            updateEnabledState();           
+        }
+        
+        public void updateEnabledState() {
+            setEnabled(getSelectedIndex() >= 0);
+        }
+
+        public void actionPerformed(ActionEvent e) {
+            model.removeSelectedVias();         
+        }
+    }
+    
+    class MoveDownAction extends AbstractAction implements ListSelectionListener{       
+        public MoveDownAction(){
+            putValue(NAME, tr("Move down"));
+            putValue(SHORT_DESCRIPTION, tr("Move the selected vias down by one position"));
+            putValue(ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.ALT_DOWN_MASK));
+            putValue(SMALL_ICON, ImageProvider.get("dialogs", "movedown"));
+            updateEnabledState();
+        }
+        
+        public void actionPerformed(ActionEvent e) {
+            model.moveDown();
+        }
+
+        public void updateEnabledState(){
+            if (getSelectedIndex() < 0) {
+                setEnabled(false);
+                return;
+            }
+            setEnabled(getSelectionModel().getMaxSelectionIndex() < getModel().getSize() -1);
+        }
+        
+        public void valueChanged(ListSelectionEvent e) {
+            updateEnabledState();           
+        }
+    }
+    
+    class MoveUpAction extends AbstractAction implements ListSelectionListener{     
+        public MoveUpAction() {
+            putValue(NAME, tr("Move up"));
+            putValue(SHORT_DESCRIPTION, tr("Move the selected vias up by one position"));
+            putValue(ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.ALT_DOWN_MASK));
+            putValue(SMALL_ICON, ImageProvider.get("dialogs", "moveup"));
+            updateEnabledState();
+        }
+        
+        public void actionPerformed(ActionEvent e) {
+            model.moveUp();
+        }
+
+        public void updateEnabledState(){
+            if (getSelectedIndex() < 0) {
+                setEnabled(false);
+                return;
+            }
+            setEnabled(getSelectionModel().getMinSelectionIndex() > 0);
+        }
+        
+        public void valueChanged(ListSelectionEvent e) {
+            updateEnabledState();           
+        }
+    }
+
+    class CopyAction extends AbstractAction implements ListSelectionListener {
+        private Action delegate;
+        
+        public CopyAction(){
+            putValue(NAME, tr("Copy"));
+            putValue(SHORT_DESCRIPTION, tr("Copy the selected vias to the clipboard"));
+            putValue(SMALL_ICON, ImageProvider.get("copy"));
+            putValue(ACCELERATOR_KEY, Shortcut.getCopyKeyStroke());
+            delegate = ViaList.this.getActionMap().get("copy");
+        }
+
+        public void actionPerformed(ActionEvent e) {            
+            delegate.actionPerformed(e);
+        }
+
+        protected void updateEnabledState() {
+            setEnabled(!model.getSelectedVias().isEmpty());
+        }
+        
+        public void valueChanged(ListSelectionEvent e) {
+            updateEnabledState();
+        }
+    }
+    
+    class PasteAction extends AbstractAction {
+        private Action delegate;
+        
+        public boolean canPaste() {
+            Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
+            for (DataFlavor df: clipboard.getAvailableDataFlavors()) {
+                if (df.equals(PrimitiveIdTransferable.PRIMITIVE_ID_LIST_FLAVOR)) return true;
+            }           
+            // FIXME: check whether there are selected objects in the JOSM copy/paste buffer  
+            return false;
+        }
+        
+        public PasteAction(){
+            putValue(NAME, tr("Paste"));
+            putValue(SHORT_DESCRIPTION, tr("Insert 'via' objects from the clipboard"));
+            putValue(SMALL_ICON, ImageProvider.get("paste"));
+            putValue(ACCELERATOR_KEY, Shortcut.getPasteKeyStroke());
+            delegate = ViaList.this.getActionMap().get("paste");
+            updateEnabledState();
+        }
+
+        public void updateEnabledState() {
+            setEnabled(canPaste());
+        }
+        
+        public void actionPerformed(ActionEvent e) {
+            delegate.actionPerformed(e);            
+        }
+    }
+    
+    class ViaListPopupMenu extends JPopupMenu {
+        public ViaListPopupMenu() {
+            JMenuItem item = add(actCopy);
+            item.setTransferHandler(transferHandler);           
+            item = add(actPaste);
+            actPaste.updateEnabledState();
+            item.setTransferHandler(transferHandler);
+            addSeparator();
+            add(actDelete);
+            addSeparator();
+            add(actMoveUp);
+            add(actMoveDown);
+        }
+    }
+    
+    class ViaListPopupMenuLaucher extends PopupMenuLauncher {
+        @Override
+        public void launch(MouseEvent evt) {
+            if (getSelectedIndex() <0) {
+                int idx = locationToIndex(evt.getPoint());
+                if (idx >=0) {
+                    setSelectedIndex(idx);
+                }
+            }
+            new ViaListPopupMenu().show(ViaList.this, evt.getX(), evt.getY());
+        }       
+    }   
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListModel.java	(revision 23192)
@@ -23,223 +23,223 @@
  */
 public class ViaListModel extends AbstractListModel implements PrimitiveIdListProvider, Observer{
-	static private final Logger logger = Logger.getLogger(ViaListModel.class.getName());
-	
-	private DefaultListSelectionModel selectionModel;
-	private final ArrayList<OsmPrimitive> vias = new ArrayList<OsmPrimitive>();
-	private TurnRestrictionEditorModel model;
-	
-	/**
-	 * Constructor 
-	 * 
-	 * @param model the turn restriction editor model. Must not be null.
-	 * @param selectionModel the selection model. Must not be null.
-	 * @throws IllegalArgumentException thrown if model is null
-	 * @throws IllegalArgumentException thrown if selectionModel is null
-	 */
-	public ViaListModel(TurnRestrictionEditorModel model, DefaultListSelectionModel selectionModel) {
-		CheckParameterUtil.ensureParameterNotNull(model, "model");
-		CheckParameterUtil.ensureParameterNotNull(selectionModel, "selectionModel");
-		this.model = model;
-		this.selectionModel = selectionModel;
-		model.addObserver(this);
-		refresh();
-	}
-
-	/**
-	 * Replies the list of currently selected vias
-	 * 
-	 * @return the list of currently selected vias
-	 */
-	public List<OsmPrimitive> getSelectedVias() {
-		ArrayList<OsmPrimitive> ret = new ArrayList<OsmPrimitive>();
-		for (int i=0; i < getSize(); i++) {
-			if (selectionModel.isSelectedIndex(i)) {
-				ret.add(vias.get(i));
-			}
-		}
-		return ret;
-	}
-	
-	/**
-	 * Sets the collection of currently selected vias
-	 * 
-	 *  @param vias a collection of vias 
-	 */
-	public void setSelectedVias(Collection<OsmPrimitive> vias) {
-		selectionModel.clearSelection();
-		if (vias == null) return;
-		for(OsmPrimitive via: vias) {
-			int idx = this.vias.indexOf(via);
-			if (idx < 0) continue;
-			selectionModel.addSelectionInterval(idx, idx);
-		}
-	}
-	
-	/**
-	 * Replies the list of selected rows 
-	 * 
-	 * @return the list of selected rows
-	 */
-	public List<Integer> getSelectedRows() {
-		ArrayList<Integer> ret = new ArrayList<Integer>();
-		for (int i=0; i < getSize(); i++) {
-			if (selectionModel.isSelectedIndex(i)) {
-				ret.add(i);
-			}
-		}
-		return ret;
-	}
-	
-	protected List<Integer> moveUp(List<Integer> rows, int targetRow) {
-		List<Integer> ret = new ArrayList<Integer>(rows.size());
-		int delta = rows.get(0) - targetRow;
-		for(int row: rows) {
-			OsmPrimitive via = vias.remove(row);
-			vias.add(row - delta, via);
-			ret.add(row - delta);
-		}
-		return ret;
-	}
-	
-	protected List<Integer>  moveDown(List<Integer> rows, int targetRow) {
-		List<Integer> ret = new ArrayList<Integer>(rows.size());
-		int delta = targetRow - rows.get(0);
-		for(int i = rows.size()-1; i >=0; i--) {
-			int row = rows.get(i);
-			OsmPrimitive via = vias.remove(row);
-			vias.add(row + delta, via);
-			ret.add(row + delta);
-		}
-		return ret;
-	}
-	
-	public void moveVias(List<Integer> selectedRows, int targetRow){
-		if (selectedRows == null) return;
-		if (selectedRows.size() == 1){
-			int sourceRow = selectedRows.get(0);
-			if (sourceRow == targetRow) return;
-			OsmPrimitive via = vias.remove(sourceRow);
-			vias.add(targetRow, via);
-			fireContentsChanged(this, 0, getSize());
-			selectionModel.setSelectionInterval(targetRow, targetRow);
-			return;
-		} 
-		int min = selectedRows.get(0);
-		int max = selectedRows.get(selectedRows.size()-1);
-		if (targetRow < min) {
-			selectedRows = moveUp(selectedRows, targetRow);
-		} else if (targetRow == min){
-			// do nothing
-		} else if (targetRow - min < getSize() - max){
-			int delta = Math.min(targetRow - min, getSize()-1 - max);
-			targetRow = min + delta;
-			if (targetRow > min) {
-				selectedRows = moveDown(selectedRows, targetRow);
-			}
-		} 
-		fireContentsChanged(this, 0, getSize());
-		selectionModel.clearSelection();
-		for(int row: selectedRows) {
-			selectionModel.addSelectionInterval(row, row);
-		}		
-	}
-	
-	/**
-	 * Move the currently selected vias up by one position
-	 */
-	public void moveUp() {
-		List<Integer> sel = getSelectedRows();
-		if (sel.isEmpty() || sel.get(0) == 0) return;
-		moveVias(sel, sel.get(0)-1);
-	}
-
-	/**
-	 * Move the currently selected vias down by one position
-	 */
-	public void moveDown() {
-		List<Integer> sel = getSelectedRows();
-		if (sel.isEmpty() || sel.get(sel.size()-1) == getSize()-1) return;
-		moveVias(sel, sel.get(sel.size()-1)+1);
-	}
-	
-	/**
-	 * Inserts a list of OSM objects given by OSM primitive ids. 
-	 * 
-	 * @param idsToInsert the ids of the objects to insert
-	 */
-	public void insertVias(List<PrimitiveId> idsToInsert) {
-		if (idsToInsert == null) return;
-		List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>(idsToInsert.size());
-		DataSet ds = model.getLayer().data;
-		for(PrimitiveId id: idsToInsert){
-			OsmPrimitive p = ds.getPrimitiveById(id);
-			if (p == null){
-				System.out.println(tr("Failed to retrieve OSM object with id {0} from dataset {1}. Cannot add it as ''via''.", id, ds));
-				continue;
-			}
-			primitives.add(p);
-		}
-		int targetRow = Math.max(selectionModel.getMinSelectionIndex(),0);
-		List<OsmPrimitive> newVias = new ArrayList<OsmPrimitive>(vias);
-		newVias.addAll(targetRow, primitives);
-		model.setVias(newVias);
-		fireContentsChanged(this, 0, getSize());
-		selectionModel.clearSelection();
-		for(int i=targetRow; i< targetRow + primitives.size();i++) {
-			selectionModel.addSelectionInterval(i, i);
-		}			
-	}
-
-	/**
-	 * Removes the currently selected vias
-	 */
-	public void removeSelectedVias() {
-		ArrayList<OsmPrimitive> newVias = new ArrayList<OsmPrimitive>(vias);
-		int j = 0;
-		for(int i=0; i< getSize();i++){
-			if (!selectionModel.isSelectedIndex(i)) continue;
-			newVias.remove(i-j);
-			j++;
-		}
-		if (j == 0) return; // nothing selected, nothing deleted
-		model.setVias(newVias);
-	}
-	
-	/**
-	 * Refreshes the list of 'vias' in this model with the current list of
-	 * vias from the turn restriction model. 
-	 */
-	protected void refresh() {
-		List<OsmPrimitive> sel = getSelectedVias();
-		vias.clear();
-		vias.addAll(model.getVias());		
-		fireContentsChanged(this, 0, getSize());
-		setSelectedVias(sel);
-	}
-
-	public Object getElementAt(int index) {
-		return vias.get(index);
-	}
-
-	public int getSize() {
-		return vias.size();
-	}
-	
-	/* ----------------------------------------------------------------------- */
-	/* interface PrimitiveIdListProvider                                       */
-	/* ----------------------------------------------------------------------- */
-	public List<PrimitiveId> getSelectedPrimitiveIds() {
-		ArrayList<PrimitiveId> ids = new ArrayList<PrimitiveId>();
-		for (OsmPrimitive p: getSelectedVias()) {
-			ids.add(p.getPrimitiveId());
-		}
-		return ids;
-	}
-
-	/* ----------------------------------------------------------------------- */
-	/* interface Observer                                                      */
-	/* ----------------------------------------------------------------------- */
-	public void update(Observable o, Object arg) {
-		refresh();
-	}	
+    static private final Logger logger = Logger.getLogger(ViaListModel.class.getName());
+    
+    private DefaultListSelectionModel selectionModel;
+    private final ArrayList<OsmPrimitive> vias = new ArrayList<OsmPrimitive>();
+    private TurnRestrictionEditorModel model;
+    
+    /**
+     * Constructor 
+     * 
+     * @param model the turn restriction editor model. Must not be null.
+     * @param selectionModel the selection model. Must not be null.
+     * @throws IllegalArgumentException thrown if model is null
+     * @throws IllegalArgumentException thrown if selectionModel is null
+     */
+    public ViaListModel(TurnRestrictionEditorModel model, DefaultListSelectionModel selectionModel) {
+        CheckParameterUtil.ensureParameterNotNull(model, "model");
+        CheckParameterUtil.ensureParameterNotNull(selectionModel, "selectionModel");
+        this.model = model;
+        this.selectionModel = selectionModel;
+        model.addObserver(this);
+        refresh();
+    }
+
+    /**
+     * Replies the list of currently selected vias
+     * 
+     * @return the list of currently selected vias
+     */
+    public List<OsmPrimitive> getSelectedVias() {
+        ArrayList<OsmPrimitive> ret = new ArrayList<OsmPrimitive>();
+        for (int i=0; i < getSize(); i++) {
+            if (selectionModel.isSelectedIndex(i)) {
+                ret.add(vias.get(i));
+            }
+        }
+        return ret;
+    }
+    
+    /**
+     * Sets the collection of currently selected vias
+     * 
+     *  @param vias a collection of vias 
+     */
+    public void setSelectedVias(Collection<OsmPrimitive> vias) {
+        selectionModel.clearSelection();
+        if (vias == null) return;
+        for(OsmPrimitive via: vias) {
+            int idx = this.vias.indexOf(via);
+            if (idx < 0) continue;
+            selectionModel.addSelectionInterval(idx, idx);
+        }
+    }
+    
+    /**
+     * Replies the list of selected rows 
+     * 
+     * @return the list of selected rows
+     */
+    public List<Integer> getSelectedRows() {
+        ArrayList<Integer> ret = new ArrayList<Integer>();
+        for (int i=0; i < getSize(); i++) {
+            if (selectionModel.isSelectedIndex(i)) {
+                ret.add(i);
+            }
+        }
+        return ret;
+    }
+    
+    protected List<Integer> moveUp(List<Integer> rows, int targetRow) {
+        List<Integer> ret = new ArrayList<Integer>(rows.size());
+        int delta = rows.get(0) - targetRow;
+        for(int row: rows) {
+            OsmPrimitive via = vias.remove(row);
+            vias.add(row - delta, via);
+            ret.add(row - delta);
+        }
+        return ret;
+    }
+    
+    protected List<Integer>  moveDown(List<Integer> rows, int targetRow) {
+        List<Integer> ret = new ArrayList<Integer>(rows.size());
+        int delta = targetRow - rows.get(0);
+        for(int i = rows.size()-1; i >=0; i--) {
+            int row = rows.get(i);
+            OsmPrimitive via = vias.remove(row);
+            vias.add(row + delta, via);
+            ret.add(row + delta);
+        }
+        return ret;
+    }
+    
+    public void moveVias(List<Integer> selectedRows, int targetRow){
+        if (selectedRows == null) return;
+        if (selectedRows.size() == 1){
+            int sourceRow = selectedRows.get(0);
+            if (sourceRow == targetRow) return;
+            OsmPrimitive via = vias.remove(sourceRow);
+            vias.add(targetRow, via);
+            fireContentsChanged(this, 0, getSize());
+            selectionModel.setSelectionInterval(targetRow, targetRow);
+            return;
+        } 
+        int min = selectedRows.get(0);
+        int max = selectedRows.get(selectedRows.size()-1);
+        if (targetRow < min) {
+            selectedRows = moveUp(selectedRows, targetRow);
+        } else if (targetRow == min){
+            // do nothing
+        } else if (targetRow - min < getSize() - max){
+            int delta = Math.min(targetRow - min, getSize()-1 - max);
+            targetRow = min + delta;
+            if (targetRow > min) {
+                selectedRows = moveDown(selectedRows, targetRow);
+            }
+        } 
+        fireContentsChanged(this, 0, getSize());
+        selectionModel.clearSelection();
+        for(int row: selectedRows) {
+            selectionModel.addSelectionInterval(row, row);
+        }       
+    }
+    
+    /**
+     * Move the currently selected vias up by one position
+     */
+    public void moveUp() {
+        List<Integer> sel = getSelectedRows();
+        if (sel.isEmpty() || sel.get(0) == 0) return;
+        moveVias(sel, sel.get(0)-1);
+    }
+
+    /**
+     * Move the currently selected vias down by one position
+     */
+    public void moveDown() {
+        List<Integer> sel = getSelectedRows();
+        if (sel.isEmpty() || sel.get(sel.size()-1) == getSize()-1) return;
+        moveVias(sel, sel.get(sel.size()-1)+1);
+    }
+    
+    /**
+     * Inserts a list of OSM objects given by OSM primitive ids. 
+     * 
+     * @param idsToInsert the ids of the objects to insert
+     */
+    public void insertVias(List<PrimitiveId> idsToInsert) {
+        if (idsToInsert == null) return;
+        List<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>(idsToInsert.size());
+        DataSet ds = model.getLayer().data;
+        for(PrimitiveId id: idsToInsert){
+            OsmPrimitive p = ds.getPrimitiveById(id);
+            if (p == null){
+                System.out.println(tr("Failed to retrieve OSM object with id {0} from dataset {1}. Cannot add it as ''via''.", id, ds));
+                continue;
+            }
+            primitives.add(p);
+        }
+        int targetRow = Math.max(selectionModel.getMinSelectionIndex(),0);
+        List<OsmPrimitive> newVias = new ArrayList<OsmPrimitive>(vias);
+        newVias.addAll(targetRow, primitives);
+        model.setVias(newVias);
+        fireContentsChanged(this, 0, getSize());
+        selectionModel.clearSelection();
+        for(int i=targetRow; i< targetRow + primitives.size();i++) {
+            selectionModel.addSelectionInterval(i, i);
+        }           
+    }
+
+    /**
+     * Removes the currently selected vias
+     */
+    public void removeSelectedVias() {
+        ArrayList<OsmPrimitive> newVias = new ArrayList<OsmPrimitive>(vias);
+        int j = 0;
+        for(int i=0; i< getSize();i++){
+            if (!selectionModel.isSelectedIndex(i)) continue;
+            newVias.remove(i-j);
+            j++;
+        }
+        if (j == 0) return; // nothing selected, nothing deleted
+        model.setVias(newVias);
+    }
+    
+    /**
+     * Refreshes the list of 'vias' in this model with the current list of
+     * vias from the turn restriction model. 
+     */
+    protected void refresh() {
+        List<OsmPrimitive> sel = getSelectedVias();
+        vias.clear();
+        vias.addAll(model.getVias());       
+        fireContentsChanged(this, 0, getSize());
+        setSelectedVias(sel);
+    }
+
+    public Object getElementAt(int index) {
+        return vias.get(index);
+    }
+
+    public int getSize() {
+        return vias.size();
+    }
+    
+    /* ----------------------------------------------------------------------- */
+    /* interface PrimitiveIdListProvider                                       */
+    /* ----------------------------------------------------------------------- */
+    public List<PrimitiveId> getSelectedPrimitiveIds() {
+        ArrayList<PrimitiveId> ids = new ArrayList<PrimitiveId>();
+        for (OsmPrimitive p: getSelectedVias()) {
+            ids.add(p.getPrimitiveId());
+        }
+        return ids;
+    }
+
+    /* ----------------------------------------------------------------------- */
+    /* interface Observer                                                      */
+    /* ----------------------------------------------------------------------- */
+    public void update(Observable o, Object arg) {
+        refresh();
+    }   
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/AbstractTurnRestrictionsListView.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/AbstractTurnRestrictionsListView.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/AbstractTurnRestrictionsListView.java	(revision 23192)
@@ -15,26 +15,26 @@
  */
 abstract class AbstractTurnRestrictionsListView extends JPanel {
-	protected TurnRestrictionsListModel model;
-	protected JList lstTurnRestrictions;
-	
-	public TurnRestrictionsListModel getModel(){
-		return model;
-	}
-	
-	public JList getList() {
-		return lstTurnRestrictions;
-	}
-	
-	public void addListSelectionListener(ListSelectionListener listener) {
-		lstTurnRestrictions.addListSelectionListener(listener);
-	}
-	 
-	public void removeListSelectionListener(ListSelectionListener listener) {
-		lstTurnRestrictions.addListSelectionListener(listener);
-	}
-	
-	public void initIconSetFromPreferences(Preferences prefs){
-		TurnRestrictionCellRenderer renderer = (TurnRestrictionCellRenderer)lstTurnRestrictions.getCellRenderer();
-		renderer.initIconSetFromPreferences(prefs);
-	}
+    protected TurnRestrictionsListModel model;
+    protected JList lstTurnRestrictions;
+    
+    public TurnRestrictionsListModel getModel(){
+        return model;
+    }
+    
+    public JList getList() {
+        return lstTurnRestrictions;
+    }
+    
+    public void addListSelectionListener(ListSelectionListener listener) {
+        lstTurnRestrictions.addListSelectionListener(listener);
+    }
+     
+    public void removeListSelectionListener(ListSelectionListener listener) {
+        lstTurnRestrictions.addListSelectionListener(listener);
+    }
+    
+    public void initIconSetFromPreferences(Preferences prefs){
+        TurnRestrictionCellRenderer renderer = (TurnRestrictionCellRenderer)lstTurnRestrictions.getCellRenderer();
+        renderer.initIconSetFromPreferences(prefs);
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionCellRenderer.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionCellRenderer.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionCellRenderer.java	(revision 23192)
@@ -41,218 +41,218 @@
  */
 public class TurnRestrictionCellRenderer extends JPanel implements ListCellRenderer, TableCellRenderer{
-	static private final Logger logger = Logger.getLogger(TurnRestrictionCellRenderer.class.getName());
-	
-	/** the names of restriction types */
-	static private Set<String> RESTRICTION_TYPES = new HashSet<String>(
-			Arrays.asList(new String[] {
-					"no_left_turn",
-					"no_right_turn",
-					"no_straight_on",
-					"no_u_turn",
-					"only_left_turn",
-					"only_right_turn",
-					"only_straight_on"
-			})
-	);
-	
-	/** components used to render the turn restriction */
-	private JLabel icon;
-	private JLabel from;
-	private JLabel to;
-	private String iconSet = "set-a";
-	
-	public TurnRestrictionCellRenderer() {
-		build();
-	}
-
-	/**
-	 * Replies true if {@code restrictionType} is a valid restriction
-	 * type.
-	 * 
-	 * @param restrictionType the restriction type 
-	 * @return true if {@code restrictionType} is a valid restriction
-	 * type
-	 */
-	protected boolean isValidRestrictionType(String restrictionType) {
-		if (restrictionType == null) return false;
-		restrictionType = restrictionType.trim().toLowerCase();
-		return RESTRICTION_TYPES.contains(restrictionType);
-	}
-	
-	/**
-	 * Builds the icon name for a given restriction type 
-	 * 
-	 * @param restrictionType the restriction type 
-	 * @return the icon name 
-	 */
-	protected String buildImageName(String restrictionType) {
-		return "types/" + iconSet + "/" + restrictionType;
-	}
-	
-	/**
-	 * Replies the icon for a given restriction type 
-	 * @param restrictionType the restriction type 
-	 * @return the icon 
-	 */
-	protected ImageIcon getIcon(String restrictionType) {
-		if (!isValidRestrictionType(restrictionType)) {
-			return ImageProvider.get("types", "non-standard-type");
-		}
-		return ImageProvider.get(buildImageName(restrictionType));
-	}
- 	
-	/**
-	 * Builds the UI used to render turn restrictions 
-	 */
-	protected void build() {
-		setLayout(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		
-		// the turn restriction icon 		
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 0.0;
-		gc.gridheight = 2;
-		gc.anchor = GridBagConstraints.CENTER;
-		gc.insets = new Insets(0,0,2,2);
-		add(icon = new JLabel(), gc);
-		
-		
-		// the name of the way with role "from"
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.gridx = 1;
-		gc.gridheight = 1;
-		gc.weightx = 0.0;
-		add(new JMultilineLabel("<html><strong>" + trc("turnrestrictions","From:") + "</strong></html>"), gc);
-		
-		gc.gridx = 2;
-		gc.weightx = 1.0; 
-		add(from = new JLabel(), gc);
-		
-		// the name of the way with role "to"
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.gridx = 1;
-		gc.gridy = 1;
-		gc.weightx = 0.0;
-		add(new JMultilineLabel("<html><strong>" + trc("turnrestriction", "To:")  + "</strong></html>"), gc);
-		
-		gc.gridx = 2;
-		gc.weightx = 1.0;
-		add(to = new JLabel(), gc);
-	}
-
-	/**
-	 * Renders the icon for the turn restriction  
-	 * 
-	 * @param tr the turn restriction
-	 */
-	protected void renderIcon(Relation tr) {
-		String restrictionType = tr.get("restriction");
-		icon.setIcon(getIcon(restrictionType));
-	}
-
-	/**
-	 * Replies a way participating in this turn restriction in a given role
-	 * 
-	 * @param tr the turn restriction 
-	 * @param role the role (either "from" or "to")
-	 * @return the participating way; null, if no way is participating in this role
-	 */
-	private Way getParticipatingWay(Relation tr, String role){
-		for(RelationMember rm: tr.getMembers()){
-			if (rm.getRole().trim().toLowerCase().equals(role) && rm.getType().equals(OsmPrimitiveType.WAY)) {
-				return (Way)rm.getMember();
-			}
-		}
-		return null;
-	}
-	
-	protected void renderFrom(Relation tr) {
-		Way from = getParticipatingWay(tr, "from");
-		if (from == null) {
-			// FIXME: render as warning/error (red background?)
-			this.from.setText(tr("no participating way with role ''from''"));
-			return;
-		} 
-		this.from.setText(DefaultNameFormatter.getInstance().format(from));
-	}
-
-	protected void renderTo(Relation tr) {
-		Way to = getParticipatingWay(tr, "to");
-		if (to == null) {
-			// FIXME: render as warning/error (red background?)
-			this.to.setText(tr("no participating way with role ''to''"));
-			return;
-		} 
-		this.to.setText(DefaultNameFormatter.getInstance().format(to));
-	}
-
-	/**
-	 * Renders the foreground and background color depending on whether
-	 * the turn restriction is selected
-	 * 
-	 * @param isSelected true if the turn restriction is selected; false,
-	 * otherwise
-	 */
-	protected void renderColor(boolean isSelected) {
-		Color bg;
-		Color fg;
-		if (isSelected) {
-			bg = UIManager.getColor("List.selectionBackground");
-			fg = UIManager.getColor("List.selectionForeground");
-		} else {
-			bg = UIManager.getColor("background");
-			fg = UIManager.getColor("foreground");
-		}
-		setBackground(bg);
-		this.icon.setBackground(bg);
-		this.from.setBackground(bg);
-		this.to.setBackground(bg);
-		
-		setForeground(fg);
-		this.icon.setForeground(fg);
-		this.from.setForeground(fg);
-		this.to.setForeground(fg);
-	}
-
-	/**
-	 * Initializes the set of icons used from the preference key
-	 * {@see PreferenceKeys#ROAD_SIGNS}.
-	 * 
-	 * @param prefs the JOSM preferences 
-	 */
-	public void initIconSetFromPreferences(Preferences prefs){
-		
-		iconSet = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a");
-		iconSet = iconSet.trim().toLowerCase();
-		if (!iconSet.equals("set-a") && !iconSet.equals("set-b")) {
-			iconSet = "set-a";
-		}
-	}
-	
-	/* ---------------------------------------------------------------------------------- */
-	/* interface ListCellRenderer                                                         */
-	/* ---------------------------------------------------------------------------------- */
-	public Component getListCellRendererComponent(JList list, Object value,
-			int index, boolean isSelected, boolean cellHasFocus) {
-
-		renderColor(isSelected);
-		Relation tr = (Relation)value;
-		renderIcon(tr);
-		renderFrom(tr);
-		renderTo(tr);		
-		return this;
-	}
-
-	/* ---------------------------------------------------------------------------------- */
-	/* interface TableCellRenderer                                                        */
-	/* ---------------------------------------------------------------------------------- */
-	public Component getTableCellRendererComponent(JTable table, Object value,
-			boolean isSelected, boolean hasFocus, int row, int column) {
-		renderColor(isSelected);		
-		Relation tr = (Relation)value;
-		renderIcon(tr);
-		renderFrom(tr);
-		renderTo(tr);		
-		return this;
-	}	
+    static private final Logger logger = Logger.getLogger(TurnRestrictionCellRenderer.class.getName());
+    
+    /** the names of restriction types */
+    static private Set<String> RESTRICTION_TYPES = new HashSet<String>(
+            Arrays.asList(new String[] {
+                    "no_left_turn",
+                    "no_right_turn",
+                    "no_straight_on",
+                    "no_u_turn",
+                    "only_left_turn",
+                    "only_right_turn",
+                    "only_straight_on"
+            })
+    );
+    
+    /** components used to render the turn restriction */
+    private JLabel icon;
+    private JLabel from;
+    private JLabel to;
+    private String iconSet = "set-a";
+    
+    public TurnRestrictionCellRenderer() {
+        build();
+    }
+
+    /**
+     * Replies true if {@code restrictionType} is a valid restriction
+     * type.
+     * 
+     * @param restrictionType the restriction type 
+     * @return true if {@code restrictionType} is a valid restriction
+     * type
+     */
+    protected boolean isValidRestrictionType(String restrictionType) {
+        if (restrictionType == null) return false;
+        restrictionType = restrictionType.trim().toLowerCase();
+        return RESTRICTION_TYPES.contains(restrictionType);
+    }
+    
+    /**
+     * Builds the icon name for a given restriction type 
+     * 
+     * @param restrictionType the restriction type 
+     * @return the icon name 
+     */
+    protected String buildImageName(String restrictionType) {
+        return "types/" + iconSet + "/" + restrictionType;
+    }
+    
+    /**
+     * Replies the icon for a given restriction type 
+     * @param restrictionType the restriction type 
+     * @return the icon 
+     */
+    protected ImageIcon getIcon(String restrictionType) {
+        if (!isValidRestrictionType(restrictionType)) {
+            return ImageProvider.get("types", "non-standard-type");
+        }
+        return ImageProvider.get(buildImageName(restrictionType));
+    }
+    
+    /**
+     * Builds the UI used to render turn restrictions 
+     */
+    protected void build() {
+        setLayout(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        
+        // the turn restriction icon        
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 0.0;
+        gc.gridheight = 2;
+        gc.anchor = GridBagConstraints.CENTER;
+        gc.insets = new Insets(0,0,2,2);
+        add(icon = new JLabel(), gc);
+        
+        
+        // the name of the way with role "from"
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.gridx = 1;
+        gc.gridheight = 1;
+        gc.weightx = 0.0;
+        add(new JMultilineLabel("<html><strong>" + trc("turnrestrictions","From:") + "</strong></html>"), gc);
+        
+        gc.gridx = 2;
+        gc.weightx = 1.0; 
+        add(from = new JLabel(), gc);
+        
+        // the name of the way with role "to"
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.gridx = 1;
+        gc.gridy = 1;
+        gc.weightx = 0.0;
+        add(new JMultilineLabel("<html><strong>" + trc("turnrestriction", "To:")  + "</strong></html>"), gc);
+        
+        gc.gridx = 2;
+        gc.weightx = 1.0;
+        add(to = new JLabel(), gc);
+    }
+
+    /**
+     * Renders the icon for the turn restriction  
+     * 
+     * @param tr the turn restriction
+     */
+    protected void renderIcon(Relation tr) {
+        String restrictionType = tr.get("restriction");
+        icon.setIcon(getIcon(restrictionType));
+    }
+
+    /**
+     * Replies a way participating in this turn restriction in a given role
+     * 
+     * @param tr the turn restriction 
+     * @param role the role (either "from" or "to")
+     * @return the participating way; null, if no way is participating in this role
+     */
+    private Way getParticipatingWay(Relation tr, String role){
+        for(RelationMember rm: tr.getMembers()){
+            if (rm.getRole().trim().toLowerCase().equals(role) && rm.getType().equals(OsmPrimitiveType.WAY)) {
+                return (Way)rm.getMember();
+            }
+        }
+        return null;
+    }
+    
+    protected void renderFrom(Relation tr) {
+        Way from = getParticipatingWay(tr, "from");
+        if (from == null) {
+            // FIXME: render as warning/error (red background?)
+            this.from.setText(tr("no participating way with role ''from''"));
+            return;
+        } 
+        this.from.setText(DefaultNameFormatter.getInstance().format(from));
+    }
+
+    protected void renderTo(Relation tr) {
+        Way to = getParticipatingWay(tr, "to");
+        if (to == null) {
+            // FIXME: render as warning/error (red background?)
+            this.to.setText(tr("no participating way with role ''to''"));
+            return;
+        } 
+        this.to.setText(DefaultNameFormatter.getInstance().format(to));
+    }
+
+    /**
+     * Renders the foreground and background color depending on whether
+     * the turn restriction is selected
+     * 
+     * @param isSelected true if the turn restriction is selected; false,
+     * otherwise
+     */
+    protected void renderColor(boolean isSelected) {
+        Color bg;
+        Color fg;
+        if (isSelected) {
+            bg = UIManager.getColor("List.selectionBackground");
+            fg = UIManager.getColor("List.selectionForeground");
+        } else {
+            bg = UIManager.getColor("background");
+            fg = UIManager.getColor("foreground");
+        }
+        setBackground(bg);
+        this.icon.setBackground(bg);
+        this.from.setBackground(bg);
+        this.to.setBackground(bg);
+        
+        setForeground(fg);
+        this.icon.setForeground(fg);
+        this.from.setForeground(fg);
+        this.to.setForeground(fg);
+    }
+
+    /**
+     * Initializes the set of icons used from the preference key
+     * {@see PreferenceKeys#ROAD_SIGNS}.
+     * 
+     * @param prefs the JOSM preferences 
+     */
+    public void initIconSetFromPreferences(Preferences prefs){
+        
+        iconSet = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a");
+        iconSet = iconSet.trim().toLowerCase();
+        if (!iconSet.equals("set-a") && !iconSet.equals("set-b")) {
+            iconSet = "set-a";
+        }
+    }
+    
+    /* ---------------------------------------------------------------------------------- */
+    /* interface ListCellRenderer                                                         */
+    /* ---------------------------------------------------------------------------------- */
+    public Component getListCellRendererComponent(JList list, Object value,
+            int index, boolean isSelected, boolean cellHasFocus) {
+
+        renderColor(isSelected);
+        Relation tr = (Relation)value;
+        renderIcon(tr);
+        renderFrom(tr);
+        renderTo(tr);       
+        return this;
+    }
+
+    /* ---------------------------------------------------------------------------------- */
+    /* interface TableCellRenderer                                                        */
+    /* ---------------------------------------------------------------------------------- */
+    public Component getTableCellRendererComponent(JTable table, Object value,
+            boolean isSelected, boolean hasFocus, int row, int column) {
+        renderColor(isSelected);        
+        Relation tr = (Relation)value;
+        renderIcon(tr);
+        renderFrom(tr);
+        renderTo(tr);       
+        return this;
+    }   
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetListModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetListModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetListModel.java	(revision 23192)
@@ -34,99 +34,99 @@
  */
 public class TurnRestrictionsInDatasetListModel extends TurnRestrictionsListModel implements EditLayerChangeListener, DataSetListener {
-	private static final Logger logger = Logger.getLogger(TurnRestrictionsInDatasetListModel.class.getName());
-	
-	public TurnRestrictionsInDatasetListModel(
-			DefaultListSelectionModel selectionModel) {
-		super(selectionModel);
-	}
-	
-	/**
-	 * Filters the list of turn restrictions from a collection of OSM primitives.
-	 * 
-	 * @param primitives the primitives 
-	 * @return the list of turn restrictions 
-	 */
-	protected List<Relation> filterTurnRestrictions(Collection<? extends OsmPrimitive> primitives) {
-		List<Relation> ret = new LinkedList<Relation>();
-		if (primitives == null) return ret;
-		for(OsmPrimitive p: primitives){
-			if (!isTurnRestriction(p)) continue;
-			ret.add((Relation)p);
-		}
-		return ret;
-	}
-	
-	/* --------------------------------------------------------------------------- */
-	/* interface EditLayerChangeListener                                           */
-	/* --------------------------------------------------------------------------- */
-	public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) {
-		if (newLayer == null) {
-			setTurnRestrictions(null);
-			return;
-		}
-		List<Relation> turnRestrictions = new LinkedList<Relation>();
-		for (Relation r: newLayer.data.getRelations()) {
-			if (isValid(r) && isTurnRestriction(r)) {
-				turnRestrictions.add(r);
-			}
-		}
-		setTurnRestrictions(turnRestrictions);
-	}
-	
-	/* --------------------------------------------------------------------------- */
-	/* interface DataSetListener                                                   */
-	/* --------------------------------------------------------------------------- */	
-	public void dataChanged(DataChangedEvent event) {		
-		OsmDataLayer layer = Main.map.mapView.getEditLayer();
-		if (layer == null) {
-			setTurnRestrictions(null);
-		} else {
-			List<Relation> turnRestrictions = filterTurnRestrictions(layer.data.getRelations());
-			setTurnRestrictions(turnRestrictions);
-		}
-	}
+    private static final Logger logger = Logger.getLogger(TurnRestrictionsInDatasetListModel.class.getName());
+    
+    public TurnRestrictionsInDatasetListModel(
+            DefaultListSelectionModel selectionModel) {
+        super(selectionModel);
+    }
+    
+    /**
+     * Filters the list of turn restrictions from a collection of OSM primitives.
+     * 
+     * @param primitives the primitives 
+     * @return the list of turn restrictions 
+     */
+    protected List<Relation> filterTurnRestrictions(Collection<? extends OsmPrimitive> primitives) {
+        List<Relation> ret = new LinkedList<Relation>();
+        if (primitives == null) return ret;
+        for(OsmPrimitive p: primitives){
+            if (!isTurnRestriction(p)) continue;
+            ret.add((Relation)p);
+        }
+        return ret;
+    }
+    
+    /* --------------------------------------------------------------------------- */
+    /* interface EditLayerChangeListener                                           */
+    /* --------------------------------------------------------------------------- */
+    public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) {
+        if (newLayer == null) {
+            setTurnRestrictions(null);
+            return;
+        }
+        List<Relation> turnRestrictions = new LinkedList<Relation>();
+        for (Relation r: newLayer.data.getRelations()) {
+            if (isValid(r) && isTurnRestriction(r)) {
+                turnRestrictions.add(r);
+            }
+        }
+        setTurnRestrictions(turnRestrictions);
+    }
+    
+    /* --------------------------------------------------------------------------- */
+    /* interface DataSetListener                                                   */
+    /* --------------------------------------------------------------------------- */   
+    public void dataChanged(DataChangedEvent event) {       
+        OsmDataLayer layer = Main.map.mapView.getEditLayer();
+        if (layer == null) {
+            setTurnRestrictions(null);
+        } else {
+            List<Relation> turnRestrictions = filterTurnRestrictions(layer.data.getRelations());
+            setTurnRestrictions(turnRestrictions);
+        }
+    }
 
-	public void primtivesAdded(PrimitivesAddedEvent event) {
-		List<Relation> turnRestrictions = filterTurnRestrictions(event.getPrimitives());
-		if (!turnRestrictions.isEmpty()) {
-			addTurnRestrictions(turnRestrictions);
-		}
-	}
+    public void primtivesAdded(PrimitivesAddedEvent event) {
+        List<Relation> turnRestrictions = filterTurnRestrictions(event.getPrimitives());
+        if (!turnRestrictions.isEmpty()) {
+            addTurnRestrictions(turnRestrictions);
+        }
+    }
 
-	public void primtivesRemoved(PrimitivesRemovedEvent event) {
-		List<Relation> turnRestrictions = filterTurnRestrictions(event.getPrimitives());
-		if (!turnRestrictions.isEmpty()) {
-			removeTurnRestrictions(turnRestrictions);
-		}
-	}
+    public void primtivesRemoved(PrimitivesRemovedEvent event) {
+        List<Relation> turnRestrictions = filterTurnRestrictions(event.getPrimitives());
+        if (!turnRestrictions.isEmpty()) {
+            removeTurnRestrictions(turnRestrictions);
+        }
+    }
 
-	public void relationMembersChanged(RelationMembersChangedEvent event) {
-		List<Relation> turnRestrictions = filterTurnRestrictions(event.getPrimitives());
-		if (!turnRestrictions.isEmpty()) {
-			List<Relation> sel = getSelectedTurnRestrictions();
-			for(Relation tr: turnRestrictions) {	
-				// enforce a repaint of the respective turn restriction
-				int idx = getTurnRestrictionIndex(tr);
-				fireContentsChanged(this, idx,idx);
-			}
-			setSelectedTurnRestrictions(sel);
-		}
-	}
+    public void relationMembersChanged(RelationMembersChangedEvent event) {
+        List<Relation> turnRestrictions = filterTurnRestrictions(event.getPrimitives());
+        if (!turnRestrictions.isEmpty()) {
+            List<Relation> sel = getSelectedTurnRestrictions();
+            for(Relation tr: turnRestrictions) {    
+                // enforce a repaint of the respective turn restriction
+                int idx = getTurnRestrictionIndex(tr);
+                fireContentsChanged(this, idx,idx);
+            }
+            setSelectedTurnRestrictions(sel);
+        }
+    }
 
-	public void tagsChanged(TagsChangedEvent event) {
-		List<Relation> turnRestrictions = filterTurnRestrictions(event.getPrimitives());
-		if (!turnRestrictions.isEmpty()) {
-			List<Relation> sel = getSelectedTurnRestrictions();
-			for(Relation tr: turnRestrictions) {	
-				// enforce a repaint of the respective turn restriction
-				int idx = getTurnRestrictionIndex(tr);
-				fireContentsChanged(this, idx,idx);
-			}
-			setSelectedTurnRestrictions(sel);
-		}		
-	}
+    public void tagsChanged(TagsChangedEvent event) {
+        List<Relation> turnRestrictions = filterTurnRestrictions(event.getPrimitives());
+        if (!turnRestrictions.isEmpty()) {
+            List<Relation> sel = getSelectedTurnRestrictions();
+            for(Relation tr: turnRestrictions) {    
+                // enforce a repaint of the respective turn restriction
+                int idx = getTurnRestrictionIndex(tr);
+                fireContentsChanged(this, idx,idx);
+            }
+            setSelectedTurnRestrictions(sel);
+        }       
+    }
 
-	public void wayNodesChanged(WayNodesChangedEvent event) {/* ignore */}
-	public void nodeMoved(NodeMovedEvent event) {/* ignore */}
-	public void otherDatasetChange(AbstractDatasetChangedEvent event) {/* ignore */}
+    public void wayNodesChanged(WayNodesChangedEvent event) {/* ignore */}
+    public void nodeMoved(NodeMovedEvent event) {/* ignore */}
+    public void otherDatasetChange(AbstractDatasetChangedEvent event) {/* ignore */}
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetView.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetView.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInDatasetView.java	(revision 23192)
@@ -18,32 +18,32 @@
  * This is the view for the list of turn restrictions in the current data set.
  */
-public class TurnRestrictionsInDatasetView extends AbstractTurnRestrictionsListView{	
-	protected void build() {
-		DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
-		model = new TurnRestrictionsInDatasetListModel(selectionModel);
-		lstTurnRestrictions = new JList(model);
-		lstTurnRestrictions.setSelectionModel(selectionModel);
-		lstTurnRestrictions.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-		lstTurnRestrictions.setCellRenderer(new TurnRestrictionCellRenderer());
-		
-		setLayout(new BorderLayout());
-		add(new JScrollPane(lstTurnRestrictions), BorderLayout.CENTER);
-	}
+public class TurnRestrictionsInDatasetView extends AbstractTurnRestrictionsListView{    
+    protected void build() {
+        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
+        model = new TurnRestrictionsInDatasetListModel(selectionModel);
+        lstTurnRestrictions = new JList(model);
+        lstTurnRestrictions.setSelectionModel(selectionModel);
+        lstTurnRestrictions.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+        lstTurnRestrictions.setCellRenderer(new TurnRestrictionCellRenderer());
+        
+        setLayout(new BorderLayout());
+        add(new JScrollPane(lstTurnRestrictions), BorderLayout.CENTER);
+    }
 
-	protected void registerAsListener() {
-		MapView.addEditLayerChangeListener((EditLayerChangeListener)model);
-		DatasetEventManager.getInstance().addDatasetListener((DataSetListener)model, FireMode.IN_EDT);
-		if (Main.main.getEditLayer() != null) {
-			model.setTurnRestrictions(Main.main.getEditLayer().data.getRelations());
-		}
-	}
+    protected void registerAsListener() {
+        MapView.addEditLayerChangeListener((EditLayerChangeListener)model);
+        DatasetEventManager.getInstance().addDatasetListener((DataSetListener)model, FireMode.IN_EDT);
+        if (Main.main.getEditLayer() != null) {
+            model.setTurnRestrictions(Main.main.getEditLayer().data.getRelations());
+        }
+    }
 
-	protected void unregisterAsListener() {
-		MapView.removeEditLayerChangeListener((EditLayerChangeListener)model);
-		DatasetEventManager.getInstance().removeDatasetListener((DataSetListener)model);
-	}
+    protected void unregisterAsListener() {
+        MapView.removeEditLayerChangeListener((EditLayerChangeListener)model);
+        DatasetEventManager.getInstance().removeDatasetListener((DataSetListener)model);
+    }
 
-	public TurnRestrictionsInDatasetView() {
-		build();
-	}
+    public TurnRestrictionsInDatasetView() {
+        build();
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionListModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionListModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionListModel.java	(revision 23192)
@@ -19,45 +19,45 @@
  */
 public class TurnRestrictionsInSelectionListModel extends TurnRestrictionsListModel implements EditLayerChangeListener, SelectionChangedListener {
-	private static final Logger logger = Logger.getLogger(TurnRestrictionsInSelectionListModel.class.getName());
-	
-	public TurnRestrictionsInSelectionListModel(
-			DefaultListSelectionModel selectionModel) {
-		super(selectionModel);
-	}
-	
-	/**
-	 * Initializes the model with the turn restrictions the primitives in 
-	 * {@code selection} participate.
-	 * 
-	 * @param selection the collection of selected primitives
-	 */
-	public void initFromSelection(Collection<? extends OsmPrimitive> selection) {
-		Set<Relation> turnRestrictions = new HashSet<Relation>();
-		if (selection == null) return;
-		for (OsmPrimitive p: selection) {
-			for (OsmPrimitive parent: p.getReferrers()) {
-				if (isTurnRestriction(parent))
-					turnRestrictions.add((Relation)parent);
-			}
-		}
-		setTurnRestrictions(turnRestrictions);
-	}
+    private static final Logger logger = Logger.getLogger(TurnRestrictionsInSelectionListModel.class.getName());
+    
+    public TurnRestrictionsInSelectionListModel(
+            DefaultListSelectionModel selectionModel) {
+        super(selectionModel);
+    }
+    
+    /**
+     * Initializes the model with the turn restrictions the primitives in 
+     * {@code selection} participate.
+     * 
+     * @param selection the collection of selected primitives
+     */
+    public void initFromSelection(Collection<? extends OsmPrimitive> selection) {
+        Set<Relation> turnRestrictions = new HashSet<Relation>();
+        if (selection == null) return;
+        for (OsmPrimitive p: selection) {
+            for (OsmPrimitive parent: p.getReferrers()) {
+                if (isTurnRestriction(parent))
+                    turnRestrictions.add((Relation)parent);
+            }
+        }
+        setTurnRestrictions(turnRestrictions);
+    }
 
-	/* --------------------------------------------------------------------------- */
-	/* interface EditLayerChangeListener                                           */
-	/* --------------------------------------------------------------------------- */
-	public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) {
-		if (newLayer == null) {
-			setTurnRestrictions(null);
-			return;
-		}
-		initFromSelection(newLayer.data.getSelected());
-	}
-	
-	/* --------------------------------------------------------------------------- */
-	/* interface SelectionChangedListener                                          */
-	/* --------------------------------------------------------------------------- */	
-	public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-		initFromSelection(newSelection);
-	}
+    /* --------------------------------------------------------------------------- */
+    /* interface EditLayerChangeListener                                           */
+    /* --------------------------------------------------------------------------- */
+    public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) {
+        if (newLayer == null) {
+            setTurnRestrictions(null);
+            return;
+        }
+        initFromSelection(newLayer.data.getSelected());
+    }
+    
+    /* --------------------------------------------------------------------------- */
+    /* interface SelectionChangedListener                                          */
+    /* --------------------------------------------------------------------------- */   
+    public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
+        initFromSelection(newSelection);
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionView.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionView.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsInSelectionView.java	(revision 23192)
@@ -24,34 +24,34 @@
 public class TurnRestrictionsInSelectionView extends AbstractTurnRestrictionsListView {
 
-	protected void build() {
-		DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
-		model = new TurnRestrictionsInSelectionListModel(selectionModel);
-		lstTurnRestrictions = new JList(model);
-		lstTurnRestrictions.setSelectionModel(selectionModel);
-		lstTurnRestrictions.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-		lstTurnRestrictions.setCellRenderer(new TurnRestrictionCellRenderer());
-		
-		setLayout(new BorderLayout());
-		add(new JScrollPane(lstTurnRestrictions), BorderLayout.CENTER);
-	}
+    protected void build() {
+        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
+        model = new TurnRestrictionsInSelectionListModel(selectionModel);
+        lstTurnRestrictions = new JList(model);
+        lstTurnRestrictions.setSelectionModel(selectionModel);
+        lstTurnRestrictions.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+        lstTurnRestrictions.setCellRenderer(new TurnRestrictionCellRenderer());
+        
+        setLayout(new BorderLayout());
+        add(new JScrollPane(lstTurnRestrictions), BorderLayout.CENTER);
+    }
 
-	protected void registerAsListener() {
-		MapView.addEditLayerChangeListener((EditLayerChangeListener)model);
-		SelectionEventManager.getInstance().addSelectionListener((SelectionChangedListener)model, FireMode.IN_EDT_CONSOLIDATED);
-		TurnRestrictionsInSelectionListModel m = (TurnRestrictionsInSelectionListModel)model;
-		if (Main.main.getEditLayer() != null){
-			m.initFromSelection(Main.main.getEditLayer().data.getSelected());
-		} else {
-			m.initFromSelection(Collections.<OsmPrimitive>emptyList());
-		}
-	}
+    protected void registerAsListener() {
+        MapView.addEditLayerChangeListener((EditLayerChangeListener)model);
+        SelectionEventManager.getInstance().addSelectionListener((SelectionChangedListener)model, FireMode.IN_EDT_CONSOLIDATED);
+        TurnRestrictionsInSelectionListModel m = (TurnRestrictionsInSelectionListModel)model;
+        if (Main.main.getEditLayer() != null){
+            m.initFromSelection(Main.main.getEditLayer().data.getSelected());
+        } else {
+            m.initFromSelection(Collections.<OsmPrimitive>emptyList());
+        }
+    }
 
-	protected void unregisterAsListener() {
-		MapView.removeEditLayerChangeListener((EditLayerChangeListener)model);
-		SelectionEventManager.getInstance().removeSelectionListener((SelectionChangedListener)model);		
-	}
+    protected void unregisterAsListener() {
+        MapView.removeEditLayerChangeListener((EditLayerChangeListener)model);
+        SelectionEventManager.getInstance().removeSelectionListener((SelectionChangedListener)model);       
+    }
 
-	public TurnRestrictionsInSelectionView() {
-		build();
-	}
+    public TurnRestrictionsInSelectionView() {
+        build();
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java	(revision 23192)
@@ -52,162 +52,162 @@
  */
 public class TurnRestrictionsListDialog extends ToggleDialog{
-	private static final Logger logger = Logger.getLogger(TurnRestrictionsListDialog.class.getName());
-
-	/** checkbox for switching between the two list views */
-	private JCheckBox cbInSelectionOnly;
-	/** the view for the turn restrictions in the current data set */
-	private TurnRestrictionsInDatasetView pnlTurnRestrictionsInDataSet;
-	/** the view for the turn restrictions related to the current selection */
-	private TurnRestrictionsInSelectionView pnlTurnRestrictionsInSelection;
-	
-	/** three actions */
-	private NewAction actNew;
-	private EditAction actEdit;
-	private DeleteAction actDelete;	 
-	private SelectSelectedTurnRestrictions actSelectSelectedTurnRestrictions;
-	private ZoomToAction actZoomTo;
-	private SwitchListViewHandler switchListViewHandler;
-	
-	private AbstractTurnRestrictionsListView currentListView = null;
-	
-	/** the main content panel in this toggle dialog */
-	private JPanel pnlContent;
-	private PreferenceChangeHandler preferenceChangeHandler;
-	
-	@Override
-	public void showNotify() {
-		pnlTurnRestrictionsInDataSet.registerAsListener();		
-		pnlTurnRestrictionsInSelection.registerAsListener();
-		MapView.addEditLayerChangeListener(actNew);
-		actNew.updateEnabledState();
-		Main.pref.addPreferenceChangeListener(preferenceChangeHandler);
-		preferenceChangeHandler.refreshIconSet();
-	}
-
-	@Override
-	public void hideNotify() {
-		pnlTurnRestrictionsInDataSet.unregisterAsListener();
-		pnlTurnRestrictionsInSelection.unregisterAsListener();
-		MapView.removeEditLayerChangeListener(actNew);
-		Main.pref.removePreferenceChangeListener(preferenceChangeHandler);
-	}
-
-	/**
-	 * Builds the panel with the checkbox for switching between the two
-	 * list views
-	 * 
-	 * @return the panel
-	 */
-	protected JPanel buildInSelectionOnlyTogglePanel(){
-		JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0));
-		pnl.setBorder(null);
-		pnl.add(cbInSelectionOnly = new JCheckBox(tr("Only participating in selection")));
-		cbInSelectionOnly.setToolTipText(tr(
-		   "<html>Select to display turn restrictions related to object in the current selection only.<br>"
-		 + "Deselect to display all turn restrictions in the current data set.</html>"));
-		return pnl;
-	}
-	
-	/**
-	 * Builds the panel with the action buttons 
-	 * 
-	 * @return the panel 
-	 */
-	protected JPanel buildCommandPanel() {
-		JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0));
-		pnl.setBorder(null);
-		pnl.add(new SideButton(actNew = new NewAction(), false /* don't show the name */));
-		pnl.add(new SideButton(actEdit = new EditAction(), false /* don't show the name */));
-		pnl.add(new SideButton(actDelete = new DeleteAction(), false /* don't show the name */));
-		
-		actSelectSelectedTurnRestrictions = new SelectSelectedTurnRestrictions();
-		actZoomTo = new ZoomToAction();
-		return pnl;
-	}
-	
-	/**
-	 * Builds the UI
-	 */
-	protected void build() {
-		pnlContent = new JPanel(new BorderLayout(0,0));
-		pnlContent.setBorder(null);
-		pnlContent.add(buildInSelectionOnlyTogglePanel(),  BorderLayout.NORTH);
-		pnlContent.add(buildCommandPanel(), BorderLayout.SOUTH);
-		
-		add(pnlContent, BorderLayout.CENTER);
-		
-		// create the two list views 
-		pnlTurnRestrictionsInDataSet = new TurnRestrictionsInDatasetView();
-		pnlTurnRestrictionsInSelection = new TurnRestrictionsInSelectionView();
-		
-		// wire the handler for switching between list views 
-		switchListViewHandler = new SwitchListViewHandler();
-		switchListViewHandler.activateListView(pnlTurnRestrictionsInDataSet);
-		cbInSelectionOnly.addItemListener(switchListViewHandler);
-		
-		// wire the popup menu launcher to the two turn restriction lists  
-		TurnRestrictionsPopupLauncher launcher = new TurnRestrictionsPopupLauncher();
-		pnlTurnRestrictionsInDataSet.getList().addMouseListener(launcher);
-		pnlTurnRestrictionsInSelection.getList().addMouseListener(launcher);
-		
-		preferenceChangeHandler = new PreferenceChangeHandler();
-		
-	}
-	
-	/**
-	 * Constructor
-	 */
-	public TurnRestrictionsListDialog() {
-		super(
-				tr("Turn Restrictions"), 
-				"turnrestrictions",
-				tr("Display and manage turn restrictions in the current data set"),
-				null, // no shortcut
-				150   // default height
-		);
-		build();
-		HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#TurnRestrictionToggleDialog"));
-	}	
-	
-	/**
-	 * Switches between the two list view.
-	 */
-	class SwitchListViewHandler implements ItemListener {
-		public void activateListView(AbstractTurnRestrictionsListView view) {
-			if (currentListView != null) {
-				currentListView.removeListSelectionListener(actEdit);
-				currentListView.removeListSelectionListener(actDelete);
-				currentListView.removeListSelectionListener(actSelectSelectedTurnRestrictions);
-				currentListView.removeListSelectionListener(actZoomTo);
-				pnlContent.remove(currentListView);
-			}
-			pnlContent.add(view,BorderLayout.CENTER);
-			currentListView = view;						
-			view.addListSelectionListener(actEdit);
-			view.addListSelectionListener(actDelete);
-			view.addListSelectionListener(actSelectSelectedTurnRestrictions);
-			view.addListSelectionListener(actZoomTo);
-			actEdit.updateEnabledState();
-			actDelete.updateEnabledState();
-			actSelectSelectedTurnRestrictions.updateEnabledState();
-			actZoomTo.updateEnabledState();
-			currentListView.revalidate();
-			currentListView.repaint();			
-		}
-
-		public void itemStateChanged(ItemEvent e) {
-			switch(e.getStateChange()) {
-			case ItemEvent.SELECTED:
-				activateListView(pnlTurnRestrictionsInSelection);
-				break;
-				
-			case ItemEvent.DESELECTED:		
-				activateListView(pnlTurnRestrictionsInDataSet);
-				break;
-			}
-		}
-	}
-	
-	 /**
+    private static final Logger logger = Logger.getLogger(TurnRestrictionsListDialog.class.getName());
+
+    /** checkbox for switching between the two list views */
+    private JCheckBox cbInSelectionOnly;
+    /** the view for the turn restrictions in the current data set */
+    private TurnRestrictionsInDatasetView pnlTurnRestrictionsInDataSet;
+    /** the view for the turn restrictions related to the current selection */
+    private TurnRestrictionsInSelectionView pnlTurnRestrictionsInSelection;
+    
+    /** three actions */
+    private NewAction actNew;
+    private EditAction actEdit;
+    private DeleteAction actDelete;  
+    private SelectSelectedTurnRestrictions actSelectSelectedTurnRestrictions;
+    private ZoomToAction actZoomTo;
+    private SwitchListViewHandler switchListViewHandler;
+    
+    private AbstractTurnRestrictionsListView currentListView = null;
+    
+    /** the main content panel in this toggle dialog */
+    private JPanel pnlContent;
+    private PreferenceChangeHandler preferenceChangeHandler;
+    
+    @Override
+    public void showNotify() {
+        pnlTurnRestrictionsInDataSet.registerAsListener();      
+        pnlTurnRestrictionsInSelection.registerAsListener();
+        MapView.addEditLayerChangeListener(actNew);
+        actNew.updateEnabledState();
+        Main.pref.addPreferenceChangeListener(preferenceChangeHandler);
+        preferenceChangeHandler.refreshIconSet();
+    }
+
+    @Override
+    public void hideNotify() {
+        pnlTurnRestrictionsInDataSet.unregisterAsListener();
+        pnlTurnRestrictionsInSelection.unregisterAsListener();
+        MapView.removeEditLayerChangeListener(actNew);
+        Main.pref.removePreferenceChangeListener(preferenceChangeHandler);
+    }
+
+    /**
+     * Builds the panel with the checkbox for switching between the two
+     * list views
+     * 
+     * @return the panel
+     */
+    protected JPanel buildInSelectionOnlyTogglePanel(){
+        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0));
+        pnl.setBorder(null);
+        pnl.add(cbInSelectionOnly = new JCheckBox(tr("Only participating in selection")));
+        cbInSelectionOnly.setToolTipText(tr(
+           "<html>Select to display turn restrictions related to object in the current selection only.<br>"
+         + "Deselect to display all turn restrictions in the current data set.</html>"));
+        return pnl;
+    }
+    
+    /**
+     * Builds the panel with the action buttons 
+     * 
+     * @return the panel 
+     */
+    protected JPanel buildCommandPanel() {
+        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0));
+        pnl.setBorder(null);
+        pnl.add(new SideButton(actNew = new NewAction(), false /* don't show the name */));
+        pnl.add(new SideButton(actEdit = new EditAction(), false /* don't show the name */));
+        pnl.add(new SideButton(actDelete = new DeleteAction(), false /* don't show the name */));
+        
+        actSelectSelectedTurnRestrictions = new SelectSelectedTurnRestrictions();
+        actZoomTo = new ZoomToAction();
+        return pnl;
+    }
+    
+    /**
+     * Builds the UI
+     */
+    protected void build() {
+        pnlContent = new JPanel(new BorderLayout(0,0));
+        pnlContent.setBorder(null);
+        pnlContent.add(buildInSelectionOnlyTogglePanel(),  BorderLayout.NORTH);
+        pnlContent.add(buildCommandPanel(), BorderLayout.SOUTH);
+        
+        add(pnlContent, BorderLayout.CENTER);
+        
+        // create the two list views 
+        pnlTurnRestrictionsInDataSet = new TurnRestrictionsInDatasetView();
+        pnlTurnRestrictionsInSelection = new TurnRestrictionsInSelectionView();
+        
+        // wire the handler for switching between list views 
+        switchListViewHandler = new SwitchListViewHandler();
+        switchListViewHandler.activateListView(pnlTurnRestrictionsInDataSet);
+        cbInSelectionOnly.addItemListener(switchListViewHandler);
+        
+        // wire the popup menu launcher to the two turn restriction lists  
+        TurnRestrictionsPopupLauncher launcher = new TurnRestrictionsPopupLauncher();
+        pnlTurnRestrictionsInDataSet.getList().addMouseListener(launcher);
+        pnlTurnRestrictionsInSelection.getList().addMouseListener(launcher);
+        
+        preferenceChangeHandler = new PreferenceChangeHandler();
+        
+    }
+    
+    /**
+     * Constructor
+     */
+    public TurnRestrictionsListDialog() {
+        super(
+                tr("Turn Restrictions"), 
+                "turnrestrictions",
+                tr("Display and manage turn restrictions in the current data set"),
+                null, // no shortcut
+                150   // default height
+        );
+        build();
+        HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#TurnRestrictionToggleDialog"));
+    }   
+    
+    /**
+     * Switches between the two list view.
+     */
+    class SwitchListViewHandler implements ItemListener {
+        public void activateListView(AbstractTurnRestrictionsListView view) {
+            if (currentListView != null) {
+                currentListView.removeListSelectionListener(actEdit);
+                currentListView.removeListSelectionListener(actDelete);
+                currentListView.removeListSelectionListener(actSelectSelectedTurnRestrictions);
+                currentListView.removeListSelectionListener(actZoomTo);
+                pnlContent.remove(currentListView);
+            }
+            pnlContent.add(view,BorderLayout.CENTER);
+            currentListView = view;                     
+            view.addListSelectionListener(actEdit);
+            view.addListSelectionListener(actDelete);
+            view.addListSelectionListener(actSelectSelectedTurnRestrictions);
+            view.addListSelectionListener(actZoomTo);
+            actEdit.updateEnabledState();
+            actDelete.updateEnabledState();
+            actSelectSelectedTurnRestrictions.updateEnabledState();
+            actZoomTo.updateEnabledState();
+            currentListView.revalidate();
+            currentListView.repaint();          
+        }
+
+        public void itemStateChanged(ItemEvent e) {
+            switch(e.getStateChange()) {
+            case ItemEvent.SELECTED:
+                activateListView(pnlTurnRestrictionsInSelection);
+                break;
+                
+            case ItemEvent.DESELECTED:      
+                activateListView(pnlTurnRestrictionsInDataSet);
+                break;
+            }
+        }
+    }
+    
+     /**
      * The edit action
      *
@@ -231,21 +231,21 @@
         }
 
-		public void launchEditor(Relation toEdit) {
-			if (toEdit == null)
-				return;
-			OsmDataLayer layer = Main.main.getEditLayer();
-			TurnRestrictionEditorManager manager = TurnRestrictionEditorManager.getInstance();
-			TurnRestrictionEditor editor = manager.getEditorForRelation(layer, toEdit);
-			if (editor != null) {
-				editor.setVisible(true);
-				editor.toFront();
-			} else {
-				editor = new TurnRestrictionEditor(
-						TurnRestrictionsListDialog.this, layer,toEdit);
-				manager.positionOnScreen(editor);
-				manager.register(layer, toEdit,editor);
-				editor.setVisible(true);
-			}
-		}
+        public void launchEditor(Relation toEdit) {
+            if (toEdit == null)
+                return;
+            OsmDataLayer layer = Main.main.getEditLayer();
+            TurnRestrictionEditorManager manager = TurnRestrictionEditorManager.getInstance();
+            TurnRestrictionEditor editor = manager.getEditorForRelation(layer, toEdit);
+            if (editor != null) {
+                editor.setVisible(true);
+                editor.toFront();
+            } else {
+                editor = new TurnRestrictionEditor(
+                        TurnRestrictionsListDialog.this, layer,toEdit);
+                manager.positionOnScreen(editor);
+                manager.register(layer, toEdit,editor);
+                editor.setVisible(true);
+            }
+        }
 
         public void actionPerformed(ActionEvent e) {
@@ -258,5 +258,5 @@
 
         public void updateEnabledState() {
-        	setEnabled(currentListView!= null && currentListView.getModel().getSelectedTurnRestrictions().size() == 1);
+            setEnabled(currentListView!= null && currentListView.getModel().getSelectedTurnRestrictions().size() == 1);
         }
         
@@ -298,9 +298,9 @@
         
         public void updateEnabledState() {
-        	setEnabled(currentListView != null && !currentListView.getModel().getSelectedTurnRestrictions().isEmpty());
+            setEnabled(currentListView != null && !currentListView.getModel().getSelectedTurnRestrictions().isEmpty());
         }
 
         public void valueChanged(ListSelectionEvent e) {
-        	updateEnabledState();
+            updateEnabledState();
         }
     }
@@ -319,8 +319,8 @@
 
         public void run() {
-        	 OsmDataLayer layer =  Main.main.getEditLayer();
-        	 if (layer == null) return;
-        	 Relation tr = new TurnRestrictionBuilder().buildFromSelection(layer);
-        	 TurnRestrictionEditor editor = new TurnRestrictionEditor(TurnRestrictionsListDialog.this, layer, tr);
+             OsmDataLayer layer =  Main.main.getEditLayer();
+             if (layer == null) return;
+             Relation tr = new TurnRestrictionBuilder().buildFromSelection(layer);
+             TurnRestrictionEditor editor = new TurnRestrictionEditor(TurnRestrictionsListDialog.this, layer, tr);
              TurnRestrictionEditorManager.getInstance().positionOnScreen(editor);             
              TurnRestrictionEditorManager.getInstance().register(layer, tr, editor);
@@ -336,8 +336,8 @@
         }
 
-		public void editLayerChanged(OsmDataLayer oldLayer,
-				OsmDataLayer newLayer) {
-            updateEnabledState();
-		}
+        public void editLayerChanged(OsmDataLayer oldLayer,
+                OsmDataLayer newLayer) {
+            updateEnabledState();
+        }
     }
     
@@ -367,9 +367,9 @@
         
         public void updateEnabledState() {
-        	setEnabled(currentListView != null && !currentListView.getModel().getSelectedTurnRestrictions().isEmpty());
+            setEnabled(currentListView != null && !currentListView.getModel().getSelectedTurnRestrictions().isEmpty());
         }
 
         public void valueChanged(ListSelectionEvent e) {
-        	updateEnabledState();
+            updateEnabledState();
         }
     }
@@ -401,9 +401,9 @@
         
         public void updateEnabledState() {
-        	setEnabled(currentListView != null && !currentListView.getModel().getSelectedTurnRestrictions().isEmpty());
+            setEnabled(currentListView != null && !currentListView.getModel().getSelectedTurnRestrictions().isEmpty());
         }
 
         public void valueChanged(ListSelectionEvent e) {
-        	updateEnabledState();
+            updateEnabledState();
         }
     }
@@ -448,15 +448,15 @@
      *
      */
-    class PreferenceChangeHandler implements PreferenceChangedListener {    	
-    	public void refreshIconSet() {
-    		pnlTurnRestrictionsInDataSet.initIconSetFromPreferences(Main.pref);
-			pnlTurnRestrictionsInSelection.initIconSetFromPreferences(Main.pref);
-			repaint();
-    	}
-    	
-		public void preferenceChanged(PreferenceChangeEvent evt) {			
-			if (!evt.getKey().equals(PreferenceKeys.ROAD_SIGNS)) return;
-			refreshIconSet();
-		}
+    class PreferenceChangeHandler implements PreferenceChangedListener {        
+        public void refreshIconSet() {
+            pnlTurnRestrictionsInDataSet.initIconSetFromPreferences(Main.pref);
+            pnlTurnRestrictionsInSelection.initIconSetFromPreferences(Main.pref);
+            repaint();
+        }
+        
+        public void preferenceChanged(PreferenceChangeEvent evt) {          
+            if (!evt.getKey().equals(PreferenceKeys.ROAD_SIGNS)) return;
+            refreshIconSet();
+        }
     }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListModel.java	(revision 23192)
@@ -73,9 +73,9 @@
      */
     protected boolean isTurnRestriction(OsmPrimitive primitive) {
-    	if (primitive == null) return false;
-    	if (! (primitive instanceof Relation)) return false;
-    	String type = primitive.get("type");
-    	if (type == null || ! type.equals("restriction")) return false;
-    	return true;
+        if (primitive == null) return false;
+        if (! (primitive instanceof Relation)) return false;
+        String type = primitive.get("type");
+        if (type == null || ! type.equals("restriction")) return false;
+        return true;
     }
     
@@ -122,6 +122,6 @@
                 continue;
             }
-			turnrestrictions.add(r);
-			added = true;
+            turnrestrictions.add(r);
+            added = true;
         }
         if (added) {
@@ -143,5 +143,5 @@
         Set<Relation> removedTurnRestrictions = new HashSet<Relation>();
         for (OsmPrimitive p: removedPrimitives) {
-        	if (!isTurnRestriction(p)) continue;
+            if (!isTurnRestriction(p)) continue;
             removedTurnRestrictions.add((Relation)p);
         }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferenceEditor.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferenceEditor.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferenceEditor.java	(revision 23192)
@@ -31,105 +31,105 @@
  */
 public class PreferenceEditor extends JPanel implements PreferenceSetting{
-	
-	private PreferencesPanel pnlIconPreferences;
+    
+    private PreferencesPanel pnlIconPreferences;
 
-	/**
-	 * builds the panel with the sponsoring information 
-	 * 
-	 * @return
-	 */
-	protected JPanel buildCreditPanel() {
-		JPanel pnl = new JPanel(new GridBagLayout());
-		pnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.insets = new Insets(0, 0,0, 5);
-		gc.weightx = 0.0;
-		JLabel lbl = new JLabel();
-		pnl.add(lbl, gc);
-		lbl.setIcon(ImageProvider.get("skobbler-logo"));
-		
-		gc.gridx = 1;
-		gc.weightx = 1.0;
-		HtmlPanel msg  =new HtmlPanel();
-		msg.setText("<html><body>"
-				+ tr("Development of the turn restriction plugin was sponsored " 
-				+ "by <a href=\"http://www.skobbler.de\">skobbler GmbH</a>.")
-				+"</body></html>");
-		pnl.add(msg, gc);
-		
-		// filler - grab remaining space 
-		gc.gridy = 1;
-		gc.gridx = 0;
-		gc.gridwidth = 2;
-		gc.weightx = 1.0;
-		gc.weighty = 1.0;
-		pnl.add(new JPanel(), gc);
-		
-		SkobblerUrlLauncher urlLauncher = new SkobblerUrlLauncher();
-		msg.getEditorPane().addHyperlinkListener(urlLauncher);
-		lbl.addMouseListener(urlLauncher);
-		return pnl;
-	}
+    /**
+     * builds the panel with the sponsoring information 
+     * 
+     * @return
+     */
+    protected JPanel buildCreditPanel() {
+        JPanel pnl = new JPanel(new GridBagLayout());
+        pnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.insets = new Insets(0, 0,0, 5);
+        gc.weightx = 0.0;
+        JLabel lbl = new JLabel();
+        pnl.add(lbl, gc);
+        lbl.setIcon(ImageProvider.get("skobbler-logo"));
+        
+        gc.gridx = 1;
+        gc.weightx = 1.0;
+        HtmlPanel msg  =new HtmlPanel();
+        msg.setText("<html><body>"
+                + tr("Development of the turn restriction plugin was sponsored " 
+                + "by <a href=\"http://www.skobbler.de\">skobbler GmbH</a>.")
+                +"</body></html>");
+        pnl.add(msg, gc);
+        
+        // filler - grab remaining space 
+        gc.gridy = 1;
+        gc.gridx = 0;
+        gc.gridwidth = 2;
+        gc.weightx = 1.0;
+        gc.weighty = 1.0;
+        pnl.add(new JPanel(), gc);
+        
+        SkobblerUrlLauncher urlLauncher = new SkobblerUrlLauncher();
+        msg.getEditorPane().addHyperlinkListener(urlLauncher);
+        lbl.addMouseListener(urlLauncher);
+        return pnl;
+    }
 
-	protected JPanel buildIconPreferencePanel() {
-		JPanel pnl = new JPanel(new BorderLayout());
-		
-		pnlIconPreferences = new PreferencesPanel();
-		pnlIconPreferences.initFromPreferences(Main.pref);
-		
-		JScrollPane sp = new JScrollPane(pnlIconPreferences);
-		sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
-		sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
-		
-		pnl.add(sp, BorderLayout.CENTER);
-		return pnl;
-	}
-	
-	protected void build() {
-		setLayout(new BorderLayout());
-		JTabbedPane tp = new JTabbedPane();
-		tp.add(buildIconPreferencePanel());
-		tp.add(buildCreditPanel());		
-		tp.setTitleAt(0, tr("Preferences"));
-		tp.setToolTipTextAt(0,tr("Configure the preferences for the turnrestrictions plugin"));
-		tp.setTitleAt(1, tr("Sponsor"));
-		add(tp, BorderLayout.CENTER);
-	}
-	
-	public PreferenceEditor() {
-		build();
-	}
-	
-	public void addGui(PreferenceTabbedPane gui) {
-		String description = tr("An OSM plugin for editing turn restrictions.");
-		JPanel tab = gui.createPreferenceTab("turnrestrictions", tr("Turn Restrictions"), description);
+    protected JPanel buildIconPreferencePanel() {
+        JPanel pnl = new JPanel(new BorderLayout());
+        
+        pnlIconPreferences = new PreferencesPanel();
+        pnlIconPreferences.initFromPreferences(Main.pref);
+        
+        JScrollPane sp = new JScrollPane(pnlIconPreferences);
+        sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+        sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
+        
+        pnl.add(sp, BorderLayout.CENTER);
+        return pnl;
+    }
+    
+    protected void build() {
+        setLayout(new BorderLayout());
+        JTabbedPane tp = new JTabbedPane();
+        tp.add(buildIconPreferencePanel());
+        tp.add(buildCreditPanel());     
+        tp.setTitleAt(0, tr("Preferences"));
+        tp.setToolTipTextAt(0,tr("Configure the preferences for the turnrestrictions plugin"));
+        tp.setTitleAt(1, tr("Sponsor"));
+        add(tp, BorderLayout.CENTER);
+    }
+    
+    public PreferenceEditor() {
+        build();
+    }
+    
+    public void addGui(PreferenceTabbedPane gui) {
+        String description = tr("An OSM plugin for editing turn restrictions.");
+        JPanel tab = gui.createPreferenceTab("turnrestrictions", tr("Turn Restrictions"), description);
         tab.add(this, GBC.eol().fill(GBC.BOTH));
-	}
+    }
 
-	public boolean ok() {
-		pnlIconPreferences.saveToPreferences(Main.pref);
-		return false;
-	}
-	
-	/**
-	 * Launches an external browser with the sponsors home page 
-	 */
-	class SkobblerUrlLauncher extends MouseAdapter implements HyperlinkListener {
-		protected void launchBrowser() {
-			OpenBrowser.displayUrl("http://www.skobbler.de");
-		}
-		
-		public void hyperlinkUpdate(HyperlinkEvent e) {
-			if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
-				launchBrowser();
-			}
-		}
+    public boolean ok() {
+        pnlIconPreferences.saveToPreferences(Main.pref);
+        return false;
+    }
+    
+    /**
+     * Launches an external browser with the sponsors home page 
+     */
+    class SkobblerUrlLauncher extends MouseAdapter implements HyperlinkListener {
+        protected void launchBrowser() {
+            OpenBrowser.displayUrl("http://www.skobbler.de");
+        }
+        
+        public void hyperlinkUpdate(HyperlinkEvent e) {
+            if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
+                launchBrowser();
+            }
+        }
 
-		@Override
-		public void mouseClicked(MouseEvent e) {
-			launchBrowser();
-		}
-	}
+        @Override
+        public void mouseClicked(MouseEvent e) {
+            launchBrowser();
+        }
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferenceKeys.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferenceKeys.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferenceKeys.java	(revision 23192)
@@ -9,32 +9,32 @@
  */
 public interface PreferenceKeys {
-	/**
-	 * Indicates which of two sets of road sign icons to use. Supported
-	 * values are:
-	 * <ul>
-	 *   <li><tt>set-a</tt> - the set of icons in the directory <tt>/images/types/set-a</tt></li>
-	 *   <li><tt>set-b</tt> - the set of icons in the directory <tt>/images/types/set-b</tt></li>
-	 * </ul>
-	 * 
-	 */
-	String ROAD_SIGNS = "turnrestrictions.road-signs";
-	
-	/**
-	 * Indicates whether the Basic Editor should include a widget for for displaying
-	 * and editing the via-objects of a turn restriction.
-	 * 
-	 * Supported values are:
-	 * <ul>
-	 *   <li><tt>true</tt> - display the list of vias in the basic editor </li>
-	 *    <li><tt>false</tt> - don't display the list of vias in the basic editor </li>
-	 * </ul>
-	 */
-	String SHOW_VIAS_IN_BASIC_EDITOR = "turnrestrictions.show-vias-in-basic-editor";
-	
-	/**
-	 * The shortcut which triggers creating a new or editing and existing turn
-	 * restriction. The value must be parseable by {@see KeyStroke#getKeyStroke(String)}.
-	 * If missing, the default value "ctrl shift T" is assumed.
-	 */
-	String EDIT_SHORTCUT= "turnrestrictions.edit-shortcut";
+    /**
+     * Indicates which of two sets of road sign icons to use. Supported
+     * values are:
+     * <ul>
+     *   <li><tt>set-a</tt> - the set of icons in the directory <tt>/images/types/set-a</tt></li>
+     *   <li><tt>set-b</tt> - the set of icons in the directory <tt>/images/types/set-b</tt></li>
+     * </ul>
+     * 
+     */
+    String ROAD_SIGNS = "turnrestrictions.road-signs";
+    
+    /**
+     * Indicates whether the Basic Editor should include a widget for for displaying
+     * and editing the via-objects of a turn restriction.
+     * 
+     * Supported values are:
+     * <ul>
+     *   <li><tt>true</tt> - display the list of vias in the basic editor </li>
+     *    <li><tt>false</tt> - don't display the list of vias in the basic editor </li>
+     * </ul>
+     */
+    String SHOW_VIAS_IN_BASIC_EDITOR = "turnrestrictions.show-vias-in-basic-editor";
+    
+    /**
+     * The shortcut which triggers creating a new or editing and existing turn
+     * restriction. The value must be parseable by {@see KeyStroke#getKeyStroke(String)}.
+     * If missing, the default value "ctrl shift T" is assumed.
+     */
+    String EDIT_SHORTCUT= "turnrestrictions.edit-shortcut";
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferencesPanel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferencesPanel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/PreferencesPanel.java	(revision 23192)
@@ -30,203 +30,203 @@
  */
 public class PreferencesPanel extends VerticallyScrollablePanel {
-	private static final Logger logger = Logger.getLogger(PreferencesPanel.class.getName());
-	private JRadioButton rbSetA;
-	private JRadioButton rbSetB;
-	private ButtonGroup bgIconSet;
-	private JCheckBox cbShowViaListInBasicEditor;
-	private ShortcutPreferencePanel pnlShortcutPreference;
-	
-	protected JPanel buildShowViaListInBasicEditorPanel() {
-		JPanel pnl = new JPanel(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 1.0;
-		gc.gridx = 0;
-		gc.gridy = 0;
-		
-		HtmlPanel msg = new HtmlPanel();
-		msg.setText("<html><body>"
-				+ tr("The Basic Editor can optionally display the list of via-objects "
-					 + "of a turn restriction. If enabled, one can edit them "
-					 + "in the Basic editor too. If disabled, editing of via-objects is "
-					 + "possible in the Advanced Editor only."
-				  )
-				+ "</body></html>"
-	    );
-		pnl.add(msg, gc);
-		
-		gc.gridy++;
-		pnl.add(cbShowViaListInBasicEditor = new JCheckBox(tr("Display and edit list of via-objects in the Basic Editor")), gc);
-		return pnl;
-	}
-	
-	/**
-	 * Builds the panel for the icon set "set-a"
-	 * 
-	 * @return
-	 */
-	protected JPanel buildSetAPanel() {
-		JPanel pnl = new JPanel(new GridBagLayout());;
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 1.0;
-		gc.gridx = 0;
-		gc.gridy = 0;
-		
-		pnl.add(rbSetA = new JRadioButton(tr("Road signs - Set A")),gc);
-		
-		JPanel icons = new JPanel(new FlowLayout(FlowLayout.LEFT));
-		for (TurnRestrictionType type: TurnRestrictionType.values()){
-			JLabel lbl = new JLabel();
-			icons.add(lbl);
-			lbl.setIcon(ImageProvider.get("types/set-a",type.getTagValue()));
-		}
-		
-		gc.gridy = 1;
-		gc.insets = new Insets(0,20,0,0);
-		pnl.add(icons, gc);
-		return pnl;		
-	}
-	
-	/**
-	 * Builds the panel for the icon set "set-b"
-	 * 
-	 * @return
-	 */
-	protected JPanel buildSetBPanel() {
-		JPanel pnl = new JPanel(new GridBagLayout());;
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 1.0;
-		gc.gridx = 0;
-		gc.gridy = 0;
-		
-		pnl.add(rbSetB = new JRadioButton(tr("Road signs - Set B")),gc);
-		
-		JPanel icons = new JPanel(new FlowLayout(FlowLayout.LEFT));
-		for (TurnRestrictionType type: TurnRestrictionType.values()){
-			JLabel lbl = new JLabel();
-			icons.add(lbl);
-			lbl.setIcon(ImageProvider.get("types/set-b",type.getTagValue()));
-		}
-		
-		gc.gridy = 1;
-		gc.insets = new Insets(0,20,0,0);
-		pnl.add(icons, gc);
-		return pnl;		
-	}
-	
-	/**
-	 * Builds the message panel at the top
-	 * 
-	 * @return
-	 */
-	protected JPanel buildMessagePanel() {
-		HtmlPanel pnl = new HtmlPanel();
-		pnl.setText(
-				"<html><body>"
-			  + tr("Please select the set of road sign icons to be used in the plugin.")
-			  + "</body></html>"
-		);
-		return pnl;
-	}
-	
-	/**
-	 * Builds the UI
-	 * 
-	 * @return
-	 */
-	protected void build() {			
-		setLayout(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 1.0;
-		gc.gridx = 0;
-		gc.gridy = 0;
-		
-		add(buildMessagePanel(), gc);
-		gc.gridy++;
-		add(buildSetAPanel(), gc);
-		gc.gridy++;
-		add(buildSetBPanel(), gc);
-		gc.gridy++;
-		add(new JSeparator(), gc);		
-		gc.gridy++;
-		add(buildShowViaListInBasicEditorPanel(), gc);
-		gc.gridy++;
-		add(new JSeparator(), gc);
-		gc.gridy++;
-		add(pnlShortcutPreference = new ShortcutPreferencePanel(), gc);
-		
-		// filler - just grab remaining space
-		gc.gridy++;
-		gc.fill = GridBagConstraints.BOTH;
-		gc.weighty = 1.0;
-		add(new JPanel(), gc);		 
-		
-		bgIconSet = new ButtonGroup();
-		bgIconSet.add(rbSetA);
-		bgIconSet.add(rbSetB);
-		
-		setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
-	}
-	
-	/**
-	 * Initializes the UI from the current settings in the JOSM preferences
-	 * {@code prefs}
-	 * 
-	 * @param prefs the preferences 
-	 */
-	public void initFromPreferences(Preferences prefs){
-		String set = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a");
-		set = set.trim().toLowerCase();
-		if (! set.equals("set-a") && ! set.equals("set-b")) {
-			System.out.println(tr("Warning: the preference with key ''{0}'' has an unsupported value ''{1}''. Assuming the default value ''set-a''.", PreferenceKeys.ROAD_SIGNS, set));
-			set = "set-a";
-		}
-		if (set.equals("set-a")){
-			rbSetA.setSelected(true);
-		} else {
-			rbSetB.setSelected(true);
-		}
-		
-		boolean b = prefs.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false);
-		cbShowViaListInBasicEditor.setSelected(b);
-		
-		pnlShortcutPreference.initFromPreferences(prefs);
-	}
-	
-	/**
-	 * Saves the current settings to the JOSM preferences {@code prefs}.
-	 * 
-	 * @param prefs the preferences 
-	 */
-	public void saveToPreferences(Preferences prefs){
-		String set = null;
-		if (rbSetA.isSelected()){
-			set = "set-a";
-		} else {
-			set = "set-b";
-		}
-		String oldSet = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a");		
-		if (!set.equals(oldSet)){
-			prefs.put(PreferenceKeys.ROAD_SIGNS, set);
-		}
-		
-		boolean newValue = cbShowViaListInBasicEditor.isSelected();
-		boolean oldValue = prefs.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false);
-		if (newValue != oldValue){
-			prefs.put(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, newValue);
-		}		
-		
-		pnlShortcutPreference.saveToPreferences(prefs);
-	}
-	
-	public PreferencesPanel() {
-		build();
-	}	
+    private static final Logger logger = Logger.getLogger(PreferencesPanel.class.getName());
+    private JRadioButton rbSetA;
+    private JRadioButton rbSetB;
+    private ButtonGroup bgIconSet;
+    private JCheckBox cbShowViaListInBasicEditor;
+    private ShortcutPreferencePanel pnlShortcutPreference;
+    
+    protected JPanel buildShowViaListInBasicEditorPanel() {
+        JPanel pnl = new JPanel(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 1.0;
+        gc.gridx = 0;
+        gc.gridy = 0;
+        
+        HtmlPanel msg = new HtmlPanel();
+        msg.setText("<html><body>"
+                + tr("The Basic Editor can optionally display the list of via-objects "
+                     + "of a turn restriction. If enabled, one can edit them "
+                     + "in the Basic editor too. If disabled, editing of via-objects is "
+                     + "possible in the Advanced Editor only."
+                  )
+                + "</body></html>"
+        );
+        pnl.add(msg, gc);
+        
+        gc.gridy++;
+        pnl.add(cbShowViaListInBasicEditor = new JCheckBox(tr("Display and edit list of via-objects in the Basic Editor")), gc);
+        return pnl;
+    }
+    
+    /**
+     * Builds the panel for the icon set "set-a"
+     * 
+     * @return
+     */
+    protected JPanel buildSetAPanel() {
+        JPanel pnl = new JPanel(new GridBagLayout());;
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 1.0;
+        gc.gridx = 0;
+        gc.gridy = 0;
+        
+        pnl.add(rbSetA = new JRadioButton(tr("Road signs - Set A")),gc);
+        
+        JPanel icons = new JPanel(new FlowLayout(FlowLayout.LEFT));
+        for (TurnRestrictionType type: TurnRestrictionType.values()){
+            JLabel lbl = new JLabel();
+            icons.add(lbl);
+            lbl.setIcon(ImageProvider.get("types/set-a",type.getTagValue()));
+        }
+        
+        gc.gridy = 1;
+        gc.insets = new Insets(0,20,0,0);
+        pnl.add(icons, gc);
+        return pnl;     
+    }
+    
+    /**
+     * Builds the panel for the icon set "set-b"
+     * 
+     * @return
+     */
+    protected JPanel buildSetBPanel() {
+        JPanel pnl = new JPanel(new GridBagLayout());;
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 1.0;
+        gc.gridx = 0;
+        gc.gridy = 0;
+        
+        pnl.add(rbSetB = new JRadioButton(tr("Road signs - Set B")),gc);
+        
+        JPanel icons = new JPanel(new FlowLayout(FlowLayout.LEFT));
+        for (TurnRestrictionType type: TurnRestrictionType.values()){
+            JLabel lbl = new JLabel();
+            icons.add(lbl);
+            lbl.setIcon(ImageProvider.get("types/set-b",type.getTagValue()));
+        }
+        
+        gc.gridy = 1;
+        gc.insets = new Insets(0,20,0,0);
+        pnl.add(icons, gc);
+        return pnl;     
+    }
+    
+    /**
+     * Builds the message panel at the top
+     * 
+     * @return
+     */
+    protected JPanel buildMessagePanel() {
+        HtmlPanel pnl = new HtmlPanel();
+        pnl.setText(
+                "<html><body>"
+              + tr("Please select the set of road sign icons to be used in the plugin.")
+              + "</body></html>"
+        );
+        return pnl;
+    }
+    
+    /**
+     * Builds the UI
+     * 
+     * @return
+     */
+    protected void build() {            
+        setLayout(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 1.0;
+        gc.gridx = 0;
+        gc.gridy = 0;
+        
+        add(buildMessagePanel(), gc);
+        gc.gridy++;
+        add(buildSetAPanel(), gc);
+        gc.gridy++;
+        add(buildSetBPanel(), gc);
+        gc.gridy++;
+        add(new JSeparator(), gc);      
+        gc.gridy++;
+        add(buildShowViaListInBasicEditorPanel(), gc);
+        gc.gridy++;
+        add(new JSeparator(), gc);
+        gc.gridy++;
+        add(pnlShortcutPreference = new ShortcutPreferencePanel(), gc);
+        
+        // filler - just grab remaining space
+        gc.gridy++;
+        gc.fill = GridBagConstraints.BOTH;
+        gc.weighty = 1.0;
+        add(new JPanel(), gc);       
+        
+        bgIconSet = new ButtonGroup();
+        bgIconSet.add(rbSetA);
+        bgIconSet.add(rbSetB);
+        
+        setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
+    }
+    
+    /**
+     * Initializes the UI from the current settings in the JOSM preferences
+     * {@code prefs}
+     * 
+     * @param prefs the preferences 
+     */
+    public void initFromPreferences(Preferences prefs){
+        String set = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a");
+        set = set.trim().toLowerCase();
+        if (! set.equals("set-a") && ! set.equals("set-b")) {
+            System.out.println(tr("Warning: the preference with key ''{0}'' has an unsupported value ''{1}''. Assuming the default value ''set-a''.", PreferenceKeys.ROAD_SIGNS, set));
+            set = "set-a";
+        }
+        if (set.equals("set-a")){
+            rbSetA.setSelected(true);
+        } else {
+            rbSetB.setSelected(true);
+        }
+        
+        boolean b = prefs.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false);
+        cbShowViaListInBasicEditor.setSelected(b);
+        
+        pnlShortcutPreference.initFromPreferences(prefs);
+    }
+    
+    /**
+     * Saves the current settings to the JOSM preferences {@code prefs}.
+     * 
+     * @param prefs the preferences 
+     */
+    public void saveToPreferences(Preferences prefs){
+        String set = null;
+        if (rbSetA.isSelected()){
+            set = "set-a";
+        } else {
+            set = "set-b";
+        }
+        String oldSet = prefs.get(PreferenceKeys.ROAD_SIGNS, "set-a");      
+        if (!set.equals(oldSet)){
+            prefs.put(PreferenceKeys.ROAD_SIGNS, set);
+        }
+        
+        boolean newValue = cbShowViaListInBasicEditor.isSelected();
+        boolean oldValue = prefs.getBoolean(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, false);
+        if (newValue != oldValue){
+            prefs.put(PreferenceKeys.SHOW_VIAS_IN_BASIC_EDITOR, newValue);
+        }       
+        
+        pnlShortcutPreference.saveToPreferences(prefs);
+    }
+    
+    public PreferencesPanel() {
+        build();
+    }   
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/ShortcutPreferencePanel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/ShortcutPreferencePanel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/preferences/ShortcutPreferencePanel.java	(revision 23192)
@@ -36,190 +36,190 @@
  */
 public class ShortcutPreferencePanel extends JPanel {
-	
-	private JCheckBox cbCtrl;
-	private JCheckBox cbAlt;
-	private JCheckBox cbShift;
-	private JCheckBox cbMeta;
-	private JComboBox cmKeyCodes;
-
-	protected JPanel buildMessagePanel() {
-		HtmlPanel pnl = new HtmlPanel();
-		pnl.setText("<html><body>"
-			+ tr("Please configure the <strong>keyboard shortcut</strong> which triggers "
-				+ "creating/editing a turn restriction from the current JOSM selection.")
-			+ "</body></html>"
-		);
-		return pnl;
-	}
-	
-	protected JPanel buildShortCutConfigPanel() {
-		JPanel pnl = new JPanel(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 0.0;
-		gc.gridx = 0;
-		gc.gridy = 0;
-		
-		pnl.add(new JLabel(trc("keyboard-key", "Key:")), gc);
-		gc.gridx++;
-		gc.gridwidth=4;
-		gc.weightx = 1.0;
-		pnl.add(cmKeyCodes = new JComboBox(new VKeyComboBoxModel()), gc);
-		cmKeyCodes.setRenderer(new VKeyCellRenderer());
-		
-		gc.gridx = 0;
-		gc.gridy = 1;
-		gc.gridwidth = 1;
-		gc.weightx = 0.0;
-		pnl.add(new JLabel(trc("keyboard-modifiers", "Modifiers:")), gc);
-	
-		gc.gridx++;
-		pnl.add(cbShift = new JCheckBox(trc("keyboard-modifiers", "Shift")), gc);
-		gc.gridx++;
-		pnl.add(cbCtrl = new JCheckBox(trc("keyboard-modifiers", "Ctrl")), gc);
-		gc.gridx++;
-		pnl.add(cbAlt = new JCheckBox(trc("keyboard-modifiers", "Alt")), gc);
-		gc.gridx++;
-		gc.weightx = 1.0;
-		pnl.add(cbMeta = new JCheckBox(trc("keyboard-modifiers", "Meta")), gc);
-		
-		return pnl;
-	}
-	
-	protected void build() {
-		setLayout(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 1.0;
-		gc.gridx = 0;
-		gc.gridy = 0;
-		add(buildMessagePanel(), gc);
-		gc.gridy++;
-		add(buildShortCutConfigPanel(), gc);
-	}
-	
-	public ShortcutPreferencePanel() {
-		build();
-	}
-	
-	public void initFromPreferences(Preferences pref){
-		String value = pref.get(PreferenceKeys.EDIT_SHORTCUT, "shift ctrl T");
-		KeyStroke key = KeyStroke.getKeyStroke(value);
-		if (key == null){
-			System.out.println(tr("Warning: illegal value ''{0}'' for preference key ''{1}''. Falling back to default value ''shift ctrl T''.", value, PreferenceKeys.EDIT_SHORTCUT));
-			key = KeyStroke.getKeyStroke("shift ctrl T");
-		}
-		cmKeyCodes.getModel().setSelectedItem(key.getKeyCode());
-		cbAlt.setSelected((key.getModifiers() & KeyEvent.ALT_DOWN_MASK) != 0);
-		cbCtrl.setSelected((key.getModifiers() & KeyEvent.CTRL_DOWN_MASK) != 0);
-		cbShift.setSelected((key.getModifiers() & KeyEvent.SHIFT_DOWN_MASK) != 0);
-		cbMeta.setSelected((key.getModifiers() & KeyEvent.META_DOWN_MASK) != 0);
-	}
-	
-	public void saveToPreferences(Preferences pref){
-		Integer code  = (Integer)cmKeyCodes.getModel().getSelectedItem();
-		if (code == null) {
-			code = KeyEvent.VK_T;
-		}
-		int modifiers = 0;
-		if (cbAlt.isSelected()) modifiers |= KeyEvent.ALT_DOWN_MASK;
-		if (cbCtrl.isSelected()) modifiers |= KeyEvent.CTRL_DOWN_MASK;
-		if (cbShift.isSelected()) modifiers |= KeyEvent.SHIFT_DOWN_MASK;
-		if (cbMeta.isSelected()) modifiers |= KeyEvent.META_DOWN_MASK;		
-		KeyStroke ks = KeyStroke.getKeyStroke(code, modifiers);
-		
-		pref.put(PreferenceKeys.EDIT_SHORTCUT, ks.toString());		
-		CreateOrEditTurnRestrictionAction.install(ks);
-	}
-	
-	static private class VKeyComboBoxModel extends AbstractListModel implements ComboBoxModel {
-		private final ArrayList<Integer> keys = new ArrayList<Integer>();
-		private Integer selected = null;
-
-		public VKeyComboBoxModel() {
-			populate();
-		}
-		
-		public void populate() {
-			for (Field f :KeyEvent.class.getFields()) {
-				if (! Modifier.isStatic(f.getModifiers())) continue;
-				if (! f.getName().startsWith("VK_")) continue;
-				try {
-					keys.add((Integer)f.get(null));
-				} catch(IllegalAccessException e){
-					// ignore
-				}
-			}
-			
-			Collections.sort(keys, new KeyCodeComparator());
-		}
-		
-		public Object getSelectedItem() {
-			return selected;
-		}
-
-		public void setSelectedItem(Object anItem) {
-			this.selected = (Integer)anItem;			
-		}
-
-		public Object getElementAt(int index) {
-			return keys.get(index);
-		}
-
-		public int getSize() {
-			return keys.size();
-		}		
-	}
-	
-	static private class VKeyCellRenderer extends JLabel implements ListCellRenderer {
-		public Component getListCellRendererComponent(JList list, Object value,
-				int index, boolean isSelected, boolean cellHasFocus) {
-			if (isSelected) {
-				setBackground(UIManager.getColor("ComboBox.selectionBackground"));
-				setForeground(UIManager.getColor("ComboBox.selectionForeground"));
-			} else {
-				setBackground(UIManager.getColor("ComboBox.background"));
-				setForeground(UIManager.getColor("ComboBox.foreground"));
-			}
-			setText(KeyEvent.getKeyText((Integer)value));
-			return this;
-		}		
-	}
-	
-	static private class KeyCodeComparator implements Comparator<Integer> {
-		private final static Map<Integer, String> keyNames = new HashMap<Integer, String>();
-		
-		protected String keyName(Integer code){
-			String name = keyNames.get(code);
-			if (name == null){
-				name = KeyEvent.getKeyText(code);
-				keyNames.put(code, name);
-			}
-			return name;
-		}
-		/**
-		 * Make sure single letter keys (A-Z, 0-9) are at the top of the list.
-		 * Make sure function key F1-F19 are sorted numerically, not lexicografically.
-		 * 
-		 */
-		public int compare(Integer kc1, Integer kc2) {
-			String n1 = keyName(kc1);
-			String n2 = keyName(kc2);
-			if (n1.length() == 1 && n2.length()==1){
-				return n1.compareTo(n2);
-			} else if (n1.length() == 1){
-				return -1;
-			} else if (n2.length() == 1){
-				return 1;
-			} else if (n1.matches("F\\d+") && n2.matches("F\\d+")){
-				int f1 = Integer.parseInt(n1.substring(1));
-				int f2 = Integer.parseInt(n2.substring(1));
-				return new Integer(f1).compareTo(f2);				
-			} else {
-				return n1.compareTo(n2);
-			}				
-		}		
-	}
+    
+    private JCheckBox cbCtrl;
+    private JCheckBox cbAlt;
+    private JCheckBox cbShift;
+    private JCheckBox cbMeta;
+    private JComboBox cmKeyCodes;
+
+    protected JPanel buildMessagePanel() {
+        HtmlPanel pnl = new HtmlPanel();
+        pnl.setText("<html><body>"
+            + tr("Please configure the <strong>keyboard shortcut</strong> which triggers "
+                + "creating/editing a turn restriction from the current JOSM selection.")
+            + "</body></html>"
+        );
+        return pnl;
+    }
+    
+    protected JPanel buildShortCutConfigPanel() {
+        JPanel pnl = new JPanel(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 0.0;
+        gc.gridx = 0;
+        gc.gridy = 0;
+        
+        pnl.add(new JLabel(trc("keyboard-key", "Key:")), gc);
+        gc.gridx++;
+        gc.gridwidth=4;
+        gc.weightx = 1.0;
+        pnl.add(cmKeyCodes = new JComboBox(new VKeyComboBoxModel()), gc);
+        cmKeyCodes.setRenderer(new VKeyCellRenderer());
+        
+        gc.gridx = 0;
+        gc.gridy = 1;
+        gc.gridwidth = 1;
+        gc.weightx = 0.0;
+        pnl.add(new JLabel(trc("keyboard-modifiers", "Modifiers:")), gc);
+    
+        gc.gridx++;
+        pnl.add(cbShift = new JCheckBox(trc("keyboard-modifiers", "Shift")), gc);
+        gc.gridx++;
+        pnl.add(cbCtrl = new JCheckBox(trc("keyboard-modifiers", "Ctrl")), gc);
+        gc.gridx++;
+        pnl.add(cbAlt = new JCheckBox(trc("keyboard-modifiers", "Alt")), gc);
+        gc.gridx++;
+        gc.weightx = 1.0;
+        pnl.add(cbMeta = new JCheckBox(trc("keyboard-modifiers", "Meta")), gc);
+        
+        return pnl;
+    }
+    
+    protected void build() {
+        setLayout(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 1.0;
+        gc.gridx = 0;
+        gc.gridy = 0;
+        add(buildMessagePanel(), gc);
+        gc.gridy++;
+        add(buildShortCutConfigPanel(), gc);
+    }
+    
+    public ShortcutPreferencePanel() {
+        build();
+    }
+    
+    public void initFromPreferences(Preferences pref){
+        String value = pref.get(PreferenceKeys.EDIT_SHORTCUT, "shift ctrl T");
+        KeyStroke key = KeyStroke.getKeyStroke(value);
+        if (key == null){
+            System.out.println(tr("Warning: illegal value ''{0}'' for preference key ''{1}''. Falling back to default value ''shift ctrl T''.", value, PreferenceKeys.EDIT_SHORTCUT));
+            key = KeyStroke.getKeyStroke("shift ctrl T");
+        }
+        cmKeyCodes.getModel().setSelectedItem(key.getKeyCode());
+        cbAlt.setSelected((key.getModifiers() & KeyEvent.ALT_DOWN_MASK) != 0);
+        cbCtrl.setSelected((key.getModifiers() & KeyEvent.CTRL_DOWN_MASK) != 0);
+        cbShift.setSelected((key.getModifiers() & KeyEvent.SHIFT_DOWN_MASK) != 0);
+        cbMeta.setSelected((key.getModifiers() & KeyEvent.META_DOWN_MASK) != 0);
+    }
+    
+    public void saveToPreferences(Preferences pref){
+        Integer code  = (Integer)cmKeyCodes.getModel().getSelectedItem();
+        if (code == null) {
+            code = KeyEvent.VK_T;
+        }
+        int modifiers = 0;
+        if (cbAlt.isSelected()) modifiers |= KeyEvent.ALT_DOWN_MASK;
+        if (cbCtrl.isSelected()) modifiers |= KeyEvent.CTRL_DOWN_MASK;
+        if (cbShift.isSelected()) modifiers |= KeyEvent.SHIFT_DOWN_MASK;
+        if (cbMeta.isSelected()) modifiers |= KeyEvent.META_DOWN_MASK;      
+        KeyStroke ks = KeyStroke.getKeyStroke(code, modifiers);
+        
+        pref.put(PreferenceKeys.EDIT_SHORTCUT, ks.toString());      
+        CreateOrEditTurnRestrictionAction.install(ks);
+    }
+    
+    static private class VKeyComboBoxModel extends AbstractListModel implements ComboBoxModel {
+        private final ArrayList<Integer> keys = new ArrayList<Integer>();
+        private Integer selected = null;
+
+        public VKeyComboBoxModel() {
+            populate();
+        }
+        
+        public void populate() {
+            for (Field f :KeyEvent.class.getFields()) {
+                if (! Modifier.isStatic(f.getModifiers())) continue;
+                if (! f.getName().startsWith("VK_")) continue;
+                try {
+                    keys.add((Integer)f.get(null));
+                } catch(IllegalAccessException e){
+                    // ignore
+                }
+            }
+            
+            Collections.sort(keys, new KeyCodeComparator());
+        }
+        
+        public Object getSelectedItem() {
+            return selected;
+        }
+
+        public void setSelectedItem(Object anItem) {
+            this.selected = (Integer)anItem;            
+        }
+
+        public Object getElementAt(int index) {
+            return keys.get(index);
+        }
+
+        public int getSize() {
+            return keys.size();
+        }       
+    }
+    
+    static private class VKeyCellRenderer extends JLabel implements ListCellRenderer {
+        public Component getListCellRendererComponent(JList list, Object value,
+                int index, boolean isSelected, boolean cellHasFocus) {
+            if (isSelected) {
+                setBackground(UIManager.getColor("ComboBox.selectionBackground"));
+                setForeground(UIManager.getColor("ComboBox.selectionForeground"));
+            } else {
+                setBackground(UIManager.getColor("ComboBox.background"));
+                setForeground(UIManager.getColor("ComboBox.foreground"));
+            }
+            setText(KeyEvent.getKeyText((Integer)value));
+            return this;
+        }       
+    }
+    
+    static private class KeyCodeComparator implements Comparator<Integer> {
+        private final static Map<Integer, String> keyNames = new HashMap<Integer, String>();
+        
+        protected String keyName(Integer code){
+            String name = keyNames.get(code);
+            if (name == null){
+                name = KeyEvent.getKeyText(code);
+                keyNames.put(code, name);
+            }
+            return name;
+        }
+        /**
+         * Make sure single letter keys (A-Z, 0-9) are at the top of the list.
+         * Make sure function key F1-F19 are sorted numerically, not lexicografically.
+         * 
+         */
+        public int compare(Integer kc1, Integer kc2) {
+            String n1 = keyName(kc1);
+            String n2 = keyName(kc2);
+            if (n1.length() == 1 && n2.length()==1){
+                return n1.compareTo(n2);
+            } else if (n1.length() == 1){
+                return -1;
+            } else if (n2.length() == 1){
+                return 1;
+            } else if (n1.matches("F\\d+") && n2.matches("F\\d+")){
+                int f1 = Integer.parseInt(n1.substring(1));
+                int f2 = Integer.parseInt(n2.substring(1));
+                return new Integer(f1).compareTo(f2);               
+            } else {
+                return n1.compareTo(n2);
+            }               
+        }       
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IdenticalTurnRestrictionLegsError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IdenticalTurnRestrictionLegsError.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IdenticalTurnRestrictionLegsError.java	(revision 23192)
@@ -15,50 +15,50 @@
  */
 public class IdenticalTurnRestrictionLegsError extends Issue{
-	private OsmPrimitive leg;
-	
-	public IdenticalTurnRestrictionLegsError(IssuesModel parent, OsmPrimitive leg) {
-		super(parent, Severity.ERROR);
-		actions.add(new DeleteFromAction());
-		actions.add(new DeleteToAction());
-		actions.add(new FixInEditorAction());
-		this.leg = leg;
-	}
+    private OsmPrimitive leg;
+    
+    public IdenticalTurnRestrictionLegsError(IssuesModel parent, OsmPrimitive leg) {
+        super(parent, Severity.ERROR);
+        actions.add(new DeleteFromAction());
+        actions.add(new DeleteToAction());
+        actions.add(new FixInEditorAction());
+        this.leg = leg;
+    }
 
-	@Override
-	public String getText() {		
-		return tr("This turn restriction uses the OSM way <span class=\"object-name\">{0}</span> with role <tt>from</tt> <strong>and</strong> with role <tt>to</tt>. "
-				+ "In a turn restriction, the way with role <tt>from</tt> should be different from the way with role <tt>to</tt>, though.",
-				leg.getDisplayName(DefaultNameFormatter.getInstance())
-				);				
-	}
-	
-	class DeleteFromAction extends AbstractAction {
-		public DeleteFromAction() {
-			putValue(NAME, tr("Delete ''from''"));
-			putValue(SHORT_DESCRIPTION, tr("Removes the member with role ''from''"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			getIssuesModel().getEditorModel().getRelationMemberEditorModel().setFromPrimitive(null);			
-		}		
-	}
-	
-	class DeleteToAction extends AbstractAction {
-		public DeleteToAction() {
-			putValue(NAME, tr("Delete ''to''"));
-			putValue(SHORT_DESCRIPTION, tr("Removes the member with role ''to''"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			getIssuesModel().getEditorModel().getRelationMemberEditorModel().setToPrimitive(null);			
-		}		
-	}
-	
-	class FixInEditorAction extends AbstractAction {
-		public FixInEditorAction() {
-			putValue(NAME, tr("Fix in editor"));
-			putValue(SHORT_DESCRIPTION, tr("Go to Basic Editor and manually choose members with roles ''from'' and ''to''"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			getIssuesModel().getNavigationControler().gotoBasicEditor();		
-		}		
-	}
+    @Override
+    public String getText() {       
+        return tr("This turn restriction uses the OSM way <span class=\"object-name\">{0}</span> with role <tt>from</tt> <strong>and</strong> with role <tt>to</tt>. "
+                + "In a turn restriction, the way with role <tt>from</tt> should be different from the way with role <tt>to</tt>, though.",
+                leg.getDisplayName(DefaultNameFormatter.getInstance())
+                );              
+    }
+    
+    class DeleteFromAction extends AbstractAction {
+        public DeleteFromAction() {
+            putValue(NAME, tr("Delete ''from''"));
+            putValue(SHORT_DESCRIPTION, tr("Removes the member with role ''from''"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            getIssuesModel().getEditorModel().getRelationMemberEditorModel().setFromPrimitive(null);            
+        }       
+    }
+    
+    class DeleteToAction extends AbstractAction {
+        public DeleteToAction() {
+            putValue(NAME, tr("Delete ''to''"));
+            putValue(SHORT_DESCRIPTION, tr("Removes the member with role ''to''"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            getIssuesModel().getEditorModel().getRelationMemberEditorModel().setToPrimitive(null);          
+        }       
+    }
+    
+    class FixInEditorAction extends AbstractAction {
+        public FixInEditorAction() {
+            putValue(NAME, tr("Fix in editor"));
+            putValue(SHORT_DESCRIPTION, tr("Go to Basic Editor and manually choose members with roles ''from'' and ''to''"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            getIssuesModel().getNavigationControler().gotoBasicEditor();        
+        }       
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IllegalRestrictionTypeError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IllegalRestrictionTypeError.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IllegalRestrictionTypeError.java	(revision 23192)
@@ -15,28 +15,28 @@
  */
 public class IllegalRestrictionTypeError extends Issue{
-	private String value;
-	
-	public IllegalRestrictionTypeError(IssuesModel parent, String value) {
-		super(parent, Severity.ERROR);
-		actions.add(new FixInEditorAction());
-		this.value = value;
-	}
+    private String value;
+    
+    public IllegalRestrictionTypeError(IssuesModel parent, String value) {
+        super(parent, Severity.ERROR);
+        actions.add(new FixInEditorAction());
+        this.value = value;
+    }
 
-	@Override
-	public String getText() {		
-		return tr("This turn restriction uses a non-standard restriction type <tt>{0}</tt> for the tag key <tt>restriction</tt>. "
-				+ "It is recommended to use standard values only. Please select one in the Basic editor.",
-				value
-				);				
-	}
-	
-	class FixInEditorAction extends AbstractAction {
-		public FixInEditorAction() {
-			putValue(NAME, tr("Fix in editor"));
-			putValue(SHORT_DESCRIPTION, tr("Go to Basic Editor and manually choose a turn restriction type"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			getIssuesModel().getNavigationControler().gotoBasicEditor(NavigationControler.BasicEditorFokusTargets.RESTRICION_TYPE);			
-		}		
-	}
+    @Override
+    public String getText() {       
+        return tr("This turn restriction uses a non-standard restriction type <tt>{0}</tt> for the tag key <tt>restriction</tt>. "
+                + "It is recommended to use standard values only. Please select one in the Basic editor.",
+                value
+                );              
+    }
+    
+    class FixInEditorAction extends AbstractAction {
+        public FixInEditorAction() {
+            putValue(NAME, tr("Fix in editor"));
+            putValue(SHORT_DESCRIPTION, tr("Go to Basic Editor and manually choose a turn restriction type"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            getIssuesModel().getNavigationControler().gotoBasicEditor(NavigationControler.BasicEditorFokusTargets.RESTRICION_TYPE);         
+        }       
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IntersectionMissingAsViaError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IntersectionMissingAsViaError.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IntersectionMissingAsViaError.java	(revision 23192)
@@ -20,47 +20,47 @@
  */
 public class IntersectionMissingAsViaError extends Issue{
-	private Way from;
-	private Way to;
-	private Node interesect;
-	
-	public IntersectionMissingAsViaError(IssuesModel parent, Way from, Way to, Node intersect) {
-		super(parent, Severity.ERROR);
-		this.from = from;
-		this.to = to;
-		this.interesect = intersect;
-		actions.add(new SetVia());
-		actions.add(new FixInEditorAction());
-	}
+    private Way from;
+    private Way to;
+    private Node interesect;
+    
+    public IntersectionMissingAsViaError(IssuesModel parent, Way from, Way to, Node intersect) {
+        super(parent, Severity.ERROR);
+        this.from = from;
+        this.to = to;
+        this.interesect = intersect;
+        actions.add(new SetVia());
+        actions.add(new FixInEditorAction());
+    }
 
-	@Override
-	public String getText() {		
-		String msg = tr("The <strong>from</strong>-way <span class=\"object-name\">{0}</span> and the <strong>to</strong>-way <span class=\"object-name\">{1}</span> "
-		       + "interesect at node <span class=\"object-name\">{2}</span> but <span class=\"object-name\">{2}</span> isn''t a <strong>via</strong>-object.<br> "
-		       + "It is recommended to set <span class=\"object-name\">{2}</span> as unique <strong>via</strong>-object.",
-		       this.from.getDisplayName(DefaultNameFormatter.getInstance()),
-		       this.to.getDisplayName(DefaultNameFormatter.getInstance()),
-		       this.interesect.getDisplayName(DefaultNameFormatter.getInstance())
-		);
-		return msg;
-	}
-	
-	class SetVia extends AbstractAction {
-		public SetVia() {
-			putValue(NAME, tr("Set via-Object"));
-			putValue(SHORT_DESCRIPTION, tr("Replaces the currently configured via-objects with the node at the intersection"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			getIssuesModel().getEditorModel().setVias(Collections.<OsmPrimitive>singletonList(interesect));			
-		}		
-	}
-	
-	class FixInEditorAction extends AbstractAction {
-		public FixInEditorAction() {
-			putValue(NAME, tr("Fix in editor"));
-			putValue(SHORT_DESCRIPTION, tr("Go to Basic Editor and manually fix the list of via-objects"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			getIssuesModel().getNavigationControler().gotoBasicEditor(BasicEditorFokusTargets.VIA);	
-		}		
-	}
+    @Override
+    public String getText() {       
+        String msg = tr("The <strong>from</strong>-way <span class=\"object-name\">{0}</span> and the <strong>to</strong>-way <span class=\"object-name\">{1}</span> "
+               + "interesect at node <span class=\"object-name\">{2}</span> but <span class=\"object-name\">{2}</span> isn''t a <strong>via</strong>-object.<br> "
+               + "It is recommended to set <span class=\"object-name\">{2}</span> as unique <strong>via</strong>-object.",
+               this.from.getDisplayName(DefaultNameFormatter.getInstance()),
+               this.to.getDisplayName(DefaultNameFormatter.getInstance()),
+               this.interesect.getDisplayName(DefaultNameFormatter.getInstance())
+        );
+        return msg;
+    }
+    
+    class SetVia extends AbstractAction {
+        public SetVia() {
+            putValue(NAME, tr("Set via-Object"));
+            putValue(SHORT_DESCRIPTION, tr("Replaces the currently configured via-objects with the node at the intersection"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            getIssuesModel().getEditorModel().setVias(Collections.<OsmPrimitive>singletonList(interesect));         
+        }       
+    }
+    
+    class FixInEditorAction extends AbstractAction {
+        public FixInEditorAction() {
+            putValue(NAME, tr("Fix in editor"));
+            putValue(SHORT_DESCRIPTION, tr("Go to Basic Editor and manually fix the list of via-objects"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            getIssuesModel().getNavigationControler().gotoBasicEditor(BasicEditorFokusTargets.VIA); 
+        }       
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/Issue.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/Issue.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/Issue.java	(revision 23192)
@@ -18,83 +18,83 @@
  */
 abstract public class Issue {
-	/** the parent model for this issue */
-	protected IssuesModel parent;
-	protected Severity severity;
-	protected final ArrayList<Action> actions = new ArrayList<Action>();
-	
-	/**
-	 * Creates a new issue associated with a parent model. Severity is
-	 * initialized to {@see Severity#WARNING}.
-	 * 
-	 * @param parent the parent model. Must not be null.
-	 * @throws IllegalArgumentException thrown if parent is null
-	 */
-	public Issue(IssuesModel parent) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(parent, "parent");
-		this.parent = parent;
-		this.severity = Severity.WARNING;
-	}
-	
-	/**
-	 * Creates a new issue of severity {@code severity} associated with
-	 * the parent model {@code parent}.
-	 * 
-	 * @param parent the parent model. Must not be null.
-	 * @param severity the severity. Must not be null.
-	 * @throws IllegalArgumentException thrown if parent is null
-	 * @throws IllegalArgumentException thrown if severity is null 
-	 */
-	public Issue(IssuesModel parent, Severity severity){
-		CheckParameterUtil.ensureParameterNotNull(parent, "parent");
-		CheckParameterUtil.ensureParameterNotNull(severity, "severity");
-		this.parent = parent;
-		this.severity = severity;
-	}
+    /** the parent model for this issue */
+    protected IssuesModel parent;
+    protected Severity severity;
+    protected final ArrayList<Action> actions = new ArrayList<Action>();
+    
+    /**
+     * Creates a new issue associated with a parent model. Severity is
+     * initialized to {@see Severity#WARNING}.
+     * 
+     * @param parent the parent model. Must not be null.
+     * @throws IllegalArgumentException thrown if parent is null
+     */
+    public Issue(IssuesModel parent) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(parent, "parent");
+        this.parent = parent;
+        this.severity = Severity.WARNING;
+    }
+    
+    /**
+     * Creates a new issue of severity {@code severity} associated with
+     * the parent model {@code parent}.
+     * 
+     * @param parent the parent model. Must not be null.
+     * @param severity the severity. Must not be null.
+     * @throws IllegalArgumentException thrown if parent is null
+     * @throws IllegalArgumentException thrown if severity is null 
+     */
+    public Issue(IssuesModel parent, Severity severity){
+        CheckParameterUtil.ensureParameterNotNull(parent, "parent");
+        CheckParameterUtil.ensureParameterNotNull(severity, "severity");
+        this.parent = parent;
+        this.severity = severity;
+    }
 
-	/**
-	 * Replies the parent model this issue is associated with 
-	 * 
-	 * @return the parent model 
-	 */
-	public IssuesModel getIssuesModel() {
-		return parent;
-	}
+    /**
+     * Replies the parent model this issue is associated with 
+     * 
+     * @return the parent model 
+     */
+    public IssuesModel getIssuesModel() {
+        return parent;
+    }
 
-	/**
-	 * Replies the severity of this issue 
-	 * 
-	 * @return the severity 
-	 */
-	public Severity getSeverity() {
-		return severity;
-	}
+    /**
+     * Replies the severity of this issue 
+     * 
+     * @return the severity 
+     */
+    public Severity getSeverity() {
+        return severity;
+    }
 
-	/**
-	 * Sets the severity of this issue. 
-	 * 
-	 * @param severity the severity. Must not be null.
-	 * @throws IllegalArgumentException thrown if severity is null
-	 */
-	public void setSeverity(Severity severity) throws IllegalArgumentException {
-		CheckParameterUtil.ensureParameterNotNull(severity, "severity");
-		this.severity = severity;
-	}
+    /**
+     * Sets the severity of this issue. 
+     * 
+     * @param severity the severity. Must not be null.
+     * @throws IllegalArgumentException thrown if severity is null
+     */
+    public void setSeverity(Severity severity) throws IllegalArgumentException {
+        CheckParameterUtil.ensureParameterNotNull(severity, "severity");
+        this.severity = severity;
+    }
 
-	/**
-	 * Replies the HTML formatted description of the issue. The text should neither include
-	 * the &lt;html&gt;, nor the &lt;body&gt; tag.  
-	 * 
-	 * @return the HTML formatted description of the issue.
-	 */
-	public abstract String getText();
-	
-	/**
-	 * Replies a list of actions which can be applied to this issue in order to fix
-	 * it. The default implementation replies an empty list.
-	 * 
-	 * @return a list of action
-	 */
-	public List<Action> getActions() {
-		return Collections.unmodifiableList(actions);
-	}
+    /**
+     * Replies the HTML formatted description of the issue. The text should neither include
+     * the &lt;html&gt;, nor the &lt;body&gt; tag.  
+     * 
+     * @return the HTML formatted description of the issue.
+     */
+    public abstract String getText();
+    
+    /**
+     * Replies a list of actions which can be applied to this issue in order to fix
+     * it. The default implementation replies an empty list.
+     * 
+     * @return a list of action
+     */
+    public List<Action> getActions() {
+        return Collections.unmodifiableList(actions);
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssueView.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssueView.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssueView.java	(revision 23192)
@@ -26,11 +26,11 @@
 public class IssueView extends JPanel{
 
-	private HtmlPanel pnlMessage;
-	private JPanel pnlActions;
-	private Issue issue;
-	private JLabel lblIcon;
-	private StyleSheet styleSheet;
-	
-	 /**
+    private HtmlPanel pnlMessage;
+    private JPanel pnlActions;
+    private Issue issue;
+    private JLabel lblIcon;
+    private StyleSheet styleSheet;
+    
+     /**
      * Builds the style sheet used in the internal help browser
      *
@@ -43,82 +43,82 @@
         ss.addRule(".object-name {background-color:rgb(240,240,240); color: blue;}");
     }
-	
-	protected void build() {
-		setLayout(new GridBagLayout());
-		setBackground(Color.WHITE);
-		setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY, 1));
-		
-		// add the icon for the severity 
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.VERTICAL;
-		gc.gridheight = 2;
-		gc.weightx = 0.0;
-		gc.weighty = 1.0;
-		gc.gridx = 0;
-		gc.gridy = 0;
-		gc.insets = new Insets(2,2,2,2);
-		add(lblIcon = new JLabel(), gc);
-		lblIcon.setVerticalAlignment(SwingConstants.TOP);
-		lblIcon.setHorizontalAlignment(SwingConstants.CENTER);
-		lblIcon.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
+    
+    protected void build() {
+        setLayout(new GridBagLayout());
+        setBackground(Color.WHITE);
+        setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY, 1));
+        
+        // add the icon for the severity 
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.VERTICAL;
+        gc.gridheight = 2;
+        gc.weightx = 0.0;
+        gc.weighty = 1.0;
+        gc.gridx = 0;
+        gc.gridy = 0;
+        gc.insets = new Insets(2,2,2,2);
+        add(lblIcon = new JLabel(), gc);
+        lblIcon.setVerticalAlignment(SwingConstants.TOP);
+        lblIcon.setHorizontalAlignment(SwingConstants.CENTER);
+        lblIcon.setBorder(BorderFactory.createEmptyBorder(2,2,2,2));
 
-		// add the html panel with the issue description 
-		gc.insets = new Insets(0,0,0,0);
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.BOTH;
-		gc.gridx = 1;
-		gc.gridy = 0;
-		gc.gridheight = 1;
-		gc.weightx = 1.0;
-		gc.weighty = 1.0;
-		add(pnlMessage = new HtmlPanel(), gc);
-		initStyleSheet(pnlMessage);
-		pnlMessage.setBackground(Color.white);
-		pnlMessage.setText("<html><body>" + issue.getText() + "</html></bod>");
+        // add the html panel with the issue description 
+        gc.insets = new Insets(0,0,0,0);
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.BOTH;
+        gc.gridx = 1;
+        gc.gridy = 0;
+        gc.gridheight = 1;
+        gc.weightx = 1.0;
+        gc.weighty = 1.0;
+        add(pnlMessage = new HtmlPanel(), gc);
+        initStyleSheet(pnlMessage);
+        pnlMessage.setBackground(Color.white);
+        pnlMessage.setText("<html><body>" + issue.getText() + "</html></bod>");
 
-		
-		// if there are any actions available to resolve the issue, add a panel with action buttons 
-		if (!issue.getActions().isEmpty()) {
-			pnlActions = new JPanel(new FlowLayout(FlowLayout.LEFT));
-			pnlActions.setBackground(Color.WHITE);
-			for (Action action: issue.getActions()){
-				JButton btn = new JButton(action);
-				pnlActions.add(btn);				
-			}
-			
-			gc.gridx = 1;			
-			gc.gridy = 1;			
-			gc.fill = GridBagConstraints.HORIZONTAL;
-			gc.weighty = 0.0;
-			add(pnlActions,gc);
-		}	
-		
-		// set the severity icon 
-		switch(issue.getSeverity()){
-		case WARNING: 
-			lblIcon.setIcon(ImageProvider.get("warning-small"));
-			break;
-		case ERROR:
-			lblIcon.setIcon(ImageProvider.get("error"));
-			break;
-		}		
-	}
-	
-	/**
-	 * Creates an issue view for an issue.
-	 * 
-	 * @param issue the issue. Must not be null.
-	 * @throws IllegalArgumentException thrown if issue is null.
-	 */
-	public IssueView(Issue issue) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(issue, "issue");
-		this.issue = issue;
-		build();		
-	}
+        
+        // if there are any actions available to resolve the issue, add a panel with action buttons 
+        if (!issue.getActions().isEmpty()) {
+            pnlActions = new JPanel(new FlowLayout(FlowLayout.LEFT));
+            pnlActions.setBackground(Color.WHITE);
+            for (Action action: issue.getActions()){
+                JButton btn = new JButton(action);
+                pnlActions.add(btn);                
+            }
+            
+            gc.gridx = 1;           
+            gc.gridy = 1;           
+            gc.fill = GridBagConstraints.HORIZONTAL;
+            gc.weighty = 0.0;
+            add(pnlActions,gc);
+        }   
+        
+        // set the severity icon 
+        switch(issue.getSeverity()){
+        case WARNING: 
+            lblIcon.setIcon(ImageProvider.get("warning-small"));
+            break;
+        case ERROR:
+            lblIcon.setIcon(ImageProvider.get("error"));
+            break;
+        }       
+    }
+    
+    /**
+     * Creates an issue view for an issue.
+     * 
+     * @param issue the issue. Must not be null.
+     * @throws IllegalArgumentException thrown if issue is null.
+     */
+    public IssueView(Issue issue) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(issue, "issue");
+        this.issue = issue;
+        build();        
+    }
 
-	@Override
-	public Dimension getMinimumSize() {
-		return super.getPreferredSize();
-	}
+    @Override
+    public Dimension getMinimumSize() {
+        return super.getPreferredSize();
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesModel.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesModel.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesModel.java	(revision 23192)
@@ -31,234 +31,234 @@
  */
 public class IssuesModel extends Observable implements Observer{
-	private final ArrayList<Issue> issues = new ArrayList<Issue>();
-	private TurnRestrictionEditorModel editorModel;
-	
-	/**
-	 * Creates the model 
-	 * 
-	 * {@code controler} is used in resolution actions for issues in
-	 * this model to direct the user to a specific input field in one
-	 * of the editor tabs in order to fix an issue. 
-	 * 
-	 * @param editorModel the editor model. Must not be null.
-	 * @throws IllegalArgumentException thrown if controler is null
-	 */
-	public IssuesModel(TurnRestrictionEditorModel editorModel) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(editorModel, "editorModel");
-		this.editorModel = editorModel;
-		this.editorModel.addObserver(this);
-	}
-	
-	/**
-	 * Populates the model with a list of issues. Just clears the model
-	 * if {@code issues} is null or empty. 
-	 * 
-	 * @param issues the list of issues. 
-	 */
-	public void populate(List<Issue> issues){
-		this.issues.clear();
-		if (issues != null){
-			this.issues.addAll(issues);
-		}
-		setChanged();
-		notifyObservers();
-	}
-	
-	/**
-	 * Replies the (unmodifiable) list of issues in this model.
-	 * 
-	 * @return the (unmodifiable) list of issues in this model.
-	 */
-	public List<Issue> getIssues() {
-		return Collections.unmodifiableList(issues);
-	}
-	
-	/**
-	 * Replies the turn restriction editor model 
-	 * 
-	 * @return
-	 */
-	public TurnRestrictionEditorModel getEditorModel() {
-		return editorModel;
-	}
-	
-	/**
-	 * Populates this model with issues derived from the state of the
-	 * turn restriction editor model. If {@code editorModel} is null, the
-	 * list of issues is cleared.
-	 * 
-	 * @param editorModel the editor model. 
-	 */
-	public void populate() {
-		issues.clear();
-		if (editorModel != null) {
-			checkTags(editorModel);
-			checkFromLeg(editorModel);
-			checkToLeg(editorModel);
-			checkFromAndToEquals(editorModel);
-			checkVias(editorModel);
-		}
-		setChanged();
-		notifyObservers();
-	}
-	
-	/**
-	 * Checks whether there are required tags missing. 
-	 * 
-	 * @param editorModel
-	 */
-	protected void checkTags(TurnRestrictionEditorModel editorModel) {
-		TagEditorModel tagEditorModel = editorModel.getTagEditorModel();
-		TagModel tag = tagEditorModel.get("type");
-		
-		// missing marker tag for a turn restriction
-		if (tag == null || ! tag.getValue().trim().equals("restriction")) {
-			issues.add(new RequiredTagMissingError(this, "type", "restriction"));
-		}
-		
-		// missing or illegal restriction type ?
-		tag = tagEditorModel.get("restriction");
-		if (tag == null) {
-			issues.add(new MissingRestrictionTypeError(this));
-		} else if (!TurnRestrictionType.isStandardTagValue(tag.getValue())) {
-			issues.add(new IllegalRestrictionTypeError(this, tag.getValue()));
-		}
-
-		// non-standard value for the 'except' tag? 
-		ExceptValueModel except = getEditorModel().getExcept();
-		if (!except.isStandard()) {
-			issues.add(new NonStandardExceptWarning(this, except));
-		}
-	}
-	
-	/**
-	 * Checks various data integrity restriction for the relation member with
-	 * role 'from'.
-	 * 
-	 */
-	protected void checkFromLeg(TurnRestrictionEditorModel editorModel) {
-		Set<OsmPrimitive> froms = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM);
-		if (froms.isEmpty()){
-			issues.add(new MissingTurnRestrictionLegError(this, TurnRestrictionLegRole.FROM));
-			return;
-		} else if (froms.size() > 1){
-			issues.add(new MultipleTurnRestrictionLegError(this, TurnRestrictionLegRole.FROM, froms.size()));
-			return;
-		} 
-		OsmPrimitive p = froms.iterator().next();
-		if (! (p instanceof Way)) {
-			issues.add(new WrongTurnRestrictionLegTypeError(this, TurnRestrictionLegRole.FROM, p));
-		}
-	}
-	
-	/**
-	 * Checks various data integrity restriction for the relation member with
-	 * role 'to'.
-	 * 
-	 */
-	protected void checkToLeg(TurnRestrictionEditorModel editorModel) {
-		Set<OsmPrimitive> toLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.TO);
-		if (toLegs.isEmpty()){
-			issues.add(new MissingTurnRestrictionLegError(this, TurnRestrictionLegRole.TO));
-			return;
-		} else if (toLegs.size() > 1){
-			issues.add(new MultipleTurnRestrictionLegError(this, TurnRestrictionLegRole.TO, toLegs.size()));
-			return;
-		} 
-		OsmPrimitive p = toLegs.iterator().next();
-		if (! (p instanceof Way)) {
-			issues.add(new WrongTurnRestrictionLegTypeError(this, TurnRestrictionLegRole.TO, p));
-		}
-	}
-	
-	/**
-	 * Creates an issue if this turn restriction has identical 'from' and to'.
-	 * 
-	 * @param editorModel
-	 */
-	protected void checkFromAndToEquals(TurnRestrictionEditorModel editorModel){
-		Set<OsmPrimitive> toLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.TO);
-		Set<OsmPrimitive> fromLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM);
-		if (toLegs.size() != 1 || fromLegs.size() != 1) return;
-		
-		OsmPrimitive from = fromLegs.iterator().next();
-		OsmPrimitive to = toLegs.iterator().next();
-		
-		if (! (from instanceof Way)) return;
-		if (! (to instanceof Way)) return;
-		if (from.equals(to) && ! "no_u_turn".equals(editorModel.getRestrictionTagValue())){
-			// identical from and to allowed for "no_u_turn" only
-			//
-			issues.add(new IdenticalTurnRestrictionLegsError(this, from));
-		}		
-	}
-	
-	protected Node getNodeAtIntersection(Way from, Way to){
-		Set<Node> fromNodes = new HashSet<Node>(from.getNodes());
-		fromNodes.retainAll(to.getNodes());
-		if (fromNodes.size() == 1){
-			return fromNodes.iterator().next();
-		} else {
-			return null;
-		}
-	}
-	
-	/**
-	 * Checks the 'via' members in the turn restriction
-	 * 
-	 * @param editorModel the editor model
-	 */
-	protected void checkVias(TurnRestrictionEditorModel editorModel){
-		Set<OsmPrimitive> toLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.TO);
-		Set<OsmPrimitive> fromLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM);
-		// we only check vias if 'to' and 'from' are already OK
-		if (toLegs.size() != 1 || fromLegs.size() != 1) return;
-		if (! (toLegs.iterator().next() instanceof Way)) return;
-		if (! (fromLegs.iterator().next() instanceof Way)) return;
-		
-		Way from = (Way)fromLegs.iterator().next();
-		Way to = (Way)toLegs.iterator().next();
-		Node intersect = getNodeAtIntersection(from, to);
-		if (intersect != null){
-			if (!editorModel.getVias().contains(intersect)) {
-				issues.add(new IntersectionMissingAsViaError(this, from, to, intersect));
-			}
-		}
-		
-		// 'from' intersects with 'to' - should be split  
-		if (intersect != null && from.getNode(0) != intersect && from.getNode(from.getNodesCount()-1) != intersect){
-			issues.add(new TurnRestrictionLegSplitRequiredError(this, TurnRestrictionLegRole.FROM, from, to, intersect));
-		}
-		// 'to' intersects with 'from' - should be split
-		if (intersect != null && to.getNode(0) != intersect && to.getNode(to.getNodesCount()-1) != intersect){
-			issues.add(new TurnRestrictionLegSplitRequiredError(this, TurnRestrictionLegRole.TO, from, to, intersect));
-		}		
-	}
-	
-	public NavigationControler getNavigationControler() {
-		return editorModel.getNavigationControler();
-	}
-	
-	public int getNumWarnings() {
-		int ret = 0;
-		for (Issue issue: issues){
-			if (issue.getSeverity().equals(Severity.WARNING)) ret++;
-		}
-		return ret;
-	}
-
-	public int getNumErrors() {
-		int ret = 0;
-		for (Issue issue: issues){
-			if (issue.getSeverity().equals(Severity.ERROR)) ret++;
-		}
-		return ret;
-	}
-
-	/* ------------------------------------------------------------------------------------- */
-	/* interface Observer                                                                    */
-	/* ------------------------------------------------------------------------------------- */
-	public void update(Observable o, Object arg) {
-		populate();		
-	}
+    private final ArrayList<Issue> issues = new ArrayList<Issue>();
+    private TurnRestrictionEditorModel editorModel;
+    
+    /**
+     * Creates the model 
+     * 
+     * {@code controler} is used in resolution actions for issues in
+     * this model to direct the user to a specific input field in one
+     * of the editor tabs in order to fix an issue. 
+     * 
+     * @param editorModel the editor model. Must not be null.
+     * @throws IllegalArgumentException thrown if controler is null
+     */
+    public IssuesModel(TurnRestrictionEditorModel editorModel) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(editorModel, "editorModel");
+        this.editorModel = editorModel;
+        this.editorModel.addObserver(this);
+    }
+    
+    /**
+     * Populates the model with a list of issues. Just clears the model
+     * if {@code issues} is null or empty. 
+     * 
+     * @param issues the list of issues. 
+     */
+    public void populate(List<Issue> issues){
+        this.issues.clear();
+        if (issues != null){
+            this.issues.addAll(issues);
+        }
+        setChanged();
+        notifyObservers();
+    }
+    
+    /**
+     * Replies the (unmodifiable) list of issues in this model.
+     * 
+     * @return the (unmodifiable) list of issues in this model.
+     */
+    public List<Issue> getIssues() {
+        return Collections.unmodifiableList(issues);
+    }
+    
+    /**
+     * Replies the turn restriction editor model 
+     * 
+     * @return
+     */
+    public TurnRestrictionEditorModel getEditorModel() {
+        return editorModel;
+    }
+    
+    /**
+     * Populates this model with issues derived from the state of the
+     * turn restriction editor model. If {@code editorModel} is null, the
+     * list of issues is cleared.
+     * 
+     * @param editorModel the editor model. 
+     */
+    public void populate() {
+        issues.clear();
+        if (editorModel != null) {
+            checkTags(editorModel);
+            checkFromLeg(editorModel);
+            checkToLeg(editorModel);
+            checkFromAndToEquals(editorModel);
+            checkVias(editorModel);
+        }
+        setChanged();
+        notifyObservers();
+    }
+    
+    /**
+     * Checks whether there are required tags missing. 
+     * 
+     * @param editorModel
+     */
+    protected void checkTags(TurnRestrictionEditorModel editorModel) {
+        TagEditorModel tagEditorModel = editorModel.getTagEditorModel();
+        TagModel tag = tagEditorModel.get("type");
+        
+        // missing marker tag for a turn restriction
+        if (tag == null || ! tag.getValue().trim().equals("restriction")) {
+            issues.add(new RequiredTagMissingError(this, "type", "restriction"));
+        }
+        
+        // missing or illegal restriction type ?
+        tag = tagEditorModel.get("restriction");
+        if (tag == null) {
+            issues.add(new MissingRestrictionTypeError(this));
+        } else if (!TurnRestrictionType.isStandardTagValue(tag.getValue())) {
+            issues.add(new IllegalRestrictionTypeError(this, tag.getValue()));
+        }
+
+        // non-standard value for the 'except' tag? 
+        ExceptValueModel except = getEditorModel().getExcept();
+        if (!except.isStandard()) {
+            issues.add(new NonStandardExceptWarning(this, except));
+        }
+    }
+    
+    /**
+     * Checks various data integrity restriction for the relation member with
+     * role 'from'.
+     * 
+     */
+    protected void checkFromLeg(TurnRestrictionEditorModel editorModel) {
+        Set<OsmPrimitive> froms = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM);
+        if (froms.isEmpty()){
+            issues.add(new MissingTurnRestrictionLegError(this, TurnRestrictionLegRole.FROM));
+            return;
+        } else if (froms.size() > 1){
+            issues.add(new MultipleTurnRestrictionLegError(this, TurnRestrictionLegRole.FROM, froms.size()));
+            return;
+        } 
+        OsmPrimitive p = froms.iterator().next();
+        if (! (p instanceof Way)) {
+            issues.add(new WrongTurnRestrictionLegTypeError(this, TurnRestrictionLegRole.FROM, p));
+        }
+    }
+    
+    /**
+     * Checks various data integrity restriction for the relation member with
+     * role 'to'.
+     * 
+     */
+    protected void checkToLeg(TurnRestrictionEditorModel editorModel) {
+        Set<OsmPrimitive> toLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.TO);
+        if (toLegs.isEmpty()){
+            issues.add(new MissingTurnRestrictionLegError(this, TurnRestrictionLegRole.TO));
+            return;
+        } else if (toLegs.size() > 1){
+            issues.add(new MultipleTurnRestrictionLegError(this, TurnRestrictionLegRole.TO, toLegs.size()));
+            return;
+        } 
+        OsmPrimitive p = toLegs.iterator().next();
+        if (! (p instanceof Way)) {
+            issues.add(new WrongTurnRestrictionLegTypeError(this, TurnRestrictionLegRole.TO, p));
+        }
+    }
+    
+    /**
+     * Creates an issue if this turn restriction has identical 'from' and to'.
+     * 
+     * @param editorModel
+     */
+    protected void checkFromAndToEquals(TurnRestrictionEditorModel editorModel){
+        Set<OsmPrimitive> toLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.TO);
+        Set<OsmPrimitive> fromLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM);
+        if (toLegs.size() != 1 || fromLegs.size() != 1) return;
+        
+        OsmPrimitive from = fromLegs.iterator().next();
+        OsmPrimitive to = toLegs.iterator().next();
+        
+        if (! (from instanceof Way)) return;
+        if (! (to instanceof Way)) return;
+        if (from.equals(to) && ! "no_u_turn".equals(editorModel.getRestrictionTagValue())){
+            // identical from and to allowed for "no_u_turn" only
+            //
+            issues.add(new IdenticalTurnRestrictionLegsError(this, from));
+        }       
+    }
+    
+    protected Node getNodeAtIntersection(Way from, Way to){
+        Set<Node> fromNodes = new HashSet<Node>(from.getNodes());
+        fromNodes.retainAll(to.getNodes());
+        if (fromNodes.size() == 1){
+            return fromNodes.iterator().next();
+        } else {
+            return null;
+        }
+    }
+    
+    /**
+     * Checks the 'via' members in the turn restriction
+     * 
+     * @param editorModel the editor model
+     */
+    protected void checkVias(TurnRestrictionEditorModel editorModel){
+        Set<OsmPrimitive> toLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.TO);
+        Set<OsmPrimitive> fromLegs = editorModel.getTurnRestrictionLeg(TurnRestrictionLegRole.FROM);
+        // we only check vias if 'to' and 'from' are already OK
+        if (toLegs.size() != 1 || fromLegs.size() != 1) return;
+        if (! (toLegs.iterator().next() instanceof Way)) return;
+        if (! (fromLegs.iterator().next() instanceof Way)) return;
+        
+        Way from = (Way)fromLegs.iterator().next();
+        Way to = (Way)toLegs.iterator().next();
+        Node intersect = getNodeAtIntersection(from, to);
+        if (intersect != null){
+            if (!editorModel.getVias().contains(intersect)) {
+                issues.add(new IntersectionMissingAsViaError(this, from, to, intersect));
+            }
+        }
+        
+        // 'from' intersects with 'to' - should be split  
+        if (intersect != null && from.getNode(0) != intersect && from.getNode(from.getNodesCount()-1) != intersect){
+            issues.add(new TurnRestrictionLegSplitRequiredError(this, TurnRestrictionLegRole.FROM, from, to, intersect));
+        }
+        // 'to' intersects with 'from' - should be split
+        if (intersect != null && to.getNode(0) != intersect && to.getNode(to.getNodesCount()-1) != intersect){
+            issues.add(new TurnRestrictionLegSplitRequiredError(this, TurnRestrictionLegRole.TO, from, to, intersect));
+        }       
+    }
+    
+    public NavigationControler getNavigationControler() {
+        return editorModel.getNavigationControler();
+    }
+    
+    public int getNumWarnings() {
+        int ret = 0;
+        for (Issue issue: issues){
+            if (issue.getSeverity().equals(Severity.WARNING)) ret++;
+        }
+        return ret;
+    }
+
+    public int getNumErrors() {
+        int ret = 0;
+        for (Issue issue: issues){
+            if (issue.getSeverity().equals(Severity.ERROR)) ret++;
+        }
+        return ret;
+    }
+
+    /* ------------------------------------------------------------------------------------- */
+    /* interface Observer                                                                    */
+    /* ------------------------------------------------------------------------------------- */
+    public void update(Observable o, Object arg) {
+        populate();     
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesView.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesView.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesView.java	(revision 23192)
@@ -17,56 +17,56 @@
  */
 public class IssuesView extends VerticallyScrollablePanel implements Observer{
-	static private final Logger logger = Logger.getLogger(IssuesView.class.getName());
-	
-	/** the issues model */
-	private IssuesModel model;
-	
-	protected void build(){
-		setLayout(new GridBagLayout());
-	}
-	
-	/**
-	 * Creates the view 
-	 * 
-	 * @param model the model. Must not be null.
-	 * @exception IllegalArgumentException thrown if model is null
-	 */
-	public IssuesView(IssuesModel model) throws IllegalArgumentException{
-		CheckParameterUtil.ensureParameterNotNull(model, "model");
-		this.model = model;
-		model.addObserver(this);
-		build();
-		HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#ErrorsAndWarnings"));
-	}
-	
-	/**
-	 * Refreshes the view with the current state in the model
-	 */
-	public void refresh() {
-		removeAll();
-		if (! model.getIssues().isEmpty()){
-			GridBagConstraints gc = new GridBagConstraints();
-			gc.anchor = GridBagConstraints.NORTHWEST;
-			gc.fill = GridBagConstraints.HORIZONTAL;
-			gc.weightx = 1.0;
-			gc.weighty = 0.0;
-			gc.gridx = 0;
-			gc.gridy = 0;
-			for (Issue issue: model.getIssues()){
-				add(new IssueView(issue), gc);
-				gc.gridy++;
-			}
-			// filler - grabs remaining space
-			gc.weighty = 1.0;			
-			add(new JPanel(), gc);
-		}
-		invalidate();
-	}
+    static private final Logger logger = Logger.getLogger(IssuesView.class.getName());
+    
+    /** the issues model */
+    private IssuesModel model;
+    
+    protected void build(){
+        setLayout(new GridBagLayout());
+    }
+    
+    /**
+     * Creates the view 
+     * 
+     * @param model the model. Must not be null.
+     * @exception IllegalArgumentException thrown if model is null
+     */
+    public IssuesView(IssuesModel model) throws IllegalArgumentException{
+        CheckParameterUtil.ensureParameterNotNull(model, "model");
+        this.model = model;
+        model.addObserver(this);
+        build();
+        HelpUtil.setHelpContext(this, HelpUtil.ht("/Plugins/turnrestrictions#ErrorsAndWarnings"));
+    }
+    
+    /**
+     * Refreshes the view with the current state in the model
+     */
+    public void refresh() {
+        removeAll();
+        if (! model.getIssues().isEmpty()){
+            GridBagConstraints gc = new GridBagConstraints();
+            gc.anchor = GridBagConstraints.NORTHWEST;
+            gc.fill = GridBagConstraints.HORIZONTAL;
+            gc.weightx = 1.0;
+            gc.weighty = 0.0;
+            gc.gridx = 0;
+            gc.gridy = 0;
+            for (Issue issue: model.getIssues()){
+                add(new IssueView(issue), gc);
+                gc.gridy++;
+            }
+            // filler - grabs remaining space
+            gc.weighty = 1.0;           
+            add(new JPanel(), gc);
+        }
+        invalidate();
+    }
 
-	/* ------------------------------------------------------------------------------- */
-	/* interface Observer                                                              */
-	/* ------------------------------------------------------------------------------- */
-	public void update(Observable o, Object arg) {
-		refresh();		
-	}
+    /* ------------------------------------------------------------------------------- */
+    /* interface Observer                                                              */
+    /* ------------------------------------------------------------------------------- */
+    public void update(Observable o, Object arg) {
+        refresh();      
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MissingRestrictionTypeError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MissingRestrictionTypeError.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MissingRestrictionTypeError.java	(revision 23192)
@@ -15,23 +15,23 @@
  */
 public class MissingRestrictionTypeError extends Issue{
-	
-	public MissingRestrictionTypeError(IssuesModel parent) {
-		super(parent, Severity.ERROR);
-		actions.add(new FixInEditorAction());
-	}
+    
+    public MissingRestrictionTypeError(IssuesModel parent) {
+        super(parent, Severity.ERROR);
+        actions.add(new FixInEditorAction());
+    }
 
-	@Override
-	public String getText() {
-		return tr("A turn restriction must declare the type of restriction. Please select a type in the Basic Editor.");				
-	}
-	
-	class FixInEditorAction extends AbstractAction {
-		public FixInEditorAction() {
-			putValue(NAME, tr("Fix in editor"));
-			putValue(SHORT_DESCRIPTION, tr("Go to Basic Editor and manually choose a turn restriction type"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			getIssuesModel().getNavigationControler().gotoBasicEditor(NavigationControler.BasicEditorFokusTargets.RESTRICION_TYPE);			
-		}		
-	}
+    @Override
+    public String getText() {
+        return tr("A turn restriction must declare the type of restriction. Please select a type in the Basic Editor.");                
+    }
+    
+    class FixInEditorAction extends AbstractAction {
+        public FixInEditorAction() {
+            putValue(NAME, tr("Fix in editor"));
+            putValue(SHORT_DESCRIPTION, tr("Go to Basic Editor and manually choose a turn restriction type"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            getIssuesModel().getNavigationControler().gotoBasicEditor(NavigationControler.BasicEditorFokusTargets.RESTRICION_TYPE);         
+        }       
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MissingTurnRestrictionLegError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MissingTurnRestrictionLegError.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MissingTurnRestrictionLegError.java	(revision 23192)
@@ -15,55 +15,55 @@
  */
 public class MissingTurnRestrictionLegError extends Issue {
-	private TurnRestrictionLegRole role;
+    private TurnRestrictionLegRole role;
 
-	/**
-	 * Creates the issue. 
-	 * 
-	 * @param parent the parent model 
-	 * @param role the role of the missing way
-	 */
-	public MissingTurnRestrictionLegError(IssuesModel parent, TurnRestrictionLegRole role) {
-		super(parent, Severity.ERROR);
-		this.role = role;
-		actions.add(new FixAction());
-	}
+    /**
+     * Creates the issue. 
+     * 
+     * @param parent the parent model 
+     * @param role the role of the missing way
+     */
+    public MissingTurnRestrictionLegError(IssuesModel parent, TurnRestrictionLegRole role) {
+        super(parent, Severity.ERROR);
+        this.role = role;
+        actions.add(new FixAction());
+    }
 
-	@Override
-	public String getText() {
-		String msg = "";
-		switch(role){
-		case FROM: 
-			msg = tr("An OSM way with role <tt>from</tt> is required in a turn restriction.");
-			break;
-		case TO: 
-			msg = tr("An OSM way with role <tt>to</tt> is required in a turn restriction.");
-			break;
-		}
-		msg += " " + tr("Please go to the Basic editor and manually choose an OSM way.");
-		return msg;
-	}
+    @Override
+    public String getText() {
+        String msg = "";
+        switch(role){
+        case FROM: 
+            msg = tr("An OSM way with role <tt>from</tt> is required in a turn restriction.");
+            break;
+        case TO: 
+            msg = tr("An OSM way with role <tt>to</tt> is required in a turn restriction.");
+            break;
+        }
+        msg += " " + tr("Please go to the Basic editor and manually choose an OSM way.");
+        return msg;
+    }
 
-	class FixAction extends AbstractAction {
-		public FixAction() {
-			putValue(NAME, tr("Add in editor"));
-			switch(role){
-			case FROM:
-				putValue(SHORT_DESCRIPTION, tr("Add an OSM way with role ''from''"));
-				break;
-			case TO:
-				putValue(SHORT_DESCRIPTION, tr("Add an OSM way with role ''to''"));
-				break;				
-			}			
-		}
-		public void actionPerformed(ActionEvent e) {
-			switch(role){
-			case FROM:
-				getIssuesModel().getNavigationControler().gotoBasicEditor(FROM);
-				break;
-			case TO:
-				getIssuesModel().getNavigationControler().gotoBasicEditor(TO);
-				break;				
-			}			
-		}		
-	}
+    class FixAction extends AbstractAction {
+        public FixAction() {
+            putValue(NAME, tr("Add in editor"));
+            switch(role){
+            case FROM:
+                putValue(SHORT_DESCRIPTION, tr("Add an OSM way with role ''from''"));
+                break;
+            case TO:
+                putValue(SHORT_DESCRIPTION, tr("Add an OSM way with role ''to''"));
+                break;              
+            }           
+        }
+        public void actionPerformed(ActionEvent e) {
+            switch(role){
+            case FROM:
+                getIssuesModel().getNavigationControler().gotoBasicEditor(FROM);
+                break;
+            case TO:
+                getIssuesModel().getNavigationControler().gotoBasicEditor(TO);
+                break;              
+            }           
+        }       
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MultipleTurnRestrictionLegError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MultipleTurnRestrictionLegError.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/MultipleTurnRestrictionLegError.java	(revision 23192)
@@ -14,50 +14,50 @@
  */
 public class MultipleTurnRestrictionLegError extends Issue {
-	private TurnRestrictionLegRole role;
-	private int numLegs;
-	
-	/**
-	 * Create the issue
-	 * 
-	 * @param parent the parent model 
-	 * @param role the role of the turn restriction leg with multiple entries 
-	 * @param numLegs the number of legs
-	 */
-	public MultipleTurnRestrictionLegError(IssuesModel parent, TurnRestrictionLegRole role, int numLegs) {
-		super(parent, Severity.ERROR);
-		this.role = role;
-		this.numLegs = numLegs;
-		actions.add(new FixAction());
-	}
+    private TurnRestrictionLegRole role;
+    private int numLegs;
+    
+    /**
+     * Create the issue
+     * 
+     * @param parent the parent model 
+     * @param role the role of the turn restriction leg with multiple entries 
+     * @param numLegs the number of legs
+     */
+    public MultipleTurnRestrictionLegError(IssuesModel parent, TurnRestrictionLegRole role, int numLegs) {
+        super(parent, Severity.ERROR);
+        this.role = role;
+        this.numLegs = numLegs;
+        actions.add(new FixAction());
+    }
 
-	@Override
-	public String getText() {
-		switch(role){
-		case FROM:  
-			return tr("A turn restriction requires exactly one way with role <tt>from</tt>. "
-				+ "This turn restriction has {0} ways in this role. Please remove "
-				+ "{1} of them.",
-				numLegs,
-				numLegs -1
-			);
-		case TO: 
-			return tr("A turn restriction requires exactly one way with role <tt>to</tt>. "
-					+ "This turn restriction has {0} ways in this role. Please remove "
-					+ "{1} of them.",
-					numLegs,
-					numLegs -1
-				);
-		}
-		return "";
-	}
+    @Override
+    public String getText() {
+        switch(role){
+        case FROM:  
+            return tr("A turn restriction requires exactly one way with role <tt>from</tt>. "
+                + "This turn restriction has {0} ways in this role. Please remove "
+                + "{1} of them.",
+                numLegs,
+                numLegs -1
+            );
+        case TO: 
+            return tr("A turn restriction requires exactly one way with role <tt>to</tt>. "
+                    + "This turn restriction has {0} ways in this role. Please remove "
+                    + "{1} of them.",
+                    numLegs,
+                    numLegs -1
+                );
+        }
+        return "";
+    }
 
-	class FixAction extends AbstractAction {
-		public FixAction() {
-			putValue(NAME, tr("Fix in editor"));
-			putValue(SHORT_DESCRIPTION, tr("Go to the Advanced Editor and remove the members"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			getIssuesModel().getNavigationControler().gotoAdvancedEditor();
-		}		
-	}
+    class FixAction extends AbstractAction {
+        public FixAction() {
+            putValue(NAME, tr("Fix in editor"));
+            putValue(SHORT_DESCRIPTION, tr("Go to the Advanced Editor and remove the members"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            getIssuesModel().getNavigationControler().gotoAdvancedEditor();
+        }       
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/NonStandardExceptWarning.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/NonStandardExceptWarning.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/NonStandardExceptWarning.java	(revision 23192)
@@ -14,27 +14,27 @@
  */
 public class NonStandardExceptWarning extends Issue{
-	private ExceptValueModel value;
-	public NonStandardExceptWarning(IssuesModel parent, ExceptValueModel value) {
-		super(parent, Severity.WARNING);
-		actions.add(new FixInEditorAction());
-		this.value  = value;
-	}
+    private ExceptValueModel value;
+    public NonStandardExceptWarning(IssuesModel parent, ExceptValueModel value) {
+        super(parent, Severity.WARNING);
+        actions.add(new FixInEditorAction());
+        this.value  = value;
+    }
 
-	@Override
-	public String getText() {		
-		return tr("The tag <tt>except</tt> has the non-standard value <tt>{0}</tt>. "
-				+ "It is recommended to use standard values for <tt>except</tt> only.",
-				value.getValue()
-				);				
-	}
-	
-	class FixInEditorAction extends AbstractAction {
-		public FixInEditorAction() {
-			putValue(NAME, tr("Fix in editor"));
-			putValue(SHORT_DESCRIPTION, tr("Go to Basic Editor and select standard vehicle type based exceptions"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			getIssuesModel().getNavigationControler().gotoBasicEditor();		
-		}		
-	}
+    @Override
+    public String getText() {       
+        return tr("The tag <tt>except</tt> has the non-standard value <tt>{0}</tt>. "
+                + "It is recommended to use standard values for <tt>except</tt> only.",
+                value.getValue()
+                );              
+    }
+    
+    class FixInEditorAction extends AbstractAction {
+        public FixInEditorAction() {
+            putValue(NAME, tr("Fix in editor"));
+            putValue(SHORT_DESCRIPTION, tr("Go to Basic Editor and select standard vehicle type based exceptions"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            getIssuesModel().getNavigationControler().gotoBasicEditor();        
+        }       
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/RequiredTagMissingError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/RequiredTagMissingError.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/RequiredTagMissingError.java	(revision 23192)
@@ -15,44 +15,44 @@
  */
 public class RequiredTagMissingError extends Issue {
-	static private final Logger logger = Logger.getLogger(RequiredTagMissingError.class.getName());
-	private String tagKey;
-	private String tagValue;
-	
-	/**
-	 * Create the issue 
-	 * 
-	 * @param parent the issues model
-	 * @param tagKey the tag key 
-	 * @param tagValue the tag value 
-	 */
-	public RequiredTagMissingError(IssuesModel parent, String tagKey, String tagValue) {
-		super(parent, Severity.ERROR);
-		this.tagKey = tagKey;
-		this.tagValue = tagValue;
-		actions.add(new AddTagAction());
-	}
+    static private final Logger logger = Logger.getLogger(RequiredTagMissingError.class.getName());
+    private String tagKey;
+    private String tagValue;
+    
+    /**
+     * Create the issue 
+     * 
+     * @param parent the issues model
+     * @param tagKey the tag key 
+     * @param tagValue the tag value 
+     */
+    public RequiredTagMissingError(IssuesModel parent, String tagKey, String tagValue) {
+        super(parent, Severity.ERROR);
+        this.tagKey = tagKey;
+        this.tagValue = tagValue;
+        actions.add(new AddTagAction());
+    }
 
-	@Override
-	public String getText() {	
-		return tr("The required tag <tt>{0}={1}</tt> is missing.",				
-				this.tagKey,
-				this.tagValue
-		);
-	}
+    @Override
+    public String getText() {   
+        return tr("The required tag <tt>{0}={1}</tt> is missing.",              
+                this.tagKey,
+                this.tagValue
+        );
+    }
 
-	private class AddTagAction extends AbstractAction {
-		public AddTagAction(){
-			putValue(NAME,tr("Add missing tag"));
-			putValue(SHORT_DESCRIPTION, tr("Add the missing tag {0}={1}", tagKey, tagValue));		
-		}
-		
-		public void actionPerformed(ActionEvent e) {
-			TagEditorModel model = getIssuesModel().getEditorModel().getTagEditorModel();
-			TagModel t = model.get(tagKey);
-			if (t == null){
-				t = new TagModel(tagKey, tagValue);
-				model.prepend(t);
-			}			
-		}		 
-	}
+    private class AddTagAction extends AbstractAction {
+        public AddTagAction(){
+            putValue(NAME,tr("Add missing tag"));
+            putValue(SHORT_DESCRIPTION, tr("Add the missing tag {0}={1}", tagKey, tagValue));       
+        }
+        
+        public void actionPerformed(ActionEvent e) {
+            TagEditorModel model = getIssuesModel().getEditorModel().getTagEditorModel();
+            TagModel t = model.get(tagKey);
+            if (t == null){
+                t = new TagModel(tagKey, tagValue);
+                model.prepend(t);
+            }           
+        }        
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/Severity.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/Severity.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/Severity.java	(revision 23192)
@@ -2,5 +2,5 @@
 
 public enum Severity {
-	WARNING,
-	ERROR
+    WARNING,
+    ERROR
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/TurnRestrictionLegSplitRequiredError.java	(revision 23192)
@@ -23,74 +23,74 @@
  */
 public class TurnRestrictionLegSplitRequiredError extends Issue{
-	private TurnRestrictionLegRole role;
-	private Way from;
-	private Way to;
-	private Node interesect;
+    private TurnRestrictionLegRole role;
+    private Way from;
+    private Way to;
+    private Node interesect;
 
-	/**
-	 * Create the issue
-	 *
-	 * @param parent the parent model
-	 * @param role the role of the way which should be splitted
-	 * @param from the way with role 'from'
-	 * @param to the way with role 'to'
-	 * @param interesect the node at the intersection
-	 */
-	public TurnRestrictionLegSplitRequiredError(IssuesModel parent, TurnRestrictionLegRole role, Way from, Way to, Node intersect) {
-		super(parent, Severity.ERROR);
-		this.role = role;
-		this.from = from;
-		this.to = to;
-		this.interesect = intersect;
-		actions.add(new SplitAction());
-	}
+    /**
+     * Create the issue
+     *
+     * @param parent the parent model
+     * @param role the role of the way which should be splitted
+     * @param from the way with role 'from'
+     * @param to the way with role 'to'
+     * @param interesect the node at the intersection
+     */
+    public TurnRestrictionLegSplitRequiredError(IssuesModel parent, TurnRestrictionLegRole role, Way from, Way to, Node intersect) {
+        super(parent, Severity.ERROR);
+        this.role = role;
+        this.from = from;
+        this.to = to;
+        this.interesect = intersect;
+        actions.add(new SplitAction());
+    }
 
-	@Override
-	public String getText() {
-		String msg = null;
-		switch(role){
-		case FROM:
-			msg = tr("The OSM way <span class=\"object-name\">{0}</span> with role <tt>{1}</tt> should be split "
-				+ "at node <span class=\"object-name\">{2}</span> where it connects to way <span class=\"object-name\">{3}</span>.",
-				from.getDisplayName(DefaultNameFormatter.getInstance()),
-				role.getOsmRole(),
-				interesect.getDisplayName(DefaultNameFormatter.getInstance()),
-				to.getDisplayName(DefaultNameFormatter.getInstance())
-			);
-			break;
-		case TO:
-			msg = tr("The OSM way <span class=\"object-name\">{0}</span> with role <tt>{1}</tt> should be split "
-					+ "at node <span class=\"object-name\">{2}</span> where it connects to way <span class=\"object-name\">{3}</span>.",
-					to.getDisplayName(DefaultNameFormatter.getInstance()),
-					role.getOsmRole(),
-					interesect.getDisplayName(DefaultNameFormatter.getInstance()),
-					from.getDisplayName(DefaultNameFormatter.getInstance())
-				);
-			break;
-		}
-		return msg;
-	}
+    @Override
+    public String getText() {
+        String msg = null;
+        switch(role){
+        case FROM:
+            msg = tr("The OSM way <span class=\"object-name\">{0}</span> with role <tt>{1}</tt> should be split "
+                + "at node <span class=\"object-name\">{2}</span> where it connects to way <span class=\"object-name\">{3}</span>.",
+                from.getDisplayName(DefaultNameFormatter.getInstance()),
+                role.getOsmRole(),
+                interesect.getDisplayName(DefaultNameFormatter.getInstance()),
+                to.getDisplayName(DefaultNameFormatter.getInstance())
+            );
+            break;
+        case TO:
+            msg = tr("The OSM way <span class=\"object-name\">{0}</span> with role <tt>{1}</tt> should be split "
+                    + "at node <span class=\"object-name\">{2}</span> where it connects to way <span class=\"object-name\">{3}</span>.",
+                    to.getDisplayName(DefaultNameFormatter.getInstance()),
+                    role.getOsmRole(),
+                    interesect.getDisplayName(DefaultNameFormatter.getInstance()),
+                    from.getDisplayName(DefaultNameFormatter.getInstance())
+                );
+            break;
+        }
+        return msg;
+    }
 
-	class SplitAction extends AbstractAction {
-		public SplitAction() {
-			putValue(NAME, tr("Split now"));
-			putValue(SHORT_DESCRIPTION, tr("Splits the way"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			Way way = null;
-			switch(role){
-			case FROM: way = from; break;
-			case TO: way = to; break;
-			}
-			SplitWayResult result = SplitWayAction.split(
-					parent.getEditorModel().getLayer(),
-					way,
-					Collections.singletonList(interesect),
-					Collections.<OsmPrimitive>emptyList()
-			);
-			if (result != null){
-				Main.main.undoRedo.add(result.getCommand());
-			}
-		}
-	}
+    class SplitAction extends AbstractAction {
+        public SplitAction() {
+            putValue(NAME, tr("Split now"));
+            putValue(SHORT_DESCRIPTION, tr("Splits the way"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            Way way = null;
+            switch(role){
+            case FROM: way = from; break;
+            case TO: way = to; break;
+            }
+            SplitWayResult result = SplitWayAction.split(
+                    parent.getEditorModel().getLayer(),
+                    way,
+                    Collections.singletonList(interesect),
+                    Collections.<OsmPrimitive>emptyList()
+            );
+            if (result != null){
+                Main.main.undoRedo.add(result.getCommand());
+            }
+        }
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/WrongTurnRestrictionLegTypeError.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/WrongTurnRestrictionLegTypeError.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/qa/WrongTurnRestrictionLegTypeError.java	(revision 23192)
@@ -19,77 +19,77 @@
  */
 public class WrongTurnRestrictionLegTypeError extends Issue {
-	private TurnRestrictionLegRole role;
-	private OsmPrimitive leg;
+    private TurnRestrictionLegRole role;
+    private OsmPrimitive leg;
 
-	/**
-	 * Create the issue 
-	 * 
-	 * @param parent the parent model 
-	 * @param role the role of the turn restriction leg
-	 * @param leg the leg 
-	 */
-	public WrongTurnRestrictionLegTypeError(IssuesModel parent, TurnRestrictionLegRole role, OsmPrimitive leg) {
-		super(parent, Severity.ERROR);
-		this.role = role;
-		this.leg = leg;
-		actions.add(new DeleteAction());
-		actions.add(new FixInEditorAction());
-	}
+    /**
+     * Create the issue 
+     * 
+     * @param parent the parent model 
+     * @param role the role of the turn restriction leg
+     * @param leg the leg 
+     */
+    public WrongTurnRestrictionLegTypeError(IssuesModel parent, TurnRestrictionLegRole role, OsmPrimitive leg) {
+        super(parent, Severity.ERROR);
+        this.role = role;
+        this.leg = leg;
+        actions.add(new DeleteAction());
+        actions.add(new FixInEditorAction());
+    }
 
-	@Override
-	public String getText() {		
-		String msg = null;
-		switch(leg.getType()){
-		case NODE:
-			msg = tr(
-				"This turn restriction uses the OSM node <span class=\"object-name\">{0}</span> as member with role <tt>{1}</tt>.",
-				leg.getDisplayName(DefaultNameFormatter.getInstance()),
-				role.toString()
-			);
-			break;
-		case RELATION:
-			msg = tr("This turn restriction uses the OSM relation <span class=\"object-name\">{0}</span> as member with role <tt>{1}</tt>.",
-					leg.getDisplayName(DefaultNameFormatter.getInstance()),
-					role.toString()
-				);				
-			break;			
-		}
-		return msg + " " + tr("An OSM way is required instead.");
-	}
+    @Override
+    public String getText() {       
+        String msg = null;
+        switch(leg.getType()){
+        case NODE:
+            msg = tr(
+                "This turn restriction uses the OSM node <span class=\"object-name\">{0}</span> as member with role <tt>{1}</tt>.",
+                leg.getDisplayName(DefaultNameFormatter.getInstance()),
+                role.toString()
+            );
+            break;
+        case RELATION:
+            msg = tr("This turn restriction uses the OSM relation <span class=\"object-name\">{0}</span> as member with role <tt>{1}</tt>.",
+                    leg.getDisplayName(DefaultNameFormatter.getInstance()),
+                    role.toString()
+                );              
+            break;          
+        }
+        return msg + " " + tr("An OSM way is required instead.");
+    }
 
-	class DeleteAction extends AbstractAction {
-		public DeleteAction() {
-			putValue(NAME, tr("Delete"));
-			putValue(SHORT_DESCRIPTION, tr("Delete the member from the turn restriction"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			RelationMemberEditorModel model = getIssuesModel().getEditorModel().getRelationMemberEditorModel();
-			switch(role){
-			case FROM: 
-				model.setFromPrimitive(null);
-				break;
-			case TO:
-				model.setToPrimitive(null);
-				break;
-			}
-		}		
-	}
-	
-	class FixInEditorAction extends AbstractAction {
-		public FixInEditorAction() {
-			putValue(NAME, tr("Fix in editor"));
-			putValue(SHORT_DESCRIPTION, tr("Change to the Basic Editor and select an OSM way"));
-		}
-		public void actionPerformed(ActionEvent e) {
-			NavigationControler controler = getIssuesModel().getNavigationControler();
-			switch(role){
-			case FROM: 
-				controler.gotoBasicEditor(BasicEditorFokusTargets.FROM);
-				break;
-			case TO:
-				controler.gotoBasicEditor(BasicEditorFokusTargets.TO);
-				break;
-			}
-		}		
-	}
+    class DeleteAction extends AbstractAction {
+        public DeleteAction() {
+            putValue(NAME, tr("Delete"));
+            putValue(SHORT_DESCRIPTION, tr("Delete the member from the turn restriction"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            RelationMemberEditorModel model = getIssuesModel().getEditorModel().getRelationMemberEditorModel();
+            switch(role){
+            case FROM: 
+                model.setFromPrimitive(null);
+                break;
+            case TO:
+                model.setToPrimitive(null);
+                break;
+            }
+        }       
+    }
+    
+    class FixInEditorAction extends AbstractAction {
+        public FixInEditorAction() {
+            putValue(NAME, tr("Fix in editor"));
+            putValue(SHORT_DESCRIPTION, tr("Change to the Basic Editor and select an OSM way"));
+        }
+        public void actionPerformed(ActionEvent e) {
+            NavigationControler controler = getIssuesModel().getNavigationControler();
+            switch(role){
+            case FROM: 
+                controler.gotoBasicEditor(BasicEditorFokusTargets.FROM);
+                break;
+            case TO:
+                controler.gotoBasicEditor(BasicEditorFokusTargets.TO);
+                break;
+            }
+        }       
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanelTest.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanelTest.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/BasicEditorPanelTest.java	(revision 23192)
@@ -15,35 +15,35 @@
 public class BasicEditorPanelTest extends JFrame {
 
-	private TurnRestrictionEditorModel model;
-	private DataSet ds;
-	
-	public BasicEditorPanelTest() {
-		ds = new DataSet();
-		OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
-		// mock a controler 
-		NavigationControler controler = new NavigationControler() {
-			public void gotoAdvancedEditor() {
-			}
+    private TurnRestrictionEditorModel model;
+    private DataSet ds;
+    
+    public BasicEditorPanelTest() {
+        ds = new DataSet();
+        OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
+        // mock a controler 
+        NavigationControler controler = new NavigationControler() {
+            public void gotoAdvancedEditor() {
+            }
 
-			public void gotoBasicEditor() {
-			}
+            public void gotoBasicEditor() {
+            }
 
-			public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
-			}			
-		};
-		model = new TurnRestrictionEditorModel(layer, controler);
-		
-		BasicEditorPanel panel = new BasicEditorPanel(model);
-		
-		Container c = getContentPane();
-		c.setLayout(new BorderLayout());
-		c.add(panel, BorderLayout.CENTER);		
-		setSize(600,600);
-		setDefaultCloseOperation(EXIT_ON_CLOSE);
-	}
-	
-	
-	static public void main(String args[]) {
-		new BasicEditorPanelTest().setVisible(true);
-	}
+            public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            }           
+        };
+        model = new TurnRestrictionEditorModel(layer, controler);
+        
+        BasicEditorPanel panel = new BasicEditorPanel(model);
+        
+        Container c = getContentPane();
+        c.setLayout(new BorderLayout());
+        c.add(panel, BorderLayout.CENTER);      
+        setSize(600,600);
+        setDefaultCloseOperation(EXIT_ON_CLOSE);
+    }
+    
+    
+    static public void main(String args[]) {
+        new BasicEditorPanelTest().setVisible(true);
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBoxTest.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBoxTest.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionComboBoxTest.java	(revision 23192)
@@ -16,46 +16,46 @@
  */
 public class TurnRestrictionComboBoxTest extends JFrame {
-	
-	private TurnRestrictionEditorModel model;
-	private DataSet ds = new DataSet();
-	
-	protected void build() {
-		ds = new DataSet();
-		OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
-		// mock a controler 
-		NavigationControler controler = new NavigationControler() {
-			public void gotoAdvancedEditor() {
-			}
+    
+    private TurnRestrictionEditorModel model;
+    private DataSet ds = new DataSet();
+    
+    protected void build() {
+        ds = new DataSet();
+        OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
+        // mock a controler 
+        NavigationControler controler = new NavigationControler() {
+            public void gotoAdvancedEditor() {
+            }
 
-			public void gotoBasicEditor() {
-			}
+            public void gotoBasicEditor() {
+            }
 
-			public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
-			}			
-		};
-		model = new TurnRestrictionEditorModel(layer, controler);
-		
-		Container c = getContentPane();
-		c.setLayout(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 1.0;
-		
-		TurnRestrictionComboBox cb = new TurnRestrictionComboBox(
-				new TurnRestrictionComboBoxModel(model)
-		);
-		add(cb, gc);		
-	}
-	
-	public TurnRestrictionComboBoxTest() {
-		build();
-		setSize(600,600);
-		setDefaultCloseOperation(EXIT_ON_CLOSE);
-	}
-	
-	public static void main(String args[]) {
-		new TurnRestrictionComboBoxTest().setVisible(true);
-	}
+            public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            }           
+        };
+        model = new TurnRestrictionEditorModel(layer, controler);
+        
+        Container c = getContentPane();
+        c.setLayout(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 1.0;
+        
+        TurnRestrictionComboBox cb = new TurnRestrictionComboBox(
+                new TurnRestrictionComboBoxModel(model)
+        );
+        add(cb, gc);        
+    }
+    
+    public TurnRestrictionComboBoxTest() {
+        build();
+        setSize(600,600);
+        setDefaultCloseOperation(EXIT_ON_CLOSE);
+    }
+    
+    public static void main(String args[]) {
+        new TurnRestrictionComboBoxTest().setVisible(true);
+    }
 
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorTest.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorTest.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionEditorTest.java	(revision 23192)
@@ -10,16 +10,16 @@
  */
 public class TurnRestrictionEditorTest extends JFrame {
-	
-	public TurnRestrictionEditorTest() {
-		setSize(10,10);
-		TurnRestrictionEditor editor = new TurnRestrictionEditor(this, new OsmDataLayer(new DataSet(), "test", null));
-		editor.setSize(600,600);
-		editor.setVisible(true);
-		
-		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-	}
-	
-	static public void main(String args[]) {
-		new TurnRestrictionEditorTest().setVisible(true);
-	}
+    
+    public TurnRestrictionEditorTest() {
+        setSize(10,10);
+        TurnRestrictionEditor editor = new TurnRestrictionEditor(this, new OsmDataLayer(new DataSet(), "test", null));
+        editor.setSize(600,600);
+        editor.setVisible(true);
+        
+        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+    }
+    
+    static public void main(String args[]) {
+        new TurnRestrictionEditorTest().setVisible(true);
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorTest.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorTest.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorTest.java	(revision 23192)
@@ -34,125 +34,125 @@
  */
 public class TurnRestrictionLegEditorTest extends JFrame {
-	
-	private JTextArea taTest;
-	private TurnRestrictionLegEditor editor;
-	private TurnRestrictionEditorModel model;
-	private JList lstObjects;
-	private DefaultListModel listModel;
-	private DataSet dataSet;
-	
-	
-	protected JPanel buildLegEditorPanel() {
-		DataSet ds = new DataSet();
-		OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
-		// mock a controler 
-		NavigationControler controler = new NavigationControler() {
-			public void gotoAdvancedEditor() {
-			}
+    
+    private JTextArea taTest;
+    private TurnRestrictionLegEditor editor;
+    private TurnRestrictionEditorModel model;
+    private JList lstObjects;
+    private DefaultListModel listModel;
+    private DataSet dataSet;
+    
+    
+    protected JPanel buildLegEditorPanel() {
+        DataSet ds = new DataSet();
+        OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
+        // mock a controler 
+        NavigationControler controler = new NavigationControler() {
+            public void gotoAdvancedEditor() {
+            }
 
-			public void gotoBasicEditor() {
-			}
+            public void gotoBasicEditor() {
+            }
 
-			public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
-			}			
-		};
-		JPanel pnl = new JPanel(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;
-		gc.weightx = 0.0;		
-		pnl.add(new JLabel("From"), gc);
-		
-		gc.weightx = 1.0;
-		gc.gridx = 1;
-		model = new TurnRestrictionEditorModel(layer, controler);
-		dataSet = new DataSet();
-		model.populate(new Relation());
-		pnl.add(editor = new TurnRestrictionLegEditor(model, TurnRestrictionLegRole.FROM), gc);
-		
-		return pnl;
-	}
-	
-	protected JPanel buildObjectListPanel() {
-		JPanel pnl = new JPanel(new BorderLayout());
-		listModel = new DefaultListModel();
-		pnl.add(new JScrollPane(lstObjects = new JList(listModel)), BorderLayout.CENTER);
-		lstObjects.setCellRenderer(new OsmPrimitivRenderer());		
-		
-		PrimitiveIdListProvider provider = new PrimitiveIdListProvider() {			
-			public List<PrimitiveId> getSelectedPrimitiveIds() {
-				List<PrimitiveId> ret = new ArrayList<PrimitiveId>();
-				int [] sel = lstObjects.getSelectedIndices();
-				for (int i: sel){
-					ret.add(((OsmPrimitive)lstObjects.getModel().getElementAt(i)).getPrimitiveId());
-				}
-				return ret;
-			}
-		};
-		
-		lstObjects.setTransferHandler(new PrimitiveIdListTransferHandler(provider));
-		lstObjects.setDragEnabled(true);
-		return pnl;
-	}
-	
-	protected void build() {
-		Container c = getContentPane();
-		c.setLayout(new GridBagLayout());
-		
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.HORIZONTAL;	
-		gc.insets = new Insets(20, 0, 20, 0);
-		gc.weightx = 1.0;		
-		gc.weighty = 0.0;
-		add(buildLegEditorPanel(), gc);
-		
-		gc.gridy = 1;
-		gc.weightx = 1.0;
-		gc.weighty = 1.0;
-		gc.fill = GridBagConstraints.BOTH;
-		add(buildObjectListPanel(), gc);
-		setSize(600,600);	
-	}
-	
-	protected void initForTest1() {
-		Way w = new Way(1);
-		w.put("name", "way-1");
-		
-		editor.getModel().setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, w);
-	}
-	
-	protected void initForTest2() {
-		Way w = new Way(1);
-		w.put("name", "way-1");		
-		dataSet.addPrimitive(w);
-		editor.getModel().setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, w);
-		
-		Node n = new Node(new LatLon(1,1));
-		n.setOsmId(1, 1);
-		n.put("name", "node.1");
-		dataSet.addPrimitive(n);
-		listModel.addElement(n);
-		
-		w = new Way();
-		w.setOsmId(2,1);
-		w.put("name", "way.1");
-		dataSet.addPrimitive(w);
-		listModel.addElement(w);
-		
-		Relation r = new Relation();
-		r.setOsmId(3,1);
-		r.put("name", "relation.1");
-		dataSet.addPrimitive(r);
-		listModel.addElement(r);
-	}
+            public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            }           
+        };
+        JPanel pnl = new JPanel(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;
+        gc.weightx = 0.0;       
+        pnl.add(new JLabel("From"), gc);
+        
+        gc.weightx = 1.0;
+        gc.gridx = 1;
+        model = new TurnRestrictionEditorModel(layer, controler);
+        dataSet = new DataSet();
+        model.populate(new Relation());
+        pnl.add(editor = new TurnRestrictionLegEditor(model, TurnRestrictionLegRole.FROM), gc);
+        
+        return pnl;
+    }
+    
+    protected JPanel buildObjectListPanel() {
+        JPanel pnl = new JPanel(new BorderLayout());
+        listModel = new DefaultListModel();
+        pnl.add(new JScrollPane(lstObjects = new JList(listModel)), BorderLayout.CENTER);
+        lstObjects.setCellRenderer(new OsmPrimitivRenderer());      
+        
+        PrimitiveIdListProvider provider = new PrimitiveIdListProvider() {          
+            public List<PrimitiveId> getSelectedPrimitiveIds() {
+                List<PrimitiveId> ret = new ArrayList<PrimitiveId>();
+                int [] sel = lstObjects.getSelectedIndices();
+                for (int i: sel){
+                    ret.add(((OsmPrimitive)lstObjects.getModel().getElementAt(i)).getPrimitiveId());
+                }
+                return ret;
+            }
+        };
+        
+        lstObjects.setTransferHandler(new PrimitiveIdListTransferHandler(provider));
+        lstObjects.setDragEnabled(true);
+        return pnl;
+    }
+    
+    protected void build() {
+        Container c = getContentPane();
+        c.setLayout(new GridBagLayout());
+        
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.HORIZONTAL;    
+        gc.insets = new Insets(20, 0, 20, 0);
+        gc.weightx = 1.0;       
+        gc.weighty = 0.0;
+        add(buildLegEditorPanel(), gc);
+        
+        gc.gridy = 1;
+        gc.weightx = 1.0;
+        gc.weighty = 1.0;
+        gc.fill = GridBagConstraints.BOTH;
+        add(buildObjectListPanel(), gc);
+        setSize(600,600);   
+    }
+    
+    protected void initForTest1() {
+        Way w = new Way(1);
+        w.put("name", "way-1");
+        
+        editor.getModel().setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, w);
+    }
+    
+    protected void initForTest2() {
+        Way w = new Way(1);
+        w.put("name", "way-1");     
+        dataSet.addPrimitive(w);
+        editor.getModel().setTurnRestrictionLeg(TurnRestrictionLegRole.FROM, w);
+        
+        Node n = new Node(new LatLon(1,1));
+        n.setOsmId(1, 1);
+        n.put("name", "node.1");
+        dataSet.addPrimitive(n);
+        listModel.addElement(n);
+        
+        w = new Way();
+        w.setOsmId(2,1);
+        w.put("name", "way.1");
+        dataSet.addPrimitive(w);
+        listModel.addElement(w);
+        
+        Relation r = new Relation();
+        r.setOsmId(3,1);
+        r.put("name", "relation.1");
+        dataSet.addPrimitive(r);
+        listModel.addElement(r);
+    }
 
-	public TurnRestrictionLegEditorTest(){
-		build();
-		initForTest2();
-	}
-	
-	static public void main(String args[]) {
-		new TurnRestrictionLegEditorTest().setVisible(true);
-	}
+    public TurnRestrictionLegEditorTest(){
+        build();
+        initForTest2();
+    }
+    
+    static public void main(String args[]) {
+        new TurnRestrictionLegEditorTest().setVisible(true);
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/VehicleExceptionEditorTest.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/VehicleExceptionEditorTest.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/VehicleExceptionEditorTest.java	(revision 23192)
@@ -15,46 +15,46 @@
  */
 public class VehicleExceptionEditorTest extends JFrame {
-	TurnRestrictionEditorModel model;
-	OsmDataLayer layer;
-	VehicleExceptionEditor editor;
-	
-	protected void build() {
-		Container c = getContentPane();
-		c.setLayout(new BorderLayout());
-		layer = new OsmDataLayer(new DataSet(), "test", null);
+    TurnRestrictionEditorModel model;
+    OsmDataLayer layer;
+    VehicleExceptionEditor editor;
+    
+    protected void build() {
+        Container c = getContentPane();
+        c.setLayout(new BorderLayout());
+        layer = new OsmDataLayer(new DataSet(), "test", null);
 
-		model = new TurnRestrictionEditorModel(layer, new MockNavigationControler());		
-		editor = new VehicleExceptionEditor(model);
-		c.add(editor, BorderLayout.CENTER);
-		
-		model.getTagEditorModel().add(new TagModel("except", "non-standard-value"));
-	}
-	
-	public VehicleExceptionEditorTest(){
-		build();
-		setDefaultCloseOperation(EXIT_ON_CLOSE);
-		setSize(500,500);		
-	}
-	
-	public static void main(String args[]){
-		new VehicleExceptionEditorTest().setVisible(true);
-	}
-	
-	static private class MockNavigationControler implements NavigationControler{
+        model = new TurnRestrictionEditorModel(layer, new MockNavigationControler());       
+        editor = new VehicleExceptionEditor(model);
+        c.add(editor, BorderLayout.CENTER);
+        
+        model.getTagEditorModel().add(new TagModel("except", "non-standard-value"));
+    }
+    
+    public VehicleExceptionEditorTest(){
+        build();
+        setDefaultCloseOperation(EXIT_ON_CLOSE);
+        setSize(500,500);       
+    }
+    
+    public static void main(String args[]){
+        new VehicleExceptionEditorTest().setVisible(true);
+    }
+    
+    static private class MockNavigationControler implements NavigationControler{
 
-		public void gotoAdvancedEditor() {
-			// TODO Auto-generated method stub
-			
-		}
+        public void gotoAdvancedEditor() {
+            // TODO Auto-generated method stub
+            
+        }
 
-		public void gotoBasicEditor() {
-			// TODO Auto-generated method stub
-			
-		}
+        public void gotoBasicEditor() {
+            // TODO Auto-generated method stub
+            
+        }
 
-		public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
-			// TODO Auto-generated method stub
-			
-		}
-	}
+        public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            // TODO Auto-generated method stub
+            
+        }
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListTest.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListTest.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListTest.java	(revision 23192)
@@ -22,65 +22,65 @@
  */
 public class ViaListTest  extends JFrame{
-	
-	private ViaList lstVias;
-	private TurnRestrictionEditorModel model;
-	private JList lstJOSMSelection;
-	
-	
-	protected void build() {
-		DataSet ds = new DataSet();
-		OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
-		// mock a controler 
-		NavigationControler controler = new NavigationControler() {
-			public void gotoAdvancedEditor() {
-			}
+    
+    private ViaList lstVias;
+    private TurnRestrictionEditorModel model;
+    private JList lstJOSMSelection;
+    
+    
+    protected void build() {
+        DataSet ds = new DataSet();
+        OsmDataLayer layer =new OsmDataLayer(ds, "test",null);
+        // mock a controler 
+        NavigationControler controler = new NavigationControler() {
+            public void gotoAdvancedEditor() {
+            }
 
-			public void gotoBasicEditor() {
-			}
+            public void gotoBasicEditor() {
+            }
 
-			public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
-			}			
-		};
-		model = new TurnRestrictionEditorModel(layer, controler);
-		Container c = getContentPane();
-		
-		c.setLayout(new GridBagLayout());
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.insets = new Insets(5,5,5,20);
-		gc.fill = GridBagConstraints.BOTH;
-		gc.weightx = 0.5;
-		gc.weighty = 1.0;
-		
-		DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
-		c.add(lstVias = new ViaList(new ViaListModel(model, selectionModel), selectionModel), gc);
-		
-		gc.gridx = 1;
-		c.add(lstJOSMSelection = new JList(), gc);
-		
-		setSize(600,600);		
-		setDefaultCloseOperation(EXIT_ON_CLOSE);
-	}
-	
-	protected void initTest1() {
-		DataSet ds = new DataSet();
-		Relation r = new Relation();
-		Node n;
-		for (int i = 1; i<10; i++){
-			n = new Node(new LatLon(i,i));	
-			n.put("name", "node." + i);
-			ds.addPrimitive(n);
-			r.addMember(new RelationMember("via",n));
-		}		
-		model.populate(r);
-	}
-	
-	public ViaListTest() {
-		build();		
-		initTest1();
-	}
-	
-	static public void main(String args[]) {
-		new ViaListTest().setVisible(true);
-	}
+            public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            }           
+        };
+        model = new TurnRestrictionEditorModel(layer, controler);
+        Container c = getContentPane();
+        
+        c.setLayout(new GridBagLayout());
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.insets = new Insets(5,5,5,20);
+        gc.fill = GridBagConstraints.BOTH;
+        gc.weightx = 0.5;
+        gc.weighty = 1.0;
+        
+        DefaultListSelectionModel selectionModel = new DefaultListSelectionModel();
+        c.add(lstVias = new ViaList(new ViaListModel(model, selectionModel), selectionModel), gc);
+        
+        gc.gridx = 1;
+        c.add(lstJOSMSelection = new JList(), gc);
+        
+        setSize(600,600);       
+        setDefaultCloseOperation(EXIT_ON_CLOSE);
+    }
+    
+    protected void initTest1() {
+        DataSet ds = new DataSet();
+        Relation r = new Relation();
+        Node n;
+        for (int i = 1; i<10; i++){
+            n = new Node(new LatLon(i,i));  
+            n.put("name", "node." + i);
+            ds.addPrimitive(n);
+            r.addMember(new RelationMember("via",n));
+        }       
+        model.populate(r);
+    }
+    
+    public ViaListTest() {
+        build();        
+        initTest1();
+    }
+    
+    static public void main(String args[]) {
+        new ViaListTest().setVisible(true);
+    }
 }
Index: /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesViewTest.java
===================================================================
--- /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesViewTest.java	(revision 23191)
+++ /applications/editors/josm/plugins/turnrestrictions/test/org/openstreetmap/josm/plugins/turnrestrictions/qa/IssuesViewTest.java	(revision 23192)
@@ -19,47 +19,47 @@
  */
 public class IssuesViewTest extends JFrame {
-	private IssuesModel model;
-	
-	protected void build() {
-		Container c = getContentPane();
-		c.setLayout(new GridBagLayout());
-		// mock a controler 
-		NavigationControler controler = new NavigationControler() {
-			public void gotoAdvancedEditor() {
-			}
+    private IssuesModel model;
+    
+    protected void build() {
+        Container c = getContentPane();
+        c.setLayout(new GridBagLayout());
+        // mock a controler 
+        NavigationControler controler = new NavigationControler() {
+            public void gotoAdvancedEditor() {
+            }
 
-			public void gotoBasicEditor() {
-			}
+            public void gotoBasicEditor() {
+            }
 
-			public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
-			}			
-		};
-		OsmDataLayer layer = new OsmDataLayer(new DataSet(), "test", null);
-		TurnRestrictionEditorModel editorModel = new TurnRestrictionEditorModel(layer, controler);
-		model = new IssuesModel(editorModel);
-		GridBagConstraints gc = new GridBagConstraints();
-		gc.anchor = GridBagConstraints.NORTHWEST;
-		gc.fill = GridBagConstraints.BOTH;
-		gc.weightx = 1.0;
-		gc.weighty = 1.0;
-		JScrollPane pane = new JScrollPane(new IssuesView(model));
-		pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
-		pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
-		c.add(pane, gc);
-		
-		List<Issue> issues = new ArrayList<Issue>();
-		issues.add(new RequiredTagMissingError(model, "type", "restriction"));
-		issues.add(new MissingRestrictionTypeError(model));
-		model.populate(issues);
-	}
-	
-	public IssuesViewTest() {
-		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-		setSize(400,600);
-		build();
-	}
-	
-	public static void main(String args[]) {
-		new IssuesViewTest().setVisible(true);
-	}
+            public void gotoBasicEditor(BasicEditorFokusTargets focusTarget) {
+            }           
+        };
+        OsmDataLayer layer = new OsmDataLayer(new DataSet(), "test", null);
+        TurnRestrictionEditorModel editorModel = new TurnRestrictionEditorModel(layer, controler);
+        model = new IssuesModel(editorModel);
+        GridBagConstraints gc = new GridBagConstraints();
+        gc.anchor = GridBagConstraints.NORTHWEST;
+        gc.fill = GridBagConstraints.BOTH;
+        gc.weightx = 1.0;
+        gc.weighty = 1.0;
+        JScrollPane pane = new JScrollPane(new IssuesView(model));
+        pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
+        pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
+        c.add(pane, gc);
+        
+        List<Issue> issues = new ArrayList<Issue>();
+        issues.add(new RequiredTagMissingError(model, "type", "restriction"));
+        issues.add(new MissingRestrictionTypeError(model));
+        model.populate(issues);
+    }
+    
+    public IssuesViewTest() {
+        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        setSize(400,600);
+        build();
+    }
+    
+    public static void main(String args[]) {
+        new IssuesViewTest().setVisible(true);
+    }
 }
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java	(revision 23191)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/OSMValidatorPlugin.java	(revision 23192)
@@ -111,5 +111,5 @@
      */
     public OSMValidatorPlugin(PluginInformation info) {
-    	super(info);
+        super(info);
         checkPluginDir();
         initializeGridDetail();
@@ -175,10 +175,10 @@
             MapView.addLayerChangeListener(this);
         } else
-        	MapView.removeLayerChangeListener(this);
+            MapView.removeLayerChangeListener(this);
         if (newFrame != null) {
-        	UploadAction.registerUploadHook(uploadHook = new ValidateUploadHook(this));
+            UploadAction.registerUploadHook(uploadHook = new ValidateUploadHook(this));
         } else {
-        	UploadAction.unregisterUploadHook(uploadHook);
-        	uploadHook = null;
+            UploadAction.unregisterUploadHook(uploadHook);
+            uploadHook = null;
         }
     }
@@ -280,5 +280,5 @@
                 e.printStackTrace();
                 JOptionPane.showMessageDialog(Main.parent,
-                		tr("Error initializing test {0}:\n {1}", test.getClass()
+                        tr("Error initializing test {0}:\n {1}", test.getClass()
                         .getSimpleName(), e),
                         tr("Error"),
@@ -306,13 +306,13 @@
 
     public void layerRemoved(Layer oldLayer) {
-    	if (oldLayer == errorLayer) {
-    		errorLayer = null;
-    		return;
-    	}
+        if (oldLayer == errorLayer) {
+            errorLayer = null;
+            return;
+        }
         layerErrors.remove(oldLayer);
         if (Main.map.mapView.getLayersOfType(OsmDataLayer.class).isEmpty()) {
-        	if (errorLayer != null) {
-        		Main.map.mapView.removeLayer(errorLayer);
-        	}
+            if (errorLayer != null) {
+                Main.map.mapView.removeLayer(errorLayer);
+            }
         }
     }
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/PreferenceEditor.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/PreferenceEditor.java	(revision 23191)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/PreferenceEditor.java	(revision 23192)
@@ -22,5 +22,5 @@
 /**
  * Preference settings for the validator plugin
- * 
+ *
  * @author frsantos
  */
@@ -52,5 +52,5 @@
     /**
      * The preferences key for enabling the permanent filtering
-     * of the displayed errors in the tree regarding the current selection 
+     * of the displayed errors in the tree regarding the current selection
      */
     public static final String PREF_FILTER_BY_SELECTION = PREFIX + ".selectionFilter";
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/Coastlines.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/Coastlines.java	(revision 23191)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/Coastlines.java	(revision 23192)
@@ -47,5 +47,5 @@
     public void startTest(ProgressMonitor monitor)
     {
-    	super.startTest(monitor);
+        super.startTest(monitor);
 
         OsmDataLayer layer = Main.map.mapView.getEditLayer();
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/CrossingWays.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/CrossingWays.java	(revision 23191)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/CrossingWays.java	(revision 23192)
@@ -53,5 +53,5 @@
     public void startTest(ProgressMonitor monitor)
     {
-    	super.startTest(monitor);
+        super.startTest(monitor);
         cellSegments = new HashMap<Point2D,List<ExtendedSegment>>(1000);
         errorSegments = new HashSet<WaySegment>();
@@ -62,5 +62,5 @@
     public void endTest()
     {
-    	super.endTest();
+        super.endTest();
         cellSegments = null;
         errorSegments = null;
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicateWay.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicateWay.java	(revision 23191)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicateWay.java	(revision 23192)
@@ -70,5 +70,5 @@
     public void startTest(ProgressMonitor monitor)
     {
-    	super.startTest(monitor);
+        super.startTest(monitor);
         ways = new Bag<WayPair, OsmPrimitive>(1000);
     }
@@ -77,5 +77,5 @@
     public void endTest()
     {
-    	super.endTest();
+        super.endTest();
         for(List<OsmPrimitive> duplicated : ways.values() )
         {
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicatedWayNodes.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicatedWayNodes.java	(revision 23191)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/DuplicatedWayNodes.java	(revision 23192)
@@ -50,9 +50,9 @@
         for (Node n : w.getNodes()) {
             if (lastN == null) {
-            	wnew.addNode(n);
+                wnew.addNode(n);
             } else if (n == lastN) {
                 // Skip this node
             } else {
-            	wnew.addNode(n);
+                wnew.addNode(n);
             }
             lastN = n;
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/NameMismatch.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/NameMismatch.java	(revision 23191)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/NameMismatch.java	(revision 23192)
@@ -74,6 +74,6 @@
                 tr("A name is missing, even though name:* exists."),
                                      NAME_MISSING, p));
-	    return;
-	}
+        return;
+    }
 
         if (names.contains(name)) return;
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java	(revision 23191)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/OverlappingWays.java	(revision 23192)
@@ -52,5 +52,5 @@
     public void startTest(ProgressMonitor monitor)
     {
-    	super.startTest(monitor);
+        super.startTest(monitor);
         nodePairs = new Bag<Pair<Node,Node>, WaySegment>(1000);
     }
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/SimilarNamedWays.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/SimilarNamedWays.java	(revision 23191)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/SimilarNamedWays.java	(revision 23192)
@@ -44,5 +44,5 @@
     public void startTest(ProgressMonitor monitor)
     {
-    	super.startTest(monitor);
+        super.startTest(monitor);
         cellWays = new HashMap<Point2D,List<Way>>(1000);
         errorWays = new Bag<Way, Way>();
Index: /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/WronglyOrderedWays.java
===================================================================
--- /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/WronglyOrderedWays.java	(revision 23191)
+++ /applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/tests/WronglyOrderedWays.java	(revision 23192)
@@ -40,5 +40,5 @@
     public void startTest(ProgressMonitor monitor)
     {
-    	super.startTest(monitor);
+        super.startTest(monitor);
         _errorWays = new Bag<Way, Way>();
     }
Index: /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java
===================================================================
--- /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java	(revision 23191)
+++ /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java	(revision 23192)
@@ -63,17 +63,17 @@
     
     
-	public void updateSearchResults(){
-		String searchfor = "";
-		listModel.clear();
-		SearchResultObjectCache.clear();
-		if (!first_time_search) {
-			searchfor = searchPattern.getText();
-		}
-		for (Iterator<Marker> i = engine.searchGpxWaypoints(searchfor).iterator(); i.hasNext();) {
-			Marker marker = i.next();
-			listModel.addElement(marker.getText());
-			SearchResultObjectCache.add(marker);
-		}
-	}
+    public void updateSearchResults(){
+        String searchfor = "";
+        listModel.clear();
+        SearchResultObjectCache.clear();
+        if (!first_time_search) {
+            searchfor = searchPattern.getText();
+        }
+        for (Iterator<Marker> i = engine.searchGpxWaypoints(searchfor).iterator(); i.hasNext();) {
+            Marker marker = i.next();
+            listModel.addElement(marker.getText());
+            SearchResultObjectCache.add(marker);
+        }
+    }
     
 
@@ -91,8 +91,8 @@
 
 
-	@Override
-	public void keyTyped(KeyEvent arg0) {
-		first_time_search = false;
-	}
+    @Override
+    public void keyTyped(KeyEvent arg0) {
+        first_time_search = false;
+    }
 
 
Index: /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/WaypointSearchPlugin.java
===================================================================
--- /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/WaypointSearchPlugin.java	(revision 23191)
+++ /applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/WaypointSearchPlugin.java	(revision 23192)
@@ -29,16 +29,16 @@
     }
 
-	
-	@Override
-	public void layerAdded(Layer newLayer) {
-		//add dialog
-		if (Main.map.getToggleDialog(SelectWaypointDialog.class)==null) {
-			Main.map.addToggleDialog(waypointDialog);
-		}
-		//update search
-		if (engine.gpxLayersExist()) {
-			waypointDialog.updateSearchResults();
-		}
-	}
+    
+    @Override
+    public void layerAdded(Layer newLayer) {
+        //add dialog
+        if (Main.map.getToggleDialog(SelectWaypointDialog.class)==null) {
+            Main.map.addToggleDialog(waypointDialog);
+        }
+        //update search
+        if (engine.gpxLayersExist()) {
+            waypointDialog.updateSearchResults();
+        }
+    }
 
 
