org.wilmascope.graphgen.plugin
Class TreeGenerator

java.lang.Object
  extended by org.wilmascope.graphgen.GraphGenerator
      extended by org.wilmascope.graphgen.plugin.TreeGenerator
All Implemented Interfaces:
org.wilmascope.util.Plugin

public class TreeGenerator
extends GraphGenerator

Generates a tree. Proceeds by adding a random number of children to a random node of the current tree. The probability of choosing a node is proportional to the number of free spaces for its children. Generation can be limited by the number of nodes, the maximum degree and optionally the tree height. The root node can be forced to have a given number of children.

Author:
Richard Webber

Constructor Summary
TreeGenerator()
           
 
Method Summary
 void generate(GraphControl gc)
          This method will do the work of actually creating the graph.
 javax.swing.JPanel getControls()
           
 java.lang.String getName()
           
 
Methods inherited from class org.wilmascope.graphgen.GraphGenerator
addRandomNode, getEdgeView, getNodeView, setView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeGenerator

public TreeGenerator()
Method Detail

getName

public java.lang.String getName()

getControls

public javax.swing.JPanel getControls()

generate

public void generate(GraphControl gc)
Description copied from class: GraphGenerator
This method will do the work of actually creating the graph.

Specified by:
generate in class GraphGenerator
Parameters:
gc - the instance of GraphControl inwhich the graph will be generated