X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2Fcompress%2FDeleteMarkedPointsFunction.java;fp=tim%2Fprune%2Ffunction%2Fcompress%2FDeleteMarkedPointsFunction.java;h=0000000000000000000000000000000000000000;hb=ce6f2161b8596f7018d6a76bff79bc9e571f35fd;hp=a6049070eea16db42e1fcad3f632a573bee1e521;hpb=2d8cb72e84d5cc1089ce77baf1e34ea3ea2f8465;p=GpsPrune.git diff --git a/tim/prune/function/compress/DeleteMarkedPointsFunction.java b/tim/prune/function/compress/DeleteMarkedPointsFunction.java deleted file mode 100644 index a604907..0000000 --- a/tim/prune/function/compress/DeleteMarkedPointsFunction.java +++ /dev/null @@ -1,56 +0,0 @@ -package tim.prune.function.compress; - -import tim.prune.App; -import tim.prune.GenericFunction; -import tim.prune.I18nManager; -import tim.prune.undo.UndoDeleteMarked; - -/** - * Function to delete the marked points in the track - */ -public class DeleteMarkedPointsFunction extends GenericFunction -{ - private boolean _splitSegments = false; - private String _parentFunctionKey = null; - - /** Constructor */ - public DeleteMarkedPointsFunction(App inApp) { - super(inApp); - } - - @Override - public String getNameKey() { - return "function.deletemarked"; - } - - /** - * Get notification about parent function - * @param inKey parent function name key - * @param inSplitSegments true to split segment, false to not - */ - public void setParentFunction(String inKey, boolean inSplitSegments) - { - _parentFunctionKey = inKey; - _splitSegments = inSplitSegments; - } - - @Override - public void begin() - { - UndoDeleteMarked undo = new UndoDeleteMarked(_app.getTrackInfo().getTrack()); - // call track to do the actual delete// - int numPointsDeleted = _app.getTrackInfo().deleteMarkedPoints(_splitSegments); - // add to undo stack if successful - if (numPointsDeleted > 0) - { - undo.setNumPointsDeleted(numPointsDeleted); - _app.completeFunction(undo, "" + numPointsDeleted + " " - + (numPointsDeleted==1?I18nManager.getText("confirm.deletepoint.single"):I18nManager.getText("confirm.deletepoint.multi"))); - } - else - { - final String titleKey = (_parentFunctionKey == null ? getNameKey() : _parentFunctionKey); - _app.showErrorMessage(titleKey, "dialog.deletemarked.nonefound"); - } - } -}