All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.gui.treevisualizer.Node

java.lang.Object
    |
    +----weka.gui.treevisualizer.Node

public class Node
extends java.lang.Object
This class records all the data about a particular node for displaying.

Version:
$Revision: 1.3 $
Author:
Malcolm Ware (mfw4@cs.waikato.ac.nz)

Constructor Index

 o Node(String, String, int, int, Color, String)
This will setup all the values of the node except for its top and center.

Method Index

 o addChild(Edge)
Set the value of children.
 o adjustCenter(double)
Will increase or decrease the postion of center.
 o getCenter()
Get the value of center.
 o getChild(int)
Get the Edge for the child number 'i'.
 o getColor()
Get the value of color.
 o getCount(Node, int)
Recursively finds the number of visible nodes there are (this may accidentally count some of the invis nodes).
 o getCVisible()
Get If this node's childs are visible.
 o getGCount(Node, int)
Recursively finds the number of visible groups of siblings there are.
 o getHeight(Node, int)
Recursively finds the number of visible levels there are.
 o getInstances()
This will return the Instances object related to this node.
 o getLabel()
Get the value of label.
 o getLine(int)
Returns the text String for the specfied line.
 o getParent(int)
Get the parent edge.
 o getRefer()
Get the value of refer.
 o getRoot()
Get the value of root.
 o getShape()
Get the value of shape.
 o getTop()
Get the value of top.
 o getTotalCount(Node, int)
Recursively finds the total number of nodes there are.
 o getTotalGCount(Node, int)
Recursively finds the total number of groups of siblings there are.
 o getTotalHeight(Node, int)
Recursively finds the total number of levels there are.
 o getVisible()
Get the value of visible.
 o setCenter(double)
Set the value of center.
 o setColor(Color)
Set the value of color.
 o setCVisible(boolean)
Sets all the children of this node either to visible or invisible
 o setParent(Edge)
Set the value of parent.
 o setRefer(String)
Set the value of refer.
 o setRoot(boolean)
Set the value of root.
 o setShape(int)
Set the value of shape.
 o setTop(double)
Set the value of top.
 o stringSize(FontMetrics)
This will return the width and height of the rectangle that the text will fit into.

Constructor Detail

 o Node
public Node(java.lang.String label,
            java.lang.String refer,
            int backstyle,
            int shape,
            java.awt.Color color,
            java.lang.String d)
          This will setup all the values of the node except for its top and center.
Parameters:
label - The text for the node.
refer - The ID string for this node.
backstyle - The backstyle of this node.
shape - The shape of this node.
color - The color of this node.

Method Detail

 o getInstances
public Instances getInstances()
          This will return the Instances object related to this node. If it has not been allocated then that will be done also.
Returns:
The Instances object.
 o getCVisible
public boolean getCVisible()
          Get If this node's childs are visible.
Returns:
True if the childs are visible.
 o setCVisible
public void setCVisible(boolean v)
          Sets all the children of this node either to visible or invisible
Parameters:
v - True if the children are to be visible
 o getRefer
public java.lang.String getRefer()
          Get the value of refer.
Returns:
Value of refer.
 o setRefer
public void setRefer(java.lang.String v)
          Set the value of refer.
Parameters:
v - Value to assign to refer.
 o getShape
public int getShape()
          Get the value of shape.
Returns:
Value of shape.
 o setShape
public void setShape(int v)
          Set the value of shape.
Parameters:
v - Value to assign to shape.
 o getColor
public java.awt.Color getColor()
          Get the value of color.
Returns:
Value of color.
 o setColor
public void setColor(java.awt.Color v)
          Set the value of color.
Parameters:
v - Value to assign to color.
 o getLabel
public java.lang.String getLabel()
          Get the value of label.
Returns:
Value of label.
 o stringSize
public java.awt.Dimension stringSize(java.awt.FontMetrics f)
          This will return the width and height of the rectangle that the text will fit into.
Parameters:
f - The size info for the Font.
Returns:
A Dimension containing the size of the text.
 o getLine
public java.lang.String getLine(int n)
          Returns the text String for the specfied line.
Parameters:
n - The line wanted.
Returns:
The String corresponding to that line.
 o getCenter
public double getCenter()
          Get the value of center.
Returns:
Value of center.
 o setCenter
public void setCenter(double v)
          Set the value of center.
Parameters:
v - Value to assign to center.
 o adjustCenter
public void adjustCenter(double v)
          Will increase or decrease the postion of center.
Parameters:
v - The amount to increase or decrease center by.
 o getTop
public double getTop()
          Get the value of top.
Returns:
Value of top.
 o setTop
public void setTop(double v)
          Set the value of top.
Parameters:
v - Value to assign to top.
 o getVisible
public boolean getVisible()
          Get the value of visible.
Returns:
Value of visible.
 o getRoot
public boolean getRoot()
          Get the value of root.
Returns:
True if has no parents.
 o setRoot
public void setRoot(boolean v)
          Set the value of root.
Parameters:
v - Value to assign to root.
 o getParent
public Edge getParent(int i)
          Get the parent edge.
Parameters:
i - The parent number to get.
Returns:
The parent edge or NULL if it doesn't exist.
 o setParent
public void setParent(Edge v)
          Set the value of parent.
Parameters:
v - Value to assign to parent.
 o getChild
public Edge getChild(int i)
          Get the Edge for the child number 'i'.
Parameters:
i - The child number to get.
Returns:
The child Edge or NULL if it doesn't exist.
 o addChild
public void addChild(Edge v)
          Set the value of children.
Parameters:
v - Value to assign to children.
 o getGCount
public static int getGCount(Node r,
                            int n)
          Recursively finds the number of visible groups of siblings there are.
Parameters:
r - The current Node upto.
n - The current number of groups there are.
Returns:
The number of groups found so far.
 o getTotalGCount
public static int getTotalGCount(Node r,
                                 int n)
          Recursively finds the total number of groups of siblings there are.
Parameters:
r - The current Node upto.
n - The current number of groups there are.
Returns:
The number of groups found so far.
 o getCount
public static int getCount(Node r,
                           int n)
          Recursively finds the number of visible nodes there are (this may accidentally count some of the invis nodes).
Parameters:
r - The current Node upto.
n - The current number nodes there are.
Returns:
The number of nodes found so far.
 o getTotalCount
public static int getTotalCount(Node r,
                                int n)
          Recursively finds the total number of nodes there are.
Parameters:
r - The current Node upto.
n - The current number nodes there are.
Returns:
The number of nodes found so far.
 o getHeight
public static int getHeight(Node r,
                            int l)
          Recursively finds the number of visible levels there are.
Parameters:
r - The current Node upto.
l - The curent level.
Returns:
The max number of levels found so far.
 o getTotalHeight
public static int getTotalHeight(Node r,
                                 int l)
          Recursively finds the total number of levels there are.
Parameters:
r - The current Node upto.
l - The curent level.
Returns:
The max number of levels found so far.

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home