|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
A InteractionItem specifies a single element like
handles, lines, rectangles or areas for the interaction for an object that
implements the BaseInteractable interface. Through the combination
of several InteractionItems an object can be freely configured
how to select and what interactions are possible.
InteractionItems are stored within a
InteractionDescriptor.
InteractionDescriptor| Field Summary | |
static int |
AREA
constant that defines an individual interaction item |
static int |
HANDLE
constant that defines an individual interaction item |
static int |
LINE
constant that defines an individual interaction item |
static int |
POLYLINE
constant that defines an individual interaction item |
static int |
RECT
constant that defines an individual interaction item |
| 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.
|
| Field Detail |
public static final int HANDLE
public static final int LINE
public static final int POLYLINE
public static final int RECT
public static final int AREA
| Method Detail |
public int getSpecifier()
public int getHandleSize()
public void setHandleSize(int handlesize)
handlesize.
The handle size specifies the size of the handles that are drawn for the
interaction item.
handlesize - the new size for the drawn handlespublic boolean getDraw()
boolean that indicates whether the
InteractionItem is draw when the BaseInteractable
is selected or is not draw.
InteractionItempublic void setDraw(boolean draw)
InteractionItem is
drawn when the BaseInteractable is selected to the value given
by draw.
draw - the new value for the drawing statepublic int getCursorID()
GraphicConstants.
public void setCursorID(int cursorID)
public void setTransform(Transform2D xform_object)
xform_object - the transformation of the objectpublic void update(java.lang.Object[] args)
InteractionItem 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)
device - the device to draw ontoxform_context - the transformation of the context
public boolean hits(Transform2D xform_context,
int x,
int y)
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)
InteractionContext 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)
InteractionContext 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)
InteractionContext 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)
InteractionContext 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)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||