Class SimpleBGLayer

  • All Implemented Interfaces:
    Layer, PropertySupport

    public class SimpleBGLayer
    extends BasicLayer
    A background layer that sits at the bottom of layer stack, and intercepts primarily mouse wheel zooming and mouse panning events.
    • Field Detail

      • PROPERTY_BACKGROUND

        public static final java.lang.String PROPERTY_BACKGROUND
        See Also:
        Constant Field Values
      • lastPoint

        protected java.awt.geom.Point2D lastPoint
    • Constructor Detail

      • SimpleBGLayer

        public SimpleBGLayer​(MapCanvas canvas)
    • Method Detail

      • 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.
      • update

        public void update​(long elapsedTime)
        Description copied from interface: Layer
        updates the contents data model or structure.
        Specified by:
        update in interface Layer
        Overrides:
        update in class BasicLayer
        Parameters:
        elapsedTime - The elapsed time since last update.
      • getBackground

        public java.awt.Color getBackground()
        Returns the background color
        Returns:
      • setBackground

        public void setBackground​(java.awt.Color background)
        Sets the background color
        Parameters:
        background -
      • getBorderColor

        public java.awt.Color getBorderColor()
        Returns the border color
        Returns:
      • setBorderColor

        public void setBorderColor​(java.awt.Color borderColor)
        Sets the border color
        Parameters:
        borderColor -