|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ciips.animation.tree.BasicNode
Field Summary | |
protected int |
depth
|
protected int |
diff_x
|
protected int |
diff_y
|
boolean |
highlight
|
protected boolean |
highlightNode
|
protected java.lang.String |
label
|
protected java.awt.Color |
labelColor
|
java.awt.Dimension |
node_dim
|
protected java.awt.Color |
nodeColor
|
protected java.lang.Object |
weight
|
protected int |
x
|
protected int |
y
|
Constructor Summary | |
BasicNode()
Create a new leaf node with label and weight as specified in the parameters with multiple children. |
|
BasicNode(java.lang.String label,
java.lang.Object weight)
|
Method Summary | |
void |
displace(int dx,
int dy)
Move the tree starting with node dx pixels to the right and dy pixels down. |
void |
draw(java.awt.Graphics g)
This method draws the node on the corresponding graphical context normally passed in from the drawing panel. |
java.lang.Object |
getData()
Get the weight of this node. |
int |
getDepth()
Get the depth of his node. |
boolean |
getHighlight()
|
java.lang.String |
getLabel()
Get the label of this node. |
int |
getX()
Get the left most position of the node. |
int |
getY()
Get the top most position of the node. |
void |
initColors(java.awt.Color nodeColor)
Set the color of the node. |
void |
initFonts(java.awt.Font hugeFont,
java.awt.Font bigFont)
Assign some font instances to reduce initialization over during redraw. |
boolean |
isLeaf()
Check if this node is a leaf node. |
void |
move(int x,
int y)
Move the node and all its branches based on the parameters. |
void |
setColour(java.awt.Color x)
|
void |
setDepth(int depth)
Sets the depth of this node corresponding to the root node of the tree. |
void |
setHighlight()
Set the highlight condition of a node |
void |
setLabel(java.lang.String label)
Set the label of this node. |
void |
setLabelColour(java.awt.Color x)
|
void |
setPosition(int x,
int y,
int dx,
int dy)
Start at a node and set the positions for the sub-tree elements dx is the distance between the first and the last child nodes in x direction dy is the distance between the parent and the child node in y direction |
void |
setWeight(java.lang.Object weight)
Set the weight of this node. |
void |
setX(int x)
Sets the x coordinate of the top-left corner of the node |
void |
setXY(int x,
int y)
|
void |
setY(int y)
Sets the y coordinate of the top-left corner of the node |
void |
unHighlight()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.String label
protected java.lang.Object weight
protected int x
protected int y
protected int depth
protected boolean highlightNode
protected java.awt.Color nodeColor
protected java.awt.Color labelColor
public boolean highlight
public java.awt.Dimension node_dim
protected int diff_y
protected int diff_x
Constructor Detail |
public BasicNode()
label
- The label of the new node.weight
- The weight of the new node.public BasicNode(java.lang.String label, java.lang.Object weight)
Method Detail |
public void setWeight(java.lang.Object weight)
weight
- The weight to be assigned to this node.public void setLabel(java.lang.String label)
label
- The label to be assigned to this node.public java.lang.Object getData()
public java.lang.String getLabel()
public boolean isLeaf()
public void setX(int x)
public void setY(int y)
public int getX()
public int getY()
public int getDepth()
public void setPosition(int x, int y, int dx, int dy)
public void setDepth(int depth)
depth
- Depth of the node.public void move(int x, int y)
x
- The horizontal destination position of this node.y
- The vertical destination position of this node.public void setXY(int x, int y)
public void displace(int dx, int dy)
node
- The root node of the tree to be moved.dx
- The change in x direction.dy
- The change in y direction.public void initFonts(java.awt.Font hugeFont, java.awt.Font bigFont)
public void initColors(java.awt.Color nodeColor)
nodeColor
- new color of the node.public void setColour(java.awt.Color x)
public void setLabelColour(java.awt.Color x)
public void setHighlight()
public void unHighlight()
public boolean getHighlight()
public void draw(java.awt.Graphics g)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |