Changeset 33721 in osm for applications/editors/josm/plugins/infomode/src
- Timestamp:
- 2017-10-19T00:19:04+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoPanel.java
r33720 r33721 12 12 import java.util.Collection; 13 13 import java.util.HashSet; 14 import java.util.Locale;15 14 import java.util.Set; 16 15 … … 27 26 import org.openstreetmap.josm.tools.Logging; 28 27 import org.openstreetmap.josm.tools.OpenBrowser; 28 import org.openstreetmap.josm.tools.date.DateUtils; 29 29 30 30 class InfoPanel extends JPanel { … … 32 32 private Collection<GpxTrack> tracks; 33 33 private GpxTrack trk; 34 private DateFormat df;35 34 36 35 private JLabel label1 = new JLabel(); … … 45 44 InfoPanel() { 46 45 super(new GridBagLayout()); 47 df = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.getDefault());48 46 setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 49 47 add(label1, GBC.eol().insets(10, 0, 0, 0)); … … 110 108 but2.setVisible(false); 111 109 } else { 112 label1.setText( df.format(wp.getTime()));110 label1.setText(DateUtils.formatDateTime(wp.getTime(), DateFormat.DEFAULT, DateFormat.DEFAULT)); 113 111 but2.setVisible(true); 114 112 } … … 123 121 s = (String) wp.attr.get("ele"); 124 122 String s1 = ""; 125 try { 126 s1 = String.format("H=%3.1f ", Double.parseDouble(s)); 127 } catch (Exception e) { 128 Logging.warn(e); 123 if (s != null) { 124 try { 125 s1 = String.format("H=%3.1f ", Double.parseDouble(s)); 126 } catch (NumberFormatException e) { 127 Logging.warn(e); 128 } 129 129 } 130 130 s1 = s1+"L="+(int) trk.length();
Note:
See TracChangeset
for help on using the changeset viewer.