Class ImageEntry
- java.lang.Object
-
- org.openstreetmap.josm.data.gpx.GpxImageEntry
-
- org.openstreetmap.josm.gui.layer.geoimage.ImageEntry
-
- All Implemented Interfaces:
java.lang.Comparable<GpxImageEntry>
,IImageEntry<ImageEntry>
,IQuadBucketType
,ImageMetadata
- Direct Known Subclasses:
WikimediaCommonsEntry
public class ImageEntry extends GpxImageEntry implements IImageEntry<ImageEntry>
Stores info about each image, with an optional thumbnail- Since:
- 2662
-
-
Constructor Summary
Constructors Constructor Description ImageEntry()
Constructs a newImageEntry
.ImageEntry(java.io.File file)
Constructs a newImageEntry
.ImageEntry(ImageEntry other)
Constructs a newImageEntry
from an existing instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
delete()
Delete the imageboolean
equals(java.lang.Object obj)
ImageData
getDataSet()
Get the dataset for this imageImageEntry
getFirstImage()
Get the first image for the data or sequenceprotected java.net.URL
getImageUrl()
ImageEntry
getLastImage()
Get the last image for the data or sequenceImageEntry
getNextImage()
Get what would be the next imageImageEntry
getPreviousImage()
Get the previous imagejava.awt.Image
getThumbnail()
Returns the thumbnail.int
hashCode()
boolean
hasThumbnail()
Determines whether a thumbnail is setboolean
isDeleteSupported()
Check if image deletion is supportedboolean
isRemoveSupported()
Check if image removal is supportedvoid
loadThumbnail()
Loads the thumbnail if it was not loaded yet.java.awt.image.BufferedImage
read(java.awt.Dimension target)
Reads the image represented by this entry in the given target dimension.boolean
remove()
Remove the imagevoid
selectImage(ImageViewerDialog imageViewerDialog, IImageEntry<?> entry)
Select a specific imagevoid
setDataSet(ImageData imageData)
Set the dataset for this imagevoid
setThumbnail(java.awt.Image thumbnail)
Sets the thumbnail.protected void
tmpUpdated()
Indicate that the temporary copy has been updated.-
Methods inherited from class org.openstreetmap.josm.data.gpx.GpxImageEntry
applyTmp, asWayPoint, compareTo, createTmp, discardTmp, extractExif, flagNewGpsData, getBBox, getDisplayName, getElevation, getExifCoor, getExifGpsInstant, getExifGpsTime, getExifImgDir, getExifInstant, getExifOrientation, getFile, getGpsInstant, getGpsTime, getHeight, getImageURI, getInputStream, getIptcCaption, getIptcHeadline, getIptcKeywords, getIptcObjectName, getLastModified, getPos, getProjectionType, getSpeed, getTmp, getWidth, hasExifGpsTime, hasExifTime, hasGpsTime, hasNewGpsData, isTagged, setElevation, setExifCoor, setExifCoor, setExifGpsTime, setExifImgDir, setExifOrientation, setExifTime, setFile, setGpsTime, setHeight, setIptcCaption, setIptcHeadline, setIptcKeywords, setIptcObjectName, setPos, setPos, setPos, setProjectionType, setSpeed, setWidth, toString, unflagNewGpsData
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.imagery.street_level.IImageEntry
getDisplayName, getElevation, getExifImgDir, getExifInstant, getFile, getGpsInstant, getImageURI, getIptcCaption, getIptcHeadline, getIptcKeywords, getIptcObjectName, getPos, getProjectionType, getSpeed, hasExifTime, hasGpsTime, selectFirstImage, selectLastImage, selectNextImage, selectPreviousImage, setHeight, setWidth
-
-
-
-
Constructor Detail
-
ImageEntry
public ImageEntry()
Constructs a newImageEntry
.
-
ImageEntry
public ImageEntry(ImageEntry other)
Constructs a newImageEntry
from an existing instance.- Parameters:
other
- existing instance- Since:
- 14625
-
ImageEntry
public ImageEntry(java.io.File file)
Constructs a newImageEntry
.- Parameters:
file
- Path to image file on disk
-
-
Method Detail
-
hasThumbnail
public boolean hasThumbnail()
Determines whether a thumbnail is set- Returns:
true
if a thumbnail is set
-
getThumbnail
public java.awt.Image getThumbnail()
Returns the thumbnail.- Returns:
- the thumbnail
-
setThumbnail
public void setThumbnail(java.awt.Image thumbnail)
Sets the thumbnail.- Parameters:
thumbnail
- thumbnail
-
loadThumbnail
public void loadThumbnail()
Loads the thumbnail if it was not loaded yet.- See Also:
ThumbsLoader
-
tmpUpdated
protected void tmpUpdated()
Description copied from class:GpxImageEntry
Indicate that the temporary copy has been updated. Mostly used to prevent UI issues. By default, this is a no-op. Override when needed in subclasses.- Overrides:
tmpUpdated
in classGpxImageEntry
-
setDataSet
public void setDataSet(ImageData imageData)
Set the dataset for this image- Parameters:
imageData
- The dataset- Since:
- 17574
-
getDataSet
public ImageData getDataSet()
Get the dataset for this image- Returns:
- The dataset
- Since:
- 17574
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classGpxImageEntry
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classGpxImageEntry
-
getNextImage
public ImageEntry getNextImage()
Description copied from interface:IImageEntry
Get what would be the next image- Specified by:
getNextImage
in interfaceIImageEntry<ImageEntry>
- Returns:
- The next image
-
getPreviousImage
public ImageEntry getPreviousImage()
Description copied from interface:IImageEntry
Get the previous image- Specified by:
getPreviousImage
in interfaceIImageEntry<ImageEntry>
- Returns:
- The previous image
-
getFirstImage
public ImageEntry getFirstImage()
Description copied from interface:IImageEntry
Get the first image for the data or sequence- Specified by:
getFirstImage
in interfaceIImageEntry<ImageEntry>
- Returns:
- The first image
-
selectImage
public void selectImage(ImageViewerDialog imageViewerDialog, IImageEntry<?> entry)
Description copied from interface:IImageEntry
Select a specific image- Specified by:
selectImage
in interfaceIImageEntry<ImageEntry>
- Parameters:
imageViewerDialog
- The image viewer to updateentry
- The image to select
-
getLastImage
public ImageEntry getLastImage()
Description copied from interface:IImageEntry
Get the last image for the data or sequence- Specified by:
getLastImage
in interfaceIImageEntry<ImageEntry>
- Returns:
- The last image
-
isRemoveSupported
public boolean isRemoveSupported()
Description copied from interface:IImageEntry
Check if image removal is supported- Specified by:
isRemoveSupported
in interfaceIImageEntry<ImageEntry>
- Returns:
true
if removal is supported
-
remove
public boolean remove()
Description copied from interface:IImageEntry
Remove the image- Specified by:
remove
in interfaceIImageEntry<ImageEntry>
- Returns:
true
if removal was successful
-
isDeleteSupported
public boolean isDeleteSupported()
Description copied from interface:IImageEntry
Check if image deletion is supported- Specified by:
isDeleteSupported
in interfaceIImageEntry<ImageEntry>
- Returns:
true
if deletion is supported
-
delete
public boolean delete()
Description copied from interface:IImageEntry
Delete the image- Specified by:
delete
in interfaceIImageEntry<ImageEntry>
- Returns:
true
if deletion was successful
-
read
public java.awt.image.BufferedImage read(java.awt.Dimension target) throws java.io.IOException
Reads the image represented by this entry in the given target dimension.- Specified by:
read
in interfaceIImageEntry<ImageEntry>
- Overrides:
read
in classGpxImageEntry
- Parameters:
target
- the desired dimension used for subsampling ornull
- Returns:
- the read image, or
null
- Throws:
java.io.IOException
- if any I/O error occurs
-
getImageUrl
protected java.net.URL getImageUrl() throws java.net.MalformedURLException
- Throws:
java.net.MalformedURLException
-
-