Class GeoImageLayer

    • Constructor Detail

      • GeoImageLayer

        public GeoImageLayer​(java.util.List<ImageEntry> data,
                             GpxLayer gpxLayer)
        Constructs a new GeoImageLayer.
        Parameters:
        data - The list of images to display
        gpxLayer - The associated GPX layer
      • GeoImageLayer

        public GeoImageLayer​(java.util.List<ImageEntry> data,
                             GpxLayer gpxLayer,
                             java.lang.String name)
        Constructs a new GeoImageLayer.
        Parameters:
        data - The list of images to display
        gpxLayer - The associated GPX layer
        name - Layer name
        Since:
        6392
      • GeoImageLayer

        public GeoImageLayer​(java.util.List<ImageEntry> data,
                             GpxLayer gpxLayer,
                             boolean useThumbs)
        Constructs a new GeoImageLayer.
        Parameters:
        data - The list of images to display
        gpxLayer - The associated GPX layer
        useThumbs - Thumbnail display flag
        Since:
        6392
      • GeoImageLayer

        public GeoImageLayer​(java.util.List<ImageEntry> data,
                             GpxLayer gpxLayer,
                             java.lang.String name,
                             boolean useThumbs)
        Constructs a new GeoImageLayer.
        Parameters:
        data - The list of images to display
        gpxLayer - The associated GPX layer
        name - Layer name
        useThumbs - Thumbnail display flag
        Since:
        6392
      • GeoImageLayer

        public GeoImageLayer​(java.util.List<ImageEntry> data,
                             GpxData gpxData,
                             java.lang.String name,
                             boolean useThumbs)
        Constructs a new GeoImageLayer.
        Parameters:
        data - The list of images to display
        gpxData - The associated GPX data
        name - Layer name
        useThumbs - Thumbnail display flag
        Since:
        18078
    • Method Detail

      • create

        public static void create​(java.util.Collection<java.io.File> files,
                                  GpxLayer gpxLayer)
        Create a GeoImageLayer asynchronously
        Parameters:
        files - the list of image files to display
        gpxLayer - the gpx layer
      • containsImage

        public boolean containsImage​(IImageEntry<?> imageEntry)
        Description copied from interface: IGeoImageLayer
        Check if the layer contains the specified image
        Specified by:
        containsImage in interface IGeoImageLayer
        Parameters:
        imageEntry - The entry to look for
        Returns:
        true if this layer contains the image
      • 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
        Returns:
        layer icon
      • registerMenuAddition

        public static void registerMenuAddition​(javax.swing.Action addition)
        Register actions on the layer
        Parameters:
        addition - the action to be added
      • 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 Layer.SeparatorLayerAction.INSTANCE instead of new JSeparator

        Specified by:
        getMenuEntries in class Layer
        Returns:
        menu actions for this layer
      • infoText

        private java.lang.String infoText()
        Prepare the string that is displayed if layer information is requested.
        Returns:
        String with layer information
      • getInfoComponent

        public java.lang.Object getInfoComponent()
        Description copied from class: Layer
        Gets the layer information to display to the user. This is used if the user requests information about this layer. It should display a description of the layer content.
        Specified by:
        getInfoComponent in class Layer
        Returns:
        Either a String or a Component describing the layer.
      • getToolTipText

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

        public boolean isModified()
        Determines if data managed by this layer has been modified. That is the case if one image has modified GPS data.
        Specified by:
        isModified in class AbstractModifiableLayer
        Returns:
        true if data has been modified; false, otherwise
      • isMergable

        public boolean isMergable​(Layer other)
        Description copied from class: Layer
        Determines if the other layer can be merged into this layer.
        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 static java.awt.Dimension scaledDimension​(java.awt.Image thumb)
      • paintImage

        private void paintImage​(ImageEntry e,
                                MapView mv,
                                java.awt.Rectangle clip,
                                java.awt.Graphics2D tempG)
        Paint one image.
        Parameters:
        e - Image to be painted
        mv - Map view
        clip - Bounding rectangle of the current clipping area
        tempG - Temporary offscreen buffer
      • paint

        public void paint​(java.awt.Graphics2D g,
                          MapView mv,
                          Bounds bounds)
        Description copied from interface: MapViewPaintable
        Paint the dataset using the engine set.
        Specified by:
        paint in interface MapViewPaintable
        Parameters:
        g - Graphics
        mv - The object that can translate GeoPoints to screen coordinates.
        bounds - Bounding box
      • drawDirectionArrow

        protected static void drawDirectionArrow​(java.awt.Graphics2D g,
                                                 java.awt.Point p,
                                                 double dir,
                                                 java.awt.Dimension imgDim)
      • visitBoundingBox

        public void visitBoundingBox​(BoundingXYVisitor v)
        Description copied from class: Layer
        Visits the content bounds of this layer. The behavior of this method depends on the layer, but each implementation should attempt to cover the relevant content of the layer in this method.
        Specified by:
        visitBoundingBox in class Layer
        Parameters:
        v - The visitor that gets notified about the contents of this layer.
      • showCurrentPhoto

        public void showCurrentPhoto()
        Show current photo on map and in image viewer.
      • isPhotoIdxUnderMouse

        private boolean isPhotoIdxUnderMouse​(int idx,
                                             java.awt.event.MouseEvent evt)
        Check if the position of the mouse event is within the rectangle of the photo icon or thumbnail.
        Parameters:
        idx - the image index
        evt - Mouse event
        Returns:
        true if the photo matches the mouse position, false otherwise
      • getPhotoIdxUnderMouse

        private int getPhotoIdxUnderMouse​(java.awt.event.MouseEvent evt,
                                          boolean cycle)
        Returns index of the image that matches the position of the mouse event.
        Parameters:
        evt - Mouse event
        cycle - Set to true to cycle through the photos at the current mouse position if multiple icons or thumbnails overlap. If set to false the topmost photo will be used.
        Returns:
        Image index at mouse position, range 0 .. size-1, or -1 if there is no image at the mouse position
      • getPhotoIdxUnderMouse

        private int getPhotoIdxUnderMouse​(java.awt.event.MouseEvent evt)
        Returns index of the image that matches the position of the mouse event. The topmost photo is picked if multiple icons or thumbnails overlap.
        Parameters:
        evt - Mouse event
        Returns:
        Image index at mouse position, range 0 .. size-1, or -1 if there is no image at the mouse position
      • getPhotoUnderMouse

        public ImageEntry getPhotoUnderMouse​(java.awt.event.MouseEvent evt)
        Returns the image that matches the position of the mouse event. The topmost photo is picked of multiple icons or thumbnails overlap.
        Parameters:
        evt - Mouse event
        Returns:
        Image at mouse position, or null if there is no image at the mouse position
        Since:
        6392
      • registerSupportedMapMode

        public static void registerSupportedMapMode​(MapMode mapMode)
        Registers a map mode for which the functionality of this layer should be available.
        Parameters:
        mapMode - Map mode to be registered
        Since:
        6392
      • isSupportedMapMode

        private static boolean isSupportedMapMode​(MapMode mapMode)
        Determines if the functionality of this layer is available in the specified map mode. SelectAction and SelectLassoAction are supported by default, other map modes can be registered.
        Parameters:
        mapMode - Map mode to be checked
        Returns:
        true if the map mode is supported, false otherwise
      • destroy

        public void destroy()
        Description copied from class: Layer
        Called, when the layer is removed from the mapview and is going to be destroyed.

        This is because the Layer constructor cannot add itself safely as a listener to the layerlist dialog, because there may be no such dialog yet (loaded via command line parameter).

        Specified by:
        destroy in interface Destroyable
        Overrides:
        destroy in class Layer
      • startLoadThumbs

        public void startLoadThumbs()
        Start to load thumbnails.
      • stopLoadThumbs

        public void stopLoadThumbs()
        Stop to load thumbnails.

        Can be called at any time to make sure that the thumbnail loader is stopped.

      • thumbsLoaded

        public void thumbsLoaded()
        Called to signal that the loading of thumbnails has finished.

        Usually called from ThumbsLoader in another thread.

      • getImages

        public java.util.List<ImageEntrygetImages()
        Get list of images in layer.
        Returns:
        List of images in layer
      • getImageData

        public ImageData getImageData()
        Returns the image data store being used by this layer
        Returns:
        imageData
        Since:
        14590
      • getGpxData

        public GpxData getGpxData()
        Returns the associated GPX data if any.
        Returns:
        The associated GPX data or null
        Since:
        18078
      • getGpxLayer

        public GpxLayer getGpxLayer()
        Returns the associated GPX layer if any.
        Returns:
        The associated GPX layer or null
      • getFauxGpxLayer

        public GpxLayer getFauxGpxLayer()
        Returns a faux GPX layer built from the images or the associated GPX layer.
        Returns:
        A faux GPX layer or the associated GPX layer
        Since:
        14802
      • getFauxGpxData

        public GpxData getFauxGpxData()
        Returns a faux GPX data built from the images or the associated GPX layer data.
        Returns:
        A faux GPX data or the associated GPX layer data
        Since:
        18065
      • isUseThumbs

        public boolean isUseThumbs()
        Returns the current thumbnail display status. true: thumbnails are displayed, false: an icon is displayed instead of thumbnails.
        Returns:
        Current thumbnail display status
        Since:
        6392
      • setUseThumbs

        public void setUseThumbs​(boolean useThumbs)
        Enables or disables the display of thumbnails. Does not update the display.
        Parameters:
        useThumbs - New thumbnail display status
        Since:
        6392
      • getSortedImgList

        java.util.List<ImageEntrygetSortedImgList​(boolean exif,
                                                    boolean tagged,
                                                    TimeSource timeSource)
        Returns a list of images that fulfill the given criteria. Default setting is to return untagged images, but may be overwritten.
        Parameters:
        exif - also returns images with exif-gps info
        tagged - also returns tagged images
        gpsTime - use GPS Time if true, instead of Camera RTC Time
        Returns:
        matching images
        Since:
        19455 gpsTime was added