X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2Fsave%2FFileSaver.java;h=6be44eb80bc3eb6beb828f0270db15c75255954e;hb=4d5796d02a15808311c09448d79e6e7d1de9d636;hp=c42a644c4c7cf3562a7e85f78367f6bc25d79f4d;hpb=ca9bdb3916f9c39adbbf95d06ac95c21dafbb4e6;p=GpsPrune.git diff --git a/tim/prune/save/FileSaver.java b/tim/prune/save/FileSaver.java index c42a644..6be44eb 100644 --- a/tim/prune/save/FileSaver.java +++ b/tim/prune/save/FileSaver.java @@ -34,24 +34,26 @@ import javax.swing.table.TableModel; import tim.prune.App; 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; 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; @@ -63,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}; @@ -76,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; } @@ -100,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