public final class ImageEntry extends java.lang.Object implements java.lang.Comparable<ImageEntry>, java.lang.Cloneable
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 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 java.awt.Image |
thumbnail |
(package private) ImageEntry |
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 |
---|
ImageEntry()
Constructs a new
ImageEntry . |
ImageEntry(java.io.File file)
Constructs a new
ImageEntry . |
Modifier and Type | Method and Description |
---|---|
void |
applyTmp()
Copy the values from the temporary variable to the main instance.
|
ImageEntry |
clone() |
int |
compareTo(ImageEntry image) |
void |
createTmp()
Make a fresh copy and save it in the temporary variable.
|
void |
discardTmp()
Delete the temporary variable.
|
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 ImageEntry represents.
|
CachedLatLon |
getPos()
Returns the position value.
|
java.lang.Double |
getSpeed()
Returns the speed value.
|
java.awt.Image |
getThumbnail()
Returns the thumbnail.
|
ImageEntry |
getTmp()
Get temporary variable that is used for real time parameter
adjustments.
|
int |
getWidth()
Returns width of the image this ImageEntry 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.
|
boolean |
hasNewGpsData()
Queries whether the GPS data changed.
|
boolean |
hasThumbnail()
Determines whether a thumbnail is set
|
boolean |
isTagged()
If it has been tagged i.e.
|
void |
loadThumbnail()
Loads the thumbnail if it was not loaded yet.
|
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 ImageEntry.
|
void |
setPos(CachedLatLon pos)
Sets the position.
|
void |
setPos(LatLon pos)
Sets the position.
|
void |
setSpeed(java.lang.Double speed)
Sets the speed.
|
void |
setThumbnail(java.awt.Image thumbnail)
Sets the thumbnail.
|
void |
setWidth(int width)
Sets the width of this ImageEntry.
|
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.awt.Image thumbnail
private CachedLatLon pos
private java.lang.Double speed
private java.lang.Double elevation
private java.util.Date gpsTime
private int width
private int height
ImageEntry tmp
public ImageEntry()
ImageEntry
.public ImageEntry(java.io.File file)
ImageEntry
.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 boolean hasThumbnail()
true
if a thumbnail is setpublic java.awt.Image getThumbnail()
public void setThumbnail(java.awt.Image thumbnail)
thumbnail
- thumbnailpublic void loadThumbnail()
ThumbsLoader
public void setWidth(int width)
width
- set the width of this ImageEntrypublic void setHeight(int height)
height
- set the height of this ImageEntrypublic 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 ImageEntry clone()
clone
in class java.lang.Object
public int compareTo(ImageEntry image)
compareTo
in interface java.lang.Comparable<ImageEntry>
public void createTmp()
applyTmp()
or discardTmp()
if the temporary variable
is not needed anymore.public ImageEntry 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()