|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecty.layout.hierarchic.incremental.SubcomponentDescriptor
public class SubcomponentDescriptor
A SubcomponentDescriptor
defines settings for subcomponents that are arranged by a different layout
algorithm than their containing graph for IncrementalHierarchicLayouter
.
Property getLayoutAlgorithm()
defines the algorithm that is responsible for arranging the
subcomponent. The placement policy
specifies the integration into
the main hierarchic layout.
Nodes mapped to the same SubcomponentDescriptor
instance form a component that is arranged as an independent
sub-graph, induced by the component nodes.
The mapping is retrieved from a DataProvider
registered with the input graph with
key IncrementalHierarchicLayouter.SUBCOMPONENT_DESCRIPTOR_DPKEY
.
Components may not be nested, that is, a subcomponent is not allowed to contain nodes that belong to yet
another subcomponent. Nesting of subcomponents results in an exception.
A graph in hierarchic
layout with subcomponents in 3 layout styles. Blue: Organic
, Green: Hierarchic
, Orange: Tree
IncrementalHierarchicLayouter.SUBCOMPONENT_DESCRIPTOR_DPKEY
![]() |
![]() |
Field Summary | |
---|---|
static byte |
SUB_COMPONENT_PLACEMENT_POLICY_ALWAYS_INTEGRATED
A placement policy that integrates subcomponents at a connector node if such a node exists. |
static byte |
SUB_COMPONENT_PLACEMENT_POLICY_AUTOMATIC
A placement policy that integrates subcomponents at a connector node if such an integration is possible without causing overlaps or violating constraints of the main layout algorithm. |
static byte |
SUB_COMPONENT_PLACEMENT_POLICY_ISOLATED
A placement policy that treats the component as a single node in the containing graph so that it is placed as such by the main layout algorithm. |
Constructor Summary | |
---|---|
SubcomponentDescriptor()
Creates a new SubcomponentDescriptor instance with default settings. |
|
SubcomponentDescriptor(byte placementPolicy,
Layouter layoutAlgorithm)
Creates a new SubcomponentDescriptor instance with the specified settings. |
|
SubcomponentDescriptor(Layouter layoutAlgorithm)
Creates a new SubcomponentDescriptor instance with the specified layout algorithm. |
Method Summary | |
---|---|
Node |
getConnectorNode(LayoutGraph graph)
Determines if there is a unique node outside the subcomponent whose removal would disconnect the component from the remaining graph and returns the node if it exists. |
Layouter |
getLayoutAlgorithm()
Returns the Layouter for the subgraph that is induced by the nodes associated with this descriptor. |
byte |
getPlacementPolicy()
Returns the policy defining how the subcomponent is placed within the layout context of the remaining graph. |
void |
setLayoutAlgorithm(Layouter layoutAlgorithm)
Specifies the Layouter for the subgraph that is induced by the nodes associated with this descriptor. |
void |
setPlacementPolicy(byte placementPolicy)
Specifies the policy defining how the subcomponent is placed within the layout context of the remaining graph. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte SUB_COMPONENT_PLACEMENT_POLICY_ISOLATED
The hierarchic layout chooses a layer for the whole component like it does for normal nodes. All inter-edges are at that point re-directed to a component representative node.
An isolated component does not have a specific connector node
but
it can have many non-component nodes it is connected to.
public static final byte SUB_COMPONENT_PLACEMENT_POLICY_ALWAYS_INTEGRATED
A component has a valid connector node
if all edges to non-component
nodes are adjacent to the connector node.
The connector node and its edges to the component are included and handled by
the layout algorithm
arranging the component.
If there is no unique connecting node, the subcomponent is instead treated
in an isolated
way.
sequence constraints
,
layer constraints
, incremental layouts
,
partition grids
, PortCandidate
s or PortConstraint
s.setPlacementPolicy(byte)
,
Constant Field Values![]() Both components are integrated at the bottom side of the connector node, disregarding overlaps between them |
public static final byte SUB_COMPONENT_PLACEMENT_POLICY_AUTOMATIC
A component has a valid connector node
if all edges to non-component
nodes are adjacent to the connector node.
If there is a connector node and if the integration is possible, the connector node and its edges to the
component are handled by the layout algorithm
arranging the component.
If an integration is not possible, the subcomponent is instead treated in
an isolated
way.
An important condition for the integration to be possible is that the orientation of the inner layout must be
orthogonal with respect to the main layout, e.g., one top-to-bottom orientation and one left-to-right orientation.
In other words, the component layout generated by the sub-layout
must be
completely on a side of the connector node which is orthogonal to the flow of the main hierarchic layout.
If the sub-layout arranges the connector node somewhere in the middle of the component, then an integration
of the connector into the main layout may lead to overlaps. This can be forced when using placement policy
SUB_COMPONENT_PLACEMENT_POLICY_ALWAYS_INTEGRATED
.
setPlacementPolicy(byte)
,
Constant Field Values![]() One component can be placed integrated at the connector node but not both, since they have the same orientation (one above and one below would work) |
Constructor Detail |
---|
public SubcomponentDescriptor()
SubcomponentDescriptor
instance with default settings.
public SubcomponentDescriptor(Layouter layoutAlgorithm)
SubcomponentDescriptor
instance with the specified layout algorithm.
layoutAlgorithm
- The layout algorithm handling the layout of the graph induced by the subcomponent.public SubcomponentDescriptor(byte placementPolicy, Layouter layoutAlgorithm)
SubcomponentDescriptor
instance with the specified settings.
placementPolicy
- The policy for placing the component into the layout context of the remaining graph.layoutAlgorithm
- The layout algorithm handling the layout of the graph induced by the subcomponent.Method Detail |
---|
public Layouter getLayoutAlgorithm()
Layouter
for the subgraph that is induced by the nodes associated with this descriptor.
Layouter
handling the subgraph that is induced by the nodes associated with this descriptor.setLayoutAlgorithm(Layouter)
public void setLayoutAlgorithm(Layouter layoutAlgorithm)
Layouter
for the subgraph that is induced by the nodes associated with this descriptor.
IncrementalHierarchicLayouter
instance as layout algorithm
responsible for the component. This way, different hierarchical layout styles can be conveniently combined
into one layout (e.g. layouts with different orientations). The best layout results are achieved if a
is connected to only a single other connector node
. In that case
this connector can be embedded in both the main layout and the inner layout.
A condition for this is that the orientations of the two layouts are orthogonal with respect to each other,
e.g., one top-to-bottom orientation and one left-to-right orientation.layoutAlgorithm
- the Layouter
handling the subgraph that is induced by the nodes associated with this descriptor.![]() Subcomponent in tree layout | ![]() Subcomponent in hierarchic layout | ![]() Subcomponent in organic layout using a star substructure |
public byte getPlacementPolicy()
setPlacementPolicy(byte)
public void setPlacementPolicy(byte placementPolicy)
SUB_COMPONENT_PLACEMENT_POLICY_AUTOMATIC
. It is automatically determined how the subcomponent is placed.placementPolicy
- one of the predefined placement policies.
java.lang.IllegalArgumentException
- if an unknown placement policy is given.public Node getConnectorNode(LayoutGraph graph)
SUB_COMPONENT_PLACEMENT_POLICY_ALWAYS_INTEGRATED
or
SUB_COMPONENT_PLACEMENT_POLICY_AUTOMATIC
.graph
- the graph containing the subcomponent.
null
otherwise.
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |