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 component layouter that handles hierarchically grouped graphs in a special way. Unlike ComponentLayouter this layout stage allows isolated subgraphs within a group to be laid out as a separate component.

The orthogonal group layouter OrthogonalGroupLayouter uses this layout stage as component layouter.


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_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, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
IsolatedGroupComponentLayouter()
          Create a new instance of IsolatedGroupComponentLayouter.
IsolatedGroupComponentLayouter(Layouter coreLayouter)
          Create a new instance of IsolatedGroupComponentLayouter.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Returns true, iff the coreLayouter returns true for all components of the graph.
 void doLayout(LayoutGraph graph)
          Calculate the layout.
protected  int findIsolatedGraphComponents(LayoutGraph graph, NodeMap compNumber)
          Determines which nodes will belong to the same graph component.
 
Methods inherited from class y.layout.ComponentLayouter
arrangeComponents, arrangeFields, calcBoundingBox, findGraphComponents, getComponentSpacing, getGridSpacing, getPreferredLayoutSize, getStyle, isComponentArrangementEnabled, isGroupingActive, isLabelAwarenessEnabled, setComponentArrangementEnabled, setComponentSpacing, setGridSpacing, setGroupingActive, setLabelAwarenessEnabled, setOrigin, 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)
Create a new instance of IsolatedGroupComponentLayouter.

Parameters:
coreLayouter - the core layouter being invoked for each component of the graph.

IsolatedGroupComponentLayouter

public IsolatedGroupComponentLayouter()
Create a new instance of IsolatedGroupComponentLayouter.

Method Detail

canLayout

public boolean canLayout(LayoutGraph graph)
Returns true, iff the coreLayouter returns true for all components of the graph.

Specified by:
canLayout in interface Layouter
Overrides:
canLayout in class ComponentLayouter

findIsolatedGraphComponents

protected int findIsolatedGraphComponents(LayoutGraph graph,
                                          NodeMap compNumber)
Determines which nodes will belong to the same graph component. Unlike ComponentLayouter this implementation identifies isolated subgraphs within a group also as separate components.


doLayout

public void doLayout(LayoutGraph graph)
Description copied from class: ComponentLayouter
Calculate the layout. This is done by decomposing the graph in its connected components and applying the core layout algorithm on each component.

Specified by:
doLayout in interface Layouter
Overrides:
doLayout in class ComponentLayouter
See Also:
AbstractLayoutStage.getCoreLayouter(), ComponentLayouter.ComponentLayouter(Layouter)

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