|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjcreek.util.graph.Node
This class represents a node with a 2D integer position. The node may also be a member of a graph.
Graph
,
Serialized FormField Summary | |
protected Graph |
graph
|
Constructor Summary | |
Node()
Creates a new node. |
|
Node(int x,
int y)
Creates a new node with the given initial position. |
Method Summary | |
void |
addEdge(Edge edge)
Adds an edge to this node. |
protected void |
addEdgeP(Edge e)
Called from Graph to tell this node to add an edge to its list of edges from or to this node. |
java.lang.Object |
clone()
Returns a clone of this node. |
int |
edgeSize()
Gives the number of edges from/to this node. |
java.util.Iterator |
getEdgeIterator()
Returns an iterator for the list of edges from/to this node. |
Graph |
getGraph()
Returns the Graph this Node is a part of. |
java.awt.Point |
getPosition()
Returns the position of this node. |
void |
remove()
Tells this node to remove itself from its current graph. |
void |
removeEdge(Edge edge)
Removes an edge from the node. |
protected void |
removeEdgeP(Edge e)
Called from Graph to tell this node to remove an edge to its list of edges from or to this node. |
void |
removeP()
Called by the Graph object to notify the node that it has been removed from the graph. |
void |
setPosition(int newX,
int newY)
Returns the position of this node. |
void |
setPosition(java.awt.Point p)
Sets the position of this node. |
void |
suspendEventReport(boolean suspend)
Suspends the reporting of "move" events for this node. |
void |
translate(int dx,
int dy)
Moves the Node by dx, dy. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Graph graph
Constructor Detail |
public Node()
public Node(int x, int y)
Method Detail |
public java.awt.Point getPosition()
public void setPosition(int newX, int newY)
public void setPosition(java.awt.Point p)
public void translate(int dx, int dy)
public Graph getGraph()
public void addEdge(Edge edge)
protected void addEdgeP(Edge e)
public void removeEdge(Edge edge)
protected void removeEdgeP(Edge e)
public void remove()
public void removeP()
public java.util.Iterator getEdgeIterator()
public int edgeSize()
public void suspendEventReport(boolean suspend)
public java.lang.Object clone()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |