Package uk.ac.man.cs.mig.util.graph.model.impl

Examples of uk.ac.man.cs.mig.util.graph.model.impl.DefaultGraphModel


*/
public class DefaultModelTestCase extends TestCase
{
  public void testAddition()
  {
    DefaultGraphModel model = new DefaultGraphModel();

    model.add("Node00");

    model.add("Node01");

    model.add("Node02");

    model.add("Node00", "Node10");

    model.add("Node01", "Node10");

    model.add("Node02", "Node10");

    model.add("Node10", "Node20");

    model.add("Node10", "Node21");


    assertTrue(model.getParentCount("Node10") == 3);

    assertTrue(model.getChildCount("Node10") == 2);




  }
View Full Code Here


  private ArrayList thumbnailViewSourceListeners;


  public GraphComponent() {
    controller = new DefaultController(new DefaultGraphModel());

    this.setLayout(new BorderLayout());

    this.add(scrollPane = new JScrollPane(controller.getGraphView()));
View Full Code Here

    frame2.setSize(1024, 300);

    frame2.setLocation(0, 320);

    model = new DefaultGraphModel();


    controller1 = new DefaultController(model);

    controller2 = new DefaultController(model);
View Full Code Here

  {
    Random rand = new Random();

    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);
      }
    }

    return mod;
  }
View Full Code Here

TOP

Related Classes of uk.ac.man.cs.mig.util.graph.model.impl.DefaultGraphModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.