public class TextElement extends AbstractTableElement implements TableElement, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static java.awt.Font |
DEFAULT_FONT
The default font.
|
CLASS| Constructor and Description |
|---|
TextElement(java.lang.String text)
Creates a new element that will display the specified text using the
default font (
DEFAULT_FONT). |
TextElement(java.lang.String text,
java.awt.Font font)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds)
Draws the element within the specified bounds.
|
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds,
TableElementOnDraw onDrawHandler)
Draws the element within the specified bounds.
|
boolean |
equals(java.lang.Object obj)
Tests this element for equality with an arbitrary object.
|
java.awt.Color |
getColor() |
java.awt.Font |
getFont()
Returns the font.
|
HAlign |
getHorizontalAlignment()
Returns the horizontal alignment that will be used when rendering the
text.
|
java.util.List<java.awt.geom.Rectangle2D> |
layoutElements(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds,
java.util.Map<java.lang.String,java.lang.Object> constraints)
Performs a layout of this table element, returning a list of bounding
rectangles for the element and its subelements.
|
java.awt.geom.Dimension2D |
preferredSize(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D bounds,
java.util.Map<java.lang.String,java.lang.Object> constraints)
Returns the preferred size of the element (including insets).
|
void |
receive(TableElementVisitor visitor)
Receives a visitor.
|
void |
setColor(java.awt.Color color) |
void |
setFont(java.awt.Font font)
Sets the font.
|
void |
setHorizontalAligment(HAlign align)
Sets the horizontal alignment.
|
java.lang.String |
toString() |
getBackground, getInsets, getProperty, getRefPoint, getTag, preferredSize, setBackground, setBackgroundColor, setInsets, setProperty, setRefPoint, setTagclone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetProperty, getRefPoint, preferredSize, setPropertypublic static final java.awt.Font DEFAULT_FONT
public TextElement(java.lang.String text)
DEFAULT_FONT).text - the text (null not permitted).public TextElement(java.lang.String text, java.awt.Font font)
text - the text (null not permitted).font - the font (null not permitted).public java.awt.Font getFont()
DEFAULT_FONT.null).public void setFont(java.awt.Font font)
font - the font (null not permitted).public java.awt.Color getColor()
public void setColor(java.awt.Color color)
public HAlign getHorizontalAlignment()
LEFT.null).public void setHorizontalAligment(HAlign align)
align - the alignment (null not permitted).public java.awt.geom.Dimension2D preferredSize(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, java.util.Map<java.lang.String,java.lang.Object> constraints)
preferredSize in interface TableElementpreferredSize in class AbstractTableElementg2 - the graphics target.bounds - the bounds.constraints - the constraints (ignored for now).public java.util.List<java.awt.geom.Rectangle2D> layoutElements(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, java.util.Map<java.lang.String,java.lang.Object> constraints)
layoutElements in interface TableElementg2 - the graphics target.bounds - the bounds.constraints - the constraints (if any).public void receive(TableElementVisitor visitor)
receive in interface TableElementvisitor - the visitor (null not permitted).public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds)
draw in interface TableElementg2 - the graphics target.bounds - the bounds.public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D bounds, TableElementOnDraw onDrawHandler)
recordBounds flag is set, this element and each of its
children will have their BOUNDS_2D property updated with
the current bounds.draw in interface TableElementg2 - the graphics target (null not permitted).bounds - the bounds (null not permitted).onDrawHandler - an object that will receive notification before
and after the element is drawn (null permitted).public boolean equals(java.lang.Object obj)
equals in class AbstractTableElementobj - the object (null permitted).public java.lang.String toString()
toString in class java.lang.Object