]> gitweb.fperrin.net Git - GpsPrune.git/blob - src/tim/prune/function/DuplicatePoint.java
341066a68422160a84a2877155a8c64a1ead516d
[GpsPrune.git] / src / tim / prune / function / DuplicatePoint.java
1 package tim.prune.function;
2
3 import tim.prune.App;
4 import tim.prune.GenericFunction;
5 import tim.prune.data.DataPoint;
6
7 /**
8  * Class to provide the function to duplicate
9  * the current point and add to the end of the track
10  */
11 public class DuplicatePoint extends GenericFunction
12 {
13         /**
14          * Constructor
15          * @param inApp application object for callback
16          */
17         public DuplicatePoint(App inApp)
18         {
19                 super(inApp);
20         }
21
22         /** Get the name key */
23         public String getNameKey() {
24                 return "function.duplicatepoint";
25         }
26
27         /**
28          * Begin the function
29          */
30         public void begin()
31         {
32                 DataPoint point = _app.getTrackInfo().getCurrentPoint();
33                 if (point != null) {
34                         // Pass information back to App to complete function
35                         _app.createPoint(point.clonePoint());
36                 }
37         }
38 }