Index: applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java
===================================================================
--- applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java	(revision 12473)
+++ applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java	(revision 12778)
@@ -34,7 +34,7 @@
 public class MeasurementDialog extends ToggleDialog implements ActionListener
 {
-	private static final long serialVersionUID = 4708541586297950021L;
+    private static final long serialVersionUID = 4708541586297950021L;
 
-	/** 
+    /**
      * The reset button
      */
@@ -64,5 +64,5 @@
      * Constructor
      */
-    public MeasurementDialog() 
+    public MeasurementDialog()
     {
         super(tr("Measured values"), "measure", tr("Open the measurement window."),
@@ -78,41 +78,41 @@
 
         JPanel valuePanel = new JPanel(new GridLayout(0,2));
-        
+
         valuePanel.add(new JLabel(tr("Path Length")));
-        
+
         pathLengthLabel = new JLabel("0 m");
         valuePanel.add(pathLengthLabel);
-        
+
         valuePanel.add(new JLabel(tr("Selection Length")));
-        
+
         selectLengthLabel = new JLabel("0 m");
         valuePanel.add(selectLengthLabel);
 
         valuePanel.add(new JLabel(tr("Selection Area")));
-        
+
         selectAreaLabel = new JLabel("0 m\u00b2");
         valuePanel.add(selectAreaLabel);
-        
+
         JLabel angle = new JLabel(tr("Angle"));
         angle.setToolTipText(tr("Angle between two selected Nodes"));
         valuePanel.add(angle);
-        
+
         segAngleLabel = new JLabel("- \u00b0");
         valuePanel.add(segAngleLabel);
-        
+
         add(valuePanel, BorderLayout.CENTER);
 
         this.setPreferredSize(new Dimension(0, 92));
         final MeasurementDialog dlg = this;
-       //TODO: is this enough? 
+       //TODO: is this enough?
 
         Main.ds.selListeners.add(new SelectionChangedListener(){
 
-			public void selectionChanged(Collection<? extends OsmPrimitive> arg0) {
-				double length = 0.0;
-				double segAngle = 0.0;
+            public void selectionChanged(Collection<? extends OsmPrimitive> arg0) {
+                double length = 0.0;
+                double segAngle = 0.0;
                                 double area = 0.0;
                                 Node lastNode = null;
-				for(OsmPrimitive p:arg0){
+                for(OsmPrimitive p:arg0){
                                     if(p instanceof Node){
                                         Node n =(Node)p;
@@ -132,5 +132,5 @@
                                                 //http://local.wasp.uwa.edu.au/~pbourke/geometry/polyarea/
                                                 area += (MeasurementLayer.calcX(n.coor) * MeasurementLayer.calcY(lastN.coor))
-						      - (MeasurementLayer.calcY(n.coor) * MeasurementLayer.calcX(lastN.coor));
+                              - (MeasurementLayer.calcY(n.coor) * MeasurementLayer.calcX(lastN.coor));
                                             }
                                             lastN = n;
@@ -142,27 +142,27 @@
                                         }
                                     }
-				}
-				dlg.selectLengthLabel.setText(new DecimalFormat("#0.00").format(length) + " m");
+                }
+                dlg.selectLengthLabel.setText(new DecimalFormat("#0.00").format(length) + " m");
 
-				dlg.segAngleLabel.setText(new DecimalFormat("#0.0").format(segAngle) + " \u00b0");		
- 				dlg.selectAreaLabel.setText(new DecimalFormat("#0.00").format(area) + " m\u00b2");
-			}
-		});
-	}
+                dlg.segAngleLabel.setText(new DecimalFormat("#0.0").format(segAngle) + " \u00b0");
+                dlg.selectAreaLabel.setText(new DecimalFormat("#0.00").format(area) + " m\u00b2");
+            }
+        });
+    }
 
-	public void actionPerformed(ActionEvent e) 
-	{
-		String actionCommand = e.getActionCommand();
-		if( actionCommand.equals("Reset")){
-			resetValues();
-		}
-	}
-    
-	/**
-	 * Cleans the active Meausurement Layer
-	 */
-	public void resetValues(){
-		MeasurementPlugin.getCurrentLayer().reset();
-	}
-	
+    public void actionPerformed(ActionEvent e)
+    {
+        String actionCommand = e.getActionCommand();
+        if( actionCommand.equals("Reset")){
+            resetValues();
+        }
+    }
+
+    /**
+     * Cleans the active Meausurement Layer
+     */
+    public void resetValues(){
+        MeasurementPlugin.getCurrentLayer().reset();
+    }
+
 }
