edu.umd.cs.jazz
Class ZLayoutGroup

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

public class ZLayoutGroup
extends ZVisualGroup
implements ZSerializable, java.io.Serializable

ZLayoutGroup is a visual group that wraps a layout manager that can position the node's children. The layout manager may also include a visual component that aids the layout. For instance, the tree layout manager adds links connecting the tree nodes.

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:
Ben Bederson
See Also:
Serialized Form

Fields inherited from class edu.umd.cs.jazz.ZVisualGroup
visualComponentPickable_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZGroup
children, childrenFindable_DEFAULT, childrenPickable_DEFAULT, hasOneChild_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZNode
findable_DEFAULT, pickable_DEFAULT, savable_DEFAULT, selectable_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject
bounds, listenerList, volatileBounds, volatileBounds_DEFAULT
 
Constructor Summary
ZLayoutGroup()
          Constructs a new empty layout group node.
ZLayoutGroup(ZNode child)
          Constructs a new layout group node with the specified node as a child of the new group.
ZLayoutGroup(ZNode child, ZGroup layoutChild)
          Constructs a new layout group node with the specified node as a child of the new group.
 
Method Summary
 void computeBounds()
          Trap computeBounds requests as it indicates that our layout is out of date, and needs to be revalidated.
 void doLayout()
          Causes the children of the specified layout node to be laid out.
protected  void doLayoutInternal(ZNode node)
          Internal method to recursively search children to look for layout nodes, and apply the layout if found.
protected  java.lang.Object duplicateObject()
          Returns a clone of this object.
 ZGroup getLayoutChild()
          Returns the current layout child for this node.
 ZLayoutManager getLayoutManager()
          Returns the current layout manager for this node.
 void invalidate()
          Specify that this layout group is out of date, and needs to be revalidated.
 void setLayoutChild(ZGroup child)
          Specifies the layout child for this node.
 void setLayoutManager(ZLayoutManager manager)
          Specifies the layout manager for this 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.
protected  void updateObjectReferences(ZObjectReferenceTable objRefTable)
          Called to update internal object references after a clone operation by ZSceneGraphObject.clone().
 void validate()
          Force an immediate validation of this layout node (if it was invalidated).
 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.ZVisualGroup
getBackVisualComponent, getBackVisualComponentBounds, getBackVisualComponentGlobalBounds, getFrontVisualComponent, getFrontVisualComponentBounds, getFrontVisualComponentGlobalBounds, getShallowBounds, isBackVisualComponentPickable, isFrontVisualComponentPickable, pick, render, setBackVisualComponent, setBackVisualComponentPickable, setFrontVisualComponent, setFrontVisualComponentPickable, updateVolatility
 
Methods inherited from class edu.umd.cs.jazz.ZGroup
addChild, addChildImpl, addChildren, addGroupListener, childAddedNotification, childRemovedNotification, dump, extract, findNodes, getChild, getChildren, getChildrenFindable, getChildrenIterator, getChildrenPickable, getChildrenReference, getNumChildren, getVolatileBounds, hasOneChild, indexOf, insertAbove, iterator, lower, lowerTo, raise, raiseTo, removeAllChildren, removeChild, removeChild, removeChild, removeChildImpl, removeGroupListener, removeNodeListener, setChildrenFindable, setChildrenPickable, setHasOneChild, trimToSize, updateHasNodeListener
 
Methods inherited from class edu.umd.cs.jazz.ZNode
addClientProperty, addNodeListener, editor, getClientProperty, getGlobalBounds, getGlobalToLocalTransform, getLocalToGlobalTransform, getParent, getRoot, globalToLocal, globalToLocal, hasNodeListener, isAncestorOf, isDescendentOf, isFindable, isPickable, isSavable, isSelectable, localToGlobal, localToGlobal, lower, lowerTo, percolateEventUpSceneGraph, putClientProperty, raise, raiseTo, remove, repaint, repaint, repaint, reparent, replaceWith, setEditorFactory, setFindable, setParent, setPickable, setSavable, setSelectable, updateBounds, writeReplace
 
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject
addMouseListener, addMouseMotionListener, clone, fireEvent, fireMouseEvent, getBounds, getBoundsReference, getListenerList, hasLisenerOfType, hasMouseListener, processMouseEvent, removeEventListener, removeMouseListener, removeMouseMotionListener, reshape, setBounds, setVolatileBounds
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZLayoutGroup

public ZLayoutGroup()
Constructs a new empty layout group node.

ZLayoutGroup

public ZLayoutGroup(ZNode child)
Constructs a new layout group node with the specified node as a child of the new group. This group will apply its layout manager (if there is one) to the children of its layoutChild node (or itself if there isn't one).
Parameters:
child - Child of the new group node.
See Also:
setLayoutChild(edu.umd.cs.jazz.ZGroup)

ZLayoutGroup

public ZLayoutGroup(ZNode child,
                    ZGroup layoutChild)
Constructs a new layout group node with the specified node as a child of the new group. This group will apply its layout manager (if there is one) to the children of its layoutChild node (or itself if there isn't one).
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 ZVisualGroup
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 ZNode
See Also:
ZSceneGraphObject.updateObjectReferences(edu.umd.cs.jazz.util.ZObjectReferenceTable)

setLayoutManager

public void setLayoutManager(ZLayoutManager manager)
Specifies the layout manager for this node.
Parameters:
manager - The new layout manager.

getLayoutManager

public final ZLayoutManager getLayoutManager()
Returns the current layout manager for this node.
Returns:
The current layout manager.

setLayoutChild

public void setLayoutChild(ZGroup child)
Specifies the layout child for this node. This node's layout manager will apply to the children of the specified child. If no layout child is specified, then the layout will apply to this node's children.
Parameters:
child - The new layout child.

getLayoutChild

public final ZGroup getLayoutChild()
Returns the current layout child for this node.
Returns:
The current layout child.

invalidate

public void invalidate()
Specify that this layout group is out of date, and needs to be revalidated. A request will be made to apply the group's layout.

validate

public void validate()
Force an immediate validation of this layout node (if it was invalidated). This will result in this node's layout being applied immediately if it was out of date, and any queued requests to layout this node will be removed.

computeBounds

public void computeBounds()
Trap computeBounds requests as it indicates that our layout is out of date, and needs to be revalidated.
Overrides:
computeBounds in class ZVisualGroup

doLayout

public void doLayout()
Causes the children of the specified layout node to be laid out. It performs a depth-first layout, doing children first, and parents last, recursively checking to see if the children have layout groups, and if so, laying them out. If there is no layout manager for this node, then nothing happens.
See Also:
getLayoutManager(), setLayoutChild(edu.umd.cs.jazz.ZGroup)

doLayoutInternal

protected void doLayoutInternal(ZNode node)
Internal method to recursively search children to look for layout nodes, and apply the layout if found.
Parameters:
node - The node to check for layout

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 ZVisualGroup
Parameters:
out - The stream that this object writes into

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 ZVisualGroup
Parameters:
out - The stream that this object writes into

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 ZVisualGroup
Parameters:
fieldType - The fully qualified type of the field
fieldName - The name of the field
fieldValue - The value of the field


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