X-Git-Url: http://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fsave%2FFileSaver.java;h=debe0e799bb1134416b950ca29700c7c111d7143;hb=649c5da6ee1bbc590699e11a92316ece2ea8512d;hp=5991b8636ef8b26f99b14a160016f109906f708f;hpb=52bf9e8686c916be37a26a0b75340393d4478b05;p=GpsPrune.git diff --git a/tim/prune/save/FileSaver.java b/tim/prune/save/FileSaver.java index 5991b86..debe0e7 100644 --- a/tim/prune/save/FileSaver.java +++ b/tim/prune/save/FileSaver.java @@ -32,14 +32,15 @@ import javax.swing.ListSelectionModel; import javax.swing.table.TableModel; import tim.prune.App; -import tim.prune.Config; import tim.prune.I18nManager; import tim.prune.UpdateMessageBroker; +import tim.prune.config.Config; import tim.prune.data.Altitude; import tim.prune.data.Coordinate; import tim.prune.data.DataPoint; import tim.prune.data.Field; import tim.prune.data.FieldList; +import tim.prune.data.RecentFile; import tim.prune.data.Timestamp; import tim.prune.data.Track; import tim.prune.load.GenericFileFilter; @@ -47,13 +48,12 @@ import tim.prune.load.OneCharDocument; /** * Class to manage the saving of track data - * into a user-specified file + * as text into a user-specified file */ public class FileSaver { private App _app = null; private JFrame _parentFrame = null; - private Track _track = null; private JDialog _dialog = null; private JFileChooser _fileChooser = null; private JPanel _cards = null; @@ -65,12 +65,14 @@ public class FileSaver private JRadioButton[] _delimiterRadios = null; private JTextField _otherDelimiterText = null; private JCheckBox _headerRowCheckbox = null; + private PointTypeSelector _pointTypeSelector = null; private JRadioButton[] _coordUnitsRadios = null; private JRadioButton[] _altitudeUnitsRadios = null; private JRadioButton[] _timestampUnitsRadios = null; + private static final int[] FORMAT_COORDS = {Coordinate.FORMAT_NONE, Coordinate.FORMAT_DEG_MIN_SEC, Coordinate.FORMAT_DEG_MIN, Coordinate.FORMAT_DEG}; - private static final int[] FORMAT_ALTS = {Altitude.FORMAT_NONE, Altitude.FORMAT_METRES, Altitude.FORMAT_FEET}; + private static final Altitude.Format[] FORMAT_ALTS = {Altitude.Format.NO_FORMAT, Altitude.Format.METRES, Altitude.Format.FEET}; private static final int[] FORMAT_TIMES = {Timestamp.FORMAT_ORIGINAL, Timestamp.FORMAT_LOCALE, Timestamp.FORMAT_ISO_8601}; @@ -78,13 +80,11 @@ public class FileSaver * Constructor * @param inApp application object to inform of success * @param inParentFrame parent frame - * @param inTrack track object to save */ - public FileSaver(App inApp, JFrame inParentFrame, Track inTrack) + public FileSaver(App inApp, JFrame inParentFrame) { _app = inApp; _parentFrame = inParentFrame; - _track = inTrack; } @@ -102,18 +102,19 @@ public class FileSaver _dialog.pack(); } // Check field list - FieldList fieldList = _track.getFieldList(); + Track track = _app.getTrackInfo().getTrack(); + FieldList fieldList = track.getFieldList(); int numFields = fieldList.getNumFields(); _model = new FieldSelectionTableModel(numFields); for (int i=0; i=selStart && p<=selEnd)); + if (!savePoint) {continue;} + numSaved++; + firstField = true; + buffer = new StringBuffer(); + for (int f=0; f