org.graffiti.util
Class CoreGraphEditing

java.lang.Object
  extended by org.graffiti.util.CoreGraphEditing

public class CoreGraphEditing
extends Object

This class offers some static methods for graph editing.

Version:
$Revision: 5767 $ $Date: 2010-04-27 18:37:22 +0200 (Di, 27 Apr 2010) $
Author:
Marek Piorkowski

Method Summary
static void removeAttribute(Collection<? extends GraphElement> graphElements, String attributePath)
          Removes the specified attribute from the specified nodes.
static void removeIsolatedNodes(Collection<Node> nodes)
          Removes isolated nodes.
static void removeIsolatedNodes(Graph graph)
          Removes isolated nodes from the specified graph.
static void removeMultipleEdges(Graph graph)
          Removes multiple edges from the specified graph.
static void removeMultipleEdgesAndLoops(Graph graph)
          Removes multiple edges and self loops from the specified graph.
static Collection<Edge> removeSelfLoops(Collection<Edge> edges)
          Removes self loops.
static void removeSelfLoops(Graph graph)
          Removes self loops from the specified graph.
static Selection selectAll(Graph graph)
          Returns a selection containing all graph elements of the specified graph.
static Selection selectAllEdges(Graph graph)
          Returns a selection containing edges of the specified graph.
static Selection selectAllIncomingEdgeNeighbours(Collection<Node> nodes)
          Returns a selection containing all in-neighbours of the specified nodes.
static Selection selectAllInNeighbours(Node node)
          Returns a selection containing all in-neighbours of the specified node.
static Selection selectAllNeighbours(Collection<Node> nodes)
          Returns a selection containing all neighbours of the specified nodes.
static Selection selectAllNeighbours(Node node)
          Returns a selection containing all neighbours of the specified node.
static Selection selectAllNodes(Graph graph)
          Returns a selection containing all nodes of the specified graph.
static Selection selectAllOutNeighbours(Node node)
          Returns a selection containing all out-neighbours of the specified node.
static Selection selectConnectedComponent(Node root)
          Returns a selection containing the connected component of the specified node.
static Selection selectIncidentEdges(Collection<Node> nodes)
          Returns a selection containing all incident edges of the specified nodes.
static Selection selectIncidentEdges(Node node)
          Returns a selection containing all incident edges of the specified node.
static Selection selectIncomingEdges(Collection<Node> nodes)
          Returns a selection containing all ingoing edges of the specified nodes.
static Selection selectIngoingEdges(Node node)
          Returns a selection containing all ingoing edges of the specified node.
static Selection selectIsolatedNodes(Collection<Node> selectedNodes)
          Returns a selection containing all isolated nodes of the specified graph.
static Selection selectMultipleEdges(Collection<Node> nodes)
          Returns a selection containing all incident multiple edges of the specified nodes.
static Selection selectMultipleEdgesForRemoval(Collection<Node> nodes)
          Returns a selection containing all multiple edges (including multiple edge loops) except one.
static Selection selectOutgoingEdgeNeighbors(Collection<Node> nodes)
          Returns a selection containing all out-neighbours of the specified nodes.
static Selection selectOutgoingEdges(Collection<Node> nodes)
          Returns a selection containing all otgoing edges of the specified nodes.
static Selection selectOutgoingEdges(Node node)
          Returns a selection containing all outgoing edges of the specified node.
static Selection selectReachableSubgraph(Node root)
          Returns a selection containing the reachable subgraph of the specified node.
static Selection selectSelfLoops(Collection<Node> nodes)
          Returns a selection containing all self loops of the specified nodes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

removeIsolatedNodes

public static void removeIsolatedNodes(Collection<Node> nodes)
Removes isolated nodes.

Parameters:
nodes - The isolated nodes from these collection will be removed.

removeIsolatedNodes

public static void removeIsolatedNodes(Graph graph)
Removes isolated nodes from the specified graph.

Parameters:
graph - All isolated nodes will be reomeved from this graph.

removeMultipleEdgesAndLoops

public static void removeMultipleEdgesAndLoops(Graph graph)
Removes multiple edges and self loops from the specified graph.

Parameters:
graph - All multiple edges and self loops will be removed from this graph.

removeMultipleEdges

public static void removeMultipleEdges(Graph graph)
Removes multiple edges from the specified graph.

Parameters:
graph - All multiple edges will be removed from this graph.

removeSelfLoops

public static Collection<Edge> removeSelfLoops(Collection<Edge> edges)
Removes self loops.

Parameters:
edges - All self loops in this collection will be removed.

removeSelfLoops

public static void removeSelfLoops(Graph graph)
Removes self loops from the specified graph.

Parameters:
graph - All self loops will be removed from this graph.

selectAll

public static Selection selectAll(Graph graph)
Returns a selection containing all graph elements of the specified graph.

Parameters:
graph - This graph's elements will be selected.
Returns:
A selection containing all graph elements of the specified graph.

selectAllEdges

public static Selection selectAllEdges(Graph graph)
Returns a selection containing edges of the specified graph.

Parameters:
graph - This graph's edges will be selected.
Returns:
A selection containing all edges of the specified graph.

selectAllNodes

public static Selection selectAllNodes(Graph graph)
Returns a selection containing all nodes of the specified graph.

Parameters:
graph - This graph's nodes will be selected.
Returns:
A selection containing all nodes of the specified graph.

