Module imp2d

Class GraphUtilities

java.lang.Object
de.grogra.imp2d.layout.GraphUtilities

public class GraphUtilities extends Object
A Utility-Class with helping methods for layouting graphs especially for hierarchical graph layouts
  • Constructor Details

    • GraphUtilities

      public GraphUtilities()
  • Method Details

    • getNodesList

      public LinkedList getNodesList(Node nodes)
    • getNodesListDFS

      public LinkedList getNodesListDFS(Node nodes)
      Getting all nodes converted to a linked list and arranged in depth first search-style
      Parameters:
      nodes -
      Returns:
    • setAllNodesEdgesAccessed

      public void setAllNodesEdgesAccessed(Node nodeList, boolean value)
    • setAllEdgesAccessed

      public void setAllEdgesAccessed(Node nodeList, boolean value)
    • getNodeCount

      public int getNodeCount(Node nodes)
      Returns the number of nodes of the graph
      Returns:
      nodeCount number of nodes
    • setNodeAccessed

      public void setNodeAccessed(Node nodeTemp, boolean value)
      Setting a concrete Node marked or unmarked
      Parameters:
      node - Node that has to be marked
      value - true if unmarked, false if marked
    • setEdgeAccessed

      public void setEdgeAccessed(Edge edgeTemp, boolean value)
      Setting a concrete edge marked or unmarked
      Parameters:
      edge - Edge that has to be marked
      value - true if unmarked, false if marked
    • isNodeAccessed

      public boolean isNodeAccessed(Node nodeTemp)
      checks if a node is marked or unmarked
      Parameters:
      node - Node that will be checked
      Returns:
      true if unmarked, false if marked
    • isEdgeAccessed

      public boolean isEdgeAccessed(Edge edgeTemp)
      checks if a edge is marked or unmarked
      Parameters:
      edge - Edge that will be checked
      Returns:
      true if unmarked, false if marked
    • getRoots

      public LinkedList getRoots(Node nodes)
    • getConnectedNodes

      public LinkedList getConnectedNodes(Node nodes)
      Dividing the nodes of the graph into connectedNodes (= nodes that have edges to other nodes) and unconnectedNodes (= nodes that don't have edges to other nodes of the graph)
    • getConnectedNodesSize

      protected int getConnectedNodesSize(Node nodes)
    • getUnconnectedNodes

      public LinkedList getUnconnectedNodes(Node nodes)
      Dividing the nodes of the graph into connectedNodes (= nodes that have edges to other nodes) and unconnectedNodes (= nodes that don't have edges to other nodes of the graph)