|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.graph.layout.AbstractGlobalLayout
diva.graph.layout.LevelLayout
public class LevelLayout
A level-based layout algorithm originally implemented by Ulfar Erlingsson at Cornell/RPI and modified to fit into this system.
The algorithm is structured in the following way:
Nested Class Summary | |
---|---|
class |
LevelLayout.LevelData
|
static class |
LevelLayout.LevelInfo
The semantic object of each node in the graph copy that is being layed out. |
Field Summary | |
---|---|
protected int |
_orientation
Keep track of the orientation; vertical by default. |
static int |
HORIZONTAL
Layout the graph in levels from left to right. |
static int |
VERTICAL
Layout the graph in levels from top to bottom. |
Constructor Summary | |
---|---|
LevelLayout(LayoutTarget target)
Construct a new levelizing layout with a vertical orientation. |
Method Summary | |
---|---|
void |
applyLayout(LevelLayout.LevelData levelData,
Object g)
Place the nodes in the target environment according to their levels and sorting order which are specified in levelData. |
void |
applyLayout(LevelLayout.LevelData levelData,
Object g,
boolean useDummies)
Place the nodes in the target environment according to their levels and sorting order which are specified in levelData. |
LevelLayout.LevelData |
calculateLayout(Object composite)
This method performs levelizing layout on the given composite. |
protected Object |
copyComposite(Object origComposite)
Copy the given graph and make the nodes/edges in the copied graph point to the nodes/edges in the original. |
protected void |
copyLayout(Object origComposite,
Object copyComposite)
Take the layout generated by the core layout algorithm and copy it back into the view of the original composite passed in by the user. |
BasicGraphModel |
getLocalGraphModel()
Return the local graph model. |
int |
getOrientation()
Return the orientation in which the graph is to be layed out, either VERTICAL or HORIZONTAL. |
boolean |
getRandomizedPlacement()
Return whether or not placement will be randomized. |
boolean |
isVisited(Object node)
|
void |
layout(Object composite)
Perform the levelizing layout on the given composite in the given target environment. |
void |
setAllVisited(Object composite,
boolean val)
|
void |
setOrientation(int o)
Set the orientation in which the graph is to be layed out, either VERTICAL or HORIZONTAL. |
void |
setRandomizedPlacement(boolean flag)
Set whether or not placement will be randomized. |
void |
setVisited(Object node,
boolean val)
|
Methods inherited from class diva.graph.layout.AbstractGlobalLayout |
---|
getLayoutTarget, setLayoutTarget |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int VERTICAL
setOrientation(int)
,
Constant Field Valuespublic static final int HORIZONTAL
setOrientation(int)
,
Constant Field Valuesprotected int _orientation
Constructor Detail |
---|
public LevelLayout(LayoutTarget target)
Method Detail |
---|
protected Object copyComposite(Object origComposite)
protected void copyLayout(Object origComposite, Object copyComposite)
public BasicGraphModel getLocalGraphModel()
public int getOrientation()
public boolean getRandomizedPlacement()
public void layout(Object composite)
layout
in interface GlobalLayout
layout
in class AbstractGlobalLayout
public LevelLayout.LevelData calculateLayout(Object composite)
public void applyLayout(LevelLayout.LevelData levelData, Object g)
public void applyLayout(LevelLayout.LevelData levelData, Object g, boolean useDummies)
public void setOrientation(int o)
public void setRandomizedPlacement(boolean flag)
public void setVisited(Object node, boolean val)
public void setAllVisited(Object composite, boolean val)
public boolean isVisited(Object node)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |