org.caida.otter
Class DisplayObjects

java.lang.Object
  |
  +--org.caida.otter.DisplayObjects

public class DisplayObjects
extends java.lang.Object

A container for nodes, labels, and links. This class should encapsulate all the necessary information to render a graph to the screen.


Constructor Summary
DisplayObjects()
          Create an empty display object
 
Method Summary
 java.lang.Object addAttribute(java.lang.Object category, java.lang.Object attribute, java.lang.Object value)
          Add an attribute to inside a category
 java.lang.Object addCategory(java.lang.Object category)
          Add a category to the set.
 void addColumnNameToNodeName()
           
 Label addLabel(int index, int column, int row, java.lang.String name, java.lang.String colName)
          Add a label to our DisplayObject
 Label addLabel(Label newLabel)
           
 Line addLine(Coordinate coord1, Coordinate coord2, java.lang.String name)
          Add a line to our DisplayObject
 Line addLine(Line newLine)
           
 Node addNode(int index, int column, int row, java.lang.String name, java.lang.String colName)
          Add a node to our DisplayObject
 Node addNode(int index, int column, int row, java.lang.String name, java.lang.String colName, int nodeNumber)
          Add a node to the DisplayObject John Tusson Tue Aug 14 16:28:12 PDT 2001
 Node addNode(Node newNode)
           
 java.lang.Object changeAttribute(java.lang.Object category, java.lang.Object attribute, java.lang.Object value)
          Replace an attribute inside a category
 boolean checkSelfConsistencyForNodesAndLines()
          check the data structure for self-consistency
 boolean containsKey(java.lang.String lineName)
           
 boolean containsLabel(Label label)
           
 boolean containsLabel(java.lang.String labelName)
           
 boolean containsLine(Line line)
           
 boolean containsNode(Node node)
           
 boolean containsNode(java.lang.String nodeName)
           
 java.lang.Object deleteAttribute(java.lang.Object category, java.lang.Object attribute)
          Remove an attribute from inside a category
 java.lang.Object deleteCategory(java.lang.Object category)
          Remove an attribute from the set of categories.
 java.lang.Object[] enumerateAttributes(java.lang.Object category)
          Get a list of attributes in a given category
 java.lang.Object[] enumerateCategories()
          Get a list of objects that represent all of the categories contained in this node's category set.
 java.lang.Object getAttribute(java.lang.Object category, java.lang.Object attribute)
          Get an attribute from inside a category
 Label getLabel(java.lang.String name)
           
 int getLabelCount()
           
 java.util.Enumeration getLabelEnumeration()
           
 Line getLine(java.lang.String name)
           
 int getLineCount()
           
 java.util.Enumeration getLineEnumeration()
           
 Node getNode(java.lang.String name)
           
 int getNodeCount()
           
 java.util.Enumeration getNodeEnumeration()
           
 void invertImage(boolean invertX, boolean invertY)
          Invert our display object along either axis.
 void normalizeSize(int screenX, int screenY)
          Normalize the size of the final image.
 void removeLabel(Label delLabel)
          Remove a label from the DisplayObject
 void staggerLabels(int tierCount, int spacing)
          Assumes all the labels are already at the same X val; stagger labels into a specified number of tiers over the given total space.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayObjects

public DisplayObjects()
Create an empty display object
Method Detail

addColumnNameToNodeName

public void addColumnNameToNodeName()

checkSelfConsistencyForNodesAndLines

public boolean checkSelfConsistencyForNodesAndLines()
check the data structure for self-consistency

addNode

public Node addNode(int index,
                    int column,
                    int row,
                    java.lang.String name,
                    java.lang.String colName)
Add a node to our DisplayObject
Parameters:
index - The index value to assign the new node.
column - The column number to put the new node in.
row - The row number to put the new node in.
name - The name to assign the new node.
colName - The column name to assign the new node.
Returns:
The newly created Node object.

addNode

public Node addNode(int index,
                    int column,
                    int row,
                    java.lang.String name,
                    java.lang.String colName,
                    int nodeNumber)
Add a node to the DisplayObject John Tusson Tue Aug 14 16:28:12 PDT 2001
Parameters:
index - The index value to assign the new node.
column - The column number to put the new node in.
row - The row number to put the new node in.
name - The name to assign the new node.
colName - The column name to assign the new node.
nodeNumber - The orignal node number from graph file
Returns:
The newly created Node object.

addNode

public Node addNode(Node newNode)

getNode

public Node getNode(java.lang.String name)

getNodeEnumeration

public java.util.Enumeration getNodeEnumeration()

containsNode

public boolean containsNode(Node node)

containsNode

public boolean containsNode(java.lang.String nodeName)

getNodeCount

public int getNodeCount()

getLabelCount

public int getLabelCount()

getLineCount

public int getLineCount()

addLabel

public Label addLabel(int index,
                      int column,
                      int row,
                      java.lang.String name,
                      java.lang.String colName)
Add a label to our DisplayObject
Parameters:
index - The index to assign the new Label
column - The column number to assign the new label.
row - The row number to assign the new label.
name - The name to assign the new label.
colName - The column name to assign to the new label.
Returns:
The newly created Label object.

addLabel

public Label addLabel(Label newLabel)

getLabel

public Label getLabel(java.lang.String name)

getLabelEnumeration

public java.util.Enumeration getLabelEnumeration()

containsLabel

public boolean containsLabel(Label label)

containsLabel

public boolean containsLabel(java.lang.String labelName)

addLine

public Line addLine(Coordinate coord1,
                    Coordinate coord2,
                    java.lang.String name)
Add a line to our DisplayObject
Parameters:
idx1 - the index of the node the line starts from.
idx2 - the index of the node the line ends at.
name - A name to assign to the new line.
Returns:
The newly created Line object.

addLine

public Line addLine(Line newLine)

getLine

public Line getLine(java.lang.String name)

getLineEnumeration

public java.util.Enumeration getLineEnumeration()

containsLine

public boolean containsLine(Line line)

containsKey

public boolean containsKey(java.lang.String lineName)

invertImage

public void invertImage(boolean invertX,
                        boolean invertY)
Invert our display object along either axis.
Parameters:
invertX - true if you want the X axis inverted, false otherwise.
invertY - true if you want the Y axis inverted, false otherwise.

removeLabel

public void removeLabel(Label delLabel)
Remove a label from the DisplayObject
Parameters:
delLabel - The label object to remove.

normalizeSize

public void normalizeSize(int screenX,
                          int screenY)
Normalize the size of the final image. An argument of -1 for either width or height will leave that axis unchanged.
Parameters:
screenX - The new width in pixels.
screenY - the new height in pixels.

staggerLabels

public void staggerLabels(int tierCount,
                          int spacing)
Assumes all the labels are already at the same X val; stagger labels into a specified number of tiers over the given total space.
Parameters:
tierCount - The number of tiers to divide the labels into.
spacing - The spacing in pixels between the tiers.

addCategory

public java.lang.Object addCategory(java.lang.Object category)
Add a category to the set.

addAttribute

public java.lang.Object addAttribute(java.lang.Object category,
                                     java.lang.Object attribute,
                                     java.lang.Object value)
Add an attribute to inside a category

getAttribute

public java.lang.Object getAttribute(java.lang.Object category,
                                     java.lang.Object attribute)
Get an attribute from inside a category

deleteCategory

public java.lang.Object deleteCategory(java.lang.Object category)
Remove an attribute from the set of categories.

deleteAttribute

public java.lang.Object deleteAttribute(java.lang.Object category,
                                        java.lang.Object attribute)
Remove an attribute from inside a category

changeAttribute

public java.lang.Object changeAttribute(java.lang.Object category,
                                        java.lang.Object attribute,
                                        java.lang.Object value)
Replace an attribute inside a category

enumerateCategories

public java.lang.Object[] enumerateCategories()
Get a list of objects that represent all of the categories contained in this node's category set.

enumerateAttributes

public java.lang.Object[] enumerateAttributes(java.lang.Object category)
Get a list of attributes in a given category