tapestry.support.swing
Class TText
java.lang.Object
|
+--tapestry.support.swing.TAnimator
|
+--tapestry.support.swing.TDrawable
|
+--tapestry.support.swing.TText
- public class TText
- extends TDrawable
A class that displays text centered at location (x, y).
Coordinates for text are as you would expect from
cartesian geometry. (0,0) represents the center of
container in which the text is drawn, with x-coordinates
increasing to the right and y-coordinates increasing
to the top of the container. Coordinates are given in
pixel units.
Constructor Summary |
TText(int cx,
int cy,
java.lang.String text)
Creates a new TText centered at position (cx, cy) with
specified text. |
TText(java.awt.Point center,
java.lang.String text)
Creates a new TText centered at specified point with
specified text. |
Method Summary |
void |
drawFeature(java.awt.Graphics g,
boolean isFilled)
|
java.awt.Dimension |
getSize()
Returns the shape's size. |
java.lang.String |
getText()
Returns the shape's text. |
void |
setFont(java.awt.Font font)
Sets the font of the text. |
void |
setSize(int width,
int height)
Sets the shape's size. |
void |
setText(java.lang.String text)
Sets the shape's text. |
Methods inherited from class tapestry.support.swing.TDrawable |
act,
draw,
fill,
getCenter,
getColor,
hide,
move,
outline,
setCenter,
setCenter,
setColor,
setContainer,
setLineWidth,
show |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
TText
public TText(int cx,
int cy,
java.lang.String text)
- Creates a new TText centered at position (cx, cy) with
specified text.
- Parameters:
cx
- center x coordinate of textcy
- center y coordinate of texttext
- text to display
TText
public TText(java.awt.Point center,
java.lang.String text)
- Creates a new TText centered at specified point with
specified text.
- Parameters:
center
- center point of boxtext
- text to display
getSize
public java.awt.Dimension getSize()
- Returns the shape's size.
- Returns:
- width and height of shape
- Overrides:
- getSize in class TDrawable
setSize
public void setSize(int width,
int height)
- Sets the shape's size.
- Parameters:
width
- new width of shapeheight
- new height of shape- Overrides:
- setSize in class TDrawable
setFont
public void setFont(java.awt.Font font)
- Sets the font of the text.
- Parameters:
font
- new font for text
getText
public java.lang.String getText()
- Returns the shape's text.
- Returns:
- text of shape
setText
public void setText(java.lang.String text)
- Sets the shape's text.
- Parameters:
text
- text to display
drawFeature
public void drawFeature(java.awt.Graphics g,
boolean isFilled)
- Overrides:
- drawFeature in class TDrawable