Index: /applications/editors/josm/plugins/public_transport/src/public_transport/SettingsStoptypeCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/SettingsStoptypeCommand.java	(revision 20814)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/SettingsStoptypeCommand.java	(revision 20815)
@@ -58,7 +58,7 @@
       for (int i = 0; i < track.stoplistTM.getRowCount(); ++i)
       {
-	if ((Node)track.stoplistTM.nodes.elementAt(i) != null)
+	if (track.stoplistTM.nodeAt(i) != null)
 	{
-	  Node node = (Node)track.stoplistTM.nodes.elementAt(i);
+	  Node node = track.stoplistTM.nodeAt(i);
 	  oldStrings.add(new HighwayRailway(node));
 	  StopImporterAction.setTagsWrtType(node, type);
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java	(revision 20814)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java	(revision 20815)
@@ -155,9 +155,9 @@
       Main.main.undoRedo.add(new TrackSuggestStopsCommand(this));
     else if ("stopImporter.stoplistFind".equals(event.getActionCommand()))
-      findNodesInTable(dialog.getStoplistTable(), currentTrack.stoplistTM.nodes);
+      findNodesInTable(dialog.getStoplistTable(), currentTrack.stoplistTM.getNodes());
     else if ("stopImporter.stoplistShow".equals(event.getActionCommand()))
-      showNodesFromTable(dialog.getStoplistTable(), currentTrack.stoplistTM.nodes);
+      showNodesFromTable(dialog.getStoplistTable(), currentTrack.stoplistTM.getNodes());
     else if ("stopImporter.stoplistMark".equals(event.getActionCommand()))
-      markNodesFromTable(dialog.getStoplistTable(), currentTrack.stoplistTM.nodes);
+      markNodesFromTable(dialog.getStoplistTable(), currentTrack.stoplistTM.getNodes());
     else if ("stopImporter.stoplistDetach".equals(event.getActionCommand()))
     {
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackReference.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackReference.java	(revision 20814)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackReference.java	(revision 20815)
@@ -31,4 +31,5 @@
   public double threshold;
   private StopImporterAction controller = null;
+  public boolean inEvent = false;
     
   public TrackReference(GpxTrack track, StopImporterAction controller)
@@ -100,8 +101,13 @@
     if ((e.getType() == TableModelEvent.UPDATE) && (e.getFirstRow() >= 0))
     {
+      if (inEvent)
+	return;
+      
       double time = StopImporterDialog.parseTime
 	    ((String)stoplistTM.getValueAt(e.getFirstRow(), 0));
       if (time < 0)
       {
+	stoplistTM.setValueAt
+	    (stoplistTM.timeAt(e.getFirstRow()), e.getFirstRow(), 0);
 	JOptionPane.showMessageDialog
 	    (null, "Can't parse a time from this string.", "Invalid value",
@@ -110,22 +116,10 @@
       }
 
-      LatLon latLon = computeCoor(time);
-	
-      if (stoplistTM.nodes.elementAt(e.getFirstRow()) == null)
-      {
-	Node node = controller.createNode
-	    (latLon, (String)stoplistTM.getValueAt(e.getFirstRow(), 1));
-	stoplistTM.nodes.set(e.getFirstRow(), node);
-      }
-      else
-      {
-	Node node = new Node(stoplistTM.nodes.elementAt(e.getFirstRow()));
-	node.setCoor(latLon);
-	node.put("name", (String)stoplistTM.getValueAt(e.getFirstRow(), 1));
-	Command cmd = new ChangeCommand(stoplistTM.nodes.elementAt(e.getFirstRow()), node);
-	if (cmd != null) {
-	  Main.main.undoRedo.add(cmd);
-	}
-      }
+      Main.main.undoRedo.add(new TrackStoplistNameCommand
+              (this, e.getFirstRow(),
+	       (String)stoplistTM.getValueAt(e.getFirstRow(), 0),
+	       (String)stoplistTM.getValueAt(e.getFirstRow(), 1)));
+      stoplistTM.setTimeAt
+	  (e.getFirstRow(), (String)stoplistTM.getValueAt(e.getFirstRow(), 0));
     }
   }
@@ -186,7 +180,7 @@
   public void relocateNodes()
   {
-    for (int i = 0; i < stoplistTM.nodes.size(); ++i)
-    {
-      Node node = stoplistTM.nodes.elementAt(i);
+    for (int i = 0; i < stoplistTM.getNodes().size(); ++i)
+    {
+      Node node = stoplistTM.nodeAt(i);
       if (node == null)
 	continue;
@@ -195,5 +189,5 @@
 	    ((String)stoplistTM.getValueAt(i, 0));
       LatLon latLon = computeCoor(time);
-	
+
       Node newNode = new Node(node);
       newNode.setCoor(latLon);
@@ -205,123 +199,3 @@
     }
   }
-    
-  public void suggestStops()
-  {
-    Vector< WayPoint > wayPoints = new Vector< WayPoint >();
-    Iterator< GpxTrackSegment > siter = track.getSegments().iterator();
-    while (siter.hasNext())
-    {
-      Iterator< WayPoint > witer = siter.next().getWayPoints().iterator();
-      while (witer.hasNext())
-	wayPoints.add(witer.next());
-    }
-    Vector< Double > wayPointsDist = new Vector< Double >(wayPoints.size());
-      
-    int i = 0;
-    double time = -48*60*60;
-    double dGpsStartTime = StopImporterDialog.parseTime(gpsStartTime);
-    while ((i < wayPoints.size()) && (time < dGpsStartTime + timeWindow/2))
-    {
-      if (wayPoints.elementAt(i).getString("time") != null)
-	time = StopImporterDialog.parseTime(wayPoints.elementAt(i)
-	    .getString("time").substring(11,19));
-      if (time < dGpsStartTime)
-	time += 24*60*60;
-      wayPointsDist.add(Double.valueOf(Double.POSITIVE_INFINITY));
-      ++i;
-    }
-    while (i < wayPoints.size())
-    {
-      int j = i;
-      double time2 = time;
-      while ((j > 0) && (time - timeWindow/2 < time2))
-      {
-	--j;
-	if (wayPoints.elementAt(j).getString("time") != null)
-	  time2 = StopImporterDialog.parseTime(wayPoints.elementAt(j)
-	      .getString("time").substring(11,19));
-	if (time2 < dGpsStartTime)
-	  time2 += 24*60*60;
-      }
-      int k = i + 1;
-      time2 = time;
-      while ((k < wayPoints.size()) && (time + timeWindow/2 > time2))
-      {
-	if (wayPoints.elementAt(k).getString("time") != null)
-	  time2 = StopImporterDialog.parseTime(wayPoints.elementAt(k)
-	      .getString("time").substring(11,19));
-	if (time2 < dGpsStartTime)
-	  time2 += 24*60*60;
-	++k;
-      }
-	
-      if (j < k)
-      {
-	double dist = 0;
-	LatLon latLonI = wayPoints.elementAt(i).getCoor();
-	for (int l = j; l < k; ++l)
-	{
-	  double distL = latLonI.greatCircleDistance(wayPoints.elementAt(l).getCoor());
-	  if (distL > dist)
-	    dist = distL;
-	}
-	wayPointsDist.add(Double.valueOf(dist));
-      }
-      else
-	wayPointsDist.add(Double.valueOf(Double.POSITIVE_INFINITY));
-	
-      if (wayPoints.elementAt(i).getString("time") != null)
-	time = StopImporterDialog.parseTime(wayPoints.elementAt(i)
-	    .getString("time").substring(11,19));
-      if (time < dGpsStartTime)
-	time += 24*60*60;
-      ++i;
-    }
-      
-    Vector< Node > toDelete = new Vector< Node >();
-    for (i = 0; i < stoplistTM.getRowCount(); ++i)
-    {
-      if ((Node)stoplistTM.nodes.elementAt(i) != null)
-	toDelete.add((Node)stoplistTM.nodes.elementAt(i));
-    }
-    if (!toDelete.isEmpty())
-    {
-      Command cmd = DeleteCommand.delete
-	  (Main.main.getEditLayer(), toDelete);
-      if (cmd == null)
-	return;
-      Main.main.undoRedo.add(cmd);
-    }
-    stoplistTM.clear();
-      
-    LatLon lastStopCoor = null;
-    for (i = 1; i < wayPoints.size()-1; ++i)
-    {
-      if (wayPointsDist.elementAt(i).doubleValue() >= threshold)
-	continue;
-      if ((wayPointsDist.elementAt(i).compareTo(wayPointsDist.elementAt(i-1)) != -1)
-	   || (wayPointsDist.elementAt(i).compareTo(wayPointsDist.elementAt(i+1)) != -1))
-	continue;
-	
-      LatLon latLon = wayPoints.elementAt(i).getCoor();
-      if ((lastStopCoor != null) &&  (lastStopCoor.greatCircleDistance(latLon) < threshold))
-	continue;
-	
-      if (wayPoints.elementAt(i).getString("time") != null)
-      {
-	time = StopImporterDialog.parseTime(wayPoints.elementAt(i)
-	    .getString("time").substring(11,19));
-	double gpsSyncTime = StopImporterDialog.parseTime(this.gpsSyncTime);
-	if (gpsSyncTime < dGpsStartTime - 12*60*60)
-	  gpsSyncTime += 24*60*60;
-	double timeDelta = gpsSyncTime - StopImporterDialog.parseTime(stopwatchStart);
-	time -= timeDelta;
-	stoplistTM.insertRow(-1, StopImporterAction.timeOf(time));
-	Node node = controller.createNode(latLon, "");
-	stoplistTM.nodes.set(stoplistTM.getRowCount()-1, node);
-      }
-	
-      lastStopCoor = latLon;
-    }
-  }
 };
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistAddCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistAddCommand.java	(revision 20814)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistAddCommand.java	(revision 20815)
@@ -33,5 +33,4 @@
     if (workingLine < 0)
       workingLine = stoplistTM.getRowCount()-1;
-    stoplistTM.nodes.removeElementAt(workingLine);
     stoplistTM.removeRow(workingLine);
   }
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDeleteCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDeleteCommand.java	(revision 20814)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDeleteCommand.java	(revision 20815)
@@ -59,9 +59,8 @@
     {
       int j = workingLines.elementAt(i).intValue();
-      Node node = stoplistTM.nodes.elementAt(j);
+      Node node = stoplistTM.nodeAt(j);
       nodesForUndo.add(new NodeTimeName
 	  (node, (String)stoplistTM.getValueAt(j, 0),
 	   (String)stoplistTM.getValueAt(j, 1)));
-      stoplistTM.nodes.removeElementAt(j);
       stoplistTM.removeRow(j);
       if (node == null)
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDetachCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDetachCommand.java	(revision 20814)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistDetachCommand.java	(revision 20815)
@@ -40,5 +40,5 @@
     for (int i = 0; i < consideredLines.size(); ++i)
     {
-      if (stoplistTM.nodes.elementAt(consideredLines.elementAt(i)) != null)
+      if (stoplistTM.nodeAt(consideredLines.elementAt(i)) != null)
 	workingLines.add(consideredLines.elementAt(i));
     }
@@ -51,7 +51,7 @@
     {
       int j = workingLines.elementAt(i).intValue();
-      Node node = stoplistTM.nodes.elementAt(j);
+      Node node = stoplistTM.nodeAt(j);
       nodesForUndo.add(node);
-      stoplistTM.nodes.set(j, null);
+      stoplistTM.setNodeAt(j, null);
     }
     return true;
@@ -64,5 +64,5 @@
       int j = workingLines.elementAt(i).intValue();
       Node node = nodesForUndo.elementAt(i);
-      stoplistTM.nodes.set(j, node);
+      stoplistTM.setNodeAt(j, node);
     }
   }
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistNameCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistNameCommand.java	(revision 20815)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistNameCommand.java	(revision 20815)
@@ -0,0 +1,83 @@
+package public_transport;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.command.Command;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+
+import java.util.Collection;
+import java.util.Vector;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.MutableTreeNode;
+
+public class TrackStoplistNameCommand extends Command
+{
+  private int workingLine = 0;
+  private TrackReference trackref = null;
+  private String oldName = null;
+  private String name = null;
+  private String oldTime = null;
+  private String time = null;
+  private LatLon oldLatLon = null;
+  
+  @SuppressWarnings("unchecked")
+  public TrackStoplistNameCommand
+    (TrackReference trackref, int workingLine, String time, String name)
+  {
+    this.trackref = trackref;
+    this.workingLine = workingLine;
+    Node node = trackref.stoplistTM.nodeAt(workingLine);
+    if (node != null)
+    {
+      oldName = node.get("name");
+      oldTime = trackref.stoplistTM.timeAt(workingLine);
+      oldLatLon = (LatLon)node.getCoor().clone();
+      System.out.println("Setze oldLatLon: " + oldLatLon);
+    }
+    this.name = name;
+    this.time = time;
+  }
+  
+  public boolean executeCommand()
+  {
+    Node node = trackref.stoplistTM.nodeAt(workingLine);
+    if (node != null)
+    {
+      node.put("name", name);
+      double dTime = StopImporterDialog.parseTime(time);
+      node.setCoor(trackref.computeCoor(dTime));
+      trackref.inEvent = true;
+      trackref.stoplistTM.setValueAt(time, workingLine, 0);
+      trackref.stoplistTM.setValueAt(name, workingLine, 1);
+      trackref.inEvent = false;
+    }
+    return true;
+  }
+  
+  public void undoCommand()
+  {
+    Node node = trackref.stoplistTM.nodeAt(workingLine);
+    if (node != null)
+    {
+      node.put("name", oldName);
+      System.out.println("Verwende oldLatLon: " + oldLatLon);
+      node.setCoor(oldLatLon);
+      trackref.inEvent = true;
+      trackref.stoplistTM.setValueAt(oldTime, workingLine, 0);
+      trackref.stoplistTM.setValueAt(oldName, workingLine, 1);
+      trackref.inEvent = false;
+    }
+  }
+  
+  public void fillModifiedData
+    (Collection< OsmPrimitive > modified, Collection< OsmPrimitive > deleted,
+     Collection< OsmPrimitive > added)
+  {
+  }
+  
+  public MutableTreeNode description()
+  {
+    return new DefaultMutableTreeNode("public_transport.TrackStoplist.Edit");
+  }
+};
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistSortCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistSortCommand.java	(revision 20814)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistSortCommand.java	(revision 20815)
@@ -19,4 +19,5 @@
   private Vector< Vector< Object > > tableDataModel = null;
   private Vector< Node > nodes = null;
+  private Vector< String > times = null;
   private Vector< Integer > workingLines = null;
   private int insPos;
@@ -49,5 +50,6 @@
     tableDataModel = (Vector< Vector< Object > >)stoplistTM.getDataVector()
 	.clone();
-    nodes = (Vector< Node >)stoplistTM.nodes.clone();
+    nodes = (Vector< Node >)stoplistTM.getNodes().clone();
+    times = (Vector< String >)stoplistTM.getTimes().clone();
     
     Vector< NodeSortEntry > nodesToSort = new Vector< NodeSortEntry >();
@@ -56,8 +58,7 @@
       int j = workingLines.elementAt(i).intValue();
       nodesToSort.add(new NodeSortEntry
-	  (stoplistTM.nodes.elementAt(j), (String)stoplistTM.getValueAt(j, 0),
+	  (stoplistTM.nodeAt(j), (String)stoplistTM.getValueAt(j, 0),
 	    (String)stoplistTM.getValueAt(j, 1),
 	     StopImporterDialog.parseTime(stopwatchStart)));
-      stoplistTM.nodes.removeElementAt(j);
       stoplistTM.removeRow(j);
     }
@@ -80,5 +81,6 @@
   {
     stoplistTM.setDataVector(tableDataModel);
-    stoplistTM.nodes = nodes;
+    stoplistTM.setNodes(nodes);
+    stoplistTM.setTimes(times);
   }
   
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistTableModel.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistTableModel.java	(revision 20814)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackStoplistTableModel.java	(revision 20815)
@@ -11,6 +11,7 @@
 public class TrackStoplistTableModel extends DefaultTableModel
 {
-  public Vector< Node > nodes = new Vector< Node >();
-  public Vector< String > columns = null;
+  private Vector< Node > nodes = null;
+  private Vector< String > times = null;
+  private Vector< String > columns = null;
     
   public TrackStoplistTableModel(TrackReference tr)
@@ -22,4 +23,6 @@
       columns.add("Name");
     }
+    nodes = new Vector< Node >();
+    times = new Vector< String >();
       
     setColumnIdentifiers(columns);
@@ -47,5 +50,52 @@
     insertRow(insPos, null, time, "");
   }
