public class Trapezium extends Shape
Modifier and Type | Field and Description |
---|---|
private GShape |
basic |
private java.util.ArrayList<Vector2D> |
basicShape |
private static int |
counter |
private static long |
serialVersionUID |
private int |
sizeXBottom |
private int |
sizeXTop |
private int |
sizeY |
Constructor and Description |
---|
Trapezium(Vector3D position,
int sizeX,
int sizeY)
Creates a trapezium.
|
Modifier and Type | Method and Description |
---|---|
Shape |
copy()
Creates a copy of this shape
|
Shape |
copyBaseForm()
Creates a copy of this shape with the basic values
|
toxi.geom.Rect |
getBoundingBox()
Not used
|
int |
getControlType(int index)
Returns the type of control for the parameter.
|
GShape |
getGShape()
Get the corresponding GShape
|
java.lang.String |
getNameOfControl(int index)
Returns the name (label) for the control for the parameter
|
int |
getNumberOfControls()
Returns the total number of possible controls to change the parameter
(allows properties enable this number of controls)
|
int |
getValue(int index)
Returns the actual value for the corresponding parameter
|
boolean |
mouseOver(Vector2D mousePosition)
Delegates check, if mouse is over this shape to the corresponding GShape
|
void |
recalculate()
Recalculates the vectors of the trapezium based on the input parameter
|
void |
setName(java.lang.String theValue)
Sets the name of this shape to name
|
void |
setShape(GShape gshape)
Set the corresponding GShape
|
void |
setSize(Vector2D newSize)
Changes sizes of the trapezium to a basic rectangle form with
|
void |
setValue0(int size)
Change Parameter 1
|
void |
setValue1(int size)
Change Parameter 2
|
void |
setValue2(int size)
Change Parameter 3
|
private static final long serialVersionUID
private int sizeXTop
private int sizeXBottom
private int sizeY
private static int counter
private GShape basic
private java.util.ArrayList<Vector2D> basicShape
public Trapezium(Vector3D position, int sizeX, int sizeY)
position
- Position within the coordinate system(0.1mm)sizeX
- length of upper and lower side of the trapezium (0.1mm)sizeY
- length of the side of the trapezium (0.1mm)public int getNumberOfControls()
getNumberOfControls
in interface Pluggable
getNumberOfControls
in class Shape
public void setName(java.lang.String theValue)
name
- the namepublic int getValue(int index)
public int getControlType(int index)
getControlType
in interface Pluggable
getControlType
in class Shape
index
- The number of the controlled parameterpublic java.lang.String getNameOfControl(int index)
getNameOfControl
in interface Pluggable
getNameOfControl
in class Shape
index
- The number of the controlled parameterpublic void setValue0(int size)
size
- Length of the top of the trapezium (0.1mm)public void setValue1(int size)
size
- Length of the bottom of the trapezium (0.1mm)public void setValue2(int size)
size
- Length of the sides of the trapezium (0.1mm)public void recalculate()
recalculate
in class Shape
public void setSize(Vector2D newSize)
newSize
- Length and Height of the trapezium (0.1mm)public void setShape(GShape gshape)
gshape
- the corresponding GShapepublic GShape getGShape()
public boolean mouseOver(Vector2D mousePosition)
mousePosition
- position of the mousepublic toxi.geom.Rect getBoundingBox()
public Shape copyBaseForm()
copyBaseForm
in class Shape