|
jET |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jet.sce.TextBox
This is a box surrounding text. It is like geometric figure.
Field Summary | |
protected java.awt.font.TextLayout |
text
The text object. |
Constructor Summary | |
TextBox(java.lang.String name,
java.awt.Font font,
java.awt.font.FontRenderContext frc)
Constructs text box at point (0, 0). |
Method Summary | |
boolean |
contains(java.awt.Rectangle r)
Determines if the text box contains given rectangle. |
void |
draw(java.awt.Graphics2D g)
Draws the text box on the graphics context. |
java.awt.Rectangle |
getBounds()
Gets the bounds of the text layout and rectangle anround it. |
java.awt.geom.Rectangle2D |
getBounds2D()
Gets the bounds of the text layout and rectangle anround it. |
java.awt.geom.Point2D |
getLocation()
Gets the location point. |
java.awt.font.TextLayout |
getText()
Gets the text layout for the text box. |
double |
getX()
Gets the X coordinate of the location. |
double |
getY()
Gets the Y coordinate of the location. |
boolean |
intersects(java.awt.Rectangle r)
Determines if the text box intersects with given rectangle. |
void |
setLocation(double x,
double y)
Sets location to the given point. |
void |
setLocation(java.awt.geom.Point2D p)
Sets location of the text box to the point. |
void |
setText(java.awt.font.TextLayout text)
Sets the text layout for the text box. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.awt.font.TextLayout text
Constructor Detail |
public TextBox(java.lang.String name, java.awt.Font font, java.awt.font.FontRenderContext frc)
name
- Track name.font
- The font.frc
- Font rendering context.Method Detail |
public void setLocation(double x, double y)
x
- X coordinate.y
- Y coordinate.public void setLocation(java.awt.geom.Point2D p)
p
- New point.public double getY()
public double getX()
public java.awt.geom.Point2D getLocation()
public void draw(java.awt.Graphics2D g)
public void setText(java.awt.font.TextLayout text)
public java.awt.font.TextLayout getText()
public boolean intersects(java.awt.Rectangle r)
r
- Rectangle to test.
True
, if this text box intersects with
given rectangle.public boolean contains(java.awt.Rectangle r)
r
- Rectangle to test.
True
, if this text box contains rectangle.public java.awt.geom.Rectangle2D getBounds2D()
public java.awt.Rectangle getBounds()
|
jET |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |