Module imp2d

Class Node

All Implemented Interfaces:
Serializable, Cloneable

public final class Node extends Point2f
A Node represents a node of a graph which is to be layouted by a Layout. Such a graph is constructed as an image of an actual source Graph. The nodes and edges of this image provide a simple and safe means to query and modify layout-relevant information. E.g., Node extends javax.vecmath.Point2f, the inherited fields x and y represent the node's global 2D-coordinates.

Nodes are connected by instances of Edge. To iterate over all edges of a node n, the following pattern has to be used:

 for (Edge e = n.getFirstEdge(); e != null; e = e.getNext(n))
 {
     // do something with the current edge e
 }
 
In addition to these edge connections, all nodes of a graph are connected linearly in a linked list via their field next.
Author:
Ole Kniemeyer
See Also:
  • Field Details

    • next

      public final Node next
      The next node in the linked list of all nodes.
    • object

      public final Object object
      The original node in the source Graph.
    • width

      public float width
      The width of the 2D-visualization. May be 0.
    • height

      public float height
      The height of the 2D-visualization. May be 0.
    • layoutVarX

      public float layoutVarX
      This field may be used freely by layout algorithms.
    • layoutVarY

      public float layoutVarY
      This field may be used freely by layout algorithms.
    • initialX

      public float initialX
      This field may be used freely by layout algorithms.
    • initialY

      public float initialY
      This field may be used freely by layout algorithms.
    • finalX

      public float finalX
      This field may be used freely by layout algorithms.
    • finalY

      public float finalY
      This field may be used freely by layout algorithms.
    • index

      public int index
      This field may be used freely by layout algorithms.
    • isAccessed

      public boolean isAccessed
      This field may be used freely by layout algorithms.
  • Method Details

    • getFirstEdge

      public Edge getFirstEdge()
      Returns the first edge of the edge list of this node.
      Returns:
      this node's first edge
      See Also:
    • getEdgeTo

      public Edge getEdgeTo(Node target)
      Returns the edge from this node to target.
      Parameters:
      target - the target node
      Returns:
      the edge from this as source to target, or null if no such edge exists