All Packages Class Hierarchy This Package Previous Next Index WEKA's home
java.lang.Object | +----java.awt.Component | +----java.awt.Container | +----javax.swing.JComponent | +----javax.swing.JPanel | +----weka.gui.treevisualizer.TreeVisualizer
To work this class simply create an instance of it.
Assign it to a window or other such object.
Resize it to the desired size.
When using the Displayer hold the left mouse button to drag the tree around.
Click the left mouse button with ctrl to shrink the size of the tree by half.
Click and drag with the left mouse button and shift to draw a box, when the left mouse button is released the contents of the box will be magnified to fill the screen.
Click the right mouse button to bring up a menu.
Most options are self explanatory.
Select Auto Scale to set the tree to it's optimal display size.
public TreeVisualizer(TreeDisplayListener tdl, java.lang.String dot, NodePlace p)
tdl
- listener
dot
- string containing the dot representation of the tree to
display
p
- the algorithm to be used to position the nodes.
public TreeVisualizer(TreeDisplayListener tdl, Node n, NodePlace p)
tdl
- listener.
n
- the top Node of the tree to be displayed.
p
- the algorithm to be used to position the nodes.
public void actionPerformed(java.awt.event.ActionEvent e)
e
- the action event.
public void itemStateChanged(java.awt.event.ItemEvent e)
e
- the item event.
public void mouseClicked(java.awt.event.MouseEvent e)
e
- the mouse event.
public void mousePressed(java.awt.event.MouseEvent e)
e
- the mouse event.
public void mouseReleased(java.awt.event.MouseEvent e)
e
- the mouse event.
public void mouseDragged(java.awt.event.MouseEvent e)
e
- the mouse event.
public void mouseMoved(java.awt.event.MouseEvent e)
e
- the mouse event.
public void mouseEntered(java.awt.event.MouseEvent e)
e
- the mouse event.
public void mouseExited(java.awt.event.MouseEvent e)
e
- the mouse event.
public void setHighlight(java.lang.String id)
id
- the id of the node to set the highlight for
public void paintComponent(java.awt.Graphics g)
g
- the drawing surface.
public static void main(java.lang.String args[])
args
- first argument should be the name of a file that contains
a tree discription in dot format.
All Packages Class Hierarchy This Package Previous Next Index WEKA's home