|
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.BusDescriptor
public class BusDescriptor
A descriptor for bus-related information to be associated with an edge.
It consists of a bus ID defining the bus of the associated edge, two optional edge group IDs for specifying the edge grouping at the source and target side, respectively, and an optional boolean flag to mark the edge as fixed.
Every object except null
can be used as a valid edge group ID. If there is no group ID
defined for an edge or if null
is set, a default group ID is used. Therefore, all such edges ending at
the same node belong to the same group.
BusRouter.EDGE_DESCRIPTOR_DPKEY
Field Summary | |
---|---|
static byte |
ROUTING_POLICY_ALWAYS
A routing policy that indicates that a new route is calculated in any case. |
static byte |
ROUTING_POLICY_PATH_AS_NEEDED
A routing policy that indicates that based on the current path it is automatically determined whether an edge is routed, and if so, the edge gets a whole new path. |
Constructor Summary | |
---|---|
BusDescriptor(java.lang.Object busID)
Creates a new instance of BusDescriptor for the specified bus ID which is marked as not fixed and uses
the default edge group IDs. |
|
BusDescriptor(java.lang.Object busID,
boolean fixed)
Creates a new instance of BusDescriptor for the specified parameters and default group IDs. |
|
BusDescriptor(java.lang.Object busID,
boolean fixed,
java.lang.Object sourceGroupID,
java.lang.Object targetGroupID)
Creates a new instance of BusDescriptor for the specified parameters. |
|
BusDescriptor(java.lang.Object busID,
boolean fixed,
java.lang.Object sourceGroupID,
java.lang.Object targetGroupID,
byte routingPolicy)
Creates a new instance of BusDescriptor for the specified parameters. |
|
BusDescriptor(java.lang.Object busID,
java.lang.Object sourceGroupID,
java.lang.Object targetGroupID)
Creates a new instance of BusDescriptor for the specified parameters and marks it as not fixed. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Indicates whether or not some other object is "equal to" this one. |
java.lang.Object |
getID()
Returns the bus ID. |
byte |
getRoutingPolicy()
Returns the routing policy indicating if the edge associated with this descriptor is unconditionally routed or if the existing route determines whether a routing is even necessary. |
java.lang.Object |
getSourceGroupID()
Returns the group ID for the source side of the edge. |
java.lang.Object |
getTargetGroupID()
Returns the group ID for the target side of the edge. |
int |
hashCode()
Returns a hash code value for this BusDescriptor instance. |
boolean |
isFixed()
Returns whether or not the associated edge is fixed. |
void |
setFixed(boolean fixed)
Specifies whether or not the associated edge is fixed. |
void |
setID(java.lang.Object busID)
Specifies the bus ID. |
void |
setRoutingPolicy(byte routingPolicy)
Specifies the routing policy indicating if the edge associated with this descriptor is unconditionally routed or if the existing route determines whether a routing is even necessary. |
void |
setSourceGroupID(java.lang.Object sourceGroupID)
Specifies the new group ID for the source side of the edge. |
void |
setTargetGroupID(java.lang.Object targetGroupID)
Specifies the new group ID for the target side of the edge. |
java.lang.String |
toString()
Returns a string representation consisting of the bus ID, the fixed flag, and both group IDs. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte ROUTING_POLICY_ALWAYS
The existing path of an edge is ignored and the routing algorithm unconditionally generates a whole new path.
public static final byte ROUTING_POLICY_PATH_AS_NEEDED
The automatic selection examines the existing, given path of an edge. Based on various criteria it heuristically determines whether or not it needs to be routed. For example, intersections with other elements or a routing style violation are clear indicators. A further criterion is when the port constraints/candidates are not properly satisfied. Edges deemed to be 'good' are not changed.
This policy is convenient for cases where it is not clear which edges the algorithm should route. For example, after a user interaction (moving a node, inserting new elements etc.), routing of edges might become necessary but depending on the action it can not definitely be said which edges need to be corrected.
Constructor Detail |
---|
public BusDescriptor(java.lang.Object busID)
BusDescriptor
for the specified bus ID which is marked as not fixed and uses
the default edge group IDs.
busID
- the ID of the bus to which the associated edge belongspublic BusDescriptor(java.lang.Object busID, java.lang.Object sourceGroupID, java.lang.Object targetGroupID)
BusDescriptor
for the specified parameters and marks it as not fixed.
busID
- the ID of the bus to which the associated edge belongssourceGroupID
- the group ID of the source sidetargetGroupID
- the group ID of the target sidepublic BusDescriptor(java.lang.Object busID, boolean fixed)
BusDescriptor
for the specified parameters and default group IDs.
busID
- the ID of the bus to which the associated edge belongsfixed
- true
if associated edge is fixed, false
otherwisepublic BusDescriptor(java.lang.Object busID, boolean fixed, java.lang.Object sourceGroupID, java.lang.Object targetGroupID)
BusDescriptor
for the specified parameters.
busID
- the ID of the bus to which the associated edge belongsfixed
- true
if associated edge is fixed, false
otherwisesourceGroupID
- the group ID of the source sidetargetGroupID
- the group ID of the target sidepublic BusDescriptor(java.lang.Object busID, boolean fixed, java.lang.Object sourceGroupID, java.lang.Object targetGroupID, byte routingPolicy)
BusDescriptor
for the specified parameters.
busID
- the ID of the bus to which the associated edge belongsfixed
- true
if associated edge is fixed, false
otherwisesourceGroupID
- the group ID of the source sidetargetGroupID
- the group ID of the target sideroutingPolicy
- one of the predefined routing policiesMethod Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare
true
if all corresponding parameters are equal, false
otherwisepublic int hashCode()
BusDescriptor
instance.
hashCode
in class java.lang.Object
public java.lang.Object getID()
Edges associated with descriptor instances
having the same bus ID belong to a common bus.
public void setID(java.lang.Object busID)
Edges associated with descriptor instances
having the same bus ID belong to a common bus.
busID
- the bus IDpublic byte getRoutingPolicy()
The routing policy only applies for edges that are not fixed
in the first place.
Fixed edges are never changed.
When only routing paths as needed
, the algorithm tries to keep
a lot of the existing routes and buses. For example, if two edges are defined to be on a common bus, but
they are not yet, then only one of the edges is routed (given that the other has a proper orthogonal path)
and parts of the other edge as the common bus.
If optimizing the overall bus routing quality it might be better to use ROUTING_POLICY_ALWAYS
.
ROUTING_POLICY_ALWAYS
and
ROUTING_POLICY_PATH_AS_NEEDED
. Only routing specific segments as needed is not supported.setRoutingPolicy(byte)
public void setRoutingPolicy(byte routingPolicy)
The routing policy only applies for edges that are not fixed
in the first place.
Fixed edges are never changed.
When only routing paths as needed
, the algorithm tries to keep
a lot of the existing routes and buses. For example, if two edges are defined to be on a common bus, but
they are not yet, then only one of the edges is routed (given that the other has a proper orthogonal path)
and parts of the other edge as the common bus.
If optimizing the overall bus routing quality it might be better to use ROUTING_POLICY_ALWAYS
.
ROUTING_POLICY_ALWAYS
and
ROUTING_POLICY_PATH_AS_NEEDED
. Only routing specific segments as needed is not supported.ROUTING_POLICY_ALWAYS
. The edge is routed, ignoring the existing sketch.routingPolicy
- one of the two predefined routing policies
java.lang.IllegalArgumentException
- if an unknown routing policy is givenpublic java.lang.Object getSourceGroupID()
Edges incident to the same node v
but associated with different group IDs at this endpoint,
use separate bus connections at v
.
public void setSourceGroupID(java.lang.Object sourceGroupID)
Edges incident to the same node v
but associated with different group IDs at this endpoint,
use separate bus connections at v
.
null
is set, a default group ID is used.
Therefore, all associated edges ending at the same node belong to the same group.Object
. All associated edges ending at the same node belong to the same group
(unless otherwise specified in the constructor).sourceGroupID
- the group ID to setpublic java.lang.Object getTargetGroupID()
Edges incident to the same node v
but associated with different group IDs at this endpoint,
use separate bus connections at v
.
public void setTargetGroupID(java.lang.Object targetGroupID)
Edges incident to the same node v
but associated with different group IDs at this endpoint,
use separate bus connections at v
.
null
is set, a default group ID is used.
Therefore, all associated edges ending at the same node belong to the same group.Object
. All associated edges ending at the same node belong to the same group (unless otherwise specified in the constructor).targetGroupID
- the group ID to setpublic boolean isFixed()
The algorithm doesn't change the route of fixed edges but tries to prevent overlaps with non-fixed edges.
true
if the associated edge is fixed, false
otherwisepublic void setFixed(boolean fixed)
The algorithm doesn't change the route of fixed edges but tries to prevent overlaps with non-fixed edges.
fixed
- true
if the associated edge should be fixed, false
otherwisepublic java.lang.String toString()
toString
in class java.lang.Object
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |