|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecty.layout.CanonicMultiStageLayouter
y.layout.hierarchic.incremental.HierarchicLayouter
public class HierarchicLayouter
This class arranges graphs in a hierarchic/layered fashion and supports complete re-layout as well as incremental graph layout.
Note that class IncrementalHierarchicLayouter
offers a facade to this class which is easier to use.
Hence, we strongly recommend to not directly use class HierarchicLayouter
.
The nodes are distributed into layers such that most of the edges point to the main layout direction. The order of the nodes within the layers ensures that the number of edge crossings is as small as possible. There are different edge routing styles available. Edges can be orthogonal, polyline or octilinear.
Hierarchical diagrams are commonly used for the visualization of hierarchical data, since they facilitate the identification of dependencies and relationships among the nodes of the graph. Possible application domains are the following: workflow visualization, call graph visualization, entity-relationship diagrams, biochemical pathways and network management.
Hierarchic Layout obtained with default settings
The layout algorithm runs in three main phases:
getLayerer()
. If the layout orientation is
top-to-bottom, the nodes in each layer are arranged horizontally while the layers are ordered vertically
top-to-bottom.
setSequencer(Sequencer)
.
In order to customize this layout algorithm, modify the Layerer
, Sequencer
,
PortAllocator
, DrawingDistanceCalculator
, and
NodePlacer
instances.
This layout algorithm is able to incrementally add new elements to an existing drawing of a graph.
In order to add elements incrementally, register a DataProvider
with the graph using the INCREMENTAL_HINTS_DPKEY
DataProvider key and associate the hints
obtained from the IncrementalHintsFactory
with the elements to be added incrementally.
NodeLayoutDescriptor
and EdgeLayoutDescriptor
instances can be used for specifying individual
information (e.g. distances or routing styles) for each node and edge in the graph. The descriptors are bound to the
graph using DataProvider
s registered with NODE_LAYOUT_DESCRIPTOR_DPKEY
or
EDGE_LAYOUT_DESCRIPTOR_DPKEY
.
HierarchicLayouter
supports two approaches to connect edges on a specific side or even an exact location
to a node. PortConstraint
s define a single constraint for the ports of an edge. To realize more
complex port restrictions, several PortCandidate
s or PortCandidateSet
s can be
assigned to edges or nodes. If an edge with registered PortCandidate
s connects to nodes with PortCandidateSet
s,
the layouter will try to match both collections to find an appropriate port. In case there is no matching port
candidate, a PortCandidate
specified for the edge is preferred.
Since their simultaneous existence at the same node may be ambiguous, it is not recommended to use a combination of
PortConstraint
s and PortCandidate
s in the same layout.
This algorithm specifies a LabelLayoutTranslator
instance as the current
CanonicMultiStageLayouter.getLabelLayouter()
and configures it such that the node labels are passed to it by
setting LabelLayoutTranslator.setTranslateNodeLabelsEnabled(boolean)
to true
.
In order to enable integrated edge labeling of this algorithm, make sure LabelLayoutTranslator
is registered
and edge labels are being translated and written back after the layout.
Moreover, this algorithm supports layer and sequence constraints. These constraints can be specified using a
LayerConstraintFactory
and SequenceConstraintFactory
, respectively.
IncrementalHierarchicLayouter
,
Layerer
,
Sequencer
,
PortAllocator
,
DrawingDistanceCalculator
,
NodePlacer
![]() |
![]() |
![]() |
![]() |
Nested Class Summary | |
---|---|
static class |
HierarchicLayouter.IncrementalHint
This class describes hint objects used internally by HierarchicLayouter . |
Field Summary | |
---|---|
static java.lang.Object |
EDGE_LAYOUT_DESCRIPTOR_DPKEY
A DataProvider key for providing layout information for each edge
|
static java.lang.Object |
INCREMENTAL_HINTS_DPKEY
A DataProvider key for specifying incremental hints
Incremental hints are created using an incremental hints factory . |
static java.lang.Object |
INCREMENTAL_NODES_DPKEY
A DataProvider key for internal use only.
|
static java.lang.Object |
LAYER_VALUE_HOLDER_DPKEY
A DataAcceptor key for publishing the layer IDs for all nodes in the graph.
|
static java.lang.Object |
NODE_LAYOUT_DESCRIPTOR_DPKEY
A DataProvider key for providing layout information for each node
|
static java.lang.Object |
SEQUENCE_VALUE_HOLDER_DPKEY
A DataAcceptor key for publishing the index inside their layer for all nodes in the graph.
|
static java.lang.Object |
SWIMLANE_DESCRIPTOR_DPKEY
A DataProvider key for providing information about swimlanes
If this key is present during the layout, the layout algorithm will arrange nodes in swimlanes. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
HierarchicLayouter()
Creates a new HierarchicLayouter instance with the default settings. |
Method Summary | |
---|---|
boolean |
canLayoutCore(LayoutGraph graph)
Accepts general graphs without exceptions. |
protected DrawingDistanceCalculator |
createDrawingDistanceCalculator()
Factory method that is called lazily upon first usage by getDrawingDistanceCalculator() if the given
DrawingDistanceCalculator instance is null . |
protected EdgeReverser |
createEdgeReverser()
Factory method called during doLayoutCore(LayoutGraph) and reates an appropriate EdgeReverser
implementation. |
protected Grouping |
createGrouping(LayoutGraph graph)
Factory method that is called during doLayoutCore(LayoutGraph) and creates a Grouping instance
in case of a grouped graph. |
IncrementalHintsFactory |
createIncrementalHintsFactory()
Creates an IncrementalHintsFactory implementation used for obtaining hint objects associated with nodes
and edges of the graph prior to the invocation of the layout algorithm. |
protected Layerer |
createIncrementalLayerer()
Factory method called during doLayoutCore(LayoutGraph) and creates an appropriate
Layerer implementation. |
protected void |
createItemData(LayoutGraph g,
ItemFactory itemFactory)
Callback method that is called during doLayoutCore(LayoutGraph) , creates the NodeData
and EdgeData instances and binds them to the elements using the given itemFactory . |
protected LayoutStage |
createLabelLayouter()
Factory method called during the initialization of this HierarchicLayouter instance that creates a
label layouter . |
LayerConstraintFactory |
createLayerConstraintFactory(Graph graph)
Creates a layer constraint factory that allows to create hints that affect
the assignment of the nodes to layers. |
protected Layerer |
createLayerer()
Factory method that is called lazily upon first usage by getLayerer() if no Layerer instance is
given as input. |
protected Layers |
createLayers(LayoutDataProvider ldp)
Factory method called during doLayoutCore(LayoutGraph) and creates an appropriate Layers
implementation using the given LayoutDataProvider instance. |
protected NodePlacer |
createNodePlacer()
Factory method that is called lazily upon first usage by getNodePlacer() if the given
NodePlacer instance is null . |
protected PortAllocator |
createPortAllocator()
Factory method that is called lazily upon first usage by getPortAllocator() if the given
PortAllocator instance is null . |
protected PortConstraintOptimizer |
createPortConstraintOptimizer()
Factory method that is called lazily upon first usage by getPortConstraintOptimizer() if the given
PortConstraintOptimizer instance is null . |
SequenceConstraintFactory |
createSequenceConstraintFactory(Graph graph)
Creates sequence constraints that affect the sequence of the nodes within each layer. |
protected Sequencer |
createSequencer()
Factory method that is called lazily upon first usage by getSequencer() if the given Sequencer
instance is null . |
protected Sequencer |
createSubgraphLayerSequencer()
Factory method called during doLayoutCore(LayoutGraph) and creates a Sequencer implementation that
can sequence subgraphs incrementally. |
void |
doLayoutCore(LayoutGraph graph)
Calculates a hierarchic layout of the given graph. |
java.lang.Object |
getAlgorithmProperty(java.lang.Object key)
Provides access to implementation specific properties of the algorithms used. |
DrawingDistanceCalculator |
getDrawingDistanceCalculator()
Returns the DrawingDistanceCalculator instance responsible for determining the minimum distances
between elements that belong to the same layer. |
protected DataProvider |
getEdgeLayoutDescriptors(LayoutGraph graph)
Callback method called during doLayoutCore(LayoutGraph) and returns a DataProvider that holds the
EdgeLayoutDescriptor information. |
double |
getGridSpacing()
Returns the equidistant spacing between the horizontal and vertical grid lines. |
protected DataProvider |
getIncrementalHints(LayoutGraph graph)
Callback method called during doLayoutCore(LayoutGraph) and returns a DataProvider that holds
the HierarchicLayouter.IncrementalHint s information. |
Layerer |
getLayerer()
Returns the Layerer instance responsible for generating the layer assignment (first phase of
the layout algorithm). |
long |
getMaximalDuration()
Returns the time limit (in milliseconds) set for the layout algorithm. |
protected DataProvider |
getNodeLayoutDescriptors(LayoutGraph graph)
Callback method called during doLayoutCore(LayoutGraph) and returns a DataProvider that holds the
NodeLayoutDescriptor information. |
NodePlacer |
getNodePlacer()
Returns the NodePlacer instance responsible for the assignment of the x-(sequence) and
preliminary y-coordinates of the nodes. |
PortAllocator |
getPortAllocator()
Returns the PortAllocator instance responsible for assigning port coordinates to the adjacent edges of
each node. |
PortConstraintOptimizer |
getPortConstraintOptimizer()
Returns the PortConstraintOptimizer instance responsible for optimizing the assignment of port
constraints to the adjacent edges of each node. |
Sequencer |
getSequencer()
Returns the Sequencer instance responsible for calculating the sequence of nodes within
each layer (second phase of the layout algorithm). |
protected DataProvider |
getSwimLaneDescriptors(LayoutGraph graph)
Callback method called during doLayoutCore(LayoutGraph) and returns a DataProvider that holds the
SwimLaneDescriptor information. |
boolean |
isComponentLayouterEnabled()
Returns whether or not the ComponentLayouter should be enabled. |
protected void |
publishLayers(LayoutGraph graph,
Layers layers)
Callback method that publishes the layering information. |
protected void |
publishSequences(LayoutGraph graph,
Layers layers,
LayoutDataProvider ldp)
Callback method that publishes the sequencing information. |
protected void |
reduceBendCount(LayoutGraph graph)
Removes the bends which are obviously not necessary. |
protected void |
reduceBendCount(LayoutGraph graph,
double bendReductionThreshold)
Removes the bends which are obviously not necessary. |
void |
setAlgorithmProperty(java.lang.Object key,
java.lang.Object propertyValue)
Provides access to implementation specific properties of the algorithms used. |
void |
setComponentLayouterEnabled(boolean enabled)
Specifies whether or not the ComponentLayouter should be enabled. |
void |
setDrawingDistanceCalculator(DrawingDistanceCalculator drawingDistanceCalculator)
Specifies the DrawingDistanceCalculator instance responsible for determining the minimum distances
between elements that belong to the same layer. |
void |
setGridSpacing(double gridSpacing)
Specifies the equidistant spacing between the horizontal and vertical grid lines. |
void |
setLayerer(Layerer layerer)
Specifies the Layerer instance responsible for generating the layer assignment (first phase of
the layout algorithm). |
void |
setMaximalDuration(long maximalDuration)
Specifies the time limit (in milliseconds) set for the layout algorithm. |
void |
setNodePlacer(NodePlacer placer)
Specifies the NodePlacer instance responsible for the assignment of the x-(sequence) and
preliminary y-coordinates of the nodes. |
void |
setPortAllocator(PortAllocator allocator)
Specifies the PortAllocator instance responsible for assigning port coordinates to the adjacent edges of
each node. |
void |
setPortConstraintOptimizer(PortConstraintOptimizer optimizer)
Specifies the PortConstraintOptimizer instance responsible for optimizing the assignment of port
constraints to the adjacent edges of each node. |
void |
setSequencer(Sequencer sequencer)
Specifies the Sequencer instance responsible for calculating the sequence of nodes within
each layer (second phase of the layout algorithm). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.Object INCREMENTAL_HINTS_DPKEY
DataProvider
key for specifying incremental hints
Incremental hints are created using an incremental hints factory
.
INCREMENTAL_HINTS_DPKEY
,
IncrementalHintsFactory
public static final java.lang.Object EDGE_LAYOUT_DESCRIPTOR_DPKEY
DataProvider
key for providing layout information for each edge
EdgeData.getEdgeLayoutDescriptor()
public static final java.lang.Object NODE_LAYOUT_DESCRIPTOR_DPKEY
DataProvider
key for providing layout information for each node
NodeData.getNodeLayoutDescriptor()
public static final java.lang.Object SWIMLANE_DESCRIPTOR_DPKEY
DataProvider
key for providing information about swimlanes
If this key is present during the layout, the layout algorithm will arrange nodes in swimlanes. The information about the swimlanes is finally written back to the descriptor instances.
Instances can be shared among multiple nodes in the same lane, but don't have to be shared.
SwimLaneDescriptor
,
NodeData.getSwimLaneDescriptor()
public static final java.lang.Object LAYER_VALUE_HOLDER_DPKEY
DataAcceptor
key for publishing the layer IDs for all nodes in the graph.
For each non-group node, the index of the node's layer will be stored
in this DataAcceptor
after the layout run.
DataAcceptor
also a DataProvider
storing values of type
IntValueHolder
can be registered. Then the
IntValueHolder
instance gets filled with the layer information
of the corresponding nodes.DataProvider
is registered with this key, the layer information of the nodes is dropped.IncrementalHierarchicLayouter.LAYER_VALUE_HOLDER_DPKEY
public static final java.lang.Object SEQUENCE_VALUE_HOLDER_DPKEY
DataAcceptor
key for publishing the index inside their layer for all nodes in the graph.
For each non-group node, the index (position) of the node within its layer will be stored
in this DataAcceptor
after the layout run.
DataAcceptor
also a DataProvider
storing values of type
IntValueHolder
can be registered. Then the
IntValueHolder
instance gets filled with the sequence information
of the corresponding nodes.DataProvider
is registered with this key, the sequence information of the nodes is dropped.IncrementalHierarchicLayouter.SEQUENCE_VALUE_HOLDER_DPKEY
public static final java.lang.Object INCREMENTAL_NODES_DPKEY
DataProvider
key for internal use only.
Constructor Detail |
---|
public HierarchicLayouter()
HierarchicLayouter
instance with the default settings.
createLayerer()
,
createIncrementalLayerer()
,
createSequencer()
,
createDrawingDistanceCalculator()
,
createNodePlacer()
Method Detail |
---|
protected LayoutStage createLabelLayouter()
HierarchicLayouter
instance that creates a
label layouter
.
In order to use the integrated node label awareness feature one has to use a LabelLayoutTranslator
instance and set LabelLayoutTranslator.setTranslateNodeLabelsEnabled(boolean)
to true
.
Likewise, in order to make use of the integrated edge labeling
LabelLayoutTranslator.setTranslateEdgeLabelsEnabled(boolean)
must be set to true
and also
LabelLayoutTranslator.setWriteBackEdgeLabelsEnabled(boolean)
must
be set to true
(which is the default).
LabelLayoutTranslator
instanceprotected Layerer createLayerer()
getLayerer()
if no Layerer
instance is
given as input.
The default implementation returns a new MultiComponentLayerer(new WeightedLayerer())
instance. It
may be overridden to return a custom Layerer
instance.
Layerer
instancegetLayerer()
,
MultiComponentLayerer
,
OldLayererWrapper
,
WeightedLayerer
public void setComponentLayouterEnabled(boolean enabled)
ComponentLayouter
should be enabled.
setComponentLayouterEnabled
in class CanonicMultiStageLayouter
ComponentLayouter
is disabled.enabled
- true
if ComponentLayouter
should be enabled, false
otherwiseCanonicMultiStageLayouter.isComponentLayouterEnabled()
,
CanonicMultiStageLayouter.setComponentLayouter(LayoutStage)
,
ComponentLayouter
public boolean isComponentLayouterEnabled()
ComponentLayouter
should be enabled.
isComponentLayouterEnabled
in class CanonicMultiStageLayouter
true
if ComponentLayouter
is enabled, false
otherwisesetComponentLayouterEnabled(boolean)
public long getMaximalDuration()
Values have to be greater than or equal to 0
.
setMaximalDuration(long)
public void setMaximalDuration(long maximalDuration)
Values have to be greater than or equal to 0
.
Long.MAX_VALUE
. The layout algorithm runs unrestricted.maximalDuration
- a non-negative value that specifies the time limit
java.lang.IllegalArgumentException
- if the maximum duration is negativegetMaximalDuration()
protected Sequencer createSequencer()
getSequencer()
if the given Sequencer
instance is null
.
The default implementation returns a DefaultLayerSequencer
instance. It may be overridden to return
a custom Sequencer
instance.
Sequencer
instancegetSequencer()
,
DefaultLayerSequencer
protected DrawingDistanceCalculator createDrawingDistanceCalculator()
getDrawingDistanceCalculator()
if the given
DrawingDistanceCalculator
instance is null
.
The default implementation returns a DefaultDrawingDistanceCalculator
instance. It may be overridden to
return a custom DefaultDrawingDistanceCalculator
instance.
DrawingDistanceCalculator
will make the properties
IncrementalHierarchicLayouter.setNodeToNodeDistance(double)
,
IncrementalHierarchicLayouter.setNodeToEdgeDistance(double)
and
IncrementalHierarchicLayouter.setEdgeToEdgeDistance(double)
superfluous. Those properties
delegate to DefaultDrawingDistanceCalculator
and will throw an IllegalStateException
if
a different class is used. Adjustments of those distances need to be done directly on the custom
implementation of DrawingDistanceCalculator
.DrawingDistanceCalculator
instancegetDrawingDistanceCalculator()
protected PortAllocator createPortAllocator()
getPortAllocator()
if the given
PortAllocator
instance is null
.
The default implementation returns a DefaultPortAllocator
instance. It may be overridden to
return a custom PortAllocator
instance.
PortAllocator
instancegetPortAllocator()
protected PortConstraintOptimizer createPortConstraintOptimizer()
getPortConstraintOptimizer()
if the given
PortConstraintOptimizer
instance is null
.
The default implementation returns null
. It may be overridden to
return a custom PortConstraintOptimizer
instance.
null
getPortConstraintOptimizer()
protected NodePlacer createNodePlacer()
getNodePlacer()
if the given
NodePlacer
instance is null
.
The default implementation returns a SimplexNodePlacer
instance. It may be overridden to
return a custom NodePlacer
instance.
NodePlacer
instancegetNodePlacer()
,
SimplexNodePlacer
public void setLayerer(Layerer layerer)
Layerer
instance responsible for generating the layer assignment (first phase of
the layout algorithm).
To set the default layerer, see createLayerer()
.
layerer
- the given Layerer
instance
java.lang.IllegalArgumentException
- if the specified Layerer
is null
createLayerer()
public Layerer getLayerer()
Layerer
instance responsible for generating the layer assignment (first phase of
the layout algorithm).
To set the default layerer, see createLayerer()
.
Layerer
instancesetLayerer(Layerer)
,
createLayerer()
public void setSequencer(Sequencer sequencer)
Sequencer
instance responsible for calculating the sequence of nodes within
each layer (second phase of the layout algorithm).
To set the default sequencer, see createSequencer()
.
sequencer
- the given Sequencer
instance
java.lang.IllegalArgumentException
- if the specified Sequencer
is null
createSequencer()
public Sequencer getSequencer()
Sequencer
instance responsible for calculating the sequence of nodes within
each layer (second phase of the layout algorithm).
To set the default sequencer, see createSequencer()
.
Sequencer
instancecreateSequencer()
,
setSequencer(Sequencer)
public void setNodePlacer(NodePlacer placer)
NodePlacer
instance responsible for the assignment of the x-(sequence) and
preliminary y-coordinates of the nodes.
To set the default node placer, see createNodePlacer()
.
placer
- the given NodePlacer
instance
java.lang.IllegalArgumentException
- if the specified NodePlacer
is null
createNodePlacer()
public NodePlacer getNodePlacer()
NodePlacer
instance responsible for the assignment of the x-(sequence) and
preliminary y-coordinates of the nodes.
To set the default node placer, see createNodePlacer()
.
NodePlacer
instancesetNodePlacer(NodePlacer)
,
createNodePlacer()
public void setPortAllocator(PortAllocator allocator)
PortAllocator
instance responsible for assigning port coordinates to the adjacent edges of
each node.
To set the default port allocator, see createPortAllocator()
.
allocator
- the given PortAllocator
instance
java.lang.IllegalArgumentException
- if the specified PortAllocator
is null
createPortAllocator()
public PortAllocator getPortAllocator()
PortAllocator
instance responsible for assigning port coordinates to the adjacent edges of
each node.
To set the default port allocator, see createPortAllocator()
.
PortAllocator
instancesetPortAllocator(PortAllocator)
,
createPortAllocator()
public void setPortConstraintOptimizer(PortConstraintOptimizer optimizer)
PortConstraintOptimizer
instance responsible for optimizing the assignment of port
constraints to the adjacent edges of each node.
To set the default port allocator, see createPortConstraintOptimizer()
.
optimizer
- the given PortConstraintOptimizer
instancecreatePortConstraintOptimizer()
public PortConstraintOptimizer getPortConstraintOptimizer()
PortConstraintOptimizer
instance responsible for optimizing the assignment of port
constraints to the adjacent edges of each node.
To set the default port allocator, see createPortConstraintOptimizer()
.
PortConstraintOptimizer
instancesetPortConstraintOptimizer(PortConstraintOptimizer)
,
createPortConstraintOptimizer()
public void setDrawingDistanceCalculator(DrawingDistanceCalculator drawingDistanceCalculator)
DrawingDistanceCalculator
instance responsible for determining the minimum distances
between elements that belong to the same layer.
To set the default port allocator, see createDrawingDistanceCalculator()
.
DrawingDistanceCalculator
will make the properties
IncrementalHierarchicLayouter.setNodeToNodeDistance(double)
,
IncrementalHierarchicLayouter.setNodeToEdgeDistance(double)
and
IncrementalHierarchicLayouter.setEdgeToEdgeDistance(double)
superfluous. Those properties
delegate to DefaultDrawingDistanceCalculator
and will throw an IllegalStateException
if
a different class is used. Adjustments of those distances need to be done directly on the custom
implementation of DrawingDistanceCalculator
.drawingDistanceCalculator
- the given DrawingDistanceCalculator
instance
java.lang.IllegalArgumentException
- if the specified DrawingDistanceCalculator
is null
createDrawingDistanceCalculator()
public DrawingDistanceCalculator getDrawingDistanceCalculator()
DrawingDistanceCalculator
instance responsible for determining the minimum distances
between elements that belong to the same layer.
To set the default port allocator, see createDrawingDistanceCalculator()
.
DrawingDistanceCalculator
will make the properties
IncrementalHierarchicLayouter.setNodeToNodeDistance(double)
,
IncrementalHierarchicLayouter.setNodeToEdgeDistance(double)
and
IncrementalHierarchicLayouter.setEdgeToEdgeDistance(double)
superfluous. Those properties
delegate to DefaultDrawingDistanceCalculator
and will throw an IllegalStateException
if
a different class is used. Adjustments of those distances need to be done directly on the custom
implementation of DrawingDistanceCalculator
.DrawingDistanceCalculator
instancecreateDrawingDistanceCalculator()
,
setDrawingDistanceCalculator(DrawingDistanceCalculator)
public double getGridSpacing()
When the spacing is negative or zero, no grid is defined, otherwise nodes and edges are placed on multiples of the grid spacing.
setGridSpacing(double)
,
IncrementalHintsFactory
public void setGridSpacing(double gridSpacing)
When the spacing is negative or zero, no grid is defined, otherwise nodes and edges are placed on multiples of the grid spacing.
public boolean canLayoutCore(LayoutGraph graph)
canLayoutCore
in class CanonicMultiStageLayouter
graph
- the input graph
true
for all input graphspublic java.lang.Object getAlgorithmProperty(java.lang.Object key)
key
- the key to a property
null
setAlgorithmProperty(Object,Object)
public void setAlgorithmProperty(java.lang.Object key, java.lang.Object propertyValue)
key
- the key to a propertypropertyValue
- the value to associate with the keysetAlgorithmProperty(Object,Object)
public void doLayoutCore(LayoutGraph graph)
doLayoutCore
in class CanonicMultiStageLayouter
graph
- the input graphprotected Grouping createGrouping(LayoutGraph graph)
doLayoutCore(LayoutGraph)
and creates a Grouping
instance
in case of a grouped graph.
graph
- the input graph
Grouping
instance or null
if the graph is not groupedprotected DataProvider getIncrementalHints(LayoutGraph graph)
doLayoutCore(LayoutGraph)
and returns a DataProvider
that holds
the HierarchicLayouter.IncrementalHint
s information.
The DataProvider
holding the information about
HierarchicLayouter.IncrementalHint
s is registered with the graph using key
INCREMENTAL_HINTS_DPKEY
.
graph
- the input graph
DataProvider
instance or null
INCREMENTAL_HINTS_DPKEY
protected DataProvider getEdgeLayoutDescriptors(LayoutGraph graph)
doLayoutCore(LayoutGraph)
and returns a DataProvider
that holds the
EdgeLayoutDescriptor
information.
The DataProvider
holding the information about the node layout is registered with the graph using key
EDGE_LAYOUT_DESCRIPTOR_DPKEY
.
graph
- the input graph
DataProvider
instance or null
EdgeLayoutDescriptor
,
EDGE_LAYOUT_DESCRIPTOR_DPKEY
protected DataProvider getNodeLayoutDescriptors(LayoutGraph graph)
doLayoutCore(LayoutGraph)
and returns a DataProvider
that holds the
NodeLayoutDescriptor
information.
The DataProvider
holding the information about the node layout is registered with the graph using key
NODE_LAYOUT_DESCRIPTOR_DPKEY
.
graph
- the input graph
DataProvider
instance or null
NodeLayoutDescriptor
,
NODE_LAYOUT_DESCRIPTOR_DPKEY
protected DataProvider getSwimLaneDescriptors(LayoutGraph graph)
doLayoutCore(LayoutGraph)
and returns a DataProvider
that holds the
SwimLaneDescriptor
information.
The DataProvider
holding the information about swimlanes is registered with the graph using key
SWIMLANE_DESCRIPTOR_DPKEY
.
graph
- the input graph
DataProvider
instance or null
SwimLaneDescriptor
,
SWIMLANE_DESCRIPTOR_DPKEY
protected void createItemData(LayoutGraph g, ItemFactory itemFactory)
doLayoutCore(LayoutGraph)
, creates the NodeData
and EdgeData
instances and binds them to the elements using the given itemFactory
.
g
- the input graphitemFactory
- the given ItemFactory
instanceprotected Sequencer createSubgraphLayerSequencer()
doLayoutCore(LayoutGraph)
and creates a Sequencer
implementation that
can sequence subgraphs incrementally.
By default, a suitable private implementation of Sequencer
is returned. It may be overridden to return
custom implementations of the Sequencer
interface.
Sequencer
implementationprotected Layers createLayers(LayoutDataProvider ldp)
doLayoutCore(LayoutGraph)
and creates an appropriate Layers
implementation using the given LayoutDataProvider
instance.
By default, a suitable private implementation of Layers
is returned. It may be overridden to return
custom implementations of the Layers
interface.
ldp
- the given LayoutDataProvider
instance
Layers
implementationprotected Layerer createIncrementalLayerer()
doLayoutCore(LayoutGraph)
and creates an appropriate
Layerer
implementation.
By default, a ConstraintIncrementalLayerer
instance with a TopologicalLayerer
instance as
argument is returned.
This method may be overridden to return a custom Layerer
implementation.
Layerer
implementationprotected EdgeReverser createEdgeReverser()
doLayoutCore(LayoutGraph)
and reates an appropriate EdgeReverser
implementation.
By default, a suitable private implementation of EdgeReverser
is returned. It may be overridden to return
a custom EdgeReverser
implementation.
protected void publishLayers(LayoutGraph graph, Layers layers)
The layering information is stored in a DataProvider
registered with the graph using key
LAYER_VALUE_HOLDER_DPKEY
.
graph
- the input graphlayers
- the Layers
implementation that provides the layering informationLAYER_VALUE_HOLDER_DPKEY
protected void publishSequences(LayoutGraph graph, Layers layers, LayoutDataProvider ldp)
The sequencing information is stored in a DataProvider
registered with the graph using key
SEQUENCE_VALUE_HOLDER_DPKEY
.
graph
- the input graphlayers
- the Layers
implementation that provides the layering and sequencing informationldp
- the LayoutDataProvider
implementation which provides access to the NodeData
and
EdgeData
instancesSEQUENCE_VALUE_HOLDER_DPKEY
protected void reduceBendCount(LayoutGraph graph)
By default, this method removes collinear bends from the graph. A bend point is considered to be collinear if it lies on a line with its preceding and succeeding bend point. It may be overridden for a custom implementation of bend removal.
graph
- the input graphprotected void reduceBendCount(LayoutGraph graph, double bendReductionThreshold)
By default, this method removes collinear bends from the graph. A bend point is considered to be collinear if it lies on a line with its preceding and succeeding bend point. It may be overridden for a custom implementation of bend removal.
graph
- the input graphbendReductionThreshold
- this method removes a bend, if its horizontal/vertical distance to the
closest collinear bend is above this valuepublic IncrementalHintsFactory createIncrementalHintsFactory()
IncrementalHintsFactory
implementation used for obtaining hint objects associated with nodes
and edges of the graph prior to the invocation of the layout algorithm.
HierarchicLayouter.IncrementalHint
s can be obtained from a
DataProvider
that is registered with the graph using key INCREMENTAL_HINTS_DPKEY
.
IncrementalHintsFactory
instanceINCREMENTAL_HINTS_DPKEY
public SequenceConstraintFactory createSequenceConstraintFactory(Graph graph)
By default, a suitable private implementation of SequenceConstraintFactory
is returned.
graph
- the given graph
SequenceConstraintFactory
instancepublic LayerConstraintFactory createLayerConstraintFactory(Graph graph)
layer constraint factory
that allows to create hints that affect
the assignment of the nodes to layers.
By default, a suitable private implementation of LayerConstraintFactory
is returned.
graph
- the given graph
LayerConstraintFactory
instance
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |