edu.cmu.sun.animation
Class CleanupAction

java.lang.Object
  extended by edu.cmu.sun.animation.CleanupAction

public class CleanupAction
extends java.lang.Object

This action removes component from a scenegraph. Removing components can be tricky because it can take a nontrivial amount of time, and you may want to remove many components at the same time. In order to acomplish this effect, we perform the component removal in two steps. First, the component is hidden, then on the second pass, the component is removed from the scene graph. Because setting the visible state of a component is fast, all components appear to disapear at the same time.

Author:
Braden Kowitz

Field Summary
(package private)  Component3D child
          The child to be removed from the scene graph
(package private)  Component3D parent
          The parent, from which the child be removed.
 
Constructor Summary
CleanupAction(Component3D itemToCleanup, Component3D parentOfItem)
          Create a new cleanup action.
 
Method Summary
 void cleanup()
          Removes the specified component from the scene graph.
 void hide()
          Makes the component to be removed invisible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

child

Component3D child
The child to be removed from the scene graph


parent

Component3D parent
The parent, from which the child be removed.

Constructor Detail

CleanupAction

public CleanupAction(Component3D itemToCleanup,
                     Component3D parentOfItem)
Create a new cleanup action.

Parameters:
itemToCleanup - Component to be removed from the scenegraph.
parentOfItem - Parent component which will have a child removed.
Method Detail

hide

public void hide()
Makes the component to be removed invisible.


cleanup

public void cleanup()
Removes the specified component from the scene graph.