Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java	(revision 35032)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/PicLayerPlugin.java	(revision 35104)
@@ -22,4 +22,6 @@
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
+import org.openstreetmap.josm.io.session.SessionReader;
+import org.openstreetmap.josm.io.session.SessionWriter;
 import org.openstreetmap.josm.plugins.Plugin;
 import org.openstreetmap.josm.plugins.PluginInformation;
@@ -37,5 +39,10 @@
 import org.openstreetmap.josm.plugins.piclayer.actions.transform.affine.TransformPointAction;
 import org.openstreetmap.josm.plugins.piclayer.actions.transform.autocalibrate.AutoCalibratePictureAction;
+import org.openstreetmap.josm.plugins.piclayer.io.session.FileSessionExporter;
+import org.openstreetmap.josm.plugins.piclayer.io.session.KMLSessionExporter;
+import org.openstreetmap.josm.plugins.piclayer.io.session.PicLayerSessionImporter;
 import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerAbstract;
+import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerFromFile;
+import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerFromKML;
 
 /**
@@ -66,4 +73,11 @@
         MainApplication.getLayerManager().addLayerChangeListener(this);
         MainApplication.getLayerManager().addActiveLayerChangeListener(this);
+
+        // Session IO
+        SessionWriter.registerSessionLayerExporter(PicLayerFromFile.class, FileSessionExporter.class);
+        SessionWriter.registerSessionLayerExporter(PicLayerFromKML.class, KMLSessionExporter.class);
+        // TODO IO for PicLayerFromClipboard
+        //SessionWriter.registerSessionLayerExporter(PicLayerFromClipboard.class, ClipboardSessionExporter.class);
+        SessionReader.registerSessionLayerImporter("piclayerImage", PicLayerSessionImporter.class);
     }
 
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/autocalibrate/AutoCalibrateHandler.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/autocalibrate/AutoCalibrateHandler.java	(revision 35032)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/autocalibrate/AutoCalibrateHandler.java	(revision 35104)
@@ -25,4 +25,6 @@
 import org.openstreetmap.josm.actions.OpenFileAction;
 import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.coor.conversion.CoordinateFormatManager;
+import org.openstreetmap.josm.data.coor.conversion.ICoordinateFormat;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
@@ -42,6 +44,5 @@
 
 /**
- * Class providing functionality of GUIs and also handles connection between {@link AutoCalibratePictureAction}
- * and GUIs what means is basic class to provide the functionality of calibration.
+ * Class handling connection between {@link AutoCalibratePictureAction} and GUIs.
  * Info at https://wiki.openstreetmap.org/wiki/User:Rebsc
  * @author rebsc
@@ -414,6 +415,7 @@
 				// add point to reference list in lat/lon scale
 				LatLon latLonPoint = MainApplication.getMap().mapView.getLatLon(e.getPoint().getX(),e.getPoint().getY());
-				double latY = latLonPoint.getY();
-				double lonX = latLonPoint.getX();
+				ICoordinateFormat mCoord = CoordinateFormatManager.getDefaultFormat();
+				double latY = Double.parseDouble(mCoord.latToString(latLonPoint));
+				double lonX = Double.parseDouble(mCoord.lonToString(latLonPoint));
 				Point2D llPoint = new Point2D.Double(lonX, latY);
 				referencePointList.add(llPoint);
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/autocalibrate/AutoCalibrator.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/autocalibrate/AutoCalibrator.java	(revision 35032)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/actions/transform/autocalibrate/AutoCalibrator.java	(revision 35104)
@@ -18,5 +18,4 @@
 /**
  * Class for image calibration.
- * The startPositions, endPositions representing points set on the image with using {@link PicLayerPlugin} actions.
  * Info at https://wiki.openstreetmap.org/wiki/User:Rebsc
  * @author rebsc
@@ -61,6 +60,5 @@
 	/**
 	 * Calibrates Image with given data.
-	 * Corrects end points by passed real distances between points.
-	 * Sets star points to end points.
+	 * Sets start points to end points and corrects end points by passed distances between points.
 	 */
 	public void calibrate() {
@@ -105,5 +103,5 @@
 
 	/**
-	 * Compare 3 side ratios of first list with 3 side ratios of compare list
+	 * Compare side ratios before/after calibration
 	 * @param list with ratios to compare to other list
 	 * @param compareList with ratios to compare to other list
@@ -133,5 +131,5 @@
 
 	/**
-	 * Corrects points with given real distances. Calculates new points on lines
+	 * Corrects points with given distances. Calculates new points on lines
 	 * between given points at given distances.
 	 * @param points need to be corrected
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/gui/autocalibrate/CalibrationWindow.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/gui/autocalibrate/CalibrationWindow.java	(revision 35032)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/gui/autocalibrate/CalibrationWindow.java	(revision 35104)
@@ -15,7 +15,7 @@
 import java.awt.event.WindowListener;
 import java.awt.geom.Point2D;
-import java.text.DecimalFormat;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Locale;
 
 import javax.imageio.ImageIO;
@@ -32,4 +32,5 @@
 import org.openstreetmap.josm.plugins.piclayer.PicLayerPlugin;
 import org.openstreetmap.josm.plugins.piclayer.actions.transform.autocalibrate.AutoCalibratePictureAction;
+import org.openstreetmap.josm.tools.I18n;
 
 /**
@@ -40,639 +41,657 @@
 public class CalibrationWindow extends JFrame {
 
-     private static final long serialVersionUID = 1L;
-     private static final int FILES_ONLY = 0;
-
-     private JFileChooser fileChooser;
-     private String referenceFileName;
-     private List<Point2D> originPoints;
-     private List<Point2D> referencePoints;
-     private String dist1Value;
-     private String dist2Value;
-
-     private JPanel dialogPane;
-     private JPanel contentPanel;
-     private JPanel infoBar;
-     private JPanel buttonBar;
-
-     private JButton addRefPointsButton;
-     private JButton addEdgePointsButton;
-     private JButton helpButton;
-     private JButton openButton;
-     private JButton selectLayerButton;
-     private JButton runButton;
-     private JButton cancelButton;
-
-     private JLabel infoHeader;
-     private JLabel edgePointHeader;
-     private JLabel edgePointNames;
-     private JLabel edgePointValues;
-     private JLabel distanceHeader;
-     private JLabel distance1;
-     private JLabel distance2;
-     private JTextField distance1Field;
-     private JTextField distance2Field;
-     private JLabel distance1Value;
-     private JLabel distance2Value;
-     private JLabel refFileHeader;
-     private JLabel refFileName;
-     private JLabel refFileNameValue;
-     private JLabel refPointHeader;
-     private JLabel refPointNames;
-     private JLabel refPointValues;
-
-     private JLabel edgePointsChecked;
-     private JLabel distance1Checked;
-     private JLabel distance2Checked;
-     private JLabel fileChecked;
-     private JLabel refPointsChecked;
-
-     public CalibrationWindow() {
-         fileChooser = new JFileChooser();
-         referenceFileName = null;
-         setFileChooser();
-
-         originPoints = new ArrayList<>();
-         referencePoints = new ArrayList<>();
-         dist1Value = null;
-         dist2Value = null;
-
-         initComponents();
-         updateState();
-     }
-
-     /**
-      * initialize components
-      */
-      private void initComponents() {
-          dialogPane = new JPanel();
-          contentPanel = new JPanel();
-          infoBar = new JPanel();
-          buttonBar = new JPanel();
-
-          addRefPointsButton = new JButton();
-          addEdgePointsButton = new JButton();
-          helpButton = new JButton();
-          openButton = new JButton();
-          selectLayerButton = new JButton();
-          runButton = new JButton();
-          cancelButton = new JButton();
-
-          infoHeader = new JLabel();
-          edgePointHeader = new JLabel();
-          edgePointNames = new JLabel();
-          edgePointValues = new JLabel();
-          distanceHeader = new JLabel();
-          distance1 = new JLabel();
-          distance2 = new JLabel();
-          distance1Field = new JTextField();
-          distance2Field = new JTextField();
-          distance1Value = new JLabel();
-          distance2Value = new JLabel();
-          refFileHeader = new JLabel();
-          refFileName = new JLabel();
-          refFileNameValue = new JLabel();
-          refPointHeader = new JLabel();
-          refPointNames = new JLabel();
-          refPointValues = new JLabel();
-
-          edgePointsChecked = new JLabel();
-          distance1Checked = new JLabel();
-          distance2Checked = new JLabel();
-          fileChecked = new JLabel();
-          refPointsChecked = new JLabel();
-
-          // this
-          setTitle(tr("AutoCalibration"));
-          java.awt.Container contentPane = getContentPane();
-          contentPane.setLayout(new BorderLayout());
-          this.setMinimumSize(new Dimension(50, 100));
-
-          // dialog pane
-          dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
-          dialogPane.setLayout(new BorderLayout());
-
-          // info bar
-          setInfoBar();
-          setInfoHeader();
-          dialogPane.add(infoBar, BorderLayout.NORTH);
-
-          // content panel
-          setContentPanel();
-          setPointHeader();
-          setEdgePointNamesValues();
-          setDistanceHeader();
-          setDistance1();
-          setDistance1Field();
-          setDistance2();
-          setDistance2Field();
-          setRefFileHeader();
-          setRefFileName();
-          setOpenButton();
-          setSelectLayerButton();
-          setRefPointHeader();
-          setRefPointNamesValues();
-          dialogPane.add(contentPanel, BorderLayout.CENTER);
-
-          // button bar
-          setButtonBar();
-          setOKButton();
-          setCancelButton();
-          dialogPane.add(buttonBar, BorderLayout.SOUTH);
-
-          // content Pane
-          contentPane.add(dialogPane, BorderLayout.CENTER);
-          pack();
-          setLocationRelativeTo(getOwner());
-    }
-
-
-    // COMPONENTS
-
-    private void setInfoBar() {
-        infoBar.setBorder(new EmptyBorder(0, 0, 12, 0));
-        infoBar.setLayout(new GridBagLayout());
-        ((GridBagLayout) infoBar.getLayout()).columnWidths = new int[] {0, 85, 80};
-        ((GridBagLayout) infoBar.getLayout()).columnWeights = new double[] {1.0, 0.0, 0.0};
-    }
-
-    private void setInfoHeader() {
-         infoHeader.setText(tr("<html>Please enter the required information.</html>"));
-         infoBar.add(infoHeader, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
-                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(5, 5, 0, 0), 0, 0));
-
-         String space = "     ";
-         helpButton = new JButton(tr(space + "help" + space));
-         infoBar.add(helpButton, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0,
-                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(0, 0, 0, 0), 0, 0));
-    }
-
-    private void setContentPanel() {
-        contentPanel.setLayout(new GridBagLayout());
-        contentPanel.setBackground(new Color(200, 200, 200));
-        ((GridBagLayout) contentPanel.getLayout()).columnWidths = new int[] {0, 0, 0, 0, 0};
-        ((GridBagLayout) contentPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0};
+	 private static final long serialVersionUID = 1L;
+	 private static final int FILES_ONLY = 0;
+
+	 private JFileChooser fileChooser;
+	 private String referenceFileName;
+	 private List<Point2D> originPoints;
+	 private List<Point2D> referencePoints;
+	 private String dist1Value;
+	 private String dist2Value;
+
+	 private JPanel dialogPane;
+	 private JPanel contentPanel;
+	 private JPanel infoBar;
+	 private JPanel buttonBar;
+
+	 private JButton addRefPointsButton;
+	 private JButton addEdgePointsButton;
+	 private JButton helpButton;
+	 private JButton openButton;
+	 private JButton selectLayerButton;
+	 private JButton runButton;
+	 private JButton cancelButton;
+
+	 private JLabel infoHeader;
+	 private JLabel edgePointHeader;
+	 private JLabel edgePointNames;
+	 private JLabel edgePointValues;
+	 private JLabel distanceHeader;
+	 private JLabel distance1;
+	 private JLabel distance2;
+	 private JTextField distance1Field;
+	 private JTextField distance2Field;
+	 private JLabel distance1Value;
+	 private JLabel distance2Value;
+	 private JLabel refFileHeader;
+	 private JLabel refFileName;
+	 private JLabel refFileNameValue;
+	 private JLabel refPointHeader;
+	 private JLabel refPointNames;
+	 private JLabel refPointValues;
+
+	 private JLabel edgePointsChecked;
+	 private JLabel distance1Checked;
+	 private JLabel distance2Checked;
+	 private JLabel fileChecked;
+	 private JLabel refPointsChecked;
+
+
+	 private String separator;
+	 private String ws = " ";
+	 private Locale language;
+
+
+	 public CalibrationWindow() {
+		 setLanguageFormat();
+	     fileChooser = new JFileChooser();
+	     referenceFileName = null;
+		 setFileChooser();
+
+		 originPoints = new ArrayList<>();
+		 referencePoints = new ArrayList<>();
+		 dist1Value = null;
+		 dist2Value = null;
+
+		 initComponents();
+		 updateState();
+	 }
+
+	 /**
+	  * initialize components
+	  */
+	  private void initComponents() {
+		  dialogPane = new JPanel();
+	      contentPanel = new JPanel();
+	      infoBar = new JPanel();
+	      buttonBar = new JPanel();
+
+	      addRefPointsButton = new JButton();
+	      addEdgePointsButton = new JButton();
+	      helpButton = new JButton();
+	      openButton = new JButton();
+	      selectLayerButton = new JButton();
+	      runButton = new JButton();
+	      cancelButton = new JButton();
+
+	      infoHeader = new JLabel();
+	      edgePointHeader = new JLabel();
+	      edgePointNames = new JLabel();
+	      edgePointValues = new JLabel();
+	      distanceHeader = new JLabel();
+	      distance1 = new JLabel();
+	      distance2 = new JLabel();
+	      distance1Field = new JTextField();
+	      distance2Field = new JTextField();
+	      distance1Value = new JLabel();
+	      distance2Value = new JLabel();
+	      refFileHeader = new JLabel();
+	      refFileName = new JLabel();
+	      refFileNameValue = new JLabel();
+	      refPointHeader = new JLabel();
+	      refPointNames = new JLabel();
+	      refPointValues = new JLabel();
+
+	      edgePointsChecked = new JLabel();
+	      distance1Checked = new JLabel();
+	      distance2Checked = new JLabel();
+	      fileChecked = new JLabel();
+	      refPointsChecked = new JLabel();
+
+	      // this
+	      setTitle(tr("AutoCalibration"));
+	      java.awt.Container contentPane = getContentPane();
+	      contentPane.setLayout(new BorderLayout());
+	      this.setMinimumSize(new Dimension(50,100));
+
+	      // dialog pane
+	      dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
+	      dialogPane.setLayout(new BorderLayout());
+
+	      // info bar
+	      setInfoBar();
+	      setInfoHeader();
+	      dialogPane.add(infoBar, BorderLayout.NORTH);
+
+	      // content panel
+	      setContentPanel();
+	      setPointHeader();
+		  setEdgePointNamesValues();
+		  setDistanceHeader();
+	      setDistance1();
+	      setDistance1Field();
+	      setDistance2();
+	      setDistance2Field();
+	      setRefFileHeader();
+    	  setRefFileName();
+		  setOpenButton();
+		  setSelectLayerButton();
+	      setRefPointHeader();
+	      setRefPointNamesValues();
+	      dialogPane.add(contentPanel, BorderLayout.CENTER);
+
+	      // button bar
+	      setButtonBar();
+	      setOKButton();
+	      setCancelButton();
+	      dialogPane.add(buttonBar, BorderLayout.SOUTH);
+
+	      // content Pane
+	      contentPane.add(dialogPane, BorderLayout.CENTER);
+	      pack();
+	      setLocationRelativeTo(getOwner());
+	}
+
+	 private void setLanguageFormat(){
+		 // TODO get application language instead of system language
+		 String c = I18n.getOriginalLocale().getCountry();
+		 switch(c) {
+		 	case "DE":
+		 		language = Locale.GERMAN;
+		 		separator = ";";
+		 		break;
+		 	case "FR":
+		 		language = Locale.FRANCE;
+		 		separator = ";";
+		 		break;
+		 	case "IT":
+		 		language = Locale.ITALIAN;
+		 		separator = ";";
+		 		break;
+		 	default:
+		 		language = Locale.US;
+		 		separator = ",";
+		 }
+	 }
+
+
+	// COMPONENTS
+
+	private void setInfoBar() {
+		infoBar.setBorder(new EmptyBorder(0, 0, 12, 0));
+		infoBar.setLayout(new GridBagLayout());
+		((GridBagLayout) infoBar.getLayout()).columnWidths = new int[] {0, 85, 80};
+		((GridBagLayout) infoBar.getLayout()).columnWeights = new double[] {1.0, 0.0, 0.0};
+	}
+
+	private void setInfoHeader() {
+		 infoHeader.setText(tr("<html>Please enter the required information.</html>"));
+	     infoBar.add(infoHeader, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
+	            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	            new Insets(5, 5, 0, 0), 0, 0));
+
+	     String space = "     ";
+	     helpButton = new JButton(tr(space + "help" + space));
+	     infoBar.add(helpButton, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0,
+	            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	            new Insets(0, 0, 0, 0), 0, 0));
+	}
+
+	private void setContentPanel() {
+		contentPanel.setLayout(new GridBagLayout());
+	    contentPanel.setBackground(new Color(200, 200, 200));
+	    ((GridBagLayout) contentPanel.getLayout()).columnWidths = new int[] {0, 0, 0, 0, 0};
+	    ((GridBagLayout) contentPanel.getLayout()).rowHeights = new int[] {0, 0, 0, 0, 0, 0};
         ((GridBagLayout) contentPanel.getLayout()).columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 1.0E-4};
