public class GpxImageEntry extends java.lang.Object implements java.lang.Comparable<GpxImageEntry>
Modifier and Type | Field and Description |
---|---|
private java.lang.Double |
elevation
Elevation (altitude) in meters
|
private LatLon |
exifCoor |
private java.util.Date |
exifGpsTime
Temporary source of GPS time if not correlated with GPX track.
|
private java.lang.Double |
exifImgDir |
private java.lang.Integer |
exifOrientation |
private java.util.Date |
exifTime |
private java.io.File |
file |
private java.util.Date |
gpsTime
The time after correlation with a gpx track
|
private int |
height |
private java.lang.String |
iptcCaption |
private java.lang.String |
iptcHeadline |
private java.util.List<java.lang.String> |
iptcKeywords |
private java.lang.String |
iptcObjectName |
private boolean |
isNewGpsData
Flag isNewGpsData indicates that the GPS data of the image is new or has changed.
|
private CachedLatLon |
pos
The following values are computed from the correlation with the gpx track
or extracted from the image EXIF data.
|
private java.lang.Double |
speed
Speed in kilometer per hour
|
private GpxImageEntry |
tmp
When the correlation dialog is open, we like to show the image position
for the current time offset on the map in real time.
|
private int |
width |
Constructor and Description |
---|
GpxImageEntry()
Constructs a new
GpxImageEntry . |
GpxImageEntry(java.io.File file)
Constructs a new
GpxImageEntry . |
GpxImageEntry(GpxImageEntry other)
Constructs a new
GpxImageEntry from an existing instance. |
Modifier and Type | Method and Description |
---|---|
void |
applyTmp()
Copy the values from the temporary variable to the main instance.
|
int |
compareTo(GpxImageEntry image) |
void |
createTmp()
Make a fresh copy and save it in the temporary variable.
|
void |
discardTmp()
Delete the temporary variable.
|
boolean |
equals(java.lang.Object obj) |
void |
extractExif()
Extract GPS metadata from image EXIF.
|
void |
flagNewGpsData()
Indicates that the image has new GPS data.
|
private static java.util.Date |
getDefensiveDate(java.util.Date date) |
java.lang.Double |
getElevation()
Returns the elevation value.
|
LatLon |
getExifCoor() |
java.util.Date |
getExifGpsTime()
Returns the EXIF GPS time.
|
java.lang.Double |
getExifImgDir() |
java.lang.Integer |
getExifOrientation()
Returns EXIF orientation
|
java.util.Date |
getExifTime()
Returns EXIF time
|
java.io.File |
getFile()
Returns associated file.
|
java.util.Date |
getGpsTime()
Returns the GPS time value.
|
int |
getHeight()
Returns height of the image this GpxImageEntry represents.
|
java.lang.String |
getIptcCaption()
Returns the IPTC caption.
|
java.lang.String |
getIptcHeadline()
Returns the IPTC headline.
|
java.util.List<java.lang.String> |
getIptcKeywords()
Returns the IPTC keywords.
|
java.lang.String |
getIptcObjectName()
Returns the IPTC object name.
|
CachedLatLon |
getPos()
Returns the position value.
|
java.lang.Double |
getSpeed()
Returns the speed value.
|
GpxImageEntry |
getTmp()
Get temporary variable that is used for real time parameter
adjustments.
|
int |
getWidth()
Returns width of the image this GpxImageEntry represents.
|
boolean |
hasExifGpsTime()
Convenient way to determine if this entry has a EXIF GPS time, without the cost of building a defensive copy.
|
boolean |
hasExifTime()
Convenient way to determine if this entry has a EXIF time, without the cost of building a defensive copy.
|
boolean |
hasGpsTime()
Convenient way to determine if this entry has a GPS time, without the cost of building a defensive copy.
|
int |
hashCode() |
boolean |
hasNewGpsData()
Queries whether the GPS data changed.
|
private static <T> void |
ifNotNull(T value,
java.util.function.Consumer<T> setter) |
boolean |
isTagged()
If it has been tagged i.e.
|
void |
setElevation(java.lang.Double elevation)
Sets the elevation.
|
void |
setExifCoor(LatLon exifCoor) |
void |
setExifGpsTime(java.util.Date exifGpsTime)
Sets the EXIF GPS time.
|
void |
setExifImgDir(java.lang.Double exifDir) |
void |
setExifOrientation(java.lang.Integer exifOrientation)
Sets EXIF orientation.
|
void |
setExifTime(java.util.Date exifTime)
Sets EXIF time.
|
void |
setFile(java.io.File file)
Sets associated file.
|
void |
setGpsTime(java.util.Date gpsTime) |
void |
setHeight(int height)
Sets the height of this GpxImageEntry.
|
void |
setIptcCaption(java.lang.String iptcCaption)
Sets the IPTC caption.
|
void |
setIptcHeadline(java.lang.String iptcHeadline)
Sets the IPTC headline.
|
void |
setIptcKeywords(java.util.List<java.lang.String> iptcKeywords)
Sets the IPTC keywords.
|
void |
setIptcObjectName(java.lang.String iptcObjectName)
Sets the IPTC object name.
|
void |
setPos(CachedLatLon pos)
Sets the position.
|
void |
setPos(LatLon pos)
Sets the position.
|
void |
setSpeed(java.lang.Double speed)
Sets the speed.
|
void |
setWidth(int width)
Sets the width of this GpxImageEntry.
|
java.lang.String |
toString()
String representation.
|
void |
unflagNewGpsData()
Remove the flag that indicates new GPS data.
|
private java.io.File file
private java.lang.Integer exifOrientation
private java.lang.Double exifImgDir
private java.util.Date exifTime
private boolean isNewGpsData
private java.util.Date exifGpsTime
private java.lang.String iptcCaption
private java.lang.String iptcHeadline
private java.util.List<java.lang.String> iptcKeywords
private java.lang.String iptcObjectName
private CachedLatLon pos
private java.lang.Double speed
private java.lang.Double elevation
private java.util.Date gpsTime
private int width
private int height
private GpxImageEntry tmp
public GpxImageEntry()
GpxImageEntry
.public GpxImageEntry(GpxImageEntry other)
GpxImageEntry
from an existing instance.other
- existing instancepublic GpxImageEntry(java.io.File file)
GpxImageEntry
.file
- Path to image file on diskpublic int getWidth()
public int getHeight()
public CachedLatLon getPos()
public java.lang.Double getSpeed()
public java.lang.Double getElevation()
public java.util.Date getGpsTime()
public boolean hasGpsTime()
true
if this entry has a GPS timepublic java.io.File getFile()
public java.lang.Integer getExifOrientation()
public java.util.Date getExifTime()
public boolean hasExifTime()
true
if this entry has a EXIF timepublic java.util.Date getExifGpsTime()
public boolean hasExifGpsTime()
true
if this entry has a EXIF GPS timeprivate static java.util.Date getDefensiveDate(java.util.Date date)
public LatLon getExifCoor()
public java.lang.Double getExifImgDir()
public void setWidth(int width)
width
- set the width of this GpxImageEntrypublic void setHeight(int height)
height
- set the height of this GpxImageEntrypublic void setPos(CachedLatLon pos)
pos
- cached positionpublic void setPos(LatLon pos)
pos
- position (will be cached)public void setSpeed(java.lang.Double speed)
speed
- speedpublic void setElevation(java.lang.Double elevation)
elevation
- elevationpublic void setFile(java.io.File file)
file
- associated filepublic void setExifOrientation(java.lang.Integer exifOrientation)
exifOrientation
- EXIF orientationpublic void setExifTime(java.util.Date exifTime)
exifTime
- EXIF timepublic void setExifGpsTime(java.util.Date exifGpsTime)
exifGpsTime
- the EXIF GPS timepublic void setGpsTime(java.util.Date gpsTime)
public void setExifCoor(LatLon exifCoor)
public void setExifImgDir(java.lang.Double exifDir)
public void setIptcCaption(java.lang.String iptcCaption)
iptcCaption
- the IPTC captionpublic void setIptcHeadline(java.lang.String iptcHeadline)
iptcHeadline
- the IPTC headlinepublic void setIptcKeywords(java.util.List<java.lang.String> iptcKeywords)
iptcKeywords
- the IPTC keywordspublic void setIptcObjectName(java.lang.String iptcObjectName)
iptcObjectName
- the IPTC object namepublic java.lang.String getIptcCaption()
public java.lang.String getIptcHeadline()
public java.util.List<java.lang.String> getIptcKeywords()
public java.lang.String getIptcObjectName()
public int compareTo(GpxImageEntry image)
compareTo
in interface java.lang.Comparable<GpxImageEntry>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void createTmp()
applyTmp()
or discardTmp()
if the temporary variable
is not needed anymore.public GpxImageEntry getTmp()
applyTmp()
or discardTmp()
if the temporary
variable is not needed anymore.public void applyTmp()
discardTmp()
public void discardTmp()
applyTmp()
public boolean isTagged()
true
if it has been taggedpublic java.lang.String toString()
toString
in class java.lang.Object
public void flagNewGpsData()
public void unflagNewGpsData()
public boolean hasNewGpsData()
true
if GPS data changed, false
otherwisepublic void extractExif()
private static <T> void ifNotNull(T value, java.util.function.Consumer<T> setter)