Changeset 7320 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2014-07-20T22:57:24+02:00 (10 years ago)
Author:
Don-vip
Message:

fix #10283 - wrong time format in GPX/images layer leading to wrong correlation (regression from r7299)

Location:
trunk/src/org/openstreetmap/josm/gui/layer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r7319 r7320  
    2222import javax.swing.JScrollPane;
    2323import javax.swing.SwingUtilities;
     24
    2425import org.openstreetmap.josm.Main;
    25 
    2626import org.openstreetmap.josm.actions.RenameLayerAction;
    2727import org.openstreetmap.josm.actions.SaveActionBase;
     
    2929import org.openstreetmap.josm.data.gpx.GpxConstants;
    3030import org.openstreetmap.josm.data.gpx.GpxData;
    31 import org.openstreetmap.josm.data.gpx.GpxRoute;
    3231import org.openstreetmap.josm.data.gpx.GpxTrack;
    33 import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
    3432import org.openstreetmap.josm.data.gpx.WayPoint;
    3533import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
     
    6462
    6563    private final GpxDrawHelper drawHelper;
    66    
     64
    6765    public GpxLayer(GpxData d) {
    6866        super((String) d.attr.get("name"));
     
    8785        return drawHelper.getColor(getName(), ignoreCustom);
    8886    }
    89    
     87
    9088    /**
    9189     * Returns a human readable string that shows the timespan of the given track
     
    106104                ts += tf.format(bounds[0]) + " - " + tf.format(bounds[1]);
    107105            } else {
    108                 DateFormat dtf = DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.SHORT);
     106                DateFormat dtf = DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.MEDIUM);
    109107                ts += dtf.format(bounds[0]) + " - " + dtf.format(bounds[1]);
    110108            }
     
    290288            }
    291289        }
    292        
    293     }
    294    
     290
     291    }
     292
    295293    private LinkedList<WayPoint> listVisibleSegments(Bounds box) {
    296294        WayPoint last = null;
    297295        LinkedList<WayPoint> visibleSegments = new LinkedList<>();
    298        
     296
    299297        ensureTrackVisibilityLength();
    300298        for (Collection<WayPoint> segment : data.getLinesIterable(trackVisibility)) {
    301            
     299
    302300            for(WayPoint pt : segment)
    303301            {
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r7299 r7320  
    238238        @Override
    239239        public void actionPerformed(ActionEvent arg0) {
    240             SimpleDateFormat dateFormat = (SimpleDateFormat) DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.SHORT);
     240            SimpleDateFormat dateFormat = (SimpleDateFormat) DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.MEDIUM);
    241241
    242242            panel = new JPanel();
     
    362362                    Date date = yLayer.data.get(index).getExifTime();
    363363                    if (date != null) {
    364                         DateFormat df = DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.SHORT);
     364                        DateFormat df = DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.MEDIUM);
    365365                        lbExifTime.setText(df.format(date));
    366366                        tfGpsTime.setText(df.format(date));
     
    403403                    }
    404404                    if (date != null) {
    405                         lbExifTime.setText(DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.SHORT).format(date));
     405                        lbExifTime.setText(DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.MEDIUM).format(date));
    406406                        tfGpsTime.setText(DateUtils.getDateFormat(DateFormat.SHORT).format(date)+" ");
    407407                        tfGpsTime.setEnabled(true);
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java

    r7299 r7320  
    264264                osd.append(tr("\nDirection {0}\u00b0", Math.round(entry.getExifImgDir())));
    265265            }
    266             DateFormat dtf = DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.SHORT);
     266            DateFormat dtf = DateUtils.getDateTimeFormat(DateFormat.SHORT, DateFormat.MEDIUM);
    267267            if (entry.hasExifTime()) {
    268268                osd.append(tr("\nEXIF time: {0}", dtf.format(entry.getExifTime())));
Note: See TracChangeset for help on using the changeset viewer.