1 package tim.prune.undo;
\r
3 import tim.prune.I18nManager;
\r
4 import tim.prune.data.DataPoint;
\r
5 import tim.prune.data.Track;
\r
6 import tim.prune.data.TrackInfo;
\r
9 * Abstract operation to undo a reordering by replacing track contents with a shallow copy
\r
11 public abstract class UndoReorder implements UndoOperation
\r
13 /** Shallow copy of whole track contents */
\r
14 private DataPoint[] _contents = null;
\r
16 private String _description = null;
\r
20 * @param inTrack track contents to copy
\r
21 * @param inDescKey description key
\r
23 public UndoReorder(Track inTrack, String inDescKey)
\r
25 _contents = inTrack.cloneContents();
\r
26 _description = I18nManager.getText(inDescKey);
\r
30 * @return description
\r
32 public String getDescription() {
\r
33 return _description;
\r
38 * Perform the undo operation on the given Track
\r
39 * @param inTrackInfo TrackInfo object on which to perform the operation
\r
41 public void performUndo(TrackInfo inTrackInfo) throws UndoException
\r
43 // restore track to previous values
\r
44 inTrackInfo.getTrack().replaceContents(_contents);
\r
45 inTrackInfo.getSelection().clearAll();
\r