Class TextPainter
java.lang.Object
com.codename1.ui.scene.TextPainter
- All Implemented Interfaces:
NodePainter
A painter for painting text into a Node.
-
Constructor Summary
ConstructorsConstructorDescriptionTextPainter(String text, int valign) Creates a new TextPainter with the given text and vertical alignment. -
Method Summary
-
Constructor Details
-
TextPainter
Creates a new TextPainter with the given text and vertical alignment.
Parameters
-
text: The text to paint. -
valign: The vertical alignment of the text. One ofComponent#CENTER,Component#TOP,Component#BOTTOM.
-
-
-
Method Details
-
paint
Paints the text onto the provided graphics context.
Parameters
-
g: The graphics to paint onto. -
bounds: The bounding rect. -
node: The node whose content we are painting.
- Specified by:
paintin interfaceNodePainter
-
-
getText
The text of this painter.
Returns
the text
-
setText
Sets the text of this painter
Parameters
text: 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: the vAlign to set
-