public class Cutout extends java.lang.Object implements Drawable2D, java.io.Serializable, Pluggable
Modifier and Type | Field and Description |
---|---|
private float |
angle |
private float |
boundingBoxSize |
private boolean |
isActive |
private boolean |
isSelected |
private GShape |
master |
private Vector2D |
position |
private float |
scalingFactor |
private static long |
serialVersionUID |
private GShape |
slave |
Constructor and Description |
---|
Cutout(GShape master,
GShape slave)
Creates a new Cut-out object, where both shapes are stored and a
new position and angle is created for the positioning of the
cut-out form on the master shape.
|
Modifier and Type | Method and Description |
---|---|
Cutout |
copyFor(GShape newMaster)
Makes a copy of a cut-out (for printing)
|
void |
draw2D(processing.core.PGraphics p,
Transformation t)
Draw cut-out line
|
Vector2D |
findCenter(GShape shape)
find the (mass)center of a shape
|
int |
getControlType(int index)
Returns the type of control for the parameter.
|
Shape |
getMasterShape() |
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)
|
Shape |
getSlaveShape() |
int |
getValue(int index)
Returns the actual value for the corresponding parameter
|
java.util.ArrayList<Vector2D> |
getVectors() |
boolean |
isActive()
check, if cut-out is made active (can be manipulated)
|
boolean |
isSelected() |
boolean |
mouseOver(Vector2D mousePosition)
check if mouse is over cut-out or the corresponding connecting line
|
void |
removeCutout()
remove cut-out from a shape
|
void |
scale2D(float scaleFactor) |
void |
setActive(boolean isActive) |
void |
setSelected(boolean b) |
void |
setValue0(int size)
Change Parameter 1
|
void |
setValue1(int size)
Change Parameter 2
|
void |
setValue2(int angle)
Change Parameter 3
|
void |
translate2D(Vector2D direction)
Move the cut-out at another position
|
private static final long serialVersionUID
private Vector2D position
private float angle
private GShape master
private GShape slave
private boolean isSelected
private boolean isActive
private float scalingFactor
private float boundingBoxSize
public Cutout(GShape master, GShape slave)
master
- The shape, where a cut-out should appearslave
- The shape, which is used as a cut-out formpublic void translate2D(Vector2D direction)
direction
- offset to add (0.1mm)public Cutout copyFor(GShape newMaster)
newMaster
- The shape, to which the copy belong (where the copy is placed)public Shape getMasterShape()
public Shape getSlaveShape()
public void setSelected(boolean b)
b
- set true, if mouse is over cut-outpublic boolean isSelected()
public java.util.ArrayList<Vector2D> getVectors()
public int getNumberOfControls()
getNumberOfControls
in interface Pluggable
public int getValue(int index)
public int getControlType(int index)
getControlType
in interface Pluggable
index
- The number of the controlled parameterpublic java.lang.String getNameOfControl(int index)
getNameOfControl
in interface Pluggable
index
- The number of the controlled parameterpublic void setValue0(int size)
size
- X-Position(0.1mm)public void setValue1(int size)
size
- Y-Position(0.1mm)public void setValue2(int angle)
angle
- Angle(degree)public void draw2D(processing.core.PGraphics p, Transformation t)
draw2D
in interface Drawable2D
public Vector2D findCenter(GShape shape)
shape
- A GShapepublic boolean mouseOver(Vector2D mousePosition)
mousePosition
- the current position of the mousepublic void removeCutout()
public boolean isActive()
public void setActive(boolean isActive)
public void scale2D(float scaleFactor)
scaleFactor
- scale cut-out for printing