Package org.jgraph

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


          } 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

                          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

                      }

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

            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

          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

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

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

            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

          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

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.