]> gitweb.fperrin.net Git - GpsPrune.git/blob - tim/prune/undo/UndoRearrangeWaypoints.java
Version 1, September 2006
[GpsPrune.git] / tim / prune / undo / UndoRearrangeWaypoints.java
1 package tim.prune.undo;\r
2 \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
7 \r
8 /**\r
9  * Operation to undo a waypoint rearrangement\r
10  */\r
11 public class UndoRearrangeWaypoints implements UndoOperation\r
12 {\r
13         private DataPoint[] _contents = null;\r
14 \r
15 \r
16         /**\r
17          * Constructor\r
18          * @param inTrack track contents to copy\r
19          */\r
20         public UndoRearrangeWaypoints(Track inTrack)\r
21         {\r
22                 _contents = inTrack.cloneContents();\r
23         }\r
24 \r
25 \r
26         /**\r
27          * @return description of operation\r
28          */\r
29         public String getDescription()\r
30         {\r
31                 return I18nManager.getText("undo.rearrangewaypoints");\r
32         }\r
33 \r
34 \r
35         /**\r
36          * Perform the undo operation on the given Track\r
37          * @param inTrackInfo TrackInfo object on which to perform the operation\r
38          */\r
39         public void performUndo(TrackInfo inTrackInfo) throws UndoException\r
40         {\r
41                 // restore track to previous values\r
42                 inTrackInfo.getTrack().replaceContents(_contents);\r
43         }\r
44 }