Class AbstractPositionableMapOverlay

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, Serializable
    Direct Known Subclasses:
    AbstractPositionableMapOverlayWithDimensions, ImageMapOverlay

    public abstract class AbstractPositionableMapOverlay
    extends AbstractMapOverlay
    Ancestor for overlays that can be positioned on the viewer.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int m_X
      the X position of the overlay.
      protected int m_Y
      the Y position of the overlay.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Field Detail

      • m_X

        protected int m_X
        the X position of the overlay.
      • m_Y

        protected int m_Y
        the Y position of the overlay.
    • Constructor Detail

      • AbstractPositionableMapOverlay

        public AbstractPositionableMapOverlay()
    • Method Detail

      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class AbstractMapOverlay
      • getDefaultX

        protected int getDefaultX()
        Returns the default X position for the overlay.
        Returns:
        the default X position
      • setX

        public void setX​(int value)
        Sets the X position of the overlay.
        Parameters:
        value - the X position
      • getX

        public int getX()
        Returns the currently set X position of the overlay.
        Returns:
        the X position
      • xTipText

        public String xTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getDefaultY

        protected int getDefaultY()
        Returns the default Y position for the overlay.
        Returns:
        the default Y position
      • setY

        public void setY​(int value)
        Sets the Y position of the overlay.
        Parameters:
        value - the Y position
      • getY

        public int getY()
        Returns the currently set Y position of the overlay.
        Returns:
        the Y position
      • yTipText

        public String yTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getHeight

        protected int getHeight()
        Returns the height.
        Returns:
        the height
      • getWidth

        protected int getWidth()
        Returns the width.
        Returns:
        the width
      • doPaintOverlay

        protected abstract void doPaintOverlay​(OpenStreetMapViewer viewer,
                                               Graphics g,
                                               int x,
                                               int y)
        Performs the actual painting.
        Parameters:
        viewer - the associated viewer
        g - the graphics context
        x - the actual x coordinate
        y - the actual y coordinate
      • doPaintOverlay

        protected void doPaintOverlay​(OpenStreetMapViewer viewer,
                                      Graphics g)
        Computes the actual coordinates before doing the actual painting.
        Specified by:
        doPaintOverlay in class AbstractMapOverlay
        Parameters:
        viewer - the associated viewer
        g - the graphics context
        See Also:
        #doPaintOverlay(JMapViewer, Graphics, int, int)