Class UniversalGraph<N,E>

java.lang.Object
org.netbeans.api.visual.graph.layout.UniversalGraph<N,E>

public abstract class UniversalGraph<N,E> extends Object
This interface represents an universal graph. It unifies a view on a GraphScene and GraphPinScene as a nodes-edges only graph. This is commonly used by graph-oriented layout algorithms.
  • Constructor Details

    • UniversalGraph

      public UniversalGraph()
  • Method Details

    • getScene

      public abstract ObjectScene getScene()
      Returns a related scene as a ObjectScene.
      Returns:
      the related scene which is represented by the universal graph.
    • getNodes

      public abstract Collection<N> getNodes()
      Returns a collection of nodes in the graph.
      Returns:
      the collection of nodes
    • getEdges

      public abstract Collection<E> getEdges()
      Returns a collection of edges in the graph.
      Returns:
      the collection of edges
    • findNodeEdges

      public abstract Collection<E> findNodeEdges(N node, boolean allowsOutputEdges, boolean allowsInputEdges)
      Returns edges that are attached to a specified node.
      Parameters:
      node - the node
      allowsOutputEdges - if true then it finds all edges that has the node as their source
      allowsInputEdges - if true then it finds all edges that has the node as their target
      Returns:
      the collection of all found edges
    • getEdgeSource

      public abstract N getEdgeSource(E edge)
      Returns an edge source.
      Parameters:
      edge - the edge
      Returns:
      the edge source
    • getEdgeTarget

      public abstract N getEdgeTarget(E edge)
      Returns an edge target.
      Parameters:
      edge - the edge
      Returns:
      the edge target