--- /dev/null
+package tim.prune.undo;\r
+\r
+import tim.prune.I18nManager;\r
+import tim.prune.data.TrackInfo;\r
+\r
+/**\r
+ * Operation to undo an insertion (eg interpolate)\r
+ */\r
+public class UndoInsert implements UndoOperation\r
+{\r
+ private int _startPosition = 0;\r
+ private int _numInserted = 0;\r
+\r
+\r
+ /**\r
+ * Constructor\r
+ * @param inStart start of insert\r
+ * @param inNumInserted number of points inserted\r
+ */\r
+ public UndoInsert(int inStart, int inNumInserted)\r
+ {\r
+ _startPosition = inStart;\r
+ _numInserted = inNumInserted;\r
+ }\r
+\r
+\r
+ /**\r
+ * @return description of operation including parameters\r
+ */\r
+ public String getDescription()\r
+ {\r
+ return I18nManager.getText("undo.insert") + " (" + _numInserted + ")";\r
+ }\r
+\r
+\r
+ /**\r
+ * Perform the undo operation on the given TrackInfo\r
+ * @param inTrackInfo TrackInfo object on which to perform the operation\r
+ */\r
+ public void performUndo(TrackInfo inTrackInfo) throws UndoException\r
+ {\r
+ // restore track to previous values\r
+ inTrackInfo.getTrack().deleteRange(_startPosition, _startPosition + _numInserted - 1);\r
+ // reset selection\r
+ inTrackInfo.getSelection().select(_startPosition-1, _startPosition-1, _startPosition);\r
+ }\r
+}
\ No newline at end of file