|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.layout.hierarchic.incremental.SimplexNodePlacer
public class SimplexNodePlacer
NodePlacer implementation based on rank-assignment.
The drawer works with integer values and rounds double values to
integers using sophisticated quantizing.
| Field Summary | |
|---|---|
static int |
GROUP_COMPACTION_MAX
Compaction strategy specifier for use with setGroupCompactionStrategy(int). |
static int |
GROUP_COMPACTION_NONE
Compaction strategy specifier for use with setGroupCompactionStrategy(int). |
| Constructor Summary | |
|---|---|
SimplexNodePlacer()
|
|
| Method Summary | |
|---|---|
void |
assignLayerCoordinates(LayoutGraph graph,
LayoutDataProvider layoutDataProvider,
Layers layers)
Invoked by HierarchicLayouter before the ports get assigned. |
void |
assignSequenceCoordinates(LayoutGraph graph,
LayoutDataProvider layoutDataProvider,
Layers layers,
DrawingDistanceCalculator drawingDistanceCalculator)
Invoked by HierarchicLayouter to determine the resulting x coordinates. |
int |
getGroupCompactionStrategy()
Gets the strategy that is used to control the horizontal compactness of group nodes. |
protected double |
getLayerAlignment(LayoutGraph graph,
LayoutDataProvider ldp,
Node node,
int layerIndex,
double minLayerHeight)
Callback method used by assignLayerCoordinates(LayoutGraph,LayoutDataProvider,Layers)
to determine the alignment of the node inside the layer |
protected double |
getMinDistance(LayoutGraph graph,
Layer layer,
Node predNode,
Node succ)
Determines the minimum allowed distance between two nodes in a given layer |
protected double |
getMinimumLayerHeight(LayoutGraph graph,
LayoutDataProvider ldp,
Layer layer)
Callback method used by assignLayerCoordinates(LayoutGraph,LayoutDataProvider,Layers)
to determine the minimum height of a layer. |
double |
getSwimLaneCrossingWeight()
Returns the relative weight of edges crossing a swim lane relative to edges that stay in their lane. |
boolean |
isBaryCenterModeEnabled()
Gets the state of the barycenter drawing mode. |
boolean |
isBreakLongSegmentsEnabled()
|
boolean |
isExactPlacementEnforced()
Returns whether this instance should enforce the placement of nodes at their exact current position, even if this violates minimum distance constraints. |
protected boolean |
isFixedNode(LayoutGraph graph,
LayoutDataProvider provider,
Node node,
boolean inLayer)
Callback used by both assignLayerCoordinates(y.layout.LayoutGraph,LayoutDataProvider,Layers)
and assignSequenceCoordinates(y.layout.LayoutGraph,LayoutDataProvider,Layers,DrawingDistanceCalculator)
to determine whether the given node should be treated as a node with fixed (given) coordinates. |
boolean |
isHorizontalCompactionEnabled()
|
void |
setBaryCenterModeEnabled(boolean enabled)
Enables or disables the barycenter drawing mode. |
void |
setBreakLongSegmentsEnabled(boolean breakLongSegmentsEnabled)
|
void |
setExactPlacementEnforced(boolean exactPlacementEnforced)
Determines whether this instance enforces the placement of nodes at their exact current position, even if this violates minimum distance constraints. |
void |
setGroupCompactionStrategy(int groupCompactionStrategy)
Sets the strategy that is used to control the horizontal compactness of group nodes. |
void |
setHorizontalCompactionEnabled(boolean horizontalCompactionEnabled)
|
void |
setSwimLaneCrossingWeight(double weight)
Sets the relative weight of edges crossing a swim lane relative to edges that stay in their lane. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int GROUP_COMPACTION_NONE
setGroupCompactionStrategy(int).
This specifies no horizontal group compaction, i.e. group node contents will occupy nearly the same horizontal positions as when not grouped at all.
public static final int GROUP_COMPACTION_MAX
setGroupCompactionStrategy(int).
This specifies maximal horizontal group compaction, i.e. the node placer will try to minimimze the horizontally occupied space for a group node.
| Constructor Detail |
|---|
public SimplexNodePlacer()
| Method Detail |
|---|
public boolean isHorizontalCompactionEnabled()
public void setHorizontalCompactionEnabled(boolean horizontalCompactionEnabled)
public int getGroupCompactionStrategy()
GROUP_COMPACTION_NONE or GROUP_COMPACTION_MAX.GROUP_COMPACTION_MAX,
GROUP_COMPACTION_NONE,
setGroupCompactionStrategy(int)public void setGroupCompactionStrategy(int groupCompactionStrategy)
groupCompactionStrategy - One of GROUP_COMPACTION_NONE or GROUP_COMPACTION_MAX.GROUP_COMPACTION_MAX,
GROUP_COMPACTION_NONE,
getGroupCompactionStrategy()public boolean isExactPlacementEnforced()
true.
setExactPlacementEnforced(boolean)public void setExactPlacementEnforced(boolean exactPlacementEnforced)
true.
exactPlacementEnforced - whether to enforce exact coordinatespublic void setSwimLaneCrossingWeight(double weight)
0.0d (the default) will effectively make the algorithm
ignore edges crossing a swim lane border.
weight - the relative weight of an edge crossing a swim lane border [0.0d .. 1.0d]public double getSwimLaneCrossingWeight()
0.0d which will effectively make the algorithm
ignore edges crossing a swim lane border.
[0.0d .. 1.0d]public void setBaryCenterModeEnabled(boolean enabled)
enabled - whether to enable this modepublic boolean isBaryCenterModeEnabled()
public void assignLayerCoordinates(LayoutGraph graph,
LayoutDataProvider layoutDataProvider,
Layers layers)
NodePlacerHierarchicLayouter before the ports get assigned.
This method is used to assign preliminary y coordinates for each layer.
The distance between two layers will be adjusted later by the edge routing
algorithm. This method is responsible for assigning the relative positions
of the nodes within each layer.
assignLayerCoordinates in interface NodePlacergraph - the graph that contains the elementslayoutDataProvider - the LayoutDataProvider that contains information about
the elementslayers - the Layers that shall be calculated by this method
protected boolean isFixedNode(LayoutGraph graph,
LayoutDataProvider provider,
Node node,
boolean inLayer)
assignLayerCoordinates(y.layout.LayoutGraph,LayoutDataProvider,Layers)
and assignSequenceCoordinates(y.layout.LayoutGraph,LayoutDataProvider,Layers,DrawingDistanceCalculator)
to determine whether the given node should be treated as a node with fixed (given) coordinates.
graph - the graph that contains the nodeprovider - the current LayoutDataProvidernode - the nodeinLayer - whether the nodes' layer coordinate is queried or the sequence coordinate.
Iff inLayer is true this method is called from within the
assignLayerCoordinates(y.layout.LayoutGraph,LayoutDataProvider,Layers)
method
protected double getMinimumLayerHeight(LayoutGraph graph,
LayoutDataProvider ldp,
Layer layer)
assignLayerCoordinates(LayoutGraph,LayoutDataProvider,Layers)
to determine the minimum height of a layer.
protected double getLayerAlignment(LayoutGraph graph,
LayoutDataProvider ldp,
Node node,
int layerIndex,
double minLayerHeight)
assignLayerCoordinates(LayoutGraph,LayoutDataProvider,Layers)
to determine the alignment of the node inside the layer
public void assignSequenceCoordinates(LayoutGraph graph,
LayoutDataProvider layoutDataProvider,
Layers layers,
DrawingDistanceCalculator drawingDistanceCalculator)
NodePlacerHierarchicLayouter to determine the resulting x coordinates.
This method is invoked after all ports have been assigned their final relative
coordinates and nodes have been given relative coordinates within each layer.
assignSequenceCoordinates in interface NodePlacergraph - the graph that contains the elementslayoutDataProvider - the LayoutDataProvider that contains information about
the elementslayers - the Layers that shall be calculated by this methoddrawingDistanceCalculator - an instance that can be queried to determine
the minimum distance between each pair of nodes in the graph
protected double getMinDistance(LayoutGraph graph,
Layer layer,
Node predNode,
Node succ)
graph - the graph that contains the nodeslayer - the layer that contains the nodespredNode - the node to the left of the other one, may be null to indicate a border linesucc - the node to the right of the other one, may be null to indicate a border line
DrawingDistanceCalculatorpublic boolean isBreakLongSegmentsEnabled()
public void setBreakLongSegmentsEnabled(boolean breakLongSegmentsEnabled)
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||