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.
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 |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
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
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 styleheadingStyle
- the heading styleshowLink
- switch to control whether link is visiblelinkStyle
- the link style
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