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 |
(package private) ThumbsLoader |
thumbsloader |
(package private) ExecutorService |
thumbsLoaderExecutor |
(package private) boolean |
thumbsLoaderRunning |
(package private) boolean |
updateOffscreenBuffer |
(package private) boolean |
useThumbs |
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) |
private static void |
extractExif(ImageEntry e)
Extract GPS metadata from image EXIF
If successful, fills in the LatLon and EastNorth attributes of passed in image
|
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 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, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getName, getOpacity, isBackgroundLayer, isChanged, isInfoResizable, isProjectionSupported, isSavable, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, setAssociatedFile, setBackgroundLayer, setName, setOpacity, setVisible, toggleVisible
List<ImageEntry> data
private Icon selectedIcon
private int currentPhoto
boolean useThumbs
ExecutorService thumbsLoaderExecutor
ThumbsLoader thumbsloader
boolean thumbsLoaderRunning
volatile boolean thumbsLoaded
private BufferedImage offscreenBuffer
boolean updateOffscreenBuffer
private static List<Action> menuAdditions
private static 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()
Layer
public static void registerMenuAddition(Action addition)
public Action[] getMenuEntries()
Layer
getMenuEntries
in class Layer
private String infoText()
public Object getInfoComponent()
getInfoComponent
in class Layer
public String getToolTipText()
getToolTipText
in class Layer
public 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 Dimension scaledDimension(Image thumb)
public void paint(Graphics2D g, MapView mv, Bounds bounds)
Layer
paint
in interface MapViewPaintable
paint
in class Layer
mv
- The object that can translate GeoPoints to screen coordinates.public void visitBoundingBox(BoundingXYVisitor v)
visitBoundingBox
in class Layer
private static void extractExif(ImageEntry e)
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(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 final 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
hookUpMapView
in class Layer
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public 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.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