Index: applications/editors/josm/plugins/measurement/build.xml
===================================================================
--- applications/editors/josm/plugins/measurement/build.xml	(revision 34528)
+++ applications/editors/josm/plugins/measurement/build.xml	(revision 34529)
@@ -4,5 +4,5 @@
     <property name="commit.message" value="recompile dure to core change"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="12636"/>
+    <property name="plugin.main.version" value="14153"/>
     <property name="plugin.canloadatruntime" value="true"/>
     
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 34528)
+++ applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java	(revision 34529)
@@ -16,7 +16,7 @@
 import javax.swing.JPanel;
 
-import org.openstreetmap.josm.data.SelectionChangedListener;
 import org.openstreetmap.josm.data.SystemOfMeasurement;
 import org.openstreetmap.josm.data.SystemOfMeasurement.SoMChangeListener;
+import org.openstreetmap.josm.data.osm.DataSelectionListener;
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
@@ -30,4 +30,5 @@
 import org.openstreetmap.josm.data.osm.event.PrimitivesRemovedEvent;
 import org.openstreetmap.josm.data.osm.event.RelationMembersChangedEvent;
+import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent;
 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent;
@@ -46,5 +47,5 @@
  * @author ramack
  */
-public class MeasurementDialog extends ToggleDialog implements SelectionChangedListener, DataSetListener, SoMChangeListener {
+public class MeasurementDialog extends ToggleDialog implements DataSelectionListener, DataSetListener, SoMChangeListener {
     private static final long serialVersionUID = 4708541586297950021L;
 
@@ -142,5 +143,5 @@
         }));
 
-        DataSet.addSelectionListener(this);
+        SelectionEventManager.getInstance().addSelectionListener(this);
         SystemOfMeasurement.addSoMChangeListener(this);
     }
@@ -170,6 +171,6 @@
 
     @Override
-    public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
-        refresh(newSelection);
+    public void selectionChanged(SelectionChangeEvent event) {
+        refresh(event.getSelection());
     }
 
@@ -262,5 +263,5 @@
         super.destroy();
         SystemOfMeasurement.removeSoMChangeListener(this);
-        DataSet.removeSelectionListener(this);
+        SelectionEventManager.getInstance().removeSelectionListener(this);
         if (ds != null) {
             ds.removeDataSetListener(this);
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 34528)
+++ applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java	(revision 34529)
@@ -27,5 +27,4 @@
 import javax.swing.JOptionPane;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -103,10 +102,10 @@
     public Action[] getMenuEntries() {
         return new Action[]{
-            LayerListDialog.getInstance().createShowHideLayerAction(),
-            // TODO: implement new JMenuItem(new LayerListDialog.DeleteLayerAction(this)),
-            SeparatorLayerAction.INSTANCE,
-            new GPXLayerImportAction(this),
-            SeparatorLayerAction.INSTANCE,
-            new LayerListPopup.InfoAction(this)};
+                LayerListDialog.getInstance().createShowHideLayerAction(),
+                // TODO: implement new JMenuItem(new LayerListDialog.DeleteLayerAction(this)),
+                SeparatorLayerAction.INSTANCE,
+                new GPXLayerImportAction(this),
+                SeparatorLayerAction.INSTANCE,
+                new LayerListPopup.InfoAction(this)};
     }
 
@@ -186,7 +185,7 @@
 
         return (180 * Math.atan2(coslat2 * Math.sin(dlon),
-                          (Math.cos(lat1) * Math.sin(lat2)
-                                    -
-                           Math.sin(lat1) * coslat2 * Math.cos(dlon)))) / Math.PI;
+                (Math.cos(lat1) * Math.sin(lat2)
+                        -
+                        Math.sin(lat1) * coslat2 * Math.cos(dlon)))) / Math.PI;
     }
 
@@ -207,5 +206,5 @@
         double d = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
         heading = Math.acos((Math.sin(lat2) - Math.sin(lat1) * Math.cos(d))
-                            / (Math.sin(d) * Math.cos(lat1)));
+                / (Math.sin(d) * Math.cos(lat1)));
         if (Math.sin(lon2 - lon1) < 0) {
             heading = 2 * Math.PI - heading;
@@ -253,5 +252,5 @@
                         Layer layer = (Layer)value;
                         JLabel label = (JLabel)super.getListCellRendererComponent(list,
-                                                                                  layer.getName(), index, isSelected, cellHasFocus);
+                                layer.getName(), index, isSelected, cellHasFocus);
                         Icon icon = layer.getIcon();
                         label.setIcon(icon);
@@ -267,15 +266,15 @@
 
                 final JOptionPane optionPane = new JOptionPane(panel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION){
-                        @Override
-                        public void selectInitialValue() {
-                            layerList.requestFocusInWindow();
-                        }
-                    };
-                final JDialog dlg = optionPane.createDialog(Main.parent, tr("Import path from GPX layer"));
+                    @Override
+                    public void selectInitialValue() {
+                        layerList.requestFocusInWindow();
+                    }
+                };
+                final JDialog dlg = optionPane.createDialog(MainApplication.getMainFrame(), tr("Import path from GPX layer"));
                 dlg.setVisible(true);
 
                 Object answer = optionPane.getValue();
                 if (answer == null || answer == JOptionPane.UNINITIALIZED_VALUE ||
-                    (answer instanceof Integer && (Integer)answer != JOptionPane.OK_OPTION)) {
+                        (answer instanceof Integer && (Integer)answer != JOptionPane.OK_OPTION)) {
                     return;
                 }
@@ -297,5 +296,5 @@
                 // TODO: register a listener and show menu entry only if gps layers are available
                 // no gps layer
-                JOptionPane.showMessageDialog(Main.parent,tr("No GPX data layer found."));
+                JOptionPane.showMessageDialog(MainApplication.getMainFrame(),tr("No GPX data layer found."));
             }
         }
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 34528)
+++ applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementMode.java	(revision 34529)
@@ -9,5 +9,4 @@
 import javax.swing.JOptionPane;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.mapmode.MapMode;
 import org.openstreetmap.josm.data.coor.LatLon;
@@ -49,5 +48,5 @@
             LatLon coor = MainApplication.getMap().mapView.getLatLon(e.getX(), e.getY());
             if (coor.isOutSideWorld()) {
-                JOptionPane.showMessageDialog(Main.parent,tr("Can not draw outside of the world."));
+                JOptionPane.showMessageDialog(MainApplication.getMainFrame(),tr("Can not draw outside of the world."));
                 return;
             }
