public class mxCoordinateAssignment extends java.lang.Object implements mxHierarchicalLayoutStage
Modifier and Type | Class and Description |
---|---|
protected class |
mxCoordinateAssignment.AreaSpatialCache
Utility class that stores a collection of vertices and edge points within
a certain area.
|
protected class |
mxCoordinateAssignment.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 double |
currentXDelta
The sum of x-displacements for the current iteration
|
protected boolean |
disableEdgeStyle
Specifies if the STYLE_NOEDGESTYLE flag should be set on edges that are
modified by the result.
|
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 mxHierarchicalLayout |
layout
Reference to the enclosing layout algorithm
|
protected double |
limitX
The maximum x value this positioning lays up to
|
protected int |
maxIterations
The number of heuristic iterations to run
|
protected mxGraphAbstractHierarchyCell[][] |
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 mxGraphAbstractHierarchyCell[][] |
previousLayerConnectedCache
A store of connections to the layer below for speed
|
protected double[] |
rankWidths
The width of all the ranks
|
protected double[] |
rankY
The Y-coordinate of all the ranks
|
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 |
---|
mxCoordinateAssignment(mxHierarchicalLayout layout,
double intraCellSpacing,
double interRankCellSpacing,
int orientation,
double initialX,
double parallelEdgeSpacing)
Creates a coordinate assignment.
|
Modifier and Type | Method and Description |
---|---|
protected void |
calculateWidestRank(mxGraph graph,
mxGraphHierarchyModel model)
Calculates the width rank in the hierarchy.
|
void |
execute(java.lang.Object parent)
A basic horizontal coordinate assignment algorithm
|
double |
getInterRankCellSpacing() |
double |
getIntraCellSpacing() |
double |
getLimitX() |
int |
getOrientation() |
boolean |
isFineTuning() |
protected void |
rankCoordinates(int rankValue,
mxGraph graph,
mxGraphHierarchyModel model)
Sets up the layout in an initial positioning.
|
protected void |
rankMedianPosition(int rankValue,
mxGraphHierarchyModel model,
int nextRankValue)
Performs median minimisation over one rank.
|
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 mxHierarchicalLayout layout
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 disableEdgeStyle
protected mxGraphAbstractHierarchyCell[][] nextLayerConnectedCache
protected mxGraphAbstractHierarchyCell[][] previousLayerConnectedCache
public mxCoordinateAssignment(mxHierarchicalLayout layout, double intraCellSpacing, double interRankCellSpacing, int orientation, 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 void execute(java.lang.Object parent)
execute
in interface mxHierarchicalLayoutStage
protected void rankMedianPosition(int rankValue, mxGraphHierarchyModel 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, mxGraph graph, mxGraphHierarchyModel model)
rankValue
- the current rank being processedgraph
- the facade describing the input graphmodel
- an internal model of the hierarchical layoutprotected void calculateWidestRank(mxGraph graph, mxGraphHierarchyModel model)
graph
- 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 void setLoggerLevel(java.util.logging.Level level)
level
- the logging level to setCopyright (c) 2010 Gaudenz Alder. All rights reserved.