X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2Fcompress%2FCompressTrackFunction.java;h=8e89360d7f79ba820f2743a001e319a42dd99a6c;hb=1a735a99408fd3b0c5ac4fe7b2fdbdbb23d38f40;hp=b347305c7968c511aa9e4072e291d56000a100cd;hpb=f35b6d628f68e3b5ef19965ad8988d0dd1eb8efa;p=GpsPrune.git diff --git a/tim/prune/function/compress/CompressTrackFunction.java b/tim/prune/function/compress/CompressTrackFunction.java index b347305..8e89360 100644 --- a/tim/prune/function/compress/CompressTrackFunction.java +++ b/tim/prune/function/compress/CompressTrackFunction.java @@ -11,10 +11,10 @@ import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JDialog; +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; @@ -23,7 +23,7 @@ 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; @@ -156,7 +156,8 @@ public class CompressTrackFunction extends GenericFunction new DuplicatePointAlgorithm(_track, details, changeListener), new ClosePointsAlgorithm(_track, details, changeListener), new WackyPointAlgorithm(_track, details, changeListener), - new SingletonAlgorithm(_track, details, changeListener) + new SingletonAlgorithm(_track, details, changeListener), + new DouglasPeuckerAlgorithm(_track, details, changeListener) }; } @@ -168,14 +169,27 @@ public class CompressTrackFunction extends GenericFunction { boolean[] deleteFlags = preview(); // All flags are now combined in deleteFlags array + int numMarked = 0; for (int i=0; i 0) + { + optionallyDeleteMarkedPoints(numMarked); + } + else + { + JOptionPane.showMessageDialog(_parentFrame, I18nManager.getText("dialog.compress.confirmnone"), + I18nManager.getText(getNameKey()), JOptionPane.INFORMATION_MESSAGE); + } } }