Package com.mxgraph.model

Examples of com.mxgraph.model.mxGeometry.clone()


              mxCellState pstate = view.getState(model
                  .getParent(cells[i]));

              if (state != null && pstate != null)
              {
                geo = (mxGeometry) geo.clone();

                double dx = -pstate.getOrigin().getX();
                double dy = -pstate.getOrigin().getY();

                Object src = model.getTerminal(cells[i], true);
View Full Code Here


    if (geometry != null)
    {
      model.beginUpdate();
      try
      {
        geometry = (mxGeometry) geometry.clone();

        if (isSource(index) || isTarget(index))
        {
          connect(edge, null, isSource(index), false);
          geometry.setTerminalPoint(point, isSource(index));
View Full Code Here

    mxIGraphModel model = graph.getModel();
    mxGeometry geometry = model.getGeometry(state.getCell());

    if (geometry != null)
    {
      geometry = (mxGeometry) geometry.clone();

      // Resets the relative location stored inside the geometry
      mxPoint pt = graph.getView().getRelativePoint(edgeState, x, y);
      geometry.setX(pt.getX());
      geometry.setY(pt.getY());
View Full Code Here

                      + 2 * x0;
                  double height = bounds.getHeight()
                      + size.getHeight() - bounds.getY()
                      + 2 * y0;

                  g = (mxGeometry) g.clone();

                  if (g.getWidth() > width)
                  {
                    dx += (g.getWidth() - width) / 2;
                  }
View Full Code Here

      }

      dx += offset.getX();
      dy += offset.getY();

      geometry = (mxGeometry) geometry.clone();
      geometry.setOffset(new mxPoint(Math.round(dx), Math.round(dy)));
      graph.getModel().setGeometry(state.getCell(), geometry);
    }
  }
View Full Code Here

      double dx = (e.getX() - first.x) / scale;
      double dy = (e.getY() - first.y) / scale;

      if (isLabel(index))
      {
        geometry = (mxGeometry) geometry.clone();

        if (geometry.getOffset() != null)
        {
          dx += geometry.getOffset().getX();
          dy += geometry.getOffset().getY();
View Full Code Here

        {
          mxGeometry geo = getCellGeometry(cells[i]);

          if (geo != null && !model.isEdge(cells[i]))
          {
            geo = (mxGeometry) geo.clone();

            if (align == null
                || align.equals(mxConstants.ALIGN_LEFT))
            {
              geo.setX(tmp);
View Full Code Here

                && childBounds.getHeight() > 0)
            {
              mxRectangle size = (isSwimlane(cells[i])) ? getStartSize(cells[i])
                  : new mxRectangle();

              geo = (mxGeometry) geo.clone();

              if (moveParent)
              {
                geo.setX(geo.getX() + childBounds.getX()
                    - size.getWidth() - border);
View Full Code Here

              if (geo != null)
              {
                double dx = o2.getX() - o1.getX();
                double dy = o2.getY() - o1.getY();

                geo = (mxGeometry) geo.clone();
                geo.translate(dx, dy);

                if (!geo.isRelative()
                    && model.isVertex(cells[i])
                    && !isAllowNegativeCoordinates())
View Full Code Here

              {
                mxCellState state = view.getState(edges[j]);

                if (state != null)
                {
                  geo = (mxGeometry) geo.clone();
                  boolean source = state
                      .getVisibleTerminal(true) == cells[i];
                  int n = (source) ? 0 : state
                      .getAbsolutePointCount() - 1;
                  mxPoint pt = state.getAbsolutePoint(n);
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.