Package org.jgraph.graph

Examples of org.jgraph.graph.DefaultPort


      return cell;
    }
   
    private DefaultPort createPort(float relX, float relY)
    {
      DefaultPort port = new DefaultPort();
      GraphConstants.setOffset(port.getAttributes(), new Point2D.Float(
        relX, relY));
     
      return port;
    }
View Full Code Here


        } else {
          currentCell++;
        }

        DefaultGraphCell graphcell = new DefaultGraphCell(graphmethod);
        graphcell.add(new DefaultPort("port/Center"));
        graphcell.add(new DefaultPort("port/Left"));
        Color color = null;
        switch (currentCell) {
          case 0 :
            color = Color.red;
            break;
View Full Code Here

        } else {
          currentCell++;
        }

        DefaultGraphCell graphcell = new DefaultGraphCell(graphmethod);
        graphcell.add(new DefaultPort("port/Center"));
        graphcell.add(new DefaultPort("port/Left"));
        Color color = null;
        switch (currentCell) {
          case 0 :
            color = Color.red;
            break;
View Full Code Here

   * Returns the sourceId.
   *
   * @return Object
   */
  public String getSourceId() {
    DefaultPort port = ((DefaultPort) getSource());
    AbstractPetriNetElementModel pnme = ((AbstractPetriNetElementModel) port.getParent());
    return pnme.getId();
  }
View Full Code Here

            allowConnection = ((AbstractPetriNetElementModel) element).getAllowOutgoingConnections();
          }
         
          // Check if connection is between valid nodes
          if (allowConnection) {
            DefaultPort source = (DefaultPort) firstPort.getCell();
            CreationMap map = CreationMap.createMap();
            if (source.getParent() instanceof TransitionModel) {
              map.setType(AbstractPetriNetElementModel.PLACE_TYPE);
              map.setId(getEditor().getModelProcessor().getNewElementId(map.getType()));
              maps[0] = map;
            }
            else {
              if (source.getParent() instanceof PlaceModel) {
                map.setType(AbstractPetriNetElementModel.TRANS_SIMPLE_TYPE);
                map.setId(getEditor().getModelProcessor().getNewElementId(map.getType()));
                maps[0] = map;
              }
            }
View Full Code Here

  // Hook for subclassers
  protected DefaultGraphCell createDefaultGraphCell() {
    DefaultGraphCell cell =
      new DefaultGraphCell("Cell " + new Integer(cellCount++));
    // Add one Floating Port
    cell.add(new DefaultPort());
    return cell;
  }
View Full Code Here

    else
      // Set black border
      GraphConstants.setBorderColor(cell.getAttributes(), Color.black);

    // Add a Port
    DefaultPort port = new DefaultPort();
    cell.add(port);

    return cell;
  }
View Full Code Here

    //
    // 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));
View Full Code Here

TOP

Related Classes of org.jgraph.graph.DefaultPort

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.