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

PatchRouterStage optimizes the performance of OrthogonalEdgeRouter.

This stage decomposes the input graph into several smaller subgraphs and the edge routing algorithm will be applied on each of them separately. This will reduce the execution time and peak memory consumption.

 
PatchRouterStage provides an optimization step for OrthogonalEdgeRouter and will not have an effect with other edge routing algorithms.
See Also:
OrthogonalEdgeRouter
 

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 using the given core layout algortihm.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Accepts all graphs that are accepted by the core layout algorithm.
 void doLayout(LayoutGraph graph)
          Decomposes the graph in order to apply OrthogonalEdgeRouter to smaller partial subgraphs.
 int getActivationThreshold()
          Returns a threshold for activating PatchRouterStage.
 void setActivationThreshold(int threshold)
          Specifies a threshold for activating PatchRouterStage.
 
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 using the given core layout algortihm.

 
The core layout algorithm must contain an instance of OrthogonalEdgeRouter in its layout pipeline. Also, the scope of this routing algorithm needs to contain all edges in the graph.
Parameters:
coreLayouter - the core layout algorithm
Method Detail

canLayout

public boolean canLayout(LayoutGraph graph)
Accepts all graphs that are accepted by the core layout algorithm.

Parameters:
graph - the input graph
Returns:
true if the core layout algorithm can handle the graph, false otherwise
See Also:
Layouter.doLayout(LayoutGraph)

setActivationThreshold

public void setActivationThreshold(int threshold)
Specifies a threshold for activating PatchRouterStage.

The optimization step implemented in this stage will only be applied if the sum of the edges and nodes of the input graph is greater than the specified activation threshold.

 
If the threshold is negative, PatchRouterStage will be active for every graph.
Default Value:
The default value is 1000.
Parameters:
threshold - the threshold for activating this stage

getActivationThreshold

public int getActivationThreshold()
Returns a threshold for activating PatchRouterStage.

The optimization step implemented in this stage will only be applied if the sum of the edges and nodes of the input graph is greater than the specified activation threshold.

 
If the threshold is negative, PatchRouterStage will be active for every graph.
Returns:
the threshold for activating this stage
See Also:
setActivationThreshold(int)

doLayout

public void doLayout(LayoutGraph graph)
Decomposes the graph in order to apply OrthogonalEdgeRouter to smaller partial subgraphs.

 
This stage will only have an optimizing effect if the sum of the edges and nodes of the input graph is greater than the activation threshold.
Precondition:
The core layout algorithm must be an instance of OrthogonalEdgeRouter or at least must have such an instance in its layout pipeline.
Parameters:
graph - the input graph
See Also:
Layouter.canLayout(LayoutGraph)

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