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 Actor
m_Actor
the actor that this paintlet belongs to.protected Color
m_Color
the color for the text.protected String
m_Text
the text to paint.protected VariableName
m_TextVariable
the variable with the text to paint.protected int
m_X
the X position.protected int
m_Y
the 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 String
colorTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.Actor
getActor()
Returns the owning actor.Color
getColor()
Get the stroke color for the text.PaintEvent.PaintMoment
getPaintMoment()
Returns when this paintlet is to be executed.String
getText()
Returns the text to paint.VariableName
getTextVariable()
Returns the variable containing the text to paint.int
getX()
Returns the X position in pixels.int
getY()
Returns the Y position in pixels.String
globalInfo()
Returns a string describing the object.protected void
initialize()
Initializes the members.void
performPaint(Graphics g, PaintEvent.PaintMoment moment)
The paint routine of the paintlet.void
setActor(Actor actor)
Sets the owning actor.void
setColor(Color value)
Set the stroke color for the text.void
setText(String value)
Sets the text to paint.void
setTextVariable(VariableName value)
Sets the variable containing the text to paint.void
setX(int value)
Sets the X position in pixels.void
setY(int value)
Sets the Y position in pixels.String
textTipText()
Returns the tip text for this property.String
textVariableTipText()
Returns the tip text for this property.String
XTipText()
Returns the tip text for this property.String
YTipText()
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:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractPaintlet
-
setActor
public void setActor(Actor actor)
Sets the owning actor.- Specified by:
setActor
in interfaceFlowAwarePaintlet
- Parameters:
actor
- the actor this paintlet belongs to
-
getActor
public Actor getActor()
Returns the owning actor.- Specified by:
getActor
in 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:
getPaintMoment
in interfacePaintlet
- Specified by:
getPaintMoment
in 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:
performPaint
in interfacePaintlet
- Specified by:
performPaint
in classAbstractPaintlet
- Parameters:
g
- the graphics context to use for paintingmoment
- whatPaintEvent.PaintMoment
is currently being painted
-
-