camera3d
Class SelectionList

java.lang.Object
  extended bycamera3d.SelectionList
All Implemented Interfaces:
PickListener, SceneObjectsChangeListener

public class SelectionList
extends java.lang.Object
implements SceneObjectsChangeListener, PickListener

This class keeps track of which objects are selected in the scene. It acts as a manager for selection activities. It must register itself with a J3DBase object so it gets informed of the list of scene graph objects. SelectionList is also the object which should receive input from mouse picking objects, by means of the PickListener interface. It interacts with graphical components dedicated to selection/edition of objects, receiving requests to selected/unselect certain objects and notifying interested listeners of changes made to the group of selected scene graph objects.

Version:
1.0
Author:
Fábio Roberto de Miranda

Constructor Summary
SelectionList()
          Creates a new SelectionList, both sceneObjects and selectedObjects remain empty.
 
Method Summary
 void addSelectionChangeListener(SelectionChangeListener listener)
          Adds listener to the list of objects notified when scene graph objects get (un)selected.
 void addToSelectedObjects(VcObject vcObj)
          Adds vcObj to selected objects list.
 void flushSelection()
          Clears current selection.
 java.util.List getSelectedObjects()
          Returns list of objects currently selected.
 boolean getSingleObjectSelectionMode()
          Returns flag indicating whether multi-object selection is permitted.
 void pickingOcurred(int mod, java.util.List pickedObjects)
          Called when a picking action is performed.
 void removeFromSelectedObjects(VcObject vcObj)
          Removes the input object from list of selected objects.
 void sceneObjectsChanged(SceneObjectsChangedEvent event)
          Informs SelectionList of changes in the list of objects in the scene graph.
 void setSceneObjects(java.util.List sceneObjects)
          Sets list of objects currently in the scene graph.
 void setSingleObjectSelectionMode(boolean b)
          Sets flag which controls whether multi-object selection is permitted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionList

public SelectionList()
Creates a new SelectionList, both sceneObjects and selectedObjects remain empty.

Method Detail

sceneObjectsChanged

public void sceneObjectsChanged(SceneObjectsChangedEvent event)
Informs SelectionList of changes in the list of objects in the scene graph. In case an object has been removed from the scene graph notifyChangeListeners will be called by the end of execution. Method from sceneObjectsChangeListener interface.

Specified by:
sceneObjectsChanged in interface SceneObjectsChangeListener

pickingOcurred

public void pickingOcurred(int mod,
                           java.util.List pickedObjects)
Called when a picking action is performed. Informs selection list of picked objects and modifiers applied during picking. Method from PickListener interface.

Specified by:
pickingOcurred in interface PickListener
Parameters:
mod - modifiers, as defined in java.awt.event.MouseEvent
pickedObjects - list of VcObjects hit by the picking operation

addToSelectedObjects

public void addToSelectedObjects(VcObject vcObj)
Adds vcObj to selected objects list.


removeFromSelectedObjects

public void removeFromSelectedObjects(VcObject vcObj)
Removes the input object from list of selected objects. The object is unselected and listeners are notified.


flushSelection

public void flushSelection()
Clears current selection. All objects currently selected are unselected, listeners are notified.


getSelectedObjects

public java.util.List getSelectedObjects()
Returns list of objects currently selected.


setSceneObjects

public void setSceneObjects(java.util.List sceneObjects)
Sets list of objects currently in the scene graph.

Parameters:
sceneObjects - List of VcObjects.

setSingleObjectSelectionMode

public void setSingleObjectSelectionMode(boolean b)
Sets flag which controls whether multi-object selection is permitted.


getSingleObjectSelectionMode

public boolean getSingleObjectSelectionMode()
Returns flag indicating whether multi-object selection is permitted.


addSelectionChangeListener

public void addSelectionChangeListener(SelectionChangeListener listener)
Adds listener to the list of objects notified when scene graph objects get (un)selected.



Copyright © 2001-2003 F.R. Miranda, C.S. Santos, J.E. Kogler Jr.. All Rights Reserved.