Search this API

y.layout.hierarchic.incremental
Class BusDescriptor

java.lang.Object
  extended by y.layout.hierarchic.incremental.BusDescriptor

public class BusDescriptor
extends java.lang.Object

A BusDescriptor defines settings for edges routed on a common bus and forming a bus substructure for IncrementalHierarchicLayouter.

Edges mapped to the same BusDescriptor instance, adjacent to a common root node and having the same edge direction form a bus. The mapping is retrieved from a DataProvider registered with the input graph with key IncrementalHierarchicLayouter.BUS_DESCRIPTOR_DPKEY.


A graph that contains a bus consisting of 15 edges and using default descriptor settings (bus edges are highlighted)

See Also:
IncrementalHierarchicLayouter.BUS_DESCRIPTOR_DPKEY
 
Your browser does not support SVG content.

Field Summary
static java.lang.Object PLACE_BEFORE_BUS_DPKEY
          A DataProvider key for assigning nodes to a specific side of the common bus If no DataProvider is specified with this key, the nodes will be placed in an alternating way.
static java.lang.Object ROOT_OFFSET_DPKEY
          A DataProvider key for assigning nodes to specific layers relative to the root node of the bus An offset value i specified for a bus node is interpreted relative to the root node as follows, assuming that the root node is in layer x.
 
Constructor Summary
BusDescriptor()
           
 
Method Summary
 int getMaximumNodesAfterBus()
          Returns the maximum number of nodes in a layer that are placed after the common bus segment.
 int getMaximumNodesBeforeBus()
          Returns the maximum number of nodes in a layer that are placed before the common bus segment.
 void setMaximumNodesAfterBus(int maximumNodesAfterBus)
          Specifies the maximum number of nodes in a layer that are placed after the common bus segment.
 void setMaximumNodesBeforeBus(int maximumNodesBeforeBus)
          Specifies the maximum number of nodes in a layer that are placed before the common bus segment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROOT_OFFSET_DPKEY

public static final java.lang.Object ROOT_OFFSET_DPKEY
A DataProvider key for assigning nodes to specific layers relative to the root node of the bus

An offset value i specified for a bus node is interpreted relative to the root node as follows, assuming that the root node is in layer x.

 
The provided layer offsets are normalized such that it is not possible to define empty bus layers (e.g. offset values 2, 10, 15 are normalized to 1, 2, 3).
 
The specified number of nodes before the bus and number of nodes after the bus might be violated if the layer indices provided here are such that e.g., a layer contains too many nodes to fulfill the node count constraints.

PLACE_BEFORE_BUS_DPKEY

public static final java.lang.Object PLACE_BEFORE_BUS_DPKEY
A DataProvider key for assigning nodes to a specific side of the common bus

If no DataProvider is specified with this key, the nodes will be placed in an alternating way.

 
The side assignment induced by this setting is ignored if there are any sequence constraints between the bus nodes.
Constructor Detail

BusDescriptor

public BusDescriptor()
Method Detail

getMaximumNodesBeforeBus

public int getMaximumNodesBeforeBus()
Returns the maximum number of nodes in a layer that are placed before the common bus segment.

This setting allows to individually specify how the bus nodes should be distributed before/after the common bus segment with respect to sequence of each layer. By default, both the getMaximumNodesBeforeBus() and the getMaximumNodesAfterBus() are 0 which means that the nodes are equally distributed and the common bus segment is placed in the middle. The actual number of nodes before and after the bus is determined automatically in that case.

 
If nodes are specifically assigned to one side using PLACE_BEFORE_BUS_DPKEY, but the value of this property is set to 0, then the maximum will be exceeded as necessary. The maximum can also be exceeded if there are too many fixed bus nodes in the same layer (when running in incremental mode) or when bus layers are user-specified via ROOT_OFFSET_DPKEY.
Returns:
the maximum number of nodes that are allowed to be placed before the bus segment
See Also:
setMaximumNodesBeforeBus(int)

setMaximumNodesBeforeBus

public void setMaximumNodesBeforeBus(int maximumNodesBeforeBus)
Specifies the maximum number of nodes in a layer that are placed before the common bus segment.

This setting allows to individually specify how the bus nodes should be distributed before/after the common bus segment with respect to sequence of each layer. By default, both the getMaximumNodesBeforeBus() and the getMaximumNodesAfterBus() are 0 which means that the nodes are equally distributed and the common bus segment is placed in the middle. The actual number of nodes before and after the bus is determined automatically in that case.

 
If nodes are specifically assigned to one side using PLACE_BEFORE_BUS_DPKEY, but the value of this property is set to 0, then the maximum will be exceeded as necessary. The maximum can also be exceeded if there are too many fixed bus nodes in the same layer (when running in incremental mode) or when bus layers are user-specified via ROOT_OFFSET_DPKEY.
Default Value:
The default value is 0. If the maximum number of nodes after the bus is 0 too, then the number of nodes is unrestricted, otherwise all nodes are placed after the bus.
Parameters:
maximumNodesBeforeBus - the maximum number of nodes that are allowed to be placed before the bus segment
Throws:
java.lang.IllegalArgumentException - if the given node count is negative
Sample Graphs:

Example result with equally distributed bus: both, before and after node count are 0

Example result where before bus node count is 1 and after bus node count is 2

getMaximumNodesAfterBus

public int getMaximumNodesAfterBus()
Returns the maximum number of nodes in a layer that are placed after the common bus segment.

This setting allows to individually specify how the bus nodes should be distributed before/after the common bus segment with respect to the sequence of each layer. By default, both the getMaximumNodesBeforeBus() and the getMaximumNodesAfterBus() are 0 which means that the nodes are equally distributed and the common bus segment is placed in the middle. The actual number of nodes before and after the bus is determined automatically in that case.

 
If nodes are specifically assigned to one side using PLACE_BEFORE_BUS_DPKEY, but the value of this property is set to 0, then the maximum will be exceeded as necessary. The maximum can also be exceeded if there are too many fixed bus nodes in the same layer (when running in incremental mode) or when bus layers are user-specified via ROOT_OFFSET_DPKEY.
Returns:
the maximum number of nodes that are allowed to be placed after the bus segment
See Also:
setMaximumNodesAfterBus(int)

setMaximumNodesAfterBus

public void setMaximumNodesAfterBus(int maximumNodesAfterBus)
Specifies the maximum number of nodes in a layer that are placed after the common bus segment.

This setting allows to individually specify how the bus nodes should be distributed before/after the common bus segment with respect to sequence of each layer. By default, both the getMaximumNodesBeforeBus() and the getMaximumNodesAfterBus() are 0 which means that the nodes are equally distributed and the common bus segment is placed in the middle. The actual number of nodes before and after the bus is determined automatically in that case.

 
If nodes are specifically assigned to one side using PLACE_BEFORE_BUS_DPKEY, but the value of this property is set to 0, then the maximum will be exceeded as necessary. The maximum can also be exceeded if there are too many fixed bus nodes in the same layer (when running in incremental mode) or when bus layers are user-specified via ROOT_OFFSET_DPKEY.
Default Value:
The default value is 0. If the maximum number of nodes before the bus is 0 too, then the number of nodes is unrestricted, otherwise all nodes are placed before the bus.
Parameters:
maximumNodesAfterBus - the maximum number of nodes that are allowed to be placed after the bus segment
Throws:
java.lang.IllegalArgumentException - if the given node count is negative
Sample Graphs:

Example result with equally distributed bus: both, before and after node count are 0

Example result where before bus node count is 1 and after bus node count is 2

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