data
Class Shape

java.lang.Object
  extended bydata.Shape

public class Shape
extends Object

This class represents a shape, that consists of some amount of Curves. It has a name, a position in its group, and a multiplier that defines the relative size of its own coordinate system. Its own coordinate system is like a normal math one, allowing negative values and having the positive side of the axes up and to the right. The position of the shape identifies the origin of its coordinate system. The multiplier "zooms in" on the curves, changing it will make them appear larger or smaller. For example you could set it to 10, which means that 10 pixels is 1 unit of the Shape coordinate system. This way small Bezier curves with calculated coordinates that are inbetween integer values (they are doubles) can be shown correctly on screens (cause they use pixels).

Since:
1.00
Version:
1.10
Author:
Berend "Kirk" Wouda

Field Summary
protected  ArrayList curvelist
          The List of Curves in this Shape.
protected  double multiplier
          The multiplier for this Shape's coordinate system.
protected  String name
          The name of this Shape.
protected  int x
          The horizontal position of this Shape in Group coordinates.
protected  int y
          The vertical position of this Shape in Group coordinates.
 
Constructor Summary
Shape(String name, int x, int y, double multiplier)
          Constructs a Shape with the given attributes.
 
Method Summary
 void addCurve(Curve curve)
          Adds the given Curve to this Shape.
 Curve getCurve(int index)
          Returns the Curve at index.
 double getMultiplier()
          Returns the multiplier of this Shape.
 String getName()
          Returns the name of this Shape.
 int getNumberOfCurves()
          Returns the number of Curves in this Shape.
 int getX()
          Returns the horizontal position of this Shape.
 int getY()
          Returns the vertical position of this Shape.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name
The name of this Shape.


x

protected int x
The horizontal position of this Shape in Group coordinates.


y

protected int y
The vertical position of this Shape in Group coordinates.


multiplier

protected double multiplier
The multiplier for this Shape's coordinate system.


curvelist

protected ArrayList curvelist
The List of Curves in this Shape.

Constructor Detail

Shape

public Shape(String name,
             int x,
             int y,
             double multiplier)
Constructs a Shape with the given attributes.

Parameters:
name - The name of the to be constructed Shape.
x - The horizontal position of this Shape.
y - The vertical position of this Shape.
multiplier - The multiplier for this Shape's coordinate system.
Method Detail

getName

public String getName()
Returns the name of this Shape.

Returns:
The name of this Shape.

getX

public int getX()
Returns the horizontal position of this Shape.

Returns:
The horizontal position of this Shape.

getY

public int getY()
Returns the vertical position of this Shape.

Returns:
The vertical position of this Shape.

getMultiplier

public double getMultiplier()
Returns the multiplier of this Shape.

Returns:
The multiplier of this Shape.

getCurve

public Curve getCurve(int index)
Returns the Curve at index.

Parameters:
index - The index the Curve is at.
Returns:
The Curve at index.

addCurve

public void addCurve(Curve curve)
Adds the given Curve to this Shape.

Parameters:
curve - The Curve to be added. May not be null.

getNumberOfCurves

public int getNumberOfCurves()
Returns the number of Curves in this Shape.

Returns:
The number of Curves in this Shape.