Examples of snap()


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 org.jgraph.JGraph.snap()

            double dx = 0, dy = 0;

            // Cloned via Drag and Drop
            if (nested != null) {
              if (p != null && bounds != null) {
                Point2D insert = graph.fromScreen(graph
                    .snap((Point2D) p.clone()));
                dx = insert.getX() - bounds.getX();
                dy = insert.getY() - bounds.getY();

                // Cloned via Clipboard
View Full Code Here

Examples of org.jgraph.JGraph.snap()

          } else {

            // Moved via Drag and Drop
            if (p != null) {
              // Scale insertion location
              Point2D insert = graph.fromScreen(graph
                  .snap(new Point(p)));

              // Compute translation vector and translate all
              // attribute maps.
              if (bounds != null && nested != null) {
View Full Code Here

Examples of org.jgraph.JGraph.snap()

                          true);
                     
                      // Shift
                      p.setLocation(p.getX() + gs2, p.getY()
                          + gs2);
                      graph.snap(p);
                    // If parent processed then childs are already located
                    } else if (parent == null || !nested.keySet().contains(model.getParent(cells[i]))) {
                      CellView view = graph.getGraphLayoutCache().getMapping(cells[i], false);
                      if (view != null && !view.isLeaf()) {
                        double dx = p.getX() - tmp.getX();
View Full Code Here

Examples of org.jgraph.JGraph.snap()

                      }

                      // Shift
                      p.setLocation(p.getX() + gs2, p.getY()
                          + gs2);
                      graph.snap(p);
                    }
                    GraphConstants.setBounds(attrs, tmp);
                    nested.put(cells[i], attrs);
                  } else {
                    nested.put(cells[i], emptyMap);
View Full Code Here

Examples of org.jgraph.JGraph.snap()

            double dx = 0, dy = 0;

            // Cloned via Drag and Drop
            if (nested != null) {
              if (p != null && bounds != null) {
                Point2D insert = graph.fromScreen(graph
                    .snap((Point2D) p.clone()));
                dx = insert.getX() - bounds.getX();
                dy = insert.getY() - bounds.getY();

                // Cloned via Clipboard
View Full Code Here

Examples of org.jgraph.JGraph.snap()

          else {

            // Moved via Drag and Drop
            if (p != null) {
              // Scale insertion location
              Point2D insert = graph.fromScreen(graph
                  .snap(new Point(p)));

              // Compute translation vector and translate all
              // attribute maps.
              if (bounds != null && nested != null) {
View Full Code Here

Examples of org.jgraph.JGraph.snap()

                      // Shift
                      p.setLocation(p.getX() + gs2, p
                          .getY()
                          + gs2);
                      graph.snap(p);
                      // If parent processed then childs
                      // are already located
                    } else if (parent == null
                        || !nested
                            .keySet()
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.