Index: applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java
===================================================================
--- applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java	(revision 12473)
+++ applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java	(revision 12778)
@@ -1,4 +1,4 @@
 package org.openstreetmap.josm.plugins.measurement;
-/// @author Raphael Mack <ramack@raphael-mack.de> 
+/// @author Raphael Mack <ramack@raphael-mack.de>
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -53,16 +53,16 @@
  */
 public class MeasurementLayer extends Layer {
-	
+
     public MeasurementLayer(String arg0) {
         super(arg0);
     }
 
-    private static Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(MeasurementPlugin.class.getResource("/images/measurement.png")));	
+    private static Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(MeasurementPlugin.class.getResource("/images/measurement.png")));
     private Collection<WayPoint> points = new ArrayList<WayPoint>(32);
-	
+
     @Override public Icon getIcon() {
         return icon;
     }
-	
+
     @Override public String getToolTipText() {
         return tr("Layer to make measurements");
@@ -76,5 +76,5 @@
     @Override public void mergeFrom(Layer from) {
         // TODO: nyi - doubts about how this should be done are around. Ideas?
-	
+
     }
 
@@ -110,5 +110,5 @@
             new JMenuItem(new LayerListPopup.InfoAction(this))};
     }
-	
+
     public void removeLastPoint(){
         WayPoint l = null;
@@ -116,11 +116,11 @@
         if(l != null) points.remove(l);
         recalculate();
-        Main.map.repaint();	
-    }
-	
-    public void mouseClicked(MouseEvent e){		
+        Main.map.repaint();
+    }
+
+    public void mouseClicked(MouseEvent e){
         if (e.getButton() != MouseEvent.BUTTON1) return;
 
-        LatLon coor = Main.map.mapView.getLatLon(e.getX(), e.getY());		
+        LatLon coor = Main.map.mapView.getLatLon(e.getX(), e.getY());
         points.add(new WayPoint(coor));
 
@@ -132,11 +132,11 @@
         points.clear();
         recalculate();
-        Main.map.repaint();		
-    }
-	
+        Main.map.repaint();
+    }
+
     private void recalculate(){
         double pathLength = 0.0, segLength = 0.0; // in meters
         WayPoint last = null;
-		
+
         pathLength = 0.0;
         for(WayPoint p : points){
@@ -151,9 +151,9 @@
         MeasurementPlugin.measurementDialog.pathLengthLabel.setText(pathLength < 800?nf2.format(pathLength) + " m":nf.format(pathLength/1000) + " km");
     }
-	
+
     public static double calcDistance(LatLon p1, LatLon p2){
         double lat1, lon1, lat2, lon2;
         double dlon, dlat;
-	    
+
         lat1 = p1.lat() * Math.PI / 180.0;
         lon1 = p1.lon() * Math.PI / 180.0;
@@ -172,5 +172,5 @@
         double lat1, lon1, lat2, lon2;
         double dlon, dlat;
-	    
+
         lat1 = p1.lat() * Math.PI / 180.0;
         lon1 = p1.lon() * Math.PI / 180.0;
@@ -185,9 +185,9 @@
         return 6367000 * c;
     }
-	
+
     public static double calcY(LatLon p1){
         double lat1, lon1, lat2, lon2;
         double dlon, dlat;
-	    
+
         lat1 = p1.lat() * Math.PI / 180.0;
         lon1 = p1.lon() * Math.PI / 180.0;
@@ -202,18 +202,18 @@
         return 6367000 * c;
     }
-	
+
     public static double calcDistance(WayPoint p1, WayPoint p2){
         return calcDistance(p1.latlon, p2.latlon);
     }
-	
+
     public static double angleBetween(WayPoint p1, WayPoint p2){
         return angleBetween(p1.latlon, p2.latlon);
     }
-	
+
     public static double angleBetween(LatLon p1, LatLon p2){
         double lat1, lon1, lat2, lon2;
         double dlon;
         double heading;
-	    
+
         lat1 = p1.lat() * Math.PI / 180.0;
         lon1 = p1.lon() * Math.PI / 180.0;
@@ -223,8 +223,8 @@
         dlon = lon2 - lon1;
         double coslat2 = Math.cos(lat2);
-        
+
         return (180 * Math.atan2(coslat2 * Math.sin(dlon),
                           (Math.cos(lat1) * Math.sin(lat2)
-                                    - 
+                                    -
                            Math.sin(lat1) * coslat2 * Math.cos(dlon)))) / Math.PI;
     }
@@ -234,5 +234,5 @@
         double dlon, dlat;
         double heading;
-	    
+
         lat1 = p1.lat() * Math.PI / 180.0;
         lon1 = p1.lon() * Math.PI / 180.0;
@@ -250,5 +250,5 @@
             heading = 2 * Math.PI - heading;
         }
