Package com.mxgraph.model

Examples of com.mxgraph.model.mxCell


      Object parent, mxGraph graph)
  {
    Object[] edges = graph.getChildEdges(parent);
    for (Object edge : edges)
    {
      mxCell e = (mxCell) edge;
      mxCell source = (mxCell) e.getSource();
      mxCell target = (mxCell) e.getTarget();

      String sourceName = "";
      String targetName = "";
      String sourcePort = "";
      String targetPort = "";
      sourceName = source != null ? source.getId() : "";
      targetName = target != null ? target.getId() : "";

      //Get the graph view that contains the states
      mxGraphView view = graph.getView();
      mxPoint sourceConstraint = null;
      mxPoint targetConstraint = null;
View Full Code Here


   * @param cells
   * @return Returns a new group cell.
   */
  public Object createGroupCell(Object[] cells)
  {
    mxCell group = new mxCell("", new mxGeometry(), null);
    group.setVertex(true);
    group.setConnectable(false);

    return group;
  }
View Full Code Here

   */
  public Object createVertex(Object parent, String id, Object value,
      double x, double y, double width, double height, String style)
  {
    mxGeometry geometry = new mxGeometry(x, y, width, height);
    mxCell vertex = new mxCell(value, geometry, style);

    vertex.setId(id);
    vertex.setVertex(true);
    vertex.setConnectable(true);

    return vertex;
  }
View Full Code Here

   * @return Returns the new edge to be inserted.
   */
  public Object createEdge(Object parent, String id, Object value,
      Object source, Object target, String style)
  {
    mxCell edge = new mxCell(value, new mxGeometry(), style);

    edge.setId(id);
    edge.setEdge(true);
    edge.getGeometry().setRelative(true);

    return edge;
  }
View Full Code Here

    //Set the node name as ID.
    String id = node.getName();

    //Insert a new vertex in the graph
    mxCell v1 = (mxCell) graph.insertVertex(parent, id, label,
        cordenates.getX(), cordenates.getY(), dimentions.getX(),
        dimentions.getY());

    cellsMap.put(node.getName(), v1);
View Full Code Here

    //Defines style of the edge.
    String style = getEdgeStyle();

    //Insert new edge and set constraints.
    mxCell e = (mxCell) graph.insertEdge(parent, null, "", source, target,
        style);

    return e;
  }
View Full Code Here

    for (Object vertex : vertexes)
    {
      List<mxGdNode> GDnodes = document.getNodes();

      mxCell v = (mxCell) vertex;
      mxGeometry geom = v.getGeometry();

      String id = v.getId();

      mxPoint coord = new mxPoint(parentCoord.getX() + geom.getCenterX(),
          parentCoord.getY() + geom.getCenterY());
      mxPoint dim = new mxPoint(geom.getWidth(), geom.getHeight());
View Full Code Here

      Object parent, mxGraph graph)
  {
    Object[] edges = graph.getChildEdges(parent);
    for (Object edge : edges)
    {
      mxCell e = (mxCell) edge;
      mxCell source = (mxCell) e.getSource();
      mxCell target = (mxCell) e.getTarget();

      String sourceName = "";
      String targetName = "";

      sourceName = source.getId();

      targetName = target.getId();

      mxGdEdge GDedge = new mxGdEdge(sourceName, targetName);

      GDedges.add(GDedge);
    }
View Full Code Here

   * @param node Gml Node
   * @return The inserted Vertex cell.
   */
  private mxCell addNode(mxGraph graph, Object parent, mxGmlNode node)
  {
    mxCell v1;
    String id = node.getNodeId();

    mxGmlData data = dataNodeKey(node);

    if (data != null && data.getDataShapeNode() != null)
View Full Code Here

    {
      style = edge.getEdgeStyle();
    }

    //Insert new edge.
    mxCell e = (mxCell) graph.insertEdge(parent, null, label, source,
        target, style);
    graph.setConnectionConstraint(e, source, true,
        new mxConnectionConstraint(fromConstraint, false));
    graph.setConnectionConstraint(e, target, false,
        new mxConnectionConstraint(toConstraint, false));
View Full Code Here

TOP

Related Classes of com.mxgraph.model.mxCell

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.