rand.setSeed(System.currentTimeMillis());
DefaultGraphModel mod = new DefaultGraphModel();
DefaultGraphNode node0 = null, node1 = null, node2 = null;
rootNode = new DefaultGraphNode("Node0");
mod.add(rootNode);
for(int i = 0; i < 220; i++)
{
rootNode.addChild(node0 = new DefaultGraphNode("Node1." + i));
mod.add(node0);
}
for(int i = 0; i < 220; i++)
{
if(rand.nextBoolean() == true)
{
node0.addChild(node1 = new DefaultGraphNode("Node2." + i));
mod.add(node1);
if(rand.nextBoolean() == true)
{
rootNode.addParent(node1);
}
}
}
for(int i = 0; i < 220; i++)
{
if(rand.nextBoolean() == true)
{
node1.addChild(node2 = new DefaultGraphNode("Node3." + i));
mod.add(node2);
}
}