org.openstreetmap.josm.gui.layer.geoimage
Class GeoImageLayer

java.lang.Object
  extended by org.openstreetmap.josm.gui.layer.Layer
      extended by org.openstreetmap.josm.gui.layer.geoimage.GeoImageLayer
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, ProjectionChangeListener, JumpToMarkerActions.JumpToMarkerLayer, MapViewPaintable, Destroyable

public class GeoImageLayer
extends Layer
implements java.beans.PropertyChangeListener, JumpToMarkerActions.JumpToMarkerLayer


Nested Class Summary
private static class GeoImageLayer.Loader
          Loads a set of images, while displaying a dialog that indicates what the plugin is currently doing.
 
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.Layer
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction
 
Field Summary
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
           
(package private)  boolean thumbsLoaded
           
(package private)  ThumbsLoader thumbsloader
           
(package private)  boolean updateOffscreenBuffer
           
(package private)  boolean useThumbs
           
 
Fields inherited from class org.openstreetmap.josm.gui.layer.Layer
ICON_SIZE, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP
 
Constructor Summary
private GeoImageLayer(java.util.List<ImageEntry> data, GpxLayer gpxLayer)
           
 
Method Summary
 void checkPreviousNextButtons()
           
static void create(java.util.Collection<java.io.File> files, GpxLayer gpxLayer)
           
private static void extractExif(ImageEntry e)
           
 javax.swing.Icon getIcon()
          Return a representative small image for this layer.
 java.util.List<ImageEntry> getImages()
           
 java.lang.Object getInfoComponent()
           
 javax.swing.Action[] getMenuEntries()
          Returns list of actions.
 java.lang.String getToolTipText()
           
private  void hook_up_mouse_events()
           
private  java.lang.String infoText()
           
 boolean isMergable(Layer other)
           
 void jumpToNextMarker()
           
 void jumpToPreviousMarker()
           
 void loadThumbs()
           
 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)
           
 void removeCurrentPhoto()
           
 void removeCurrentPhotoFromDisk()
           
private  java.awt.Dimension scaledDimension(java.awt.Image thumb)
           
 void showNextPhoto()
           
 void showPreviousPhoto()
           
 void updateBufferAndRepaint()
           
 void visitBoundingBox(BoundingXYVisitor v)
           
 
Methods inherited from class org.openstreetmap.josm.gui.layer.Layer
addPropertyChangeListener, checkSaveConditions, createAndOpenSaveFileChooser, destroy, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getColor, getName, getOpacity, hookUpMapView, isBackgroundLayer, isChanged, isProjectionSupported, isSavable, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, setAssociatedFile, setBackgroundLayer, setName, setOpacity, setVisible, toggleVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

java.util.List<ImageEntry> data

gpxLayer

GpxLayer gpxLayer

icon

private javax.swing.Icon icon

selectedIcon

private javax.swing.Icon selectedIcon

currentPhoto

private int currentPhoto

useThumbs

boolean useThumbs

thumbsloader

ThumbsLoader thumbsloader

thumbsLoaded

boolean thumbsLoaded

offscreenBuffer

private java.awt.image.BufferedImage offscreenBuffer

updateOffscreenBuffer

boolean updateOffscreenBuffer

menuAdditions

private static java.util.List<javax.swing.Action> menuAdditions

mouseAdapter

private java.awt.event.MouseAdapter mouseAdapter

mapModeListener

private MapFrame.MapModeChangeListener mapModeListener
Constructor Detail

GeoImageLayer

private GeoImageLayer(java.util.List<ImageEntry> data,
                      GpxLayer gpxLayer)
Method Detail

create

public static void create(java.util.Collection<java.io.File> files,
                          GpxLayer gpxLayer)

getIcon

public javax.swing.Icon getIcon()
Description copied from class: Layer
Return a representative small image for this layer. The image must not be larger than 64 pixel in any dimension.

Specified by:
getIcon in class Layer

registerMenuAddition

public static void registerMenuAddition(javax.swing.Action addition)

getMenuEntries

public javax.swing.Action[] getMenuEntries()
Description copied from class: Layer
Returns list of actions. Action can implement LayerAction interface when it needs to be represented by other menu component than JMenuItem or when it supports multiple layers. Actions that support multiple layers should also have correct equals implementation. Use SeparatorLayerAction.INSTANCE instead of new JSeparator

Specified by:
getMenuEntries in class Layer

infoText

private java.lang.String infoText()

getInfoComponent

public java.lang.Object getInfoComponent()
Specified by:
getInfoComponent in class Layer

getToolTipText

public java.lang.String getToolTipText()
Specified by:
getToolTipText in class Layer
Returns:
A small tooltip hint about some statistics for this layer.

isMergable

public boolean isMergable(Layer other)
Specified by:
isMergable in class Layer
Parameters:
other - The other layer that is tested to be mergable with this.
Returns:
Whether the other layer can be merged into this layer.

mergeFrom

public void mergeFrom(Layer from)
Description copied from class: Layer
Merges the given layer into this layer. Throws if the layer types are incompatible.

Specified by:
mergeFrom in class Layer
Parameters:
from - The layer that get merged into this one. After the merge, the other layer is not usable anymore and passing to one others mergeFrom should be one of the last things to do with a layer.

scaledDimension

private java.awt.Dimension scaledDimension(java.awt.Image thumb)

paint

public void paint(java.awt.Graphics2D g,
                  MapView mv,
                  Bounds bounds)
Description copied from class: Layer
Paint the dataset using the engine set.

Specified by:
paint in interface MapViewPaintable
Specified by:
paint in class Layer
mv - The object that can translate GeoPoints to screen coordinates.

visitBoundingBox

public void visitBoundingBox(BoundingXYVisitor v)
Specified by:
visitBoundingBox in class Layer

extractExif

private static void extractExif(ImageEntry e)

showNextPhoto

public void showNextPhoto()

showPreviousPhoto

public void showPreviousPhoto()

checkPreviousNextButtons

public void checkPreviousNextButtons()

removeCurrentPhoto

public void removeCurrentPhoto()

removeCurrentPhotoFromDisk

public void removeCurrentPhotoFromDisk()

hook_up_mouse_events

private void hook_up_mouse_events()

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

loadThumbs

public void loadThumbs()

updateBufferAndRepaint

public void updateBufferAndRepaint()

getImages

public java.util.List<ImageEntry> getImages()

jumpToNextMarker

public void jumpToNextMarker()
Specified by:
jumpToNextMarker in interface JumpToMarkerActions.JumpToMarkerLayer

jumpToPreviousMarker

public void jumpToPreviousMarker()
Specified by:
jumpToPreviousMarker in interface JumpToMarkerActions.JumpToMarkerLayer


JOSM