edu.umd.cs.jazz
Class ZLayerGroup

java.lang.Object
  |
  +--edu.umd.cs.jazz.ZSceneGraphObject
        |
        +--edu.umd.cs.jazz.ZNode
              |
              +--edu.umd.cs.jazz.ZGroup
                    |
                    +--edu.umd.cs.jazz.ZLayerGroup
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, ZSerializable

public class ZLayerGroup
extends ZGroup
implements ZSerializable, java.io.Serializable

ZLayerGroup is used exclusively to specify the portion of the scenegraph that a camera can see. It has no other function.

Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.

Author:
Ben Bederson
See Also:
ZCamera, Serialized Form

Field Summary
 
Fields inherited from class edu.umd.cs.jazz.ZGroup
children, childrenFindable_DEFAULT, childrenPickable_DEFAULT, childrenVolatileBoundsCache, hasOneChild_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZNode
editorFactory, findable_DEFAULT, parent, pickable_DEFAULT, savable_DEFAULT, selectable_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject
bounds, inTransaction, invalidBounds, invalidVolatileBounds, listenerList, volatileBounds, volatileBounds_DEFAULT
 
Constructor Summary
ZLayerGroup()
          Constructs a new ZLayerGroup.
ZLayerGroup(ZNode child)
          Constructs a new layer group node with the specified node as a child of the new group.
 
Method Summary
protected  java.lang.Object duplicateObject()
          Returns a clone of this object.
 ZCamera[] getCameras()
          Return a copy of the array of cameras looking onto this layer.
protected  ZCamera[] getCamerasReference()
          Internal method to return a reference to the actual cameras looking onto this layer.
 int getNumCameras()
          Return the number of cameras of this group node.
 void repaint()
          Repaint causes the portions of the surfaces that this object appears in to be marked as needing painting, and queues events to cause those areas to be painted.
 void repaint(ZBounds repaintBounds)
          Method to pass repaint methods up the tree, and to any cameras looking here.
 void trimToSize()
          Trims the capacity of the array that stores the cameras list points to the actual number of points.
protected  void updateObjectReferences(ZObjectReferenceTable objRefTable)
          Called to update internal object references after a clone operation by ZSceneGraphObject.clone().
 
Methods inherited from class edu.umd.cs.jazz.ZGroup
addChild, addChildImpl, addChildren, addChildren, addGroupListener, childAddedNotification, childRemovedNotification, computeBounds, computeVolatileBounds, dump, extract, findNodes, getChild, getChildren, getChildrenFindable, getChildrenIterator, getChildrenPickable, getChildrenReference, getNumChildren, getShallowBounds, getVolatileBounds, hasOneChild, indexOf, insertAbove, iterator, lower, lowerTo, markInTransaction, markNotInTransaction, pick, raise, raiseTo, removeAllChildren, removeAllChildren, removeChild, removeChild, removeChild, removeChildImpl, removeGroupListener, removeNodeListener, render, setChildrenFindable, setChildrenPickable, setHasOneChild, setState, updateHasNodeListener, writeObject, writeObjectRecurse
 
Methods inherited from class edu.umd.cs.jazz.ZNode
addNodeListener, editor, getGlobalBounds, getGlobalToLocalTransform, getLocalToGlobalTransform, getParent, getRoot, globalToLocal, globalToLocal, globalToLocal, hasNodeListener, isAncestorOf, isDescendentOf, isFindable, isPickable, isSavable, isSelectable, localToGlobal, localToGlobal, localToGlobal, lower, lowerTo, percolateEventUpSceneGraph, raise, raiseTo, remove, reparent, replaceWith, setEditorFactory, setFindable, setParent, setPickable, setSavable, setSelectable, setVolatileBounds, updateBounds, updateVolatility, writeReplace
 
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject
addClientProperty, addMouseListener, addMouseMotionListener, clone, endTransaction, fireEvent, fireMouseEvent, getBounds, getBoundsReference, getClientProperty, getHandles, getListenerList, hasLisenerOfType, hasListenerOfType, hasMouseListener, processMouseEvent, putClientProperty, removeEventListener, removeMouseListener, removeMouseMotionListener, reshape, setBounds, startTransaction
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.umd.cs.jazz.io.ZSerializable
setState, writeObject, writeObjectRecurse
 

Constructor Detail

ZLayerGroup

public ZLayerGroup()
Constructs a new ZLayerGroup. The node must be attached to a live scenegraph (a scenegraph that is currently visible) order for it to be visible.


ZLayerGroup

public ZLayerGroup(ZNode child)
Constructs a new layer group node with the specified node as a child of the new group.

Parameters:
child - Child of the new group node.
Method Detail

duplicateObject

protected java.lang.Object duplicateObject()
Returns a clone of this object.

Overrides:
duplicateObject in class ZGroup
See Also:
ZSceneGraphObject.duplicateObject()

updateObjectReferences

protected void updateObjectReferences(ZObjectReferenceTable objRefTable)
Called to update internal object references after a clone operation by ZSceneGraphObject.clone().

Overrides:
updateObjectReferences in class ZSceneGraphObject
Parameters:
objRefTable - Table mapping from uncloned objects to their cloned versions.
See Also:
ZSceneGraphObject.updateObjectReferences(edu.umd.cs.jazz.util.ZObjectReferenceTable)

trimToSize

public void trimToSize()
Trims the capacity of the array that stores the cameras list points to the actual number of points. Normally, the cameras list arrays can be slightly larger than the number of points in the cameras list. An application can use this operation to minimize the storage of a cameras list.

Overrides:
trimToSize in class ZGroup

getCameras

public ZCamera[] getCameras()
Return a copy of the array of cameras looking onto this layer. This method always returns an array, even when there are no cameras.

Returns:
the cameras looking onto this layer

getCamerasReference

protected ZCamera[] getCamerasReference()
Internal method to return a reference to the actual cameras looking onto this layer. It should not be modified by the caller. Note that the actual number of cameras could be less than the size of the array. Determine the actual number of cameras with @link{#getNumCameras}.

Returns:
the cameras looking onto this layer.

getNumCameras

public int getNumCameras()
Return the number of cameras of this group node.

Returns:
the number of cameras.

repaint

public void repaint()
Repaint causes the portions of the surfaces that this object appears in to be marked as needing painting, and queues events to cause those areas to be painted. The painting does not actually occur until those events are handled. If this object is visible in multiple places because more than one camera can see this object, then all of those places are marked as needing painting.

Scenegraph objects should call repaint when their internal state has changed and they need to be redrawn on the screen.

Important note : Scenegraph objects should call reshape() instead of repaint() if the internal state change effects the bounds of the shape in any way (e.g. changing penwidth, selection, transform, adding points to a line, etc.)

Overrides:
repaint in class ZNode
See Also:
ZSceneGraphObject.reshape()

repaint

public void repaint(ZBounds repaintBounds)
Method to pass repaint methods up the tree, and to any cameras looking here. Repaints only the sub-portion of this object specified by the given ZBounds. Note that the input parameter may be modified as a result of this call.

Overrides:
repaint in class ZNode
Parameters:
repaintBounds - The bounds to repaint


Copyright � 2003 by University of Maryland, College Park, MD 20742, USA All rights reserved.