public class TextFormat
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
TextFormat()
Initializes a new instance of the
TextFormat class. |
TextFormat(Align horizontalAlign,
Align verticalAlign)
Initializes a new instance of the
TextFormat class. |
Modifier and Type | Method and Description |
---|---|
TextFormat |
clone()
Creates a copy of this
TextFormat . |
void |
drawText(java.lang.String text,
java.awt.Graphics2D graphics,
java.awt.Font font,
java.awt.geom.Rectangle2D bounds) |
boolean |
equals(TextFormat other)
Object.equals override. |
Align |
getHorizontalAlign()
Gets the horizontal text alignment.
|
boolean |
getNoWrap()
Gets a value indicating whether automatic text wrapping is disabled.
|
boolean |
getRightToLeft() |
Align |
getVerticalAlign()
Gets the vertical text alignment.
|
boolean |
getWrapAtCharacter()
Gets a value indicating whether text can be wrapped to a new line
at an arbitrary character, or only after a whole word.
|
boolean |
getWrapOverflowingSingleWordLines()
Gets whether a single-word line should wrap when overflowing.
|
void |
setHorizontalAlign(Align value)
Sets the horizontal text alignment.
|
void |
setNoWrap(boolean wrap)
Sets a value indicating whether automatic text wrapping is disabled.
|
void |
setRightToLeft(boolean value) |
void |
setVerticalAlign(Align value)
Sets the vertical text alignment.
|
void |
setWrapAtCharacter(boolean value)
Sets a value indicating whether text can be wrapped to a new line
at an arbitrary character, or only after a whole word.
|
void |
setWrapOverflowingSingleWordLines(boolean value)
Sets whether a single-word line should wrap when overflowing.
|
public TextFormat()
TextFormat
class.public TextFormat(Align horizontalAlign, Align verticalAlign)
TextFormat
class.public TextFormat clone()
TextFormat
.clone
in class java.lang.Object
TextFormat
object.public boolean equals(TextFormat other)
Object.equals
override.other
- The object to compare to this instance.public void setHorizontalAlign(Align value)
value
- A member of the Align
enumeration.public Align getHorizontalAlign()
Align
enumeration.public void setVerticalAlign(Align value)
value
- A member of the Align
enumeration.public Align getVerticalAlign()
Align
enumeration.public boolean getNoWrap()
If wrapping is enabled, the control automatically wraps the text to a new line when there is not enough space to fit it in one line. If automatic wrapping is disabled, the control wraps text only at new-line characters.
public void setNoWrap(boolean wrap)
If wrapping is enabled, the control automatically wraps the text to a new line when there is not enough space to fit it in one line. If automatic wrapping is disabled, the control wraps text only at new-line characters.
wrap
- true to disable text wrapping, otherwise false.public boolean getWrapAtCharacter()
public void setWrapAtCharacter(boolean value)
value
- true if text can be wrapped at an arbitrary character, otherwise false.public void setRightToLeft(boolean value)
public boolean getRightToLeft()
public boolean getWrapOverflowingSingleWordLines()
public void setWrapOverflowingSingleWordLines(boolean value)
value
- true if long word should wrap when it cannot fit on a line,
or false if it should be drawn clipped.public void drawText(java.lang.String text, java.awt.Graphics2D graphics, java.awt.Font font, java.awt.geom.Rectangle2D bounds)