Package com.mxgraph.view

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


      mxCellState state = marker.process(e);

      if (connectPreview.isActive())
      {
        mxGraph graph = graphComponent.getGraph();
        double x = graph.snap(e.getX());
        double y = graph.snap(e.getY());

        connectPreview.update(e, marker.getValidState(), x, y);
        setBounds(null);
        e.consume();
View Full Code Here


      if (connectPreview.isActive())
      {
        mxGraph graph = graphComponent.getGraph();
        double x = graph.snap(e.getX());
        double y = graph.snap(e.getY());

        connectPreview.update(e, marker.getValidState(), x, y);
        setBounds(null);
        e.consume();
      }
View Full Code Here

              }

              graph.addCells(new Object[] { vertex }, dropTarget);
            }

            double x = graph.snap(e.getX());
            double y = graph.snap(e.getY());

            // FIXME: Here we pre-create the state for the vertex to be
            // inserted in order to invoke update in the connectPreview.
            // This means we have a cell state which should be created
View Full Code Here

              graph.addCells(new Object[] { vertex }, dropTarget);
            }

            double x = graph.snap(e.getX());
            double y = graph.snap(e.getY());

            // FIXME: Here we pre-create the state for the vertex to be
            // inserted in order to invoke update in the connectPreview.
            // This means we have a cell state which should be created
            // after the model.update, so this should be fixed.
View Full Code Here

        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

        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

          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

        }

        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

        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

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