public static class SugiyamaLayoutAlgorithm.DFSLayerProvider extends java.lang.Object implements SugiyamaLayoutAlgorithm.LayerProvider
Constructor and Description |
---|
DFSLayerProvider() |
Modifier and Type | Method and Description |
---|---|
void |
addAssignedNode(org.eclipse.gef.graph.Node node,
int layer)
Assigns the given layer to the given
Node . |
java.util.List<java.util.List<SugiyamaLayoutAlgorithm.NodeWrapper>> |
calculateLayers(java.util.List<org.eclipse.gef.graph.Node> nodeLayouts)
Creating layers of the nodes and makes it possible to assign layers
to those nodes.
|
void |
clearAssignedNodes()
Clears the
Map that stores the layer assignments. |
java.util.Map<org.eclipse.gef.graph.Node,java.lang.Integer> |
getAssignedNodes()
Returns a
Map that stores the assignment of layers to
Node s. |
java.util.ArrayList<org.eclipse.gef.graph.Node> |
getRoots(java.util.List<org.eclipse.gef.graph.Node> nodes)
Finds the root elements in the list of nodes based on their
connections.
|
public java.util.ArrayList<org.eclipse.gef.graph.Node> getRoots(java.util.List<org.eclipse.gef.graph.Node> nodes)
nodes
- The list of Node
s for which to find the root
elements.public java.util.Map<org.eclipse.gef.graph.Node,java.lang.Integer> getAssignedNodes()
Map
that stores the assignment of layers to
Node
s.Map
that stores the assignment of layers to
Node
s.public void addAssignedNode(org.eclipse.gef.graph.Node node, int layer)
Node
.node
- The Node
to which a layer is assigned.layer
- The layer that is assigned to that Node
.public void clearAssignedNodes()
Map
that stores the layer assignments.public java.util.List<java.util.List<SugiyamaLayoutAlgorithm.NodeWrapper>> calculateLayers(java.util.List<org.eclipse.gef.graph.Node> nodeLayouts)
SugiyamaLayoutAlgorithm.LayerProvider
calculateLayers
in interface SugiyamaLayoutAlgorithm.LayerProvider
nodeLayouts
- List of all the nodes that needs to be organizedSugiyamaLayoutAlgorithm.NodeWrapper
sCopyright (c) 2014 itemis AG and others. All rights reserved.