public class GeoImageLayer extends AbstractModifiableLayer implements java.beans.PropertyChangeListener, JumpToMarkerActions.JumpToMarkerLayer
Modifier and Type | Class and Description |
---|---|
(package private) static class |
GeoImageLayer.Loader
Loads a set of images, while displaying a dialog that indicates what the plugin is currently doing.
|
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction
Modifier and Type | Field and Description |
---|---|
private int |
currentPhoto |
(package private) java.util.List<ImageEntry> |
data |
(package private) GpxLayer |
gpxLayer |
private javax.swing.Icon |
icon |
private MapFrame.MapModeChangeListener |
mapModeListener |
private static java.util.List<javax.swing.Action> |
menuAdditions |
private java.awt.event.MouseAdapter |
mouseAdapter |
private java.awt.image.BufferedImage |
offscreenBuffer |
private javax.swing.Icon |
selectedIcon |
private static java.util.List<MapMode> |
supportedMapModes |
(package private) boolean |
thumbsLoaded |
private ThumbsLoader |
thumbsloader |
private java.util.concurrent.ExecutorService |
thumbsLoaderExecutor |
private boolean |
thumbsLoaderRunning |
(package private) boolean |
updateOffscreenBuffer |
(package private) boolean |
useThumbs |
FILTER_STATE_PROP, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP
Constructor and Description |
---|
GeoImageLayer(java.util.List<ImageEntry> data,
GpxLayer gpxLayer)
Constructs a new
GeoImageLayer . |
GeoImageLayer(java.util.List<ImageEntry> data,
GpxLayer gpxLayer,
boolean useThumbs)
Constructs a new
GeoImageLayer . |
GeoImageLayer(java.util.List<ImageEntry> data,
GpxLayer gpxLayer,
java.lang.String name)
Constructs a new
GeoImageLayer . |
GeoImageLayer(java.util.List<ImageEntry> data,
GpxLayer gpxLayer,
java.lang.String name,
boolean useThumbs)
Constructs a new
GeoImageLayer . |
Modifier and Type | Method and Description |
---|---|
void |
checkPreviousNextButtons() |
void |
clearCurrentPhoto(boolean repaint)
Clears the currentPhoto, i.e.
|
private void |
clearOtherCurrentPhotos()
Clears the currentPhoto of the other GeoImageLayer's.
|
void |
copyCurrentPhotoPath() |
static void |
create(java.util.Collection<java.io.File> files,
GpxLayer gpxLayer) |
GpxLayer |
getGpxLayer()
Returns the associated GPX layer.
|
javax.swing.Icon |
getIcon()
Return a representative small image for this layer.
|
java.util.List<ImageEntry> |
getImages()
Get list of images in layer.
|
java.lang.Object |
getInfoComponent() |
javax.swing.Action[] |
getMenuEntries()
Returns list of actions.
|
ImageEntry |
getPhotoUnderMouse(java.awt.event.MouseEvent evt)
Returns the image that matches the position of the mouse event.
|
java.lang.String |
getToolTipText() |
void |
hookUpMapView()
Initialization code, that depends on Main.map.mapView.
|
private java.lang.String |
infoText()
Prepare the string that is displayed if layer information is requested.
|
boolean |
isMergable(Layer other) |
boolean |
isModified()
Determines if data managed by this layer has been modified.
|
private static boolean |
isSupportedMapMode(MapMode mapMode)
Determines if the functionality of this layer is available in
the specified map mode.
|
boolean |
isUseThumbs()
Returns the current thumbnail display status.
|
void |
jumpToNextMarker() |
void |
jumpToPreviousMarker() |
void |
mergeFrom(Layer from)
Merges the given layer into this layer.
|
void |
paint(java.awt.Graphics2D g,
MapView mv,
Bounds bounds)
Paint the dataset using the engine set.
|
void |
propertyChange(java.beans.PropertyChangeEvent evt) |
static void |
registerMenuAddition(javax.swing.Action addition) |
static void |
registerSupportedMapMode(MapMode mapMode)
Registers a map mode for which the functionality of this layer should be available.
|
void |
removeCurrentPhoto() |
void |
removeCurrentPhotoFromDisk() |
void |
removePhotoByIdx(int idx)
Removes a photo from the list of images by index.
|
private static java.awt.Dimension |
scaledDimension(java.awt.Image thumb) |
void |
setUseThumbs(boolean useThumbs)
Enables or disables the display of thumbnails.
|
void |
showFirstPhoto()
Shows first photo.
|
void |
showLastPhoto()
Shows last photo.
|
void |
showNextPhoto()
Shows next photo.
|
void |
showPreviousPhoto()
Shows previous photo.
|
void |
startLoadThumbs()
Start to load thumbnails.
|
void |
stopLoadThumbs()
Stop to load thumbnails.
|
void |
thumbsLoaded()
Called to signal that the loading of thumbnails has finished.
|
void |
updateBufferAndRepaint() |
void |
visitBoundingBox(BoundingXYVisitor v) |
createUploadTask, getUploadDialog, isUploadable, isUploadDiscouraged, onPostSaveToFile, onPostUploadToServer, requiresSaveToFile, requiresUploadToServer
addPropertyChangeListener, checkSaveConditions, createAndOpenSaveFileChooser, destroy, estimateMemoryUsage, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getName, getOpacity, isBackgroundLayer, isChanged, isInfoResizable, isProjectionSupported, isRenamed, isSavable, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isSavable
private static java.util.List<javax.swing.Action> menuAdditions
private static volatile java.util.List<MapMode> supportedMapModes
java.util.List<ImageEntry> data
private final javax.swing.Icon icon
private final javax.swing.Icon selectedIcon
private int currentPhoto
boolean useThumbs
private final java.util.concurrent.ExecutorService thumbsLoaderExecutor
private ThumbsLoader thumbsloader
private boolean thumbsLoaderRunning
volatile boolean thumbsLoaded
private java.awt.image.BufferedImage offscreenBuffer
boolean updateOffscreenBuffer
private java.awt.event.MouseAdapter mouseAdapter
private MapFrame.MapModeChangeListener mapModeListener
public GeoImageLayer(java.util.List<ImageEntry> data, GpxLayer gpxLayer)
GeoImageLayer
.data
- The list of images to displaygpxLayer
- The associated GPX layerpublic GeoImageLayer(java.util.List<ImageEntry> data, GpxLayer gpxLayer, java.lang.String name)
GeoImageLayer
.data
- The list of images to displaygpxLayer
- The associated GPX layername
- Layer namepublic GeoImageLayer(java.util.List<ImageEntry> data, GpxLayer gpxLayer, boolean useThumbs)
GeoImageLayer
.data
- The list of images to displaygpxLayer
- The associated GPX layeruseThumbs
- Thumbnail display flagpublic GeoImageLayer(java.util.List<ImageEntry> data, GpxLayer gpxLayer, java.lang.String name, boolean useThumbs)
GeoImageLayer
.data
- The list of images to displaygpxLayer
- The associated GPX layername
- Layer nameuseThumbs
- Thumbnail display flagpublic javax.swing.Icon getIcon()
Layer
public static void registerMenuAddition(javax.swing.Action addition)
public javax.swing.Action[] getMenuEntries()
Layer
Layer.SeparatorLayerAction.INSTANCE
instead of new JSeparatorgetMenuEntries
in class Layer
private java.lang.String infoText()
public java.lang.Object getInfoComponent()
getInfoComponent
in class Layer
public java.lang.String getToolTipText()
getToolTipText
in class Layer
public boolean isModified()
isModified
in class AbstractModifiableLayer
true
if data has been modified; false
, otherwisepublic boolean isMergable(Layer other)
isMergable
in class Layer
other
- The other layer that is tested to be mergable with this.public void mergeFrom(Layer from)
Layer
private static java.awt.Dimension scaledDimension(java.awt.Image thumb)
public void paint(java.awt.Graphics2D g, MapView mv, Bounds bounds)
Layer
paint
in interface MapViewPaintable
paint
in class Layer
g
- Graphicsmv
- The object that can translate GeoPoints to screen coordinates.bounds
- Bounding boxpublic void visitBoundingBox(BoundingXYVisitor v)
visitBoundingBox
in class Layer
public void showNextPhoto()
public void showPreviousPhoto()
public void showFirstPhoto()
public void showLastPhoto()
public void checkPreviousNextButtons()
public void removeCurrentPhoto()
public void removeCurrentPhotoFromDisk()
public void copyCurrentPhotoPath()
public void removePhotoByIdx(int idx)
idx
- Image indexpublic ImageEntry getPhotoUnderMouse(java.awt.event.MouseEvent evt)
evt
- Mouse eventnull
if there is no image at the mouse positionpublic void clearCurrentPhoto(boolean repaint)
repaint
- Repaint flagprivate void clearOtherCurrentPhotos()
public static void registerSupportedMapMode(MapMode mapMode)
mapMode
- Map mode to be registeredprivate static boolean isSupportedMapMode(MapMode mapMode)
SelectAction
and LassoModeAction
are supported by default,
other map modes can be registered.mapMode
- Map mode to be checkedtrue
if the map mode is supported,
false
otherwisepublic void hookUpMapView()
Layer
estimateMemoryUsage
method and give a hint.
This allows for preemptive warning message for user, instead of failing later on
Remember to call super.hookUpMapView()
when overriding this methodhookUpMapView
in class Layer
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
public void startLoadThumbs()
public void stopLoadThumbs()
public void thumbsLoaded()
ThumbsLoader
in another thread.public void updateBufferAndRepaint()
public java.util.List<ImageEntry> getImages()
public GpxLayer getGpxLayer()
public void jumpToNextMarker()
jumpToNextMarker
in interface JumpToMarkerActions.JumpToMarkerLayer
public void jumpToPreviousMarker()
jumpToPreviousMarker
in interface JumpToMarkerActions.JumpToMarkerLayer
public boolean isUseThumbs()
true
: thumbnails are displayed, false
: an icon is displayed instead of thumbnails.public void setUseThumbs(boolean useThumbs)
useThumbs
- New thumbnail display status