Package adams.gui.visualization.sequence
Class MathExpressionOverlayPaintlet
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.core.AbstractPaintlet
-
- adams.gui.visualization.core.AbstractStrokePaintlet
-
- adams.gui.visualization.sequence.AbstractXYSequencePaintlet
-
- adams.gui.visualization.sequence.MathExpressionOverlayPaintlet
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<Paintlet>,SizeOfHandler,Paintlet,HitDetectorSupporter<AbstractXYSequencePointHitDetector>,PaintletWithOptionalPointPreprocessor,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 Summary
Fields Modifier and Type Field Description protected Colorm_Colorthe color for the overlay.protected MathematicalExpressionTextm_Expressionthe expression to evaluate.protected intm_NumPointsthe number of data points to generate.protected PaintletWithCustomDataSupportm_Paintletthe paintlet to use for painting the data points.-
Fields inherited from class adams.gui.visualization.sequence.AbstractXYSequencePaintlet
m_CustomerContainerManager, m_HitDetector, m_PointPreprocessor
-
Fields inherited from class adams.gui.visualization.core.AbstractStrokePaintlet
m_StrokeThickness
-
Fields inherited from class adams.gui.visualization.core.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
-
-
Constructor Summary
Constructors Constructor Description MathExpressionOverlayPaintlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcolorTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected voiddoPerformPaint(Graphics g, PaintEvent.PaintMoment moment)The paint routine of the paintlet.StringexpressionTipText()Returns the tip text for this property.ColorgetColor()Get the stroke color for the paintlet.MathematicalExpressionTextgetExpression()Returns the expression to use for generating the Y values.intgetNumPoints()Returns the number of points to generate.PaintletWithCustomDataSupportgetPaintlet()Returns the paintlet to use for painting the generated data points.PaintEvent.PaintMomentgetPaintMoment()Returns when this paintlet is to be executed.StringglobalInfo()Returns a string describing the object.AbstractXYSequencePointHitDetectornewHitDetector()Returns a new instance of the hit detector to use.StringnumPointsTipText()Returns the tip text for this property.StringpaintletTipText()Returns the tip text for this property.voidsetColor(Color value)Set the stroke color for the paintlet.voidsetExpression(MathematicalExpressionText value)Sets the expression to use for generating the Y values.voidsetNumPoints(int value)Sets the number of points to generate.voidsetPaintlet(PaintletWithCustomDataSupport value)Sets the paintlet to use for painting the generated data points.-
Methods inherited from class adams.gui.visualization.sequence.AbstractXYSequencePaintlet
getActualContainerManager, getColor, getCustomerContainerManager, getHitDetector, getPointPreprocessor, getSequencePanel, initialize, memberChanged, newPointPreprocessor, pointPreprocessorTipText, setCustomContainerManager, setLoggingLevel, setPanel, setPointPreprocessor, supportsPointPreprocessor, updateHitDetector
-
Methods inherited from class adams.gui.visualization.core.AbstractStrokePaintlet
applyStroke, getStrokeThickness, getStrokeWidth, performPaint, setStrokeThickness, strokeThicknessTipText
-
Methods inherited from class adams.gui.visualization.core.AbstractPaintlet
canPaint, finishInit, forCommandLine, forName, getPaintlets, getPanel, getPlot, getRepaintOnChange, hasPanel, isEnabled, isInitializing, memberChanged, paint, repaint, setEnabled, setPanel, setRepaintOnChange, shallowCopy, shallowCopy, updatePanel
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, getDefaultLoggingLevel, getOptionManager, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.gui.visualization.core.Paintlet
canPaint, getPanel, getPlot, getRepaintOnChange, hasPanel, isEnabled, paint, performPaint, setEnabled, setPanel, setRepaintOnChange
-
Methods inherited from interface adams.core.ShallowCopySupporter
shallowCopy, shallowCopy
-
-
-
-
Field Detail
-
m_Expression
protected MathematicalExpressionText m_Expression
the expression to evaluate.
-
m_NumPoints
protected int m_NumPoints
the number of data points to generate.
-
m_Paintlet
protected PaintletWithCustomDataSupport m_Paintlet
the paintlet to use for painting the data points.
-
m_Color
protected Color m_Color
the color for the overlay.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractXYSequencePaintlet
-
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.
-
getPaintMoment
public PaintEvent.PaintMoment getPaintMoment()
Returns when this paintlet is to be executed.- Specified by:
getPaintMomentin interfacePaintlet- Overrides:
getPaintMomentin classAbstractXYSequencePaintlet- Returns:
- when this paintlet is to be executed
-
newHitDetector
public AbstractXYSequencePointHitDetector newHitDetector()
Returns a new instance of the hit detector to use.- Specified by:
newHitDetectorin interfaceXYSequencePaintlet- Specified by:
newHitDetectorin classAbstractXYSequencePaintlet- Returns:
- always null
-
doPerformPaint
protected void doPerformPaint(Graphics g, PaintEvent.PaintMoment moment)
The paint routine of the paintlet.- Specified by:
doPerformPaintin classAbstractStrokePaintlet- Parameters:
g- the graphics context to use for paintingmoment- whatPaintEvent.PaintMomentis currently being painted
-
-