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.


Fields inherited from class tapestry.support.swing.TAnimator
DEFAULT_DELAY
 
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 tapestry.support.swing.TAnimator
actionPerformed, dispose, getContainer, getCount, getDelay, init, isRunning, setDelay, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 line
y1 - starting y coordinate of line
x2 - ending x coordinate of line
y2 - 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 line
end - 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 line
size - 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 line
size - size of line
Method Detail

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 shape
height - new height of shape
Overrides:
setSize in class TDrawable

drawFeature

public void drawFeature(java.awt.Graphics g,
                        boolean isFilled)
Overrides:
drawFeature in class TDrawable