Class CorrelateGpxWithImages
- java.lang.Object
-
- javax.swing.AbstractAction
-
- 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,ExpertToggleAction.ExpertModeChangeListener,Destroyable
public class CorrelateGpxWithImages extends javax.swing.AbstractAction implements ExpertToggleAction.ExpertModeChangeListener, Destroyable
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.- Since:
- 2566
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CorrelateGpxWithImages(GeoImageLayer layer)Constructs a newCorrelateGpxWithImagesaction.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(java.awt.event.ActionEvent ae)(package private) static Pair<GpxTimezone,GpxTimeOffset>autoGuess(java.util.List<ImageEntry> imgs, GpxData gpx)Tries to auto-guess the timezone and offset.(package private) voidcloseDialog()private voidconstructGpxModel(CorrelateGpxWithImages.NoGpxDataWrapper nogdw)Construct the list of loaded GPX tracksvoiddestroy()Called when the object has been destroyed.voidexpertChanged(boolean isExpert)The expert mode changed.private static voidforEachLayer(java.util.function.Consumer<CorrelateGpxWithImages> action)GpxImageDatumSettingsgetSettings()private java.util.List<ImageEntry>getSortedImgList()(package private) static GpxTimeOffsetloadDelta()(package private) static java.lang.StringloadGpsDatum()(package private) static GpxTimezoneloadTimezone()private static voidremoveDuplicates(java.io.File file)private voidremoveSupportLayer()(package private) voidrepaintCombobox()private static CorrelateGpxWithImages.GpxDataWrapperselectedGPX(boolean complain)-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Field Detail
-
gpxModel
private static JosmComboBoxModel<CorrelateGpxWithImages.GpxDataWrapper> gpxModel
-
forceTags
private static boolean forceTags
-
imgTimeSource
private static TimeSource imgTimeSource
-
yLayer
private final transient GeoImageLayer yLayer
-
supportLayer
private transient CorrelationSupportLayer supportLayer
-
timezone
private transient GpxTimezone timezone
-
delta
private transient GpxTimeOffset delta
-
syncDialog
private ExtendedDialog syncDialog
-
outerPanel
private javax.swing.JPanel outerPanel
-
expertPanel
private javax.swing.JPanel expertPanel
-
cbGpx
private JosmComboBox<CorrelateGpxWithImages.GpxDataWrapper> cbGpx
-
buttonSupport
private javax.swing.JButton buttonSupport
-
tfTimezone
private JosmTextField tfTimezone
-
tfOffset
private JosmTextField tfOffset
-
rbTimeFromCamera
private javax.swing.JRadioButton rbTimeFromCamera
-
rbTimeFromGps
private javax.swing.JRadioButton rbTimeFromGps
-
cbExifImg
private javax.swing.JCheckBox cbExifImg
-
cbTaggedImg
private javax.swing.JCheckBox cbTaggedImg
-
cbShowThumbs
private javax.swing.JCheckBox cbShowThumbs
-
sepExtendedTags
private javax.swing.JSeparator sepExtendedTags
-
labelExtTags
private javax.swing.JLabel labelExtTags
-
labelDatum
private javax.swing.JLabel labelDatum
-
statusBarText
private javax.swing.JLabel statusBarText
-
sepDirectionPosition
private javax.swing.JSeparator sepDirectionPosition
-
pDirectionPosition
private ImageDirectionPositionPanel pDirectionPosition
-
cbAddGpsDatum
private javax.swing.JCheckBox cbAddGpsDatum
-
tfDatum
private JosmTextField tfDatum
-
lastNumMatched
private int lastNumMatched
-
statusBarUpdater
private final transient CorrelateGpxWithImages.StatusBarUpdater statusBarUpdater
-
statusBarUpdaterWithRepaint
private final transient CorrelateGpxWithImages.StatusBarUpdater statusBarUpdaterWithRepaint
-
-
Constructor Detail
-
CorrelateGpxWithImages
public CorrelateGpxWithImages(GeoImageLayer layer)
Constructs a newCorrelateGpxWithImagesaction.- Parameters:
layer- The image layer
-
-
Method Detail
-
removeSupportLayer
private void removeSupportLayer()
-
constructGpxModel
private void constructGpxModel(CorrelateGpxWithImages.NoGpxDataWrapper nogdw)
Construct the list of loaded GPX tracks- Parameters:
nogdw- Data wrapper with no GPX data
-
loadTimezone
static GpxTimezone loadTimezone()
-
loadDelta
static GpxTimeOffset loadDelta()
-
loadGpsDatum
static java.lang.String loadGpsDatum()
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener
-
getSettings
public GpxImageDatumSettings getSettings()
-
expertChanged
public void expertChanged(boolean isExpert)
Description copied from interface:ExpertToggleAction.ExpertModeChangeListenerThe expert mode changed.- Specified by:
expertChangedin interfaceExpertToggleAction.ExpertModeChangeListener- Parameters:
isExpert-trueif expert mode was enabled, false otherwise.
-
removeDuplicates
private static void removeDuplicates(java.io.File file)
-
forEachLayer
private static void forEachLayer(java.util.function.Consumer<CorrelateGpxWithImages> action)
-
closeDialog
void closeDialog()
-
repaintCombobox
void repaintCombobox()
-
autoGuess
static Pair<GpxTimezone,GpxTimeOffset> autoGuess(java.util.List<ImageEntry> imgs, GpxData gpx) throws CorrelateGpxWithImages.NoGpxTimestamps
Tries to auto-guess the timezone and offset.- Parameters:
imgs- the images to correlategpx- the gpx track to correlate to- Returns:
- a pair of timezone and offset
- Throws:
java.lang.IndexOutOfBoundsException- when there are no imagesCorrelateGpxWithImages.NoGpxTimestamps- when the gpx track does not contain a timestamp
-
getSortedImgList
private java.util.List<ImageEntry> getSortedImgList()
-
selectedGPX
private static CorrelateGpxWithImages.GpxDataWrapper selectedGPX(boolean complain)
-
destroy
public void destroy()
Description copied from interface:DestroyableCalled when the object has been destroyed.- Specified by:
destroyin interfaceDestroyable
-
-