X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2Fcompress%2FCompressTrackFunction.java;h=8e89360d7f79ba820f2743a001e319a42dd99a6c;hp=ce0203cb9e221d3b8f00dd82e0d998629d6e1ee1;hb=a6197ddcaac11c0b943183da7d46169742d024af;hpb=88f2c3647ed9e055090484f01a959d4581f85e7d diff --git a/tim/prune/function/compress/CompressTrackFunction.java b/tim/prune/function/compress/CompressTrackFunction.java index ce0203c..8e89360 100644 --- a/tim/prune/function/compress/CompressTrackFunction.java +++ b/tim/prune/function/compress/CompressTrackFunction.java @@ -15,7 +15,6 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import tim.prune.App; -import tim.prune.GenericFunction; import tim.prune.I18nManager; import tim.prune.UpdateMessageBroker; import tim.prune.data.DataPoint; @@ -24,15 +23,13 @@ import tim.prune.data.Track; /** * Class to provide the function for track compression */ -public class CompressTrackFunction extends GenericFunction +public class CompressTrackFunction extends MarkAndDeleteFunction { private Track _track = null; private JDialog _dialog = null; private JButton _okButton = null; private CompressionAlgorithm[] _algorithms = null; private SummaryLabel _summaryLabel = null; - /** flag to remember whether the automatic deletion has been set to always */ - private boolean _automaticallyDelete = false; /** @@ -187,23 +184,7 @@ public class CompressTrackFunction extends GenericFunction // Show confirmation dialog with OK button (not status bar message) if (numMarked > 0) { - // Allow calling of delete function with one click - final String[] buttonTexts = {I18nManager.getText("button.yes"), I18nManager.getText("button.no"), - I18nManager.getText("button.always")}; - int answer = _automaticallyDelete ? JOptionPane.YES_OPTION : - JOptionPane.showOptionDialog(_parentFrame, - I18nManager.getTextWithNumber("dialog.compress.confirm", numMarked), - I18nManager.getText(getNameKey()), JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.WARNING_MESSAGE, null, buttonTexts, buttonTexts[1]); - if (answer == JOptionPane.CANCEL_OPTION) {_automaticallyDelete = true;} // "always" is third option - if (_automaticallyDelete || answer == JOptionPane.YES_OPTION) - { - new Thread(new Runnable() { - public void run() { - _app.finishCompressTrack(); - } - }).start(); - } + optionallyDeleteMarkedPoints(numMarked); } else {