Search this API

y.layout.grouping
Class IsolatedGroupComponentLayouter

java.lang.Object
  extended by y.layout.AbstractLayoutStage
      extended by y.layout.ComponentLayouter
          extended by y.layout.grouping.IsolatedGroupComponentLayouter
All Implemented Interfaces:
Layouter, LayoutStage

public class IsolatedGroupComponentLayouter
extends ComponentLayouter

A special ComponentLayouter implementation that allows to lay out isolated subgraphs within a group as separate components.

OrthogonalGroupLayouter uses this layout stage to arrange components.


Example of a hierarchically grouped graph with two components that are laid out by OrthogonalGroupLayouter as separate components.

 
Your browser does not support SVG content.

Field Summary
 
Fields inherited from class y.layout.ComponentLayouter
GIVEN_COMPONENT_ID_DPKEY, LAYOUT_NODE_DPKEY, STYLE_MASK, STYLE_MODIFIER_AS_IS, STYLE_MODIFIER_NO_OVERLAP, STYLE_MULTI_ROWS, STYLE_MULTI_ROWS_COMPACT, STYLE_MULTI_ROWS_HEIGHT_CONSTRAINED, STYLE_MULTI_ROWS_HEIGHT_CONSTRAINED_COMPACT, STYLE_MULTI_ROWS_TYPE_SEPARATED, STYLE_MULTI_ROWS_WIDTH_CONSTRAINED, STYLE_MULTI_ROWS_WIDTH_CONSTRAINED_COMPACT, STYLE_NONE, STYLE_PACKED_CIRCLE, STYLE_PACKED_COMPACT_CIRCLE, STYLE_PACKED_COMPACT_RECTANGLE, STYLE_PACKED_RECTANGLE, STYLE_ROWS, STYLE_SINGLE_COLUMN, STYLE_SINGLE_ROW
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
IsolatedGroupComponentLayouter()
          Creates an instance of IsolatedGroupComponentLayouter with default settings.
IsolatedGroupComponentLayouter(Layouter coreLayouter)
          Creates an instance of IsolatedGroupComponentLayouter with the given layout algorithm as core layout algorithm.
 
Method Summary
 void doLayout(LayoutGraph graph)
          Calculates the layout based on the current core layout algorithm.
protected  int findIsolatedGraphComponents(LayoutGraph graph, NodeMap compNumber)
          Determines the nodes that belong to the same graph component.
 
Methods inherited from class y.layout.ComponentLayouter
arrangeComponents, arrangeFields, calcBoundingBox, canLayout, findGraphComponents, getComponentSpacing, getGridSpacing, getPreferredLayoutSize, getStyle, isComponentArrangementEnabled, isGroupingActive, isLabelAwarenessEnabled, setComponentArrangementEnabled, setComponentSpacing, setGridSpacing, setGroupingActive, setLabelAwarenessEnabled, setOrigin, setPreferredLayoutSize, setPreferredLayoutSize, setStyle
 
Methods inherited from class y.layout.AbstractLayoutStage
canLayoutCore, doLayoutCore, getCoreLayouter, setCoreLayouter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsolatedGroupComponentLayouter

public IsolatedGroupComponentLayouter(Layouter coreLayouter)
Creates an instance of IsolatedGroupComponentLayouter with the given layout algorithm as core layout algorithm.

Parameters:
coreLayouter - the core layout algorithm that will be invoked for each component of the graph

IsolatedGroupComponentLayouter

public IsolatedGroupComponentLayouter()
Creates an instance of IsolatedGroupComponentLayouter with default settings.

Method Detail

findIsolatedGraphComponents

protected int findIsolatedGraphComponents(LayoutGraph graph,
                                          NodeMap compNumber)
Determines the nodes that belong to the same graph component.

Unlike ComponentLayouter, this implementation additionally identifies isolated subgraphs within a group as separate components.

Parameters:
graph - the input graph
compNumber - the NodeMap 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
Returns:
the number of separate components

doLayout

public void doLayout(LayoutGraph graph)
Calculates the layout based on the current core layout algorithm.

Before calling the core layout algorithm, the IsolatedGroupComponentLayouter identifies the isolated subgraphs within a group and treats them as separate components.

Specified by:
doLayout in interface Layouter
Overrides:
doLayout in class ComponentLayouter
 
The given graph will not be copied during the layout process and the layout will be immediately applied to the given graph.
Parameters:
graph - the input graph
See Also:
Layouter.canLayout(LayoutGraph)

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.