java.lang.Object
javax.vecmath.Tuple2f
javax.vecmath.Point2f
de.grogra.imp2d.layout.Node
- All Implemented Interfaces:
Serializable
,Cloneable
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 Summary
FieldsModifier and TypeFieldDescriptionfloat
This field may be used freely by layout algorithms.float
This field may be used freely by layout algorithms.float
The height of the 2D-visualization.int
This field may be used freely by layout algorithms.float
This field may be used freely by layout algorithms.float
This field may be used freely by layout algorithms.boolean
This field may be used freely by layout algorithms.float
This field may be used freely by layout algorithms.float
This field may be used freely by layout algorithms.final Node
The next node in the linked list of all nodes.final Object
The original node in the sourceGraph
.float
The width of the 2D-visualization. -
Method Summary
Modifier and TypeMethodDescriptionReturns the edge from this node totarget
.Returns the first edge of the edge list of this node.Methods inherited from class javax.vecmath.Point2f
clone, distance, distanceL1, distanceLinf, distanceSquared
-
Field Details
-
next
The next node in the linked list of all nodes. -
object
The original node in the sourceGraph
. -
width
public float widthThe width of the 2D-visualization. May be 0. -
height
public float heightThe height of the 2D-visualization. May be 0. -
layoutVarX
public float layoutVarXThis field may be used freely by layout algorithms. -
layoutVarY
public float layoutVarYThis field may be used freely by layout algorithms. -
initialX
public float initialXThis field may be used freely by layout algorithms. -
initialY
public float initialYThis field may be used freely by layout algorithms. -
finalX
public float finalXThis field may be used freely by layout algorithms. -
finalY
public float finalYThis field may be used freely by layout algorithms. -
index
public int indexThis field may be used freely by layout algorithms. -
isAccessed
public boolean isAccessedThis field may be used freely by layout algorithms.
-
-
Method Details
-
getFirstEdge
Returns the first edge of the edge list of this node.- Returns:
- this node's first edge
- See Also:
-
getEdgeTo
Returns the edge from this node totarget
.- Parameters:
target
- the target node- Returns:
- the edge from
this
assource
totarget
, ornull
if no such edge exists
-