weka.gui.treevisualizer
Class PlaceNode1

java.lang.Object
  extended byweka.gui.treevisualizer.PlaceNode1
All Implemented Interfaces:
NodePlace

public class PlaceNode1
extends java.lang.Object
implements NodePlace

This class will place the Nodes of a tree.

It will place these nodes so that they symetrically fill each row. This is simple to calculate but is not visually nice for most trees.

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

Field Summary
private  int[] m_levelNode
          An array containing the current node place for each level to place each node accordingly.
private  double[] m_levels
          An array containing the spacing value for each level
private  int m_noLevels
          The number of levels in the tree
private  double m_yRatio
          The distance between each level.
 
Constructor Summary
PlaceNode1()
           
 
Method Summary
 void place(Node r)
          Call this function to have each node in the tree starting at 'r' placed in a visual (not logical, they already are) tree position.
private  void placer(Node r, int l)
          This function goes through and sets the position of each node
private  void setNumOfNodes(Node r, int l)
          This function finds the number of nodes on each level recursively.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_levels

private double[] m_levels
An array containing the spacing value for each level


m_noLevels

private int m_noLevels
The number of levels in the tree


m_levelNode

private int[] m_levelNode
An array containing the current node place for each level to place each node accordingly.


m_yRatio

private double m_yRatio
The distance between each level.

Constructor Detail

PlaceNode1

public PlaceNode1()
Method Detail

place

public void place(Node r)
Call this function to have each node in the tree starting at 'r' placed in a visual (not logical, they already are) tree position.

Specified by:
place in interface NodePlace
Parameters:
r - The top of the tree.

setNumOfNodes

private void setNumOfNodes(Node r,
                           int l)
This function finds the number of nodes on each level recursively.

Parameters:
r - The current Node upto.
l - The current level upto.

placer

private void placer(Node r,
                    int l)
This function goes through and sets the position of each node

Parameters:
r - The current node upto.
l - the current level upto.