Search this API

y.layout.organic
Class SplitEdgeLayoutStage

java.lang.Object
  extended by y.layout.organic.SplitEdgeLayoutStage
All Implemented Interfaces:
Layouter, LayoutStage

public class SplitEdgeLayoutStage
extends Object
implements LayoutStage

This layout stage replaces edges by a path of nodes before it calls a core layouter. After the core layouter is finished this stage transforms the substituted path of nodes back to the original edge. For each node in the path there will be a bend in the original edge. The coordinate of the bend will be the center coordinate of the corresponding path node.


Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
SplitEdgeLayoutStage()
          Creates a new instance of SplitEdgeLayouter
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Returns true
 void doLayout(LayoutGraph graph)
          Assigns a new graph layout to the given layout graph
 Layouter getCoreLayouter()
          Returns the core layouter.
 double getProxyNodeSize()
          Returns the size used as width/height for proxy nodes, i.e. nodes inserted by this layout stage.
 Object getSplitEdgesDpKey()
          Returns the DataProvider key that determines which edges are to be split.
 Object getSplitNodesDpKey()
          Returns the DataProvider key to mark the nodes, that were created by splitting edges, for the core layouter.
 double getSplitSegmentLength()
          Returns the split segment length.
 void setCoreLayouter(Layouter l)
          Sets the core layouter.
 void setProxyNodeSize(double proxyNodeSize)
          Sets the size which is used as width/height for proxy nodes, i.e. nodes inserted by this layout stage.
 void setSplitEdgesDpKey(Object key)
          Specifies the DataProvider key that determines which edges are to be split.
 void setSplitNodesDpKey(Object key)
          Specifies the DataProvider key to mark the nodes, that were created by splitting edges, for the core layouter.
 void setSplitSegmentLength(double l)
          Sets the split segment length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplitEdgeLayoutStage

public SplitEdgeLayoutStage()
Creates a new instance of SplitEdgeLayouter

Method Detail

getSplitEdgesDpKey

public Object getSplitEdgesDpKey()
Returns the DataProvider key that determines which edges are to be split.

By default, Layouter.SELECTED_EDGES is used.

Returns:
the DataProvider key that determines which edges are to be split.
See Also:
setSplitEdgesDpKey(Object)

setSplitEdgesDpKey

public void setSplitEdgesDpKey(Object key)
Specifies the DataProvider key that determines which edges are to be split.

By default, Layouter.SELECTED_EDGES is used.

Throws:
IllegalArgumentException - if the specified key is null.
Parameters:
key - the DataProvider key.
See Also:
getSplitEdgesDpKey()

getSplitNodesDpKey

public Object getSplitNodesDpKey()
Returns the DataProvider key to mark the nodes, that were created by splitting edges, for the core layouter.

By default, Layouter.SELECTED_NODES is used.

Returns:
the DataProvider key to mark newly created nodes by splitting edges.
See Also:
setSplitNodesDpKey(Object)

setSplitNodesDpKey

public void setSplitNodesDpKey(Object key)
Specifies the DataProvider key to mark the nodes, that were created by splitting edges, for the core layouter.

By default, Layouter.SELECTED_NODES is used.

Throws:
IllegalArgumentException - if the specified key is null.
Parameters:
key - the DataProvider key.
See Also:
getSplitNodesDpKey()

setSplitSegmentLength

public void setSplitSegmentLength(double l)
Sets the split segment length. The split segment length determines the length of the path that will replace an original edge in the graph. The length of the original edge path divided by the given split segment length yields the number of nodes on the new node path.


getSplitSegmentLength

public double getSplitSegmentLength()
Returns the split segment length.

See Also:
setSplitSegmentLength(double)

getProxyNodeSize

public double getProxyNodeSize()
Returns the size used as width/height for proxy nodes, i.e. nodes inserted by this layout stage.


setProxyNodeSize

public void setProxyNodeSize(double proxyNodeSize)
Sets the size which is used as width/height for proxy nodes, i.e. nodes inserted by this layout stage.


canLayout

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

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

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