|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.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 |
long |
getMaximalDuration()
Returns the time limit (in milliseconds) set for the algorithm. |
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()
Returns whether or not to use the barycenter drawing mode. |
boolean |
isBendReductionEnabled()
Returns whether or not an optimization step should be applied that tries to further reduce the number of bends. |
boolean |
isBreakLongSegmentsEnabled()
Returns whether this instance may break long edge segments in favor of a more compact layout. |
boolean |
isEdgeStraighteningOptimizationEnabled()
Returns whether a postprocessing step should be applied that tries to remove some bends. |
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 |
isFromSketchLayerAssignment()
Returns whether this instance tries to use the coordinates given from the current sketch for the determination of the layer coordinates. |
boolean |
isHorizontalCompactionEnabled()
Returns whether this instance tries to create a maximally compact horizontal layout at the cost of more bends. |
void |
setBaryCenterModeEnabled(boolean enabled)
Specifies whether or not to use the barycenter drawing mode. |
void |
setBendReductionEnabled(boolean bendReductionEnabled)
Specifies whether or not an optimization step should be applied that tries to further reduce the number of bends. |
void |
setBreakLongSegmentsEnabled(boolean breakLongSegmentsEnabled)
Determines whether this instance may break long edge segments in favor of a more compact layout. |
void |
setEdgeStraighteningOptimizationEnabled(boolean edgeStraighteningOptimizationEnabled)
Whether or not a postprocessing step should be applied that tries to remove some bends. |
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 |
setFromSketchLayerAssignment(boolean fromSketchLayerAssignment)
Sets whether this instance should try to use the coordinates given from the current sketch for the determination of the layer coordinates. |
void |
setGroupCompactionStrategy(int groupCompactionStrategy)
Sets the strategy that is used to control the horizontal compactness of group nodes. |
void |
setHorizontalCompactionEnabled(boolean horizontalCompactionEnabled)
Determines whether this instance tries to create a maximally compact horizontal layout at the cost of more bends. |
void |
setMaximalDuration(long maximalDuration)
Sets a preferred time limit (in milliseconds) for the algorithm. |
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 minimize the horizontally occupied space for a group node.
Constructor Detail |
---|
public SimplexNodePlacer()
Method Detail |
---|
public boolean isBendReductionEnabled()
setBendReductionEnabled(boolean)
public void setBendReductionEnabled(boolean bendReductionEnabled)
setMaximalDuration(long)
) the number of bends is not reduced.
bendReductionEnabled
- whether or not the bend optimization step should be applied.setMaximalDuration(long)
public boolean isHorizontalCompactionEnabled()
setHorizontalCompactionEnabled(boolean)
public void setHorizontalCompactionEnabled(boolean horizontalCompactionEnabled)
For best results, setBreakLongSegmentsEnabled(boolean)
should also be enabled.
horizontalCompactionEnabled
- to create a maximally compact horizontal layoutisHorizontalCompactionEnabled()
public boolean isEdgeStraighteningOptimizationEnabled()
public void setEdgeStraighteningOptimizationEnabled(boolean edgeStraighteningOptimizationEnabled)
The default is false
.
edgeStraighteningOptimizationEnabled
- whether the postprocessing step should be applied.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()
The default is true
.
setExactPlacementEnforced(boolean)
public void setExactPlacementEnforced(boolean exactPlacementEnforced)
The default is true
.
exactPlacementEnforced
- whether to enforce exact coordinatespublic boolean isFromSketchLayerAssignment()
public void setFromSketchLayerAssignment(boolean fromSketchLayerAssignment)
fromSketchLayerAssignment
- whether to use the current sketchpublic long getMaximalDuration()
setMaximalDuration(long)
public void setMaximalDuration(long maximalDuration)
maximalDuration
- the time limit.getMaximalDuration()
public void setSwimLaneCrossingWeight(double weight)
A value of 0.0d
will effectively make the algorithm
ignore edges crossing a swim lane border.
Defaults to 0.0d
.
weight
- the relative weight of an edge crossing a swim lane border [0.0d .. 1.0d]
public double getSwimLaneCrossingWeight()
A value of 0.0d
will effectively make the algorithm
ignore edges crossing a swim lane border.
Defaults to 0.0d
.
[0.0d .. 1.0d]
public void setBaryCenterModeEnabled(boolean enabled)
By default this mode is turned off.
enabled
- whether to enable this mode.public boolean isBaryCenterModeEnabled()
By default this mode is turned off.
public void assignLayerCoordinates(LayoutGraph graph, LayoutDataProvider layoutDataProvider, Layers layers)
NodePlacer
HierarchicLayouter
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 NodePlacer
graph
- the graph that contains the elementslayoutDataProvider
- the LayoutDataProvider that contains information about
the elementslayers
- the Layers that shall be calculated by this methodprotected 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)
NodePlacer
HierarchicLayouter
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 NodePlacer
graph
- 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 graphprotected 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
DrawingDistanceCalculator
public boolean isBreakLongSegmentsEnabled()
setBreakLongSegmentsEnabled(boolean)
public void setBreakLongSegmentsEnabled(boolean breakLongSegmentsEnabled)
breakLongSegmentsEnabled
- whether to break long segmentsisBreakLongSegmentsEnabled()
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |