1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
package tim.prune.function;
import tim.prune.App;
import tim.prune.GenericFunction;
import tim.prune.I18nManager;
import tim.prune.cmd.InsertPointCmd;
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)
{
InsertPointCmd command = new InsertPointCmd(point.clonePoint(), -1);
command.setDescription(I18nManager.getText("undo.createpoint"));
command.setConfirmText(I18nManager.getText("confirm.pointadded"));
_app.execute(command);
}
}
}
|