tapestry.support.swing
Class TLine
java.lang.Object
|
+--tapestry.support.swing.TAnimator
|
+--tapestry.support.swing.TDrawable
|
+--tapestry.support.swing.TLine
- public class TLine
- extends TDrawable
A class that is a line segment.
Coordinates for a line are as you would expect from
cartesian geometry. (0,0) represents the center of
container in which the Line 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 |
TLine(int x1,
int y1,
int x2,
int y2)
Creates a new TLine segment from position (x1, y1) to
position (x2, y2). |
TLine(java.awt.Point center,
java.awt.Dimension size)
Creates a new TLine segment centered at center with
size size. |
TLine(java.awt.Point center,
int size)
Creates a new TLine segment centered at center with
size size. |
TLine(java.awt.Point start,
java.awt.Point end)
Creates a new TLine segment from point start to
point end. |
Method Summary |
void |
drawFeature(java.awt.Graphics g,
boolean isFilled)
|
java.awt.Dimension |
getSize()
Returns the shape's size. |
void |
setSize(int width,
int height)
Sets the shape's size. |
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 |
TLine
public TLine(int x1,
int y1,
int x2,
int y2)
- Creates a new TLine segment from position (x1, y1) to
position (x2, y2).
- Parameters:
x1
- starting x coordinate of liney1
- starting y coordinate of linex2
- ending x coordinate of liney2
- ending y coordinate of line
TLine
public TLine(java.awt.Point start,
java.awt.Point end)
- Creates a new TLine segment from point start to
point end.
- Parameters:
start
- starting point of lineend
- ending point of line
TLine
public TLine(java.awt.Point center,
java.awt.Dimension size)
- Creates a new TLine segment centered at center with
size size.
- Parameters:
center
- center point of linesize
- size of line
TLine
public TLine(java.awt.Point center,
int size)
- Creates a new TLine segment centered at center with
size size.
- Parameters:
center
- center point of linesize
- size of line
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
drawFeature
public void drawFeature(java.awt.Graphics g,
boolean isFilled)
- Overrides:
- drawFeature in class TDrawable