edu.umd.cs.jazz
Class ZNameGroup

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

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

ZNameGroup is a group node that names a portion of the scenegraph. A name group node can be inserted into the tree when an application wants to assign a name to that section of the scenegraph. A static method ZNameGroup.getNameGroup(String name) returns the name group node associated with the specified name.

ZSceneGraphEditor provides a convenience mechanism to locate, create and manage nodes of this type.

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:
Jim Mokwa
See Also:
getNameGroup(String), Serialized Form

Field Summary
protected  java.lang.String name
          The name of this ZNameGroup node.
protected static java.util.Hashtable nameHash
          Hashtable whose key is String name, value is reference to ZNameGroup node.
 
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
ZNameGroup()
          Constructs a new empty name group node.
ZNameGroup(java.lang.String name)
          Constructs a new name group node with the given name.
ZNameGroup(ZNode child)
          Constructs a new name group node with the specified node as a child of the new group.
ZNameGroup(ZNode child, java.lang.String name)
          Constructs a new name group node with the specified node as a child of the new group, and with the specified name.
 
Method Summary
 java.lang.String getName()
          Get the name associated with this name group node.
static ZNameGroup getNameGroup(java.lang.String name)
          Returns the ZNameGroup node associated with the specified name.
 void setName(java.lang.String aName)
          Set the name of this nameGroup node.
 void setState(java.lang.String fieldType, java.lang.String fieldName, java.lang.Object fieldValue)
          Set some state of this object as it gets read back in.
 void writeObject(ZObjectOutputStream out)
          Write out all of this object's state.
 void writeObjectRecurse(ZObjectOutputStream out)
          Specify which objects this object references in order to write out the scenegraph properly
 
Methods inherited from class edu.umd.cs.jazz.ZGroup
addChild, addChildImpl, addChildren, addChildren, addGroupListener, childAddedNotification, childRemovedNotification, computeBounds, computeVolatileBounds, dump, duplicateObject, 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, trimToSize, updateHasNodeListener
 
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, repaint, repaint, 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, updateObjectReferences
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameHash

protected static java.util.Hashtable nameHash
Hashtable whose key is String name, value is reference to ZNameGroup node.


name

protected java.lang.String name
The name of this ZNameGroup node.

Constructor Detail

ZNameGroup

public ZNameGroup()
Constructs a new empty name group node.


ZNameGroup

public ZNameGroup(java.lang.String name)
Constructs a new name group node with the given name.

Parameters:
name - The name of this group node.

ZNameGroup

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

Parameters:
child - Child of the new group node.

ZNameGroup

public ZNameGroup(ZNode child,
                  java.lang.String name)
Constructs a new name group node with the specified node as a child of the new group, and with the specified name.

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

getNameGroup

public static ZNameGroup getNameGroup(java.lang.String name)
Returns the ZNameGroup node associated with the specified name.

Parameters:
name - The name associated with some ZNameGroup node.
Returns:
the ZNameGroup node associated with the specified name.

setName

public void setName(java.lang.String aName)
Set the name of this nameGroup node. This name replaces any old name for this node. If this name had previously been assigned to another node, it will now be associated with this node.

Parameters:
aName - The new name of this nameGroup node.

getName

public java.lang.String getName()
Get the name associated with this name group node.

Returns:
a String containing the name of this name group node.

writeObject

public void writeObject(ZObjectOutputStream out)
                 throws java.io.IOException
Write out all of this object's state.

Specified by:
writeObject in interface ZSerializable
Overrides:
writeObject in class ZGroup
Parameters:
out - The stream that this object writes into
java.io.IOException

writeObjectRecurse

public void writeObjectRecurse(ZObjectOutputStream out)
                        throws java.io.IOException
Specify which objects this object references in order to write out the scenegraph properly

Specified by:
writeObjectRecurse in interface ZSerializable
Overrides:
writeObjectRecurse in class ZGroup
Parameters:
out - The stream that this object writes into
java.io.IOException

setState

public void setState(java.lang.String fieldType,
                     java.lang.String fieldName,
                     java.lang.Object fieldValue)
Set some state of this object as it gets read back in. After the object is created with its default no-arg constructor, this method will be called on the object once for each bit of state that was written out through calls to ZObjectOutputStream.writeState() within the writeObject method.

Specified by:
setState in interface ZSerializable
Overrides:
setState in class ZGroup
Parameters:
fieldType - The fully qualified type of the field
fieldName - The name of the field
fieldValue - The value of the field


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