net.claribole.zgrviewer.dot
Class Node

java.lang.Object
  extended bynet.claribole.zgrviewer.dot.Node
Direct Known Subclasses:
net.claribole.zgrviewer.dot.CommonNode, SubGraph

public abstract class Node
extends java.lang.Object

Abstract node class containing basic common attributes and accessing methods

Author:
Eric Mounhem

Constructor Summary
protected Node(java.lang.Object root)
           
  Node(java.lang.Object root, java.lang.String id)
          Create a new Node instance
 
Method Summary
protected  void addInEdge(Edge edge)
          Add an incoming edge to the node
protected  void addOutEdge(Edge edge)
          Add an outcoming edge to the node
protected  void changeOption(java.lang.String name, java.lang.String value)
           
 Edge[] getIn()
          Get the edges entering this node
 Edge[] getOut()
          Get the edges exiting this node
 Graph getRootGraph()
           
protected  java.lang.String nodeOptions()
          Write node options
protected  java.lang.String printOption(java.lang.String attribute, boolean value)
          Write a boolean option
protected  java.lang.String printOption(java.lang.String attribute, double value)
          Write a double option
protected  java.lang.String printOption(java.lang.String attribute, int value)
          Write an integer option
protected  java.lang.String printOption(java.lang.String attribute, java.lang.String value)
          Write a String option
protected  void removeInEdge(Edge edge)
          Remove an incoming edge to the node
protected  void removeOutEdge(Edge edge)
          Remove an outcoming edge to the node
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

public Node(java.lang.Object root,
            java.lang.String id)
     throws java.lang.Exception
Create a new Node instance

Parameters:
root - root of the Node
id - identification string of the node in the graph
Throws:
java.lang.Exception - the node must have an ID (unless it is a SubRecord node)

Node

protected Node(java.lang.Object root)
        throws java.lang.Exception
Method Detail

getIn

public Edge[] getIn()
Get the edges entering this node

Returns:
list of entering edges

getOut

public Edge[] getOut()
Get the edges exiting this node

Returns:
list of exiting edges

addInEdge

protected void addInEdge(Edge edge)
Add an incoming edge to the node

Parameters:
edge -

addOutEdge

protected void addOutEdge(Edge edge)
Add an outcoming edge to the node

Parameters:
edge -

removeInEdge

protected void removeInEdge(Edge edge)
Remove an incoming edge to the node

Parameters:
edge -

removeOutEdge

protected void removeOutEdge(Edge edge)
Remove an outcoming edge to the node

Parameters:
edge -

changeOption

protected void changeOption(java.lang.String name,
                            java.lang.String value)
                     throws java.lang.Exception
Throws:
java.lang.Exception

toString

public java.lang.String toString()
See Also:
Object.toString()

nodeOptions

protected java.lang.String nodeOptions()
Write node options

Returns:
Modified attributes values

printOption

protected java.lang.String printOption(java.lang.String attribute,
                                       boolean value)
Write a boolean option

Parameters:
attribute -
value -
Returns:
A GraphViz boolean value

printOption

protected java.lang.String printOption(java.lang.String attribute,
                                       double value)
Write a double option

Parameters:
attribute -
value -
Returns:
A GraphViz double value

printOption

protected java.lang.String printOption(java.lang.String attribute,
                                       int value)
Write an integer option

Parameters:
attribute -
value -
Returns:
A GraphViz integer value

printOption

protected java.lang.String printOption(java.lang.String attribute,
                                       java.lang.String value)
Write a String option

Parameters:
attribute -
value -
Returns:
A GraphViz String value

getRootGraph

public Graph getRootGraph()


Copyright © 2004-2005 INRIA. All Rights Reserved
Licensed under the GNU LGPL. For full terms see the file COPYING.