Class AbstractMapOverlay

  • 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:
    AbstractPositionableMapOverlay, MultiMapOverlay, NullMapOverlay

    public abstract class AbstractMapOverlay
    extends adams.core.option.AbstractOptionHandler
    Ancestor for classes that paint an overlay on a JMapViewer.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Enabled

        protected boolean m_Enabled
        whether the overlay is enabled.
    • Constructor Detail

      • AbstractMapOverlay

        public AbstractMapOverlay()
    • 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 adams.core.option.AbstractOptionHandler
      • setEnabled

        public void setEnabled​(boolean value)
        Sets whether the overlay is enabled.
        Parameters:
        value - true if enabled
      • isEnabled

        public boolean isEnabled()
        Returns whether the overlay is enabled
        Returns:
        true if enabled
      • enabledTipText

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

        protected void prePaintOverlay​(OpenStreetMapViewer viewer,
                                       Graphics g)
        Gets executed before the actual painting.

        Default implementation does nothing.
        Parameters:
        viewer - the associated viewer
        g - the graphics context
      • doPaintOverlay

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

        protected void postPaintOverlay​(OpenStreetMapViewer viewer,
                                        Graphics g)
        Gets executed after the actual painting.

        Default implementation does nothing.
        Parameters:
        viewer - the associated viewer
        g - the graphics context
      • paintOverlay

        public void paintOverlay​(OpenStreetMapViewer viewer,
                                 Graphics g)
        Paints the overlay.
        Parameters:
        viewer - the associated viewer
        g - the graphics context