Examples of snap()


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()

    mxGeometry geo = model.getGeometry(clone);

    if (geo != null)
    {
      mxPoint point = graphComponent.getPointForEvent(e);
      geo.setX(graph.snap(point.getX() - geo.getWidth() / 2));
      geo.setY(graph.snap(point.getY() - geo.getHeight() / 2));
    }

    return clone;
  }
View Full Code Here

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

    if (geo != null)
    {
      mxPoint point = graphComponent.getPointForEvent(e);
      geo.setX(graph.snap(point.getX() - geo.getWidth() / 2));
      geo.setY(graph.snap(point.getY() - geo.getHeight() / 2));
    }

    return clone;
  }
View Full Code Here

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

        mxGraph graph = graphComponent.getGraph();
        double scale = graph.getView().getScale();

        if (gridEnabledEvent)
        {
          dx = graph.snap(dx / scale) * scale;
          dy = graph.snap(dy / scale) * scale;
        }

        mxRectangle bounds = union(getState(), dx, dy, index);
        bounds.setWidth(bounds.getWidth() + 1);
View Full Code Here

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

        double scale = graph.getView().getScale();

        if (gridEnabledEvent)
        {
          dx = graph.snap(dx / scale) * scale;
          dy = graph.snap(dy / scale) * scale;
        }

        mxRectangle bounds = union(getState(), dx, dy, index);
        bounds.setWidth(bounds.getWidth() + 1);
        bounds.setHeight(bounds.getHeight() + 1);
View Full Code Here

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

          dy += geometry.getOffset().getY();
        }

        if (gridEnabledEvent)
        {
          dx = graph.snap(dx);
          dy = graph.snap(dy);
        }

        geometry.setOffset(new mxPoint(dx, dy));
        graph.getModel().setGeometry(cell, geometry);
View Full Code Here

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

        }

        if (gridEnabledEvent)
        {
          dx = graph.snap(dx);
          dy = graph.snap(dy);
        }

        geometry.setOffset(new mxPoint(dx, dy));
        graph.getModel().setGeometry(cell, geometry);
      }
View Full Code Here

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

        Rectangle rect = bounds.getRectangle();

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

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