public class Node
extends java.lang.Object
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(Edge v)
Set the value of children.
|
void |
adjustCenter(double v)
Will increase or decrease the postion of center.
|
double |
getCenter()
Get the value of center.
|
Edge |
getChild(int i)
Get the Edge for the child number 'i'.
|
java.awt.Color |
getColor()
Get the value of color.
|
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).
|
boolean |
getCVisible()
Get If this node's childs are visible.
|
static int |
getGCount(Node r,
int n)
Recursively finds the number of visible groups of siblings there are.
|
static int |
getHeight(Node r,
int l)
Recursively finds the number of visible levels there are.
|
Instances |
getInstances()
This will return the Instances object related to this node.
|
java.lang.String |
getLabel()
Get the value of label.
|
java.lang.String |
getLine(int n)
Returns the text String for the specfied line.
|
Edge |
getParent(int i)
Get the parent edge.
|
java.lang.String |
getRefer()
Get the value of refer.
|
boolean |
getRoot()
Get the value of root.
|
int |
getShape()
Get the value of shape.
|
double |
getTop()
Get the value of top.
|
static int |
getTotalCount(Node r,
int n)
Recursively finds the total number of nodes there are.
|
static int |
getTotalGCount(Node r,
int n)
Recursively finds the total number of groups of siblings there are.
|
static int |
getTotalHeight(Node r,
int l)
Recursively finds the total number of levels there are.
|
boolean |
getVisible()
Get the value of visible.
|
void |
setCenter(double v)
Set the value of center.
|
void |
setColor(java.awt.Color v)
Set the value of color.
|
void |
setCVisible(boolean v)
Sets all the children of this node either to visible or invisible
|
void |
setParent(Edge v)
Set the value of parent.
|
void |
setRefer(java.lang.String v)
Set the value of refer.
|
void |
setRoot(boolean v)
Set the value of root.
|
void |
setShape(int v)
Set the value of shape.
|
void |
setTop(double v)
Set the value of top.
|
java.awt.Dimension |
stringSize(java.awt.FontMetrics f)
This will return the width and height of the rectangle that the text
will fit into.
|
public Node(java.lang.String label, java.lang.String refer, int backstyle, int shape, java.awt.Color color, java.lang.String d)
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.public Instances getInstances()
public boolean getCVisible()
public void setCVisible(boolean v)
v
- True if the children are to be visiblepublic java.lang.String getRefer()
public void setRefer(java.lang.String v)
v
- Value to assign to refer.public int getShape()
public void setShape(int v)
v
- Value to assign to shape.public java.awt.Color getColor()
public void setColor(java.awt.Color v)
v
- Value to assign to color.public java.lang.String getLabel()
public java.awt.Dimension stringSize(java.awt.FontMetrics f)
f
- The size info for the Font.public java.lang.String getLine(int n)
n
- The line wanted.public double getCenter()
public void setCenter(double v)
v
- Value to assign to center.public void adjustCenter(double v)
v
- The amount to increase or decrease center by.public double getTop()
public void setTop(double v)
v
- Value to assign to top.public boolean getVisible()
public boolean getRoot()
public void setRoot(boolean v)
v
- Value to assign to root.public Edge getParent(int i)
i
- The parent number to get.public void setParent(Edge v)
v
- Value to assign to parent.public Edge getChild(int i)
i
- The child number to get.public void addChild(Edge v)
v
- Value to assign to children.public static int getGCount(Node r, int n)
r
- The current Node upto.n
- The current number of groups there are.public static int getTotalGCount(Node r, int n)
r
- The current Node upto.n
- The current number of groups there are.public static int getCount(Node r, int n)
r
- The current Node upto.n
- The current number nodes there are.public static int getTotalCount(Node r, int n)
r
- The current Node upto.n
- The current number nodes there are.public static int getHeight(Node r, int l)
r
- The current Node upto.l
- The curent level.public static int getTotalHeight(Node r, int l)
r
- The current Node upto.l
- The curent level.