Package org.jgraph.graph

Examples of org.jgraph.graph.DefaultGraphCell


      }
    }

    Vector duplicatedNameVector = new Vector();
    for (int i = 0; i < cellVector.size(); i++) {
      DefaultGraphCell defaultGraphCell = (DefaultGraphCell) cellVector.get(i);
      Hashtable userObjectHashtable = null;
      Object userObject = graphpadGraphModel.getValue(defaultGraphCell);
      if (userObject instanceof JGraphpadBusinessObject) {
        JGraphpadBusinessObject graphpadBusinessObject = (JGraphpadBusinessObject) userObject;
        userObjectHashtable = (Hashtable) graphpadBusinessObject.getProperties();
      } else
        continue;

      Vector incomingCellVector = new Vector();
      Object[] incomingEdges =
        JGraphpadGraphModel.getIncomingEdges(graphpadGraphModel, defaultGraphCell);
      for (int index = 0; index < incomingEdges.length; index++) {
        DefaultEdge edge = (DefaultEdge) incomingEdges[index];
        Object vertex = graphpadGraphModel.getSourceVertex(graphpadGraphModel, edge);
        if (CellType.isCellActionCell(vertex)) {
          DefaultGraphCell cell = (DefaultGraphCell) vertex;
          JGraphpadBusinessObject businessObject =
            (JGraphpadBusinessObject) graphpadGraphModel.getValue(cell);
          Hashtable businessProperties = (Hashtable) businessObject.getProperties();
          incomingCellVector.add(businessProperties);
        } else
View Full Code Here


  }

  Vector getEndCellVector() {
    Vector vector = new Vector();
    for (int i = 0; i < cellVector.size(); i++) {
      DefaultGraphCell defaultGraphCell = (DefaultGraphCell) cellVector.get(i);
      Object[] outgoingEdges =      
        JGraphpadGraphModel.getOutgoingEdges(graphpadGraphModel, defaultGraphCell);
      if (outgoingEdges.length == 0)
        vector.add(defaultGraphCell);
    }
View Full Code Here

  Vector getOrphanCellVector() {
    Vector vector = new Vector();

    for (int i = 0; i < cellVector.size(); i++) {
      DefaultGraphCell defaultGraphCell = (DefaultGraphCell) cellVector.get(i);
      if (CellType.isCellActionCell(defaultGraphCell) == false)
        continue;

      Object[] incomingEdges =
        JGraphpadGraphModel.getIncomingEdges(graphpadGraphModel, defaultGraphCell);
View Full Code Here

    textTool = (JGraphpadVertexTool)
      graphEditorKit.getTool(JGraphpad.NAME_TEXTTOOL)
    vertexTool = (JGraphpadVertexTool)
      graphEditorKit.getTool(JGraphpad.NAME_VERTEXTOOL)

    DefaultGraphCell defaultGraphCell = (DefaultGraphCell) vertexTool.getPrototype();
    AttributeMap vertexAttributes = defaultGraphCell.getAttributes();
    vertexAttributes.put(CellType.CELL_TYPE_KEY, CellType.CELL_TYPE_ACTION);

    LoadFile loadFile = new LoadFile();
    ImageIcon rectangleIcon = loadFile.receiveImageIcon("rectangleCursor.gif");
    ImageIcon edgeIcon = loadFile.receiveImageIcon("edgeCursor.gif");
View Full Code Here

   * @param userObj
   *            The user object that the vertex should contain.
   * @return Returns a new vertex.
   */
  public GraphCell createVertex(Object userObj) {
    DefaultGraphCell vertex = new DefaultGraphCell(userObj,
        createAttributeMap());
    configureVertex(vertex);
    return vertex;
  }
View Full Code Here

   * @param userObj
   *            The user object that the group should contain.
   * @return Returns a new group.
   */
  public GraphCell createGroup(Object userObj) {
    DefaultGraphCell vertex = new DefaultGraphCell(userObj,
        createAttributeMap());
    configureVertex(vertex);
    return vertex;
  }
View Full Code Here

   * @param userObject
   *            The user object that the port should contain.
   * @return Returns a new port.
   */
  public GraphCell createPort(MutableTreeNode parent, Object userObject) {
    DefaultGraphCell port = new DefaultPort(userObject);
    parent.insert(port, parent.getChildCount());
    port.setParent(parent);
    return port;
  }
View Full Code Here

  public static DefaultGraphCell createVertex(String name, double x,
      double y, double w, double h, Color bg, boolean raised) {

    // Create vertex with the given name
    DefaultGraphCell cell = new DefaultGraphCell(name);

    // Set bounds
    GraphConstants.setBounds(cell.getAttributes(), new Rectangle2D.Double(
        x, y, w, h));

    // Set fill color
    if (bg != null) {
      GraphConstants.setGradientColor(cell.getAttributes(), Color.orange);
      GraphConstants.setOpaque(cell.getAttributes(), true);
    }

    // Set raised border
    if (raised)
      GraphConstants.setBorder(cell.getAttributes(), BorderFactory
          .createRaisedBevelBorder());
    else
      // Set black border
      GraphConstants.setBorderColor(cell.getAttributes(), Color.black);

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

    return cell;
  }
View Full Code Here

  }

  // Insert a new Vertex at point
  public void insert(Point2D point) {
    // Construct Vertex with no Label
    DefaultGraphCell vertex = createDefaultGraphCell();
    // Create a Map that holds the attributes for the Vertex
    vertex.getAttributes().applyMap(createCellAttributes(point));
    // Insert the Vertex (including child port and attributes)
    graph.getGraphLayoutCache().insert(vertex);
  }
View Full Code Here

    return map;
  }

  // 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

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.