utilities
Class GraphNode

java.lang.Object
  |
  +--utilities.GraphNode
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, ConfiguredObject, java.io.Serializable
Direct Known Subclasses:
ContainerGraphNode, GraphEdge

public class GraphNode
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable, ConfiguredObject, java.lang.Comparable

This is a superclass for the generic purpose of drawing graphs made up of nodes and edges. Its primary purpose is for the resource hierarchy interface.

It should probably not be instantiated directly. It is modeled after taems' Node class, minus the agent/tames specific stuff.

See Also:
Serialized Form

Constructor Summary
GraphNode()
          Blank Constructor
GraphNode(java.lang.String l)
          Default constructor
 
Method Summary
 void addEdge(GraphEdge e, GraphNode t)
           
 void addEdge(GraphNode t)
           
 java.lang.Object clone()
           
 int compareTo(java.lang.Object o)
           
 boolean equals(java.lang.Object o)
           
 void excise()
           
 java.lang.Object getAttribute(java.lang.Object k)
          Note that this uses the toString() method for the key to actually store the object.
 java.util.Enumeration getAttributes()
          Returns the attribute names
 javax.swing.JPanel getDefaultPanel()
          Drawing stuff *
 java.util.Enumeration getInEdges()
           
 java.lang.String getLabel()
          Accessors
 java.util.Enumeration getOutEdges()
           
 java.util.Enumeration getUndirEdges()
           
 boolean hasAttribute(java.lang.Object k)
          Determines if the node has a particular attribute
 boolean hasInEdges()
           
 boolean hasOutEdges()
           
 boolean hasUndirEdges()
           
 boolean matches(java.lang.Object o)
           
 int numInEdges()
           
 int numOutEdges()
           
 int numUndirEdges()
           
 void removeEdge(GraphEdge e)
           
 void removeEdge(GraphNode t)
           
 void saveCfg()
          saves the information in this object to the proper location in the CfgManager.
 void setAttribute(java.lang.Object k, java.lang.Object d)
          Sets an attribute's data.
 void setLabel(java.lang.String l)
           
 java.lang.String toString()
           
 void updateCfg()
          updates the information in this object with information currently in the CfgManager.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GraphNode

public GraphNode(java.lang.String l)
Default constructor
Parameters:
l - The node's label

GraphNode

public GraphNode()
Blank Constructor
Method Detail

updateCfg

public void updateCfg()
Description copied from interface: ConfiguredObject
updates the information in this object with information currently in the CfgManager.
Specified by:
updateCfg in interface ConfiguredObject

saveCfg

public void saveCfg()
Description copied from interface: ConfiguredObject
saves the information in this object to the proper location in the CfgManager.
Specified by:
saveCfg in interface ConfiguredObject

getLabel

public java.lang.String getLabel()
Accessors

setLabel

public void setLabel(java.lang.String l)

getAttribute

public java.lang.Object getAttribute(java.lang.Object k)
Note that this uses the toString() method for the key to actually store the object.
Parameters:
k - The key identifying the desired attribute
Returns:
The object, or null if not found

setAttribute

public void setAttribute(java.lang.Object k,
                         java.lang.Object d)
Sets an attribute's data. Attribute keys should not contain whitespace.

If a key is added with a null data object, the key will be removed from the attribute set.

Parameters:
k - The key identifying the desired attribute
d - The attribute data

getAttributes

public java.util.Enumeration getAttributes()
Returns the attribute names
Returns:
An enumeration of all the attribute keys

hasAttribute

public boolean hasAttribute(java.lang.Object k)
Determines if the node has a particular attribute
Returns:
True if the attribute is present

addEdge

public void addEdge(GraphNode t)

removeEdge

public void removeEdge(GraphNode t)

addEdge

public void addEdge(GraphEdge e,
                    GraphNode t)

removeEdge

public void removeEdge(GraphEdge e)

getOutEdges

public java.util.Enumeration getOutEdges()

hasOutEdges

public boolean hasOutEdges()

numOutEdges

public int numOutEdges()

getInEdges

public java.util.Enumeration getInEdges()

getUndirEdges

public java.util.Enumeration getUndirEdges()

hasUndirEdges

public boolean hasUndirEdges()

numUndirEdges

public int numUndirEdges()

hasInEdges

public boolean hasInEdges()

numInEdges

public int numInEdges()

excise

public void excise()

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

matches

public boolean matches(java.lang.Object o)

clone

public java.lang.Object clone()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDefaultPanel

public javax.swing.JPanel getDefaultPanel()
Drawing stuff *