]> gitweb.fperrin.net Git - GpsPrune.git/blob - tim/prune/undo/UndoConnectPhotoWithClone.java
Version 6, October 2008
[GpsPrune.git] / tim / prune / undo / UndoConnectPhotoWithClone.java
1 package tim.prune.undo;
2
3 import tim.prune.data.DataPoint;
4 import tim.prune.data.TrackInfo;
5
6 /**
7  * Operation to undo the connection of a photo to a point
8  * where the point had to be cloned
9  */
10 public class UndoConnectPhotoWithClone extends UndoConnectPhoto
11 {
12         /** Additional undo object for removing inserted point */
13         private UndoInsert _undoInsert = null;
14
15
16         /**
17          * Constructor
18          * @param inPoint data point
19          * @param inFilename filename of photo
20          * @param inIndex index of cloned point
21          */
22         public UndoConnectPhotoWithClone(DataPoint inPoint, String inFilename, int inIndex)
23         {
24                 super(inPoint, inFilename);
25                 // Make an undo object for the insert
26                 _undoInsert = new UndoInsert(inIndex, 1);
27         }
28
29         /**
30          * Perform the undo operation on the given Track
31          * @param inTrackInfo TrackInfo object on which to perform the operation
32          */
33         public void performUndo(TrackInfo inTrackInfo) throws UndoException
34         {
35                 //System.out.println("Performing undo: (" + super.getDescription() + ", " + _undoInsert.getDescription() + ")");
36                 // Firstly, undo connect
37                 super.performUndo(inTrackInfo);
38                 // Next, undo insert to remove cloned point
39                 _undoInsert.performUndo(inTrackInfo);
40         }
41 }