Package org.jgraph.graph

Examples of org.jgraph.graph.DefaultGraphCell


    }

    @Override
    protected Object unhandled_node(SimpleNode node) throws Exception {
        DefaultGraphCell cell = null;
        String caption = node.toString();

        parentAddPort();

        cell = createVertex(caption, indent, depth, nodeColor, false);
View Full Code Here


     * Entry point
     */
    @Override
    public Object visitModule(Module node) throws Exception {
        // String caption = node.toString();
        DefaultGraphCell moduleCell = createVertex("Module", indent, depth, nodeColor, false);
        cells.add(moduleCell);

        incrementPosition(moduleCell);
        traverse(node);

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

  public void group(Object[] cells) {
    // Order Cells by Model Layering
    cells = graph.order(cells);
    // If Any Cells in View
    if (cells != null && cells.length > 0) {
      DefaultGraphCell group = createGroupCell();
      // Insert into model
      graph.getGraphLayoutCache().insertGroup(group, cells);
    }
  }
View Full Code Here

    }
  }

  // Hook for subclassers
  protected DefaultGraphCell createGroupCell() {
    return new DefaultGraphCell();
  }
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);

    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.addPort();
    return cell;
  }
View Full Code Here

  public void group(Object[] cells) {
    // Order Cells by Model Layering
    cells = graph.order(cells);
    // If Any Cells in View
    if (cells != null && cells.length > 0) {
      DefaultGraphCell group = createGroupCell();
      // Insert into model
      graph.getGraphLayoutCache().insertGroup(group, cells);
    }
  }
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.