|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graphics.AbstractPrimitive
com.tensegrity.graphics.primitive2D.Ellipse2D
An object of class Ellipse2D represents a 2-dimensional
elliptical shape specified by a rectangular boundary. If the boundary
is a square, the corresponding ellipse is a circle such that its
diameter equals the length of one of the square's sides.
| Field Summary | |
static int |
COORD_LEFT_TOP
constant that tells about a coordinate index in the bounding box of the ellipse |
static int |
COORD_RIGHT_BOTTOM
constant that tells about a coordinate index in the bounding box of the ellipse |
protected int[] |
coordsX
instance variable for the x components of the ellipse coordinates |
protected int[] |
coordsY
instance variable for the y components of the ellipse coordinates |
| Fields inherited from class com.tensegrity.graphics.AbstractPrimitive |
attributableOnSetListener, doAttributableEvents, infovalueregistry, interactionDescriptor, selected |
| Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet |
TREE_SUBSET_POSTFIX |
| Constructor Summary | |
Ellipse2D()
Constructor that creates an empty Ellipse2D. |
|
Ellipse2D(Ellipse2D ellipse)
Copy constructor for Ellipse2D. |
|
Ellipse2D(int x1,
int y1,
int x2,
int y2)
Constructor that creates an Ellipse2D with the coordinates
given by x1/code>, |
|
| Method Summary | |
void |
applyState(PrimitiveState state)
|
BoundingBox |
calculateBoundingBox(InteractionInfo interactionInfo)
|
Primitive |
deepCopy()
An implementation of this method is responsible for returning a deep- copy of the Primitive instance |
Attribute |
getAttribute(java.lang.String name)
Returns the attribute with the given name or null if there
is no Attribute with the given name. |
AttributeSet |
getAttributes()
Returns an AttributeSet consisting of all attributes of this
AttributableOnSet. |
AttributeSet |
getAttributesTree()
Returns an AttributeSet containing all
Attributes of this AttributableOnSet in a
treelike structure.
|
int |
getBottom()
Returns the bottom value of the ellipse bounding box. |
Boundary |
getBoundingBox()
Returns the bounding box of the BaseInteractable. |
int |
getCenterX()
Returns the x component of the center coordinate of the ellipse bounding box. |
int |
getCenterY()
Returns the y component of the center coordinate of the ellipse bounding box. |
int |
getHeight()
Returns the height of the ellipse bounding box. |
Illustrator |
getIllustrator(Transform2D xform_context)
Returns the Primitives illustrator object. |
int |
getLeft()
Returns the left value of the ellipse bounding box. |
int |
getRadiusX()
Returns the radius in x direction of the ellipse. |
int |
getRadiusY()
Returns the radius in y direction of the ellipse. |
int |
getRight()
Returns the right value of the ellipse bounding box. |
PrimitiveState |
getState()
|
int |
getTop()
Returns the top value of the ellipse bounding box. |
int |
getWidth()
Returns the width of the ellipse bounding box. |
protected InteractionDescriptor |
internalCreateInteractionDescriptor()
This method should return an InteractionDescriptor that
defines the interaction capabilities of a certain Primitive.
|
boolean |
isResizable()
Returns a boolean that indicates whether the
Interactable is resizable or not. |
void |
set(int left,
int top,
int right,
int bottom)
Sets the bounding box of this Rect2D to the given
left, top, right and
bottom coordinate components. |
void |
setAttributes(AttributeSet attributes)
Searches within the AttributeSet given by
attributes for attributes that have the same name as the
attributes of this AttributableOnSet holds. |
void |
setAttributesTree(AttributeSet attributes)
Performs the same operation as the setAttributes(com.tensegrity.generic.attribute.AttributeSet) method with
the difference that the AttributeSet given to this method
must provide the treelike structure mentioned in the documentation of
the getAttributesTree(). |
void |
setAttributeValue(java.lang.String name,
java.lang.Object value)
Sets the value of the attribute with the name to the given value. |
void |
setBottom(int bottom)
Sets the bottom value of the ellipse bounding box to the value given by bottom |
void |
setCenter(int centerX,
int centerY)
Sets the center coordinate of the ellipse bounding box to the coordinate given by centerX and centerY. |
void |
setCenterX(int centerX)
Sets the x component of the center coordinate of the ellipse bounding box to the value given by centerX |
void |
setCenterY(int centerY)
Sets the y component of the center coordinate of the ellipse bounding box to the value given by centerY |
void |
setHeight(int height)
Sets the height of the ellipse bounding box to the value given by height |
void |
setLeft(int left)
Sets the left value of the ellipse bounding box to the value given by left. |
void |
setRadii(int radiusX,
int radiusY)
Sets the radii in x and y direction of the ellipse to the values given by radiusX and radiusY. |
void |
setRadiusX(int radiusX)
Sets the radius in x direction of the ellipse to the value given by radiusX. |
void |
setRadiusY(int radiusY)
Sets the radius in y direction of the ellipse to the value given by radiusY. |
void |
setResizable(boolean resizable)
Sets the state of resizability for the Interactable to the
value given by resizable. |
void |
setRight(int right)
Sets the right value of the ellipse bounding box to the value given by right. |
void |
setStroke(StrokeFormat stroke)
Sets a StrokeFormat for the Primitive. |
void |
setTop(int top)
Sets the top value of the ellipse bounding box to the value given by top. |
void |
setWidth(int width)
Sets the width of the ellipse bounding box to the value given by width |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.tensegrity.graphics.interaction.BaseInteractable |
getInteractionDescriptor, getMoveItem, hits, internalEnableSelection, internalSelect, internalSetSelected, isMovable, isSelectable, isSelected, mouseClick, mouseDown, mouseEnter, mouseExit, mouseUp, postActing, preActing, select, setMovable, setSelectable, setSelected, startAction, stopAction |
| Field Detail |
public static final int COORD_LEFT_TOP
public static final int COORD_RIGHT_BOTTOM
protected int[] coordsX
protected int[] coordsY
| Constructor Detail |
public Ellipse2D()
Ellipse2D.
public Ellipse2D(int x1,
int y1,
int x2,
int y2)
Ellipse2D with the coordinates
given by x1/code>, y1, x2 and
y2.
- Parameters:
x1 - x component of the first coordinate of the ellipse bounding boxy1 - y component of the first coordinate of the ellipse bounding boxx2 - x component of the second coordinate of the ellipse bounding
boxy2 - y component of the second coordinate of the ellipse bounding
boxpublic Ellipse2D(Ellipse2D ellipse)
Ellipse2D.
ellipse - the Ellipse2D to copy| Method Detail |
public final int getLeft()
public final void setLeft(int left)
left.
left - the new value for the left value of the ellipse bounding boxpublic final int getTop()
public final void setTop(int top)
top.
top - the new value for the top value of the ellipse bounding boxpublic final int getRight()
public final void setRight(int right)
right.
right - the new value for the right value of the ellipse bounding
boxpublic final int getBottom()
public final void setBottom(int bottom)
bottom
bottom - the new value for the bottom value of the ellipse bounding
boxpublic final int getWidth()
public final void setWidth(int width)
width
width - the new width value for the ellipse bounding boxpublic final int getHeight()
public final void setHeight(int height)
height
height - the new height value for the ellipse bounding boxpublic final int getCenterX()
public final void setCenterX(int centerX)
centerX
centerX - the new value for the x center of the ellipse bounding
boxpublic final int getCenterY()
public final void setCenterY(int centerY)
centerY
centerY - the new value for the y center of the ellipse bounding
box
public final void setCenter(int centerX,
int centerY)
centerX and centerY.
centerX - the x component of the new center coordinatecenterY - the y component of the new center coordinatepublic final int getRadiusX()
public final void setRadiusX(int radiusX)
radiusX.
radiusX - the new radius in x directionpublic final int getRadiusY()
public final void setRadiusY(int radiusY)
radiusY.
radiusY - the new radius in y direction
public final void setRadii(int radiusX,
int radiusY)
radiusX and radiusY.
radiusX - the new radius in x directionradiusY - the new radius in y direction
public final void set(int left,
int top,
int right,
int bottom)
Rect2D to the given
left, top, right and
bottom coordinate components.
left - the x-coordinate of the left bounding.top - the y-coordinate of the top bounding.right - the x-coordinate of the right bounding.bottom - the y-coordinate of the bottom bounding.public void setStroke(StrokeFormat stroke)
PrimitiveStrokeFormat for the Primitive.
setStroke in interface Primitivestroke - the StrokeFormat to usepublic Boundary getBoundingBox()
BaseInteractableBaseInteractable.
getBoundingBox in interface BaseInteractableBaseInteractablepublic PrimitiveState getState()
getState in interface Primitive
public void applyState(PrimitiveState state)
throws PrimitiveStateNotApplicableException
applyState in interface PrimitivePrimitiveStateNotApplicableExceptionpublic Illustrator getIllustrator(Transform2D xform_context)
PrimitivePrimitives illustrator object. To get more
informations about the illustrator object see the class above or the
documentation of the Illustrator class.
getIllustrator in interface Primitivexform_context - the transformation of the context the
Primitive lies within.
Primitive.public Primitive deepCopy()
PrimitivePrimitive instance
deepCopy in interface PrimitivePrimitive.public boolean isResizable()
Interactableboolean that indicates whether the
Interactable is resizable or not.
isResizable in interface InteractableInteractablepublic void setResizable(boolean resizable)
InteractableInteractable to the
value given by resizable.
setResizable in interface Interactableresizable - the new state of resizability for the
Interactablepublic BoundingBox calculateBoundingBox(InteractionInfo interactionInfo)
calculateBoundingBox in interface Interactable
public void setAttributeValue(java.lang.String name,
java.lang.Object value)
throws IllegalValueException,
ConstraintViolationException
AttributableAttributable interface doesn't support an
Attribute with the name given by name,
the attribute given through name and value
is not handled nor created by Attributable.
setAttributeValue in interface AttributablesetAttributeValue in class AbstractPrimitiveIllegalValueException
ConstraintViolationExceptionpublic Attribute getAttribute(java.lang.String name)
Attributablenull if there
is no Attribute with the given name.
getAttribute in interface AttributablegetAttribute in class AbstractPrimitivepublic AttributeSet getAttributes()
AttributableOnSetAttributeSet consisting of all attributes of this
AttributableOnSet.
getAttributes in interface AttributableOnSetAttributeSet with all attributes.public void setAttributes(AttributeSet attributes)
AttributableOnSetAttributeSet given by
attributes for attributes that have the same name as the
attributes of this AttributableOnSet holds. The value of
every attribute that has the same name is used as the new value for the
corresponding attribute of this AttributableOnSet.
An Attribute within the given AttributeSet that
is not an attribute of the object that implements the
AttributableOnSet interface is not handled by nor added
to the specific implementor of the AttributableOnSet
interface.
setAttributes in interface AttributableOnSetattributes - the AttributeSet consisting of the attributes
whose values to set.public AttributeSet getAttributesTree()
AttributableOnSetAttributeSet containing all
Attributes of this AttributableOnSet in a
treelike structure.
Attributes for an Attribute of this
AttributableOnSet.
Attribute can only
have one value (in this case an object or the Attributes
for an object) the subsequent attributes are plugged into the returned
AttributeSet as a new Attribute with the same
name and the AttributableOnSet.TREE_SUBSET_POSTFIX.
getAttributesTree in interface AttributableOnSetAttributeSet with the attributes
in a treelike structurepublic void setAttributesTree(AttributeSet attributes)
AttributableOnSetAttributableOnSet.setAttributes(com.tensegrity.generic.attribute.AttributeSet) method with
the difference that the AttributeSet given to this method
must provide the treelike structure mentioned in the documentation of
the AttributableOnSet.getAttributesTree().
setAttributesTree in interface AttributableOnSetattributes - the AttributeSet containing the attributes
whose values to set.protected InteractionDescriptor internalCreateInteractionDescriptor()
AbstractPrimitiveInteractionDescriptor that
defines the interaction capabilities of a certain Primitive.
Since the InteractionDescriptor varies for different kinds
of primitives this method is declared as abstract and must be
implemented for each Primitive that is based on the
AbstractPrimitive class.
null.
internalCreateInteractionDescriptor in class AbstractPrimitiveInteractionDescriptor
for the certain Primitive instancepublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||