Package org.openstreetmap.josm.data
Class ImageData
- java.lang.Object
-
- org.openstreetmap.josm.data.ImageData
-
- All Implemented Interfaces:
Data
public class ImageData extends java.lang.Object implements Data
Class to holdImageEntryand the current selection- Since:
- 14590
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceImageData.ImageDataUpdateListenerA listener that is informed when the current selection change
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ImageEntry>dataprivate QuadBuckets<ImageEntry>geoImagesprivate Layerlayerprivate ListenerList<ImageData.ImageDataUpdateListener>listenersprivate java.util.List<java.lang.Integer>selectedImagesIndex
-
Constructor Summary
Constructors Constructor Description ImageData()Construct a new image container without imagesImageData(java.util.List<ImageEntry> data)Construct a new image container with a list of images
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddImageDataUpdateListener(ImageData.ImageDataUpdateListener listener)Add a listener that listens to image data changesvoidaddImageToSelection(ImageEntry image)Add image to the list of selected imagesprivate voidafterImageUpdated(ImageEntry img)voidclearSelectedImage()Clear the selected image(s)voidfireNodeMoved(ImageEntry gpxImageEntry)Indicate that an entry has changedjava.util.Collection<DataSource>getDataSources()Returns the collection of data sources.ImageEntrygetFirstImage()Get the first image on the layerjava.util.List<ImageEntry>getImages()Returns the imagesImageEntrygetLastImage()Get the last image in the layerLayergetLayer()Get the layer that this data is associated with.ImageEntrygetNextImage()Get the image next to the current imageImageEntrygetPreviousImage()Get the image previous to the current imageImageEntrygetSelectedImage()Return the first currently selected imagejava.util.List<ImageEntry>getSelectedImages()Return the current selected imagesbooleanhasNextImage()Check if there is a next image in the sequencebooleanhasPreviousImage()Check if there is a previous image in the sequencebooleanisImageSelected(ImageEntry image)Determines if the image is selectedbooleanisModified()Determines if one image has modified GPS data.voidmergeFrom(ImageData otherData)Merge 2 ImageDatavoidnotifyImageUpdate()Manually trigger theImageData.ImageDataUpdateListener.imageDataUpdated(ImageData)voidremoveImage(ImageEntry img)Remove the image from the list and trigger update listenervoidremoveImage(ImageEntry img, boolean fireUpdateEvent)Remove the image from the list and optionally trigger update listenervoidremoveImageDataUpdateListener(ImageData.ImageDataUpdateListener listener)Removes a listener that listens to image data changesprivate voidremoveImages(java.util.List<ImageEntry> selectedImages)voidremoveImageToSelection(ImageEntry image)Remove the image from the list of selected imagesvoidremoveSelectedImages()Remove the current selected image from the listjava.util.Collection<ImageEntry>searchImages(Bounds bounds)Search for images in a boundsvoidsetLayer(Layer layer)Set the layer for use withImageViewerDialog.displayImages(List)voidsetSelectedImage(ImageEntry image)Select as the selected the given imageprivate voidsetSelectedImageIndex(int index)private voidsetSelectedImageIndex(int index, boolean forceTrigger)voidupdateImageDirection(ImageEntry img, double direction)Update the image direction of the image and trigger updatevoidupdateImageExifGpsDatum(ImageEntry img, java.lang.String exifGpsDatum)Update the image GPS datum and trigger update.voidupdateImageExifGpsDop(ImageEntry img, java.lang.Double exifGpsDop)Update the image GPS DOP value and trigger update.voidupdateImageExifGpsProcMethod(ImageEntry img, java.lang.String exifGpsProcMethod)Update the image GPS processing method and trigger update.voidupdateImageGps2d3dMode(ImageEntry img, java.lang.Integer gps2d3dMode)Update the image GPS 2d/3d mode value and trigger update.voidupdateImageGpsDiffMode(ImageEntry img, java.lang.Integer gpsDiffMode)Update the image GPS differential mode and trigger update.voidupdateImageGpsTrack(ImageEntry img, double trackDirection)Update the GPS track direction of the image and trigger update.voidupdateImageHPosErr(ImageEntry img, double hposerr)Update the image horizontal positioning error and trigger update.voidupdateImagePosition(ImageEntry img, LatLon newPos)Update the position of the image and trigger updatevoidupdateSelectedImage()Update the selected image after removal of one or more images.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.data.Data
getDataSourceArea, getDataSourceBounds
-
-
-
-
Field Detail
-
data
private final java.util.List<ImageEntry> data
-
selectedImagesIndex
private final java.util.List<java.lang.Integer> selectedImagesIndex
-
listeners
private final ListenerList<ImageData.ImageDataUpdateListener> listeners
-
geoImages
private final QuadBuckets<ImageEntry> geoImages
-
-
Constructor Detail
-
ImageData
public ImageData()
Construct a new image container without images
-
ImageData
public ImageData(java.util.List<ImageEntry> data)
Construct a new image container with a list of images- Parameters:
data- the list ofImageEntry
-
-
Method Detail
-
getImages
public java.util.List<ImageEntry> getImages()
Returns the images- Returns:
- the images
-
isModified
public boolean isModified()
Determines if one image has modified GPS data.- Returns:
trueif data has been modified;false, otherwise
-
mergeFrom
public void mergeFrom(ImageData otherData)
Merge 2 ImageData- Parameters:
otherData-ImageDatato merge
-
getSelectedImage
public ImageEntry getSelectedImage()
Return the first currently selected image- Returns:
- the first selected image as
ImageEntryor null - See Also:
getSelectedImages()
-
getSelectedImages
public java.util.List<ImageEntry> getSelectedImages()
Return the current selected images- Returns:
- the selected images as list
ImageEntry - Since:
- 15333
-
getFirstImage
public ImageEntry getFirstImage()
Get the first image on the layer- Returns:
- The first image
- Since:
- 18246
-
getLastImage
public ImageEntry getLastImage()
Get the last image in the layer- Returns:
- The last image
- Since:
- 18246
-
hasNextImage
public boolean hasNextImage()
Check if there is a next image in the sequence- Returns:
trueis there is a next image,falseotherwise
-
searchImages
public java.util.Collection<ImageEntry> searchImages(Bounds bounds)
Search for images in a bounds- Parameters:
bounds- The bounds to search- Returns:
- images in the bounds
- Since:
- 17459
-
getNextImage
public ImageEntry getNextImage()
Get the image next to the current image- Returns:
- The next image
- Since:
- 18246
-
getPreviousImage
public ImageEntry getPreviousImage()
Get the image previous to the current image- Returns:
- The previous image
- Since:
- 18246
-
hasPreviousImage
public boolean hasPreviousImage()
Check if there is a previous image in the sequence- Returns:
trueis there is a previous image,falseotherwise
-
setSelectedImage
public void setSelectedImage(ImageEntry image)
Select as the selected the given image- Parameters:
image- the selected image
-
addImageToSelection
public void addImageToSelection(ImageEntry image)
Add image to the list of selected images- Parameters:
image-ImageEntrythe image to add- Since:
- 15333
-
fireNodeMoved
public void fireNodeMoved(ImageEntry gpxImageEntry)
Indicate that an entry has changed- Parameters:
gpxImageEntry- The entry to update- Since:
- 17574
-
removeImageToSelection
public void removeImageToSelection(ImageEntry image)
Remove the image from the list of selected images- Parameters:
image-ImageEntrythe image to remove- Since:
- 15333
-
clearSelectedImage
public void clearSelectedImage()
Clear the selected image(s)
-
setSelectedImageIndex
private void setSelectedImageIndex(int index)
-
setSelectedImageIndex
private void setSelectedImageIndex(int index, boolean forceTrigger)
-
removeSelectedImages
public void removeSelectedImages()
Remove the current selected image from the list- Since:
- 15348
-
removeImages
private void removeImages(java.util.List<ImageEntry> selectedImages)
-
updateSelectedImage
public void updateSelectedImage()
Update the selected image after removal of one or more images.- Since:
- 18049
-
isImageSelected
public boolean isImageSelected(ImageEntry image)
Determines if the image is selected- Parameters:
image- theImageEntryimage- Returns:
trueis the image is selected,falseotherwise- Since:
- 15333
-
removeImage
public void removeImage(ImageEntry img)
Remove the image from the list and trigger update listener- Parameters:
img- theImageEntryto remove
-
removeImage
public void removeImage(ImageEntry img, boolean fireUpdateEvent)
Remove the image from the list and optionally trigger update listener- Parameters:
img- theImageEntryto removefireUpdateEvent- iftrue, notifies listeners of image update- Since:
- 18049
-
updateImagePosition
public void updateImagePosition(ImageEntry img, LatLon newPos)
Update the position of the image and trigger update- Parameters:
img- the image to updatenewPos- the new position
-
updateImageDirection
public void updateImageDirection(ImageEntry img, double direction)
Update the image direction of the image and trigger update- Parameters:
img- the image to updatedirection- the new direction
-
updateImageGpsTrack
public void updateImageGpsTrack(ImageEntry img, double trackDirection)
Update the GPS track direction of the image and trigger update.- Parameters:
img- the image to updatetrackDirection- the new GPS track direction- Since:
- 19387
-
updateImageHPosErr
public void updateImageHPosErr(ImageEntry img, double hposerr)
Update the image horizontal positioning error and trigger update.- Parameters:
img- the image to updatehposerr- the new horizontal positionning error- Since:
- 19387
-
updateImageGpsDiffMode
public void updateImageGpsDiffMode(ImageEntry img, java.lang.Integer gpsDiffMode)
Update the image GPS differential mode and trigger update.- Parameters:
img- the image to updategpsDiffMode- the new GPS differential mode- Since:
- 19387
-
updateImageGps2d3dMode
public void updateImageGps2d3dMode(ImageEntry img, java.lang.Integer gps2d3dMode)
Update the image GPS 2d/3d mode value and trigger update.- Parameters:
img- the image to updategps2d3dMode- the new 2d/3d GPS mode- Since:
- 19387
-
updateImageExifGpsDop
public void updateImageExifGpsDop(ImageEntry img, java.lang.Double exifGpsDop)
Update the image GPS DOP value and trigger update.- Parameters:
img- the image to updateexifGpsDop- the new GPS DOP value- Since:
- 19387
-
updateImageExifGpsDatum
public void updateImageExifGpsDatum(ImageEntry img, java.lang.String exifGpsDatum)
Update the image GPS datum and trigger update.- Parameters:
img- the image to updateexifGpsDatum- the new datum string value- Since:
- 19387
-
updateImageExifGpsProcMethod
public void updateImageExifGpsProcMethod(ImageEntry img, java.lang.String exifGpsProcMethod)
Update the image GPS processing method and trigger update.- Parameters:
img- the image to updateexifGpsProcMethod- the new GPS processing method- Since:
- 19387
-
notifyImageUpdate
public void notifyImageUpdate()
Manually trigger theImageData.ImageDataUpdateListener.imageDataUpdated(ImageData)
-
afterImageUpdated
private void afterImageUpdated(ImageEntry img)
-
setLayer
public void setLayer(Layer layer)
Set the layer for use withImageViewerDialog.displayImages(List)- Parameters:
layer- The layer to use for organization- Since:
- 18591
-
getLayer
public Layer getLayer()
Get the layer that this data is associated with. May benull.- Returns:
- The layer this data is associated with.
- Since:
- 18591
-
addImageDataUpdateListener
public void addImageDataUpdateListener(ImageData.ImageDataUpdateListener listener)
Add a listener that listens to image data changes- Parameters:
listener- theImageData.ImageDataUpdateListener
-
removeImageDataUpdateListener
public void removeImageDataUpdateListener(ImageData.ImageDataUpdateListener listener)
Removes a listener that listens to image data changes- Parameters:
listener- The listener
-
getDataSources
public java.util.Collection<DataSource> getDataSources()
Description copied from interface:DataReturns the collection of data sources.- Specified by:
getDataSourcesin interfaceData- Returns:
- the collection of data sources.
-
-