-        ((GridBagLayout) contentPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4};
-    }
-
-    private void setPointHeader() {
-        edgePointHeader.setText(tr("<html><b><u>Local Edge Points</u></b></html>"));
-        contentPanel.add(edgePointHeader, new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0,
-                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(5, 5, 5, 30), 0, 0));
-    }
-
-    private void setEdgePointNamesValues() {
-        edgePointNames.setText(tr("<html>"
-                + "Point 1 (Lat,Lon):<br>"
-                + "Point 2 (Lat,Lon):<br>"
-                + "Point 3 (Lat,Lon):<br>"
-                        + "</html>"));
-        contentPanel.add(edgePointNames, new GridBagConstraints(0, 1, 3, 1, 0.0, 0.0,
-                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                    new Insets(5, 5, 5, 30), 0, 0));
-
-        if (!originPoints.isEmpty()) {
-            edgePointValuesEntered();
-        } else {
-            addEdgePointsButton = new JButton(tr("Add Points..."));
-            contentPanel.add(addEdgePointsButton, new GridBagConstraints(3, 1, GridBagConstraints.REMAINDER, 1, 0.0, 0.0,
-                      GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                      new Insets(5, 50, 5, 5), 0, 0));
-        }
-    }
-
-    private void setDistanceHeader() {
-         distanceHeader.setText(tr("<html><b><u>True Distances</u></b></html>"));
-         contentPanel.add(distanceHeader, new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0,
-                  GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                  new Insets(5, 5, 5, 30), 0, 0));
-    }
-
-    private void setDistance1Field() {
-        distance1Field.setText("Click here...");
-        contentPanel.add(distance1Field, new GridBagConstraints(3, 3, GridBagConstraints.REMAINDER, 1, 0.0, 0.0,
-                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(5, 50, 5, 5), 0, 0));
-    }
-
-    private void setDistance2() {
-        distance2.setText(tr("Point 2 to Point 3 (meter):"));
-        contentPanel.add(distance2, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0,
-              GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-              new Insets(5, 5, 5, 30), 0, 0));
-    }
-
-    private void setDistance2Field() {
-        distance2Field.setText("Click here...");
-        contentPanel.add(distance2Field, new GridBagConstraints(3, 4, GridBagConstraints.REMAINDER, 1, 0.0, 0.0,
-              GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-              new Insets(5, 50, 5, 5), 0, 0));
-    }
-
-    private void setRefFileHeader() {
-        refFileHeader.setText(tr("<html><b><u>Reference File</u></b></html>"));
-        contentPanel.add(refFileHeader, new GridBagConstraints(0, 5, 3, 1, 0.0, 0.0,
-              GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-              new Insets(5, 5, 5, 30), 0, 0));
-    }
-
-    private void setRefFileName() {
-        refFileName.setText("<html>"+tr("Reference Name:")
-              + "<br>"
-              + "<br>"
-              + "<br>"
-              + "</html>");
-
-        contentPanel.add(refFileName, new GridBagConstraints(0, 6, GridBagConstraints.REMAINDER, 1, 0.0, 0.0,
-                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(5, 5, 5, 30), 0, 0));
-    }
-
-    private void setSelectLayerButton() {
-        String imageName = "layerlist.png";
-        Image image = null;
-        try {
-            image = ImageIO.read(getClass().getResource("/images/" + imageName));
-        } catch (Exception ex) {
-            System.out.println("Error: Could not load image " + imageName + "," + ex);
-         }
-
-        selectLayerButton.setToolTipText(tr("Select a layer as reference..."));
-        selectLayerButton.setIcon(new ImageIcon(image));
-        contentPanel.add(selectLayerButton, new GridBagConstraints(3, 6, 2, 1, 1.0, 0.0,
-              GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-              new Insets(5, 50, 5, 5), 0, 0));
-    }
-
-    private void setOpenButton() {
-        String imageName = "open.png";
-        Image image = null;
-        try {
-            image = ImageIO.read(getClass().getResource("/images/" + imageName));
-        } catch (Exception ex) {
-            System.out.println("Error: Could not load image " + imageName + "," + ex);
-         }
-
-        openButton.setToolTipText(tr("Open a file as reference..."));
-        openButton.setIcon(new ImageIcon(image));
-        contentPanel.add(openButton, new GridBagConstraints(6, 6, GridBagConstraints.REMAINDER, 1, 1.0, 0.0,
-              GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-              new Insets(5, 5, 5, 5), 0, 0));
-    }
-
-    private void setRefPointHeader() {
-        refPointHeader.setText("<html><b><u>Reference Points</u></b></html>\"");
-        contentPanel.add(refPointHeader, new GridBagConstraints(0, 7, 3, 1, 0.0, 0.0,
-              GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-              new Insets(5, 5, 5, 30), 0, 0));
-    }
-
-    private void setRefPointNamesValues() {
-         Point2D rp1 = null;
-         Point2D rp2 = null;
-         Point2D rp3 = null;
-
-         if (!referencePoints.isEmpty()) {
-              rp1 = referencePoints.get(0);
-              rp2 = referencePoints.get(1);
-              rp3 = referencePoints.get(2);
-         }
-
-         refPointNames.setText(tr("<html>"
-                + "Point 1 (Lat,Lon):<br>"
-                + "Point 2 (Lat,Lon):<br>"
-                + "Point 3 (Lat,Lon):<br>"
-                        + "</html>"));
-         contentPanel.add(refPointNames, new GridBagConstraints(0, 8, 3, 1, 0.0, 0.0,
-                    GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                    new Insets(5, 5, 5, 30), 0, 0));
-
-         if (!referencePoints.isEmpty()) {
-              refPointValues.setText(tr("<html>"
-                + rp1.getY() + ", " + rp1.getX() + "<br>"
-                + rp2.getY() + ", " + rp2.getX() + "<br>"
-                + rp3.getY() + ", " + rp3.getX() + "<br>"
-                        + "</html>"));
-
-              contentPanel.add(refPointValues, new GridBagConstraints(3, 8, GridBagConstraints.REMAINDER, 1, 0.0, 0.0,
-                      GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                      new Insets(5, 5, 5, 30), 0, 0));
-         } else {
-              addRefPointsButton = new JButton(tr("Add Points..."));
-              contentPanel.add(addRefPointsButton, new GridBagConstraints(3, 8, GridBagConstraints.REMAINDER, 1, 0.0, 0.0,
-                        GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                        new Insets(5, 50, 5, 5), 0, 0));
-         }
-    }
-
-    private void setButtonBar() {
-        buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));
-        buttonBar.setLayout(new GridBagLayout());
-        ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 85, 80};
-        ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0, 0.0};
-    }
-
-    private void setOKButton() {
-        runButton.setText(tr("Run"));
-        buttonBar.add(runButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
-              GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-              new Insets(0, 0, 0, 5), 0, 0));
-    }
-
-    private void setCancelButton() {
-        cancelButton.setText(tr("Cancel"));
-        buttonBar.add(cancelButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
-              GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-              new Insets(0, 0, 0, 0), 0, 0));
-    }
-
-
-    // DYNAMIC FIELD CHANGES
-
-    private void edgePointValuesEntered() {
-        Point2D p1 = null;
-        Point2D p2 = null;
-        Point2D p3 = null;
-        DecimalFormat df = new DecimalFormat("###,###.###");
-
-        if (originPoints.size() == 3) {
-            p1 = originPoints.get(0);
-            p2 = originPoints.get(1);
-            p3 = originPoints.get(2);
-        } else return;
-
-        edgePointValues.setText(tr("<html>"
-            + df.format(p1.getY()) + " , " + df.format(p1.getX()) + "<br>"
-            + df.format(p2.getY()) + " , " + df.format(p2.getX()) + "<br>"
-            + df.format(p3.getY()) + " , " + df.format(p3.getX()) + "<br>"
-                    + "</html>"));
-
-        contentPanel.remove(addEdgePointsButton);
-        contentPanel.add(edgePointValues, new GridBagConstraints(3, 1, 3, 1, 0.0, 0.0,
-                  GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                  new Insets(5, 5, 5, 30), 0, 0));
-
-        edgePointsChecked.setIcon(getCheckedIcon());
-        contentPanel.add(edgePointsChecked, new GridBagConstraints(6, 1, 3, 1, 0.0, 0.0,
-                  GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                  new Insets(5, 5, 5, 5), 0, 0));
-    }
-
-    private void distance1Entered() {
-        contentPanel.remove(distance1Field);
-        distance1Value.setText(dist1Value);
-        contentPanel.add(distance1Value, new GridBagConstraints(3, 3, 2, 1, 0.0, 0.0,
-                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(5, 5, 5, 30), 0, 0));
-
-        distance1Checked.setIcon(getCheckedIcon());
-        contentPanel.add(distance1Checked, new GridBagConstraints(6, 3, 3, 1, 0.0, 0.0,
-                  GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                  new Insets(5, 5, 5, 5), 0, 0));
-    }
-
-    private void distance2Entered() {
-        contentPanel.remove(distance2Field);
-        distance2Value.setText(dist2Value);
-        contentPanel.add(distance2Value, new GridBagConstraints(3, 4, 2, 1, 0.0, 0.0,
-                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(5, 5, 5, 30), 0, 0));
-
-        distance2Checked.setIcon(getCheckedIcon());
-        contentPanel.add(distance2Checked, new GridBagConstraints(6, 4, 3, 1, 0.0, 0.0,
-                  GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                  new Insets(5, 5, 5, 5), 0, 0));
-    }
-
-    private void refFileEntered() {
-        contentPanel.remove(selectLayerButton);
-        contentPanel.remove(openButton);
-        refFileName.setText("<html>"+tr("Reference Name:")+"</html>");
-        refFileNameValue.setText(referenceFileName);
-        contentPanel.add(refFileNameValue, new GridBagConstraints(3, 6, 2, 1, 0.0, 0.0,
-                   GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                   new Insets(5, 5, 5, 30), 0, 0));
-
-        fileChecked.setIcon(getCheckedIcon());
-        contentPanel.add(fileChecked, new GridBagConstraints(6, 6, 3, 1, 0.0, 0.0,
-                  GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                  new Insets(5, 5, 5, 5), 0, 0));
-    }
-
-    private void refPointValuesEntered() {
-        Point2D p1 = null;
-        Point2D p2 = null;
-        Point2D p3 = null;
-        DecimalFormat df = new DecimalFormat("###,###.###");
-
-        if (referencePoints.size() == 3) {
-            p1 = referencePoints.get(0);
-            p2 = referencePoints.get(1);
-            p3 = referencePoints.get(2);
-        } else return;
-
-        refPointValues.setText(tr("<html>"
-                + df.format(p1.getY()) + " , " + df.format(p1.getX()) + "<br>"
-                + df.format(p2.getY()) + " , " + df.format(p2.getX()) + "<br>"
-                + df.format(p3.getY()) + " , " + df.format(p3.getX()) + "<br>"
-                        + "</html>"));
-
-        contentPanel.remove(addRefPointsButton);
-        contentPanel.add(refPointValues, new GridBagConstraints(3, 8, 3, 1, 0.0, 0.0,
-                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(5, 5, 5, 30), 0, 0));
-
-        refPointsChecked.setIcon(getCheckedIcon());
-        contentPanel.add(refPointsChecked, new GridBagConstraints(6, 8, 3, 1, 0.0, 0.0,
-                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(5, 5, 5, 5), 0, 0));
-    }
-
-    private void setDistance1() {
-         distance1.setText(tr("Point 1 to Point 2 (meter):"));
-         contentPanel.add(distance1, new GridBagConstraints(0, 3, 3, 1, 0.0, 0.0,
-                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
-                new Insets(5, 5, 5, 30), 0, 0));
-    }
-
-
-    // GETTER / SETTER
-
-    public JButton getOpenButton() {
-        return this.openButton;
-    }
-
-    public JTextField getDistance1Field() {
-        return this.distance1Field;
-    }
-
-    public JTextField getDistance2Field() {
-        return this.distance2Field;
-    }
-
-    public String getDistance1FieldText() {
-        return this.distance1Field.getText();
-    }
-
-    public String getDistance2FieldText() {
-        return this.distance2Field.getText();
-    }
-
-    public void setOriginPoints(List<Point2D> points) {
-        this.originPoints = points;
-        edgePointValuesEntered();
-        updateState();
-    }
-
-    public void setReferencePoints(List<Point2D> points) {
-        this.referencePoints = points;
-        refPointValuesEntered();
-        updateState();
-    }
-
-    public void setDistance1Field(String s) {
-        this.distance1Field.setText(s);
-        updateState();
-    }
-
-    public void setDistance2Field(String s) {
-        this.distance2Field.setText(s);
-        updateState();
-    }
-
-    public void setDistance1Value(String valueAsString) {
-        this.dist1Value = valueAsString;
-        if (!valueAsString.equals("")) distance1Entered();
-        updateState();
-    }
-
-    public void setDistance2Value(String valueAsString) {
-        this.dist2Value = valueAsString;
-        if (!valueAsString.equals("")) distance2Entered();
-        updateState();
-    }
-
-    public void setReferenceFileName(String name) {
-        this.referenceFileName = name;
-    }
-
-    private void setFileChooser() {
-        fileChooser.setFileSelectionMode(FILES_ONLY);
-        FileNameExtensionFilter filter = new FileNameExtensionFilter(".osm, .gpx", "osm", "gpx");
-        fileChooser.setFileFilter(filter);
-    }
-
-    public void setReferenceFileNameValue(String value) {
-        this.referenceFileName = value;
-        this.refFileNameValue.setText(value);
-        refFileEntered();
-        updateState();
-    }
-
-    public JFileChooser getFileChooser() {
-        return this.fileChooser;
-    }
-
-    public String getFileName() {
-        return this.referenceFileName;
-    }
-
-    // LISTENER
-
-    public void setOkButtonListener(ActionListener l) {
-        this.runButton.addActionListener(l);
-    }
-
-    public void setCancelButtonListener(ActionListener l) {
-        this.cancelButton.addActionListener(l);
-    }
-
-    public void setWindowListener(WindowListener l) {
-        this.addWindowListener(l);
-    }
-
-    public void addOpenFileButtonListener(ActionListener l) {
-        this.openButton.addActionListener(l);
-    }
-
-    public void addSelectLayerButtonListener(ActionListener l) {
-        this.selectLayerButton.addActionListener(l);
-    }
-
-    public void addCancelButtonListener(ActionListener l) {
-        this.cancelButton.addActionListener(l);
-    }
-
-    public void addRunButtonListener(ActionListener l) {
-        this.runButton.addActionListener(l);
-    }
-
-    public void addEdgePointButtonListener(ActionListener l) {
-        this.addEdgePointsButton.addActionListener(l);
-    }
-
-    public void addReferencePointButtonListener(ActionListener l) {
-        this.addRefPointsButton.addActionListener(l);
-    }
-
-    public void addFrameWindowListener(WindowAdapter wAdapter) {
-        this.addWindowListener(wAdapter);
-    }
-
-    public void addDistance1FieldListener(FocusListener l) {
-        this.distance1Field.addFocusListener(l);
-    }
-
-    public void addDistance2FieldListener(FocusListener l) {
-        this.distance2Field.addFocusListener(l);
-    }
-
-    public void addHelpButtonListener(ActionListener l) {
-        this.helpButton.addActionListener(l);
-    }
-
-
-    // HELPER
-
-    private ImageIcon getCheckedIcon() {
-        String imageName = "checked.png";
-        Image image = null;
-        try {
-            image = ImageIO.read(getClass().getResource("/images/" + imageName));
-        } catch (Exception ex) {
-            System.out.println("Error: Could not load image " + imageName + "," + ex);
-         }
-        return new ImageIcon(image);
-    }
-
-    public void updateState() {
-        if (originPoints.isEmpty()) {
-            // button blink
-            distance1Field.setEnabled(false);
-            distance2Field.setEnabled(false);
-            openButton.setEnabled(false);
-            selectLayerButton.setEnabled(false);
-            addRefPointsButton.setEnabled(false);
-            runButton.setEnabled(false);
-        } else {
-            if (dist1Value == null && dist2Value == null) {
-                distance1Field.setEnabled(true);
-                distance2Field.setEnabled(true);
-            }
-            if (dist1Value != null) {
-                openButton.setEnabled(true);
-                selectLayerButton.setEnabled(true);
-            }
-            if (referenceFileName != null) addRefPointsButton.setEnabled(true);
-            if (!referencePoints.isEmpty()) runButton.setEnabled(true);
-        }
-    }
-
-    public void refresh() {
-        this.setVisible(true);
-    }
+	    ((GridBagLayout) contentPanel.getLayout()).rowWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4};
+	}
+
+	private void setPointHeader() {
+		edgePointHeader.setText(tr("<html><b><u>Local Edge Points</u></b></html>"));
+	    contentPanel.add(edgePointHeader, new GridBagConstraints(0, 0, 3, 1, 0.0, 0.0,
+	            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	            new Insets(5, 5, 5, 30), 0, 0));
+	}
+
+	private void setEdgePointNamesValues() {
+		edgePointNames.setText(tr("<html>"
+				+ String.format("Point 1 (Lat%sLon):<br>", separator)
+				+ String.format("Point 2 (Lat%sLon):<br>", separator)
+				+ String.format("Point 3 (Lat%sLon):<br>", separator)
+						+ "</html>"));
+		contentPanel.add(edgePointNames, new GridBagConstraints(0, 1, 3, 1, 0.0, 0.0,
+	                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	                new Insets(5, 5, 5, 30), 0, 0));
+
+		if(!this.originPoints.isEmpty()) {
+			edgePointValuesEntered();
+		}
+		else {
+		    addEdgePointsButton = new JButton(tr("Add Points..."));
+			contentPanel.add(addEdgePointsButton, new GridBagConstraints(3, 1, GridBagConstraints.REMAINDER, 1, 0.0, 0.0,
+			          GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+			          new Insets(5, 50, 5, 5), 0, 0));
+		}
+	}
+
+	private void setDistanceHeader() {
+		 distanceHeader.setText(tr("<html><b><u>True Distances</u></b></html>"));
+	     contentPanel.add(distanceHeader, new GridBagConstraints(0, 2, 3, 1, 0.0, 0.0,
+	              GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	              new Insets(5, 5, 5, 30), 0, 0));
+	}
+
+	private void setDistance1Field() {
+		distance1Field.setText("Click here...");
+	    contentPanel.add(distance1Field, new GridBagConstraints(3, 3, GridBagConstraints.REMAINDER, 1, 0.0, 0.0,
+	            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	            new Insets(5, 50, 5, 5), 0, 0));
+	}
+
+	private void setDistance2() {
+	    distance2.setText(tr("Point 2 to Point 3 (meter):"));
+	    contentPanel.add(distance2, new GridBagConstraints(0, 4, 3, 1, 0.0, 0.0,
+	          GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	          new Insets(5, 5, 5, 30), 0, 0));
+	}
+
+	private void setDistance2Field() {
+	    distance2Field.setText("Click here...");
+	    contentPanel.add(distance2Field, new GridBagConstraints(3, 4, GridBagConstraints.REMAINDER, 1, 0.0, 0.0,
+	          GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	          new Insets(5, 50, 5, 5), 0, 0));
+	}
+
+	private void setRefFileHeader() {
+		refFileHeader.setText(tr("<html><b><u>Reference File</u></b></html>"));
+	    contentPanel.add(refFileHeader, new GridBagConstraints(0, 5, 3, 1, 0.0, 0.0,
+	          GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	          new Insets(5, 5, 5, 30), 0, 0));
+	}
+
+	private void setRefFileName() {
+		refFileName.setText(tr("<html>Reference Name:"
+		      + "<br>"
+		      + "<br>"
+		      + "<br>"
+		      + "</html>"));
+
+		contentPanel.add(refFileName, new GridBagConstraints(0, 6, GridBagConstraints.REMAINDER, 1, 0.0, 0.0,
+				GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+				new Insets(5, 5, 5, 30), 0, 0));
+	}
+
+	private void setSelectLayerButton() {
+		String imageName = "layerlist.png";
+		Image image = null;
+		try {
+			image = ImageIO.read(getClass().getResource("/images/" + imageName));
+		} catch (Exception ex) {
+			System.out.println("Error: Could not load image " + imageName + "," + ex);
+	 	}
+
+		selectLayerButton.setToolTipText(tr("Select a layer as reference..."));
+	    selectLayerButton.setIcon(new ImageIcon(image));
+	    contentPanel.add(selectLayerButton, new GridBagConstraints(3, 6, 2, 1, 1.0, 0.0,
+	          GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	          new Insets(5, 50, 5, 5), 0, 0));
+	}
+
+	private void setOpenButton() {
+		String imageName = "open.png";
+		Image image = null;
+		try {
+			image = ImageIO.read(getClass().getResource("/images/" + imageName));
+		} catch (Exception ex) {
+			System.out.println("Error: Could not load image " + imageName + "," + ex);
+	 	}
+
+		openButton.setToolTipText(tr("Open a file as reference..."));
+	    openButton.setIcon(new ImageIcon(image));
+	    contentPanel.add(openButton, new GridBagConstraints(6, 6, GridBagConstraints.REMAINDER, 1, 1.0, 0.0,
+	          GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	          new Insets(5, 5, 5, 5), 0, 0));
+	}
+
+	private void setRefPointHeader() {
+		refPointHeader.setText("<html><b><u>Reference Points</u></b></html>\"");
+	    contentPanel.add(refPointHeader, new GridBagConstraints(0, 7, 3, 1, 0.0, 0.0,
+	          GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+		      new Insets(5, 5, 5, 30), 0, 0));
+	}
+
+	private void setRefPointNamesValues() {
+		 refPointNames.setText(tr("<html>"
+				+ String.format("Point 1 (Lat%sLon):<br>", separator)
+				+ String.format("Point 2 (Lat%sLon):<br>", separator)
+				+ String.format("Point 3 (Lat%sLon):<br>", separator)
+						+ "</html>"));
+		 contentPanel.add(refPointNames, new GridBagConstraints(0, 8, 3, 1, 0.0, 0.0,
+	                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	                new Insets(5, 5, 5, 30), 0, 0));
+
+		 if(!this.referencePoints.isEmpty()) {
+			 refPointValuesEntered();
+		 }
+		 else {
+		      addRefPointsButton = new JButton(tr("Add Points..."));
+			  contentPanel.add(addRefPointsButton, new GridBagConstraints(3, 8, GridBagConstraints.REMAINDER, 1, 0.0, 0.0,
+			            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+			            new Insets(5, 50, 5, 5), 0, 0));
+		 }
+	}
+
+	private void setButtonBar() {
+		buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));
+	    buttonBar.setLayout(new GridBagLayout());
+	    ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] {0, 85, 80};
+	    ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0, 0.0};
+	}
+
+	private void setOKButton() {
+		runButton.setText(tr("Run"));
+	    buttonBar.add(runButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
+	          GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	          new Insets(0, 0, 0, 5), 0, 0));
+	}
+
+	private void setCancelButton() {
+		cancelButton.setText(tr("Cancel"));
+	    buttonBar.add(cancelButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
+	          GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	          new Insets(0, 0, 0, 0), 0, 0));
+	}
+
+
+	// DYNAMIC FIELD CHANGES
+
+	private void edgePointValuesEntered() {
+		Point2D p1 = null;
+		Point2D p2 = null;
+		Point2D p3 = null;
+
+		if(this.originPoints.size() == 3) {
+			p1 = originPoints.get(0);
+			p2 = originPoints.get(1);
+			p3 = originPoints.get(2);
+		}
+		else return;
+
+		edgePointValues.setText(tr("<html>"
+			+ formatValue(p1.getY()) + ws + separator + ws + formatValue(p1.getX()) + "<br>"
+			+ formatValue(p2.getY()) + ws + separator + ws + formatValue(p2.getX()) + "<br>"
+			+ formatValue(p3.getY()) + ws + separator + ws + formatValue(p3.getX()) + "<br>"
+					+ "</html>"));
+
+		contentPanel.remove(addEdgePointsButton);
+		contentPanel.add(edgePointValues, new GridBagConstraints(3, 1, 3, 1, 0.0, 0.0,
+				  GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+			      new Insets(5, 5, 5, 30), 0, 0));
+
+		edgePointsChecked.setIcon(getCheckedIcon());
+		contentPanel.add(edgePointsChecked, new GridBagConstraints(6, 1, 3, 1, 0.0, 0.0,
+				  GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+			      new Insets(5, 5, 5, 5), 0, 0));
+	}
+
+	private void distance1Entered() {
+		contentPanel.remove(distance1Field);
+		distance1Value.setText(dist1Value);
+	    contentPanel.add(distance1Value, new GridBagConstraints(3, 3, 2, 1, 0.0, 0.0,
+	            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	            new Insets(5, 5, 5, 30), 0, 0));
+
+		distance1Checked.setIcon(getCheckedIcon());
+		contentPanel.add(distance1Checked, new GridBagConstraints(6, 3, 3, 1, 0.0, 0.0,
+				  GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+			      new Insets(5, 5, 5, 5), 0, 0));
+	}
+
+	private void distance2Entered() {
+		contentPanel.remove(distance2Field);
+		distance2Value.setText(dist2Value);
+	    contentPanel.add(distance2Value, new GridBagConstraints(3, 4, 2, 1, 0.0, 0.0,
+	            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	            new Insets(5, 5, 5, 30), 0, 0));
+
+		distance2Checked.setIcon(getCheckedIcon());
+		contentPanel.add(distance2Checked, new GridBagConstraints(6, 4, 3, 1, 0.0, 0.0,
+				  GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+			      new Insets(5, 5, 5, 5), 0, 0));
+	}
+
+	private void refFileEntered() {
+		contentPanel.remove(selectLayerButton);
+		contentPanel.remove(openButton);
+		refFileName.setText(tr("<html>Reference Name:</html>"));
+		refFileNameValue.setText(referenceFileName);
+		contentPanel.add(refFileNameValue, new GridBagConstraints(3, 6, 2, 1, 0.0, 0.0,
+		           GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+		           new Insets(5, 5, 5, 30), 0, 0));
+
+		fileChecked.setIcon(getCheckedIcon());
+		contentPanel.add(fileChecked, new GridBagConstraints(6, 6, 3, 1, 0.0, 0.0,
+				  GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+			      new Insets(5, 5, 5, 5), 0, 0));
+	}
+
+	private void refPointValuesEntered() {
+		Point2D p1 = null;
+		Point2D p2 = null;
+		Point2D p3 = null;
+
+		if(this.referencePoints.size() == 3) {
+			p1 = referencePoints.get(0);
+			p2 = referencePoints.get(1);
+			p3 = referencePoints.get(2);
+		}
+		else return;
+
+		refPointValues.setText(tr("<html>"
+				+ formatValue(p1.getY()) + ws + separator + ws + formatValue(p1.getX()) + "<br>"
+				+ formatValue(p2.getY()) + ws + separator + ws + formatValue(p2.getX()) + "<br>"
+				+ formatValue(p3.getY()) + ws + separator + ws + formatValue(p3.getX()) + "<br>"
+						+ "</html>"));
+
+		contentPanel.remove(addRefPointsButton);
+		contentPanel.add(refPointValues, new GridBagConstraints(3, 8, 3, 1, 0.0, 0.0,
+	            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	            new Insets(5, 5, 5, 30), 0, 0));
+
+		refPointsChecked.setIcon(getCheckedIcon());
+		contentPanel.add(refPointsChecked, new GridBagConstraints(6, 8, 3, 1, 0.0, 0.0,
+				GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+			    new Insets(5, 5, 5, 5), 0, 0));
+	}
+
+	private void setDistance1() {
+		 distance1.setText(tr("Point 1 to Point 2 (meter):"));
+	     contentPanel.add(distance1, new GridBagConstraints(0, 3, 3, 1, 0.0, 0.0,
+	            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
+	            new Insets(5, 5, 5, 30), 0, 0));
+	}
+
+
+	// GETTER / SETTER
+
+	public JButton getOpenButton() {
+		return this.openButton;
+	}
+
+	public JTextField getDistance1Field() {
+		return this.distance1Field;
+	}
+
+	public JTextField getDistance2Field() {
+		return this.distance2Field;
+	}
+
+	public String getDistance1FieldText() {
+	    return this.distance1Field.getText();
+	}
+
+	public String getDistance2FieldText() {
+	    return this.distance2Field.getText();
+	}
+
+	public void setOriginPoints(List<Point2D> points) {
+		this.originPoints = points;
+		edgePointValuesEntered();
+		updateState();
+	}
+
+	public void setReferencePoints(List<Point2D> points) {
+		this.referencePoints = points;
+		refPointValuesEntered();
+		updateState();
+	}
+
+	public void setDistance1Field(String s) {
+	    this.distance1Field.setText(s);
+	    updateState();
+	}
+
+	public void setDistance2Field(String s) {
+	    this.distance2Field.setText(s);
+	    updateState();
+	}
+
+	public void setDistance1Value(String valueAsString) {
+		this.dist1Value = valueAsString;
+		if(!valueAsString.equals(""))	distance1Entered();
+	    updateState();
+	}
+
+	public void setDistance2Value(String valueAsString) {
+		this.dist2Value = valueAsString;
+		if(!valueAsString.equals(""))	distance2Entered();
+	    updateState();
+	}
+
+	public void setReferenceFileName(String name) {
+		  this.referenceFileName = name;
+	}
+
+	private void setFileChooser() {
+		fileChooser.setFileSelectionMode(FILES_ONLY);
+		FileNameExtensionFilter filter = new FileNameExtensionFilter(".osm, .gpx","osm", "gpx");
+		fileChooser.setFileFilter(filter);
+	}
+
+	public void setReferenceFileNameValue(String value) {
+		this.referenceFileName = value;
+		this.refFileNameValue.setText(value);
+		refFileEntered();
+		updateState();
+	}
+
+	public JFileChooser getFileChooser() {
+		return this.fileChooser;
+	}
+
+	public String getFileName() {
+		return this.referenceFileName;
+	}
+
+	// LISTENER
+
+	public void setOkButtonListener(ActionListener l) {
+	    this.runButton.addActionListener(l);
+	}
+
+	public void setCancelButtonListener(ActionListener l) {
+	    this.cancelButton.addActionListener(l);
+	}
+
+	public void setWindowListener(WindowListener l) {
+	    this.addWindowListener(l);
+	}
+
+	public void addOpenFileButtonListener(ActionListener l) {
+		this.openButton.addActionListener(l);
+	}
+
+	public void addSelectLayerButtonListener(ActionListener l) {
+		this.selectLayerButton.addActionListener(l);
+	}
+
+	public void addCancelButtonListener(ActionListener l) {
+		this.cancelButton.addActionListener(l);
+	}
+
+	public void addRunButtonListener(ActionListener l) {
+		this.runButton.addActionListener(l);
+	}
+
+	public void addEdgePointButtonListener(ActionListener l) {
+		this.addEdgePointsButton.addActionListener(l);
+	}
+
+	public void addReferencePointButtonListener(ActionListener l) {
+		this.addRefPointsButton.addActionListener(l);
+	}
+
+	public void addFrameWindowListener(WindowAdapter wAdapter) {
+		this.addWindowListener(wAdapter);
+	}
+
+	public void addDistance1FieldListener(FocusListener l) {
+		this.distance1Field.addFocusListener(l);
+	}
+
+	public void addDistance2FieldListener(FocusListener l) {
+		this.distance2Field.addFocusListener(l);
+	}
+
+	public void addHelpButtonListener(ActionListener l) {
+		this.helpButton.addActionListener(l);
+	}
+
+
+	// HELPER
+
+	private String formatValue(double value) {
+		return String.format(language, "%.3f", value);
+	}
+
+	private ImageIcon getCheckedIcon() {
+		String imageName = "checked.png";
+		Image image = null;
+		try {
+			image = ImageIO.read(getClass().getResource("/images/" + imageName));
+		} catch (Exception ex) {
+			System.out.println("Error: Could not load image " + imageName + "," + ex);
+	 	}
+		return new ImageIcon(image);
+	}
+
+	public void updateState() {
+		if(originPoints.isEmpty()) {
+			// button blink
+			distance1Field.setEnabled(false);
+			distance2Field.setEnabled(false);
+			openButton.setEnabled(false);
+			selectLayerButton.setEnabled(false);
+			addRefPointsButton.setEnabled(false);
+			runButton.setEnabled(false);
+		}
+		else {
+			if(dist1Value == null && dist2Value == null) {
+				distance1Field.setEnabled(true);
+				distance2Field.setEnabled(true);
+			}
+			if(dist1Value != null) {
+				openButton.setEnabled(true);
+				selectLayerButton.setEnabled(true);
+			}
+			if(referenceFileName != null)	addRefPointsButton.setEnabled(true);
+			if(!referencePoints.isEmpty())	runButton.setEnabled(true);
+		}
+	}
+
+	public void refresh() {
+		this.setVisible(true);
+	}
 
 }
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/ClipboardSessionExporter.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/ClipboardSessionExporter.java	(revision 35104)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/ClipboardSessionExporter.java	(revision 35104)
@@ -0,0 +1,10 @@
+package org.openstreetmap.josm.plugins.piclayer.io.session;
+
+import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerFromClipboard;
+
+public class ClipboardSessionExporter extends PicLayerAbstractSessionExporter<PicLayerFromClipboard>{
+
+	public ClipboardSessionExporter(PicLayerFromClipboard layer) {
+		super(layer);
+	}
+}
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/FileSessionExporter.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/FileSessionExporter.java	(revision 35104)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/FileSessionExporter.java	(revision 35104)
@@ -0,0 +1,10 @@
+package org.openstreetmap.josm.plugins.piclayer.io.session;
+
+import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerFromFile;
+
+public class FileSessionExporter extends PicLayerAbstractSessionExporter<PicLayerFromFile>{
+
+	public FileSessionExporter(PicLayerFromFile layer) {
+		super(layer);
+	}
+}
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/KMLSessionExporter.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/KMLSessionExporter.java	(revision 35104)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/KMLSessionExporter.java	(revision 35104)
@@ -0,0 +1,10 @@
+package org.openstreetmap.josm.plugins.piclayer.io.session;
+
+import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerFromKML;
+
+public class KMLSessionExporter extends PicLayerAbstractSessionExporter<PicLayerFromKML>{
+
+	public KMLSessionExporter(PicLayerFromKML layer) {
+		super(layer);
+	}
+}
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/PicLayerAbstractSessionExporter.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/PicLayerAbstractSessionExporter.java	(revision 35104)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/PicLayerAbstractSessionExporter.java	(revision 35104)
@@ -0,0 +1,81 @@
+package org.openstreetmap.josm.plugins.piclayer.io.session;
+
+import java.awt.Component;
+import java.awt.GridBagLayout;
+import java.io.IOException;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingConstants;
+
+import org.openstreetmap.josm.gui.layer.geoimage.ImageEntry;
+import org.openstreetmap.josm.io.session.AbstractSessionExporter;
+import org.openstreetmap.josm.io.session.SessionWriter;
+import org.openstreetmap.josm.io.session.SessionWriter.ExportSupport;
+import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerAbstract;
+import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Logging;
+import org.w3c.dom.Element;
+
+/**
+ * Session exporter for PicLayer.
+ * Code copied and adjusted from JOSM GeoImageSessionExporter-class!
+ * @param <T> Type of PicLayerAbstract
+ * @author rebsc
+ */
+public abstract class PicLayerAbstractSessionExporter<T extends PicLayerAbstract> extends AbstractSessionExporter<T>{
+
+    public PicLayerAbstractSessionExporter(T layer) {
+        super(layer);
+    }
+
+	@Override
+	public Component getExportPanel() {
+		final JPanel p = new JPanel(new GridBagLayout());
+        export.setSelected(true);
+        final JLabel lbl = new JLabel(layer.getName(), layer.getIcon(), SwingConstants.LEFT);
+        lbl.setToolTipText(layer.getToolTipText());
+        lbl.setLabelFor(export);
+        p.add(export, GBC.std());
+        p.add(lbl, GBC.std());
+        p.add(GBC.glue(1, 0), GBC.std().fill(GBC.HORIZONTAL));
+        return p;
+	}
+
+	@Override
+	public Element export(ExportSupport support) throws IOException {
+		Element layerElem = support.createElement("layer");
+        layerElem.setAttribute("type", "piclayerImage");
+        layerElem.setAttribute("version", "0.1");
+
+        for (ImageEntry entry : layer.getImages()) {
+
+            Element imgElem = support.createElement("piclayerImage");
+
+            if (entry.getFile() == null) {
+                Logging.warn("No file attribute for image - skipping entry");
+                break;
+            }
+            addAttr("file", entry.getFile().getPath(), imgElem, support);
+            // FIXME: relative filenames as option
+
+            addAttr("thumbnail", Boolean.toString(entry.hasThumbnail()), imgElem, support);
+            if (entry.getPos() != null) {
+                Element posElem = support.createElement("position");
+                posElem.setAttribute("lat", Double.toString(entry.getPos().lat()));
+                posElem.setAttribute("lon", Double.toString(entry.getPos().lon()));
+                imgElem.appendChild(posElem);
+            }
+
+            layerElem.appendChild(imgElem);
+        }
+	    return layerElem;
+	}
+
+    protected static void addAttr(String name, String value, Element element, SessionWriter.ExportSupport support) {
+        Element attrElem = support.createElement(name);
+        attrElem.appendChild(support.createTextNode(value));
+        element.appendChild(attrElem);
+    }
+
+}
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/PicLayerSessionImporter.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/PicLayerSessionImporter.java	(revision 35104)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/io/session/PicLayerSessionImporter.java	(revision 35104)
@@ -0,0 +1,120 @@
+package org.openstreetmap.josm.plugins.piclayer.io.session;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JOptionPane;
+
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.gpx.GpxImageEntry;
+import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.gui.layer.geoimage.ImageEntry;
+import org.openstreetmap.josm.gui.progress.ProgressMonitor;
+import org.openstreetmap.josm.io.IllegalDataException;
+import org.openstreetmap.josm.io.session.SessionLayerImporter;
+import org.openstreetmap.josm.io.session.SessionReader;
+import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerAbstract;
+import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerFromFile;
+import org.openstreetmap.josm.plugins.piclayer.layer.PicLayerFromKML;
+import org.openstreetmap.josm.plugins.piclayer.layer.kml.KMLGroundOverlay;
+import org.openstreetmap.josm.plugins.piclayer.layer.kml.KMLReader;
+import org.openstreetmap.josm.tools.Logging;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Session importer for PicLayer.
+ * Code copied and adjusted from JOSM GeoImageSessionImporter-class!
+ * @author rebsc
+ *
+ */
+public class PicLayerSessionImporter implements SessionLayerImporter{
+
+	@Override
+    public Layer load(Element elem, SessionReader.ImportSupport support, ProgressMonitor progressMonitor)
+            throws IOException, IllegalDataException {
+        String version = elem.getAttribute("version");
+        if (!"0.1".equals(version)) {
+            throw new IllegalDataException(tr("Version ''{0}'' of meta data for piclayerImage layer is not supported. Expected: 0.1", version));
+        }
+
+        List<ImageEntry> entries = new ArrayList<>();
+        NodeList imgNodes = elem.getChildNodes();
+        boolean useThumbs = false;
+        for (int i = 0; i < imgNodes.getLength(); ++i) {
+            Node imgNode = imgNodes.item(i);
+            if (imgNode.getNodeType() == Node.ELEMENT_NODE) {
+                Element imgElem = (Element) imgNode;
+                if ("piclayerImage".equals(imgElem.getTagName())) {
+                    ImageEntry entry = new ImageEntry();
+                    NodeList attrNodes = imgElem.getChildNodes();
+                    for (int j = 0; j < attrNodes.getLength(); ++j) {
+                        Node attrNode = attrNodes.item(j);
+                        if (attrNode.getNodeType() == Node.ELEMENT_NODE) {
+                            handleElement(entry, (Element) attrNode);
+                        }
+                    }
+                    entries.add(entry);
+                } else if ("show-thumbnails".equals(imgElem.getTagName())) {
+                    useThumbs = Boolean.parseBoolean(imgElem.getTextContent());
+                }
+            }
+        }
+
+        // create empty layer to avoid exceptions, remove layer afterwards
+        Layer defaultLayer = new OsmDataLayer(new DataSet(), OsmDataLayer.createNewName(), null);
+        MainApplication.getLayerManager().addLayer(defaultLayer);
+
+        PicLayerAbstract layer = null;
+
+        File file = entries.get(0).getFile();
+        if(file.getAbsolutePath().contains("kml") || file.getAbsolutePath().contains("KML")) {
+        	KMLReader kml = new KMLReader(file);
+            kml.process();
+            JOptionPane.showMessageDialog(null, tr("KML calibration is in beta stage and may produce incorrectly calibrated layers!\n"+
+            "Please use {0} to upload your KMLs that were calibrated incorrectly.",
+            "https://josm.openstreetmap.de/ticket/5451"), tr("Notification"), JOptionPane.INFORMATION_MESSAGE);
+            List<KMLGroundOverlay> overlays = kml.getGroundOverlays();
+            if(!overlays.isEmpty()) {
+            	layer = new PicLayerFromKML(file, overlays.get(0));
+                layer.initialize();
+            }
+        }
+        else {
+            layer = new PicLayerFromFile(file);
+            layer.initialize();
+        }
+
+        MainApplication.getLayerManager().removeLayer(defaultLayer);
+
+        return layer;
+    }
+
+    private static void handleElement(GpxImageEntry entry, Element attrElem) {
+        try {
+            switch(attrElem.getTagName()) {
+            case "file":
+                entry.setFile(new File(attrElem.getTextContent()));
+                break;
+            case "position":
+                double lat = Double.parseDouble(attrElem.getAttribute("lat"));
+                double lon = Double.parseDouble(attrElem.getAttribute("lon"));
+                entry.setPos(new LatLon(lat, lon));
+                break;
+            default: // Do nothing
+            }
+            // TODO: handle thumbnail loading
+        } catch (NumberFormatException e) {
+            Logging.trace(e);
+        }
+    }
+
+}
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java	(revision 35032)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerAbstract.java	(revision 35104)
@@ -3,5 +3,4 @@
 
 import static org.openstreetmap.josm.tools.I18n.tr;
