|
JGraphAddons |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jgraph.layout.JGraphLayoutAlgorithm | +--org.jgraph.layout.SugiyamaLayoutAlgorithm
Arranges the nodes with the Sugiyama Layout Algorithm.
Link to the algorithm
Field Summary | |
protected int |
gridAreaSize
represents the size of the grid in horizontal grid elements |
protected Point |
spacing
|
static String |
SUGIYAMA_CELL_WRAPPER
Const to add the Cell Wrapper to the Nodes |
static String |
SUGIYAMA_VISITED
Const to add Attributes at the Nodes |
Fields inherited from class org.jgraph.layout.JGraphLayoutAlgorithm |
LAYOUT_ATTRIBUTES |
Constructor Summary | |
SugiyamaLayoutAlgorithm()
|
Method Summary | |
JGraphLayoutSettings |
createSettings()
Returns an new instance of SugiyamaLayoutSettings |
protected void |
drawGraph(JGraph jgraph,
Vector levels,
Point min,
Point spacing)
This Method draws the graph. |
protected Vector |
fillLevels(JGraph jgraph,
CellView[] selectedCellViews,
Vector rootVertexViews)
Method fills the levels and stores them in the member levels. |
protected void |
fillLevels(JGraph jgraph,
Vector levels,
int level,
VertexView vertexView)
Fills the Vector for the specified level with a wrapper for the MyGraphCell. |
protected Point |
findMinimumAndSpacing(CellView[] graphCellViews,
Point spacing)
calculates the minimum for the paint area. |
String |
getHint()
Get a human readable hint for using this layout. |
protected boolean |
move(boolean toRight,
Vector currentLevel,
int currentIndexInTheLevel,
int currentPriority)
|
protected void |
moveToBarycenter(JGraph jgraph,
CellView[] allSelectedViews,
Vector levels)
|
protected int |
moveToBarycenter(JGraph jgraph,
Vector levels,
int levelIndex)
|
void |
run(JGraph jgraph,
Object[] cells,
int step)
Implementation. |
protected Vector |
searchRoots(JGraph jgraph,
CellView[] selectedCellViews)
Searches all Roots for the current Graph First the method marks any Node as not visited. |
protected void |
searchRoots(JGraph jgraph,
VertexView vertexViewToInspect,
Vector roots)
Searches Roots for the current Cell. |
protected int |
solveEdgeCrosses(JGraph jgraph,
boolean down,
Vector levels,
int levelIndex)
|
protected void |
solveEdgeCrosses(JGraph jgraph,
Vector levels)
|
String |
toString()
Returns the name of this algorithm in human readable form. |
protected void |
updateProgress4Movements()
Updates the progress based on the movements count |
Methods inherited from class org.jgraph.layout.JGraphLayoutAlgorithm |
applyLayout, createDialog, createDialog, getMaximumProgress, getProgress, isAllowedToRun, populateDialog, run, setAllowedToRun, setMaximumProgress, setProgress |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String SUGIYAMA_VISITED
public static final String SUGIYAMA_CELL_WRAPPER
protected int gridAreaSize
protected Point spacing
Constructor Detail |
public SugiyamaLayoutAlgorithm()
Method Detail |
public JGraphLayoutSettings createSettings()
createSettings
in class JGraphLayoutAlgorithm
public String toString()
toString
in class Object
public String getHint()
getHint
in class JGraphLayoutAlgorithm
public void run(JGraph jgraph, Object[] cells, int step)
levels
.
The Member levels contains Vector Objects and the Vector per level
contains Cell Wrapper Objects. After that the Algorithm
tries to solve the edge crosses from level to level and
goes top down and bottom up. After minimization of the
edge crosses the algorithm moves each node to its
bary center. Last but not Least the method draws the Graph.
run
in class JGraphLayoutAlgorithm
LayoutAlgorithm
protected Vector searchRoots(JGraph jgraph, CellView[] selectedCellViews)
searchRoots(JGraph, CellView[])
protected void searchRoots(JGraph jgraph, VertexView vertexViewToInspect, Vector roots)
protected Vector fillLevels(JGraph jgraph, CellView[] selectedCellViews, Vector rootVertexViews)
levels
Vector.
protected void fillLevels(JGraph jgraph, Vector levels, int level, VertexView vertexView)
level
- The level for the graphCellprotected Point findMinimumAndSpacing(CellView[] graphCellViews, Point spacing)
protected void updateProgress4Movements()
protected void solveEdgeCrosses(JGraph jgraph, Vector levels)
protected int solveEdgeCrosses(JGraph jgraph, boolean down, Vector levels, int levelIndex)
protected void moveToBarycenter(JGraph jgraph, CellView[] allSelectedViews, Vector levels)
protected int moveToBarycenter(JGraph jgraph, Vector levels, int levelIndex)
protected boolean move(boolean toRight, Vector currentLevel, int currentIndexInTheLevel, int currentPriority)
toRight
- true = try to move the currentWrapper to right; false = try to move the currentWrapper to left;currentLevel
- Vector which contains the CellWrappers for the current levelcurrentIndexInTheLevel
- currentPriority
-
protected void drawGraph(JGraph jgraph, Vector levels, Point min, Point spacing)
|
JGraphAddons |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |