Class MapNavLayer

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.event.ChangeListener, Layer, ShapeDrawingLayer, PropertySupport

    public class MapNavLayer
    extends BasicLayer
    implements ShapeDrawingLayer, javax.swing.event.ChangeListener, java.beans.PropertyChangeListener
    MapNavLayer renders and handles the events for the Navigation Panel that includes a panning dial, zoom buttons, and if a tile layer is present, a zoom slider
    • Field Detail

      • ENABLED_BLUE

        public static final java.awt.Color ENABLED_BLUE
      • MOUSEOVER_BLUE

        public static final java.awt.Color MOUSEOVER_BLUE
    • Constructor Detail

      • MapNavLayer

        public MapNavLayer​(MapCanvas parent)
    • Method Detail

      • setCanvas

        public void setCanvas​(MapCanvas canvas)
        Description copied from interface: Layer
        Sets the map canvas on which this layer is displayed.
        Specified by:
        setCanvas in interface Layer
        Overrides:
        setCanvas in class BasicLayer
      • propertyChange

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

        public void stateChanged​(javax.swing.event.ChangeEvent evt)
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
      • mapRegionChanged

        public void mapRegionChanged​(MapRegionEvent e)
        Description copied from interface: Layer
        When the associated canvas's map region is changed, this method is called to notify the layer of the change. Note that either a device window change (as a result of resizing the application window) or a data window change can cause this method to be invoked. Query the canvas' MapRegion object to get the changed values. Inside a mapRegionChanged() implementation, the layer typically needs to update its data contents accordingly.
        Specified by:
        mapRegionChanged in interface Layer
        Overrides:
        mapRegionChanged in class BasicLayer
      • handleEvent

        public boolean handleEvent​(java.util.EventObject evt)
        Description copied from interface: Layer
        The main method that performs event handling for this tool. Returns whether the event should be propagated to other layers down stream (further down the layer stack) after the event has been handled.
        Specified by:
        handleEvent in interface Layer
        Overrides:
        handleEvent in class BasicLayer
      • render

        public long render​(java.awt.Graphics2D g)
        Description copied from interface: Layer
        Renders the layer contents to the given Graphics.
        Specified by:
        render in interface Layer
        Overrides:
        render in class BasicLayer
        Parameters:
        g - the graphics object
        Returns:
        the rendering time in milliseconds.
      • shapeCompleted

        public void shapeCompleted​(java.awt.event.MouseEvent e)
        Description copied from interface: ShapeDrawingLayer
        To be called when the shape is completely drawn
        Specified by:
        shapeCompleted in interface ShapeDrawingLayer
      • getSnapPoint

        public java.awt.geom.Point2D getSnapPoint​(java.awt.geom.Point2D point)
        Description copied from interface: ShapeDrawingLayer
        Gets the shape snap point closest to the given point
        Specified by:
        getSnapPoint in interface ShapeDrawingLayer
        Returns:
      • setSliderEnabled

        public void setSliderEnabled​(boolean enabled)
      • getSliderEnabled

        public boolean getSliderEnabled()
      • setNumTicks

        public void setNumTicks​(int numTicks)