com.tensegrity.graphics.interaction
Interface InteractionDescriptor

All Known Implementing Classes:
DefaultInteractionDescriptor

public interface InteractionDescriptor

An InteractionDescriptor accumulates several InteractionItems. It is returned by an object that implements the BaseInteractable interface.


NOTICE:This class is subject of reconstruction such that it might change in the near future. It is recommended not to make to much use of it.

Version:
$Id: InteractionDescriptor.java,v 1.7 2005/04/01 15:42:39 MichaelKegel Exp $
Author:
MichaelKegel
See Also:
InteractionItem, BaseInteractable

Field Summary
static int ITEM_INDEX_NONE
          constant that defines a non existing index
 
Method Summary
 void addItem(InteractionItem item)
          Adds the item given by item to the InteractionDescriptor.
 InteractionItem getItem(int index)
          Returns the InteractionItem at the index given by index.
 InteractionItem getMoveItem()
          Returns the InteractionItem that moves the BaseInteractable or null if there is no item that moves the whole BaseInteractable.
 int indexOf(InteractionItem item)
          Returns the index for the InteractionItem given by item.
 int indexOfMoveItem()
          Returns the index of the 'move' InteractionItem or ITEM_INDEX_NONE if no 'move' InteractionItem is available.
 int itemCount()
          Returns the number of InteractionItems currently available for the InteractionDescriptor.
 java.util.Iterator iteratorItems()
          This method returns an iterator which steps over the InteractionItems provided by this InteractionDescriptor object.
 void removeItem(int index)
          Removes the item at the index given by index from the InteractionDescriptor.
 void removeItem(InteractionItem item)
          Removes the InteractionItem given by item from the InteractionDescriptor.
 

Field Detail

ITEM_INDEX_NONE

public static final int ITEM_INDEX_NONE
constant that defines a non existing index

See Also:
Constant Field Values
Method Detail

itemCount

public int itemCount()
Returns the number of InteractionItems currently available for the InteractionDescriptor.

Returns:
int the current number of InteractionItems

indexOf

public int indexOf(InteractionItem item)
Returns the index for the InteractionItem given by item.

Parameters:
item - the InteractionItem to return the index for
Returns:
int the index of the InteractionItem

indexOfMoveItem

public int indexOfMoveItem()
Returns the index of the 'move' InteractionItem or ITEM_INDEX_NONE if no 'move' InteractionItem is available.

Returns:
the index of the 'move' InteractionItem or ITEM_INDEX_NONE

getItem

public InteractionItem getItem(int index)
Returns the InteractionItem at the index given by index.

Parameters:
index - the index of the InteractionItem to return
Returns:
InteractionIten the InteractionItem at the given index

addItem

public void addItem(InteractionItem item)
Adds the item given by item to the InteractionDescriptor.

Parameters:
item - the InteractionItem to add

removeItem

public void removeItem(int index)
Removes the item at the index given by index from the InteractionDescriptor.

Parameters:
index - the index of the InteractionItem to remove

removeItem

public void removeItem(InteractionItem item)
Removes the InteractionItem given by item from the InteractionDescriptor.

Parameters:
item - the InteactionDescriptor to remove

iteratorItems

public java.util.Iterator iteratorItems()
This method returns an iterator which steps over the InteractionItems provided by this InteractionDescriptor object.

Returns:
Iterator object for all stored items in this descriptor

getMoveItem

public InteractionItem getMoveItem()
Returns the InteractionItem that moves the BaseInteractable or null if there is no item that moves the whole BaseInteractable.

Returns:
InteractionItem null or the item that moves the BaseInteractable


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.