Package org.jgraph.graph

Examples of org.jgraph.graph.DefaultGraphCell


    }
  }

  // Hook for subclassers
  protected DefaultGraphCell createGroupCell() {
    return new DefaultGraphCell();
  }
View Full Code Here


        .deriveFont(10));
    //
    // The Swing MVC Pattern
    //
    // Model Column
    DefaultGraphCell gm = new DefaultGraphCell("GraphModel");
    attributes.put(gm,
        createBounds(new AttributeMap(), 20, 100, Color.blue));
    gm.add(new DefaultPort("GraphModel/Center"));
    DefaultGraphCell dgm = new DefaultGraphCell("DefaultGraphModel");
    attributes.put(dgm, createBounds(new AttributeMap(), 20, 180,
        Color.blue));
    dgm.add(new DefaultPort("DefaultGraphModel/Center"));
    DefaultEdge dgmImplementsGm = new DefaultEdge("implements");
    cs.connect(dgmImplementsGm, gm.getChildAt(0), dgm.getChildAt(0));
    attributes.put(dgmImplementsGm, implementStyle);
    DefaultGraphCell modelGroup = new DefaultGraphCell("ModelGroup");
    modelGroup.add(gm);
    modelGroup.add(dgm);
    modelGroup.add(dgmImplementsGm);
    // JComponent Column
    DefaultGraphCell jc = new DefaultGraphCell("JComponent");
    attributes.put(jc, createBounds(new AttributeMap(), 180, 20,
        Color.green));
    jc.add(new DefaultPort("JComponent/Center"));
    DefaultGraphCell jg = new DefaultGraphCell("JGraph");
    attributes.put(jg, createBounds(new AttributeMap(), 180, 100,
        Color.green));
    jg.add(new DefaultPort("JGraph/Center"));
    DefaultEdge jgExtendsJc = new DefaultEdge("extends");
    cs.connect(jgExtendsJc, jc.getChildAt(0), jg.getChildAt(0));
    attributes.put(jgExtendsJc, extendStyle);
    // UI Column
    DefaultGraphCell cu = new DefaultGraphCell("ComponentUI");
    attributes
        .put(cu, createBounds(new AttributeMap(), 340, 20, Color.red));
    cu.add(new DefaultPort("ComponentUI/Center"));
    DefaultGraphCell gu = new DefaultGraphCell("GraphUI");
    attributes.put(gu,
        createBounds(new AttributeMap(), 340, 100, Color.red));
    gu.add(new DefaultPort("GraphUI/Center"));
    DefaultGraphCell dgu = new DefaultGraphCell("BasicGraphUI");
    attributes.put(dgu, createBounds(new AttributeMap(), 340, 180,
        Color.red));
    dgu.add(new DefaultPort("BasicGraphUI/Center"));
    DefaultEdge guExtendsCu = new DefaultEdge("extends");
    cs.connect(guExtendsCu, cu.getChildAt(0), gu.getChildAt(0));
    attributes.put(guExtendsCu, extendStyle);
    DefaultEdge dguImplementsDu = new DefaultEdge("implements");
    cs.connect(dguImplementsDu, gu.getChildAt(0), dgu.getChildAt(0));
    attributes.put(dguImplementsDu, implementStyle);
    DefaultGraphCell uiGroup = new DefaultGraphCell("UIGroup");
    uiGroup.add(cu);
    uiGroup.add(gu);
    uiGroup.add(dgu);
    uiGroup.add(dguImplementsDu);
    uiGroup.add(guExtendsCu);
    // Aggregations
    DefaultEdge jgAggregatesGm = new DefaultEdge("model");
    cs.connect(jgAggregatesGm, jg.getChildAt(0), gm.getChildAt(0));
    attributes.put(jgAggregatesGm, aggregateStyle);
    DefaultEdge jcAggregatesCu = new DefaultEdge("ui");
View Full Code Here

TOP

Related Classes of org.jgraph.graph.DefaultGraphCell

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.