|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.router.polyline.BusDescriptor
public class BusDescriptor
A BusDescriptor
defines settings for edges routed on a common bus by EdgeRouter
.
Edges (except self-loops) mapped to the same BusDescriptor
instance form a bus. The mapping is retrieved from
a DataProvider
registered with the input graph with key EdgeRouter.BUS_DESCRIPTOR_DPKEY
.
A bus consists of a set of backbone segments shared by multiple edges to which shorter segments that connect to
the actual nodes are
attached. This descriptor allows to specify settings about the bus, for example, the location of the bus may
be user-specified - see setBusPoints(YPointPath)
.
With buses, the routing algorithm tries to produce routes where the edges share as much of their paths as possible. It yields long line segments (so-called backbone segments) where ideally all but the first and last segments of all edge paths are drawn on top of each other (forming the bus), with short connections branching off to the nodes (bus connections).
Edges that are fixed (i.e. are not marked for routing) may also belong to a bus. Then, the bus segments will be derived using the existing path of the fixed edges. This way, buses can be incrementally updated, e.g., when a new edge should be added to an existing bus structure. Carefully note that fixed edges must have a correct orthogonal path for this feature to work properly.
Routing result containing three different bus structures
Routing result with a user-specified bus assigned to all edges (single vertical segment on the left-hand side)
Intermediate routing points
are not supported for edges associated with a bus using this descriptor.EdgeRouter.BUS_DESCRIPTOR_DPKEY
Constructor Summary | |
---|---|
BusDescriptor()
|
Method Summary | |
---|---|
YPointPath |
getBusPoints()
Returns the user-specified bus path that represents the backbone for edges associated with this bus. |
YPointPath |
getComputedBusPoints()
Returns the point path that describes the bus computed by the EdgeRouter . |
double |
getMinimumBackboneSegmentLength()
Returns the preferred minimum length of backbone segments. |
boolean |
isAutomaticEdgeGroupingEnabled()
Returns whether or not bus edges ending at the same node are automatically grouped such that they share a common bus connection. |
boolean |
isMultipleBackboneSegmentsAllowed()
Returns whether or not the algorithm may create buses that consist of multiple backbone segments. |
void |
setAutomaticEdgeGroupingEnabled(boolean automaticEdgeGrouping)
Specifies whether or not bus edges ending at the same node are automatically grouped such that they share a common bus connection. |
void |
setBusPoints(YPointPath busPoints)
Specifies the user-specified bus path that represents the backbone for edges associated with this bus. |
void |
setMinimumBackboneSegmentLength(double minimumBackboneSegmentLength)
Specifies the preferred minimum length of backbone segments. |
void |
setMultipleBackboneSegmentsAllowed(boolean multipleBackboneSegmentsAllowed)
Specifies whether or not the algorithm may create buses that consist of multiple backbone segments. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BusDescriptor()
Method Detail |
---|
public YPointPath getBusPoints()
If the user does not specify the bus path, the algorithm automatically detects a suitable bus path.
Similar to an edge path, a bus path is specified by an instance of YPointPath
.
null
if the path is determined automaticallysetBusPoints(YPointPath)
public void setBusPoints(YPointPath busPoints)
If the user does not specify the bus path, the algorithm automatically detects a suitable bus path.
Similar to an edge path, a bus path is specified by an instance of YPointPath
.
busPoints
- the user-specified bus path or null
if the path should be determined automaticallypublic YPointPath getComputedBusPoints()
point path
that describes the bus computed by the EdgeRouter
.
The computed path of a bus is always orthogonal and connected. The bus path represents the backbone of the edges associated with the bus and the edges use parts of the bus path in their own path.
getBusPoints()
.setBusPoints(YPointPath)
public double getMinimumBackboneSegmentLength()
This number defines the minimum length of backbone segments which are computed during the selection of backbone segments. Final backbone segments might actually be shorter because not the full segment is used by bus connections; such dead-ends are not drawn.
The minimum length is defined to be a value greater than or equal to 1.0
.
setMinimumBackboneSegmentLength(double)
public void setMinimumBackboneSegmentLength(double minimumBackboneSegmentLength)
This number defines the minimum length of backbone segments which are computed during the selection of backbone segments. Final backbone segments might actually be shorter because not the full segment is used by bus connections; such dead-ends are not drawn.
The minimum length is defined to be a value greater than or equal to 1.0
.
minimumBackboneSegmentLength
- the preferred minimum length of a backbone segment
java.lang.IllegalArgumentException
- if the given minimum length is smaller than 1.0
100.0 - a backbone segment fits in the middle | 300.0 - no backbone segment fits in the middle as it must be at least have width 300.0 |
public boolean isMultipleBackboneSegmentsAllowed()
For edges routed on a bus, a preferred outcome is that the part of the edge that is not on the bus is short and has few bends. Of course, for buses that may consist of multiple backbone segments (instead of just a single backbone) this is usually easier to achieve. Hence, if this option is enabled, the algorithm automatically may decide to use multiple backbone segments in order to produce more suitable results.
custom bus path
.true
if the algorithm may create buses that consist of multiple backbone segments,
false
otherwisesetMultipleBackboneSegmentsAllowed(boolean)
,
setBusPoints(YPointPath)
,
setMinimumBackboneSegmentLength(double)
public void setMultipleBackboneSegmentsAllowed(boolean multipleBackboneSegmentsAllowed)
For edges routed on a bus, a preferred outcome is that the part of the edge that is not on the bus is short and has few bends. Of course, for buses that may consist of multiple backbone segments (instead of just a single backbone) this is usually easier to achieve. Hence, if this option is enabled, the algorithm automatically may decide to use multiple backbone segments in order to produce more suitable results.
custom bus path
.multipleBackboneSegmentsAllowed
- true
if the algorithm may create buses that consist of
multiple backbone segments, false
otherwisesetBusPoints(YPointPath)
,
setMinimumBackboneSegmentLength(double)
true - the bus consist of multiple backbone segments | false - the bus consist of a single backbone segment |
public boolean isAutomaticEdgeGroupingEnabled()
This setting affects the bus connections of edges that belong to the same bus and end/start at the same node.
Manually defined edge groups are considered, too. See PortConstraintKeys.SOURCE_GROUPID_KEY
and PortConstraintKeys.TARGET_GROUPID_KEY
.
There are generally three scenarios:
true
if bus edges ending at the same node are automatically grouped,
false
otherwisesetAutomaticEdgeGroupingEnabled(boolean)
,
PortConstraintKeys.SOURCE_GROUPID_KEY
,
PortConstraintKeys.TARGET_GROUPID_KEY
public void setAutomaticEdgeGroupingEnabled(boolean automaticEdgeGrouping)
This setting affects the bus connections of edges that belong to the same bus and end/start at the same node.
Manually defined edge groups are considered, too. See PortConstraintKeys.SOURCE_GROUPID_KEY
and PortConstraintKeys.TARGET_GROUPID_KEY
.
There are generally three scenarios:
automaticEdgeGrouping
- true
if bus edges ending at the same node should automatically be grouped,
false
otherwisePortConstraintKeys.SOURCE_GROUPID_KEY
,
PortConstraintKeys.TARGET_GROUPID_KEY
true - edges to the same node use the same bus connection | false and no other edge groupings - edges to the same node use individual bus connections |
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |