tapestry.support.swing
Class TArc

java.lang.Object
  |
  +--tapestry.support.swing.TAnimator
        |
        +--tapestry.support.swing.TDrawable
              |
              +--tapestry.support.swing.TArc

public class TArc
extends TDrawable

A TArc class is a 2D arc defined by a bounding rectangle, start angle, and angular extent (length of the arc).

The bounding rectangle defines the outer boundary of the full ellipse of which this arc is a partial section. The angles are specified relative to the non-square extents of the bounding rectangle such that 45 degrees always falls on the line from the center of the ellipse to the upper right corner of the bounding rectangle.

Coordinates for a arc are as you would expect from cartesian geometry. (0,0) represents the center of container in which the Arc 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
TArc(int cx, int cy, int width, int height, int start, int extent)
          Creates a new TArc centered at position (cx, cy) with specified width and height, whose curve starts at start and continues for extent degrees.
TArc(java.awt.Point center, java.awt.Dimension size, int start, int extent)
          Creates a new TArc centered at position center with specified size, whose curve starts at start and continues for extent degrees.
 
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

TArc

public TArc(int cx,
            int cy,
            int width,
            int height,
            int start,
            int extent)
Creates a new TArc centered at position (cx, cy) with specified width and height, whose curve starts at start and continues for extent degrees.
Parameters:
cx - center x coordinate of arc's enclosing box
cy - center y coordinate of arc's enclosing box
width - width of rectangular box enclosing arc
height - height of rectangular box enclosing arc
start - starting angle of arc's curve
extent - length of arc's curve in degrees

TArc

public TArc(java.awt.Point center,
            java.awt.Dimension size,
            int start,
            int extent)
Creates a new TArc centered at position center with specified size, whose curve starts at start and continues for extent degrees.
Parameters:
center - center point of arc's enclosing box
size - size of rectangular box enclosing arc
start - starting angle of arc's curve
extent - length of arc's curve in degrees
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