edu.umd.cs.jazz.scenegraph
Class ZLayoutManagerTree

java.lang.Object
  |
  +--edu.umd.cs.jazz.scenegraph.ZLayoutManagerTree

public class ZLayoutManagerTree
extends java.lang.Object
implements ZLayoutManager

ZLayoutManagerTree implements a generic tree layout manager that can layout hierarchical Jazz objects.


Field Summary
protected static java.util.Hashtable areaManager
           
protected static int currentHeadStyle
           
protected static int currentOrientation
           
protected static float currentXSpacing
           
protected static float currentYSpacing
           
static float DEFAULT_LeftMostPos
           
static float DEFAULT_TopMostPos
           
static float DEFAULT_XSpacing
           
static float DEFAULT_YSpacing
           
static int Heading_IN
           
static int Heading_OUT
           
static int Heading_SIDE
           
static int link_ANGLEDLINE
           
static int link_STRAIGHTLINE
           
protected static boolean linkVisible
           
static int Orientation_LEFTRIGHT
           
static int Orientation_TOPDOWN
           
 
Constructor Summary
ZLayoutManagerTree()
          Default constructor, calls a longer version with all the default settings.
ZLayoutManagerTree(int orientation, int headingStyle, boolean showLink, int linkStyle)
          Constructor with all the custom options
 
Method Summary
 void doLayout(ZNode node)
          The tree layout algorithm.
static int getCurrentHeadStyle()
           
static int getCurrentOrientation()
          Get the current orientation.
static float getCurrentXSpacing()
           
static float getCurrentYSpacing()
           
static int getZLinkStyle()
          Get the value of ZLinkStyle.
static boolean setCurrentHeadingStyle(int h)
           
static boolean setCurrentOrientation(int orientation)
          Set the current orientation.
static boolean setCurrentXSpacing(float x)
           
static boolean setCurrentYSpacing(float y)
           
static boolean setZLinkStyle(int v)
          Set the value of ZLinkStyle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Orientation_TOPDOWN

public static final int Orientation_TOPDOWN

Orientation_LEFTRIGHT

public static final int Orientation_LEFTRIGHT

link_STRAIGHTLINE

public static final int link_STRAIGHTLINE

link_ANGLEDLINE

public static final int link_ANGLEDLINE

currentOrientation

protected static int currentOrientation

Heading_IN

public static final int Heading_IN

Heading_OUT

public static final int Heading_OUT

Heading_SIDE

public static final int Heading_SIDE

currentHeadStyle

protected static int currentHeadStyle

DEFAULT_XSpacing

public static final float DEFAULT_XSpacing

DEFAULT_YSpacing

public static final float DEFAULT_YSpacing

currentXSpacing

protected static float currentXSpacing

currentYSpacing

protected static float currentYSpacing

DEFAULT_LeftMostPos

public static final float DEFAULT_LeftMostPos

DEFAULT_TopMostPos

public static final float DEFAULT_TopMostPos

areaManager

protected static java.util.Hashtable areaManager

linkVisible

protected static boolean linkVisible
Constructor Detail

ZLayoutManagerTree

public ZLayoutManagerTree()
Default constructor, calls a longer version with all the default settings.

ZLayoutManagerTree

public ZLayoutManagerTree(int orientation,
                          int headingStyle,
                          boolean showLink,
                          int linkStyle)
Constructor with all the custom options
Parameters:
orientation - the orientation style
headingStyle - the heading style
showLink - switch to control whether link is visible
linkStyle - the link style
Method Detail

setCurrentOrientation

public static boolean setCurrentOrientation(int orientation)
Set the current orientation. If the orientation is not supported, nothing will happen.
Parameters:
orientation - the orientation want to set
Returns:
true if orientation set, false if orientation not supported.

getCurrentOrientation

public static int getCurrentOrientation()
Get the current orientation.
Returns:
returns the current orientation for this tree

setCurrentHeadingStyle

public static boolean setCurrentHeadingStyle(int h)
Parameters:
h - the heading style want to set
Returns:
true if set successfuly, false otherwise

getCurrentHeadStyle

public static int getCurrentHeadStyle()
Returns:
the current heading style

setCurrentXSpacing

public static boolean setCurrentXSpacing(float x)
Parameters:
x - the value for x spacing -- horizontal spacing
Returns:
true if set successfuly, false otherwise

setCurrentYSpacing

public static boolean setCurrentYSpacing(float y)
Parameters:
y - the value for y spacing -- horizontal spacing
Returns:
true if set successfuly, false otherwise

getCurrentXSpacing

public static float getCurrentXSpacing()
Returns:
current x spacing

getCurrentYSpacing

public static float getCurrentYSpacing()
Returns:
current y spacing

getZLinkStyle

public static int getZLinkStyle()
Get the value of ZLinkStyle.
Returns:
Value of ZLinkStyle.

setZLinkStyle

public static boolean setZLinkStyle(int v)
Set the value of ZLinkStyle.
Parameters:
v - Value to assign to ZLinkStyle.
Returns:
true if set successfuly

doLayout

public void doLayout(ZNode node)
The tree layout algorithm. Layout will place this node at anchor place first, and layout all its children alone the base line, and translate them so that this node will sit in the middle (according to heading style.)
Specified by:
doLayout in interface ZLayoutManager
Parameters:
node - the node that needs to lay out its children