1 package tim.prune.undo;
\r
3 import tim.prune.I18nManager;
\r
4 import tim.prune.data.TrackInfo;
\r
7 * Operation to undo an operation (such as create marker waypoints)
\r
8 * in which a number of points were appended to the track
\r
10 public class UndoAppendPoints implements UndoOperation
\r
12 private int _previousTrackLength = -1;
\r
13 private int _numAppended = 0;
\r
19 public UndoAppendPoints(int inTrackLength)
\r
21 _previousTrackLength = inTrackLength;
\r
25 * @param inNumPoints number of points appended to track
\r
27 public void setNumPointsAppended(int inNumPoints)
\r
29 _numAppended = inNumPoints;
\r
33 * @return description of operation including number of points loaded
\r
35 public String getDescription()
\r
37 return I18nManager.getText("undo.insert") + " (" + _numAppended + ")";
\r
41 * Perform the undo operation on the given Track
\r
42 * @param inTrackInfo TrackInfo object on which to perform the operation
\r
44 public void performUndo(TrackInfo inTrackInfo) throws UndoException
\r
46 // crop track to previous size
\r
47 inTrackInfo.getTrack().cropTo(_previousTrackLength);
\r
49 inTrackInfo.getSelection().clearAll();
\r