Search this API

y.layout.router
Class ReducedSphereOfActionStage

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

public class ReducedSphereOfActionStage
extends AbstractLayoutStage

ReducedSphereOfActionStage optimizes the performance of OrthogonalEdgeRouter when the scope is constrained to a subset of edges.

 
ReducedSphereOfActionStage provides an optimization step for OrthogonalEdgeRouter and will not have an effect with other edge routing algorithms.
See Also:
OrthogonalEdgeRouter, OrthogonalEdgeRouter.setSphereOfAction(byte)
 

Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
ReducedSphereOfActionStage(Layouter coreLayouter)
          Creates a new instance of ReducedSphereOfActionStage 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)
          Adds an optimization step to OrthogonalEdgeRouter when routing a subset of edges.
 int getActivationThreshold()
          Returns a threshold for activating ReducedSphereOfActionStage.
 void setActivationThreshold(int threshold)
          Specifies a threshold for activating ReducedSphereOfActionStage.
 
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

ReducedSphereOfActionStage

public ReducedSphereOfActionStage(Layouter coreLayouter)
Creates a new instance of ReducedSphereOfActionStage 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 of 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)

doLayout

public void doLayout(LayoutGraph graph)
Adds an optimization step to OrthogonalEdgeRouter when routing a subset of edges.

 
This stage will only have an optimizing effect if the graph is greater than the activation threshold and only a subset of edges of the graph is included.
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:
OrthogonalEdgeRouter.setSphereOfAction(byte)

setActivationThreshold

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

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, ReducedSphereOfActionStage will be active for every graph.
Default Value:
The default value is 200.
Parameters:
threshold - the threshold for activating this stage

getActivationThreshold

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

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, ReducedSphereOfActionStage will be active for every graph.
Default Value:
The default value is 200.
Returns:
the threshold for activating this stage
See Also:
setActivationThreshold(int)

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