Index: applications/editors/josm/plugins/public_transport/build.xml
===================================================================
--- applications/editors/josm/plugins/public_transport/build.xml	(revision 34547)
+++ applications/editors/josm/plugins/public_transport/build.xml	(revision 34548)
@@ -5,5 +5,5 @@
     <property name="commit.message" value="Commit message"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="13906"/>
+    <property name="plugin.main.version" value="14153"/>
 
     <property name="plugin.author" value="Roland M. Olbricht"/>
Index: applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/actions/GTFSImporterAction.java
===================================================================
--- applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/actions/GTFSImporterAction.java	(revision 34547)
+++ applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/actions/GTFSImporterAction.java	(revision 34548)
@@ -23,6 +23,6 @@
 import javax.swing.JTable;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.data.UndoRedoHandler;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.DataSet;
@@ -39,4 +39,5 @@
 import org.openstreetmap.josm.plugins.public_transport.models.GTFSStopTableModel;
 import org.openstreetmap.josm.plugins.public_transport.refs.TrackReference;
+import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Logging;
 
@@ -94,5 +95,5 @@
 
         if (tr("Create Stops from GTFS ...").equals(event.getActionCommand())) {
-            String curDir = Main.pref.get("lastDirectory");
+            String curDir = Config.getPref().get("lastDirectory");
             if (curDir.isEmpty()) {
                 curDir = ".";
@@ -102,10 +103,10 @@
             fc.setMultiSelectionEnabled(false);
 
-            int answer = fc.showOpenDialog(Main.parent);
+            int answer = fc.showOpenDialog(MainApplication.getMainFrame());
             if (answer != JFileChooser.APPROVE_OPTION)
                 return;
 
             if (!fc.getCurrentDirectory().getAbsolutePath().equals(curDir))
-                Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
+                Config.getPref().put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
 
             importData(fc.getSelectedFile());
@@ -116,10 +117,10 @@
     {
       if ((!inEvent) && (dialog.gpsTimeStartValid()) && (currentTrack != null))
-    Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
+    UndoRedoHandler.getInstance().add(new TrackStoplistRelocateCommand(this));
     }
     else if ("stopImporter.settingsStopwatchStart".equals(event.getActionCommand()))
     {
       if ((!inEvent) && (dialog.stopwatchStartValid()) && (currentTrack != null))
-    Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
+    UndoRedoHandler.getInstance().add(new TrackStoplistRelocateCommand(this));
     }
     else if ("stopImporter.settingsTimeWindow".equals(event.getActionCommand()))
@@ -134,5 +135,5 @@
     }
     else if ("stopImporter.settingsSuggestStops".equals(event.getActionCommand()))
-      Main.main.undoRedo.add(new TrackSuggestStopsCommand(this));
+      UndoRedoHandler.getInstance().add(new TrackSuggestStopsCommand(this));
     else if ("stopImporter.stoplistFind".equals(event.getActionCommand()))
       findNodesInTable(dialog.getStoplistTable(), currentTrack.stoplistTM.getNodes());
@@ -143,15 +144,15 @@
     else if ("stopImporter.stoplistDetach".equals(event.getActionCommand()))
     {
-      Main.main.undoRedo.add(new TrackStoplistDetachCommand(this));
+      UndoRedoHandler.getInstance().add(new TrackStoplistDetachCommand(this));
       dialog.getStoplistTable().clearSelection();
     */
         } else if ("gtfsImporter.gtfsStopsAdd".equals(event.getActionCommand()))
-            Main.main.undoRedo.add(new GTFSAddCommand(this));
+            UndoRedoHandler.getInstance().add(new GTFSAddCommand(this));
         else if ("gtfsImporter.gtfsStopsDelete".equals(event.getActionCommand()))
-            Main.main.undoRedo.add(new GTFSDeleteCommand(this));
+            UndoRedoHandler.getInstance().add(new GTFSDeleteCommand(this));
         else if ("gtfsImporter.gtfsStopsCatch".equals(event.getActionCommand()))
-            Main.main.undoRedo.add(new GTFSCatchCommand(this));
+            UndoRedoHandler.getInstance().add(new GTFSCatchCommand(this));
         else if ("gtfsImporter.gtfsStopsJoin".equals(event.getActionCommand()))
-            Main.main.undoRedo.add(new GTFSJoinCommand(this));
+            UndoRedoHandler.getInstance().add(new GTFSJoinCommand(this));
         else if ("gtfsImporter.gtfsStopsFind".equals(event.getActionCommand()))
             findNodesInTable(dialog.getGTFSStopTable(), gtfsStopTM.nodes);
@@ -359,5 +360,5 @@
         @Override
         public void actionPerformed(ActionEvent e) {
-            Main.main.undoRedo.add(new GTFSAddCommand(GTFSImporterAction.this));
+            UndoRedoHandler.getInstance().add(new GTFSAddCommand(GTFSImporterAction.this));
             showNodesFromTable(dialog.getGTFSStopTable(), gtfsStopTM.nodes);
         }
@@ -381,5 +382,5 @@
     table.clearSelection();
     table.addRowSelectionInterval(row, row);
-/*  Main.main.undoRedo.add
+/*  UndoRedoHandler.getInstance().add
         (new WaypointsDisableCommand(GTFSImporterAction.this));*
       }
@@ -409,5 +410,5 @@
     table.clearSelection();
     table.addRowSelectionInterval(row, row);
-/*  Main.main.undoRedo.add
+/*  UndoRedoHandler.getInstance().add
         (new TrackStoplistDeleteCommand(GTFSImporterAction.this));*
       }
Index: applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/actions/RoutePatternAction.java
===================================================================
--- applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/actions/RoutePatternAction.java	(revision 34547)
+++ applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/actions/RoutePatternAction.java	(revision 34548)
@@ -43,5 +43,4 @@
 import javax.swing.table.TableCellEditor;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.actions.mapmode.DeleteAction;
@@ -335,5 +334,5 @@
     @Override
     public void actionPerformed(ActionEvent event) {
-        Frame frame = JOptionPane.getFrameForComponent(Main.parent);
+        Frame frame = JOptionPane.getFrameForComponent(MainApplication.getMainFrame());
         DataSet mainDataSet = MainApplication.getLayerManager().getEditDataSet();
 
Index: applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/actions/StopImporterAction.java
===================================================================
--- applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/actions/StopImporterAction.java	(revision 34547)
+++ applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/actions/StopImporterAction.java	(revision 34548)
@@ -24,6 +24,6 @@
 import javax.swing.JTable;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.data.UndoRedoHandler;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.GpxData;
@@ -50,4 +50,5 @@
 import org.openstreetmap.josm.plugins.public_transport.models.WaypointTableModel;
 import org.openstreetmap.josm.plugins.public_transport.refs.TrackReference;
+import org.openstreetmap.josm.spi.preferences.Config;
 import org.xml.sax.SAXException;
 
@@ -104,5 +105,5 @@
 
         if (tr("Create Stops from GPX ...").equals(event.getActionCommand())) {
-            String curDir = Main.pref.get("lastDirectory");
+            String curDir = Config.getPref().get("lastDirectory");
             if (curDir.equals("")) {
                 curDir = ".";
@@ -112,10 +113,10 @@
             fc.setMultiSelectionEnabled(false);
 
-            int answer = fc.showOpenDialog(Main.parent);
+            int answer = fc.showOpenDialog(MainApplication.getMainFrame());
             if (answer != JFileChooser.APPROVE_OPTION)
                 return;
 
             if (!fc.getCurrentDirectory().getAbsolutePath().equals(curDir))
-                Main.pref.put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
+                Config.getPref().put("lastDirectory", fc.getCurrentDirectory().getAbsolutePath());
 
             importData(fc.getSelectedFile());
@@ -124,8 +125,8 @@
         } else if ("stopImporter.settingsGPSTimeStart".equals(event.getActionCommand())) {
             if ((!inEvent) && (dialog.gpsTimeStartValid()) && (currentTrack != null))
-                Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
+                UndoRedoHandler.getInstance().add(new TrackStoplistRelocateCommand(this));
         } else if ("stopImporter.settingsStopwatchStart".equals(event.getActionCommand())) {
             if ((!inEvent) && (dialog.stopwatchStartValid()) && (currentTrack != null))
-                Main.main.undoRedo.add(new TrackStoplistRelocateCommand(this));
+                UndoRedoHandler.getInstance().add(new TrackStoplistRelocateCommand(this));
         } else if ("stopImporter.settingsTimeWindow".equals(event.getActionCommand())) {
             if (currentTrack != null)
@@ -135,5 +136,5 @@
                 currentTrack.threshold = dialog.getThreshold();
         } else if ("stopImporter.settingsSuggestStops".equals(event.getActionCommand()))
-            Main.main.undoRedo.add(new TrackSuggestStopsCommand(this));
+            UndoRedoHandler.getInstance().add(new TrackSuggestStopsCommand(this));
         else if ("stopImporter.stoplistFind".equals(event.getActionCommand()))
             findNodesInTable(dialog.getStoplistTable(), currentTrack.stoplistTM.getNodes());
@@ -143,12 +144,12 @@
             markNodesFromTable(dialog.getStoplistTable(), currentTrack.stoplistTM.getNodes());
         else if ("stopImporter.stoplistDetach".equals(event.getActionCommand())) {
-            Main.main.undoRedo.add(new TrackStoplistDetachCommand(this));
+            UndoRedoHandler.getInstance().add(new TrackStoplistDetachCommand(this));
             dialog.getStoplistTable().clearSelection();
         } else if ("stopImporter.stoplistAdd".equals(event.getActionCommand()))
-            Main.main.undoRedo.add(new TrackStoplistAddCommand(this));
+            UndoRedoHandler.getInstance().add(new TrackStoplistAddCommand(this));
         else if ("stopImporter.stoplistDelete".equals(event.getActionCommand()))
-            Main.main.undoRedo.add(new TrackStoplistDeleteCommand(this));
+            UndoRedoHandler.getInstance().add(new TrackStoplistDeleteCommand(this));
         else if ("stopImporter.stoplistSort".equals(event.getActionCommand()))
-            Main.main.undoRedo.add(new TrackStoplistSortCommand(this));
+            UndoRedoHandler.getInstance().add(new TrackStoplistSortCommand(this));
         else if ("stopImporter.waypointsFind".equals(event.getActionCommand()))
             findNodesInTable(dialog.getWaypointsTable(), waypointTM.nodes);
@@ -158,12 +159,12 @@
             markNodesFromTable(dialog.getWaypointsTable(), waypointTM.nodes);
         else if ("stopImporter.waypointsDetach".equals(event.getActionCommand())) {
-            Main.main.undoRedo.add(new WaypointsDetachCommand(this));
+            UndoRedoHandler.getInstance().add(new WaypointsDetachCommand(this));
             dialog.getWaypointsTable().clearSelection();
         } else if ("stopImporter.waypointsAdd".equals(event.getActionCommand()))
-            Main.main.undoRedo.add(new WaypointsEnableCommand(this));
+            UndoRedoHandler.getInstance().add(new WaypointsEnableCommand(this));
         else if ("stopImporter.waypointsDelete".equals(event.getActionCommand()))
-            Main.main.undoRedo.add(new WaypointsDisableCommand(this));
+            UndoRedoHandler.getInstance().add(new WaypointsDisableCommand(this));
         else if ("stopImporter.settingsStoptype".equals(event.getActionCommand()))
-            Main.main.undoRedo.add(new SettingsStoptypeCommand(this));
+            UndoRedoHandler.getInstance().add(new SettingsStoptypeCommand(this));
     }
 
@@ -400,5 +401,5 @@
                 table.clearSelection();
                 table.addRowSelectionInterval(row, row);
-                Main.main.undoRedo.add(new WaypointsDisableCommand(StopImporterAction.this));
+                UndoRedoHandler.getInstance().add(new WaypointsDisableCommand(StopImporterAction.this));
             }
         };
@@ -423,5 +424,5 @@
                 table.clearSelection();
                 table.addRowSelectionInterval(row, row);
-                Main.main.undoRedo.add(new TrackStoplistDeleteCommand(StopImporterAction.this));
+                UndoRedoHandler.getInstance().add(new TrackStoplistDeleteCommand(StopImporterAction.this));
             }
         };
Index: applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/dialogs/AbstractImporterDialog.java
===================================================================
--- applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/dialogs/AbstractImporterDialog.java	(revision 34547)
+++ applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/dialogs/AbstractImporterDialog.java	(revision 34548)
@@ -13,6 +13,6 @@
 import javax.swing.JTextField;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.gui.MainApplication;
 import org.openstreetmap.josm.plugins.public_transport.TransText;
 
@@ -44,5 +44,5 @@
 
     public AbstractImporterDialog(T controller, String dialogTitle, String actionPrefix) {
-        Frame frame = JOptionPane.getFrameForComponent(Main.parent);
+        Frame frame = JOptionPane.getFrameForComponent(MainApplication.getMainFrame());
         jDialog = new JDialog(frame, dialogTitle, false);
         tabbedPane = new JTabbedPane();
Index: applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/models/WaypointTableModel.java
===================================================================
--- applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/models/WaypointTableModel.java	(revision 34547)
+++ applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/models/WaypointTableModel.java	(revision 34548)
@@ -10,5 +10,5 @@
 import javax.swing.table.DefaultTableModel;
 
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.UndoRedoHandler;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.WayPoint;
@@ -88,5 +88,5 @@
             if (inEvent)
                 return;
-            Main.main.undoRedo.add(new WaypointsNameCommand(this, e.getFirstRow(),
+            UndoRedoHandler.getInstance().add(new WaypointsNameCommand(this, e.getFirstRow(),
                     (String) getValueAt(e.getFirstRow(), 1),
                     (TransText) getValueAt(e.getFirstRow(), 2)));
Index: applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/refs/TrackReference.java
===================================================================
--- applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/refs/TrackReference.java	(revision 34547)
+++ applications/editors/josm/plugins/public_transport/src/org/openstreetmap/josm/plugins/public_transport/refs/TrackReference.java	(revision 34548)
@@ -10,7 +10,7 @@
 import javax.swing.event.TableModelListener;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.command.ChangeCommand;
 import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.data.UndoRedoHandler;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.GpxTrack;
@@ -113,5 +113,5 @@
             }
 
-            Main.main.undoRedo.add(new TrackStoplistNameCommand(this, e.getFirstRow()));
+            UndoRedoHandler.getInstance().add(new TrackStoplistNameCommand(this, e.getFirstRow()));
             stoplistTM.setTimeAt(e.getFirstRow(),
                     (String) stoplistTM.getValueAt(e.getFirstRow(), 0));
@@ -182,5 +182,5 @@
             Command cmd = new ChangeCommand(node, newNode);
             if (cmd != null) {
-                Main.main.undoRedo.add(cmd);
+                UndoRedoHandler.getInstance().add(cmd);
             }
         }
