public class LevelLayout extends AbstractGlobalLayout
The algorithm is structured in the following way:
Modifier and Type | Class and Description |
---|---|
class |
LevelLayout.LevelData |
static class |
LevelLayout.LevelInfo
The semantic object of each node in the graph copy that is
being laid out.
|
Modifier and Type | Field and Description |
---|---|
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.
|
_layoutTarget
Constructor and Description |
---|
LevelLayout(LayoutTarget target)
Construct a new levelizing layout with a vertical orientation.
|
Modifier and Type | Method and Description |
---|---|
void |
applyLayout(LevelLayout.LevelData levelData,
java.lang.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,
java.lang.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(java.lang.Object composite)
This method performs levelizing layout on the given composite.
|
protected java.lang.Object |
copyComposite(java.lang.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(java.lang.Object origComposite,
java.lang.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 laid out,
either VERTICAL or HORIZONTAL.
|
boolean |
getRandomizedPlacement()
Return whether or not placement will be randomized.
|
boolean |
isVisited(java.lang.Object node) |
void |
layout(java.lang.Object composite)
Perform the levelizing layout on the given composite in the given
target environment.
|
void |
setAllVisited(java.lang.Object composite,
boolean val) |
void |
setOrientation(int o)
Set the orientation in which the graph is to be laid out,
either VERTICAL or HORIZONTAL.
|
void |
setRandomizedPlacement(boolean flag)
Set whether or not placement will be randomized.
|
void |
setVisited(java.lang.Object node,
boolean val) |
getLayoutTarget, setLayoutTarget
public static final int VERTICAL
setOrientation(int)
,
Constant Field Valuespublic static final int HORIZONTAL
setOrientation(int)
,
Constant Field Valuesprotected int _orientation
public LevelLayout(LayoutTarget target)
protected java.lang.Object copyComposite(java.lang.Object origComposite)
protected void copyLayout(java.lang.Object origComposite, java.lang.Object copyComposite)
public BasicGraphModel getLocalGraphModel()
public int getOrientation()
public boolean getRandomizedPlacement()
public void layout(java.lang.Object composite)
layout
in interface GlobalLayout
layout
in class AbstractGlobalLayout
public LevelLayout.LevelData calculateLayout(java.lang.Object composite)
public void applyLayout(LevelLayout.LevelData levelData, java.lang.Object g)
public void applyLayout(LevelLayout.LevelData levelData, java.lang.Object g, boolean useDummies)
public void setOrientation(int o)
public void setRandomizedPlacement(boolean flag)
public void setVisited(java.lang.Object node, boolean val)
public void setAllVisited(java.lang.Object composite, boolean val)
public boolean isVisited(java.lang.Object node)