|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.layout.router.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 direction specifier. |
static byte |
ROUTE_VERTICAL
Channel direction specifier. |
Constructor Summary | |
ChannelRouter(double min,
double max)
Creates a new instance of ChannelRouter for a horizontal channel. |
|
ChannelRouter(double min,
double max,
byte direction)
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)
|
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 direction)
Sets the channel bounds and direction. |
void |
setEpsilon(double epsilon)
Setter for property epsilon. |
void |
setEpsilonChannelIgnored(boolean ignore)
Determines if subchannel lengths smaller than epsilon should be ignored by the channelrouter. |
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 direction)
min
- the smallest assignable coordinate within the channelmax
- the largest assignable coordinate within the channeldirection
- the direction of the channel. One of
ChannelRouter.ROUTE_VERTICAL
and ChannelRouter.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 direction)
min
- the smallest assignable coordinate within the channelmax
- the largest assignable coordinate within the channeldirection
- the direction of the channel. One of
ChannelRouter.ROUTE_VERTICAL
and ChannelRouter.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 ChannelRouter.addSegment(Object, YPoint, YPoint)
public boolean containsGroupKey(Object groupKey)
groupKey
- the key which is used in ChannelRouter.addGroupSegment(Object, Object, YPoint, YPoint)
public void route()
ChannelRouter.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 ChannelRouter.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 ChannelRouter.addSegment(Object,YPoint,YPoint)
public int getGroupSubChannelRank(Object groupKey)
public boolean isEpsilonChannelIgnored()
epsilon
are ignored
by this instance.
ChannelRouter.setEpsilon(double)
,
ChannelRouter.setEpsilonChannelIgnored(boolean)
public void setEpsilonChannelIgnored(boolean ignore)
true
with an epsilon value of 0.5d.
public double getEpsilon()
epsilonChannelIgnored
property is set to true
ChannelRouter.setEpsilonChannelIgnored(boolean)
public void setEpsilon(double epsilon)
epsilon
- New value of property epsilon.
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |