public class DefaultTextWrapper
extends java.lang.Object
DefaultTextWrapper
class is used by DefaultTextCellRenderer
as a container for text and its properties.Modifier and Type | Field and Description |
---|---|
static java.awt.Color |
DEFAULT_BACKGROUND_COLOR |
static java.awt.Color |
DEFAULT_COLOR |
static java.awt.Font |
DEFAULT_FONT |
static int |
DEFAULT_HORIZONTAL_ALIGN |
static int |
DEFAULT_VERTICAL_ALIGN |
Constructor and Description |
---|
DefaultTextWrapper(java.lang.String text)
Constructs a
DefaultTextWrapper with the specified text |
DefaultTextWrapper(java.lang.String text,
java.awt.Color color)
Constructs a
DefaultTextWrapper with the specified text and text color. |
DefaultTextWrapper(java.lang.String text,
java.awt.Color color,
java.awt.Color backgroundColor)
Constructs a
DefaultTextWrapper with the specified text, text color and background text color. |
DefaultTextWrapper(java.lang.String text,
java.awt.Color color,
java.awt.Color backgroundColor,
java.awt.Font font)
Constructs a
DefaultTextWrapper with the specified text, text color, background text color and font. |
DefaultTextWrapper(java.lang.String text,
java.awt.Color color,
java.awt.Color backgroundColor,
java.awt.Font font,
int hAlign,
int vAlign)
Constructs a
DefaultTextWrapper with the specified text, text color, background text color, font,
horizontal alignment and vertical alignment. |
DefaultTextWrapper(java.lang.String text,
java.awt.Color color,
java.awt.Font font)
Constructs a
DefaultTextWrapper with the specified text, text color, font,
horizontal alignment and vertical alignment. |
DefaultTextWrapper(java.lang.String text,
java.awt.Font font)
Constructs a
DefaultTextWrapper with the specified text and font. |
DefaultTextWrapper(java.lang.String text,
int hAlign,
int vAlign)
Constructs a
DefaultTextWrapper with the specified text, horizontal alignment and vertical alignment. |
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getBackgroundColor()
Returns background color of the text that holds by this wrapper.
|
java.awt.Color |
getColor()
Returns color of the text that holds by this wrapper.
|
java.awt.Font |
getFont()
Returns font of the text that holds by this wrapper.
|
int |
getHorizontalAlignment()
Returns the alignment of the wrapper's contents along the X axis.
|
java.lang.String |
getText()
Returns text that holds by this wrapper.
|
int |
getVerticalAlignment()
Returns the alignment of the wrapper's contents along the Y axis.
|
void |
setBackgroundColor(java.awt.Color backgroundColor)
Specifies background color of the text that holds by this wrapper.
|
void |
setColor(java.awt.Color color)
Specifies color of the text that holds by this wrapper.
|
void |
setFont(java.awt.Font font)
Specifies font of the text that holds by this wrapper.
|
void |
setHorizontalAlign(int hAlign)
Specifies the alignment of the wrapper's contents along the Y axis.
|
void |
setText(java.lang.String text)
Specifies text that holds by this wrapper.
|
void |
setVerticalAlign(int vAlign)
Specifies the alignment of the wrapper's contents along the Y axis.
|
public static final java.awt.Color DEFAULT_COLOR
public static final java.awt.Color DEFAULT_BACKGROUND_COLOR
public static final java.awt.Font DEFAULT_FONT
public static final int DEFAULT_HORIZONTAL_ALIGN
public static final int DEFAULT_VERTICAL_ALIGN
public DefaultTextWrapper(java.lang.String text, java.awt.Color color, java.awt.Color backgroundColor, java.awt.Font font, int hAlign, int vAlign)
DefaultTextWrapper
with the specified text, text color, background text color, font,
horizontal alignment and vertical alignment.text
- text to be displayed by the DefaultTextWrapper
's renderercolor
- text colorbackgroundColor
- background text colorfont
- text fonthAlign
- horizontal text alignmentvAlign
- vertical text alignmentpublic DefaultTextWrapper(java.lang.String text)
DefaultTextWrapper
with the specified texttext
- text to be displayed by the DefaultTextWrapper
's rendererpublic DefaultTextWrapper(java.lang.String text, java.awt.Color color)
DefaultTextWrapper
with the specified text and text color.text
- text to be displayed by the DefaultTextWrapper
's renderercolor
- text colorpublic DefaultTextWrapper(java.lang.String text, java.awt.Color color, java.awt.Color backgroundColor)
DefaultTextWrapper
with the specified text, text color and background text color.text
- text to be displayed by the DefaultTextWrapper
's renderercolor
- text colorbackgroundColor
- background text colorpublic DefaultTextWrapper(java.lang.String text, java.awt.Font font)
DefaultTextWrapper
with the specified text and font.text
- text to be displayed by the DefaultTextWrapper
's rendererfont
- text fontpublic DefaultTextWrapper(java.lang.String text, java.awt.Color color, java.awt.Font font)
DefaultTextWrapper
with the specified text, text color, font,
horizontal alignment and vertical alignment.text
- text to be displayed by the DefaultTextWrapper
's renderercolor
- text colorfont
- text fontpublic DefaultTextWrapper(java.lang.String text, java.awt.Color color, java.awt.Color backgroundColor, java.awt.Font font)
DefaultTextWrapper
with the specified text, text color, background text color and font.text
- text to be displayed by the DefaultTextWrapper
's renderercolor
- text colorbackgroundColor
- background text colorfont
- text fontpublic DefaultTextWrapper(java.lang.String text, int hAlign, int vAlign)
DefaultTextWrapper
with the specified text, horizontal alignment and vertical alignment.text
- text to be displayed by the DefaultTextWrapper
's rendererhAlign
- horizontal text alignmentvAlign
- vertical text alignmentpublic java.lang.String getText()
public void setText(java.lang.String text)
text
- that holds by this wrapperpublic java.awt.Color getColor()
public void setColor(java.awt.Color color)
color
- color of the text that holds by this wrapperpublic java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color backgroundColor)
backgroundColor
- background color of the text that holds by this wrapperpublic java.awt.Font getFont()
public void setFont(java.awt.Font font)
font
- font of the text that holds by this wrapperpublic int getHorizontalAlignment()
SwingConstants
:
LEFT
,
CENTER
,
RIGHT
,
LEADING
or
TRAILING
.public void setHorizontalAlign(int hAlign)
hAlign
- one of the following constants
defined in SwingConstants
:
LEFT
,
CENTER
(the default),
RIGHT
,
LEADING
or
TRAILING
.public int getVerticalAlignment()
SwingConstants
:
TOP
,
CENTER
, or
BOTTOM
.public void setVerticalAlign(int vAlign)
vAlign
- one of the following constants
defined in SwingConstants
:
TOP
,
CENTER
(the default), or
BOTTOM
.