Search this API

y.layout.grouping
Class GroupNodeHider

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

public class GroupNodeHider
extends AbstractLayoutStage

A layout stage for hierarchically grouped graphs. Activating this stage removes all group nodes and adjacent edges from the graph before passing it on to its core layouter. After the core layouter has arranged the graph, the hidden elements will be reinserted in the graph again.


Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
GroupNodeHider()
          Creates a new instance of GroupNodeHider
GroupNodeHider(Layouter coreLayouter)
          Creates a new instance of GroupNodeHider.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Returns true iff the given graph can be laid out by this algorithm.
 void doLayout(LayoutGraph graph)
          Main layout routine that assigns new layout information to the given graph.
 GroupBoundsCalculator getGroupBoundsCalculator()
          Returns the currently installed GroupBoundsCalculator instance
 void hideGroupNodes(LayoutGraph graph)
          Hides the group nodes and adjacent edges from the graph.
 boolean isHidingEmptyGroupNodes()
          Returns whether or not group nodes without children will be hidden.
 void setGroupBoundsCalculator(GroupBoundsCalculator calc)
          Sets the new GroupBoundsCalculator instance.
 void setHidingEmptyGroupNodes(boolean hidingEmptyGroupNodes)
          Sets whether or not group nodes without children will be hidden.
 void unhideGroupNodes(LayoutGraph graph)
          Unhides group nodes and adjacent edges from the graph that were previously hidden using method hideGroupNodes(y.layout.LayoutGraph).
 
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

GroupNodeHider

public GroupNodeHider()
Creates a new instance of GroupNodeHider


GroupNodeHider

public GroupNodeHider(Layouter coreLayouter)
Creates a new instance of GroupNodeHider.

Parameters:
coreLayouter - the core layouter used by this layout stage.
Method Detail

isHidingEmptyGroupNodes

public boolean isHidingEmptyGroupNodes()
Returns whether or not group nodes without children will be hidden. Defaults to true.

Returns:
true if all group nodes will be hidden; false if only group nodes with children will be hidden.

setHidingEmptyGroupNodes

public void setHidingEmptyGroupNodes(boolean hidingEmptyGroupNodes)
Sets whether or not group nodes without children will be hidden. Defaults to true.

Parameters:
hidingEmptyGroupNodes - if true all group nodes will be hidden; if false only group nodes with children will be hidden.

hideGroupNodes

public void hideGroupNodes(LayoutGraph graph)
Hides the group nodes and adjacent edges from the graph. Furthermore this method removes all grouping related DataProviders from the input graph.


unhideGroupNodes

public void unhideGroupNodes(LayoutGraph graph)
Unhides group nodes and adjacent edges from the graph that were previously hidden using method hideGroupNodes(y.layout.LayoutGraph). Furthermore this method restores all previously removed grouping related DataProviders on the input graph.


setGroupBoundsCalculator

public void setGroupBoundsCalculator(GroupBoundsCalculator calc)
Sets the new GroupBoundsCalculator instance.

Parameters:
calc - New GroupBoundsCalculator instance.

getGroupBoundsCalculator

public GroupBoundsCalculator getGroupBoundsCalculator()
Returns the currently installed GroupBoundsCalculator instance

Returns:
the GroupBoundsCalculator instance.

canLayout

public boolean canLayout(LayoutGraph graph)
Description copied from interface: Layouter
Returns true iff the given graph can be laid out by this algorithm. Calling doLayout with the given graph as its argument will only success if this method returns true.


doLayout

public void doLayout(LayoutGraph graph)
Description copied from interface: Layouter
Main layout routine that assigns new layout information to the given graph.


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