X-Git-Url: https://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fgui%2FDetailsDisplay.java;h=f66d99b3c469f7690400919faf909afba1ccbf67;hp=13df7cd31609b0ea8ef1eb6b7fdb59d6639a722d;hb=326f489e36aa7f235bc19409a57bf4955cd50f24;hpb=8c8868ae29b3252f02e094c02307384cf61ba667 diff --git a/tim/prune/gui/DetailsDisplay.java b/tim/prune/gui/DetailsDisplay.java index 13df7cd..f66d99b 100644 --- a/tim/prune/gui/DetailsDisplay.java +++ b/tim/prune/gui/DetailsDisplay.java @@ -82,8 +82,8 @@ public class DetailsDisplay extends GenericDisplay private JPanel _playAudioPanel = null; // Units - private JComboBox _coordFormatDropdown = null; - private JComboBox _distUnitsDropdown = null; + private JComboBox _coordFormatDropdown = null; + private JComboBox _distUnitsDropdown = null; // Cached labels private static final String LABEL_POINT_SELECTED = I18nManager.getText("details.index.selected") + ": "; @@ -243,7 +243,7 @@ public class DetailsDisplay extends GenericDisplay lowerPanel.add(coordFormatLabel); String[] coordFormats = {I18nManager.getText("units.original"), I18nManager.getText("units.degminsec"), I18nManager.getText("units.degmin"), I18nManager.getText("units.deg")}; - _coordFormatDropdown = new JComboBox(coordFormats); + _coordFormatDropdown = new JComboBox(coordFormats); _coordFormatDropdown.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -256,7 +256,7 @@ public class DetailsDisplay extends GenericDisplay unitsLabel.setAlignmentX(Component.LEFT_ALIGNMENT); lowerPanel.add(unitsLabel); // Make dropdown for distance units - _distUnitsDropdown = new JComboBox(); + _distUnitsDropdown = new JComboBox(); final UnitSet currUnits = Config.getUnitSet(); for (int i=0; i 0) + _distanceLabel.setText(LABEL_RANGE_DISTANCE + DisplayUtils.roundedNumber(selection.getMovingDistance()) + " " + distUnitsStr); + final long numMovingSeconds = selection.getMovingSeconds(); + if (numMovingSeconds > 0L) { - _durationLabel.setText(LABEL_RANGE_DURATION + DisplayUtils.buildDurationString(selection.getNumSeconds())); + _durationLabel.setText(LABEL_RANGE_DURATION + DisplayUtils.buildDurationString(numMovingSeconds)); _aveSpeedLabel.setText(I18nManager.getText("details.range.avespeed") + ": " - + DisplayUtils.roundedNumber(selection.getDistance()/selection.getNumSeconds()*3600.0) + " " + speedUnitsStr); + + DisplayUtils.roundedNumber(selection.getMovingDistance()/numMovingSeconds*3600.0) + " " + speedUnitsStr); } else { _durationLabel.setText("");