1 package tim.prune.undo;
3 import tim.prune.I18nManager;
4 import tim.prune.UpdateMessageBroker;
5 import tim.prune.data.TrackInfo;
8 * Undo addition/subtraction of a time offset
10 public class UndoAddTimeOffset implements UndoOperation
12 /** Start and end indices of section */
13 private int _startIndex, _endIndex;
15 private long _timeOffset;
20 * @param inStart start index of section
21 * @param inEnd end index of section
22 * @param inOffset time offset
24 public UndoAddTimeOffset(int inStart, int inEnd, long inOffset)
26 _startIndex = inStart;
28 _timeOffset = inOffset;
33 * @return description of operation including number of points adjusted
35 public String getDescription()
37 return I18nManager.getText("undo.addtimeoffset") + " (" + (_endIndex - _startIndex + 1) + ")";
42 * Perform the undo operation on the given Track
43 * @param inTrackInfo TrackInfo object on which to perform the operation
45 public void performUndo(TrackInfo inTrackInfo) throws UndoException
47 // Perform the inverse operation
48 inTrackInfo.getTrack().addTimeOffset(_startIndex, _endIndex, -_timeOffset, true);
49 UpdateMessageBroker.informSubscribers();