|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graphics.interaction.DefaultInteractionContext
The default implementation of the InteractionContext
interface.
InteractionContext| Constructor Summary | |
DefaultInteractionContext()
Constructor for DefaultInteractionContext. |
|
| Method Summary | |
int |
act(InteractionInfo interactionInfo)
This method has to be called from the object that holds an instance of InteractionContext to move or manipulate the current
selection. |
int |
act(InteractionInfo interactionInfo,
java.util.List interactables_fixed)
|
int |
getCursorID(InteractionInfo interactionInfo,
java.util.List interactables)
Returns a identifier for a mouse cursor that should be displayed for the given coordinate. |
int |
getInteractionProviderCount()
Returns the number of InteractionProviders that have a sub
selection. |
java.util.List |
getInteractionProviders()
Returns a List of InteractionProviders that
have a selection. |
java.util.List |
getSelection()
Returns the currently selected BaseInteractables in a
List. |
Boundary |
getSelectionBoundingBox()
Returns the bounding box of the currently selected objects. |
int |
getSelectionCount()
Returns the number of the currently selected BaseInteractables. |
boolean |
hasMultiSelection()
Returns a flag that indicates whether more than one object is selected or not. |
boolean |
hasSelection()
Returns a flag that indicates whether something is selected or not. |
boolean |
hasSubSelection()
Returns a flag that indicates whether this InteractionContext has a sub selection or not. |
int |
hits(InteractionInfo interactionInfo,
java.util.List interactables)
Checks if an BaseInteractable is hit. |
void |
internalAddInteractionProvider(InteractionProvider interactionProvider)
Internal method of the selection api. |
void |
internalChangeDescriptor(BaseInteractable interactable,
java.util.List interactables_fixed,
InteractionDescriptor newDescriptor,
InteractionItem newItem)
Internal method of the selection api. |
InteractionItem |
internalGetCurrentInteractionItemFor(BaseInteractable interactable)
Internal method of the selection api. |
void |
internalRemoveInteractionProvider(InteractionProvider interactionProvider)
Internal method of the selection api. |
boolean |
isInteractionCycleComplete()
|
boolean |
isInteractionStarted()
Returns a boolean that indicates whether an interaction has
been started on this InteractionContext. |
int |
mouseClick(InteractionInfo interactionInfo,
java.util.List interactables)
This method has to be called from the object that holds an instance of InteractionContext when a mouse button has been clicked.
|
int |
mouseDown(InteractionInfo interactionInfo,
java.util.List interactables)
This method has to be called from the object that holds an instance of InteractionContext when a mouse button has been pressed. |
int |
mouseMove(InteractionInfo interactionInfo,
java.util.List interactables)
This method has to be called from the object that holds an instance of InteractionContext when the mouse has been moved. |
int |
mouseUp(InteractionInfo interactionInfo,
java.util.List interactables)
This method has to be called from the object that holds an instance of InteractionContext when a mouse button has been released. |
void |
paint(Renderer renderer,
Device device,
Transform2D xform_context)
This method has to be called from the objects that holds an instance of InteractionContext to paint the current selection. |
int |
postAction(InteractionInfo interactionInfo,
java.util.List interactables)
TODO : comment |
void |
preAction(InteractionInfo interactionInfo,
java.util.List interactables)
TODO : comment |
void |
select(BaseInteractable interactable,
boolean adjustSelectionFlag)
Selects the BaseInteractable given by
interactable and adds it to the
InteractionContext.
|
void |
select(BaseInteractable interactable,
InteractionItem interactionItem)
Select the BaseInteractable given by
interactable and adds it to the
InteractionContext. |
int |
select(InteractionInfo interactionInfo,
java.util.List interactables)
This method has to be called from the object that holds an instance of InteractionContext to select a BaseInteractable
if it lies at the given point. |
int |
select(InteractionInfo interactionInfo,
java.util.List interactables,
Boundary boundary)
This method has to be called from the object that holds an instance of InteractionContext to select all
BaseInteractable objects that lie within the given
Boundary. |
void |
select(java.util.List interactables)
This method has to be called to select the given List of
BaseInteractable objects. |
void |
selectSubsequent(InteractionProvider interactionProvider)
Adds the InteractionProvider given by
interactionProvider to the InteractionContext.
|
void |
startAction(InteractionInfo interactionInfo)
This method has to be called from the object that holds an instance of InteractionContext before movement or manipulation of the
current selection starts. |
int |
stopAction(InteractionInfo interactionInfo)
This method has to be called from the object that holds an instance of InteractionContext when movement or manipulation of the
current selection is done. |
void |
unselect()
This method has to be called to unselect each BaseInteractable that is currently selected. |
void |
unselect(BaseInteractable interactable,
boolean adjustSelectionFlag)
Unselects the BaseInteractable given by
interactable and removes it from the
InteractionContext.
|
void |
unselect(java.util.List interactables)
This method has to be called to unselect the given List of
BaseInteractable objects. |
void |
unselectSubsequent(InteractionProvider interactionProvider)
Removes the InteractionProvider given by
interactionProvider from the
InteractionContext.
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultInteractionContext()
| Method Detail |
public boolean hasSelection()
InteractionContext
hasSelection in interface InteractionContextpublic boolean hasMultiSelection()
InteractionContext
hasMultiSelection in interface InteractionContextpublic int getSelectionCount()
InteractionContextBaseInteractables.
getSelectionCount in interface InteractionContextBaseInteractablespublic java.util.List getSelection()
InteractionContextBaseInteractables in a
List.
getSelection in interface InteractionContextList of the currently selected objectspublic boolean hasSubSelection()
InteractionContextInteractionContext has a sub selection or not. A sub
selection means that an InteractionProvider that belongs to
this InteractionContext has a selection.
hasSubSelection in interface InteractionContextpublic boolean isInteractionStarted()
InteractionContextboolean that indicates whether an interaction has
been started on this InteractionContext.
isInteractionStarted in interface InteractionContextpublic boolean isInteractionCycleComplete()
isInteractionCycleComplete in interface InteractionContextpublic int getInteractionProviderCount()
InteractionContextInteractionProviders that have a sub
selection.
getInteractionProviderCount in interface InteractionContextInteractionProviders with a sub
selectionpublic java.util.List getInteractionProviders()
InteractionContextList of InteractionProviders that
have a selection.InteractionProviders that have a selection must
not be selected by itself and therefore they must not but can be part of
the List returned by InteractionContext.getSelection().
getInteractionProviders in interface InteractionContextList of InteractionProviders
that have a selection
public int getCursorID(InteractionInfo interactionInfo,
java.util.List interactables)
InteractionContextGraphicConstants.
getCursorID in interface InteractionContextinteractionInfo - the info values needed to find the right cursor.interactables - the List of
BaseInteractables to check for.
public int hits(InteractionInfo interactionInfo,
java.util.List interactables)
InteractionContextBaseInteractable is hit. The informations
needed therefore have to be given by the interactionInfo
parameter. The BaseInteractables to check have to be given
by the interactables parameter.
A constant is returned that identifies what has been hit.
hits in interface InteractionContextinteractionInfo - the info values needed to check for a hitinteractables - the List of
BaseInteractables to check for.
hit identifiers
public int select(InteractionInfo interactionInfo,
java.util.List interactables)
InteractionContextInteractionContext to select a BaseInteractable
if it lies at the given point.
select in interface InteractionContextinteractables - the list of BaseInteractable objects that
can be selected.interactionInfo - the InteractionInfo holding
information on the manipulation.
selection identifiers
public int select(InteractionInfo interactionInfo,
java.util.List interactables,
Boundary boundary)
InteractionContextInteractionContext to select all
BaseInteractable objects that lie within the given
Boundary.
select in interface InteractionContextinteractionInfo - the InteractionInfo holding
information on the manipulation.interactables - the list of BaseInteractable objects
that should process the mouse move interaction.boundary - the rectangle to select within
selection identifiers
public void select(BaseInteractable interactable,
boolean adjustSelectionFlag)
InteractionContextBaseInteractable given by
interactable and adds it to the
InteractionContext.
select in interface InteractionContextinteractable - adjustSelectionFlag -
public void select(BaseInteractable interactable,
InteractionItem interactionItem)
InteractionContextBaseInteractable given by
interactable and adds it to the
InteractionContext. The InteractionItem given
by interactionItem is used for further interaction.
select in interface InteractionContextinteractable - interactionItem - public void select(java.util.List interactables)
InteractionContextList of
BaseInteractable objects.
select in interface InteractionContextinteractables - the list of BaseInteractable objects that
should be selectedpublic void unselect()
InteractionContextBaseInteractable that is currently selected.
unselect in interface InteractionContext
public void unselect(BaseInteractable interactable,
boolean adjustSelectionFlag)
InteractionContextBaseInteractable given by
interactable and removes it from the
InteractionContext.
unselect in interface InteractionContextinteractable - adjustSelectionFlag - public void unselect(java.util.List interactables)
InteractionContextList of
BaseInteractable objects.
unselect in interface InteractionContextinteractables - the list of BaseInteractable objects that
should process the mouse button down interaction.public void selectSubsequent(InteractionProvider interactionProvider)
InteractionContextInteractionProvider given by
interactionProvider to the InteractionContext.
selectSubsequent in interface InteractionContextinteractionProvider - public void unselectSubsequent(InteractionProvider interactionProvider)
InteractionContextInteractionProvider given by
interactionProvider from the
InteractionContext.
unselectSubsequent in interface InteractionContextinteractionProvider - the InteractionProvider to
removepublic Boundary getSelectionBoundingBox()
InteractionContext
getSelectionBoundingBox in interface InteractionContext
public int mouseDown(InteractionInfo interactionInfo,
java.util.List interactables)
InteractionContextInteractionContext when a mouse button has been pressed.
mouseDown in interface InteractionContextinteractionInfo - the InteractionInfo holding
information on the manipulation.interactables - the list of BaseInteractable objects that
should process the mouse button down interaction.
mouse interaction identifiers
public int mouseUp(InteractionInfo interactionInfo,
java.util.List interactables)
InteractionContextInteractionContext when a mouse button has been released.
mouseUp in interface InteractionContextinteractionInfo - the InteractionInfo holding
information on the manipulation.interactables - the list of BaseInteractable objects that
should process the mouse button up interaction.
mouse interaction identifiers
public int mouseClick(InteractionInfo interactionInfo,
java.util.List interactables)
InteractionContextInteractionContext when a mouse button has been clicked.
Clicked means in this case that a mouse buttin has been pressed and
released.
mouseClick in interface InteractionContextinteractionInfo - the InteractionInfo holding
information on the manipulation.interactables - the list of BaseInteractable objects that
should process the mouse move interaction.
mouse interaction identifiers
public int mouseMove(InteractionInfo interactionInfo,
java.util.List interactables)
InteractionContextInteractionContext when the mouse has been moved.
mouseMove in interface InteractionContextinteractionInfo - the InteractionInfo holding
information on the manipulation.interactables - the list of BaseInteractable objects that
should process the mouse move interaction.
mouse interaction identifiers
public void preAction(InteractionInfo interactionInfo,
java.util.List interactables)
InteractionContext
preAction in interface InteractionContextinteractionInfo - interactables - public void startAction(InteractionInfo interactionInfo)
InteractionContextInteractionContext before movement or manipulation of the
current selection starts.
startAction in interface InteractionContextinteractionInfo - the InteractionInfo holding
information on the manipulation.public int act(InteractionInfo interactionInfo)
InteractionContextInteractionContext to move or manipulate the current
selection.
act in interface InteractionContextinteractionInfo - the InteractionInfo holding
information on the manipulation.
interaction identifiers
public int act(InteractionInfo interactionInfo,
java.util.List interactables_fixed)
act in interface InteractionContextpublic int stopAction(InteractionInfo interactionInfo)
InteractionContextInteractionContext when movement or manipulation of the
current selection is done.
stopAction in interface InteractionContextinteractionInfo - the InteractionInfo holding
information on the manipulation.
interaction identifiers
public int postAction(InteractionInfo interactionInfo,
java.util.List interactables)
InteractionContext
postAction in interface InteractionContextinteractionInfo - interactables -
public void paint(Renderer renderer,
Device device,
Transform2D xform_context)
InteractionContextInteractionContext to paint the current selection.
paint in interface InteractionContextrenderer - the Renderer to render withdevice - the Device to paint ontoxform_context - the transformation of the contextpublic void internalRemoveInteractionProvider(InteractionProvider interactionProvider)
InteractionContext
internalRemoveInteractionProvider in interface InteractionContextpublic void internalAddInteractionProvider(InteractionProvider interactionProvider)
InteractionContext
internalAddInteractionProvider in interface InteractionContextpublic InteractionItem internalGetCurrentInteractionItemFor(BaseInteractable interactable)
InteractionContext
internalGetCurrentInteractionItemFor in interface InteractionContextinteractable -
public void internalChangeDescriptor(BaseInteractable interactable,
java.util.List interactables_fixed,
InteractionDescriptor newDescriptor,
InteractionItem newItem)
InteractionContext
internalChangeDescriptor in interface InteractionContextinteractable - |param interactables_fixednewDescriptor - newItem -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||