y.layout.grouping
Class IsolatedGroupComponentLayouter

java.lang.Object
  |
  +--y.layout.AbstractLayoutStage
        |
        +--y.layout.ComponentLayouter
              |
              +--y.layout.grouping.IsolatedGroupComponentLayouter
All Implemented Interfaces:
Layouter, LayoutStage

public class IsolatedGroupComponentLayouter
extends ComponentLayouter

A special component layouter that handled hierarchically grouped graphs in a special way. Unlike ComponentLayouter this layout stage allows isolated subgraphs within a group to be laid as a separate component.

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


Field Summary
 
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 findGraphComponents(LayoutGraph graph, NodeMap compNumber)
          Determines which nodes will belong to the same graph component.
 
Methods inherited from class y.layout.ComponentLayouter
arrangeComponentGraphs, getComponentSpacing, getGridSpacing, isGroupingActive, setComponentSpacing, setGridSpacing, setGroupingActive, setOrigin, setPreferredLayoutSize
 
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

findGraphComponents

protected int findGraphComponents(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.

Overrides:
findGraphComponents in class ComponentLayouter
Parameters:
graph - the input graph
compNumber - return value that will hold the zero-based number of the component that it belongs to. The component number of Node v is compNum.getInt().
Returns:
the number of connected components of this graph.

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 layout algorithm on them.

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

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

2003