public class JGraphCoordinateAssignment extends java.lang.Object implements JGraphHierarchicalLayoutStep
Modifier and Type | Class and Description |
---|---|
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.
|
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
JGraphCoordinateAssignment(double intraCellSpacing,
double interRankCellSpacing,
int orientation,
boolean compactLayout,
double initialX,
double parallelEdgeSpacing)
Creates a JGraphCoordinateAssignment
|
Modifier and Type | Method and Description |
---|---|
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(java.util.logging.Level level)
Sets the logging level of this class
|
void |
setOrientation(int orientation) |
protected double intraCellSpacing
protected double interRankCellSpacing
protected double parallelEdgeSpacing
protected int maxIterations
protected int orientation
protected double initialX
protected double limitX
protected double currentXDelta
protected int widestRank
protected double widestRankValue
protected double[] rankWidths
protected double[] rankY
protected boolean fineTuning
protected boolean compactLayout
protected JGraphAbstractHierarchyCell[][] nextLayerConnectedCache
protected JGraphAbstractHierarchyCell[][] previousLayerConnectedCache
public JGraphCoordinateAssignment(double intraCellSpacing, double interRankCellSpacing, int orientation, boolean compactLayout, double initialX, double parallelEdgeSpacing)
intraCellSpacing
- the minimum buffer between cells on the same rankinterRankCellSpacing
- the minimum distance between cells on adjacent ranksorientation
- the position of the root node(s) relative to the graphinitialX
- the leftmost coordinate node placement starts atpublic JGraphHierarchyModel run(JGraphFacade facade, JGraphHierarchyModel model)
run
in interface JGraphHierarchicalLayoutStep
facade
- the facade describing the input graphmodel
- an internal model of the hierarchical layoutprotected void rankMedianPosition(int rankValue, JGraphHierarchyModel model, int nextRankValue)
rankValue
- the layer number of this rankmodel
- an internal model of the hierarchical layoutnextRankValue
- the layer number whose connected cels are to be laid out
relative toprotected void rankCoordinates(int rankValue, JGraphFacade facade, JGraphHierarchyModel model)
rankValue
- the current rank being processedfacade
- the facade describing the input graphmodel
- an internal model of the hierarchical layoutprotected void calculateWidestRank(JGraphFacade facade, JGraphHierarchyModel model)
facade
- the facade describing the input graphmodel
- an internal model of the hierarchical layoutpublic double getInterRankCellSpacing()
public void setInterRankCellSpacing(double interRankCellSpacing)
interRankCellSpacing
- The interRankCellSpacing to set.public double getIntraCellSpacing()
public void setIntraCellSpacing(double intraCellSpacing)
intraCellSpacing
- The intraCellSpacing to set.public int getOrientation()
public void setOrientation(int orientation)
orientation
- The orientation to set.public double getLimitX()
public void setLimitX(double limitX)
limitX
- The limitX to set.public boolean isFineTuning()
public void setFineTuning(boolean fineTuning)
fineTuning
- The fineTuning to set.public boolean isCompactLayout()
public void setCompactLayout(boolean compactLayout)
compactLayout
- The compactLayout to set.public void setLoggerLevel(java.util.logging.Level level)
level
- the logging level to setCopyright (C) 2001-2009 JGraph Ltd. All rights reserved.