com.nwoods.jgo.layout
Class JGoNetworkNode

java.lang.Object
  extended bycom.nwoods.jgo.layout.JGoNetworkNode

public class JGoNetworkNode
extends java.lang.Object

JGoNetworkNode provides an abstract view of a JGoObject as a node in a network (graph) of nodes and directed links. Nodes can also be created which do not correspond to any top-level JGoObjects in a JGoDocument. The JGoNetworkNode class provides a framework for manipulating the state of nodes without corrupting the JGoDocument objects.

See Also:
JGoNetwork, JGoNetworkLink

Constructor Summary
JGoNetworkNode()
          Contstructs a JGoNetworkNode with myCenter of (0,0) and all other values as null.
JGoNetworkNode(JGoNetwork network, JGoObject object)
          Constructs a JGoNetworkNode with myNetwork of network and myGoObject of object.
 
Method Summary
 void addPredLink(JGoNetworkLink pPredNetworkLink)
          Adds a JGoNetworkLink to the list predecessors (i.e., the link will be to this node).
 void addSuccLink(JGoNetworkLink pSuccNetworkLink)
          Adds a JGoNetworkLink to the list successors (i.e., the link will be from this node).
 void commitPosition()
          Moves the corresponding JGoObject to the center point of the node in the document.
 void deletePredLink(JGoNetworkLink pPredNetworkLink)
          Deletes a JGoNetworkLink from the list of predecessors (i.e., the link was to this node).
 void deleteSuccLink(JGoNetworkLink pSuccNetworkLink)
          Deletes a JGoNetworkLink from the list of successors (i.e., the link was from this node).
 org.eclipse.swt.graphics.Point getCenter()
          Returns the center point of the node in the document.
 JGoObject getJGoObject()
          Returns the JGoObject to which the node corresponds.
 JGoNetwork getNetwork()
          Gets the JGoNetwork that this JGoNetworkNode is part of.
 JGoAutoLayoutNodeData getNodeData()
          Gets the node's layout-specific nodeData.
 java.lang.Object getNodeUserData()
          Gets nodeUserData.
 JGoNetworkLink[] getPredLinksArray()
           
 java.util.LinkedList getPredLinksList()
          Returns the list of predecessor links (i.e., the links are to this node).
 JGoNetworkLink[] getSuccLinksArray()
           
 java.util.LinkedList getSuccLinksList()
          Returns the list of successor links (i.e., the links are from this node).
 void setCenter(int newx, int newy)
          Sets the center point of the node in the document.
 void setCenter(org.eclipse.swt.graphics.Point newCenter)
          Sets the center point of the node in the document.
 void setJGoObject(JGoObject obj)
          Change the JGoObject that this JGoNetworkNode is associated with.
 void setNetwork(JGoNetwork net)
          Set the "back-pointer" to the owning JGoNetwork.
 void setNodeData(JGoAutoLayoutNodeData data)
          Sets the node's layout-specific nodeData to data.
 void setNodeUserData(java.lang.Object obj)
          Sets nodeUserData to obj.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGoNetworkNode

public JGoNetworkNode()
Contstructs a JGoNetworkNode with myCenter of (0,0) and all other values as null.


JGoNetworkNode

public JGoNetworkNode(JGoNetwork network,
                      JGoObject object)
Constructs a JGoNetworkNode with myNetwork of network and myGoObject of object.

Parameters:
network - the JGoNetwork to which the node will belong
object - the JGoObject to which the node will correspond
Method Detail

getNetwork

public JGoNetwork getNetwork()
Gets the JGoNetwork that this JGoNetworkNode is part of.


setNetwork

public void setNetwork(JGoNetwork net)
Set the "back-pointer" to the owning JGoNetwork.


getJGoObject

public JGoObject getJGoObject()
Returns the JGoObject to which the node corresponds.


setJGoObject

public void setJGoObject(JGoObject obj)
Change the JGoObject that this JGoNetworkNode is associated with.


getPredLinksList

public java.util.LinkedList getPredLinksList()
Returns the list of predecessor links (i.e., the links are to this node).


getPredLinksArray

public JGoNetworkLink[] getPredLinksArray()

addPredLink

public void addPredLink(JGoNetworkLink pPredNetworkLink)
Adds a JGoNetworkLink to the list predecessors (i.e., the link will be to this node).


deletePredLink

public void deletePredLink(JGoNetworkLink pPredNetworkLink)
Deletes a JGoNetworkLink from the list of predecessors (i.e., the link was to this node).


getSuccLinksList

public java.util.LinkedList getSuccLinksList()
Returns the list of successor links (i.e., the links are from this node).


getSuccLinksArray

public JGoNetworkLink[] getSuccLinksArray()

addSuccLink

public void addSuccLink(JGoNetworkLink pSuccNetworkLink)
Adds a JGoNetworkLink to the list successors (i.e., the link will be from this node).


deleteSuccLink

public void deleteSuccLink(JGoNetworkLink pSuccNetworkLink)
Deletes a JGoNetworkLink from the list of successors (i.e., the link was from this node).


getCenter

public org.eclipse.swt.graphics.Point getCenter()
Returns the center point of the node in the document. Note: the corresponding JGoObject is not necessarily centered at this point.

See Also:
setCenter(org.eclipse.swt.graphics.Point), commitPosition()

setCenter

public void setCenter(org.eclipse.swt.graphics.Point newCenter)
Sets the center point of the node in the document. Note: the corresponding JGoObject is not necessarily centered at this point.

See Also:
getCenter(), commitPosition()

setCenter

public void setCenter(int newx,
                      int newy)
Sets the center point of the node in the document. Note: the corresponding JGoObject is not necessarily centered at this point.

See Also:
getCenter(), commitPosition()

commitPosition

public void commitPosition()
Moves the corresponding JGoObject to the center point of the node in the document.

See Also:
getCenter(), setCenter(org.eclipse.swt.graphics.Point)

getNodeData

public JGoAutoLayoutNodeData getNodeData()
Gets the node's layout-specific nodeData.


setNodeData

public void setNodeData(JGoAutoLayoutNodeData data)
Sets the node's layout-specific nodeData to data.


getNodeUserData

public java.lang.Object getNodeUserData()
Gets nodeUserData. Note: nodeUserData is not used by any of the auto-layout routines. It is meant to contain customizable data associated with a node.


setNodeUserData

public void setNodeUserData(java.lang.Object obj)
Sets nodeUserData to obj. Note: nodeUserData is not used by any of the auto-layout routines. It is meant to contain customizable data associated with a node.