public class IsolatedGroupComponentLayout extends ComponentLayout
ComponentLayout
implementation that allows to lay out isolated subgraphs within a group as separate
components.
OrthogonalLayout
uses this layout stage to arrange
components.
Example of a hierarchically grouped graph with two components that are laid out by OrthogonalLayout
as separate components.
AFFECTED_COMPONENTS_DPKEY, COMPONENT_ID_DPKEY
Constructor and Description |
---|
IsolatedGroupComponentLayout()
Creates an instance of
IsolatedGroupComponentLayout with the given layout algorithm as
core layout algorithm . |
IsolatedGroupComponentLayout(ILayoutAlgorithm coreLayouter)
Creates an instance of
IsolatedGroupComponentLayout with the given layout algorithm as
core layout algorithm . |
Modifier and Type | Method and Description |
---|---|
void |
applyLayout(LayoutGraph graph)
Calculates the layout based on the current
core layout algorithm . |
protected int |
findIsolatedGraphComponents(LayoutGraph graph,
INodeMap compNumber)
Determines the nodes that belong to the same graph component.
|
arrangeComponents, arrangeFields, calculateBounds, findGraphComponents, getComponentSpacing, getGridSpacing, getPreferredSize, getStyle, isComponentArrangementEnabled, isGroupingConsiderationEnabled, isLabelConsiderationEnabled, setComponentArrangementEnabled, setComponentSpacing, setGridSpacing, setGroupingConsiderationEnabled, setLabelConsiderationEnabled, setOrigin, setPreferredSize, setStyle
applyLayoutCore, getCoreLayout, setCoreLayout
public IsolatedGroupComponentLayout()
IsolatedGroupComponentLayout
with the given layout algorithm as
core layout algorithm
.public IsolatedGroupComponentLayout(ILayoutAlgorithm coreLayouter)
IsolatedGroupComponentLayout
with the given layout algorithm as
core layout algorithm
.coreLayouter
- the core layout algorithm that will be invoked for each component of the graphpublic void applyLayout(LayoutGraph graph)
core layout algorithm
.
Before calling the core layout algorithm, the IsolatedGroupComponentLayout
identifies the isolated subgraphs
within a group and treats them as separate components.
applyLayout
in interface ILayoutAlgorithm
applyLayout
in class ComponentLayout
graph
- the input graphprotected int findIsolatedGraphComponents(LayoutGraph graph, INodeMap compNumber)
Unlike
ComponentLayout
, this implementation additionally identifies isolated subgraphs within a group as separate
components.
graph
- the input graphcompNumber
- the INodeMap
that will be filled by the layout algorithm, such that it contains the zero-based index of the
component number to which each node belongs