|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface marks a graphical object as one that can be selected, repositioned and manipulated via interaction with the mouse or API calls.
A BaseInteractable must provide a BoundingBox so that
intersection detection and other calculations can be made on it. Thus, this
interface includes the following method:
InteractionContext,
InteractionItem,
InteractionDescriptor,
Interactable,
InteractableLine| Method Summary | |
Boundary |
getBoundingBox()
Returns the bounding box of the BaseInteractable. |
InteractionDescriptor |
getInteractionDescriptor()
This method returns the InteractionDescriptor for the
BaseInteractable. |
InteractionItem |
getMoveItem()
Returns the InteractionItem that is used to move the
BaseInteractable. |
InteractionItem |
hits(InteractionInfo interactionInfo)
This method is called to check if the given point hits the BaseInteractable object. |
void |
internalEnableSelection(boolean enabled)
Sets the internal state of selectability for this BaseInteractable instance to the value given by
enabled.
|
InteractionItem |
internalSelect(InteractionInfo interactionInfo)
This method is called by the InteractionContext to select
the BaseInteractable. |
void |
internalSetSelected(boolean select)
Sets the state of selection for this BaseInteractable to the
value given by select. |
boolean |
isMovable()
Returns a boolean that indicates whether this
BaseInteractable is movable or not. |
boolean |
isSelectable()
Returns a boolean |
boolean |
isSelected()
Returns a boolean |
void |
mouseClick(InteractionInfo interactionInfo)
This method is called when a mouse button click has been occured upon the BaseInteractable. |
void |
mouseDown(InteractionInfo interactionInfo)
This method is called when a mouse button has been pressed upon the BaseInteractable. |
void |
mouseEnter(InteractionInfo interactionInfo)
This method is called when the mouse cursor has entered the BaseInteractable bounding box. |
void |
mouseExit(InteractionInfo interactionInfo)
This method is called when the mouse cursor has exited the BaseInteractable bounding box. |
void |
mouseUp(InteractionInfo interactionInfo)
This method is called when a mouse button has been released upon the BaseInteractable. |
void |
postActing(InteractionInfo interactionInfo,
int itemspecifier)
This method is called by the InteractionContext while the
interaction takes place. |
boolean |
preActing(InteractionInfo interactionInfo,
int itemspecifier)
This method is called by the InteractionContext while the
interaction takes place. |
InteractionItem |
select(InteractionInfo interactionInfo)
This method is called by the InteractionContext to select
the BaseInteractable. |
void |
setMovable(boolean movable)
Sets the state of movability for this BaseInteractable to the
value given by movable. |
void |
setSelectable(boolean selectable)
Sets the state of selectability for this BaseInteractable to the
value given by selectable. |
void |
setSelected(boolean selected)
Sets the state of selection for this BaseInteractable to the
value given by selected. |
boolean |
startAction(InteractionInfo interactionInfo,
int itemspecifier)
This method is called by the InteractionContext before the
interaction takes place. |
void |
stopAction(InteractionInfo interactionInfo,
int itemspecifier)
This method is called by the InteractionContext after the
interaction has taken place. |
| Method Detail |
public boolean isSelectable()
boolean that indicates whether is it allowed to
select the BaseInteractable or not.
- Returns:
- boolean that indicates the state of selectability for the
BaseInteractable
public void setSelectable(boolean selectable)
BaseInteractable to the
value given by selectable.
selectable - the new state of selectability for the
BaseInteractablepublic void internalEnableSelection(boolean enabled)
BaseInteractable instance to the value given by
enabled.
enabled - the new state of internal selectability for the
BaseInteractable instancepublic boolean isSelected()
boolean that indicates whether this
BaseInteractable is selected or not.
- Returns:
- boolean that indicates the state of selection for this
BaseInteractable
public void setSelected(boolean selected)
BaseInteractable to the
value given by selected.
selected - the new state of selection for this
BaseInteractablepublic void internalSetSelected(boolean select)
BaseInteractable to the
value given by select.setSelected(boolean) method is
that not the complete hierarchy is selected the BaseInteractable
may be belongs to.
select - the new state of selection for this
BaseInteractablepublic boolean isMovable()
boolean that indicates whether this
BaseInteractable is movable or not.
BaseInteractablepublic void setMovable(boolean movable)
BaseInteractable to the
value given by movable.
movable - the new state of movabilitypublic Boundary getBoundingBox()
BaseInteractable.
BaseInteractablepublic InteractionItem getMoveItem()
InteractionItem that is used to move the
BaseInteractable. The returned value can be null if
there is no InteractionItem defined for moving the
BaseInteractable.
BaseInteractablepublic InteractionDescriptor getInteractionDescriptor()
InteractionDescriptor for the
BaseInteractable.
BaseInteractableInteractionDescriptorpublic void mouseEnter(InteractionInfo interactionInfo)
BaseInteractable bounding box.
interactionInfo - the corresponding InteractionInfo
to the interactionpublic void mouseExit(InteractionInfo interactionInfo)
BaseInteractable bounding box.
interactionInfo - the corresponding InteractionInfo
to the interactionpublic void mouseDown(InteractionInfo interactionInfo)
BaseInteractable.
interactionInfo - the corresponding InteractionInfo
to the interactionpublic void mouseUp(InteractionInfo interactionInfo)
BaseInteractable.
interactionInfo - the corresponding InteractionInfo
to the interactionpublic void mouseClick(InteractionInfo interactionInfo)
BaseInteractable.
interactionInfo - the corresponding InteractionInfo
to the interactionpublic InteractionItem hits(InteractionInfo interactionInfo)
BaseInteractable object. It returns null if the
object is not hit or the responsable InteractionItem.
Notice that it do not influence the state of selected for the
BaseInteractable.
interactionInfo - the InteractionInfo's to check, may
not be null.
null.public InteractionItem select(InteractionInfo interactionInfo)
InteractionContext to select
the BaseInteractable. It returns null if the
BaseInteractable is not hit or the responsible
InteractionItem.
interactionInfo - the InteractionInfo's to check, may
not be null.
InteractionItem or
null.public InteractionItem internalSelect(InteractionInfo interactionInfo)
InteractionContext to select
the BaseInteractable. It returns null if the
BaseInteractable is not hit or the responsable
InteractionItem.select(com.tensegrity.graphics.interaction.InteractionInfo) method
is that the flag returned by isSelected() will not be changed nor
an event is generated by a call to this method.
interactionInfo - the InteractionInfo to check, may not
be null.
null
public boolean startAction(InteractionInfo interactionInfo,
int itemspecifier)
InteractionContext before the
interaction takes place. It enables the BaseInteractable object
to fire events or to prepare some datas und such. The returned value
indicates that interaction is allowed or not.
interactionInfo - the InteractionInfo instance;
must not be null.itemspecifier - the specifier of the InteractionItem
the InteractionContext will use.
public boolean preActing(InteractionInfo interactionInfo,
int itemspecifier)
InteractionContext while the
interaction takes place. The prefix pre indicates that it is called
before the InteractionContext calls the
InteractionItem to do his work. The returned
boolean indicates whether it is allowed to interact with the
BaseInteractable or not.
interactionInfo - the InteractionInfo instance;
must not be null.itemspecifier - the specifier of the InteractionItem
the InteractionContext will use
BaseInteractable
public void postActing(InteractionInfo interactionInfo,
int itemspecifier)
InteractionContext while the
interaction takes place. The prefix post indicates that it is called
after the InteractionContext has called the
InteractionItem to do his work, so that the
BaseInteractable can update needed values, fire events and such
interactionInfo - the InteractionInfo instance;
must not be null.itemspecifier - the specifier of the InteractionItem
the InteractionContext will use
public void stopAction(InteractionInfo interactionInfo,
int itemspecifier)
InteractionContext after the
interaction has taken place. It enabled the BaseInteractable
object to fire events, update some datas and such.
interactionInfo - the InteractionInfo instance;
must not be null.itemspecifier - the specifier of the InteractionItem
the InteractionContext will use
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||