|
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.ChannelRouter
public class ChannelRouter
Class that routes edges within a vertical or horizontal channel All edges will then be routed in an orthogonal fashion. This class basically assigns subchannels to each each key (normally edges) so that the overall number of subchannels is small.
Field Summary | |
---|---|
static byte |
ROUTE_HORIZONTAL
Channel orientation specifier. |
static byte |
ROUTE_VERTICAL
Channel orientation specifier. |
Constructor Summary | |
---|---|
ChannelRouter(double min,
double max)
Creates a new instance of ChannelRouter for a horizontal channel. |
|
ChannelRouter(double min,
double max,
byte orientation)
Creates a new instance of ChannelRouter. |
Method Summary | |
---|---|
void |
addGroupSegment(Object key,
Object groupId,
YPoint p1,
YPoint p2)
Adds an edge object that belongs to a group of edges with source and target coordinates to the set of edges that have to be routed within the channel Edges sharing the same groupId will be placed on the same channel. |
void |
addSegment(Object key,
YPoint p1,
YPoint p2)
Adds an edge object with source and target coordinates to the set of edges that have to be routed within the channel |
boolean |
containsGroupKey(Object groupKey)
Determines if the given key has been registered as a grouping key with this instance. |
boolean |
containsKey(Object key)
Determines if the given key has been registered already with this instance. |
double |
getCoord(Object key)
Returns the calculated channel coordinate for an added edge object. |
double |
getEpsilon()
Returns the current epsilon value. |
int |
getGroupSubChannelRank(Object groupKey)
Returns the subchannel rank for the group indicated by the groupKey. |
int |
getSubChannelCount()
Returns the number of subchannels within this channel. |
int |
getSubChannelRank(Object key)
Returns the subchannel rank of this segment within the channel. |
boolean |
isEpsilonChannelIgnored()
Returns whether subchannels shorter than epsilon are ignored
by this instance. |
void |
route()
Routes all added edges within the specified channel. |
Iterator |
segmentKeys()
Returns an iterator over all added segment keys. |
void |
setChannel(double min,
double max,
byte orientation)
Sets the channel bounds and direction. |
void |
setEpsilon(double epsilon)
Specifies the current epsilon value. |
void |
setEpsilonChannelIgnored(boolean ignore)
Determines if subchannel lengths smaller than epsilon should be ignored by the channel router. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte ROUTE_VERTICAL
public static final byte ROUTE_HORIZONTAL
Constructor Detail |
---|
public ChannelRouter(double min, double max, byte orientation)
min
- the smallest assignable coordinate within the channelmax
- the largest assignable coordinate within the channelorientation
- the direction of the channel. One of
ROUTE_VERTICAL
and ROUTE_HORIZONTAL
public ChannelRouter(double min, double max)
min
- the smallest assignable coordinate within the channelmax
- the largest assignable coordinate within the channelMethod Detail |
---|
public void setChannel(double min, double max, byte orientation)
min
- the smallest assignable coordinate within the channelmax
- the largest assignable coordinate within the channelorientation
- the orientation of the channel. One of
ROUTE_VERTICAL
and ROUTE_HORIZONTAL
public void addSegment(Object key, YPoint p1, YPoint p2)
public void addGroupSegment(Object key, Object groupId, YPoint p1, YPoint p2)
public Iterator segmentKeys()
public boolean containsKey(Object key)
key
- the key which is used in addSegment(Object, YPoint, YPoint)
public boolean containsGroupKey(Object groupKey)
groupKey
- the key which is used in addGroupSegment(Object, Object, YPoint, YPoint)
public void route()
getSubChannelRank(Object)
method.
public double getCoord(Object key)
ChannelRouter(100,200,ChannelRouter.ROUTE_HORIZONTAL)
then the returned coordinate is an x-coordinate between 100 and
200. This coordinate represents the x-coordinate of two additional
bends that are needed to route the edge orthogonally from
p1 to p2 (as specified in addSegment).
key
- an edge object added with addSegment(Object,YPoint,YPoint)
public int getSubChannelCount()
0
indicates that there are no subchannels
present.
public int getSubChannelRank(Object key)
key
- an edge object added with addSegment(Object,YPoint,YPoint)
public int getGroupSubChannelRank(Object groupKey)
addGroupSegment(Object, Object, y.geom.YPoint, y.geom.YPoint)
public boolean isEpsilonChannelIgnored()
epsilon
are ignored
by this instance.
setEpsilon(double)
,
setEpsilonChannelIgnored(boolean)
public void setEpsilonChannelIgnored(boolean ignore)
true
with an epsilon value of 0.5d.
public double getEpsilon()
epsilonChannelIgnored
property is set to true
setEpsilonChannelIgnored(boolean)
public void setEpsilon(double epsilon)
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |