Package adams.gui.visualization.core
Class TextOverlayPaintlet
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.core.AbstractPaintlet
-
- adams.gui.visualization.core.TextOverlayPaintlet
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,ShallowCopySupporter<Paintlet>,SizeOfHandler,FlowAwarePaintlet,Paintlet,Serializable
- Direct Known Subclasses:
TextOverlayPaintlet
public class TextOverlayPaintlet extends AbstractPaintlet implements FlowAwarePaintlet
Simply paints the specified text at a certain location.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Actorm_Actorthe actor that this paintlet belongs to.protected Colorm_Colorthe color for the text.protected Stringm_Textthe text to paint.protected VariableNamem_TextVariablethe variable with the text to paint.protected intm_Xthe X position.protected intm_Ythe Y position.-
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 TextOverlayPaintlet()
-
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.ActorgetActor()Returns the owning actor.ColorgetColor()Get the stroke color for the text.PaintEvent.PaintMomentgetPaintMoment()Returns when this paintlet is to be executed.StringgetText()Returns the text to paint.VariableNamegetTextVariable()Returns the variable containing the text to paint.intgetX()Returns the X position in pixels.intgetY()Returns the Y position in pixels.StringglobalInfo()Returns a string describing the object.protected voidinitialize()Initializes the members.voidperformPaint(Graphics g, PaintEvent.PaintMoment moment)The paint routine of the paintlet.voidsetActor(Actor actor)Sets the owning actor.voidsetColor(Color value)Set the stroke color for the text.voidsetText(String value)Sets the text to paint.voidsetTextVariable(VariableName value)Sets the variable containing the text to paint.voidsetX(int value)Sets the X position in pixels.voidsetY(int value)Sets the Y position in pixels.StringtextTipText()Returns the tip text for this property.StringtextVariableTipText()Returns the tip text for this property.StringXTipText()Returns the tip text for this property.StringYTipText()Returns the tip text for this property.-
Methods inherited from class adams.gui.visualization.core.AbstractPaintlet
canPaint, finishInit, forCommandLine, forName, getPaintlets, getPanel, getPlot, getRepaintOnChange, hasPanel, 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, 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
-
Methods inherited from interface adams.gui.visualization.core.Paintlet
canPaint, getPanel, getPlot, getRepaintOnChange, hasPanel, isEnabled, paint, setEnabled, setPanel, setPanel, setRepaintOnChange
-
Methods inherited from interface adams.core.ShallowCopySupporter
shallowCopy, shallowCopy
-
-
-
-
Field Detail
-
m_Actor
protected Actor m_Actor
the actor that this paintlet belongs to.
-
m_Text
protected String m_Text
the text to paint.
-
m_TextVariable
protected VariableName m_TextVariable
the variable with the text to paint.
-
m_X
protected int m_X
the X position.
-
m_Y
protected int m_Y
the Y position.
-
m_Color
protected Color m_Color
the color for the text.
-
-
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 classAbstractOptionHandler
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractPaintlet
-
setActor
public void setActor(Actor actor)
Sets the owning actor.- Specified by:
setActorin interfaceFlowAwarePaintlet- Parameters:
actor- the actor this paintlet belongs to
-
getActor
public Actor getActor()
Returns the owning actor.- Specified by:
getActorin interfaceFlowAwarePaintlet- Returns:
- the actor this paintlet belongs to, null if none set
-
setText
public void setText(String value)
Sets the text to paint.- Parameters:
value- the text
-
getText
public String getText()
Returns the text to paint.- Returns:
- the text
-
textTipText
public String textTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setTextVariable
public void setTextVariable(VariableName value)
Sets the variable containing the text to paint.- Parameters:
value- the variable
-
getTextVariable
public VariableName getTextVariable()
Returns the variable containing the text to paint.- Returns:
- the variable
-
textVariableTipText
public String textVariableTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setX
public void setX(int value)
Sets the X position in pixels.- Parameters:
value- the position
-
getX
public int getX()
Returns the X position in pixels.- Returns:
- the position
-
XTipText
public String XTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setY
public void setY(int value)
Sets the Y position in pixels.- Parameters:
value- the position
-
getY
public int getY()
Returns the Y position in pixels.- Returns:
- the position
-
YTipText
public String YTipText()
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 text.- Parameters:
value- color of the text
-
getColor
public Color getColor()
Get the stroke color for the text.- Returns:
- color of the text
-
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- Specified by:
getPaintMomentin classAbstractPaintlet- Returns:
- when this paintlet is to be executed
-
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
-
-