changeset 7749:cc1bac897ccb

[SCENEBUILDER] Going on fixing DTL-6783: Rationalize job implementation between Hierarchy and Content Panels => Add Eric?s feedback on the new architecture
author slions
date Thu, 21 Aug 2014 11:53:17 +0200
parents 81336c8544a5
children 59e71e06a1c6
files apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/BatchDocumentJob.java apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/BatchSelectionJob.java apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/CompositeJob2.java apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/FitToParentSelectionJob.java apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/InlineDocumentJob.java apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/UseComputedSizesSelectionJob.java
diffstat 6 files changed, 19 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/BatchDocumentJob.java	Thu Aug 21 11:31:26 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/BatchDocumentJob.java	Thu Aug 21 11:53:17 2014 +0200
@@ -44,6 +44,8 @@
  */
 public abstract class BatchDocumentJob extends CompositeJob2 {
 
+    private List<Job> subJobs;
+
     public BatchDocumentJob(EditorController editorController) {
         super(editorController);
     }
@@ -51,9 +53,8 @@
     @Override
     public final List<Job> getSubJobs() {
         if (subJobs == null) {
-            subJobs = makeSubJobs();
+            subJobs = Collections.unmodifiableList(makeSubJobs());
             assert subJobs != null;
-            subJobs = Collections.unmodifiableList(subJobs);
         }
         return subJobs;
     }
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/BatchSelectionJob.java	Thu Aug 21 11:31:26 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/BatchSelectionJob.java	Thu Aug 21 11:53:17 2014 +0200
@@ -45,13 +45,20 @@
  */
 public abstract class BatchSelectionJob extends CompositeJob2 {
 
-    protected AbstractSelectionGroup oldSelectionGroup;
-    protected AbstractSelectionGroup newSelectionGroup;
+    private List<Job> subJobs;
+    private AbstractSelectionGroup oldSelectionGroup;
+    private AbstractSelectionGroup newSelectionGroup;
 
     public BatchSelectionJob(EditorController editorController) {
         super(editorController);
     }
 
+    protected final AbstractSelectionGroup getOldSelectionGroup() {
+        return oldSelectionGroup;
+    }
+    
+    protected abstract AbstractSelectionGroup getNewSelectionGroup();
+
     @Override
     public final List<Job> getSubJobs() {
         if (subJobs == null) {
@@ -119,7 +126,4 @@
     }
 
     protected abstract List<Job> makeSubJobs();
-
-    protected abstract AbstractSelectionGroup getNewSelectionGroup();
-
 }
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/CompositeJob2.java	Thu Aug 21 11:31:26 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/CompositeJob2.java	Thu Aug 21 11:53:17 2014 +0200
@@ -39,8 +39,7 @@
  */
 public abstract class CompositeJob2 extends Job {
 
-    protected List<Job> subJobs;
-    protected String description;
+    private String description;
 
     public CompositeJob2(EditorController editorController) {
         super(editorController);
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/FitToParentSelectionJob.java	Thu Aug 21 11:31:26 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/FitToParentSelectionJob.java	Thu Aug 21 11:53:17 2014 +0200
@@ -109,7 +109,7 @@
     @Override
     protected AbstractSelectionGroup getNewSelectionGroup() {
         // Selection unchanged
-        return oldSelectionGroup;
+        return getOldSelectionGroup();
     }
 
     private String makeMultipleSelectionDescription() {
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/InlineDocumentJob.java	Thu Aug 21 11:31:26 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/InlineDocumentJob.java	Thu Aug 21 11:53:17 2014 +0200
@@ -44,13 +44,15 @@
  */
 public abstract class InlineDocumentJob extends CompositeJob2 {
 
+    private List<Job> subJobs;
+
     public InlineDocumentJob(EditorController editorController) {
         super(editorController);
     }
 
     @Override
     public final List<Job> getSubJobs() {
-        return Collections.unmodifiableList(subJobs);
+        return subJobs;
     }
 
     @Override
@@ -58,7 +60,7 @@
         final FXOMDocument fxomDocument
                 = getEditorController().getFxomDocument();
         fxomDocument.beginUpdate();
-        subJobs = makeAndExecuteSubJobs();
+        subJobs = Collections.unmodifiableList(makeAndExecuteSubJobs());
         fxomDocument.endUpdate();
     }
 
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/UseComputedSizesSelectionJob.java	Thu Aug 21 11:31:26 2014 +0200
+++ b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/job/UseComputedSizesSelectionJob.java	Thu Aug 21 11:53:17 2014 +0200
@@ -123,7 +123,7 @@
     @Override
     protected AbstractSelectionGroup getNewSelectionGroup() {
         // Selection unchanged
-        return oldSelectionGroup;
+        return getOldSelectionGroup();
     }
 
     private String makeMultipleSelectionDescription() {