- 
+
         return heading * 180 / Math.PI;
     }
@@ -257,34 +257,34 @@
     private class GPXLayerImportAction extends AbstractAction {
 
-	private MeasurementLayer layer;
-
-	/**
-	 * The data model for the list component.
-	 */
-	private DefaultListModel model = new DefaultListModel();
-
-	/**
-	 * @param layer the targeting measurement layer
-	 */
-	public GPXLayerImportAction(MeasurementLayer layer) {
-	    super(tr("Import path from GPX layer"), ImageProvider.get("dialogs", "edit")); // TODO: find better image
-	    this.layer = layer;
-	}
-
-	public void actionPerformed(ActionEvent e) {
-	    Box panel = Box.createVerticalBox();
-	    final JList layerList = new JList(model);
-	    Collection<Layer> data = Main.map.mapView.getAllLayers();
-	    Layer lastLayer = null;
-	    int layerCnt = 0;
-	    
-	    for (Layer l : data){
-                if(l instanceof GpxLayer){    
+    private MeasurementLayer layer;
+
+    /**
+     * The data model for the list component.
+     */
+    private DefaultListModel model = new DefaultListModel();
+
+    /**
+     * @param layer the targeting measurement layer
+     */
+    public GPXLayerImportAction(MeasurementLayer layer) {
+        super(tr("Import path from GPX layer"), ImageProvider.get("dialogs", "edit")); // TODO: find better image
+        this.layer = layer;
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        Box panel = Box.createVerticalBox();
+        final JList layerList = new JList(model);
+        Collection<Layer> data = Main.map.mapView.getAllLayers();
+        Layer lastLayer = null;
+        int layerCnt = 0;
+
+        for (Layer l : data){
+                if(l instanceof GpxLayer){
                     model.addElement(l);
                     lastLayer = l;
                     layerCnt++;
                 }
-	    }
-	    if(layerCnt == 1){
+        }
+        if(layerCnt == 1){
                 layerList.setSelectedValue(lastLayer, true);
             }
@@ -304,8 +304,8 @@
 
                 JCheckBox dropFirst = new JCheckBox(tr("Drop existing path"));
-	    
+
                 panel.add(layerList);
                 panel.add(dropFirst);
-	    
+
                 final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION){
                         @Override public void selectInitialValue() {
@@ -315,5 +315,5 @@
                 final JDialog dlg = optionPane.createDialog(Main.parent, tr("Import path from GPX layer"));
                 dlg.setVisible(true);
-	
+
                 Object answer = optionPane.getValue();
                 if (answer == null || answer == JOptionPane.UNINITIALIZED_VALUE ||
@@ -326,5 +326,5 @@
                     points = new ArrayList<WayPoint>(32);
                 }
-	    
+
                 for (GpxTrack trk : gpx.data.tracks) {
                     for (Collection<WayPoint> trkseg : trk.trackSegs) {
@@ -333,5 +333,5 @@
                         }
                     }
-	    	}
+            }
                 recalculate();
                 Main.parent.repaint();
Index: applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementMode.java
===================================================================
--- applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementMode.java	(revision 12473)
+++ applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementMode.java	(revision 12778)
@@ -15,40 +15,40 @@
 public class MeasurementMode extends MapMode {
 
-	private static final long serialVersionUID = 3853830673475744263L;
-	
-	public MeasurementMode(MapFrame mapFrame, String name, String desc) {
-		super(name, "measurement.png", desc, mapFrame, Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));		
-	}
+    private static final long serialVersionUID = 3853830673475744263L;
 
-	@Override public void enterMode() {
-		super.enterMode();
-		Main.map.mapView.addMouseListener(this);
-	}
+    public MeasurementMode(MapFrame mapFrame, String name, String desc) {
+        super(name, "measurement.png", desc, mapFrame, Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
+    }
 
-	@Override public void exitMode() {
-		super.exitMode();
-		Main.map.mapView.removeMouseListener(this);
-	}
+    @Override public void enterMode() {
+        super.enterMode();
+        Main.map.mapView.addMouseListener(this);
+    }
 
-	/**
-	 * If user clicked with the left button, add a node at the current mouse
-	 * position.
-	 *
-	 * If in nodesegment mode, add the node to the line segment by splitting the
-	 * segment. The new created segment will be inserted in every way the segment
-	 * was part of.
-	 */
-	@Override public void mouseClicked(MouseEvent e) {
-		if (e.getButton() == MouseEvent.BUTTON3){
-			MeasurementPlugin.getCurrentLayer().removeLastPoint();
-		}else if (e.getButton() == MouseEvent.BUTTON1){
-			LatLon coor = Main.map.mapView.getLatLon(e.getX(), e.getY());
-			if (coor.isOutSideWorld()) {
-				JOptionPane.showMessageDialog(Main.parent,tr("Can not draw outside of the world."));
-				return;
-			}
-			MeasurementPlugin.getCurrentLayer().mouseClicked(e);
-		}
-	}
+    @Override public void exitMode() {
+        super.exitMode();
+        Main.map.mapView.removeMouseListener(this);
+    }
+
+    /**
+     * If user clicked with the left button, add a node at the current mouse
+     * position.
+     *
+     * If in nodesegment mode, add the node to the line segment by splitting the
+     * segment. The new created segment will be inserted in every way the segment
+     * was part of.
+     */
+    @Override public void mouseClicked(MouseEvent e) {
+        if (e.getButton() == MouseEvent.BUTTON3){
+            MeasurementPlugin.getCurrentLayer().removeLastPoint();
+        }else if (e.getButton() == MouseEvent.BUTTON1){
+            LatLon coor = Main.map.mapView.getLatLon(e.getX(), e.getY());
+            if (coor.isOutSideWorld()) {
+                JOptionPane.showMessageDialog(Main.parent,tr("Can not draw outside of the world."));
+                return;
+            }
+            MeasurementPlugin.getCurrentLayer().mouseClicked(e);
+        }
+    }
 
 }
Index: applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementPlugin.java
===================================================================
--- applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementPlugin.java	(revision 12473)
+++ applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementPlugin.java	(revision 12778)
@@ -12,40 +12,40 @@
 public class MeasurementPlugin extends Plugin {
 
-	private IconToggleButton btn;
-	private MeasurementMode mode;
-	protected static MeasurementDialog measurementDialog;
-	protected static MeasurementLayer currentLayer;
-	
-	public MeasurementPlugin() {
-		mode = new MeasurementMode(Main.map, "measurement", tr("measurement mode"));
-		btn = new IconToggleButton(mode);
-		btn.setVisible(true);
-		measurementDialog = new MeasurementDialog();
-	}
-	
-	@Override
-	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-		if(newFrame != null)
-			newFrame.addToggleDialog(measurementDialog);
-		if(Main.map != null)
-			Main.map.addMapMode(btn);
-	}
+    private IconToggleButton btn;
+    private MeasurementMode mode;
+    protected static MeasurementDialog measurementDialog;
+    protected static MeasurementLayer currentLayer;
 
-	public static MeasurementLayer getCurrentLayer(){
-		if(currentLayer == null){
-			currentLayer = new MeasurementLayer(tr("Measurements"));
-			Main.main.addLayer(currentLayer);
-			currentLayer.listeners.add(new LayerChangeListener(){
-				public void activeLayerChange(final Layer oldLayer, final Layer newLayer) {
-					if(newLayer instanceof MeasurementLayer)
-						MeasurementPlugin.currentLayer = (MeasurementLayer)newLayer;
-				}
-				public void layerAdded(final Layer newLayer) {
-				}
-				public void layerRemoved(final Layer oldLayer) {
-				}
-			});
-		}
-		return currentLayer;
-	}
+    public MeasurementPlugin() {
+        mode = new MeasurementMode(Main.map, "measurement", tr("measurement mode"));
+        btn = new IconToggleButton(mode);
+        btn.setVisible(true);
+        measurementDialog = new MeasurementDialog();
+    }
+
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if(newFrame != null)
+            newFrame.addToggleDialog(measurementDialog);
+        if(Main.map != null)
+            Main.map.addMapMode(btn);
+    }
+
+    public static MeasurementLayer getCurrentLayer(){
+        if(currentLayer == null){
+            currentLayer = new MeasurementLayer(tr("Measurements"));
+            Main.main.addLayer(currentLayer);
+            currentLayer.listeners.add(new LayerChangeListener(){
+                public void activeLayerChange(final Layer oldLayer, final Layer newLayer) {
+                    if(newLayer instanceof MeasurementLayer)
+                        MeasurementPlugin.currentLayer = (MeasurementLayer)newLayer;
+                }
+                public void layerAdded(final Layer newLayer) {
+                }
+                public void layerRemoved(final Layer oldLayer) {
+                }
+            });
+        }
+        return currentLayer;
+    }
 }
