Package adams.gui.visualization.core
Class AbstractStrokePaintlet
- 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
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<Paintlet>,SizeOfHandler,Paintlet,Serializable
- Direct Known Subclasses:
AbstractColorPaintlet,AbstractDataContainerPaintlet,AbstractErrorPaintlet,AbstractMarkerPaintlet,AbstractStrokePaintletWithContainerIDMatching,AbstractXYSequencePaintlet,CoordinatesPaintlet,CrossHairTracker,DiagonalOverlayPaintlet,HorizontalIndicatorPaintlet,KendallTheilOverlayPaintlet,StraightLineOverlayPaintlet
public abstract class AbstractStrokePaintlet extends AbstractPaintlet
Ancestor for paintlets that paint lines of some sort.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected floatm_StrokeThicknessthe thickness of the stroke.-
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 AbstractStrokePaintlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidapplyStroke(Graphics g, float stroke)Applies the stroke thickness.voiddefineOptions()Adds options to the internal list of options.protected abstract voiddoPerformPaint(Graphics g, PaintEvent.PaintMoment moment)The actual paint routine of the paintlet.floatgetStrokeThickness()Returns the current stroke thickness.protected floatgetStrokeWidth(Graphics g, float defValue)Returns the thickness of the stroke.voidperformPaint(Graphics g, PaintEvent.PaintMoment moment)The paint routine of the paintlet.voidsetStrokeThickness(float value)Sets the stroke thickness to use.StringstrokeThicknessTipText()Returns the tip text for this property.-
Methods inherited from class adams.gui.visualization.core.AbstractPaintlet
canPaint, finishInit, forCommandLine, forName, getPaintlets, getPaintMoment, getPanel, getPlot, getRepaintOnChange, hasPanel, initialize, isEnabled, isInitializing, memberChanged, memberChanged, paint, repaint, setEnabled, setPanel, setPanel, setRepaintOnChange, shallowCopy, shallowCopy, updatePanel
-
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
setStrokeThickness
public void setStrokeThickness(float value)
Sets the stroke thickness to use.- Parameters:
value- the thickness
-
strokeThicknessTipText
public String strokeThicknessTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getStrokeThickness
public float getStrokeThickness()
Returns the current stroke thickness.- Returns:
- the thickness
-
getStrokeWidth
protected float getStrokeWidth(Graphics g, float defValue)
Returns the thickness of the stroke.- Parameters:
g- graphics context to get the thickness fromdefValue- the default value to return in case of failure- Returns:
- the stroke, default value if failed to extract
-
applyStroke
protected void applyStroke(Graphics g, float stroke)
Applies the stroke thickness.- Parameters:
stroke- the thickness to apply
-
doPerformPaint
protected abstract void doPerformPaint(Graphics g, PaintEvent.PaintMoment moment)
The actual paint routine of the paintlet.- Parameters:
g- the graphics context to use for paintingmoment- whatPaintEvent.PaintMomentis currently being painted
-
performPaint
public void performPaint(Graphics g, PaintEvent.PaintMoment moment)
The paint routine of the paintlet.- Specified by:
performPaintin interfacePaintlet- Specified by:
performPaintin classAbstractPaintlet- Parameters:
g- the graphics context to use for paintingmoment- whatPaintEvent.PaintMomentis currently being painted
-
-