Package com.mxgraph.view

Examples of com.mxgraph.view.mxGraph.snap()


        // Snaps new bounds to grid (unscaled)
        if (gridEnabledEvent)
        {
          int x = (int) graph.snap(rect.x);
          int y = (int) graph.snap(rect.y);
          rect.width = (int) graph.snap(rect.width - x + rect.x);
          rect.height = (int) graph.snap(rect.height - y + rect.y);
          rect.x = x;
          rect.y = y;
        }
View Full Code Here


        if (gridEnabledEvent)
        {
          int x = (int) graph.snap(rect.x);
          int y = (int) graph.snap(rect.y);
          rect.width = (int) graph.snap(rect.width - x + rect.x);
          rect.height = (int) graph.snap(rect.height - y + rect.y);
          rect.x = x;
          rect.y = y;
        }

        graph.resizeCell(cell, new mxRectangle(rect));
View Full Code Here

    double x = point.getX() / scale - trans.getX();
    double y = point.getY() / scale - trans.getY();

    if (gridEnabled)
    {
      x = graph.snap(x);
      y = graph.snap(y);
    }

    point.setX(x - state.getOrigin().getX());
    point.setY(y - state.getOrigin().getY());
View Full Code Here

    double y = point.getY() / scale - trans.getY();

    if (gridEnabled)
    {
      x = graph.snap(x);
      y = graph.snap(y);
    }

    point.setX(x - state.getOrigin().getX());
    point.setY(y - state.getOrigin().getY());
View Full Code Here

          dy -= Math.round(transferBounds.getHeight() * scale / 2);
        }

        // Sets the drop offset so that the location in the transfer
        // handler reflects the actual mouse position
        handler.setOffset(new Point((int) graph.snap(dx / scale),
            (int) graph.snap(dy / scale)));
        pt.translate(dx, dy);

        // Shifts the preview so that overlapping parts do not
        // affect the centering
View Full Code Here

        }

        // Sets the drop offset so that the location in the transfer
        // handler reflects the actual mouse position
        handler.setOffset(new Point((int) graph.snap(dx / scale),
            (int) graph.snap(dy / scale)));
        pt.translate(dx, dy);

        // Shifts the preview so that overlapping parts do not
        // affect the centering
        if (transferBounds != null && dragImage != null)
View Full Code Here

          if (graphComponent.isGridEnabledEvent(e))
          {
            mxGraph graph = graphComponent.getGraph();

            dx = graph.snap(dx);
            dy = graph.snap(dy);
          }

          boolean clone = isCloneEnabled()
              && graphComponent.isCloneEvent(e);
View Full Code Here

          if (graphComponent.isGridEnabledEvent(e))
          {
            mxGraph graph = graphComponent.getGraph();

            dx = graph.snap(dx);
            dy = graph.snap(dy);
          }

          boolean clone = isCloneEnabled()
              && graphComponent.isCloneEvent(e);
          movePreview.update(e, dx, dy, clone);
View Full Code Here

      double dxg = ((cellBounds.getX() + dx) / scale) - trans.getX();
      double dyg = ((cellBounds.getY() + dy) / scale) - trans.getY();

      if (gridEnabled)
      {
        dxg = graph.snap(dxg);
        dyg = graph.snap(dyg);
      }

      x = (int) Math.round((dxg + trans.getX()) * scale)
          + (int) Math.round(bbox.getX())
View Full Code Here

      double dyg = ((cellBounds.getY() + dy) / scale) - trans.getY();

      if (gridEnabled)
      {
        dxg = graph.snap(dxg);
        dyg = graph.snap(dyg);
      }

      x = (int) Math.round((dxg + trans.getX()) * scale)
          + (int) Math.round(bbox.getX())
          - (int) Math.round(cellBounds.getX());
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.