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 newImageEntryfrom an existing instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete()Delete the imagebooleanequals(java.lang.Object obj)ImageDatagetDataSet()Get the dataset for this imageImageEntrygetFirstImage()Get the first image for the data or sequenceprotected java.net.URLgetImageUrl()ImageEntrygetLastImage()Get the last image for the data or sequenceImageEntrygetNextImage()Get what would be the next imageImageEntrygetPreviousImage()Get the previous imagejava.awt.ImagegetThumbnail()Returns the thumbnail.inthashCode()booleanhasThumbnail()Determines whether a thumbnail is setbooleanisDeleteSupported()Check if image deletion is supportedbooleanisRemoveSupported()Check if image removal is supportedvoidloadThumbnail()Loads the thumbnail if it was not loaded yet.java.awt.image.BufferedImageread(java.awt.Dimension target)Reads the image represented by this entry in the given target dimension.booleanremove()Remove the imagevoidselectImage(ImageViewerDialog imageViewerDialog, IImageEntry<?> entry)Select a specific imagevoidsetDataSet(ImageData imageData)Set the dataset for this imagevoidsetThumbnail(java.awt.Image thumbnail)Sets the thumbnail.protected voidtmpUpdated()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, getExifGpsDatum, getExifGpsDop, getExifGpsInstant, getExifGpsProcMethod, getExifGpsTrack, getExifHPosErr, getExifImgDir, getExifInstant, getExifOrientation, getFile, getGps2d3dMode, getGpsDiffMode, getGpsInstant, getHeight, getImageURI, getInputStream, getIptcCaption, getIptcHeadline, getIptcKeywords, getIptcObjectName, getLastModified, getPos, getProjectionType, getSpeed, getTimeSourceInstant, getTmp, getWidth, hasExifGpsTime, hasExifTime, hasGpsTime, hasNewGpsData, isTagged, setElevation, setExifCoor, setExifCoor, setExifGpsDatum, setExifGpsDop, setExifGpsProcMethod, setExifGpsTime, setExifGpsTrack, setExifHPosErr, setExifImgDir, setExifOrientation, setExifTime, setFile, setGps2d3dMode, setGpsDiffMode, 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, getExifGpsDatum, getExifGpsDop, getExifGpsInstant, getExifGpsProcMethod, getExifGpsTrack, getExifHPosErr, getExifImgDir, getExifInstant, getFile, getGps2d3dMode, getGpsDiffMode, 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 newImageEntryfrom 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:
trueif 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:GpxImageEntryIndicate 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:
tmpUpdatedin 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:
hashCodein classGpxImageEntry
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classGpxImageEntry
-
getNextImage
public ImageEntry getNextImage()
Description copied from interface:IImageEntryGet what would be the next image- Specified by:
getNextImagein interfaceIImageEntry<ImageEntry>- Returns:
- The next image
-
getPreviousImage
public ImageEntry getPreviousImage()
Description copied from interface:IImageEntryGet the previous image- Specified by:
getPreviousImagein interfaceIImageEntry<ImageEntry>- Returns:
- The previous image
-
getFirstImage
public ImageEntry getFirstImage()
Description copied from interface:IImageEntryGet the first image for the data or sequence- Specified by:
getFirstImagein interfaceIImageEntry<ImageEntry>- Returns:
- The first image
-
selectImage
public void selectImage(ImageViewerDialog imageViewerDialog, IImageEntry<?> entry)
Description copied from interface:IImageEntrySelect a specific image- Specified by:
selectImagein interfaceIImageEntry<ImageEntry>- Parameters:
imageViewerDialog- The image viewer to updateentry- The image to select
-
getLastImage
public ImageEntry getLastImage()
Description copied from interface:IImageEntryGet the last image for the data or sequence- Specified by:
getLastImagein interfaceIImageEntry<ImageEntry>- Returns:
- The last image
-
isRemoveSupported
public boolean isRemoveSupported()
Description copied from interface:IImageEntryCheck if image removal is supported- Specified by:
isRemoveSupportedin interfaceIImageEntry<ImageEntry>- Returns:
trueif removal is supported
-
remove
public boolean remove()
Description copied from interface:IImageEntryRemove the image- Specified by:
removein interfaceIImageEntry<ImageEntry>- Returns:
trueif removal was successful
-
isDeleteSupported
public boolean isDeleteSupported()
Description copied from interface:IImageEntryCheck if image deletion is supported- Specified by:
isDeleteSupportedin interfaceIImageEntry<ImageEntry>- Returns:
trueif deletion is supported
-
delete
public boolean delete()
Description copied from interface:IImageEntryDelete the image- Specified by:
deletein interfaceIImageEntry<ImageEntry>- Returns:
trueif 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:
readin interfaceIImageEntry<ImageEntry>- Overrides:
readin 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
-
-