org.wilmascope.graphgen
Class GraphGenerator

java.lang.Object
  extended by org.wilmascope.graphgen.GraphGenerator
All Implemented Interfaces:
org.wilmascope.util.Plugin
Direct Known Subclasses:
ClusteredGraphGenerator, GridGenerator, RandomGraphGenerator, ScaleFreeGraphGenerator, StratifiedGraphGenerator, TreeGenerator

public abstract class GraphGenerator
extends java.lang.Object
implements org.wilmascope.util.Plugin

Boilerplate class for graph generators. Extend this class to create classes that generate random or example graphs.

Author:
dwyer

Constructor Summary
GraphGenerator()
           
 
Method Summary
protected  GraphControl.Node addRandomNode(GraphControl.Cluster root, boolean threeD)
          Create a randomly coloured, randomly positioned node with the default style
abstract  void generate(GraphControl gc)
          This method will do the work of actually creating the graph.
protected  java.lang.String getEdgeView()
           
protected  java.lang.String getNodeView()
          Get the NodeView style
 void setView(java.lang.String nodeView, java.lang.String edgeView)
          Set the glyph style for the generated graph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.wilmascope.util.Plugin
getControls, getName
 

Constructor Detail

GraphGenerator

public GraphGenerator()
Method Detail

generate

public abstract void generate(GraphControl gc)
This method will do the work of actually creating the graph.

Parameters:
gc - the instance of GraphControl inwhich the graph will be generated

setView

public void setView(java.lang.String nodeView,
                    java.lang.String edgeView)
Set the glyph style for the generated graph

Parameters:
nodeView - node view style
edgeView - edge view style

addRandomNode

protected GraphControl.Node addRandomNode(GraphControl.Cluster root,
                                          boolean threeD)
Create a randomly coloured, randomly positioned node with the default style

Parameters:
root - cluster to add the node to
threeD - use 3D positions
Returns:
the new node

getNodeView

protected java.lang.String getNodeView()
Get the NodeView style

Returns:

getEdgeView

protected java.lang.String getEdgeView()