Class CorrelateGpxWithImages
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.layer.geoimage.CorrelateGpxWithImages
-
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
,ExpertToggleAction.ExpertModeChangeListener
,Destroyable
public class CorrelateGpxWithImages extends 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 JButton
buttonSupport
private JCheckBox
cbExifImg
private JosmComboBox<CorrelateGpxWithImages.GpxDataWrapper>
cbGpx
private JCheckBox
cbShowThumbs
private JCheckBox
cbTaggedImg
private GpxTimeOffset
delta
private static boolean
forceTags
private static JosmComboBoxModel<CorrelateGpxWithImages.GpxDataWrapper>
gpxModel
private int
lastNumMatched
private JPanel
outerPanel
private ImageDirectionPositionPanel
pDirectionPosition
private JSeparator
sepDirectionPosition
private 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
-
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
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(ActionEvent ae)
(package private) static Pair<GpxTimezone,GpxTimeOffset>
autoGuess(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(Consumer<CorrelateGpxWithImages> action)
private List<ImageEntry>
getSortedImgList()
(package private) static GpxTimeOffset
loadDelta()
(package private) static GpxTimezone
loadTimezone()
private static void
removeDuplicates(File file)
private void
removeSupportLayer()
(package private) void
repaintCombobox()
private 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 JPanel outerPanel
-
cbGpx
private JosmComboBox<CorrelateGpxWithImages.GpxDataWrapper> cbGpx
-
buttonSupport
private JButton buttonSupport
-
tfTimezone
private JosmTextField tfTimezone
-
tfOffset
private JosmTextField tfOffset
-
cbTaggedImg
private JCheckBox cbTaggedImg
-
cbShowThumbs
private JCheckBox cbShowThumbs
-
statusBarText
private JLabel statusBarText
-
sepDirectionPosition
private 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(ActionEvent ae)
- Specified by:
actionPerformed
in interfaceActionListener
-
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(File file)
-
forEachLayer
private static void forEachLayer(Consumer<CorrelateGpxWithImages> action)
-
closeDialog
void closeDialog()
-
repaintCombobox
void repaintCombobox()
-
autoGuess
static Pair<GpxTimezone,GpxTimeOffset> autoGuess(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:
IndexOutOfBoundsException
- when there are no imagesCorrelateGpxWithImages.NoGpxTimestamps
- when the gpx track does not contain a timestamp
-
getSortedImgList
private List<ImageEntry> getSortedImgList()
-
selectedGPX
private 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
-
-