Jazz API Documentation

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.io.Serializable, ZSerializable

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

ZLayoutGroup is a group node that can layout the children of a specified node.

See Also:
Serialized Form

Fields inherited from class edu.umd.cs.jazz.ZVisualGroup
visualComponentPickable_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZGroup
childrenFindable_DEFAULT, childrenPickable_DEFAULT, hasOneChild_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZNode
findable_DEFAULT, listenerList, pickable_DEFAULT, savable_DEFAULT
 
Fields inherited from class edu.umd.cs.jazz.ZSceneGraphObject
bounds, objRefTable, 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
 java.lang.Object clone()
          Duplicates the current node by using the copy constructor.
 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.
 void duplicateObject(ZLayoutGroup refNode)
          Copies all object information from the reference object into the current 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.
 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
duplicateObject, getBackVisualComponent, getBackVisualComponentBounds, getBackVisualComponentGlobalBounds, getFrontVisualComponent, getFrontVisualComponentBounds, getFrontVisualComponentGlobalBounds, isBackVisualComponentPickable, isFrontVisualComponentPickable, pick, render, setBackVisualComponent, setBackVisualComponentPickable, setFrontVisualComponent, setFrontVisualComponentPickable, updateVolatility
 
Methods inherited from class edu.umd.cs.jazz.ZGroup
addChild, addGroupListener, dump, duplicateObject, fireGroupEvent, getChild, getChildren, getChildrenFindable, getChildrenIterator, getChildrenPickable, getNumChildren, hasOneChild, indexOf, insertAbove, lower, lowerTo, raise, raiseTo, remove, removeChild, removeGroupListener, setChildrenFindable, setChildrenPickable, setHasOneChild, trimToSize
 
Methods inherited from class edu.umd.cs.jazz.ZNode
addClientProperty, addMouseListener, addMouseMotionListener, duplicateObject, editor, fireMouseEvent, getClientProperty, getGlobalBounds, getGlobalToLocalTransform, getLocalToGlobalTransform, getParent, getRoot, globalToLocal, globalToLocal, hasMouseListener, isAncestorOf, isDescendentOf, isFindable, isPickable, isSavable, localToGlobal, localToGlobal, lower, lowerTo, putClientProperty, raise, raiseTo, removeMouseListener, removeMouseMotionListener, repaint, repaint, reparent, replaceWith, setEditorFactory, setFindable, setParent, setPickable, setSavable, updateBounds, updateObjectReferences, writeReplace
 
Methods inherited from class edu.umd.cs.jazz.ZSceneGraphObject
duplicateObject, getBounds, getVolatileBounds, reshape, 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

public void duplicateObject(ZLayoutGroup refNode)
Copies all object information from the reference object into the current object. This method is called from the clone method. All ZSceneGraphObjects objects contained by the object being duplicated are duplicated, except parents which are set to null. This results in the sub-tree rooted at this object being duplicated.
Parameters:
refNode - The reference node to copy

clone

public java.lang.Object clone()
Duplicates the current node by using the copy constructor. The portion of the reference node that is duplicated is that necessary to reuse the node in a new place within the scenegraph, but the new node is not inserted into any scenegraph. The node must be attached to a live scenegraph (a scenegraph that is currently visible) or be registered with a camera directly in order for it to be visible.

In particular, the visual component associated with this group gets duplicated along with the subtree.

Overrides:
clone in class ZVisualGroup
Returns:
A copy of this node.
See Also:
ZNode.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

Jazz API Documentation