com.jgraph.layout.hierarchical
public class JGraphCoordinateAssignment extends Object implements JGraphHierarchicalLayoutStep
Nested Class Summary | |
---|---|
protected class | JGraphCoordinateAssignment.AreaSpatialCache
Utility class that stores a collection of vertices and edge points within
a certain area. |
protected class | JGraphCoordinateAssignment.WeightedCellSorter
A utility class used to track cells whilst sorting occurs on the weighted
sum of their connected edges. |
Field Summary | |
---|---|
protected boolean | compactLayout
Whether or not to pull together sections of layout into empty space |
protected double | currentXDelta
The sum of x-displacements for the current iteration |
protected boolean | fineTuning
Whether or not to perform local optimisations and iterate multiple times
through the algorithm |
protected double | initialX
The minimum x position node placement starts at |
protected double | interRankCellSpacing
The minimum distance between cells on adjacent ranks |
protected double | intraCellSpacing
The minimum buffer between cells on the same rank |
protected double | limitX
The maximum x value this positioning lays up to |
protected int | maxIterations
The number of heuristic iterations to run |
protected JGraphAbstractHierarchyCell[][] | nextLayerConnectedCache
A store of connections to the layer above for speed |
protected int | orientation
The position of the root ( start ) node(s) relative to the rest of the
laid out graph |
protected double | parallelEdgeSpacing
The distance between each parallel edge on each ranks for long edges |
protected JGraphAbstractHierarchyCell[][] | previousLayerConnectedCache
A store of connections to the layer below for speed |
protected double[] | rankWidths
The width of all the ranks |
protected double[] | rankY |
protected int | widestRank
The rank that has the widest x position |
protected double | widestRankValue
The X-coordinate of the edge of the widest rank |
Constructor Summary | |
---|---|
JGraphCoordinateAssignment(double intraCellSpacing, double interRankCellSpacing, int orientation, boolean compactLayout, double initialX, double parallelEdgeSpacing)
Creates a JGraphCoordinateAssignment
|
Method Summary | |
---|---|
protected void | calculateWidestRank(JGraphFacade facade, JGraphHierarchyModel model)
Calculates the width rank in the hierarchy. |
double | getInterRankCellSpacing() |
double | getIntraCellSpacing() |
double | getLimitX() |
int | getOrientation() |
boolean | isCompactLayout() |
boolean | isFineTuning() |
protected void | rankCoordinates(int rankValue, JGraphFacade facade, JGraphHierarchyModel model)
Sets up the layout in an initial positioning. |
protected void | rankMedianPosition(int rankValue, JGraphHierarchyModel model, int nextRankValue)
Performs median minimisation over one rank.
|
JGraphHierarchyModel | run(JGraphFacade facade, JGraphHierarchyModel model)
A basic horizontal coordinate assignment algorithm
|
void | setCompactLayout(boolean compactLayout) |
void | setFineTuning(boolean fineTuning) |
void | setInterRankCellSpacing(double interRankCellSpacing) |
void | setIntraCellSpacing(double intraCellSpacing) |
void | setLimitX(double limitX) |
void | setLoggerLevel(Level level)
Sets the logging level of this class
|
void | setOrientation(int orientation) |
Parameters: intraCellSpacing the minimum buffer between cells on the same rank interRankCellSpacing the minimum distance between cells on adjacent ranks orientation the position of the root node(s) relative to the graph initialX the leftmost coordinate node placement starts at
Parameters: facade the facade describing the input graph model an internal model of the hierarchical layout
Returns: Returns the interRankCellSpacing.
Returns: Returns the intraCellSpacing.
Returns: Returns the limitX.
Returns: Returns the orientation.
Returns: Returns the compactLayout.
Returns: Returns the fineTuning.
Parameters: rankValue the current rank being processed facade the facade describing the input graph model an internal model of the hierarchical layout
Parameters: rankValue the layer number of this rank model an internal model of the hierarchical layout nextRankValue the layer number whose connected cels are to be laid out relative to
Parameters: facade the facade describing the input graph model an internal model of the hierarchical layout
Returns: the updated hierarchy model
Parameters: compactLayout The compactLayout to set.
Parameters: fineTuning The fineTuning to set.
Parameters: interRankCellSpacing The interRankCellSpacing to set.
Parameters: intraCellSpacing The intraCellSpacing to set.
Parameters: limitX The limitX to set.
Parameters: level the logging level to set
Parameters: orientation The orientation to set.