public class GeoImageLayer extends Layer implements PropertyChangeListener, JumpToMarkerActions.JumpToMarkerLayer
| Modifier and Type | Class and Description |
|---|---|
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) List<ImageEntry> |
data |
(package private) GpxLayer |
gpxLayer |
private Icon |
icon |
private MapFrame.MapModeChangeListener |
mapModeListener |
private static List<Action> |
menuAdditions |
private MouseAdapter |
mouseAdapter |
private BufferedImage |
offscreenBuffer |
private Icon |
selectedIcon |
private static List<MapMode> |
supportedMapModes |
(package private) boolean |
thumbsLoaded |
private ThumbsLoader |
thumbsloader |
private ExecutorService |
thumbsLoaderExecutor |
private boolean |
thumbsLoaderRunning |
(package private) boolean |
updateOffscreenBuffer |
(package private) boolean |
useThumbs |
FILTER_STATE_PROP, ICON_SIZE, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP| Constructor and Description |
|---|
GeoImageLayer(List<ImageEntry> data,
GpxLayer gpxLayer)
Constructs a new
GeoImageLayer. |
GeoImageLayer(List<ImageEntry> data,
GpxLayer gpxLayer,
boolean useThumbs)
Constructs a new
GeoImageLayer. |
GeoImageLayer(List<ImageEntry> data,
GpxLayer gpxLayer,
String name)
Constructs a new
GeoImageLayer. |
GeoImageLayer(List<ImageEntry> data,
GpxLayer gpxLayer,
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(Collection<File> files,
GpxLayer gpxLayer) |
GpxLayer |
getGpxLayer()
Returns the associated GPX layer.
|
Icon |
getIcon()
Return a representative small image for this layer.
|
List<ImageEntry> |
getImages()
Get list of images in layer.
|
Object |
getInfoComponent() |
Action[] |
getMenuEntries()
Returns list of actions.
|
ImageEntry |
getPhotoUnderMouse(MouseEvent evt)
Returns the image that matches the position of the mouse event.
|
String |
getToolTipText() |
void |
hookUpMapView()
Initialization code, that depends on Main.map.mapView.
|
private String |
infoText()
Prepare the string that is displayed if layer information is requested.
|
boolean |
isMergable(Layer other) |
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(Graphics2D g,
MapView mv,
Bounds bounds)
Paint the dataset using the engine set.
|
void |
propertyChange(PropertyChangeEvent evt) |
static void |
registerMenuAddition(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 Dimension |
scaledDimension(Image thumb) |
void |
setUseThumbs(boolean useThumbs)
Enables or disables the display of thumbnails.
|
void |
showFirstPhoto() |
void |
showLastPhoto() |
void |
showNextPhoto() |
void |
showPreviousPhoto() |
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) |
addPropertyChangeListener, checkSaveConditions, createAndOpenSaveFileChooser, destroy, estimateMemoryUsage, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getName, getOpacity, isBackgroundLayer, isChanged, isInfoResizable, isProjectionSupported, isSavable, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, setAssociatedFile, setBackgroundLayer, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisibleList<ImageEntry> data
private final Icon selectedIcon
private int currentPhoto
boolean useThumbs
private final ExecutorService thumbsLoaderExecutor
private ThumbsLoader thumbsloader
private boolean thumbsLoaderRunning
volatile boolean thumbsLoaded
private BufferedImage offscreenBuffer
boolean updateOffscreenBuffer
private static List<Action> menuAdditions
private static volatile List<MapMode> supportedMapModes
private MouseAdapter mouseAdapter
private MapFrame.MapModeChangeListener mapModeListener
public GeoImageLayer(List<ImageEntry> data, GpxLayer gpxLayer)
GeoImageLayer.data - The list of images to displaygpxLayer - The associated GPX layerpublic GeoImageLayer(List<ImageEntry> data, GpxLayer gpxLayer, String name)
GeoImageLayer.data - The list of images to displaygpxLayer - The associated GPX layername - Layer namepublic GeoImageLayer(List<ImageEntry> data, GpxLayer gpxLayer, boolean useThumbs)
GeoImageLayer.data - The list of images to displaygpxLayer - The associated GPX layeruseThumbs - Thumbnail display flagpublic GeoImageLayer(List<ImageEntry> data, GpxLayer gpxLayer, String name, boolean useThumbs)
GeoImageLayer.data - The list of images to displaygpxLayer - The associated GPX layername - Layer nameuseThumbs - Thumbnail display flagpublic static void create(Collection<File> files, GpxLayer gpxLayer)
public Icon getIcon()
Layerpublic static void registerMenuAddition(Action addition)
public Action[] getMenuEntries()
LayerLayer.SeparatorLayerAction.INSTANCE instead of new JSeparatorgetMenuEntries in class Layerprivate String infoText()
public Object getInfoComponent()
getInfoComponent in class Layerpublic String getToolTipText()
getToolTipText in class Layerpublic boolean isMergable(Layer other)
isMergable in class Layerother - The other layer that is tested to be mergable with this.public void mergeFrom(Layer from)
Layerprivate static Dimension scaledDimension(Image thumb)
public void paint(Graphics2D g, MapView mv, Bounds bounds)
Layerpaint in interface MapViewPaintablepaint in class Layerg - Graphicsmv - The object that can translate GeoPoints to screen coordinates.bounds - Bounding boxpublic void visitBoundingBox(BoundingXYVisitor v)
visitBoundingBox in class Layerpublic 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(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()
LayerestimateMemoryUsage 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 Layerpublic void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic void startLoadThumbs()
public void stopLoadThumbs()
public void thumbsLoaded()
ThumbsLoader in another thread.public void updateBufferAndRepaint()
public List<ImageEntry> getImages()
public GpxLayer getGpxLayer()
public void jumpToNextMarker()
jumpToNextMarker in interface JumpToMarkerActions.JumpToMarkerLayerpublic void jumpToPreviousMarker()
jumpToPreviousMarker in interface JumpToMarkerActions.JumpToMarkerLayerpublic boolean isUseThumbs()
true: thumbnails are displayed, false: an icon is displayed instead of thumbnails.public void setUseThumbs(boolean useThumbs)
useThumbs - New thumbnail display status