Class AbstractTrailPaintlet

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.ShallowCopySupporter<adams.gui.visualization.image.paintlet.Paintlet>, adams.core.SizeOfHandler, adams.gui.visualization.image.paintlet.Paintlet, TrailPaintlet, Serializable
    Direct Known Subclasses:
    Circles, Lines

    public abstract class AbstractTrailPaintlet
    extends adams.gui.visualization.image.paintlet.AbstractPaintlet
    implements TrailPaintlet
    Ancestor for trail paintlets.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Color m_Color
      Color of the stroke for the paintlet
      protected TrailPanel m_TrailPanel
      the trail panel.
      • Fields inherited from class adams.gui.visualization.image.paintlet.AbstractPaintlet

        m_Enabled, m_Initializing, m_Panel, m_RepaintOnChange
      • Fields inherited from class adams.core.option.AbstractOptionHandler

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

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      String colorTipText()
      Returns the tip text for this property.
      void defineOptions()
      Adds options to the internal list of options.
      static TrailPaintlet forCommandLine​(String cmdline)
      Instantiates the paintlet from the given commandline (i.e., classname and optional options).
      static TrailPaintlet forName​(String classname, String[] options)
      Instantiates the paintlet with the given options.
      Color getColor()
      Get the stroke color for the paintlet.
      protected Color getDefaultColor()
      Returns the default color for the stroke.
      static String[] getPaintlets()
      Returns a list with classnames of paintlets.
      TrailPanel getTrailPanel()
      Returns the underlying trail panel.
      protected void initialize()
      Initializes the members.
      abstract void paintData​(Graphics g, Trail trail)
      Paints the given data.
      protected void performPaint​(Graphics g)
      The paint routine of the paintlet.
      void setColor​(Color value)
      Set the stroke color for the paintlet.
      void setPanel​(TrailPanel value)
      Sets the panel to use, null to disable painting.
      • Methods inherited from class adams.gui.visualization.image.paintlet.AbstractPaintlet

        finishInit, getPaintPanel, getPanel, getPlot, getRepaintOnChange, hasPanel, isEnabled, isInitializing, memberChanged, memberChanged, paint, repaint, setEnabled, setPanel, setPanel, setRepaintOnChange, shallowCopy, shallowCopy
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
      • Methods inherited from interface adams.gui.visualization.image.paintlet.Paintlet

        getPaintPanel, getPanel, getRepaintOnChange, hasPanel, isEnabled, paint, setEnabled, setPanel, setPanel, setRepaintOnChange
      • Methods inherited from interface adams.core.ShallowCopySupporter

        shallowCopy, shallowCopy
    • Field Detail

      • m_TrailPanel

        protected TrailPanel m_TrailPanel
        the trail panel.
      • m_Color

        protected Color m_Color
        Color of the stroke for the paintlet
    • Constructor Detail

      • AbstractTrailPaintlet

        public AbstractTrailPaintlet()
    • 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
      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.gui.visualization.image.paintlet.AbstractPaintlet
      • getDefaultColor

        protected Color getDefaultColor()
        Returns the default color for the stroke.
        Returns:
        the default
      • getColor

        public Color getColor()
        Get the stroke color for the paintlet.
        Returns:
        Color of the stroke
      • setColor

        public void setColor​(Color value)
        Set the stroke color for the paintlet.
        Parameters:
        value - Color of the stroke
      • colorTipText

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

        public void setPanel​(TrailPanel value)
        Sets the panel to use, null to disable painting.
        Specified by:
        setPanel in interface TrailPaintlet
        Parameters:
        value - the panel to paint on
      • getTrailPanel

        public TrailPanel getTrailPanel()
        Returns the underlying trail panel.
        Specified by:
        getTrailPanel in interface TrailPaintlet
        Returns:
        the panel, null if not set
      • paintData

        public abstract void paintData​(Graphics g,
                                       Trail trail)
        Paints the given data.
        Specified by:
        paintData in interface TrailPaintlet
        Parameters:
        g - the graphics context to use for painting
        trail - the data to paint
      • performPaint

        protected void performPaint​(Graphics g)
        The paint routine of the paintlet.
        Specified by:
        performPaint in class adams.gui.visualization.image.paintlet.AbstractPaintlet
        Parameters:
        g - the graphics context to use for painting
      • getPaintlets

        public static String[] getPaintlets()
        Returns a list with classnames of paintlets.
        Returns:
        the paintlet classnames
      • forName

        public static TrailPaintlet forName​(String classname,
                                            String[] options)
        Instantiates the paintlet with the given options.
        Parameters:
        classname - the classname of the paintlet to instantiate
        options - the options for the paintlet
        Returns:
        the instantiated paintlet or null if an error occurred
      • forCommandLine

        public static TrailPaintlet forCommandLine​(String cmdline)
        Instantiates the paintlet from the given commandline (i.e., classname and optional options).
        Parameters:
        cmdline - the classname (and optional options) of the paintlet to instantiate
        Returns:
        the instantiated paintlet or null if an error occurred