-    
+
+  public void removeRow(int pos)
+  {
+    super.removeRow(pos);
+    nodes.removeElementAt(pos);
+    times.removeElementAt(pos);
+  }
+
+  public Node nodeAt(int i)
+  {
+    return nodes.elementAt(i);
+  }
+
+  public void setNodeAt(int i, Node node)
+  {
+    nodes.set(i, node);
+  }
+
+  public final Vector< Node > getNodes()
+  {
+    return nodes;
+  }
+
+  public void setNodes(Vector< Node > nodes)
+  {
+    this.nodes = nodes;
+  }
+
+  public String timeAt(int i)
+  {
+    return times.elementAt(i);
+  }
+
+  public void setTimeAt(int i, String time)
+  {
+    times.set(i, time);
+  }
+
+  public final Vector< String > getTimes()
+  {
+    return times;
+  }
+
+  public void setTimes(Vector< String > times)
+  {
+    this.times = times;
+  }
+
   public void insertRow(int insPos, Node node, String time, String name)
   {
@@ -56,4 +106,5 @@
     {
       nodes.addElement(node);
+      times.addElement(time);
       super.addRow(buf);
     }
@@ -61,4 +112,5 @@
     {
       nodes.insertElementAt(node, insPos);
+      times.insertElementAt(time, insPos);
       super.insertRow(insPos, buf);
     }
@@ -68,4 +120,5 @@
   {
     nodes.clear();
+    times.clear();
     super.setRowCount(0);
   }
Index: /applications/editors/josm/plugins/public_transport/src/public_transport/TrackSuggestStopsCommand.java
===================================================================
--- /applications/editors/josm/plugins/public_transport/src/public_transport/TrackSuggestStopsCommand.java	(revision 20814)
+++ /applications/editors/josm/plugins/public_transport/src/public_transport/TrackSuggestStopsCommand.java	(revision 20815)
@@ -29,4 +29,5 @@
   private Vector< Vector< Object > > tableDataModel = null;
   private Vector< Node > nodes = null;
+  private Vector< String > times = null;
   
   public TrackSuggestStopsCommand(StopImporterAction controller)
@@ -49,10 +50,10 @@
     tableDataModel = (Vector< Vector< Object > >)stoplistTM.getDataVector()
 	.clone();
-    nodes = (Vector< Node >)stoplistTM.nodes.clone();
-    
-    for (int i = 0; i < stoplistTM.nodes.size(); ++i)
-    {
-      Node node = stoplistTM.nodes.elementAt(i);
-      stoplistTM.nodes.set(i, null);
+    nodes = (Vector< Node >)stoplistTM.getNodes().clone();
+    times = (Vector< String >)stoplistTM.getTimes().clone();
+    
+    for (int i = 0; i < stoplistTM.getNodes().size(); ++i)
+    {
+      Node node = stoplistTM.nodeAt(i);
       if (node == null)
 	continue;
@@ -155,7 +156,6 @@
 	double timeDelta = gpsSyncTime - StopImporterDialog.parseTime(stopwatchStart);
 	time -= timeDelta;
-	stoplistTM.insertRow(-1, StopImporterAction.timeOf(time));
 	Node node = StopImporterAction.createNode(latLon, type, "");
-	stoplistTM.nodes.set(stoplistTM.getRowCount()-1, node);
+	stoplistTM.insertRow(-1, node, StopImporterAction.timeOf(time), "");
       }
 	
@@ -168,8 +168,7 @@
   public void undoCommand()
   {
-    for (int i = 0; i < stoplistTM.nodes.size(); ++i)
-    {
-      Node node = stoplistTM.nodes.elementAt(i);
-      stoplistTM.nodes.set(i, null);
+    for (int i = 0; i < stoplistTM.getNodes().size(); ++i)
+    {
+      Node node = stoplistTM.nodeAt(i);
       if (node == null)
 	continue;
@@ -179,9 +178,10 @@
     
     stoplistTM.setDataVector(tableDataModel);
-    stoplistTM.nodes = nodes;
-    
-    for (int i = 0; i < stoplistTM.nodes.size(); ++i)
-    {
-      Node node = stoplistTM.nodes.elementAt(i);
+    stoplistTM.setNodes(nodes);
+    stoplistTM.setTimes(times);
+    
+    for (int i = 0; i < stoplistTM.getNodes().size(); ++i)
+    {
+      Node node = stoplistTM.nodeAt(i);
       if (node == null)
 	continue;
@@ -199,5 +199,5 @@
   public MutableTreeNode description()
   {
-    return new DefaultMutableTreeNode("public_transport.TrackStoplist.Sort");
+    return new DefaultMutableTreeNode("public_transport.TrackStoplist.SuggestStops");
   }
   
