Search this API

y.layout
Class PartitionLayouter.ChannelInterEdgeRouter

java.lang.Object
  extended by y.layout.PartitionLayouter.ChannelInterEdgeRouter
All Implemented Interfaces:
PartitionLayouter.InterEdgeRouter
Enclosing class:
PartitionLayouter

public static class PartitionLayouter.ChannelInterEdgeRouter
extends Object
implements PartitionLayouter.InterEdgeRouter

InterEdgeRouter implementation that routes inter-edges using ChannelEdgeRouter.


Constructor Summary
PartitionLayouter.ChannelInterEdgeRouter()
          Creates a new instance of this class.
 
Method Summary
 ChannelEdgeRouter getChannelEdgeRouter()
          Returns the ChannelEdgeRouter instance used to route inter-edges.
 Object getInterEdgeDPKey()
          Returns the DataProvider key which is used to register the inter-edge data provider passed to routeInterEdges(LayoutGraph, y.base.DataProvider, y.base.DataProvider) on the given graph.
 double getMargin()
          Returns the maximum relative distance between an edge and its closest node for edges routed outside the bounding box of all graph nodes.
 boolean isRouteInterEdgesOnly()
          Returns true if this ChannelInterEdgeRouter is configured to route inter-partition edges only.
 void routeInterEdges(LayoutGraph graph, DataProvider partitionIDDP, DataProvider interEdgeDP)
          Routes inter-edges of the partitioned graph.
 void setChannelEdgeRouter(ChannelEdgeRouter router)
          Sets the ChannelEdgeRouter instance used to route inter-edges.
 void setInterEdgeDPKey(Object key)
          Specifies the DataProvider key which is used to register the inter-edge data provider passed to routeInterEdges(LayoutGraph, y.base.DataProvider, y.base.DataProvider) on the given graph.
 void setMargin(double margin)
          Specifies the maximum relative distance between an edge and its closest node for edges that are routed outside the bounding box of all graph nodes.
 void setRouteInterEdgesOnly(boolean b)
          Specifies whether to route inter-partition edges only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartitionLayouter.ChannelInterEdgeRouter

public PartitionLayouter.ChannelInterEdgeRouter()
Creates a new instance of this class.

Method Detail

isRouteInterEdgesOnly

public boolean isRouteInterEdgesOnly()
Returns true if this ChannelInterEdgeRouter is configured to route inter-partition edges only. By default, all edges are routed, i.e. routeInterEdgesOnly is set to false.

See Also:
routeInterEdges(LayoutGraph, y.base.DataProvider, y.base.DataProvider)

setRouteInterEdgesOnly

public void setRouteInterEdgesOnly(boolean b)
Specifies whether to route inter-partition edges only. By default, all edges are routed, i.e. routeInterEdgesOnly is set to false.

See Also:
routeInterEdges(LayoutGraph, y.base.DataProvider, y.base.DataProvider)

getInterEdgeDPKey

public Object getInterEdgeDPKey()
Returns the DataProvider key which is used to register the inter-edge data provider passed to routeInterEdges(LayoutGraph, y.base.DataProvider, y.base.DataProvider) on the given graph.

Returns:
the DataProvider key used to register the inter-edge data provider

setInterEdgeDPKey

public void setInterEdgeDPKey(Object key)
Specifies the DataProvider key which is used to register the inter-edge data provider passed to routeInterEdges(LayoutGraph, y.base.DataProvider, y.base.DataProvider) on the given graph. Defaults to Layouter.SELECTED_EDGES.

Parameters:
key - the DataProvider key used to register the inter-edge data provider

getChannelEdgeRouter

public ChannelEdgeRouter getChannelEdgeRouter()
Returns the ChannelEdgeRouter instance used to route inter-edges.


setChannelEdgeRouter

public void setChannelEdgeRouter(ChannelEdgeRouter router)
Sets the ChannelEdgeRouter instance used to route inter-edges.


getMargin

public double getMargin()
Returns the maximum relative distance between an edge and its closest node for edges routed outside the bounding box of all graph nodes. A negative value means that there is no restriction for the edge-node distance.

See Also:
setMargin(double)

setMargin

public void setMargin(double margin)
Specifies the maximum relative distance between an edge and its closest node for edges that are routed outside the bounding box of all graph nodes. The value is relative in the way that edges to the left or right of the nodes' bounding box must satisfy dist(edge, bounding box) <= (bounding box width) * margin and edges above or below the nodes' bounding box must satisfy dist(edge, bounding box) <= (bounding box height) * margin. Passing in a negative value effectively allow edges to be arbitrarily far from their closest nodes. By default margin is set to -1.0.

Parameters:
margin - the maximum horizontal distance between edge and closest node.

routeInterEdges

public void routeInterEdges(LayoutGraph graph,
                            DataProvider partitionIDDP,
                            DataProvider interEdgeDP)
Routes inter-edges of the partitioned graph. This implementation will register/deregister interEdgeDP on the specified input graph before/after doing any actual routing.

Specified by:
routeInterEdges in interface PartitionLayouter.InterEdgeRouter
Parameters:
graph - the input graph.
partitionIDDP - the partition id for each node in the graph.
interEdgeDP - holds a boolean value for each edge of the graph indicating if the edge is an inter-edge or not.
See Also:
getInterEdgeDPKey(), setInterEdgeDPKey(Object)

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