Search this API

y.layout
Class PartitionLayouter

java.lang.Object
  extended by y.layout.AbstractLayoutStage
      extended by y.layout.PartitionLayouter
All Implemented Interfaces:
Layouter, LayoutStage
Direct Known Subclasses:
CompactOrthogonalLayouter

public class PartitionLayouter
extends AbstractLayoutStage

PartitionLayouter provides a framework for layouts that are based on a divide and conquer approach.

Concept

The approach can be subdivided into four stages:

  1. The input graph is partitioned into smaller units. Implementations of this phase can be set using method setPartitionFinder(PartitionLayouter.PartitionFinder).
  2. Optionally, the layout algorithm arranges each partition. Implementations of this phase can be set using method AbstractLayoutStage.setCoreLayouter(Layouter).
  3. The graph partitions are arranged next to each other keeping their layout. Implementations of this phase can be set using method setPartitionPlacer(PartitionLayouter.PartitionPlacer).
  4. Edges that connect nodes in different graph partitions will be routed. Implementations of this phase can be set using method setInterEdgeRouter(PartitionLayouter.InterEdgeRouter)

 

Nested Class Summary
static class PartitionLayouter.ChannelInterEdgeRouter
          PartitionLayouter.ChannelInterEdgeRouter routes inter-edges using ChannelEdgeRouter.
static class PartitionLayouter.ComponentPartitionPlacer
          PartitionLayouter.ComponentPartitionPlacer uses ComponentLayouter to place the partitions.
static class PartitionLayouter.EdgeBetweennessPartitionFinder
          PartitionLayouter.EdgeBetweennessPartitionFinder uses Groups.edgeBetweennessClustering(y.base.Graph, NodeMap, boolean, int, int, DataProvider) as strategy for finding graph partitions.
static interface PartitionLayouter.InterEdgeRouter
          An PartitionLayouter.InterEdgeRouter is responsible for routing inter-edges.
static class PartitionLayouter.OrthogonalInterEdgeRouter
          PartitionLayouter.OrthogonalInterEdgeRouter routes inter-edges using OrthogonalEdgeRouter.
static interface PartitionLayouter.PartitionFinder
          A PartitionLayouter.PartitionFinder is responsible for partitioning the input graph.
static interface PartitionLayouter.PartitionPlacer
          A PartitionLayouter.PartitionPlacer is responsible for arranging the graph partitions.
static class PartitionLayouter.PolylineInterEdgeRouter
          PartitionLayouter.PolylineInterEdgeRouter routes inter-edges using EdgeRouter.
 
Field Summary
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
PartitionLayouter()
          Creates a new PartitionLayouter instance with default settings.
 
Method Summary
 boolean canLayout(LayoutGraph graph)
          Accepts all graphs that can be handled by the core layout algorithm.
 void doLayout(LayoutGraph graph)
          Arranges and places independent partitions in the graph.
 PartitionLayouter.InterEdgeRouter getInterEdgeRouter()
          Return the PartitionLayouter.InterEdgeRouter instance that is responsible for inter-edge routing.
 PartitionLayouter.PartitionFinder getPartitionFinder()
          Returns the PartitionLayouter.PartitionFinder instance that is responsible for partitioning the input graph.
 PartitionLayouter.PartitionPlacer getPartitionPlacer()
          Returns the PartitionLayouter.PartitionPlacer instance that is responsible for arranging the graph partitions.
 void setInterEdgeRouter(PartitionLayouter.InterEdgeRouter interEdgeRouter)
          Specifies the PartitionLayouter.InterEdgeRouter instance that is responsible for inter-edge routing.
 void setPartitionFinder(PartitionLayouter.PartitionFinder partitionFinder)
          Specifies the PartitionLayouter.PartitionFinder instance that is responsible for partitioning the input graph.
 void setPartitionPlacer(PartitionLayouter.PartitionPlacer partitionPlacer)
          Specifies the PartitionLayouter.PartitionPlacer instance that is responsible for arranging the graph partitions.
 
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

PartitionLayouter

public PartitionLayouter()
Creates a new PartitionLayouter instance with default settings.

Method Detail

canLayout

public boolean canLayout(LayoutGraph graph)
Accepts all graphs that can be handled by the core layout algorithm.

If there is no core layout algorithm, all graphs are accepted.

Parameters:
graph - the input graph
Returns:
true if there is no core layout algorithm or the core layout algorithm accepts the graph, false otherwise
See Also:
Layouter.doLayout(LayoutGraph)

doLayout

public void doLayout(LayoutGraph graph)
Arranges and places independent partitions in the graph.

Parameters:
graph - the input graph
Throws:
java.lang.IllegalStateException - if the partition finder is null
See Also:
Layouter.canLayout(LayoutGraph)

getPartitionFinder

public PartitionLayouter.PartitionFinder getPartitionFinder()
Returns the PartitionLayouter.PartitionFinder instance that is responsible for partitioning the input graph.

Returns:
the PartitionLayouter.PartitionFinder that is used
See Also:
setPartitionFinder(PartitionFinder)

setPartitionFinder

public void setPartitionFinder(PartitionLayouter.PartitionFinder partitionFinder)
Specifies the PartitionLayouter.PartitionFinder instance that is responsible for partitioning the input graph.

Default Value:
The default value is null.
Parameters:
partitionFinder - the PartitionLayouter.PartitionFinder that should be used

getPartitionPlacer

public PartitionLayouter.PartitionPlacer getPartitionPlacer()
Returns the PartitionLayouter.PartitionPlacer instance that is responsible for arranging the graph partitions.

Returns:
the PartitionLayouter.PartitionPlacer that is used
See Also:
setPartitionPlacer(PartitionPlacer)

setPartitionPlacer

public void setPartitionPlacer(PartitionLayouter.PartitionPlacer partitionPlacer)
Specifies the PartitionLayouter.PartitionPlacer instance that is responsible for arranging the graph partitions.

Default Value:
The default value is null.
Parameters:
partitionPlacer - the PartitionLayouter.PartitionPlacer that should be used

getInterEdgeRouter

public PartitionLayouter.InterEdgeRouter getInterEdgeRouter()
Return the PartitionLayouter.InterEdgeRouter instance that is responsible for inter-edge routing.

Returns:
the PartitionLayouter.InterEdgeRouter that is used
See Also:
setInterEdgeRouter(InterEdgeRouter)

setInterEdgeRouter

public void setInterEdgeRouter(PartitionLayouter.InterEdgeRouter interEdgeRouter)
Specifies the PartitionLayouter.InterEdgeRouter instance that is responsible for inter-edge routing.

Default Value:
The default value is null.
Parameters:
interEdgeRouter - the PartitionLayouter.InterEdgeRouter that should be used

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