Search this API

y.layout.router
Class PatchRouterStage

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

public class PatchRouterStage
extends AbstractLayoutStage

Performance optimization stage for OrthogonalEdgeRouter. This layout stage decomposes the input graph for the orthogonal edge router into several smaller graphs on each of which the edge router will perform its action separately, hence speeding up execution time and reducing peak memory consumption.


Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
PatchRouterStage(Layouter coreLayouter)
          Creates a new instance of PatchRouterStage.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Returns true iff the given graph can be laid out by this algorithm.
 void doLayout(LayoutGraph graph)
          Assigns orthogonal edge paths to the edges of a big graph, efficiently.
 int getActivationThreshold()
          Returns the activation threshold for this class.
 void setActivationThreshold(int threshold)
          Sets the activation threshold for this class.
 
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

PatchRouterStage

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

Parameters:
coreLayouter - the core layouter invoked by this stage. The coreLayouter must contain an instance of OrthogonalEdgeRouter its layout pipeline.
Method Detail

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.


setActivationThreshold

public void setActivationThreshold(int threshold)
Sets the activation threshold for this class. The patch router will perform its optimization step only if the sum of the edges and nodes of the input graph is bigger than the activation threshold. By default the threshold value is set to 1000.


getActivationThreshold

public int getActivationThreshold()
Returns the activation threshold for this class.

See Also:
setActivationThreshold(int)

doLayout

public void doLayout(LayoutGraph graph)
Assigns orthogonal edge paths to the edges of a big graph, efficiently. Note that this stage will only have an optimizing effect if the graph is bigger than the activation threshold and the sphere of action of the core router includes all edges.

Precondition:
a LayoutStage of getCoreLayouter() must be an instance of OrthogonalEdgeRouter.

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