|
|||||||||||
| 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.RectInteractionItem
An implementation of the InteractionItem interface to
enable rectangle selection 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 | |
RectInteractionItem(int[] coordsX,
int[] coordsY,
int indexX1,
int indexY1,
int indexX2,
int indexY2,
Transform2D xform_object)
Constructor for RectInteractionItem. |
|
RectInteractionItem(int[] coordsX,
int[] coordsY,
int index1,
int index2,
Transform2D xform_object)
Constructor for RectInteractionItem. |
|
RectInteractionItem(int[] coordsX,
int[] coordsY,
int index1,
int index2,
Transform2D xform_object,
int restrictionMove)
Constructor for RectInteractionItem. |
|
| 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 RectInteractionItem.
|
| 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 RectInteractionItem(int[] coordsX,
int[] coordsY,
int index1,
int index2,
Transform2D xform_object)
RectInteractionItem.
public RectInteractionItem(int[] coordsX,
int[] coordsY,
int indexX1,
int indexY1,
int indexX2,
int indexY2,
Transform2D xform_object)
RectInteractionItem.
public RectInteractionItem(int[] coordsX,
int[] coordsY,
int index1,
int index2,
Transform2D xform_object,
int restrictionMove)
RectInteractionItem.
| Method Detail |
public int getSpecifier()
InteractionItem
public void update(java.lang.Object[] args)
RectInteractionItem.
The following table shows the expected arguments, their types and order
in the object array given by args.
| position | argument | type |
| 0 | x components | int[] |
| 1 | y components | int[] |
| 2 | index x1 | Integer |
| 3 | index y1 | Integer |
| 4 | index x2 | Integer |
| 5 | index y2 | Integer |
| 6 | xform object | Transform2D |
args - the array with the argumentsInteractionItem.update(Object[])
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 | ||||||||||