public class TextPainter
- Object
- TextPainter
ImplementsNodePainter
A painter for painting text into a Node.
Constructors
public TextPainter(String text, int valign) | Creates a new TextPainter with the given text and vertical alignment. |
Methods
public void paint(Graphics g, Rectangle bounds, Node node) | Paints the text onto the provided graphics context. |
public String getText() | The text of this painter. |
public void setText(String text) | Sets the text of this painter |
public int getvAlign() | Gets the vertical alignment of this text. |
public void setvAlign(int vAlign) | Sets the vertical alignment. |
Inherited methods
Constructor details
TextPainter
public TextPainter(String text, int valign)Creates a new TextPainter with the given text and vertical alignment.
Parameters
textString- The text to paint.
valignint- The vertical alignment of the text. One of
Component#CENTER,Component#TOP,Component#BOTTOM.
Method details
paint
public void paint(Graphics g, Rectangle bounds, Node node)Paints the text onto the provided graphics context.
Parameters
gGraphics- The graphics to paint onto.
boundsRectangle- The bounding rect.
nodeNode- The node whose content we are painting.
getText
public String getText()The text of this painter.
Returns
the text
setText
public void setText(String text)Sets the text of this painter
Parameters
textString- the text to set
getvAlign
public int getvAlign()Gets the vertical alignment of this text. One of
Component#CENTER, Component#TOP, Component#BOTTOM.Returns
the vAlign
setvAlign
public void setvAlign(int vAlign)Sets the vertical alignment. One of
Component#CENTER, Component#TOP, Component#BOTTOM.Parameters
vAlignint- the vAlign to set