X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Ffunction%2Fcompress%2FCompressTrackFunction.java;h=8e89360d7f79ba820f2743a001e319a42dd99a6c;hb=a6197ddcaac11c0b943183da7d46169742d024af;hp=62bf1f14a4802d41b40355b4a67250f0fc0cda95;hpb=112bb0c9b46894adca9a33ed8c99ea712b253185;p=GpsPrune.git diff --git a/tim/prune/function/compress/CompressTrackFunction.java b/tim/prune/function/compress/CompressTrackFunction.java index 62bf1f1..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; @@ -72,7 +72,6 @@ public class CompressTrackFunction extends GenericFunction */ private boolean[] preview() { - // System.out.println("track dialog preview"); int numToDelete = 0; boolean[] deleteFlags = new boolean[_track.getNumPoints()]; for (int i=0; i<_algorithms.length; i++) @@ -157,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) }; } @@ -169,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); + } } }