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
Fields Modifier and Type Field Description private javax.swing.JButton
buttonSupport
private javax.swing.JCheckBox
cbExifImg
private JosmComboBox<CorrelateGpxWithImages.GpxDataWrapper>
cbGpx
private javax.swing.JCheckBox
cbShowThumbs
private javax.swing.JCheckBox
cbTaggedImg
private GpxTimeOffset
delta
private static boolean
forceTags
private static JosmComboBoxModel<CorrelateGpxWithImages.GpxDataWrapper>
gpxModel
private int
lastNumMatched
private javax.swing.JPanel
outerPanel
private ImageDirectionPositionPanel
pDirectionPosition
private javax.swing.JSeparator
sepDirectionPosition
private javax.swing.JLabel
statusBarText
private CorrelateGpxWithImages.StatusBarUpdater
statusBarUpdater
private CorrelateGpxWithImages.StatusBarUpdater
statusBarUpdaterWithRepaint
private CorrelationSupportLayer
supportLayer
private ExtendedDialog
syncDialog
private JosmTextField
tfOffset
private JosmTextField
tfTimezone
private GpxTimezone
timezone
private GeoImageLayer
yLayer
-
Constructor Summary
Constructors Constructor Description CorrelateGpxWithImages(GeoImageLayer layer)
Constructs a newCorrelateGpxWithImages
action.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(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) void
closeDialog()
private void
constructGpxModel(CorrelateGpxWithImages.NoGpxDataWrapper nogdw)
Construct the list of loaded GPX tracksvoid
destroy()
Called when the object has been destroyed.void
expertChanged(boolean isExpert)
The expert mode changed.private static void
forEachLayer(java.util.function.Consumer<CorrelateGpxWithImages> action)
private java.util.List<ImageEntry>
getSortedImgList()
(package private) static GpxTimeOffset
loadDelta()
(package private) static GpxTimezone
loadTimezone()
private static void
removeDuplicates(java.io.File file)
private void
removeSupportLayer()
(package private) void
repaintCombobox()
private static CorrelateGpxWithImages.GpxDataWrapper
selectedGPX(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
-
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
-
cbGpx
private JosmComboBox<CorrelateGpxWithImages.GpxDataWrapper> cbGpx
-
buttonSupport
private javax.swing.JButton buttonSupport
-
tfTimezone
private JosmTextField tfTimezone
-
tfOffset
private JosmTextField tfOffset
-
cbExifImg
private javax.swing.JCheckBox cbExifImg
-
cbTaggedImg
private javax.swing.JCheckBox cbTaggedImg
-
cbShowThumbs
private javax.swing.JCheckBox cbShowThumbs
-
statusBarText
private javax.swing.JLabel statusBarText
-
sepDirectionPosition
private javax.swing.JSeparator sepDirectionPosition
-
pDirectionPosition
private ImageDirectionPositionPanel pDirectionPosition
-
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 newCorrelateGpxWithImages
action.- 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()
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
expertChanged
public void expertChanged(boolean isExpert)
Description copied from interface:ExpertToggleAction.ExpertModeChangeListener
The expert mode changed.- Specified by:
expertChanged
in interfaceExpertToggleAction.ExpertModeChangeListener
- Parameters:
isExpert
-true
if 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:Destroyable
Called when the object has been destroyed.- Specified by:
destroy
in interfaceDestroyable
-
-