Search this API

y.layout.tree
Class TreeComponentLayouter

java.lang.Object
  extended by y.layout.tree.TreeComponentLayouter
All Implemented Interfaces:
Layouter, LayoutStage

public class TreeComponentLayouter
extends Object
implements LayoutStage

This stage can be used to do mix layouts for tree-like subgraph structures and the non-tree like rest of a graph.


Field Summary
static Object DUMMY_NODE_DPKEY
          During the main run of the layout dummy nodes can be identified by looking at the value of the registered DataProvider which can be obtained from the graph using this key.
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
TreeComponentLayouter(Layouter treeCoreLayouter)
          Creates a new instance of TreeComponentLayouter using the specified layouter for laying out the subtrees.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Returns true iff the given graph can be laid out by this algorithm.
 void doLayout(LayoutGraph graph)
          Assigns a new graph layout to the given layout graph.
protected  void doLayoutUsingDummies(LayoutGraph graph, DataProvider dummyDp)
          Called by doLayout(y.layout.LayoutGraph) to delegate to the getCoreLayouter(), adding the dummy provider to the graph instance.
 Layouter getCoreLayouter()
          Returns the core layouter.
 Layouter getTreeComponentCoreLayouter()
          Returns the core layouter used for tree components.
 boolean isOrientationOptimizationActive()
          Returns true if this layouter tries to improve tree component placement by changing the components orientation and false otherwise.
 void setCoreLayouter(Layouter l)
          Sets the core layouter.
 void setOrientationOptimizationActive(boolean orientationOptimizationActive)
          Specifies whether this layouter should try to improve tree component placement by changing the components orientation.
 void setTreeComponentCoreLayouter(Layouter treeComponentCoreLayouter)
          Specifies the core layouter used for tree components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DUMMY_NODE_DPKEY

public static final Object DUMMY_NODE_DPKEY
During the main run of the layout dummy nodes can be identified by looking at the value of the registered DataProvider which can be obtained from the graph using this key.

Constructor Detail

TreeComponentLayouter

public TreeComponentLayouter(Layouter treeCoreLayouter)
Creates a new instance of TreeComponentLayouter using the specified layouter for laying out the subtrees.

Method Detail

canLayout

public boolean canLayout(LayoutGraph graph)
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.

Specified by:
canLayout in interface Layouter

doLayout

public void doLayout(LayoutGraph graph)
Assigns a new graph layout to the given layout graph.

Specified by:
doLayout in interface Layouter

doLayoutUsingDummies

protected void doLayoutUsingDummies(LayoutGraph graph,
                                    DataProvider dummyDp)
Called by doLayout(y.layout.LayoutGraph) to delegate to the getCoreLayouter(), adding the dummy provider to the graph instance.


getCoreLayouter

public Layouter getCoreLayouter()
Returns the core layouter.

Specified by:
getCoreLayouter in interface LayoutStage

setCoreLayouter

public void setCoreLayouter(Layouter l)
Sets the core layouter.

Specified by:
setCoreLayouter in interface LayoutStage

getTreeComponentCoreLayouter

public Layouter getTreeComponentCoreLayouter()
Returns the core layouter used for tree components.


setTreeComponentCoreLayouter

public void setTreeComponentCoreLayouter(Layouter treeComponentCoreLayouter)
Specifies the core layouter used for tree components.


isOrientationOptimizationActive

public boolean isOrientationOptimizationActive()
Returns true if this layouter tries to improve tree component placement by changing the components orientation and false otherwise.


setOrientationOptimizationActive

public void setOrientationOptimizationActive(boolean orientationOptimizationActive)
Specifies whether this layouter should try to improve tree component placement by changing the components orientation.


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