selectAllNeighbours

public static Selection selectAllNeighbours(Collection<Node> nodes)
Returns a selection containing all neighbours of the specified nodes.

Parameters:
nodes - This nodes' neighbours will be selected.
Returns:
A selection containing containing all neighbours of the specified nodes.

selectAllNeighbours

public static Selection selectAllNeighbours(Node node)
Returns a selection containing all neighbours of the specified node.

Parameters:
node - This node's neighbours will be selected.
Returns:
A selection containing containing all neighbours of the specified node.

selectAllIncomingEdgeNeighbours

public static Selection selectAllIncomingEdgeNeighbours(Collection<Node> nodes)
Returns a selection containing all in-neighbours of the specified nodes.

Parameters:
nodes - This nodes' in-neighbours will be selected.
Returns:
A selection containing containing all in-neighbours of the specified nodes.

selectAllInNeighbours

public static Selection selectAllInNeighbours(Node node)
Returns a selection containing all in-neighbours of the specified node.

Parameters:
node - This node's in-neighbours will be selected.
Returns:
A selection containing containing all in-neighbours of the specified node.

selectOutgoingEdgeNeighbors

public static Selection selectOutgoingEdgeNeighbors(Collection<Node> nodes)
Returns a selection containing all out-neighbours of the specified nodes.

Parameters:
nodes - This nodes' out-neighbours will be selected.
Returns:
A selection containing containing all out-neighbours of the specified nodes.

selectReachableSubgraph

public static Selection selectReachableSubgraph(Node root)
Returns a selection containing the reachable subgraph of the specified node.

Parameters:
root - The root node.
Returns:
A selection containing the reachable subgraph of the specified node.

selectConnectedComponent

public static Selection selectConnectedComponent(Node root)
Returns a selection containing the connected component of the specified node.

Parameters:
root - The root node.
Returns:
A selection containing the connected component of the specified node.

selectAllOutNeighbours

public static Selection selectAllOutNeighbours(Node node)
Returns a selection containing all out-neighbours of the specified node.

Parameters:
node - This node's out-neighbours will be selected.
Returns:
A selection containing containing all out-neighbours of the specified node.

selectIncidentEdges

public static Selection selectIncidentEdges(Collection<Node> nodes)
Returns a selection containing all incident edges of the specified nodes.

Parameters:
nodes - This nodes' incident edges will be selected.
Returns:
A selection containing containing all incident edges of the specified nodes.

selectIncidentEdges

public static Selection selectIncidentEdges(Node node)
Returns a selection containing all incident edges of the specified node.

Parameters:
node - This node's incident edges will be selected.
Returns:
A selection containing containing all incident edges of the specified node.

selectIncomingEdges

public static Selection selectIncomingEdges(Collection<Node> nodes)
Returns a selection containing all ingoing edges of the specified nodes.

Parameters:
nodes - This nodes' ingoing edges will be selected.
Returns:
A selection containing containing all ingoing edges of the specified nodes.

selectIngoingEdges

public static Selection selectIngoingEdges(Node node)
Returns a selection containing all ingoing edges of the specified node.

Parameters:
node - This node's ingoing edges will be selected.
Returns:
A selection containing containing all ingoing edges of the specified node.

selectOutgoingEdges

public static Selection selectOutgoingEdges(Collection<Node> nodes)
Returns a selection containing all otgoing edges of the specified nodes.

Parameters:
nodes - This nodes' outgoing edges will be selected.
Returns:
A selection containing containing all outgoing edges of the specified nodes.

selectOutgoingEdges

public static Selection selectOutgoingEdges(Node node)
Returns a selection containing all outgoing edges of the specified node.

Parameters:
node - This node's outgoing edges will be selected.
Returns:
A selection containing containing all outgoing edges of the specified node.

selectIsolatedNodes

public static Selection selectIsolatedNodes(Collection<Node> selectedNodes)
Returns a selection containing all isolated nodes of the specified graph.

Parameters:
selectedNodes - This collections's isolated nodes will be selected.
Returns:
A selection containing all isolated nodes of the specified graph.

selectSelfLoops

public static Selection selectSelfLoops(Collection<Node> nodes)
Returns a selection containing all self loops of the specified nodes.

Parameters:
nodes - This nodes' self loops will be selected.
Returns:
A selection containing all self loops of the specified nodes.

selectMultipleEdges

public static Selection selectMultipleEdges(Collection<Node> nodes)
Returns a selection containing all incident multiple edges of the specified nodes.

Parameters:
nodes - This nodes' incident multiple edges will be selected.
Returns:
A selection containing all incident multiple edges of the specified nodes.

selectMultipleEdgesForRemoval

public static Selection selectMultipleEdgesForRemoval(Collection<Node> nodes)
Returns a selection containing all multiple edges (including multiple edge loops) except one.

Parameters:
nodes - a collection containing nodes
Returns:
a selection containing all multiple edges for removal

removeAttribute

public static void removeAttribute(Collection<? extends GraphElement> graphElements,
                                   String attributePath)
                            throws AttributeNotFoundException
Removes the specified attribute from the specified nodes.

Parameters:
graphElements - The attribute of these nodes will be removed.
attributePath - The attribute with this path will be removed.
Throws:
AttributeNotFoundException


Generated at 2012-05-30 11:00:14 PM CEST