Class MathExpressionOverlayPaintlet

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, ShallowCopySupporter<Paintlet>, SizeOfHandler, Paintlet, HitDetectorSupporter<AbstractXYSequencePointHitDetector>, XYSequencePaintlet, XYSequencePaintletWithCustomerContainerManager, Serializable

    public class MathExpressionOverlayPaintlet
    extends AbstractXYSequencePaintlet
    Calculates data points using the provided mathematical expression and paints them using the specified paintlet.
    If the expression generates a NaN ('not a number') the x/y pair gets ignored.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -stroke-thickness <float> (property: strokeThickness)
        The thickness of the stroke.
        default: 1.0
        minimum: 0.01
     
    -expression <adams.parser.MathematicalExpressionText> (property: expression)
        The mathematical expression to use for generating the Y values; use 'X' 
        as the current data point on the X axis in your expression.
        default: X
     
    -num-points <int> (property: numPoints)
        The number of data points to generate for the overlay.
        default: 100
        minimum: 1
     
    -paintlet <adams.gui.visualization.sequence.PaintletWithCustomDataSupport> (property: paintlet)
        The paintlet to use for painting the generated data points.
        default: adams.gui.visualization.sequence.LinePaintlet
     
    -color <java.awt.Color> (property: color)
        The color for the line.
        default: #000000
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_NumPoints

        protected int m_NumPoints
        the number of data points to generate.
      • m_Color

        protected Color m_Color
        the color for the overlay.
    • Constructor Detail

      • MathExpressionOverlayPaintlet

        public MathExpressionOverlayPaintlet()
    • Method Detail

      • setExpression

        public void setExpression​(MathematicalExpressionText value)
        Sets the expression to use for generating the Y values.
        Parameters:
        value - the expression
      • getExpression

        public MathematicalExpressionText getExpression()
        Returns the expression to use for generating the Y values.
        Returns:
        the expression
      • expressionTipText

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

        public void setNumPoints​(int value)
        Sets the number of points to generate.
        Parameters:
        value - the number of points
      • getNumPoints

        public int getNumPoints()
        Returns the number of points to generate.
        Returns:
        the number of points
      • numPointsTipText

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

        public void setPaintlet​(PaintletWithCustomDataSupport value)
        Sets the paintlet to use for painting the generated data points.
        Parameters:
        value - the paintlet
      • getPaintlet

        public PaintletWithCustomDataSupport getPaintlet()
        Returns the paintlet to use for painting the generated data points.
        Returns:
        the paintlet
      • paintletTipText

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

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

        public Color getColor()
        Get the stroke color for the paintlet.
        Returns:
        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.