Changeset 17718 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2021-04-09T00:19:56+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r17715 r17718 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.layer; 3 4 import static org.openstreetmap.josm.tools.I18n.tr;5 import static org.openstreetmap.josm.tools.I18n.trn;6 7 import java.awt.Color;8 import java.awt.Dimension;9 import java.awt.Graphics2D;10 import java.awt.event.ActionEvent;11 import java.io.File;12 import java.time.Instant;13 import java.time.format.DateTimeFormatter;14 import java.time.format.FormatStyle;15 import java.time.temporal.ChronoUnit;16 import java.util.ArrayList;17 import java.util.Arrays;18 import java.util.Collections;19 import java.util.Date;20 import java.util.List;21 import java.util.NoSuchElementException;22 import java.util.stream.Collectors;23 24 import javax.swing.AbstractAction;25 import javax.swing.Action;26 import javax.swing.Icon;27 import javax.swing.JScrollPane;28 import javax.swing.SwingUtilities;29 3 30 4 import org.openstreetmap.josm.actions.AutoScaleAction; … … 68 42 import org.openstreetmap.josm.tools.date.DateUtils; 69 43 44 import javax.swing.AbstractAction; 45 import javax.swing.Action; 46 import javax.swing.Icon; 47 import javax.swing.JScrollPane; 48 import javax.swing.SwingUtilities; 49 import java.awt.Color; 50 import java.awt.Dimension; 51 import java.awt.Graphics2D; 52 import java.awt.event.ActionEvent; 53 import java.io.File; 54 import java.time.Instant; 55 import java.time.format.DateTimeFormatter; 56 import java.time.format.FormatStyle; 57 import java.util.ArrayList; 58 import java.util.Arrays; 59 import java.util.Collections; 60 import java.util.Date; 61 import java.util.List; 62 import java.util.NoSuchElementException; 63 import java.util.stream.Collectors; 64 65 import static org.openstreetmap.josm.tools.I18n.tr; 66 import static org.openstreetmap.josm.tools.I18n.trn; 67 70 68 /** 71 69 * A layer that displays data from a Gpx file / the OSM gpx downloads. … … 178 176 DateTimeFormatter tf = DateUtils.getTimeFormatter(FormatStyle.SHORT); 179 177 ts += earliestDate + ' '; 180 ts += tf.format(bounds[0]) + " -" + tf.format(bounds[1]);178 ts += tf.format(bounds[0]) + " \u2013 " + tf.format(bounds[1]); 181 179 } else { 182 180 DateTimeFormatter dtf = DateUtils.getDateTimeFormatter(FormatStyle.SHORT, FormatStyle.MEDIUM); 183 ts += dtf.format(bounds[0]) + " - " + dtf.format(bounds[1]); 184 } 185 186 long diff = ChronoUnit.SECONDS.between(bounds[1], bounds[0]); 187 ts += String.format(" (%d:%02d)", diff / 3600, (diff % 3600) / 60); 181 ts += dtf.format(bounds[0]) + " \u2013 " + dtf.format(bounds[1]); 182 } 183 184 ts += String.format(" (%s)", Utils.getDurationString(bounds[1].toEpochMilli() - bounds[0].toEpochMilli())); 188 185 return ts; 189 186 }
Note:
See TracChangeset
for help on using the changeset viewer.