Jazz API Documentation

edu.umd.cs.jazz
Class ZPathLayoutManager

java.lang.Object
  |
  +--edu.umd.cs.jazz.ZPathLayoutManager
All Implemented Interfaces:
ZLayoutManager, ZSerializable

public class ZPathLayoutManager
extends java.lang.Object
implements ZLayoutManager, ZSerializable

ZPathLayoutManager positions a set of nodes along a path.

See Also:
ZNode, ZLayout

Constructor Summary
ZPathLayoutManager()
          Default Constructor - uses default values unless specifically set
 
Method Summary
 void doLayout(ZGroup node)
          Apply this manager's layout algorithm to the specified node's children.
 boolean getClosed()
           
 boolean getExact()
           
 float getFlatness()
           
 java.awt.Shape getShape()
           
 float getSpace()
           
 float getTolerance()
           
 void postLayout(ZGroup node)
          Notify the layout manager that the layout for this node has finished This is called after all children and the node itself are layed out.
 void preLayout(ZGroup node)
          Notify the layout manager that a potentially recursive layout is starting.
 void setClosed(boolean closed)
          Sets whether the path is closed to closed
 void setExact(boolean exact)
          Sets whether the algorithm should iterate to get exact spacing or should run once
 void setFlatness(float flatness)
           
 void setShape(java.awt.Shape shape)
          Sets the shape that this layout manager will use.
 void setSpacing(float space)
           
 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 setTolerance(float tolerance)
           
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZPathLayoutManager

public ZPathLayoutManager()
Default Constructor - uses default values unless specifically set
Method Detail

preLayout

public void preLayout(ZGroup node)
Notify the layout manager that a potentially recursive layout is starting. This is called before any children are layed out.
Specified by:
preLayout in interface ZLayoutManager
Parameters:
The - node to apply this layout algorithm to.

postLayout

public void postLayout(ZGroup node)
Notify the layout manager that the layout for this node has finished This is called after all children and the node itself are layed out.
Specified by:
postLayout in interface ZLayoutManager
Parameters:
The - node to apply this layout algorithm to.

doLayout

public void doLayout(ZGroup node)
Apply this manager's layout algorithm to the specified node's children.
Specified by:
doLayout in interface ZLayoutManager
Parameters:
node - The node to apply this layout algorithm to.

getClosed

public boolean getClosed()
Returns:
Is the path closed?

setClosed

public void setClosed(boolean closed)
Sets whether the path is closed to closed
Parameters:
closed - Is the path closed?

getFlatness

public float getFlatness()
Returns:
The current flatness of the FlatteningPathIterator used to convert the Shape to points

setFlatness

public void setFlatness(float flatness)
Parameters:
flatness - Sets the flatness of the FlatteninPathIterator used to convert the Shape to points

getExact

public boolean getExact()
Returns:
Is exact spacing specified

setExact

public void setExact(boolean exact)
Sets whether the algorithm should iterate to get exact spacing or should run once
Parameters:
exact - Whether exact spacing is specified.

getTolerance

public float getTolerance()
Returns:
The tolerance allowed if exact spacing is specified.

setTolerance

public void setTolerance(float tolerance)
Parameters:
tolerance - The tolerance allowed if exact spacing is specified.

getShape

public java.awt.Shape getShape()
Returns:
The shape currently in use by this object.

setShape

public void setShape(java.awt.Shape shape)
Sets the shape that this layout manager will use. Gets the points from this shape using a FlatteningPathIterator with flatness constant of 1.0 by default.
Parameters:
s - The desired layout shape

getSpace

public float getSpace()
Returns:
The current spacing used by the layout algorithm during its first iteration.

setSpacing

public void setSpacing(float space)
Parameters:
space - The spacing used by the layout algorithm during its first iteration.

writeObject

public void writeObject(ZObjectOutputStream out)
                 throws java.io.IOException
Write out all of this object's state.
Specified by:
writeObject in interface ZSerializable
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
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
Parameters:
fieldType - The fully qualified type of the field
fieldName - The name of the field
fieldValue - The value of the field

Jazz API Documentation