changeset 7918:8a83d139c837

[SCENEBUILDER] Fix for DTL-6846 (Dropping an object between two GridPane rows does not reorganize the grid content correctly).
author eric.le.ponner@oracle.com
date Fri, 29 Aug 2014 16:03:17 +0200
parents c157e2f9a534
children 4d31c9c55102
files apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/gridpane/v2/InsertColumnJob.java apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/gridpane/v2/InsertRowJob.java
diffstat 2 files changed, 16 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/gridpane/v2/InsertColumnJob.java	Fri Aug 29 15:54:49 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/gridpane/v2/InsertColumnJob.java	Fri Aug 29 16:03:17 2014 +0200
@@ -88,11 +88,14 @@
                 = new InsertColumnConstraintsJob(gridPaneObject, columnIndex, insertCount, getEditorController());
         result.add(insertJob);
         
-        final Job moveJob
-                = new MoveColumnContentJob(gridPaneObject, columnIndex, +insertCount, getEditorController());
-        if (moveJob.isExecutable()) {
-            result.add(moveJob);
-        } // else column is empty : no children to move
+        final int lastColumnIndex = columnContraintsMeta.getValue(gridPaneObject).size()-1;
+        for (int c = lastColumnIndex; c >= columnIndex; c--) {
+            final Job moveJob
+                    = new MoveColumnContentJob(gridPaneObject, c, +insertCount, getEditorController());
+            if (moveJob.isExecutable()) {
+                result.add(moveJob);
+            } // else column is empty : no children to move
+        }
         
         return result;
     }
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/gridpane/v2/InsertRowJob.java	Fri Aug 29 15:54:49 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/gridpane/v2/InsertRowJob.java	Fri Aug 29 16:03:17 2014 +0200
@@ -88,11 +88,14 @@
                 = new InsertRowConstraintsJob(gridPaneObject, rowIndex, insertCount, getEditorController());
         result.add(insertJob);
         
-        final Job moveJob
-                = new MoveRowContentJob(gridPaneObject, rowIndex, +insertCount, getEditorController());
-        if (moveJob.isExecutable()) {
-            result.add(moveJob);
-        } // else column is empty : no children to move
+        final int lastRowIndex = rowContraintsMeta.getValue(gridPaneObject).size()-1;
+        for (int r = lastRowIndex; r >= rowIndex; r--) {
+            final Job moveJob
+                    = new MoveRowContentJob(gridPaneObject, r, +insertCount, getEditorController());
+            if (moveJob.isExecutable()) {
+                result.add(moveJob);
+            } // else column is empty : no children to move
+        }
         
         return result;
     }