-
 
 import java.awt.BasicStroke;
@@ -16,4 +15,5 @@
 import java.awt.geom.Point2D;
 import java.io.BufferedReader;
+import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -39,4 +39,5 @@
 import org.openstreetmap.josm.gui.MapView;
 import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.geoimage.ImageEntry;
 import org.openstreetmap.josm.plugins.piclayer.actions.LoadPictureCalibrationAction;
 import org.openstreetmap.josm.plugins.piclayer.actions.LoadPictureCalibrationFromWorldAction;
@@ -63,4 +64,7 @@
     private static Image pinTiledImage;
     private static Image pinTiledImageOrange;
+
+    // save file for IO Sessions
+    File imageFile;
 
     // Initial position of the image in the real world
@@ -248,4 +252,10 @@
     public String getToolTipText() {
         return getPicLayerName();
+    }
+
+    public List<ImageEntry> getImages(){
+    	List<ImageEntry> list = new ArrayList<>();
+    	list.add(new ImageEntry(imageFile));
+    	return list;
     }
 
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromFile.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromFile.java	(revision 35032)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromFile.java	(revision 35104)
@@ -40,4 +40,5 @@
         // Remember the file
         m_file = file;
+        super.imageFile = m_file;
 
         if ("zip".equalsIgnoreCase(getFileExtension(file))) {
@@ -229,4 +230,3 @@
         return f.getName().substring(dotIdx+1);
     }
-
 }
Index: applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromKML.java
===================================================================
--- applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromKML.java	(revision 35032)
+++ applications/editors/josm/plugins/piclayer/src/org/openstreetmap/josm/plugins/piclayer/layer/PicLayerFromKML.java	(revision 35104)
@@ -25,4 +25,6 @@
 
         pictureName = calibration.getName();
+
+        super.imageFile = main;
 
         // Set the name of the layer as the base name of the file
