Examples of mxICell


Examples of com.mxgraph.model.mxICell

   * parent and terminals, respectively.
   * @return Graph cell that represents the given node.
   */
  public mxICell decodeCell(Node node, boolean restoreStructures)
  {
    mxICell cell = null;

    if (node != null && node.getNodeType() == Node.ELEMENT_NODE)
    {
      // Tries to find a codec for the given node name. If that does
      // not return a codec then the node is the user object (an XML node
View Full Code Here

Examples of com.mxgraph.model.mxICell

  /**
   * Inserts the given cell into its parent and terminal cells.
   */
  public void insertIntoGraph(mxICell cell)
  {
    mxICell parent = cell.getParent();
    mxICell source = cell.getTerminal(true);
    mxICell target = cell.getTerminal(false);

    // Fixes possible inconsistencies during insert into graph
    cell.setTerminal(null, false);
    cell.setTerminal(null, true);
    cell.setParent(null);
   
    if (parent != null)
    {
      parent.insert(cell);
    }

    if (source != null)
    {
      source.insertEdge(cell, true);
    }

    if (target != null)
    {
      target.insertEdge(cell, false);
    }
  }
View Full Code Here

Examples of com.mxgraph.model.mxICell

   * Creates a new instance of mxShape for previewing the edge.
   */
  protected Object createCell(mxCellState startState, String style)
  {
    mxGraph graph = graphComponent.getGraph();
    mxICell cell = ((mxICell) graph
        .createEdge(null, null, "",
            (startState != null) ? startState.getCell() : null,
            null, style));
    ((mxICell) startState.getCell()).insertEdge(cell, true);

View Full Code Here

Examples of com.mxgraph.model.mxICell

   *
   */
  public void update(MouseEvent e, mxCellState targetState, double x, double y)
  {
    mxGraph graph = graphComponent.getGraph();
    mxICell cell = (mxICell) previewState.getCell();

    mxRectangle dirty = graphComponent.getGraph().getPaintBounds(
        new Object[] { previewState.getCell() });

    if (cell.getTerminal(false) != null)
    {
      cell.getTerminal(false).removeEdge(cell, false);
    }

    if (targetState != null)
    {
      ((mxICell) targetState.getCell()).insertEdge(cell, false);
View Full Code Here

Examples of com.mxgraph.model.mxICell

      mxGraph graph = graphComponent.getGraph();

      graph.getModel().beginUpdate();
      try
      {
        mxICell cell = (mxICell) previewState.getCell();
        Object src = cell.getTerminal(true);
        Object trg = cell.getTerminal(false);

        if (src != null)
        {
          ((mxICell) src).removeEdge(cell, true);
        }
View Full Code Here

Examples of com.mxgraph.model.mxICell

   * parent and terminals, respectively.
   * @return Graph cell that represents the given node.
   */
  public mxICell decodeCell(Node node, boolean restoreStructures)
  {
    mxICell cell = null;

    if (node != null && node.getNodeType() == Node.ELEMENT_NODE)
    {
      // Tries to find a codec for the given node name. If that does
      // not return a codec then the node is the user object (an XML node
View Full Code Here

Examples of com.mxgraph.model.mxICell

  /**
   * Inserts the given cell into its parent and terminal cells.
   */
  public void insertIntoGraph(mxICell cell)
  {
    mxICell parent = cell.getParent();
    mxICell source = cell.getTerminal(true);
    mxICell target = cell.getTerminal(false);

    // Fixes possible inconsistencies during insert into graph
    cell.setTerminal(null, false);
    cell.setTerminal(null, true);
    cell.setParent(null);
   
    if (parent != null)
    {
      parent.insert(cell);
    }

    if (source != null)
    {
      source.insertEdge(cell, true);
    }

    if (target != null)
    {
      target.insertEdge(cell, false);
    }
  }
View Full Code Here

Examples of com.mxgraph.model.mxICell

      }

      // Reads the cells into the graph model. All cells
      // are children of the root element in the node.
      Node root = elt.getElementsByTagName("root").item(0);
      mxICell rootCell = null;

      if (root != null)
      {
        Node tmp = root.getFirstChild();

        while (tmp != null)
        {
          mxICell cell = dec.decodeCell(tmp, true);

          if (cell != null && cell.getParent() == null)
          {
            rootCell = cell;
          }

          tmp = tmp.getNextSibling();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.