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
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
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
-