|
Eclipse Draw2d 3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.draw2d.graph.Node
public class Node
A node in a DirectedGraph. A node has 0 or more incoming and outgoing Edge
s. A
node is given a width and height by the client. When a layout places the node in the
graph, it will determine the node's x and y location. It may also modify the node's
height.
A node represents both the input and the output for a layout
algorithm. The following fields are used as input to a graph layout:
width
- the node's width.
height
- the node's height.
outgoing
- the node's outgoing edges.
incoming
- the node's incoming edges.
incomingOffset
- the default attachment point for incoming edges.
outgoingOffset
- the default attachment point for outgoing edges.
The following fields are calculated by a graph layout and comprise the output:
x
- the node's x location
y
- the node's y location
height
- the node's height may be stretched to match the height of other
nodes
Field Summary | |
---|---|
Object |
data
Clients may use this field to mark the Node with an arbitrary data object. |
int |
height
The height of this node. |
EdgeList |
incoming
The edges for which this node is the target. |
int |
incomingOffset
The default attachment point for incoming edges. |
EdgeList |
outgoing
The edges for which this node is the source. |
int |
outgoingOffset
The node's outgoing offset attachment point. |
int |
rowOrder
Deprecated. use setRowConstraint(int) and getRowConstraint() |
double |
sortValue
Deprecated. for internal use only |
int |
width
The node's width. |
int |
x
The node's x coordinate. |
int |
y
The node's y coordinate. |
Constructor Summary | |
---|---|
Node()
Constructs a new node. |
|
Node(Object data)
Constructs a node with the given data object |
|
Node(Object data,
Subgraph parent)
Constructs a node with the given data object and parent subgraph. |
|
Node(Subgraph parent)
Constructs a node inside the given subgraph. |
Method Summary | |
---|---|
Node |
getLeft()
Returns a reference to a node located left from this one |
int |
getOffsetIncoming()
Returns the incoming attachment point. |
int |
getOffsetOutgoing()
Returns the outgoing attachment point. |
Insets |
getPadding()
Returns the padding for this node or null if the default padding for the
graph should be used. |
Subgraph |
getParent()
Returns the parent Subgraph or null if there is no parent. |
Node |
getRight()
Returns a reference to a node located right from this one |
int |
getRowConstraint()
Returns the row constraint for this node. |
void |
setPadding(Insets padding)
Sets the padding. |
void |
setParent(Subgraph parent)
Sets the parent subgraph. |
void |
setRowConstraint(int value)
Sets the row sorting constraint for this node. |
void |
setSize(Dimension size)
Sets the size of this node to the given dimension. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Object data
public int height
public int rowOrder
setRowConstraint(int)
and getRowConstraint()
public EdgeList incoming
public int incomingOffset
-1
indicates that the
node's horizontal center should be used.
public EdgeList outgoing
public double sortValue
public int outgoingOffset
public int width
public int x
public int y
Constructor Detail |
---|
public Node()
public Node(Object data)
data
- an arbitrary data objectpublic Node(Subgraph parent)
parent
- the parent subgraphpublic Node(Object data, Subgraph parent)
data
- an arbitrary data objectparent
- the parent subgraph or null
Method Detail |
---|
public int getOffsetIncoming()
public int getOffsetOutgoing()
public Insets getPadding()
null
if the default padding for the
graph should be used.
null
public Subgraph getParent()
null
if there is no parent. Subgraphs are
only for use in CompoundDirectedGraphLayout
.
null
public void setPadding(Insets padding)
null
indicates that the default padding should be used.
padding
- an insets or null
public void setParent(Subgraph parent)
parent
- the parentpublic void setRowConstraint(int value)
-1
. If two nodes have different values both >= 0, the node with the
smaller constraint will be placed to the left of the other node. In all other cases no
relative placement is guaranteed.
value
- the row constraintpublic int getRowConstraint()
public void setSize(Dimension size)
size
- the new sizepublic String toString()
toString
in class Object
Object.toString()
public Node getLeft()
Node
on the left from this onepublic Node getRight()
Node
on the right from this one
|
Eclipse Draw2d 3.3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |