public class TextPainter

  1. Object
  2. 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

text String
The text to paint.
valign int
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

g Graphics
The graphics to paint onto.
bounds Rectangle
The bounding rect.
node Node
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

text String
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

vAlign int
the vAlign to set