Examples of snap()


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

  {
    mxGraph graph = graphComponent.getGraph();
    mxPoint tr = graph.getView().getTranslate();
    double scale = graph.getView().getScale();

    return new mxPoint(graph.snap(x / scale - tr.getX()), graph.snap(y / scale - tr.getY()));
  }

  /**
   *
   */
 
View Full Code Here

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

  {
    mxGraph graph = graphComponent.getGraph();
    mxPoint tr = graph.getView().getTranslate();
    double scale = graph.getView().getScale();

    return new mxPoint(graph.snap(x / scale - tr.getX()), graph.snap(y / scale - tr.getY()));
  }

  /**
   *
   */
 
View Full Code Here

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

          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

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

        }

        // 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

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

          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

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

          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

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

      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

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

      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

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

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

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

          double x = ((dxg + trans.getX()) * scale) + (bbox.getX())
              - (cellBounds.getX());
View Full Code Here

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

              - trans.getY();

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

          double x = ((dxg + trans.getX()) * scale) + (bbox.getX())
              - (cellBounds.getX());
          double y = ((dyg + trans.getY()) * scale) + (bbox.getY())
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.