1 package tim.prune.undo;
3 import tim.prune.I18nManager;
4 import tim.prune.data.TrackInfo;
7 * Undo creation of new point
9 public class UndoCreatePoint implements UndoOperation
12 * @return description of operation
14 public String getDescription()
16 return I18nManager.getText("undo.createpoint");
21 * Perform the undo operation on the given Track
22 * @param inTrackInfo TrackInfo object on which to perform the operation
24 public void performUndo(TrackInfo inTrackInfo) throws UndoException
26 if (inTrackInfo.getTrack().getNumPoints() < 1)
28 throw new UndoException(getDescription());
30 // Reset selection if last point selected
31 if (inTrackInfo.getSelection().getCurrentPointIndex() == (inTrackInfo.getTrack().getNumPoints()-1)) {
32 inTrackInfo.getSelection().clearAll(); // Note: Informers told twice now!
35 inTrackInfo.getTrack().cropTo(inTrackInfo.getTrack().getNumPoints() - 1);