|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.DefaultGraph2DTraversal
public class DefaultGraph2DTraversal
Default Graph2DTraversal
that provides the (layer-unrelated)
rendering order used in DefaultGraph2DRenderer
.
Field Summary |
---|
Fields inherited from interface y.view.Graph2DTraversal |
---|
ALL, BENDS, EDGE_LABELS, EDGES, NODE_LABELS, NODE_PORTS, NODES, PORTS |
Constructor Summary | |
---|---|
DefaultGraph2DTraversal()
Constructs a new DefaultGraph2DTraversal . |
Method Summary | |
---|---|
java.util.Iterator |
firstToLast(Graph2D graph,
int elementTypes)
Creates an Iterator that traverses the specified
Graph2D 's elements that match the specified element types. |
boolean |
isEdgesFirst()
Returns true , if edge elements are generally traversed before
(incident) node elements in a first-to-last traversal and
false if edge elements are generally traversed after
(incident) node elements in a first-to-last traversal. |
boolean |
isHierarchicOrder()
Returns true , if node elements of nested graphs are traversed
in the order induced by
HierarchyManager.preTraversal() for first-to-last
traversals and HierarchyManager.postTraversal()
for last-to-first traversals. |
boolean |
isNestedEdgeOrder()
Returns true , if node elements and edge elements of nested
graphs are traversed in an interleaved fashion. |
java.util.Iterator |
lastToFirst(Graph2D graph,
int elementTypes)
Creates an Iterator that traverses the specified
Graph2D 's elements that match the specified element types. |
void |
setEdgesFirst(boolean edgesFirst)
Specifies the general order of edge elements in relation to (incident) node elements. |
void |
setHierarchicOrder(boolean hierarchicOrder)
Specifies whether to traverse node elements of nested graphs in the order induced by HierarchyManager.preTraversal() for
first-to-last traversals and
HierarchyManager.postTraversal() for
last-to-first traversals; false otherwise. |
void |
setNestedEdgeOrder(boolean nestedEdgeOrder)
Specifies whether node elements and edge elements of nested graphs should be traversed in an interleaved fashion. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultGraph2DTraversal()
DefaultGraph2DTraversal
.
Method Detail |
---|
public boolean isEdgesFirst()
true
, if edge elements are generally traversed before
(incident) node elements in a first-to-last traversal and
false
if edge elements are generally traversed after
(incident) node elements in a first-to-last traversal.
Defaults to false
.
true
if edge elements are generally traversed before
(incident) node elements in a first-to-last traversal and
false
if edge elements are generally traversed after
(incident) node elements in a first-to-last traversal.setEdgesFirst(boolean)
,
isNestedEdgeOrder()
,
setNestedEdgeOrder(boolean)
public void setEdgesFirst(boolean edgesFirst)
Defaults to false
.
edgesFirst
- if true
edge elements are usually
traversed before (incident) node elements are traversed when doing a
first-to-last traversal.isEdgesFirst()
,
isNestedEdgeOrder()
,
setNestedEdgeOrder(boolean)
public boolean isHierarchicOrder()
true
, if node elements of nested graphs are traversed
in the order induced by
HierarchyManager.preTraversal()
for first-to-last
traversals and HierarchyManager.postTraversal()
for last-to-first traversals.
Defaults to true
.
true
if node elements of nested graphs are traversed
in the order induced by
HierarchyManager.preTraversal()
for first-to-last
traversals and HierarchyManager.postTraversal()
for last-to-first traversals; false
otherwise.setHierarchicOrder(boolean)
public void setHierarchicOrder(boolean hierarchicOrder)
HierarchyManager.preTraversal()
for
first-to-last traversals and
HierarchyManager.postTraversal()
for
last-to-first traversals; false
otherwise.
Defaults to true
.
hierarchicOrder
- if true
, node elements are traversed
in the order induced by HierarchyManager
's
preTraversal
and postTraversal
methods, else
nodes are traversed in the order implied by Graph.nodes()
.isHierarchicOrder()
public boolean isNestedEdgeOrder()
true
, if node elements and edge elements of nested
graphs are traversed in an interleaved fashion.
Defaults to false
.
true
, if node elements and edge elements of nested
graphs are traversed in an interleaved fashion.setNestedEdgeOrder(boolean)
,
isEdgesFirst()
,
setEdgesFirst(boolean)
public void setNestedEdgeOrder(boolean nestedEdgeOrder)
edgesFirst
, edges are either traversed before or after the
group node to which their endpoints belong.
Defaults to false
.
nestedEdgeOrder
- if true
nodes and edges of nested
graphs should be traversed in an interleaved fashion; else all node
elements are traversed before or after all edge elements.isNestedEdgeOrder()
,
isEdgesFirst()
,
setEdgesFirst(boolean)
public java.util.Iterator firstToLast(Graph2D graph, int elementTypes)
Iterator
that traverses the specified
Graph2D
's elements that match the specified element types.
The traversal order of node and edge elements depends on the properties
edgesFirst
, hierarchicOrder
, and
nestedEdgeOrder
.
Independent of these settings, a node will always be followed directly by
its associated node labels and an edge will always be followed directly by
its source and target port, its associated bends, and finally its
associated edge labels (assuming, of course, that all of these are included
in the specified element types).
Note, the iterators created with this method are not fail-fast as one is used to from the Java™ Collections Framework, because there is no reliable way to check for concurrent modifications of the traversed graph.
firstToLast
in interface Graph2DTraversal
graph
- the Graph2D
whose elements are to be
traversed.elementTypes
- determines the types of graph elements that should be
included in the traversal. The elementTypes
argument is an
integer bit mask that may be Graph2DTraversal.ALL
or any bitwise union of
Graph2DTraversal.BENDS
, Graph2DTraversal.EDGES
, Graph2DTraversal.EDGE_LABELS
, Graph2DTraversal.NODES
,
Graph2DTraversal.NODE_LABELS
, Graph2DTraversal.PORTS
, and/or Graph2DTraversal.NODE_PORTS
.
Iterator
that traverses the specified
Graph2D
's elements first to last.Graph2DTraversal.lastToFirst(Graph2D, int)
public java.util.Iterator lastToFirst(Graph2D graph, int elementTypes)
Iterator
that traverses the specified
Graph2D
's elements that match the specified element types.
The traversal order of node and edge elements depends on the properties
edgesFirst
, hierarchicOrder
, and
nestedEdgeOrder
.
Independent of these settings, a node will always be returned right after
its associated node labels and an edge will always be returned right after
by its associated edge labels, its associated bends, and finally its
target and source port (assuming, of course, that all of these are included
in the specified element types).
Note, the iterators created with this method are not fail-fast as one is used to from the Java™ Collections Framework, because there is no reliable way to check for concurrent modifications of the traversed graph.
lastToFirst
in interface Graph2DTraversal
graph
- the Graph2D
whose elements are to be
traversed.elementTypes
- determines the types of graph elements that should be
included in the traversal. The elementTypes
argument is an
integer bit mask that may be Graph2DTraversal.ALL
or any bitwise union of
Graph2DTraversal.BENDS
, Graph2DTraversal.EDGES
, Graph2DTraversal.EDGE_LABELS
, Graph2DTraversal.NODES
,
Graph2DTraversal.NODE_LABELS
, Graph2DTraversal.PORTS
, and/or Graph2DTraversal.NODE_PORTS
.
Iterator
that traverses the specified
Graph2D
's elements last to first.Graph2DTraversal.firstToLast(Graph2D, int)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |