org.xith3d.selection
Class ActionList

java.lang.Object
  extended by org.xith3d.selection.ActionList

public class ActionList
extends java.lang.Object


Constructor Summary
ActionList()
           
 
Method Summary
 void addAction(int preferredPosition, Action action)
          Add an Action at the prefered position.
 void addAll(ActionList source)
           
 java.util.List<Action> getActions()
          Returns the Actions contained in this list in the order resulting from the preferred positions.
 boolean removeAction(Action action)
          Removes an Action from this list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionList

public ActionList()
Method Detail

addAll

public void addAll(ActionList source)

addAction

public void addAction(int preferredPosition,
                      Action action)
Add an Action at the prefered position. The position is not an index and adding two actions at the same position will result in both action to be displayed. If the list is displayed as Context menu, this means, that both Actions show below an Action with a lower preferedPosition and above an Action with a higher preferredPosition value. If an Action has the same ID property as an already contained action, this action is overwritten. This is useful for merging ActionLists from multiple selected Nodes.

Parameters:
action - the action to add
preferredPosition - the position in the list where the action should be displayed

removeAction

public boolean removeAction(Action action)
Removes an Action from this list.

Parameters:
action - the Action to be removed
Returns:
true, if the Action was contained in this list.

getActions

public java.util.List<Action> getActions()
Returns the Actions contained in this list in the order resulting from the preferred positions.

Returns:
A consolidated and sorted Action list