org.openstreetmap.josm.gui.layer.geoimage
Class CorrelateGpxWithImages

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.openstreetmap.josm.gui.layer.geoimage.CorrelateGpxWithImages
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

public class CorrelateGpxWithImages
extends javax.swing.AbstractAction

This class displays the window to select the GPX file and the offset (timezone + delta). Then it correlates the images of the layer with that GPX file.

See Also:
Serialized Form

Nested Class Summary
private  class CorrelateGpxWithImages.AdjustActionListener
          Presents dialog with sliders for manual adjust.
private  class CorrelateGpxWithImages.AutoGuessActionListener
           
private static class CorrelateGpxWithImages.GpxDataWrapper
           
private  class CorrelateGpxWithImages.LoadGpxDataActionListener
          This class is called when the user doesn't find the GPX file he needs in the files that have been loaded yet.
private  class CorrelateGpxWithImages.RepaintTheMapListener
           
private  class CorrelateGpxWithImages.SetOffsetActionListener
          This action listener is called when the user has a photo of the time of his GPS receiver.
private  class CorrelateGpxWithImages.StatusBarUpdater
           
 
Field Summary
(package private)  javax.swing.JCheckBox cbExifImg
           
(package private)  JosmComboBox cbGpx
           
(package private)  javax.swing.JCheckBox cbShowThumbs
           
(package private)  javax.swing.JCheckBox cbTaggedImg
           
(package private)  long delta
           
(package private)  java.util.Vector<CorrelateGpxWithImages.GpxDataWrapper> gpxLst
           
(package private)  int lastNumMatched
           
private static java.util.List<GpxData> loadedGpxData
           
(package private)  javax.swing.JPanel outerPanel
           
(package private)  CorrelateGpxWithImages.RepaintTheMapListener repaintTheMap
           
(package private)  javax.swing.JLabel statusBarText
           
(package private)  CorrelateGpxWithImages.StatusBarUpdater statusBarUpdater
           
(package private)  CorrelateGpxWithImages.StatusBarUpdater statusBarUpdaterWithRepaint
           
(package private)  ExtendedDialog syncDialog
           
(package private)  javax.swing.JTextField tfOffset
           
(package private)  javax.swing.JTextField tfTimezone
           
(package private)  double timezone
           
(package private)  GeoImageLayer yLayer
           
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
CorrelateGpxWithImages(GeoImageLayer layer)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent arg0)
           
private  java.lang.String formatTimezone(double timezone)
           
private  int getLastIndexOfListBefore(java.util.ArrayList<ImageEntry> images, long searchedTime)
           
private  java.util.ArrayList<ImageEntry> getSortedImgList()
           
private  java.util.ArrayList<ImageEntry> getSortedImgList(boolean exif, boolean tagged)
          Returns a list of images that fulfill the given criteria.
private  int matchGpxTrack(java.util.ArrayList<ImageEntry> images, GpxData selectedGpx, long offset)
          Match a list of photos to a gpx track with a given offset.
private  int matchPoints(java.util.ArrayList<ImageEntry> images, WayPoint prevWp, long prevWpTime, WayPoint curWp, long curWpTime, long offset)
           
private  long parseOffset(java.lang.String offset)
           
private  double parseTimezone(java.lang.String timezone)
           
private  CorrelateGpxWithImages.GpxDataWrapper selectedGPX(boolean complain)
           
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loadedGpxData

private static java.util.List<GpxData> loadedGpxData

yLayer

GeoImageLayer yLayer

timezone

double timezone

delta

long delta

syncDialog

ExtendedDialog syncDialog

gpxLst

java.util.Vector<CorrelateGpxWithImages.GpxDataWrapper> gpxLst

outerPanel

javax.swing.JPanel outerPanel

cbGpx

JosmComboBox cbGpx

tfTimezone

javax.swing.JTextField tfTimezone

tfOffset

javax.swing.JTextField tfOffset

cbExifImg

javax.swing.JCheckBox cbExifImg

cbTaggedImg

javax.swing.JCheckBox cbTaggedImg

cbShowThumbs

javax.swing.JCheckBox cbShowThumbs

statusBarText

javax.swing.JLabel statusBarText

lastNumMatched

int lastNumMatched

statusBarUpdater

CorrelateGpxWithImages.StatusBarUpdater statusBarUpdater

statusBarUpdaterWithRepaint

CorrelateGpxWithImages.StatusBarUpdater statusBarUpdaterWithRepaint

repaintTheMap

CorrelateGpxWithImages.RepaintTheMapListener repaintTheMap
Constructor Detail

CorrelateGpxWithImages

public CorrelateGpxWithImages(GeoImageLayer layer)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent arg0)

getSortedImgList

private java.util.ArrayList<ImageEntry> getSortedImgList()

getSortedImgList

private java.util.ArrayList<ImageEntry> getSortedImgList(boolean exif,
                                                         boolean tagged)
Returns a list of images that fulfill the given criteria. Default setting is to return untagged images, but may be overwritten.

Parameters:
boolean - all -- returns all available images
boolean - noexif -- returns untagged images without EXIF-GPS coords this parameter is irrelevant if all is true
boolean - exif -- also returns images with exif-gps info
boolean - tagged -- also returns tagged images
Returns:
ArrayList matching images

selectedGPX

private CorrelateGpxWithImages.GpxDataWrapper selectedGPX(boolean complain)

matchGpxTrack

private int matchGpxTrack(java.util.ArrayList<ImageEntry> images,
                          GpxData selectedGpx,
                          long offset)
Match a list of photos to a gpx track with a given offset. All images need a exifTime attribute and the List must be sorted according to these times.


matchPoints

private int matchPoints(java.util.ArrayList<ImageEntry> images,
                        WayPoint prevWp,
                        long prevWpTime,
                        WayPoint curWp,
                        long curWpTime,
                        long offset)

getLastIndexOfListBefore

private int getLastIndexOfListBefore(java.util.ArrayList<ImageEntry> images,
                                     long searchedTime)

formatTimezone

private java.lang.String formatTimezone(double timezone)

parseTimezone

private double parseTimezone(java.lang.String timezone)
                      throws java.text.ParseException
Throws:
java.text.ParseException

parseOffset

private long parseOffset(java.lang.String offset)
                  throws java.text.ParseException
Throws:
java.text.ParseException


JOSM