Examples of snap()


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

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

        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

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

            * scale;
        dy = location.getY() - (bounds.getY() + translate.getY())
            * scale;

        // Keeps the cells aligned to the grid
        dx = graph.snap(dx / scale);
        dy = graph.snap(dy / scale);
      }
      else
      {
        int gs = graph.getGridSize();
View Full Code Here

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

        dy = location.getY() - (bounds.getY() + translate.getY())
            * scale;

        // Keeps the cells aligned to the grid
        dx = graph.snap(dx / scale);
        dy = graph.snap(dy / scale);
      }
      else
      {
        int gs = graph.getGridSize();

View Full Code Here

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

    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

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

    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

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