X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=src%2Ftim%2Fprune%2Ffunction%2FDuplicatePoint.java;fp=src%2Ftim%2Fprune%2Ffunction%2FDuplicatePoint.java;h=341066a68422160a84a2877155a8c64a1ead516d;hp=0000000000000000000000000000000000000000;hb=ce6f2161b8596f7018d6a76bff79bc9e571f35fd;hpb=2d8cb72e84d5cc1089ce77baf1e34ea3ea2f8465 diff --git a/src/tim/prune/function/DuplicatePoint.java b/src/tim/prune/function/DuplicatePoint.java new file mode 100644 index 0000000..341066a --- /dev/null +++ b/src/tim/prune/function/DuplicatePoint.java @@ -0,0 +1,38 @@ +package tim.prune.function; + +import tim.prune.App; +import tim.prune.GenericFunction; +import tim.prune.data.DataPoint; + +/** + * Class to provide the function to duplicate + * the current point and add to the end of the track + */ +public class DuplicatePoint extends GenericFunction +{ + /** + * Constructor + * @param inApp application object for callback + */ + public DuplicatePoint(App inApp) + { + super(inApp); + } + + /** Get the name key */ + public String getNameKey() { + return "function.duplicatepoint"; + } + + /** + * Begin the function + */ + public void begin() + { + DataPoint point = _app.getTrackInfo().getCurrentPoint(); + if (point != null) { + // Pass information back to App to complete function + _app.createPoint(point.clonePoint()); + } + } +}