package ciips.animation.tree;
import java.awt.*;
import ciips.animation.*;
/**
* This class regards a TreeNode as a binary tree.
* Its draw method draws the descending arcs also.
* @see TreeNode
* @see DrawingPanel#addDrawingObj
* @see DrawingPanel#removeObj
*/
public class MultiwayTree extends MultiNode /* implements DrawingObj*/ {
public int size;
/**
* Create a new tree
*/
public MultiwayTree() {
size=getChildCount();
} // Constructor 1
/** Start at a node and set the positions for the sub-tree elements
*
**/
public void setPosition( int x, int y, int dx, int dy ) {
this.x = x; this.y = y;
int dx2 = dx/2;
for (int i=0; i 0) {
g.setColor( labelColor );
g.setFont( hugeFont );
g.drawString(getLabel(), x + 5, y + 12);
}
}
g.setColor( Color.white );
g.setFont( bigFont );
g.drawString(""+getData(), x + 2, y+27);
// draw links to children
for (int i=0; i