|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graphics.interaction.AbstractInteractionItem
com.tensegrity.graphics.interaction.AreaInteractionItem
An implementation of the InteractionItem interface to
enable area (polygon) selection and manipulation.
| Field Summary | |
protected int[] |
coordsX
instance variable for the x components of the coordinates the InteractionItem uses |
protected int[] |
coordsX2
instance variable for a second coordinates x components the InteractionItem uses |
protected int[] |
coordsY
instance variable for the y components of the coordinates the InteractionItem uses |
protected int[] |
coordsY2
instance variable for a second coordinates y components the InteractionItem uses |
protected int |
cursorID
instance variable that identifies the cursor that should be displayed when the mouse position hits the InteractionItem or when
interaction is performed. |
protected boolean |
draw
instance variable that indicates whether the InteractionItem should be drawn or not. |
protected int |
handlesize
instance variable for the size of the handle |
protected double[] |
offsetsX
instance variable that keeps the distances between the x component of the interaction start coordinate and the x component of the coordinate to the points the interaction item refers to |
protected double[] |
offsetsY
instance variable that keeps the distances between the y component of the interaction start coordinate and the y component of the coordinate to the points the interaction item refers to |
protected Transform2D |
xform_object
instance variable for the transformation of the object the InteractionItem belongs to. |
| Fields inherited from interface com.tensegrity.graphics.interaction.InteractionItem |
AREA, HANDLE, LINE, POLYLINE, RECT |
| Constructor Summary | |
AreaInteractionItem(int[] coordsX,
int[] coordsY,
int[] indicesX,
int[] indicesY,
Transform2D xform_object)
Constructor for AreaInteractionItem. |
|
AreaInteractionItem(int[] coordsX,
int[] coordsY,
int[] indicesX,
int[] indicesY,
Transform2D xform_object,
boolean draw)
Constructor for AreaInteractionItem. |
|
AreaInteractionItem(int[] coordsX,
int[] coordsY,
Transform2D xform_object)
Constructor for AreaInteractionItem. |
|
AreaInteractionItem(int[] coordsX,
int[] coordsY,
Transform2D xform_object,
boolean draw)
Constructor for AreaInteractionItem. |
|
| Method Summary | |
java.lang.Object |
calculateMove(Transform2D xform_context,
int x,
int y)
|
void |
draw(Device device,
Transform2D xform_context)
draws an object that implements this interface if it has a visual representation and is enabled for drawing. |
int |
getCursorID()
Returns an identifier that specifies a cursor. |
boolean |
getDraw()
Returns a boolean that indicates whether the
InteractionItem is draw when the BaseInteractable
is selected or is not draw. |
int |
getHandleSize()
Returns the current handle size. |
int |
getSpecifier()
Returns the specifier for an object that implements this interface. |
boolean |
hits(Transform2D xform_context,
int x,
int y)
checks whether the given point hits the object that implements this interface. |
void |
move(Transform2D xform_context,
int x,
int y)
This method is called from the InteractionContext when a
move occurs. |
void |
moveStart(int x,
int y)
This method is called from the InteractionContext when a
move is about to start. |
void |
moveStart(Transform2D xform_context,
int x,
int y)
This method is called from the InteractionContext when a
move is about to start. |
void |
moveStop(Transform2D xform_context,
int x,
int y)
This method is called from the InteractionContext when a
move has been done. |
void |
setCursorID(int cursorID)
|
void |
setDraw(boolean draw)
Sets the flag that indices whether the InteractionItem is
drawn when the BaseInteractable is selected to the value given
by draw. |
void |
setHandleSize(int handlesize)
Sets the handle size to the value given by handlesize.
|
void |
setTransform(Transform2D xform_object)
sets the transform a selectable object is possibly transformed by. |
void |
update(java.lang.Object[] args)
Updates the arguments the InteractionItem uses.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Transform2D xform_object
InteractionItem belongs to.
protected int[] coordsX
InteractionItem uses
protected int[] coordsX2
InteractionItem uses
protected int[] coordsY
InteractionItem uses
protected int[] coordsY2
InteractionItem uses
protected double[] offsetsX
protected double[] offsetsY
protected int cursorID
InteractionItem or when
interaction is performed.
protected boolean draw
InteractionItem should be drawn or not.
protected int handlesize
| Constructor Detail |
public AreaInteractionItem(int[] coordsX,
int[] coordsY,
Transform2D xform_object)
AreaInteractionItem.
public AreaInteractionItem(int[] coordsX,
int[] coordsY,
Transform2D xform_object,
boolean draw)
AreaInteractionItem.
public AreaInteractionItem(int[] coordsX,
int[] coordsY,
int[] indicesX,
int[] indicesY,
Transform2D xform_object)
AreaInteractionItem.
public AreaInteractionItem(int[] coordsX,
int[] coordsY,
int[] indicesX,
int[] indicesY,
Transform2D xform_object,
boolean draw)
AreaInteractionItem.
| Method Detail |
public int getSpecifier()
InteractionItem
public void update(java.lang.Object[] args)
InteractionItemInteractionItem uses.
Because the used arguments differ for each implementation of the
InteractionItem please take a look at the documentation of
the specific implementation of the InteractionItem to see
what arguments and what order of the arguments are/is expected.
args - the array with the arguments
public void draw(Device device,
Transform2D xform_context)
InteractionItem
device - the device to draw ontoxform_context - the transformation of the context
public boolean hits(Transform2D xform_context,
int x,
int y)
InteractionItem
xform_context - the transformation of the contextx - the x coordinate of the point to check fory - the y coordinate of the point to check for
public void moveStart(int x,
int y)
InteractionItemInteractionContext when a
move is about to start. It enables an object that implements this
interface to do some initialisations needed for the move action and such.
x - the x coordinate the move starts aty - the y coordinate the move starts at
public void moveStart(Transform2D xform_context,
int x,
int y)
InteractionItemInteractionContext when a
move is about to start. It enables an object that implements this
interface to do some initialisations needed for the move action and such.
xform_context - the transformation of the contextx - the x coordinate the move starts aty - the y coordinate the move starts at
public void moveStop(Transform2D xform_context,
int x,
int y)
InteractionItemInteractionContext when a
move has been done. It enables an object that implements this interface
to do some clean ups when a move action is finished.
xform_context - the transformation of the contextx - the x coordinate the move starts aty - the y coordinate the move starts at
public void move(Transform2D xform_context,
int x,
int y)
InteractionItemInteractionContext when a
move occurs. It enables an object that implements this interface to
modify the Interactable object it is associated to.
xform_context - the transformation of the contextx - the x coordinate the move is currently aty - the y coordinate the move is currently at
public java.lang.Object calculateMove(Transform2D xform_context,
int x,
int y)
public int getHandleSize()
InteractionItem
getHandleSize in interface InteractionItempublic void setHandleSize(int handlesize)
InteractionItemhandlesize.
The handle size specifies the size of the handles that are drawn for the
interaction item.
setHandleSize in interface InteractionItemhandlesize - the new size for the drawn handlespublic boolean getDraw()
InteractionItemboolean that indicates whether the
InteractionItem is draw when the BaseInteractable
is selected or is not draw.
getDraw in interface InteractionItemInteractionItempublic void setDraw(boolean draw)
InteractionItemInteractionItem is
drawn when the BaseInteractable is selected to the value given
by draw.
setDraw in interface InteractionItemdraw - the new value for the drawing statepublic int getCursorID()
InteractionItemGraphicConstants.
getCursorID in interface InteractionItempublic void setCursorID(int cursorID)
setCursorID in interface InteractionItempublic void setTransform(Transform2D xform_object)
InteractionItem
setTransform in interface InteractionItemxform_object - the transformation of the object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||