|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.tree.NodeOrderComparator
public class NodeOrderComparator
The NodeOrderComparator
compares edges according to a specified order.
It obtains the order from a DataProvider
registered with the graph with key NODE_ORDER_DPKEY
.
Various tree layout algorithms can use this Comparator
to influence the resulting layout.
To achieve this, use this comparator and assign it to the comparator property of the layout algorithm classes.
TreeLayouter.setComparator(Comparator)
,
GenericTreeLayouter.setDefaultChildComparator(Comparator)
,
GenericTreeLayouter.CHILD_COMPARATOR_DPKEY
,
BalloonLayouter.setComparator(Comparator)
,
ARTreeLayouter.setComparator(Comparator)
,
HVTreeLayouter.setComparator(Comparator)
,
NODE_ORDER_DPKEY
Field Summary | |
---|---|
static java.lang.Object |
NODE_ORDER_DPKEY
A DataProvider key for registering an order for each node in the graph
|
Constructor Summary | |
---|---|
NodeOrderComparator()
Creates a new NodeOrderComparator instance. |
Method Summary | |
---|---|
int |
compare(java.lang.Object edge1,
java.lang.Object edge2)
Compares two edges according to their index in the order specified using a DataProvider . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
---|
equals |
Field Detail |
---|
public static final java.lang.Object NODE_ORDER_DPKEY
DataProvider
key for registering an order for each node in the graph
Constructor Detail |
---|
public NodeOrderComparator()
NodeOrderComparator
instance.
Method Detail |
---|
public int compare(java.lang.Object edge1, java.lang.Object edge2)
DataProvider
.
Target nodes for which the DataProvider
registered with NODE_ORDER_DPKEY
returns
null
or an Object
that does not
implement Comparable
are treated as being smaller than other target nodes.
compare
in interface java.util.Comparator
edge1
- the first edgeedge2
- the second edgeNODE_ORDER_DPKEY
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |