messageBox) {
- super("MessageBox[" + messageBox.getFolder() + "]"); //NOI18N
- this.messageBox = messageBox;
- }
-
- @Override
- public void run() {
-
- try {
- do {
- if (Files.exists(messageBox.messageFile)) {
- try {
- final byte[] messageBytes = Files.readAllBytes(messageBox.messageFile);
- final T message = messageBox.unserializeMessage(messageBytes);
- messageBox.delegate.messageBoxDidGetMessage(message);
- } catch(IOException x) {
- messageBox.delegate.messageBoxDidCatchException(x);
- } finally {
- try {
- Files.delete(messageBox.messageFile);
- } catch(IOException x) {
- messageBox.delegate.messageBoxDidCatchException(x);
- }
- }
- Thread.sleep(NAP_TIME);
- } else {
- Thread.sleep(messageBox.pollingTime);
- }
- } while (true);
-
- } catch(InterruptedException x) {
- }
- }
- }
-}
diff --git a/apps/scenebuilder/SceneBuilderKit/.classpath b/apps/scenebuilder/SceneBuilderKit/.classpath
deleted file mode 100644
index e4e061994b..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/apps/scenebuilder/SceneBuilderKit/.project b/apps/scenebuilder/SceneBuilderKit/.project
deleted file mode 100644
index 94f0517c5f..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- SceneBuilderKit
-
-
-
-
-
- org.eclipse.jdt.core.javabuilder
-
-
-
-
-
- org.eclipse.jdt.core.javanature
-
-
diff --git a/apps/scenebuilder/SceneBuilderKit/build.xml b/apps/scenebuilder/SceneBuilderKit/build.xml
deleted file mode 100644
index 929fcbde56..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/build.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
-
-
-
- Builds, tests, and runs the project SceneBuilderKit.
-
-
-
-
diff --git a/apps/scenebuilder/SceneBuilderKit/manifest.mf b/apps/scenebuilder/SceneBuilderKit/manifest.mf
deleted file mode 100644
index 328e8e5bc3..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/manifest.mf
+++ /dev/null
@@ -1,3 +0,0 @@
-Manifest-Version: 1.0
-X-COMMENT: Main-Class will be added automatically by build
-
diff --git a/apps/scenebuilder/SceneBuilderKit/nbproject/build-impl.xml b/apps/scenebuilder/SceneBuilderKit/nbproject/build-impl.xml
deleted file mode 100644
index 9580580df4..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/nbproject/build-impl.xml
+++ /dev/null
@@ -1,1431 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set platform.home
- Must set platform.bootcp
- Must set platform.java
- Must set platform.javac
-
- The J2SE Platform is not correctly set up.
- Your active platform is: ${platform.active}, but the corresponding property "platforms.${platform.active}.home" is not found in the project's properties files.
- Either open the project in the IDE and setup the Platform with the same name or add it manually.
- For example like this:
- ant -Duser.properties.file=<path_to_property_file> jar (where you put the property "platforms.${platform.active}.home" in a .properties file)
- or ant -Dplatforms.${platform.active}.home=<path_to_JDK_home> jar (where no properties file is used)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set src.dir
- Must set build.dir
- Must set dist.dir
- Must set build.classes.dir
- Must set dist.javadoc.dir
- Must set build.test.classes.dir
- Must set build.test.results.dir
- Must set build.classes.excludes
- Must set dist.jar
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- No tests executed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must set JVM to use for profiling in profiler.info.jvm
- Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- To run this application from the command line without Ant, try:
-
- ${platform.java} -jar "${dist.jar.resolved}"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set debug.class
-
-
-
-
- Must select one file in the IDE or set debug.class
-
-
-
-
- Must set fix.includes
-
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set profile.class
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
-
-
-
-
- This target only works when run from inside the NetBeans IDE.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
-
- Must select some files in the IDE or set test.includes
-
-
-
-
- Must select one file in the IDE or set run.class
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set javac.includes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Some tests failed; see details above.
-
-
-
-
-
-
-
-
- Must select some files in the IDE or set test.includes
-
-
-
- Some tests failed; see details above.
-
-
-
- Must select some files in the IDE or set test.class
- Must select some method in the IDE or set test.method
-
-
-
- Some tests failed; see details above.
-
-
-
-
- Must select one file in the IDE or set test.class
-
-
-
- Must select one file in the IDE or set test.class
- Must select some method in the IDE or set test.method
-
-
-
-
-
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
- Must select one file in the IDE or set applet.url
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/apps/scenebuilder/SceneBuilderKit/nbproject/genfiles.properties b/apps/scenebuilder/SceneBuilderKit/nbproject/genfiles.properties
deleted file mode 100644
index 4193bb7b8a..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/nbproject/genfiles.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-build.xml.data.CRC32=aae0549c
-build.xml.script.CRC32=9a74839c
-build.xml.stylesheet.CRC32=8064a381@1.68.1.46
-# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
-# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=aae0549c
-nbproject/build-impl.xml.script.CRC32=4c887ca7
-nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48
diff --git a/apps/scenebuilder/SceneBuilderKit/nbproject/project.properties b/apps/scenebuilder/SceneBuilderKit/nbproject/project.properties
deleted file mode 100644
index 38c3ad51e9..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/nbproject/project.properties
+++ /dev/null
@@ -1,77 +0,0 @@
-annotation.processing.enabled=true
-annotation.processing.enabled.in.editor=false
-annotation.processing.processors.list=
-annotation.processing.run.all.processors=true
-annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
-application.title=SceneBuilderKit
-application.vendor=Oracle
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-# Files in build.classes.dir which should be excluded from distribution jar
-dist.archive.excludes=
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/SceneBuilderKit.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-endorsed.classpath=
-excludes=
-file.reference.SceneBuilderKit-src=src
-includes=**
-jar.compress=false
-javac.classpath=
-# Space-separated list of extra javac options
-compile.patch=@../../../build/compile.args
-javac.compilerargs=${compile.patch}
-javac.deprecation=false
-javac.processorpath=\
- ${javac.classpath}
-javac.source=1.9
-javac.target=1.9
-javac.test.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-javac.test.processorpath=\
- ${javac.test.classpath}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-main.class=
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-mkdist.disabled=false
-platform.active=JDK_1.9
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project.
-# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value.
-# To set system properties for unit tests define test-sys-prop.name=value:
-run.patch=@../../../build/run.args
-run.jvmargs=${run.patch} -ea
-run.test.classpath=\
- ${javac.test.classpath}:\
- ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=${file.reference.SceneBuilderKit-src}
diff --git a/apps/scenebuilder/SceneBuilderKit/nbproject/project.xml b/apps/scenebuilder/SceneBuilderKit/nbproject/project.xml
deleted file mode 100644
index 572749ac1f..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/nbproject/project.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- org.netbeans.modules.java.j2seproject
-
-
- SceneBuilderKit
-
-
-
-
-
-
-
-
diff --git a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/EditorController.css b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/EditorController.css
deleted file mode 100644
index 4ce6b48182..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/EditorController.css
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-.drag-preview {
- -fx-text-fill: lightgray;
- -fx-text-alignment: center;
- -fx-alignment: center;
- -fx-wrap-text: true;
- -fx-background-color: rgba(255, 255, 255, 0.5);
- -fx-border-width: 1;
- -fx-border-color: lightgray;
-}
-
-.drag-shadow {
- -fx-opacity: 0.5;
-}
-
-.drag-shadow-glass {
- -fx-background-color: rgba(255, 255, 0.0, 0.5);
- -fx-border-width: 1;
- -fx-border-style: dotted;
- -fx-border-color: black;
-}
diff --git a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/EditorController.java b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/EditorController.java
deleted file mode 100644
index a792794cd8..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/EditorController.java
+++ /dev/null
@@ -1,2420 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.oracle.javafx.scenebuilder.kit.editor;
-
-import com.oracle.javafx.scenebuilder.kit.editor.EditorPlatform.Theme;
-import com.oracle.javafx.scenebuilder.kit.editor.drag.DragController;
-import com.oracle.javafx.scenebuilder.kit.editor.i18n.I18N;
-import com.oracle.javafx.scenebuilder.kit.editor.job.AddContextMenuToSelectionJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.AddTooltipToSelectionJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.ModifySelectionJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.BringForwardJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.BringToFrontJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.CutSelectionJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.DeleteSelectionJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.DuplicateSelectionJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.FitToParentSelectionJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.ImportFileJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.IncludeFileJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.InsertAsSubComponentJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.Job;
-import com.oracle.javafx.scenebuilder.kit.editor.job.PasteIntoJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.PasteJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.SendBackwardJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.SendToBackJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.SetDocumentRootJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.TrimSelectionJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.UseComputedSizesSelectionJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.UsePredefinedSizeJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.gridpane.AddColumnJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.gridpane.AddRowJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.gridpane.GridPaneJobUtils.Position;
-import com.oracle.javafx.scenebuilder.kit.editor.job.gridpane.MoveColumnJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.gridpane.MoveRowJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.gridpane.v2.SpanJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.wrap.AbstractWrapInJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.wrap.UnwrapJob;
-import com.oracle.javafx.scenebuilder.kit.editor.messagelog.MessageLog;
-import com.oracle.javafx.scenebuilder.kit.editor.panel.util.dialog.ErrorDialog;
-import com.oracle.javafx.scenebuilder.kit.editor.util.InlineEditController;
-import com.oracle.javafx.scenebuilder.kit.editor.report.ErrorReport;
-import com.oracle.javafx.scenebuilder.kit.editor.selection.AbstractSelectionGroup;
-import com.oracle.javafx.scenebuilder.kit.editor.selection.GridSelectionGroup;
-import com.oracle.javafx.scenebuilder.kit.editor.selection.ObjectSelectionGroup;
-import com.oracle.javafx.scenebuilder.kit.editor.selection.Selection;
-import com.oracle.javafx.scenebuilder.kit.editor.util.ContextMenuController;
-import com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument;
-import com.oracle.javafx.scenebuilder.kit.fxom.FXOMInstance;
-import com.oracle.javafx.scenebuilder.kit.fxom.FXOMIntrinsic;
-import com.oracle.javafx.scenebuilder.kit.fxom.FXOMObject;
-import com.oracle.javafx.scenebuilder.kit.glossary.Glossary;
-import com.oracle.javafx.scenebuilder.kit.glossary.BuiltinGlossary;
-import com.oracle.javafx.scenebuilder.kit.library.BuiltinLibrary;
-import com.oracle.javafx.scenebuilder.kit.library.Library;
-import com.oracle.javafx.scenebuilder.kit.library.LibraryItem;
-import com.oracle.javafx.scenebuilder.kit.metadata.Metadata;
-import com.oracle.javafx.scenebuilder.kit.metadata.property.PropertyMetadata;
-import com.oracle.javafx.scenebuilder.kit.metadata.property.ValuePropertyMetadata;
-import com.oracle.javafx.scenebuilder.kit.metadata.util.ClipboardEncoder;
-import com.oracle.javafx.scenebuilder.kit.metadata.util.DesignHierarchyMask;
-import com.oracle.javafx.scenebuilder.kit.metadata.util.DesignHierarchyMask.Accessory;
-import com.oracle.javafx.scenebuilder.kit.metadata.util.PrefixedValue;
-import com.oracle.javafx.scenebuilder.kit.metadata.util.PropertyName;
-import com.oracle.javafx.scenebuilder.kit.util.control.effectpicker.Utils;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.ResourceBundle;
-import java.util.Set;
-
-import javafx.beans.property.BooleanProperty;
-import javafx.beans.property.ListProperty;
-import javafx.beans.property.ObjectProperty;
-import javafx.beans.property.SimpleBooleanProperty;
-import javafx.beans.property.SimpleListProperty;
-import javafx.beans.property.SimpleObjectProperty;
-import javafx.beans.property.SimpleStringProperty;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableListValue;
-import javafx.beans.value.ObservableValue;
-import javafx.collections.ObservableList;
-import javafx.geometry.Bounds;
-import javafx.scene.Node;
-import javafx.scene.Parent;
-import javafx.scene.control.Control;
-import javafx.scene.effect.Effect;
-import javafx.scene.input.Clipboard;
-import javafx.scene.layout.BorderPane;
-import javafx.util.Callback;
-
-/**
- * An editor controller is the central object which coordinates the editing
- * of an FXML document across the different panels (hierarchy, content,
- * inspector...).
- *
- * An editor controller is associated to an FXML document. It can perform
- * editing and control actions on this document. It also maintains the list of
- * objects selected by the user.
- *
- * Some panel controllers can be attached to an editor controller. They listen
- * to the editor and update their content accordingly.
- */
-public class EditorController {
-
- /**
- * An 'edit' action is an action which modifies the document associated
- * to this editor. It makes the document dirty and pushes a
- * new item on the undo/redo stack.
- */
- public enum EditAction {
- // Candidates for Edit menu
- CUT,
- PASTE,
- PASTE_INTO,
- DUPLICATE,
- DELETE,
- TRIM,
- TOGGLE_FX_ROOT,
- // Candidates for Modify menu
- FIT_TO_PARENT,
- USE_COMPUTED_SIZES,
- ADD_CONTEXT_MENU,
- ADD_TOOLTIP,
- SET_SIZE_320x240,
- SET_SIZE_640x480,
- SET_SIZE_1280x800,
- SET_SIZE_1920x1080,
- // Candidates for Modify/GridPane menu
- MOVE_ROW_ABOVE,
- MOVE_ROW_BELOW,
- MOVE_COLUMN_BEFORE,
- MOVE_COLUMN_AFTER,
- ADD_ROW_ABOVE,
- ADD_ROW_BELOW,
- ADD_COLUMN_BEFORE,
- ADD_COLUMN_AFTER,
- INCREASE_ROW_SPAN,
- DECREASE_ROW_SPAN,
- INCREASE_COLUMN_SPAN,
- DECREASE_COLUMN_SPAN,
- // Candidates for Arrange menu
- BRING_TO_FRONT,
- SEND_TO_BACK,
- BRING_FORWARD,
- SEND_BACKWARD,
- UNWRAP,
- WRAP_IN_ANCHOR_PANE,
- WRAP_IN_BORDER_PANE,
- WRAP_IN_BUTTON_BAR,
- WRAP_IN_DIALOG_PANE,
- WRAP_IN_FLOW_PANE,
- WRAP_IN_GRID_PANE,
- WRAP_IN_GROUP,
- WRAP_IN_HBOX,
- WRAP_IN_PANE,
- WRAP_IN_SCROLL_PANE,
- WRAP_IN_SPLIT_PANE,
- WRAP_IN_STACK_PANE,
- WRAP_IN_TAB_PANE,
- WRAP_IN_TEXT_FLOW,
- WRAP_IN_TILE_PANE,
- WRAP_IN_TITLED_PANE,
- WRAP_IN_TOOL_BAR,
- WRAP_IN_VBOX
- }
-
- /**
- * A 'control' action does not modify the document. It only changes a
- * state or a mode in this editor.
- */
- public enum ControlAction {
- // Candidates for Edit menu
- COPY,
- SELECT_ALL,
- SELECT_NONE,
- SELECT_PARENT,
- SELECT_NEXT,
- SELECT_PREVIOUS,
- EDIT_INCLUDED_FILE,
- REVEAL_INCLUDED_FILE,
- TOGGLE_CSS_SELECTION,
- TOGGLE_SAMPLE_DATA
- }
-
- /**
- * Predefined sizes (width x height).
- * Preferred one refers to the one explicitly set by the user: it is for
- * use for previewing only.
- * Default one is the one stored as a global preference: its value is
- * under user control.
- */
- public enum Size {
- SIZE_320x240,
- SIZE_640x480,
- SIZE_1280x800,
- SIZE_1920x1080,
- SIZE_PREFERRED,
- SIZE_DEFAULT
- }
-
- private final Selection selection = new Selection();
- private final JobManager jobManager = new JobManager(this, 50);
- private final MessageLog messageLog = new MessageLog();
- private final ErrorReport errorReport = new ErrorReport();
- private final DragController dragController = new DragController(this);
- private final InlineEditController inlineEditController = new InlineEditController(this);
- private final ContextMenuController contextMenuController = new ContextMenuController(this);
- private final WatchingController watchingController = new WatchingController(this);
-
- // At start-up the setter for the two variables below might be called by the
- // Preferences controller.
- private double defaultRootContainerWidth = 600;
- private double defaultRootContainerHeight = 400;
-
- private final ObjectProperty fxomDocumentProperty
- = new SimpleObjectProperty<>();
- private final ObjectProperty fxmlLocationProperty
- = new SimpleObjectProperty<>();
- private final ObjectProperty libraryProperty
- = new SimpleObjectProperty<>(BuiltinLibrary.getLibrary());
- private final ObjectProperty glossaryProperty
- = new SimpleObjectProperty<>(new BuiltinGlossary());
- private final ObjectProperty resourcesProperty
- = new SimpleObjectProperty<>(null);
- private final ObjectProperty themeProperty
- = new SimpleObjectProperty<>(Theme.MODENA);
- private final ListProperty sceneStyleSheetProperty
- = new SimpleListProperty<>();
- private final BooleanProperty pickModeEnabledProperty
- = new SimpleBooleanProperty(false);
- private final BooleanProperty sampleDataEnabledProperty
- = new SimpleBooleanProperty(false);
- private final SimpleStringProperty toolStylesheetProperty
- = new SimpleStringProperty(getBuiltinToolStylesheet());
-
- private Callback requestTextEditingSessionEnd;
-
- private static String builtinToolStylesheet;
- private static File nextInitialDirectory = new File(System.getProperty("user.home")); //NOI18N
-
-
- /**
- * Creates an empty editor controller (ie it has no associated fxom document).
- */
- public EditorController() {
- jobManager.revisionProperty().addListener((ChangeListener) (ov, t, t1) -> jobManagerRevisionDidChange());
- }
-
- /**
- * Get the width to use by default for the root container.
- *
- * @return default width for the root container.
- */
- public double getDefaultRootContainerWidth() {
- return defaultRootContainerWidth;
- }
-
- /**
- * Set the width to use by default for the root container.
- *
- * @param defaultRootContainerWidth the new root container's default width.
- */
- public void setDefaultRootContainerWidth(double defaultRootContainerWidth) {
- this.defaultRootContainerWidth = defaultRootContainerWidth;
- }
-
- /**
- * Get the height to use by default for the root container.
- *
- * @return default height for the root container.
- */
- public double getDefaultRootContainerHeight() {
- return defaultRootContainerHeight;
- }
-
- /**
- * Set the height to use by default for the root container.
- *
- * @param defaultRootContainerHeight the new root container's default height.
- */
- public void setDefaultRootContainerHeight(double defaultRootContainerHeight) {
- this.defaultRootContainerHeight = defaultRootContainerHeight;
- }
-
- /**
- * Sets the fxml content to be edited by this editor.
- * A null value makes this editor empty.
- *
- * @param fxmlText null or the fxml text to be edited
- * @throws IOException if fxml text cannot be parsed and loaded correctly.
- */
- public void setFxmlText(String fxmlText) throws IOException {
- setFxmlTextAndLocation(fxmlText, getFxmlLocation());
- }
-
- /**
- * Returns null or the fxml content being edited by this editor.
- *
- * @return null or the fxml content being edited by this editor.
- */
- public String getFxmlText() {
- final String result;
-
- final FXOMDocument fxomDocument = getFxomDocument();
- if (fxomDocument == null) {
- result = null;
- } else {
- final boolean sampleDataEnabled = fxomDocument.isSampleDataEnabled();
- if (sampleDataEnabled) {
- fxomDocument.setSampleDataEnabled(false);
- }
- result = fxomDocument.getFxmlText();
- if (sampleDataEnabled) {
- fxomDocument.setSampleDataEnabled(true);
- }
- }
-
- return result;
- }
-
- /**
- * Returns true if fxml content being edited can be returned safely.
- * This method will return false if there is a text editing session on-going.
- *
- * @return true if fxml content being edited can be returned safely.
- */
- public boolean canGetFxmlText() {
- final boolean result;
-
- if (requestTextEditingSessionEnd == null) {
- result = true;
- } else {
- result = requestTextEditingSessionEnd.call(null);
- // If the callback returns true, then it should have call
- // textEditingSessionDidEnd()
- // => requestTextEditingSessionEnd should be null
- assert (requestTextEditingSessionEnd == null) || (result == false);
- }
-
- return result;
- }
-
- /**
- * Tells this editor that a text editing session has started.
- * The editor controller may invoke the requestSessionEnd() callback
- * if it needs the text editing session to stop. The callback should;
- * - either stop the text editing session, invoke textEditingSessionDidEnd()
- * and return true
- * - either keep the text editing session on-going and return false
- *
- * @param requestSessionEnd Callback that should end the text editing session or return false
- */
- public void textEditingSessionDidBegin(Callback requestSessionEnd) {
- assert requestTextEditingSessionEnd == null;
- requestTextEditingSessionEnd = requestSessionEnd;
- }
-
-
- /**
- * Tells this editor that the text editing session has ended.
- */
- public void textEditingSessionDidEnd() {
- assert requestTextEditingSessionEnd != null;
- requestTextEditingSessionEnd = null;
- }
-
- /*
- * Returns true if a text editing session is currently on going.
- */
- public boolean isTextEditingSessionOnGoing() {
- return requestTextEditingSessionEnd != null;
- }
-
- /**
- * The property holding the fxml location associated to this editor.
- * @return the property holding the fxml location associated to this editor.
- */
- public ObservableValue fxmlLocationProperty() {
- return fxmlLocationProperty;
- }
-
- /**
- * Sets the location of the fxml being edited.
- * If null value is passed, fxml text is being interpreted with any location
- * (ie some references may be broken).
- *
- * @param fxmlLocation null or the location of the fxml being edited.
- */
- public void setFxmlLocation(URL fxmlLocation) {
- fxmlLocationProperty.setValue(fxmlLocation);
- if (getFxomDocument() != null) {
- getFxomDocument().setLocation(fxmlLocation);
- clearUndoRedo(); // Because FXOMDocument.setLocation() mutates the document
- }
- if (fxmlLocation != null) {
- final File newInitialDirectory = new File(fxmlLocation.getPath());
- EditorController.updateNextInitialDirectory(newInitialDirectory);
- }
- }
-
- /**
- * Returns the library used by this editor.
- *
- * @return the library used by this editor (never null).
- */
- public Library getLibrary() {
- return libraryProperty.getValue();
- }
-
- /**
- * Sets the library used by this editor.
- * When this method is called, user scene graph is fully rebuilt using
- * the new library and all panel refresh their contents.
- *
- * @param library the library to be used by this editor (never null).
- */
- public void setLibrary(Library library) {
- assert library != null;
- libraryProperty.getValue().classLoaderProperty().removeListener(libraryClassLoaderListener);
- libraryProperty.setValue(library);
- libraryProperty.getValue().classLoaderProperty().addListener(libraryClassLoaderListener);
- libraryClassLoaderDidChange();
- }
-
- /**
- * The property holding the library used by this editor.
- *
- * @return the property holding the library used by this editor (never null).
- */
- public ObservableValue libraryProperty() {
- return libraryProperty;
- }
-
- /**
- * Returns the glossary used by this editor.
- *
- * @return the glossary used by this editor (never null).
- */
- public Glossary getGlossary() {
- return glossaryProperty.getValue();
- }
-
- /**
- * Sets the glossary used by this editor.
- * The Inspector panel(s) connected to this editor will update
- * their suggested lists in Code section.
- *
- * @param glossary the glossary to be used by this editor (never null).
- */
- public void setLibrary(Glossary glossary) {
- assert glossary != null;
- glossaryProperty.setValue(glossary);
- }
-
- /**
- * The property holding the glossary used by this editor.
- *
- * @return the property holding the glossary used by this editor (never null).
- */
- public ObservableValue glossaryProperty() {
- return glossaryProperty;
- }
-
- /**
- * Returns the resource bundle used by this editor.
- *
- * @return the resource bundle used by this editor.
- */
- public ResourceBundle getResources() {
- return resourcesProperty.getValue();
- }
-
- /**
- * Sets the resource bundle used by this editor.
- * Content and Preview panels sharing this editor will update
- * their content to use this new theme.
- *
- * @param resources null of the resource bundle to be used by this editor.
- */
- public void setResources(ResourceBundle resources) {
- resourcesProperty.setValue(resources);
- resourcesDidChange();
- }
-
- /**
- * The property holding the resource bundle used by this editor.
- *
- * @return the property holding the resource bundle used by this editor (never null).
- */
- public ObservableValue resourcesProperty() {
- return resourcesProperty;
- }
-
- /**
- * Returns the theme used by this editor.
- *
- * @return the theme used by this editor.
- */
- public Theme getTheme() {
- return themeProperty.getValue();
- }
-
- /**
- * Sets the theme used by this editor.
- * Content and Preview panels sharing this editor will update
- * their content to use this new theme.
- *
- * @param theme the theme to be used by this editor
- */
- public void setTheme(Theme theme) {
- themeProperty.setValue(theme);
- }
-
- /**
- * The property holding the theme used by this editor.
- *
- * @return the property holding the theme associated to the editor (never null).
- */
- public ObservableValue themeProperty() {
- return themeProperty;
- }
-
- /**
- *
- * @return the list of scene style sheet used by this editor
- */
- public ObservableList getSceneStyleSheets() {
- return sceneStyleSheetProperty.getValue();
- }
-
- /**
- *
- * @param styleSheets the list of scene style sheet to be used by this editor
- */
- public void setSceneStyleSheets(ObservableList styleSheets) {
- sceneStyleSheetProperty.setValue(styleSheets);
- }
-
- /**
- * The property holding the list of scene style sheet used by this editor.
- *
- * @return the property holding the set of scene style sheet used by the editor,
- * or null if has not been set.
- */
- public ObservableListValue sceneStyleSheetProperty() {
- return sceneStyleSheetProperty;
- }
-
- /**
- * Returns true if 'pick mode' is enabled for this editor.
- * @return true if 'pick mode' is enabled for this editor.
- */
- public boolean isPickModeEnabled() {
- return pickModeEnabledProperty.getValue();
- }
-
- /**
- * Enables or disables 'pick mode' on this editor.
- *
- * @param pickModeEnabled true if 'pick mode' should be enabled.
- */
- public void setPickModeEnabled(boolean pickModeEnabled) {
- pickModeEnabledProperty.setValue(pickModeEnabled);
- }
-
- /**
- * The property indicating if 'pick mode' is enabled or not.
- *
- * @return the property indicating if 'pick mode' is enabled or not.
- */
- public ObservableValue pickModeEnabledProperty() {
- return pickModeEnabledProperty;
- }
-
- /**
- * Returns true if content and preview panels attached to this editor
- * should display sample data.
- *
- * @return true if content and preview panels should display sample data.
- */
- public boolean isSampleDataEnabled() {
- return sampleDataEnabledProperty.getValue();
- }
-
- /**
- * Enables or disables display of sample data in content and preview panels
- * attached to this editor.
- *
- * @param sampleDataEnabled true if sample data should be displayed
- */
- public void setSampleDataEnabled(boolean sampleDataEnabled) {
- setPickModeEnabled(false);
- sampleDataEnabledProperty.setValue(sampleDataEnabled);
- if (getFxomDocument() != null) {
- getFxomDocument().setSampleDataEnabled(isSampleDataEnabled());
- }
- }
-
- /**
- * The property indicating if sample data should be displayed or not.
- *
- * @return the property indicating if sample data should be displayed or not.
- */
- public ObservableValue sampleDataEnabledProperty() {
- return sampleDataEnabledProperty;
- }
-
-
- /**
- * Returns null or the location of the fxml being edited.
- *
- * @return null or the location of the fxml being edited.
- */
- public URL getFxmlLocation() {
- return fxmlLocationProperty.getValue();
- }
-
- /**
- * Sets both fxml text and location to be edited by this editor.
- * Performs setFxmlText() and setFxmlLocation() but in a optimized manner
- * (it avoids an extra scene graph refresh).
- *
- * @param fxmlText null or the fxml text to be edited
- * @param fxmlLocation null or the location of the fxml text being edited
- * @throws IOException if fxml text cannot be parsed and loaded correctly.
- */
- public void setFxmlTextAndLocation(String fxmlText, URL fxmlLocation) throws IOException {
- updateFxomDocument(fxmlText, fxmlLocation, getResources());
- this.fxmlLocationProperty.setValue(fxmlLocation);
- }
-
- /**
- * Sets fxml text, location and resources to be edited by this editor.
- * Performs setFxmlText(), setFxmlLocation() and setResources() but in an
- * optimized manner (it avoids extra scene graph refresh).
- *
- * @param fxmlText null or the fxml text to be edited
- * @param fxmlLocation null or the location of the fxml text being edited
- * @param resources null or the resource bundle used to load the fxml text
- * @throws IOException if fxml text cannot be parsed and loaded correctly.
- */
- public void setFxmlTextLocationAndResources(String fxmlText, URL fxmlLocation,
- ResourceBundle resources) throws IOException {
- updateFxomDocument(fxmlText, fxmlLocation, resources);
- this.fxmlLocationProperty.setValue(fxmlLocation);
- }
-
- /**
- * The property holding the document associated to this editor.
- * @return the property holding the document associated to this editor.
- */
- public ObservableValue fxomDocumentProperty() {
- return fxomDocumentProperty;
- }
-
- /**
- * Returns the document associated to this editor.
- *
- * @return the document associated to this editor.
- */
- public FXOMDocument getFxomDocument() {
- return fxomDocumentProperty.getValue();
- }
-
- /**
- * Returns the tool stylesheet associated to this editor controller.
- * Its default value equals to getBuiltinToolStylesheet().
- *
- * @return the tool stylesheet associated to this editor controller (never null)
- */
- public String getToolStylesheet() {
- return toolStylesheetProperty.getValue();
- }
-
- /**
- * Sets the tool stylesheet associated to this editor controller.
- * Each panel connected to this editor controller will install this style
- * sheet in its root object.
- *
- * @param stylesheet the tool stylesheet associated to this editor controller (never null)
- */
- public void setToolStylesheet(String stylesheet) {
- assert stylesheet != null;
- toolStylesheetProperty.setValue(stylesheet);
- }
-
- /**
- * The property holding tool stylesheet associated to this editor controller.
- * @return the property holding tool stylesheet associated to this editor controller.
- */
- public ObservableValue toolStylesheetProperty() {
- return toolStylesheetProperty;
- }
-
- /**
- * Returns the builtin tool stylesheet.
- * This is the default value for EditorController#toolStylesheet property.
- *
- * @return the builtin tool stylesheet.
- */
- public static synchronized String getBuiltinToolStylesheet() {
- if (builtinToolStylesheet == null) {
- final URL url = EditorController.class.getResource("css/Theme.css"); //NOI18N
- assert url != null;
- builtinToolStylesheet = url.toExternalForm();
- }
- return builtinToolStylesheet;
- }
-
- /**
- * Starts file watching on this editor.
- * This editor will now monitor the files referenced by the FXML text
- * (like images, medias, stylesheets, included fxmls...) and automatically
- * request attached panels to update themselves.
- */
- public void startFileWatching() {
- watchingController.start();
- }
-
- /**
- * Stops file watching on this editor.
- */
- public void stopFileWatching() {
- watchingController.stop();
- }
-
- /**
- * Returns true if file watching is started on this editor.
- *
- * @return true if file watching is started on this editor.
- */
- public boolean isFileWatchingStarted() {
- return watchingController.isStarted();
- }
-
- /**
- * @treatAsPrivate Returns the selection associated to this editor.
- *
- * @return the selection associated to this editor.
- */
- public Selection getSelection() {
- return selection;
- }
-
-
- /**
- * @treatAsPrivate Returns the job manager associated to this editor.
- *
- * @return the job manager associated to this editor.
- */
- public JobManager getJobManager() {
- return jobManager;
- }
-
- /**
- * @treatAsPrivate Returns the message log associated to this editor.
- *
- * @return the message log associated to this editor.
- */
- public MessageLog getMessageLog() {
- return messageLog;
- }
-
- /**
- * @treatAsPrivate Returns the error report associated to this editor.
- *
- * @return the error report associated to this editor.
- */
- public ErrorReport getErrorReport() {
- return errorReport;
- }
-
- /**
- * @treatAsPrivate Returns the drag controller associated to this editor.
- *
- * @return the drag controller associated to this editor.
- */
- public DragController getDragController() {
- return dragController;
- }
-
- /**
- * @treatAsPrivate Returns the inline edit controller associated to this editor.
- *
- * @return the inline edit controller associated to this editor.
- */
- public InlineEditController getInlineEditController() {
- return inlineEditController;
- }
-
- /**
- * @treatAsPrivate Returns the context menu controller associated to this editor.
- *
- * @return the context menu controller associated to this editor.
- */
- public ContextMenuController getContextMenuController() {
- return contextMenuController;
- }
-
- /**
- * Returns true if the undo action is permitted (ie there is something
- * to be undone).
- *
- * @return true if the undo action is permitted.
- */
- public boolean canUndo() {
- return jobManager.canUndo();
- }
-
- /**
- * Returns null or the description of the action to be undone.
- *
- * @return null or the description of the action to be undone.
- */
- public String getUndoDescription() {
- return jobManager.getUndoDescription();
- }
-
- /**
- * Performs the undo action.
- */
- public void undo() {
- jobManager.undo();
- assert getFxomDocument().isUpdateOnGoing() == false;
- }
-
- /**
- * Returns true if the redo action is permitted (ie there is something
- * to be redone).
- *
- * @return true if the redo action is permitted.
- */
- public boolean canRedo() {
- return jobManager.canRedo();
- }
-
- /**
- * Returns null or the description of the action to be redone.
- *
- * @return null or the description of the action to be redone.
- */
- public String getRedoDescription() {
- return jobManager.getRedoDescription();
- }
-
- /**
- * Performs the redo action.
- */
- public void redo() {
- jobManager.redo();
- assert getFxomDocument().isUpdateOnGoing() == false;
- }
-
- /**
- * Clears the undo/redo stack of this editor controller.
- */
- public void clearUndoRedo() {
- jobManager.clear();
- }
-
- /**
- * Performs an edit action.
- *
- * @param editAction the edit action to be performed.
- */
- public void performEditAction(EditAction editAction) {
- switch(editAction) {
- case ADD_CONTEXT_MENU: {
- performAddContextMenu();
- break;
- }
- case ADD_TOOLTIP: {
- performAddTooltip();
- break;
- }
- case ADD_COLUMN_BEFORE: {
- final AddColumnJob job = new AddColumnJob(this, Position.BEFORE);
- jobManager.push(job);
- break;
- }
- case ADD_COLUMN_AFTER: {
- final AddColumnJob job = new AddColumnJob(this, Position.AFTER);
- jobManager.push(job);
- break;
- }
- case ADD_ROW_ABOVE: {
- final AddRowJob job = new AddRowJob(this, Position.ABOVE);
- jobManager.push(job);
- break;
- }
- case ADD_ROW_BELOW: {
- final AddRowJob job = new AddRowJob(this, Position.BELOW);
- jobManager.push(job);
- break;
- }
- case BRING_FORWARD: {
- final BringForwardJob job = new BringForwardJob(this);
- jobManager.push(job);
- break;
- }
- case BRING_TO_FRONT: {
- final BringToFrontJob job = new BringToFrontJob(this);
- jobManager.push(job);
- break;
- }
- case CUT: {
- final CutSelectionJob job = new CutSelectionJob(this);
- jobManager.push(job);
- break;
- }
- case DECREASE_COLUMN_SPAN: {
- final SpanJob job = new SpanJob(this, EditAction.DECREASE_COLUMN_SPAN);
- jobManager.push(job);
- break;
- }
- case DECREASE_ROW_SPAN: {
- final SpanJob job = new SpanJob(this, EditAction.DECREASE_ROW_SPAN);
- jobManager.push(job);
- break;
- }
- case DELETE: {
- final DeleteSelectionJob job = new DeleteSelectionJob(this);
- jobManager.push(job);
- break;
- }
- case DUPLICATE: {
- final DuplicateSelectionJob job = new DuplicateSelectionJob(this);
- jobManager.push(job);
- break;
- }
- case FIT_TO_PARENT: {
- final FitToParentSelectionJob job
- = new FitToParentSelectionJob(this);
- jobManager.push(job);
- break;
- }
- case INCREASE_COLUMN_SPAN: {
- final SpanJob job = new SpanJob(this, EditAction.INCREASE_COLUMN_SPAN);
- jobManager.push(job);
- break;
- }
- case INCREASE_ROW_SPAN: {
- final SpanJob job = new SpanJob(this, EditAction.INCREASE_ROW_SPAN);
- jobManager.push(job);
- break;
- }
- case MOVE_COLUMN_BEFORE: {
- final MoveColumnJob job = new MoveColumnJob(this, Position.BEFORE);
- jobManager.push(job);
- break;
- }
- case MOVE_COLUMN_AFTER: {
- final MoveColumnJob job = new MoveColumnJob(this, Position.AFTER);
- jobManager.push(job);
- break;
- }
- case MOVE_ROW_ABOVE: {
- final MoveRowJob job = new MoveRowJob(this, Position.ABOVE);
- jobManager.push(job);
- break;
- }
- case MOVE_ROW_BELOW: {
- final MoveRowJob job = new MoveRowJob(this, Position.BELOW);
- jobManager.push(job);
- break;
- }
- case PASTE: {
- final PasteJob job = new PasteJob(this);
- jobManager.push(job);
- break;
- }
- case PASTE_INTO: {
- final PasteIntoJob job = new PasteIntoJob(this);
- jobManager.push(job);
- break;
- }
- case SEND_BACKWARD: {
- final SendBackwardJob job = new SendBackwardJob(this);
- jobManager.push(job);
- break;
- }
- case SEND_TO_BACK: {
- final SendToBackJob job = new SendToBackJob(this);
- jobManager.push(job);
- break;
- }
- case SET_SIZE_320x240: {
- final UsePredefinedSizeJob job = new UsePredefinedSizeJob(this, Size.SIZE_320x240);
- jobManager.push(job);
- break;
- }
- case SET_SIZE_640x480: {
- final UsePredefinedSizeJob job = new UsePredefinedSizeJob(this, Size.SIZE_640x480);
- jobManager.push(job);
- break;
- }
- case SET_SIZE_1280x800: {
- final UsePredefinedSizeJob job = new UsePredefinedSizeJob(this, Size.SIZE_1280x800);
- jobManager.push(job);
- break;
- }
- case SET_SIZE_1920x1080: {
- final UsePredefinedSizeJob job = new UsePredefinedSizeJob(this, Size.SIZE_1920x1080);
- jobManager.push(job);
- break;
- }
- case TRIM: {
- final TrimSelectionJob job = new TrimSelectionJob(this);
- jobManager.push(job);
- break;
- }
- case UNWRAP: {
- final UnwrapJob job = new UnwrapJob(this);
- jobManager.push(job);
- break;
- }
- case USE_COMPUTED_SIZES: {
- final UseComputedSizesSelectionJob job
- = new UseComputedSizesSelectionJob(this);
- jobManager.push(job);
- break;
- }
- case WRAP_IN_ANCHOR_PANE: {
- performWrap(javafx.scene.layout.AnchorPane.class);
- break;
- }
- case WRAP_IN_BORDER_PANE: {
- performWrap(javafx.scene.layout.BorderPane.class);
- break;
- }
- case WRAP_IN_BUTTON_BAR: {
- performWrap(javafx.scene.control.ButtonBar.class);
- break;
- }
- case WRAP_IN_DIALOG_PANE: {
- performWrap(javafx.scene.control.DialogPane.class);
- break;
- }
- case WRAP_IN_FLOW_PANE: {
- performWrap(javafx.scene.layout.FlowPane.class);
- break;
- }
- case WRAP_IN_GRID_PANE: {
- performWrap(javafx.scene.layout.GridPane.class);
- break;
- }
- case WRAP_IN_GROUP: {
- performWrap(javafx.scene.Group.class);
- break;
- }
- case WRAP_IN_HBOX: {
- performWrap(javafx.scene.layout.HBox.class);
- break;
- }
- case WRAP_IN_PANE: {
- performWrap(javafx.scene.layout.Pane.class);
- break;
- }
- case WRAP_IN_SCROLL_PANE: {
- performWrap(javafx.scene.control.ScrollPane.class);
- break;
- }
- case WRAP_IN_SPLIT_PANE: {
- performWrap(javafx.scene.control.SplitPane.class);
- break;
- }
- case WRAP_IN_STACK_PANE: {
- performWrap(javafx.scene.layout.StackPane.class);
- break;
- }
- case WRAP_IN_TAB_PANE: {
- performWrap(javafx.scene.control.TabPane.class);
- break;
- }
- case WRAP_IN_TEXT_FLOW: {
- performWrap(javafx.scene.text.TextFlow.class);
- break;
- }
- case WRAP_IN_TILE_PANE: {
- performWrap(javafx.scene.layout.TilePane.class);
- break;
- }
- case WRAP_IN_TITLED_PANE: {
- performWrap(javafx.scene.control.TitledPane.class);
- break;
- }
- case WRAP_IN_TOOL_BAR: {
- performWrap(javafx.scene.control.ToolBar.class);
- break;
- }
- case WRAP_IN_VBOX: {
- performWrap(javafx.scene.layout.VBox.class);
- break;
- }
- default:
- throw new UnsupportedOperationException("Not yet implemented"); //NOI18N
- }
- assert getFxomDocument().isUpdateOnGoing() == false;
- }
-
- /**
- * Returns true if the specified edit action is permitted.
- *
- * @param editAction the edit action to be tested.
- * @return true if the specified edit action is permitted.
- */
- public boolean canPerformEditAction(EditAction editAction) {
- final boolean result;
- switch(editAction) {
- case ADD_CONTEXT_MENU: {
- result = canPerformAddContextMenu();
- break;
- }
- case ADD_TOOLTIP: {
- result = canPerformAddTooltip();
- break;
- }
- case ADD_COLUMN_BEFORE: {
- final AddColumnJob job = new AddColumnJob(this, Position.BEFORE);
- result = job.isExecutable();
- break;
- }
- case ADD_COLUMN_AFTER: {
- final AddColumnJob job = new AddColumnJob(this, Position.AFTER);
- result = job.isExecutable();
- break;
- }
- case ADD_ROW_ABOVE: {
- final AddRowJob job = new AddRowJob(this, Position.ABOVE);
- result = job.isExecutable();
- break;
- }
- case ADD_ROW_BELOW: {
- final AddRowJob job = new AddRowJob(this, Position.BELOW);
- result = job.isExecutable();
- break;
- }
- case BRING_FORWARD: {
- final BringForwardJob job = new BringForwardJob(this);
- result = job.isExecutable();
- break;
- }
- case BRING_TO_FRONT: {
- final BringToFrontJob job = new BringToFrontJob(this);
- result = job.isExecutable();
- break;
- }
- case CUT: {
- final CutSelectionJob job = new CutSelectionJob(this);
- result = job.isExecutable();
- break;
- }
- case DECREASE_COLUMN_SPAN: {
- final SpanJob job = new SpanJob(this, EditAction.DECREASE_COLUMN_SPAN);
- result = job.isExecutable();
- break;
- }
- case DECREASE_ROW_SPAN: {
- final SpanJob job = new SpanJob(this, EditAction.DECREASE_ROW_SPAN);
- result = job.isExecutable();
- break;
- }
- case DELETE: {
- final DeleteSelectionJob job = new DeleteSelectionJob(this);
- result = job.isExecutable();
- break;
- }
- case DUPLICATE: {
- final DuplicateSelectionJob job = new DuplicateSelectionJob(this);
- result = job.isExecutable();
- break;
- }
- case FIT_TO_PARENT: {
- final FitToParentSelectionJob job
- = new FitToParentSelectionJob(this);
- result = job.isExecutable();
- break;
- }
- case INCREASE_COLUMN_SPAN: {
- final SpanJob job = new SpanJob(this, EditAction.INCREASE_COLUMN_SPAN);
- result = job.isExecutable();
- break;
- }
- case INCREASE_ROW_SPAN: {
- final SpanJob job = new SpanJob(this, EditAction.INCREASE_ROW_SPAN);
- result = job.isExecutable();
- break;
- }
- case MOVE_COLUMN_BEFORE: {
- final MoveColumnJob job = new MoveColumnJob(this, Position.BEFORE);
- result = job.isExecutable();
- break;
- }
- case MOVE_COLUMN_AFTER: {
- final MoveColumnJob job = new MoveColumnJob(this, Position.AFTER);
- result = job.isExecutable();
- break;
- }
- case MOVE_ROW_ABOVE: {
- final MoveRowJob job = new MoveRowJob(this, Position.ABOVE);
- result = job.isExecutable();
- break;
- }
- case MOVE_ROW_BELOW: {
- final MoveRowJob job = new MoveRowJob(this, Position.BELOW);
- result = job.isExecutable();
- break;
- }
- case PASTE: {
- final PasteJob job = new PasteJob(this);
- result = job.isExecutable();
- break;
- }
- case PASTE_INTO: {
- final PasteIntoJob job = new PasteIntoJob(this);
- result = job.isExecutable();
- break;
- }
- case SEND_BACKWARD: {
- final SendBackwardJob job = new SendBackwardJob(this);
- result = job.isExecutable();
- break;
- }
- case SEND_TO_BACK: {
- final SendToBackJob job = new SendToBackJob(this);
- result = job.isExecutable();
- break;
- }
- case SET_SIZE_320x240: {
- final UsePredefinedSizeJob job = new UsePredefinedSizeJob(this, Size.SIZE_320x240);
- result = job.isExecutable();
- break;
- }
- case SET_SIZE_640x480: {
- final UsePredefinedSizeJob job = new UsePredefinedSizeJob(this, Size.SIZE_640x480);
- result = job.isExecutable();
- break;
- }
- case SET_SIZE_1280x800: {
- final UsePredefinedSizeJob job = new UsePredefinedSizeJob(this, Size.SIZE_1280x800);
- result = job.isExecutable();
- break;
- }
- case SET_SIZE_1920x1080: {
- final UsePredefinedSizeJob job = new UsePredefinedSizeJob(this, Size.SIZE_1920x1080);
- result = job.isExecutable();
- break;
- }
- case TRIM: {
- final TrimSelectionJob job = new TrimSelectionJob(this);
- result = job.isExecutable();
- break;
- }
- case UNWRAP: {
- final UnwrapJob job = new UnwrapJob(this);
- result = job.isExecutable();
- break;
- }
- case USE_COMPUTED_SIZES: {
- final UseComputedSizesSelectionJob job
- = new UseComputedSizesSelectionJob(this);
- result = job.isExecutable();
- break;
- }
- case WRAP_IN_ANCHOR_PANE: {
- result = canPerformWrap(javafx.scene.layout.AnchorPane.class);
- break;
- }
- case WRAP_IN_BORDER_PANE: {
- result = canPerformWrap(javafx.scene.layout.BorderPane.class);
- break;
- }
- case WRAP_IN_BUTTON_BAR: {
- result = canPerformWrap(javafx.scene.control.ButtonBar.class);
- break;
- }
- case WRAP_IN_DIALOG_PANE: {
- result = canPerformWrap(javafx.scene.control.DialogPane.class);
- break;
- }
- case WRAP_IN_FLOW_PANE: {
- result = canPerformWrap(javafx.scene.layout.FlowPane.class);
- break;
- }
- case WRAP_IN_GRID_PANE: {
- result = canPerformWrap(javafx.scene.layout.GridPane.class);
- break;
- }
- case WRAP_IN_GROUP: {
- result = canPerformWrap(javafx.scene.Group.class);
- break;
- }
- case WRAP_IN_HBOX: {
- result = canPerformWrap(javafx.scene.layout.HBox.class);
- break;
- }
- case WRAP_IN_PANE: {
- result = canPerformWrap(javafx.scene.layout.Pane.class);
- break;
- }
- case WRAP_IN_SCROLL_PANE: {
- result = canPerformWrap(javafx.scene.control.ScrollPane.class);
- break;
- }
- case WRAP_IN_SPLIT_PANE: {
- result = canPerformWrap(javafx.scene.control.SplitPane.class);
- break;
- }
- case WRAP_IN_STACK_PANE: {
- result = canPerformWrap(javafx.scene.layout.StackPane.class);
- break;
- }
- case WRAP_IN_TAB_PANE: {
- result = canPerformWrap(javafx.scene.control.TabPane.class);
- break;
- }
- case WRAP_IN_TEXT_FLOW: {
- result = canPerformWrap(javafx.scene.text.TextFlow.class);
- break;
- }
- case WRAP_IN_TILE_PANE: {
- result = canPerformWrap(javafx.scene.layout.TilePane.class);
- break;
- }
- case WRAP_IN_TITLED_PANE: {
- result = canPerformWrap(javafx.scene.control.TitledPane.class);
- break;
- }
- case WRAP_IN_TOOL_BAR: {
- result = canPerformWrap(javafx.scene.control.ToolBar.class);
- break;
- }
- case WRAP_IN_VBOX: {
- result = canPerformWrap(javafx.scene.layout.VBox.class);
- break;
- }
- default:
- result = false;
- break;
- }
-
- return result;
- }
-
- /**
- * Performs the specified control action.
- *
- * @param controlAction the control action to be performed.
- */
- public void performControlAction(ControlAction controlAction) {
- switch(controlAction) {
- case COPY: {
- performCopy();
- break;
- }
- case EDIT_INCLUDED_FILE: {
- performEditIncludedFile();
- break;
- }
- case REVEAL_INCLUDED_FILE: {
- performRevealIncludedFile();
- break;
- }
- case SELECT_ALL: {
- performSelectAll();
- break;
- }
- case SELECT_NONE: {
- performSelectNone();
- break;
- }
- case SELECT_PARENT: {
- performSelectParent();
- break;
- }
- case SELECT_NEXT: {
- performSelectNext();
- break;
- }
- case SELECT_PREVIOUS: {
- performSelectPrevious();
- break;
- }
- case TOGGLE_SAMPLE_DATA: {
- setSampleDataEnabled( ! isSampleDataEnabled());
- break;
- }
- default:
- throw new UnsupportedOperationException("Not yet implemented"); //NOI18N
- }
- }
-
- /**
- * Returns true if the specified control action is permitted.
- *
- * @param controlAction the control action to be tested.
- * @return true if the specified control action is permitted.
- */
- public boolean canPerformControlAction(ControlAction controlAction) {
- final boolean result;
-
- // If there is no document loaded, we cannot perform control actions
- if (getFxomDocument() == null || getFxomDocument().getFxomRoot() == null) {
- return false;
- }
- switch(controlAction) {
- case COPY: {
- result = canPerformCopy();
- break;
- }
- case EDIT_INCLUDED_FILE:
- case REVEAL_INCLUDED_FILE: {
- result = canPerformIncludedFileAction();
- break;
- }
- case SELECT_ALL: {
- result = canPerformSelectAll();
- break;
- }
- case SELECT_NONE: {
- result = canPerformSelectNone();
- break;
- }
- case SELECT_PARENT: {
- result = canPerformSelectParent();
- break;
- }
- case SELECT_NEXT: {
- result = canPerformSelectNext();
- break;
- }
- case SELECT_PREVIOUS: {
- result = canPerformSelectPrevious();
- break;
- }
- case TOGGLE_SAMPLE_DATA: {
- result = true;
- break;
- }
- default:
- result = false;
- break;
- }
-
- return result;
- }
-
- /**
- * Performs the 'import' FXML edit action.
- * This action creates an object matching the root node of the selected
- * FXML file and insert it in the document (either as root if the document
- * is empty or under the selection common ancestor node otherwise).
- *
- * @param fxmlFile the FXML file to be imported
- */
- public void performImportFxml(File fxmlFile) {
- performImport(fxmlFile);
- }
-
- /**
- * Performs the 'import' media edit action.
- * This action creates an object matching the type of the selected
- * media file (either ImageView or MediaView) and insert it in the document
- * (either as root if the document is empty or under the selection common
- * ancestor node otherwise).
- *
- * @param mediaFile the media file to be imported
- */
- public void performImportMedia(File mediaFile) {
- performImport(mediaFile);
- }
-
- private void performImport(File file) {
- final ImportFileJob job = new ImportFileJob(file, this);
- if (job.isExecutable()) {
- jobManager.push(job);
- } else {
- final String target;
- if (job.getTargetObject() == null) {
- target = null;
- } else {
- final Object sceneGraphTarget
- = job.getTargetObject().getSceneGraphObject();
- if (sceneGraphTarget == null) {
- target = null;
- } else {
- target = sceneGraphTarget.getClass().getSimpleName();
- }
- }
- if (target != null) {
- getMessageLog().logWarningMessage(
- "import.from.file.failed.target",
- file.getName(), target);
- } else {
- getMessageLog().logWarningMessage(
- "import.from.file.failed",
- file.getName());
- }
- }
- }
-
- /**
- * Performs the 'include' FXML edit action.
- * As opposed to the 'import' edit action, the 'include' action does not
- * copy the FXML content but adds an fx:include element to the FXML document.
- *
- * @param fxmlFile the FXML file to be included
- */
- public void performIncludeFxml(File fxmlFile) {
- final IncludeFileJob job = new IncludeFileJob(fxmlFile, this);
- if (job.isExecutable()) {
- jobManager.push(job);
- } else {
- final String target;
- if (job.getTargetObject() == null) {
- target = null;
- } else {
- final Object sceneGraphTarget
- = job.getTargetObject().getSceneGraphObject();
- if (sceneGraphTarget == null) {
- target = null;
- } else {
- target = sceneGraphTarget.getClass().getSimpleName();
- }
- }
- if (target != null) {
- getMessageLog().logWarningMessage(
- "include.file.failed.target",
- fxmlFile.getName(), target);
- } else {
- getMessageLog().logWarningMessage(
- "include.file.failed",
- fxmlFile.getName());
- }
- }
- }
-
- /**
- * Performs the 'insert' edit action. This action creates an object
- * matching the specified library item and insert it in the document
- * (according the selection state).
- *
- * @param libraryItem the library item describing the object to be inserted.
- */
- public void performInsert(LibraryItem libraryItem) {
- final Job job;
- final FXOMObject target;
-
- assert canPerformInsert(libraryItem); // (1)
-
- final FXOMDocument newItemDocument = libraryItem.instantiate();
- assert newItemDocument != null; // Because (1)
- final FXOMObject newObject = newItemDocument.getFxomRoot();
- assert newObject != null;
- newObject.moveToFxomDocument(getFxomDocument());
- final FXOMObject rootObject = getFxomDocument().getFxomRoot();
- if (rootObject == null) { // Empty document
- final String description
- = I18N.getString("drop.job.insert.library.item", libraryItem.getName());
- job = new SetDocumentRootJob(newObject, true /* usePredefinedSize */, description, this);
-
- } else {
- if (selection.isEmpty() || selection.isSelected(rootObject)) {
- // No selection or root is selected -> we insert below root
- target = rootObject;
- } else {
- // Let's use the common parent of the selected objects.
- // It might be null if selection holds some non FXOMObject entries
- target = selection.getAncestor();
- }
- job = new InsertAsSubComponentJob(newObject, target, -1, this);
- }
-
- jobManager.push(job);
- }
-
- /**
- * Returns true if the 'insert' action is permitted with the specified
- * library item.
- *
- * @param libraryItem the library item describing the object to be inserted.
- * @return true if the 'insert' action is permitted.
- */
- public boolean canPerformInsert(LibraryItem libraryItem) {
- final FXOMObject targetCandidate;
- final boolean result;
-
- if (getFxomDocument() == null) {
- result = false;
- } else {
- assert (libraryItem.getLibrary().getClassLoader() == null)
- || (libraryItem.getLibrary().getClassLoader() == getFxomDocument().getClassLoader());
- final FXOMDocument newItemDocument = libraryItem.instantiate();
- if (newItemDocument == null) {
- // For some reason, library is unable to instantiate this item
- result = false;
- } else {
- final FXOMObject newItemRoot = newItemDocument.getFxomRoot();
- newItemRoot.moveToFxomDocument(getFxomDocument());
- assert newItemDocument.getFxomRoot() == null;
- final FXOMObject rootObject = getFxomDocument().getFxomRoot();
- if (rootObject == null) { // Empty document
- final SetDocumentRootJob job = new SetDocumentRootJob(
- newItemRoot, true /* usePredefinedSize */, "unused", this); //NOI18N
- result = job.isExecutable();
- } else {
- if (selection.isEmpty() || selection.isSelected(rootObject)) {
- // No selection or root is selected -> we insert below root
- targetCandidate = rootObject;
- } else {
- // Let's use the common parent of the selected objects.
- // It might be null if selection holds some non FXOMObject entries
- targetCandidate = selection.getAncestor();
- }
- final InsertAsSubComponentJob job = new InsertAsSubComponentJob(
- newItemRoot, targetCandidate, -1, this);
- result = job.isExecutable();
- }
- }
- }
-
- return result;
- }
-
- /**
- * Performs the 'wrap' edit action. This action creates an object
- * matching the specified class and reparent all the selected objects
- * below this new object.
- *
- * @param wrappingClass the wrapping class
- */
- public void performWrap(Class extends Parent> wrappingClass) {
- assert canPerformWrap(wrappingClass);
- final AbstractWrapInJob job = AbstractWrapInJob.getWrapInJob(this, wrappingClass);
- jobManager.push(job);
- }
-
- /**
- * Returns true if the 'wrap' action is permitted with the specified class.
- *
- * @param wrappingClass the wrapping class.
- * @return true if the 'wrap' action is permitted.
- */
- public boolean canPerformWrap(Class extends Parent> wrappingClass) {
- if (getClassesSupportingWrapping().contains(wrappingClass) == false) {
- return false;
- }
- final AbstractWrapInJob job = AbstractWrapInJob.getWrapInJob(this, wrappingClass);
- return job.isExecutable();
- }
-
- private static List> classesSupportingWrapping;
-
- /**
- * Return the list of classes that can be passed to
- * {@link EditorController#performWrap(java.lang.Class)}.
- *
- * @return the list of classes.
- */
- public synchronized static Collection> getClassesSupportingWrapping() {
- if (classesSupportingWrapping == null) {
- classesSupportingWrapping = new ArrayList<>();
- classesSupportingWrapping.add(javafx.scene.layout.AnchorPane.class);
- classesSupportingWrapping.add(javafx.scene.layout.BorderPane.class);
- classesSupportingWrapping.add(javafx.scene.control.ButtonBar.class);
- classesSupportingWrapping.add(javafx.scene.control.DialogPane.class);
- classesSupportingWrapping.add(javafx.scene.layout.FlowPane.class);
- classesSupportingWrapping.add(javafx.scene.layout.GridPane.class);
- classesSupportingWrapping.add(javafx.scene.Group.class);
- classesSupportingWrapping.add(javafx.scene.layout.HBox.class);
- classesSupportingWrapping.add(javafx.scene.layout.Pane.class);
- classesSupportingWrapping.add(javafx.scene.control.ScrollPane.class);
- classesSupportingWrapping.add(javafx.scene.control.SplitPane.class);
- classesSupportingWrapping.add(javafx.scene.layout.StackPane.class);
- classesSupportingWrapping.add(javafx.scene.control.TabPane.class);
- classesSupportingWrapping.add(javafx.scene.text.TextFlow.class);
- classesSupportingWrapping.add(javafx.scene.layout.TilePane.class);
- classesSupportingWrapping.add(javafx.scene.control.TitledPane.class);
- classesSupportingWrapping.add(javafx.scene.control.ToolBar.class);
- classesSupportingWrapping.add(javafx.scene.layout.VBox.class);
- classesSupportingWrapping = Collections.unmodifiableList(classesSupportingWrapping);
- }
-
- return classesSupportingWrapping;
- }
-
- /**
- * Performs the copy control action.
- */
- private void performCopy() {
- assert canPerformCopy(); // (1)
- assert selection.getGroup() instanceof ObjectSelectionGroup; // Because of (1)
- final ObjectSelectionGroup osg = (ObjectSelectionGroup) selection.getGroup();
-
- final ClipboardEncoder encoder = new ClipboardEncoder(osg.getSortedItems());
- assert encoder.isEncodable();
- Clipboard.getSystemClipboard().setContent(encoder.makeEncoding());
- }
-
- /**
- * Returns true if the selection is not empty.
- *
- * @return if the selection is not empty.
- */
- private boolean canPerformCopy() {
- return selection.getGroup() instanceof ObjectSelectionGroup;
- }
-
- /**
- * Performs the select all control action.
- * Select all sub components of the selection common ancestor.
- */
- private void performSelectAll() {
- assert canPerformSelectAll(); // (1)
- final FXOMObject rootObject = getFxomDocument().getFxomRoot();
- if (selection.isEmpty()) { // (1)
- // If the current selection is empty, we select the root object
- selection.select(rootObject);
- } else if (selection.getGroup() instanceof ObjectSelectionGroup) {
- // Otherwise, select all sub components of the common ancestor ??
- final FXOMObject ancestor = selection.getAncestor();
- assert ancestor != null; // Because of (1)
- final DesignHierarchyMask mask = new DesignHierarchyMask(ancestor);
- final Set selectableObjects = new HashSet<>();
- // BorderPane special case : use accessories
- if (mask.getFxomObject().getSceneGraphObject() instanceof BorderPane) {
- final FXOMObject top = mask.getAccessory(Accessory.TOP);
- final FXOMObject left = mask.getAccessory(Accessory.LEFT);
- final FXOMObject center = mask.getAccessory(Accessory.CENTER);
- final FXOMObject right = mask.getAccessory(Accessory.RIGHT);
- final FXOMObject bottom = mask.getAccessory(Accessory.BOTTOM);
- for (FXOMObject accessoryObject : new FXOMObject[]{
- top, left, center, right, bottom}) {
- if (accessoryObject != null) {
- selectableObjects.add(accessoryObject);
- }
- }
- } else {
- assert mask.isAcceptingSubComponent(); // Because of (1)
- selectableObjects.addAll(mask.getSubComponents());
- }
- selection.select(selectableObjects);
- } else if (selection.getGroup() instanceof GridSelectionGroup) {
- // Select ALL rows / columns
- final GridSelectionGroup gsg = (GridSelectionGroup) selection.getGroup();
- final FXOMObject gridPane = gsg.getParentObject();
- assert gridPane instanceof FXOMInstance;
- final DesignHierarchyMask gridPaneMask = new DesignHierarchyMask(gridPane);
- int size = 0;
- switch (gsg.getType()) {
- case ROW:
- size = gridPaneMask.getRowsSize();
- break;
- case COLUMN:
- size = gridPaneMask.getColumnsSize();
- break;
- default:
- assert false;
- break;
- }
- // Select first index
- selection.select((FXOMInstance) gridPane, gsg.getType(), 0);
- for (int index = 1; index < size; index++) {
- selection.toggleSelection((FXOMInstance) gridPane, gsg.getType(), index);
- }
- } else {
- assert selection.getGroup() == null :
- "Add implementation for " + selection.getGroup(); //NOI18N
-
- }
- }
-
- /**
- * Returns true if the root object is not selected and if the sub components
- * of the selection common ancestor are not all already selected.
- *
- * @return if the root object is not selected and if the sub components of
- * the selection common ancestor are not all already selected.
- */
- private boolean canPerformSelectAll() {
- assert getFxomDocument() != null && getFxomDocument().getFxomRoot() != null;
- if (selection.isEmpty()) { // (1)
- return true;
- } else if (selection.getGroup() instanceof ObjectSelectionGroup) {
- final FXOMObject rootObject = getFxomDocument().getFxomRoot();
- // Cannot select all if root is selected
- if (selection.isSelected(rootObject)) { // (1)
- return false;
- } else {
- // Cannot select all if all sub components are already selected
- final FXOMObject ancestor = selection.getAncestor();
- assert ancestor != null; // Because of (1)
- final DesignHierarchyMask mask = new DesignHierarchyMask(ancestor);
- // BorderPane special case : use accessories
- if (mask.getFxomObject().getSceneGraphObject() instanceof BorderPane) {
- final FXOMObject top = mask.getAccessory(Accessory.TOP);
- final FXOMObject left = mask.getAccessory(Accessory.LEFT);
- final FXOMObject center = mask.getAccessory(Accessory.CENTER);
- final FXOMObject right = mask.getAccessory(Accessory.RIGHT);
- final FXOMObject bottom = mask.getAccessory(Accessory.BOTTOM);
- for (FXOMObject bpAccessoryObject : new FXOMObject[] {
- top, left, center, right, bottom}) {
- if (bpAccessoryObject != null
- && selection.isSelected(bpAccessoryObject) == false) {
- return true;
- }
- }
- } else if (mask.isAcceptingSubComponent()) {
- for (FXOMObject subComponentObject : mask.getSubComponents()) {
- if (selection.isSelected(subComponentObject) == false) {
- return true;
- }
- }
- }
- }
- } else if (selection.getGroup() instanceof GridSelectionGroup) {
- final GridSelectionGroup gsg = (GridSelectionGroup) selection.getGroup();
- // GridSelectionGroup => at least 1 row/column is selected
- assert gsg.getIndexes().isEmpty() == false;
- return true;
- } else {
- assert selection.getGroup() == null :
- "Add implementation for " + selection.getGroup(); //NOI18N
- }
- return false;
- }
-
- /**
- * Performs the select parent control action.
- * If the selection is multiple, we select the common ancestor.
- */
- private void performSelectParent() {
- assert canPerformSelectParent(); // (1)
- final FXOMObject ancestor = selection.getAncestor();
- assert ancestor != null; // Because of (1)
- selection.select(ancestor);
- }
-
- /**
- * Returns true if the selection is not empty and the root object is not
- * selected.
- *
- * @return if the selection is not empty and the root object is not
- * selected.
- */
- private boolean canPerformSelectParent() {
- assert getFxomDocument() != null && getFxomDocument().getFxomRoot() != null;
- final FXOMObject rootObject = getFxomDocument().getFxomRoot();
- return !selection.isEmpty() && !selection.isSelected(rootObject);
- }
-
- /**
- * Performs the select next control action.
- */
- private void performSelectNext() {
- assert canPerformSelectNext(); // (1)
-
- final AbstractSelectionGroup asg = selection.getGroup();
- if (asg instanceof ObjectSelectionGroup) {
- final ObjectSelectionGroup osg = (ObjectSelectionGroup) asg;
- final Set items = osg.getItems();
- assert items.size() == 1; // Because of (1)
- final FXOMObject selectedObject = items.iterator().next();
- final FXOMObject nextSibling = selectedObject.getNextSlibing();
- assert nextSibling != null; // Because of (1)
- selection.select(nextSibling);
- } else {
- assert asg instanceof GridSelectionGroup; // Because of (1)
- final GridSelectionGroup gsg = (GridSelectionGroup) asg;
- final FXOMObject gridPane = gsg.getParentObject();
- final DesignHierarchyMask mask = new DesignHierarchyMask(gridPane);
- assert gridPane instanceof FXOMInstance;
- final Set indexes = gsg.getIndexes();
- assert indexes.size() == 1; // Because of (1)
- int selectedIndex = indexes.iterator().next();
- int nextIndex = selectedIndex + 1;
- int size = 0;
- switch (gsg.getType()) {
- case ROW:
- size = mask.getRowsSize();
- break;
- case COLUMN:
- size = mask.getColumnsSize();
- break;
- default:
- assert false;
- break;
- }
- assert nextIndex < size; // Because of (1)
- selection.select((FXOMInstance) gridPane, gsg.getType(), nextIndex);
- }
- }
-
- /**
- * Returns true if the selection is single and the container of the selected
- * object container contains a child next to the selected one.
- *
- * @return if the selection is single and the container of the selected
- * object container contains a child next to the selected one.
- */
- private boolean canPerformSelectNext() {
- assert getFxomDocument() != null && getFxomDocument().getFxomRoot() != null;
- if (selection.isEmpty()) {
- return false;
- }
- final AbstractSelectionGroup asg = selection.getGroup();
- if (asg instanceof ObjectSelectionGroup) {
- final ObjectSelectionGroup osg = (ObjectSelectionGroup) asg;
- final Set items = osg.getItems();
- if (items.size() != 1) {
- return false;
- }
- final FXOMObject selectedObject = items.iterator().next();
- return selectedObject.getNextSlibing() != null;
- } else if (asg instanceof GridSelectionGroup) {
- final GridSelectionGroup gsg = (GridSelectionGroup) asg;
- final Set indexes = gsg.getIndexes();
- if (indexes.size() != 1) {
- return false;
- }
- final FXOMObject gridPane = gsg.getParentObject();
- final DesignHierarchyMask mask = new DesignHierarchyMask(gridPane);
- int size = 0;
- switch (gsg.getType()) {
- case ROW:
- size = mask.getRowsSize();
- break;
- case COLUMN:
- size = mask.getColumnsSize();
- break;
- default:
- assert false;
- break;
- }
- final int index = indexes.iterator().next();
- return index < size - 1;
- } else {
- assert selection.getGroup() == null :
- "Add implementation for " + selection.getGroup(); //NOI18N
- }
- return false;
- }
-
- /**
- * Performs the select previous control action.
- */
- private void performSelectPrevious() {
- assert canPerformSelectPrevious(); // (1)
-
- final AbstractSelectionGroup asg = selection.getGroup();
- if (asg instanceof ObjectSelectionGroup) {
- final ObjectSelectionGroup osg = (ObjectSelectionGroup) asg;
- final Set items = osg.getItems();
- assert items.size() == 1; // Because of (1)
- final FXOMObject selectedObject = items.iterator().next();
- final FXOMObject previousSibling = selectedObject.getPreviousSlibing();
- assert previousSibling != null; // Because of (1)
- selection.select(previousSibling);
- } else {
- assert asg instanceof GridSelectionGroup; // Because of (1)
- final GridSelectionGroup gsg = (GridSelectionGroup) asg;
- final FXOMObject gridPane = gsg.getParentObject();
- assert gridPane instanceof FXOMInstance;
- final Set indexes = gsg.getIndexes();
- assert indexes.size() == 1; // Because of (1)
- int selectedIndex = indexes.iterator().next();
- int previousIndex = selectedIndex - 1;
- assert previousIndex >= 0; // Because of (1)
- selection.select((FXOMInstance) gridPane, gsg.getType(), previousIndex);
- }
- }
-
- /**
- * Returns true if the selection is single and the container of the selected
- * object container contains a child previous to the selected one.
- *
- * @return if the selection is single and the container of the selected
- * object container contains a child previous to the selected one.
- */
- private boolean canPerformSelectPrevious() {
- assert getFxomDocument() != null && getFxomDocument().getFxomRoot() != null;
- if (selection.isEmpty()) {
- return false;
- }
- final AbstractSelectionGroup asg = selection.getGroup();
- if (asg instanceof ObjectSelectionGroup) {
- final ObjectSelectionGroup osg = (ObjectSelectionGroup) asg;
- final Set items = osg.getItems();
- if (items.size() != 1) {
- return false;
- }
- final FXOMObject selectedObject = items.iterator().next();
- return selectedObject.getPreviousSlibing() != null;
- } else if (asg instanceof GridSelectionGroup) {
- final GridSelectionGroup gsg = (GridSelectionGroup) asg;
- final Set indexes = gsg.getIndexes();
- if (indexes.size() != 1) {
- return false;
- }
- final int index = indexes.iterator().next();
- return index > 0;
- } else {
- assert selection.getGroup() == null :
- "Add implementation for " + selection.getGroup(); //NOI18N
- }
- return false;
- }
-
- /**
- * Performs the select none control action.
- */
- private void performSelectNone() {
- assert canPerformSelectNone();
- selection.clear();
- }
-
- /**
- * Returns true if the selection is not empty.
- *
- * @return if the selection is not empty.
- */
- private boolean canPerformSelectNone() {
- return getSelection().isEmpty() == false;
- }
-
- /**
- * If selection contains single FXOM object and this an fx:include instance, then
- * returns the included file. Else returns null.
- *
- * If the selection is single and is an included FXOM object :
- * 1) if included file source does not start with /,
- * it's a path relative to the document location.
- * - if FXOM document location is null (document not saved yet), return null
- * - else return selection included file
- *
- * 2) if included file source starts with /,
- * it's a path relative to the document class loader.
- * - if FXOM document class loader is null, return null
- * - else return selection included file
- *
- * @return the included file associated to the selected object or null.
- */
- public File getIncludedFile() {
- final AbstractSelectionGroup asg = getSelection().getGroup();
- if (asg instanceof ObjectSelectionGroup == false) {
- return null;
- }
- final ObjectSelectionGroup osg = (ObjectSelectionGroup) asg;
- if (osg.getItems().size() != 1) {
- return null;
- }
- final FXOMObject fxomObject = osg.getItems().iterator().next();
- if (fxomObject instanceof FXOMIntrinsic == false) {
- return null;
- }
- final FXOMIntrinsic fxomIntrinsic = (FXOMIntrinsic) fxomObject;
- if (fxomIntrinsic.getType() != FXOMIntrinsic.Type.FX_INCLUDE) {
- return null;
- }
- final String source = fxomIntrinsic.getSource();
- if (source == null) {
- return null; // Can this happen ?
- }
- if (source.startsWith("/")) { //NOI18N
- // Source relative to FXOM document class loader
- final ClassLoader classLoader = getFxomDocument().getClassLoader();
- if (classLoader != null) {
- final PrefixedValue pv = new PrefixedValue(
- PrefixedValue.Type.CLASSLOADER_RELATIVE_PATH, source);
- final URL url = pv.resolveClassLoaderRelativePath(classLoader);
- final File file;
- try {
- file = new File(url.toURI());
- } catch (URISyntaxException ex) {
- throw new IllegalArgumentException(ex);
- }
- return file;
- }
- } else {
- // Source relative to FXOM document location
- final URL location = getFxmlLocation();
- if (location != null) {
- final PrefixedValue pv = new PrefixedValue(
- PrefixedValue.Type.DOCUMENT_RELATIVE_PATH, source);
- final URL url = pv.resolveDocumentRelativePath(location);
- final File file;
- try {
- file = new File(url.toURI());
- } catch (URISyntaxException ex) {
- throw new IllegalArgumentException(ex);
- }
- return file;
- }
- }
- return null;
- }
-
- /**
- * Returns true if the selection is an included file that can be edited/revealed.
- *
- * @return true if the selection is an included file that can be edited/revealed.
- */
- private boolean canPerformIncludedFileAction() {
- return getIncludedFile() != null;
- }
-
- private void performEditIncludedFile() {
- assert canPerformIncludedFileAction(); // (1)
- final File includedFile = getIncludedFile();
- assert includedFile != null; // Because of (1)
- try {
- EditorPlatform.open(includedFile.getAbsolutePath());
- } catch (IOException ioe) {
- final ErrorDialog errorDialog = new ErrorDialog(null);
- errorDialog.setTitle(I18N.getString("error.file.open.title"));
- errorDialog.setMessage(I18N.getString("error.file.open.message",
- includedFile.getAbsolutePath()));
- errorDialog.setDebugInfoWithThrowable(ioe);
- errorDialog.showAndWait();
- }
- }
-
- private void performRevealIncludedFile() {
- assert canPerformIncludedFileAction(); // (1)
- final File includedFile = getIncludedFile();
- assert includedFile != null; // Because of (1)
- try {
- EditorPlatform.revealInFileBrowser(includedFile);
- } catch (IOException ioe) {
- final ErrorDialog errorDialog = new ErrorDialog(null);
- errorDialog.setTitle(I18N.getString("error.file.reveal.title"));
- errorDialog.setMessage(I18N.getString("error.file.reveal.message",
- includedFile.getAbsolutePath()));
- errorDialog.setDetails(I18N.getString("error.write.details"));
- errorDialog.setDebugInfoWithThrowable(ioe);
- errorDialog.showAndWait();
- }
- }
-
- /**
- * Returns true if the 'set effect' action is permitted with the current
- * selection.
- * In other words, returns true if the selection contains only Node objects.
- *
- * @return true if the 'set effect' action is permitted.
- */
- public boolean canPerformSetEffect() {
- return isSelectionNode();
- }
-
- /**
- * Performs the 'set effect' edit action. This method creates an instance of
- * the specified effect class and sets it in the effect property of the
- * selected objects.
- *
- * @param effectClass class of the effect to be added (never null)
- */
- public void performSetEffect(Class extends Effect> effectClass) {
- assert canPerformSetEffect(); // (1)
-
- final Effect effect = Utils.newInstance(effectClass);
- final PropertyName pn = new PropertyName("effect"); //NOI18N
-
- final PropertyMetadata pm
- = Metadata.getMetadata().queryProperty(Node.class, pn);
- assert pm instanceof ValuePropertyMetadata;
- final ValuePropertyMetadata vpm = (ValuePropertyMetadata) pm;
- final ModifySelectionJob job = new ModifySelectionJob(vpm, effect, this);
- getJobManager().push(job);
- }
-
- /**
- * Returns true if the 'add context menu' action is permitted with the current
- * selection.
- * In other words, returns true if the selection contains only Control objects.
- *
- * @return true if the 'add context menu' action is permitted.
- */
- public boolean canPerformAddContextMenu() {
- return isSelectionControl();
- }
-
- /**
- * Performs the 'add context menu' edit action. This method creates an instance of
- * ContextMenu and sets it in the contextMenu property of the
- * selected objects.
- */
- public void performAddContextMenu() {
- assert canPerformAddContextMenu();
- final Job addContextMenuJob = new AddContextMenuToSelectionJob(this);
- getJobManager().push(addContextMenuJob);
- }
-
- /**
- * Returns true if the 'add tooltip' action is permitted with the current
- * selection.
- * In other words, returns true if the selection contains only Control objects.
- *
- * @return true if the 'add tooltip' action is permitted.
- */
- public boolean canPerformAddTooltip() {
- return isSelectionControl();
- }
-
- /**
- * Performs the 'add tooltip' edit action. This method creates an instance of
- * Tooltip and sets it in the tooltip property of the
- * selected objects.
- */
- public void performAddTooltip() {
- assert canPerformAddTooltip(); // (1)
- final Job addTooltipJob = new AddTooltipToSelectionJob(this);
- getJobManager().push(addTooltipJob);
- }
-
- /**
- * Returns the URL of the CSS style associated to EditorController class.
- * This stylesheet contains rules shareable by all other components of
- * SB kit.
- *
- * @return URL of EditorController class style sheet (never null).
- */
- private static URL stylesheet = null;
- public synchronized static URL getStylesheet() {
- if (stylesheet == null) {
- stylesheet = EditorController.class.getResource("EditorController.css"); //NOI18N
- assert stylesheet != null;
- }
- return stylesheet;
- }
-
-
- /**
- * Returns the last directory selected from the file chooser.
- *
- * @return the last selected directory (never null).
- */
- public static File getNextInitialDirectory() {
- return nextInitialDirectory;
- }
-
- /**
- * @treatAsPrivate
- *
- * Updates the initial directory used by the file chooser.
- *
- * @param chosenFile the selected file from which the initial directory is set.
- */
- public static void updateNextInitialDirectory(File chosenFile) {
- assert chosenFile != null;
-
- final Path chosenFolder = chosenFile.toPath().getParent();
- if (chosenFolder != null) {
- nextInitialDirectory = chosenFolder.toFile();
- }
- }
-
- /**
- * @treatAsPrivate
- *
- * @return true if the current FXOM document represents a 3D layout, false
- * otherwise.
- */
- public boolean is3D() {
- boolean res = false;
- FXOMDocument doc = getFxomDocument();
-
- if (doc != null) {
- Object sgroot = doc.getSceneGraphRoot();
-
- if (sgroot instanceof Node) {
- final Bounds rootBounds = ((Node)sgroot).getLayoutBounds();
- res = (rootBounds.getDepth() > 0);
- }
- }
-
- return res;
- }
-
-
- /**
- * @treatAsPrivate
- *
- * @return true if the current FXOM document is an instance of a Node, false
- * otherwise.
- */
- public boolean isNode() {
- boolean res = false;
- FXOMDocument doc = getFxomDocument();
-
- if (doc != null) {
- Object sgroot = doc.getSceneGraphRoot();
-
- if (sgroot instanceof Node) {
- res = true;
- }
- }
-
- return res;
- }
-
- /**
- * @treatAsPrivate
- *
- * @return true if the current selection objects are all instances of a Node,
- * false otherwise.
- */
- public boolean isSelectionNode() {
- final AbstractSelectionGroup asg = selection.getGroup();
- if (asg instanceof ObjectSelectionGroup) {
- final ObjectSelectionGroup osg = (ObjectSelectionGroup) asg;
- for (FXOMObject fxomObject : osg.getItems()) {
- final boolean isNode = fxomObject.getSceneGraphObject() instanceof Node;
- if (isNode == false) {
- return false;
- }
- }
- } else {
- return false;
- }
- return true;
- }
-
- /*
- * Private
- */
-
- private boolean isSelectionControl() {
- final AbstractSelectionGroup asg = selection.getGroup();
- if (asg instanceof ObjectSelectionGroup) {
- final ObjectSelectionGroup osg = (ObjectSelectionGroup) asg;
- for (FXOMObject fxomObject : osg.getItems()) {
- final boolean isControl = fxomObject.getSceneGraphObject() instanceof Control;
- if (isControl == false) {
- return false;
- }
- }
- } else {
- return false;
- }
- return true;
- }
-
- private void updateFxomDocument(String fxmlText, URL fxmlLocation, ResourceBundle resources) throws IOException {
- final FXOMDocument newFxomDocument;
-
- if (fxmlText != null) {
- newFxomDocument = new FXOMDocument(fxmlText, fxmlLocation, getLibrary().getClassLoader(), resources);
- } else {
- newFxomDocument = null;
- }
- jobManager.clear();
- selection.clear();
- messageLog.clear();
- errorReport.setFxomDocument(newFxomDocument);
- fxomDocumentProperty.setValue(newFxomDocument);
-
- watchingController.fxomDocumentDidChange();
-
- }
-
- private final ChangeListener libraryClassLoaderListener
- = (ov, t, t1) -> libraryClassLoaderDidChange();
-
- private void libraryClassLoaderDidChange() {
- if (getFxomDocument() != null) {
- errorReport.forget();
- getFxomDocument().setClassLoader(libraryProperty.get().getClassLoader());
- }
- }
-
- private void resourcesDidChange() {
- if (getFxomDocument() != null) {
- errorReport.forget();
- getFxomDocument().setResources(getResources());
- }
- }
-
- private void jobManagerRevisionDidChange() {
- errorReport.forget();
- watchingController.jobManagerRevisionDidChange();
-// setPickModeEnabled(false);
- }
-}
diff --git a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/EditorPlatform.java b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/EditorPlatform.java
deleted file mode 100644
index 41302848cb..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/EditorPlatform.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (c) 2012, 2015, Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.oracle.javafx.scenebuilder.kit.editor;
-
-import com.oracle.javafx.scenebuilder.kit.util.Deprecation;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Locale;
-import javafx.scene.input.MouseEvent;
-
-/**
- * This class contains static methods that depends on the platform.
- *
- * @treatAsPrivate
- */
-public class EditorPlatform {
-
- private static final String osName = System.getProperty("os.name").toLowerCase(Locale.ROOT); //NOI18N
-
- /**
- * True if current platform is running Linux.
- */
- public static final boolean IS_LINUX = osName.contains("linux"); //NOI18N
-
- /**
- * True if current platform is running Mac OS X.
- */
- public static final boolean IS_MAC = osName.contains("mac"); //NOI18N
-
- /**
- * True if current platform is running Windows.
- */
- public static final boolean IS_WINDOWS = osName.contains("windows"); //NOI18N
-
- /**
- * This URL is where you go when the user takes Scene Builder Help action (shortcut F1)
- */
- public static final String DOCUMENTATION_URL = "https://docs.oracle.com/javafx/index.html"; //NOI18N
-
- /**
- * Javadoc home (for Inspector and CSS Analyzer properties)
- */
- public final static String JAVADOC_HOME = "https://docs.oracle.com/javase/8/javafx/api/"; //NOI18N
-
-
- /**
- * Themes supported by Scene Builder Kit.
- */
- public enum Theme {
-
- MODENA,
- MODENA_TOUCH,
- MODENA_HIGH_CONTRAST_BLACK_ON_WHITE,
- MODENA_HIGH_CONTRAST_WHITE_ON_BLACK,
- MODENA_HIGH_CONTRAST_YELLOW_ON_BLACK,
- MODENA_TOUCH_HIGH_CONTRAST_BLACK_ON_WHITE,
- MODENA_TOUCH_HIGH_CONTRAST_WHITE_ON_BLACK,
- MODENA_TOUCH_HIGH_CONTRAST_YELLOW_ON_BLACK,
- CASPIAN,
- CASPIAN_HIGH_CONTRAST,
- CASPIAN_EMBEDDED,
- CASPIAN_EMBEDDED_HIGH_CONTRAST,
- CASPIAN_EMBEDDED_QVGA,
- CASPIAN_EMBEDDED_QVGA_HIGH_CONTRAST
- }
-
- /**
- * Returns the url string for locating the specified stylesheet.
- * SB uses a set of CSS files aggregating several @import statements (see DTL-6799).
- *
- * @param theme theme for which string should be computed
- * @return string for locating the specified stylesheet.
- */
- public static String getThemeStylesheetURL(Theme theme) {
- final String result;
-
- switch (theme) {
- default:
- result = null;
- break;
- case MODENA:
- result = Deprecation.MODENA_STYLESHEET;
- break;
- case MODENA_TOUCH:
- result = Deprecation.MODENA_TOUCH_STYLESHEET;
- break;
- case MODENA_HIGH_CONTRAST_BLACK_ON_WHITE:
- result = Deprecation.MODENA_HIGHCONTRAST_BLACKONWHITE_STYLESHEET;
- break;
- case MODENA_HIGH_CONTRAST_WHITE_ON_BLACK:
- result = Deprecation.MODENA_HIGHCONTRAST_WHITEONBLACK_STYLESHEET;
- break;
- case MODENA_HIGH_CONTRAST_YELLOW_ON_BLACK:
- result = Deprecation.MODENA_HIGHCONTRAST_YELLOWONBLACK_STYLESHEET;
- break;
- case MODENA_TOUCH_HIGH_CONTRAST_BLACK_ON_WHITE:
- result = Deprecation.MODENA_TOUCH_HIGHCONTRAST_BLACKONWHITE_STYLESHEET;
- break;
- case MODENA_TOUCH_HIGH_CONTRAST_WHITE_ON_BLACK:
- result = Deprecation.MODENA_TOUCH_HIGHCONTRAST_WHITEONBLACK_STYLESHEET;
- break;
- case MODENA_TOUCH_HIGH_CONTRAST_YELLOW_ON_BLACK:
- result = Deprecation.MODENA_TOUCH_HIGHCONTRAST_YELLOWONBLACK_STYLESHEET;
- break;
- case CASPIAN:
- result = Deprecation.CASPIAN_STYLESHEET;
- break;
- case CASPIAN_HIGH_CONTRAST:
- result = Deprecation.CASPIAN_HIGHCONTRAST_STYLESHEET;
- break;
- case CASPIAN_EMBEDDED:
- result = Deprecation.CASPIAN_EMBEDDED_STYLESHEET;
- break;
- case CASPIAN_EMBEDDED_HIGH_CONTRAST:
- result = Deprecation.CASPIAN_EMBEDDED_HIGHCONTRAST_STYLESHEET;
- break;
- case CASPIAN_EMBEDDED_QVGA:
- result = Deprecation.CASPIAN_EMBEDDED_QVGA_STYLESHEET;
- break;
- case CASPIAN_EMBEDDED_QVGA_HIGH_CONTRAST:
- result = Deprecation.CASPIAN_EMBEDDED_QVGA_HIGHCONTRAST_STYLESHEET;
- break;
- }
-
- if (!theme.equals(Theme.MODENA)) {
- assert result != null : "Missing logic for " + theme;
- }
-
- return result;
- }
-
- public static String getPlatformThemeStylesheetURL() {
- // Return USER_AGENT css, which is Modena for fx 8.0
- return Deprecation.MODENA_STYLESHEET;
- }
-
- public static boolean isModena(Theme theme) {
- return theme.toString().startsWith("MODENA");
- }
-
- public static boolean isModenaBlackonwhite(Theme theme) {
- return isModena(theme)
- && theme.toString().contains("BLACK_ON_WHITE");
- }
-
- public static boolean isModenaWhiteonblack(Theme theme) {
- return isModena(theme)
- && theme.toString().contains("WHITE_ON_BLACK");
- }
-
- public static boolean isModenaYellowonblack(Theme theme) {
- return isModena(theme)
- && theme.toString().contains("YELLOW_ON_BLACK");
- }
-
- public static boolean isModenaHighContrast(Theme theme) {
- return isModena(theme)
- && theme.toString().contains("HIGH_CONTRAST");
- }
-
- public static boolean isModenaTouch(Theme theme) {
- return isModena(theme)
- && theme.toString().contains("TOUCH");
- }
-
- public static boolean isModenaTouchHighContrast(Theme theme) {
- return isModena(theme)
- && theme.toString().contains("HIGH_CONTRAST")
- && theme.toString().contains("TOUCH");
- }
-
- public static boolean isCaspian(Theme theme) {
- return theme.toString().startsWith("CASPIAN");
- }
-
- /**
- * Requests the underlying platform to open a given file. On Linux, it runs
- * 'xdg-open'. On Mac, it runs 'open'. On Windows, it runs 'cmd /c start'.
- *
- * @param path path for the file to be opened
- * @throws IOException if an error occurs
- */
- public static void open(String path) throws IOException {
- List args = new ArrayList<>();
- if (EditorPlatform.IS_MAC) {
- args.add("open"); //NOI18N
- args.add(path);
- } else if (EditorPlatform.IS_WINDOWS) {
- args.add("cmd"); //NOI18N
- args.add("/c"); //NOI18N
- args.add("start"); //NOI18N
-
- if (path.contains(" ")) { //NOI18N
- args.add("\"html\""); //NOI18N
- }
-
- args.add(path);
- } else if (EditorPlatform.IS_LINUX) {
- // xdg-open does fine on Ubuntu, which is a Debian.
- // I've no idea how it does with other Linux flavors.
- args.add("xdg-open"); //NOI18N
- args.add(path);
- }
-
- if (!args.isEmpty()) {
- executeDaemon(args, null);
- }
- }
-
- /**
- * Requests the underlying platform to "reveal" the specified folder. On
- * Linux, it runs 'nautilus'. On Mac, it runs 'open'. On Windows, it runs
- * 'explorer /select'.
- *
- * @param filePath path for the folder to be revealed
- * @throws IOException if an error occurs
- */
- public static void revealInFileBrowser(File filePath) throws IOException {
- List args = new ArrayList<>();
- String path = filePath.toURI().toURL().toExternalForm();
- if (EditorPlatform.IS_MAC) {
- args.add("open"); //NOI18N
- args.add("-R"); //NOI18N
- args.add(path);
- } else if (EditorPlatform.IS_WINDOWS) {
- args.add("explorer"); //NOI18N
- args.add("/select," + path); //NOI18N
- } else if (EditorPlatform.IS_LINUX) {
- // nautilus does fine on Ubuntu, which is a Debian.
- // I've no idea how it does with other Linux flavors.
- args.add("nautilus"); //NOI18N
- // The nautilus that comes with Ubuntu up to 11.04 included doesn't
- // take a file path as parameter (you get an error popup), you must
- // provide a dir path.
- // Starting with Ubuntu 11.10 (the first based on kernel 3.x) a
- // file path is well managed.
- int osVersionNumerical = Integer.parseInt(System.getProperty("os.version").substring(0, 1)); //NOI18N
- if (osVersionNumerical < 3) {
- // Case Ubuntu 10.04 to 11.04: What you provide to nautilus is
- // the name of the directory containing the file you want to see
- // listed. See DTL-5384.
- path = filePath.getAbsoluteFile().getParent();
- if (path == null) {
- path = "."; //NOI18N
- }
- }
- args.add(path);
- } else {
- // Not Supported
- }
-
- if (!args.isEmpty()) {
- executeDaemon(args, null);
- }
- }
-
- /**
- * Returns true if the modifier key for continuous selection is down.
- *
- * @param e mouse event to check (never null)
- * @return true if the modifier key for continuous selection is down.
- */
- public static boolean isContinuousSelectKeyDown(MouseEvent e) {
- return e.isShiftDown();
- }
-
- /**
- * Returns true if the modifier key for non-continuous selection is down.
- *
- * @param e mouse event to check (never null).
- * @return true if the modifier key for non-continuous selection is down.
- */
- public static boolean isNonContinousSelectKeyDown(MouseEvent e) {
- return IS_MAC ? e.isMetaDown(): e.isControlDown();
- }
-
- /**
- * Returns true if the jvm is running with assertions enabled.
- *
- * @return true if the jvm is running with assertions enabled.
- */
- public static boolean isAssertionEnabled() {
- return EditorPlatform.class.desiredAssertionStatus();
- }
-
- /*
- * Private
- */
- private static void executeDaemon(List cmd, File wDir) throws IOException {
- try {
- ProcessBuilder builder = new ProcessBuilder(cmd);
- builder = builder.directory(wDir);
- builder.start();
- } catch (RuntimeException ex) {
- throw new IOException(ex);
- }
- }
-
-}
diff --git a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/JobManager.java b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/JobManager.java
deleted file mode 100644
index 932b4a12dd..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/JobManager.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.oracle.javafx.scenebuilder.kit.editor;
-
-import com.oracle.javafx.scenebuilder.kit.editor.job.Job;
-import com.oracle.javafx.scenebuilder.kit.editor.job.reference.UpdateReferencesJob;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import javafx.beans.property.ReadOnlyIntegerProperty;
-import javafx.beans.property.SimpleIntegerProperty;
-
-/**
- * @treatAsPrivate
- */
-public class JobManager {
-
- private final EditorController editorController;
- private final int undoStackMaxSize;
- private final List undoStack = new ArrayList<>();
- private final List redoStack = new ArrayList<>();
- private final SimpleIntegerProperty revision = new SimpleIntegerProperty();
- private boolean lock;
-
-
- JobManager(EditorController editorController, int undoStackMaxSize) {
- assert editorController != null;
- assert undoStackMaxSize >= 1;
- this.editorController = editorController;
- this.undoStackMaxSize = undoStackMaxSize;
- }
-
-
- public List getUndoStack() {
- return Collections.unmodifiableList(undoStack);
- }
-
- public List getRedoStack() {
- return Collections.unmodifiableList(redoStack);
- }
-
- public void push(Job job) {
- assert job != null;
- assert job.getEditorController() == editorController;
- assert job.isExecutable();
-
- if (lock) {
- // Method is called from a revision property listener
- throw new IllegalStateException("Pushing jobs from another job or a job manager listener is forbidden"); //NOI18N
- }
-
- final Job fixJob = new UpdateReferencesJob(job);
- executeJob(fixJob);
- undoStack.add(0, fixJob);
- if (undoStack.size() > undoStackMaxSize) {
- undoStack.remove(undoStack.size()-1);
- }
- redoStack.clear();
- incrementRevision();
-
- }
-
- public void clear() {
- if (lock) {
- // Method is called from a revision property listener
- throw new IllegalStateException("Clearing job stack from another job or a job manager listener is forbidden"); //NOI18N
- }
-
- undoStack.clear();
- redoStack.clear();
- // We don't change the revision.
- }
-
- public boolean canUndo() {
- return undoStack.isEmpty() == false;
- }
-
- public String getUndoDescription() {
- final String result;
- if (canUndo()) {
- result = undoStack.get(0).getDescription();
- } else {
- result = null;
- }
- return result;
- }
-
- public void undo() {
- assert canUndo();
-
- if (lock) {
- // Method is called from a revision property listener
- throw new IllegalStateException("Undoing jobs from another job or a job manager listener is forbidden"); //NOI18N
- }
-
- final Job job = undoStack.get(0);
- undoJob(job);
- undoStack.remove(0);
- redoStack.add(0, job);
- incrementRevision();
- }
-
- public boolean canRedo() {
- return redoStack.isEmpty() == false;
- }
-
- public String getRedoDescription() {
- final String result;
- if (canRedo()) {
- result = redoStack.get(0).getDescription();
- } else {
- result = null;
- }
- return result;
- }
-
- public void redo() {
- assert canRedo();
-
- if (lock) {
- // Method is called from a revision property listener
- throw new IllegalStateException("Redoing jobs from another job or a job manager listener is forbidden"); //NOI18N
- }
-
- final Job job = redoStack.get(0);
- redoJob(job);
- redoStack.remove(0);
- undoStack.add(0, job);
- incrementRevision();
- }
-
- /**
- * Returns the property holding the revision number of this job manager.
- * Job manager adds +1 to this number each time a job is done or undone.
- *
- * @return the property holding the revision number of this job manager.
- */
- public ReadOnlyIntegerProperty revisionProperty() {
- return revision;
- }
-
- /**
- * Returns the job which has just been processed and which can be undone.
- *
- * @return the current job, which is the one at index 0 in the undo stack.
- * It can be null.
- */
- public Job getCurrentJob() {
- if (undoStack.size() > 0) {
- return undoStack.get(0);
- } else {
- return null;
- }
- }
-
-
- /*
- * Private
- */
-
- private void executeJob(Job job) {
- lock = true;
- try {
- job.execute();
- } finally {
- lock = false;
- }
- }
-
-
- private void undoJob(Job job) {
- lock = true;
- try {
- job.undo();
- } finally {
- lock = false;
- }
- }
-
-
- private void redoJob(Job job) {
- lock = true;
- try {
- job.redo();
- } finally {
- lock = false;
- }
- }
-
-
- private void incrementRevision() {
- lock = true;
- try {
- revision.set(revision.get()+1);
- } finally {
- lock = false;
- }
- }
-}
diff --git a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/WatchingController.java b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/WatchingController.java
deleted file mode 100644
index 03000fff99..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/WatchingController.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-package com.oracle.javafx.scenebuilder.kit.editor;
-
-import com.oracle.javafx.scenebuilder.kit.fxom.FXOMAssetIndex;
-import com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument;
-import com.oracle.javafx.scenebuilder.kit.util.FileWatcher;
-import java.nio.file.Path;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Locale;
-import javafx.application.Platform;
-
-/**
- *
- */
-class WatchingController implements FileWatcher.Delegate {
-
- private final EditorController editorController;
- private final FileWatcher fileWatcher
- = new FileWatcher(2000 /*ms*/, this, EditorController.class.getSimpleName());
-
- public WatchingController(EditorController editorController) {
- this.editorController = editorController;
- }
-
- public void fxomDocumentDidChange() {
- updateFileWatcher();
- }
-
- public void jobManagerRevisionDidChange() {
- updateFileWatcher();
- }
-
- public void start() {
- fileWatcher.start();
- }
-
- public void stop() {
- fileWatcher.stop();
- }
-
- public boolean isStarted() {
- return fileWatcher.isStarted();
- }
-
- /*
- * FileWatcher.Delegate
- */
-
- @Override
- public void fileWatcherDidWatchTargetCreation(Path target) {
- assert Platform.isFxApplicationThread();
- updateEditorController("file.watching.file.created", target); //NOI18N
- }
-
- @Override
- public void fileWatcherDidWatchTargetDeletion(Path target) {
- assert Platform.isFxApplicationThread();
- updateEditorController("file.watching.file.deleted", target); //NOI18N
- }
-
- @Override
- public void fileWatcherDidWatchTargetModification(Path target) {
- assert Platform.isFxApplicationThread();
- updateEditorController("file.watching.file.modified", target); //NOI18N
- }
-
-
- /*
- * Private
- */
-
- private void updateFileWatcher() {
-
- final FXOMDocument fxomDocument = editorController.getFxomDocument();
- final Collection targets;
- if (fxomDocument == null) {
- targets = Collections.emptyList();
- } else {
- final FXOMAssetIndex assetIndex = new FXOMAssetIndex(fxomDocument);
- targets = assetIndex.getFileAssets().keySet();
- }
- fileWatcher.setTargets(targets);
- }
-
- private void updateEditorController(String messageKey, Path target) {
- final String targetFileName = target.getFileName().toString();
- editorController.getMessageLog().logInfoMessage(messageKey, targetFileName);
- editorController.getErrorReport().forget();
- if (targetFileName.toLowerCase(Locale.ROOT).endsWith(".css")) { //NOI18N
- editorController.getErrorReport().cssFileDidChange(target);
- editorController.getFxomDocument().reapplyCSS(target);
- } else {
- editorController.getFxomDocument().refreshSceneGraph();
- }
- }
-}
diff --git a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/css/Theme.css b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/css/Theme.css
deleted file mode 100644
index 7a34f39c32..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/css/Theme.css
+++ /dev/null
@@ -1,1261 +0,0 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*******************************************************************************
- * *
- * Preset colours for the theme *
- * *
- ******************************************************************************/
-
-.theme-presets {
- -sb-base: rgb(147, 147, 147);
- -sb-base-dark: derive(-sb-base, -25%);
-
- -sb-header-text: derive(-sb-base, -70%);
- -sb-header-text-dimmed: derive(-sb-base, -30%);
- -sb-header-detail: derive(-sb-base, -40%);
- -sb-header-height: 32;
-
- -sb-content-text: derive(-sb-base, -50%);
- -sb-content-text-dimmed: derive(-sb-base, -20%);
- -sb-content-detail: derive(-sb-base, -25%);
- -sb-content-background: derive(-sb-base, 98%);
-
- -sb-grad-hi: derive(-sb-base, 110%);
- -sb-sharp-edge-hi: derive(-sb-base, 90%);
- -sb-flat: derive(-sb-base, 60%);
- -sb-sharp-edge-lo: derive(-sb-base, 20%);
-
- -sb-scrollbar-thumb: derive(-sb-base, 60%);
-
- -sb-focus-color: -fx-focus-color;
- -sb-focus-inner-background: rgba(255, 255, 255, 0.4);
- -sb-selected-bar-color: rgb(75, 155, 210);
- -sb-selected-bar-unfocused-color: derive(-sb-content-background, -15%);
-
- -sb-line-art: derive(-sb-base, 40%);
- -sb-line-art-accent: red;
-
- -sb-css-winner-color: rgb(210, 240, 255);
- -sb-warning-panel: rgb(230, 225, 140);
- -sb-warning-panel-text: derive(-sb-base, -50%);
- -sb-warning-panel-text-dimmed: derive(-sb-base, -20%);
- -sb-message-panel: rgb(185, 220, 240);
-}
-
-/*******************************************************************************
- * *
- * Common UI Styling *
- * *
- ******************************************************************************/
-
-/*******************************************************************************
- * Common UI Styling - Controls *
- ******************************************************************************/
-
-.theme-presets .context-menu {
- -fx-background-color: -sb-sharp-edge-lo, white;
- -fx-background-insets: 0, 1;
- -fx-background-radius: 0;
-}
-.theme-presets .custom-menu-item {
- -fx-padding: 4 8 4 8;
-}
-.theme-presets .custom-menu-item:focused {
- -fx-background: white;
- -fx-background-color: -fx-background;
-}
-
-/*******************************************************************************
- * Common UI Styling - Cog Button *
- ******************************************************************************/
-
-.theme-presets .cog-shape {
- -fx-shape: "M15.385,6.769h-0.738c-0.338,0-0.697-0.265-0.797-0.587L13.424,5.15c-0.158-0.298-0.094-0.74,0.145-0.978l0.523-0.523
- c0.242-0.239,0.242-0.632,0-0.872l-0.869-0.868c-0.24-0.241-0.633-0.241-0.873,0l-0.521,0.523
- c-0.238,0.239-0.682,0.304-0.979,0.144L9.818,2.152C9.496,2.052,9.23,1.692,9.23,1.354V0.615C9.23,0.277,8.953,0,8.615,0H7.386
- C7.047,0,6.77,0.277,6.77,0.615v0.739c0,0.338-0.265,0.697-0.586,0.798L5.152,2.576c-0.299,0.16-0.739,0.097-0.978-0.144
- L3.65,1.909c-0.24-0.241-0.631-0.241-0.872,0L1.91,2.777c-0.241,0.24-0.241,0.633,0,0.871l0.522,0.524
- C2.672,4.41,2.738,4.853,2.578,5.15L2.152,6.183C2.052,6.504,1.692,6.77,1.355,6.77l-0.74-0.001C0.277,6.769,0,7.046,0,7.385v1.23
- C0,8.951,0.277,9.23,0.615,9.23h0.74c0.337,0,0.695,0.266,0.797,0.588l0.426,1.029c0.158,0.299,0.094,0.742-0.146,0.979L1.91,12.35
- c-0.241,0.24-0.241,0.633,0,0.873l0.868,0.869c0.241,0.24,0.632,0.24,0.872,0l0.523-0.523c0.237-0.238,0.679-0.305,0.977-0.143
- l1.033,0.424c0.321,0.1,0.586,0.459,0.586,0.797v0.738C6.77,15.723,7.047,16,7.386,16h1.229c0.338,0,0.615-0.277,0.615-0.615
- v-0.738c0-0.338,0.266-0.697,0.588-0.797l1.031-0.424c0.301-0.162,0.74-0.096,0.98,0.143l0.52,0.523c0.24,0.24,0.633,0.24,0.873,0
- l0.869-0.869c0.242-0.24,0.242-0.633,0-0.873l-0.523-0.523c-0.238-0.236-0.303-0.68-0.145-0.979l0.426-1.029
- c0.1-0.322,0.459-0.588,0.797-0.588h0.738C15.725,9.23,16,8.953,16,8.615v-1.23C16,7.046,15.725,6.769,15.385,6.769z M11.582,7.998
- c0,1.979-1.602,3.58-3.578,3.58c-1.979,0-3.582-1.602-3.582-3.58c0-1.978,1.603-3.58,3.582-3.58
- C9.98,4.418,11.582,6.021,11.582,7.998z";
- -fx-background-color: -sb-header-detail;
- -fx-min-width: 8;
- -fx-max-width: 8;
- -fx-min-height: 8;
- -fx-max-height: 8;
-}
-.theme-presets .property-sheet .cog-shape {
- -fx-background-color: -sb-content-detail;
-}
-
-/*******************************************************************************
- * Common UI Styling - Accordion and TitledPane and search area shadows *
- ******************************************************************************/
-
-.theme-presets .accordion > .titled-pane > .title {
- -fx-background-color:
- derive(-sb-content-background, -35%), -sb-sharp-edge-lo, -sb-sharp-edge-hi, -sb-flat;
- -fx-background-insets: 0 0 -1 0, 0, 1 0 0 0, 2 0 0 0;
- -fx-padding: 0.385em 0.692em 0.231em 0.692em;
- -fx-font-size: 0.875em;
- -fx-alignment: center-right;
- -fx-effect: dropshadow( two-pass-box, rgba(0, 0, 0, 0.2), 5, 0.0, 0, 1 );
-}
-.theme-presets .accordion > .titled-pane > .title > .text {
- -fx-fill: -sb-header-text;
-}
-.theme-presets .accordion > .first-titled-pane > .title {
- -fx-background-insets: 0 0 -1 0, 0, 1 0 1 0, 2 0 0 0;
-}
-.theme-presets .accordion > .titled-pane > .title > .arrow-button {
- -fx-padding: -0.154em 0.583em 0.0em 0.0em;
-}
-.theme-presets .accordion > .titled-pane > .title > .arrow-button > .arrow {
- -fx-background-color: -sb-header-detail;
- -fx-padding: 0.154em 0.231em 0.231em 0.231em; /* 2 3 3 3 */
-}
-.theme-presets .pane-shadow {
- -fx-background-color: derive(-sb-content-background, -35%);
- -fx-effect: dropshadow( two-pass-box, rgba(0, 0, 0, 0.6), 5, 0.0, 0, 0 );
-}
-
-/*******************************************************************************
- * Common UI Styling - Panel Backgrounds *
- ******************************************************************************/
-
-.theme-presets .property-sheet,
-.theme-presets .property-sheet > .viewport,
-.theme-presets .SBKIT-library-panel,
-.theme-presets .SBKIT-library-panel .accordion > .titled-pane > .content,
-.theme-presets .SBKIT-hierarchy-panel .tree-view {
- -fx-border-color: null;
- -fx-border-width: 0;
- -fx-background-color: -sb-content-background;
- -fx-background-insets: 0;
- -fx-padding: 0;
-}
-
-.theme-presets .titled-pane > .content {
- -fx-border-width: 0;
- -fx-border-insets: 0;
-}
-
-/*******************************************************************************
- * Common UI Styling - Split Panes *
- ******************************************************************************/
-
-.theme-presets .split-pane {
- -fx-background-color: -sb-base-dark;
- -fx-background-insets: 0;
- -fx-padding: 0;
-}
-.theme-presets .split-pane > .split-pane-divider {
- -fx-background-color: -sb-base-dark;
- -fx-padding: 0 0.5 0 0;
-}
-.theme-presets .split-pane:horizontal .split-pane-divider .horizontal-grabber,
-.theme-presets .split-pane:vertical .split-pane-divider .vertical-grabber {
- -fx-padding: 3;
- -fx-shape: "";
-}
-
-/*******************************************************************************
- * Common UI Styling - ScrollBars *
- ******************************************************************************/
-
-.theme-presets .scroll-bar .track-background {
- -fx-background-color: transparent;
-}
-.theme-presets .scroll-bar:vertical > .decrement-button,
-.theme-presets .scroll-bar:vertical > .increment-button {
- -fx-padding: 0.077em 0.769em 0.077em 0.615em;
-}
-.theme-presets .scroll-bar:horizontal > .decrement-button,
-.theme-presets .scroll-bar:horizontal > .increment-button {
- -fx-padding: 0.692em 0.077em 0.692em 0.077em;
-}
-.theme-presets .scroll-bar .increment-arrow,
-.theme-presets .scroll-bar .decrement-arrow {
- -fx-padding: 0;
-}
-.theme-presets .scroll-bar:vertical {
- -fx-background-color: -sb-sharp-edge-lo, -sb-content-background;
- -fx-background-insets: 0 0 0 0, 0 0 0 1;
-}
-.theme-presets .scroll-bar:horizontal {
- -fx-background-color: -sb-sharp-edge-lo, -sb-content-background;
- -fx-background-insets: 0, 1 0 0 0;
-}
-.theme-presets .scroll-bar .thumb {
- -fx-background-color: derive(-sb-sharp-edge-lo, 0%), -sb-scrollbar-thumb;
- -fx-background-radius: 10, 10;
-}
-.theme-presets .scroll-bar:vertical .thumb {
- -fx-background-insets: 3 4 3 4, 4 5 4 5;
-}
-.theme-presets .scroll-bar:horizontal .thumb {
- -fx-background-insets: 4 3 4 3, 5 4 5 4;
-}
-.theme-presets .scroll-pane .corner,
-.theme-presets .tree-view .virtual-flow .corner {
- -fx-background-color: -sb-sharp-edge-lo, -sb-content-background;
- -fx-background-insets: 0 -1 -1 0, 1 -1 -1 1;
-}
-
-.theme-presets .text-area .scroll-pane .scroll-bar:horizontal {
- -fx-background-insets: 0 1 1 1, 1 1 1 1;
-}
-.theme-presets .text-area .scroll-pane .scroll-bar:vertical {
- -fx-background-insets: 1 1 1 0, 1 1 1 1;
-}
-.theme-presets .text-area .scroll-pane .corner {
- -fx-background-insets: 0 1 1 0, 1 1 1 1;
-}
-
-/*******************************************************************************
- * *
- * UI Panels *
- * *
- ******************************************************************************/
-
-/*******************************************************************************
- * *
- * Library panel *
- * *
- ******************************************************************************/
-
-.theme-presets.SBKIT-library-panel .list-view {
- -fx-background-color: transparent;
- -fx-padding: 0;
-}
-.theme-presets.SBKIT-library-panel .list-view .list-cell .text {
- -fx-fill: -sb-content-text;
-}
-.theme-presets.SBKIT-library-panel .list-view .list-cell {
- -fx-background-color: transparent;
- -fx-cell-size: 1.8em;
- -fx-background-insets: 2 0 -2 0;
- -fx-padding: 2 0 0 4;
-}
-.theme-presets.SBKIT-library-panel .list-view .list-cell:filled:hover {
- -fx-background-color: null; /* no hover effect on list view */
-}
-.theme-presets.SBKIT-library-panel .list-view:focused .list-cell:filled:selected {
- -fx-background-color: -sb-selected-bar-color;
-}
-.theme-presets.SBKIT-library-panel .list-view .list-cell:filled:selected {
- /* When the ListView is not focused there is no need to highlight
- the selected item */
- -fx-background-color: null;
-}
-.theme-presets.SBKIT-library-panel .list-view .scroll-bar {
- /* Cursor may dynamically change when working in library / hierarchy.
- Set back the cursor to its default. */
- -fx-cursor: default;
-}
-
-/* ListCell graphic is an HBox */
-.theme-presets.SBKIT-library-panel .list-cell-graphic {
- -fx-alignment: center-left;
- -fx-padding: 0 2 0 2;
- -fx-spacing: 4;
-}
-
-.theme-presets.SBKIT-library-panel .library-no-results-label {
- -fx-text-fill: -sb-content-text-dimmed;
- -fx-font-size: 0.875em;
- -fx-padding: 6 0 0 10;
-}
-
-.theme-presets.SBKIT-library-panel .library-section-label {
- -fx-text-fill: derive(-sb-content-text, 10%);
- -fx-font-size: 0.875em;
- -fx-background-color:
- derive(-sb-sharp-edge-lo, 65%),
- linear-gradient(to right, derive(-sb-content-background, 40%) 0%, -sb-content-background 70%);
- -fx-background-insets: -4 -2 -4 -12, -3 -2 -3 -12;
-}
-
-.theme-presets.SBKIT-library-panel .library-classname-label {
- -fx-text-fill: -sb-content-text;
-}
-
-.theme-presets.SBKIT-library-panel .library-qualifier-label {
- -fx-text-fill: -sb-content-text-dimmed;
-}
-
-/*******************************************************************************
- * Library Panel - Jar import dialog *
- ******************************************************************************/
-
-.theme-presets .jar-import-preview-label {
- -fx-text-fill: -sb-content-text-dimmed;
- -fx-font-size : 0.875em;
-}
-
-.theme-presets .jar-import-preview {
- -fx-background-color: azure;
-}
-
-.theme-presets .jar-import-num-of-items-label {
- -fx-font-size : 0.875em;
-}
-
-.theme-presets .jar-import-class-name-label {
- -fx-text-fill: -sb-content-text-dimmed;
- -fx-font-size : 0.875em;
-}
-
-/*******************************************************************************
- * *
- * Hierarchy Panel *
- * *
- ******************************************************************************/
-
-/*******************************************************************************
- * Hierarchy Panel - TreeView / TreeTableView *
- ******************************************************************************/
-
-.theme-presets.SBKIT-hierarchy-panel .tree-cell {
- -fx-background-color: transparent;
- -fx-padding: 2 0 2 0;
- -fx-background-insets: 0 0 0 0;
-}
-.theme-presets.SBKIT-hierarchy-panel .tree-cell .label {
- -fx-text-fill: -sb-content-text;
-}
-.theme-presets.SBKIT-hierarchy-panel .hierarchy-first-cell {
-/* -fx-padding: 4 0 0 1;
- -fx-background-insets: 4 0 0 0;*/
-}
-
-/* Selected rows */
-.theme-presets.SBKIT-hierarchy-panel .tree-view:focused > .virtual-flow > .clipped-container > .sheet > .tree-cell:filled:selected,
-.theme-presets.SBKIT-hierarchy-panel .tree-table-view:focused > .virtual-flow > .clipped-container > .sheet > .tree-table-row-cell:filled:selected,
-.theme-presets.SBKIT-hierarchy-panel .tree-table-view:focused > .virtual-flow > .clipped-container > .sheet > .tree-table-row-cell .tree-table-cell:selected {
- -fx-background-color: -sb-selected-bar-color;
-}
-/* Selected rows when control is not focused */
-.theme-presets.SBKIT-hierarchy-panel .tree-cell:filled:selected,
-.theme-presets.SBKIT-hierarchy-panel .tree-table-row-cell:filled:selected,
-.theme-presets.SBKIT-hierarchy-panel .tree-table-row-cell:filled > .tree-table-cell:selected {
- -fx-background-color: -sb-selected-bar-unfocused-color;
-}
-
-/*******************************************************************************
- * Hierarchy Panel - Graphic Icon and Disclosure Arrows *
- ******************************************************************************/
-
-/* TreeCell graphic is a HBox */
-.theme-presets.SBKIT-hierarchy-panel .tree-cell-graphic {
- -fx-alignment: center-left;
- -fx-padding: 0 2 0 0;
- -fx-spacing: 2;
-}
-
-.theme-presets.SBKIT-hierarchy-panel .tree-view .tree-cell .tree-disclosure-node {
- -fx-padding: 7 6 6 9;
- -fx-background-color: derive(-sb-sharp-edge-hi, -60%), derive(-sb-sharp-edge-lo, 55%);
- -fx-background-insets: 3 2 2 5, 4 3 3 6;
- -fx-background-radius: 10;
- -fx-cursor: hand;
-}
-.theme-presets.SBKIT-hierarchy-panel .tree-view .tree-cell:expanded .tree-disclosure-node {
- -fx-background-color: derive(-sb-sharp-edge-lo, 10%), derive(-sb-sharp-edge-hi, 0%);
-}
-.theme-presets.SBKIT-hierarchy-panel .tree-view .tree-cell .tree-disclosure-node .arrow {
- -fx-shape: "M0,3h3V0h1v3h3v1H4v3H3l0-3H0V3z";
- -fx-padding: 0.2em;
- -fx-background-color: -sb-header-text;
-}
-.theme-presets.SBKIT-hierarchy-panel .tree-view .tree-cell:expanded .tree-disclosure-node .arrow {
- -fx-shape: "M0,3h7v1H0V3z M0,0L0,0L0,0L0,0L0,0z M7,7L7,7L7,7L7,7L7,7z";
- -fx-padding: 0.2em;
- -fx-background-color: -sb-content-text;
- -fx-rotate: 0;
-}
-
-/*******************************************************************************
- * Hierarchy Panel - Place holder Labels *
- ******************************************************************************/
-
-.theme-presets.SBKIT-hierarchy-panel .hierarchy-place-holder-label {
- -fx-label-padding: 0 3 0 0;
-}
-
-/*******************************************************************************
- * Hierarchy Panel - Read/Write labels and Inline editing *
- ******************************************************************************/
-
-/* editable label on node in hierarchy (info / node id / fx:id) */
-.theme-presets.SBKIT-hierarchy-panel .hierarchy-readwrite-label {
- -fx-border-color: transparent;
- -fx-border-insets: 0 1 0 0;
-}
-.theme-presets.SBKIT-hierarchy-panel .hierarchy-readwrite-label:hover {
- -fx-border-color: -sb-sharp-edge-hi;
- -fx-cursor: text;
-}
-.theme-presets.SBKIT-hierarchy-panel .hierarchy-readwrite-label .text {
- -fx-fill: -sb-content-text-dimmed;
-}
-.theme-presets.SBKIT-hierarchy-panel .hierarchy-readwrite-label:hover .text {
- -fx-fill: -sb-content-text;
-}
-
-.theme-presets.SBKIT-hierarchy-panel .inline-editor, .inline-editor:focused {
- -fx-background-color: white;
- -fx-background-insets: 0;
- -fx-border-color: rgb(25, 164, 255);
- -fx-text-fill: black;
- -fx-padding: 0 1 0 1;
-}
-
-/*******************************************************************************
- * Hierarchy Panel - Empty FXML 'drag items here' prompt *
- ******************************************************************************/
-
-.theme-presets.SBKIT-hierarchy-panel .hierarchy-prompt-label {
- -fx-font-size: 1.231em; /* 16px (base pixel size of 13px) */
- -fx-text-fill: -sb-content-text-dimmed;
- -fx-text-alignment: center;
- -fx-alignment: center;
- -fx-wrap-text: true;
- -fx-label-padding: 16;
- -fx-background-color: transparent;
- -fx-border-color: -sb-sharp-edge-lo;
- -fx-border-width: 1;
- -fx-border-style: segments(1px, 2px);
-}
-
-/*******************************************************************************
- * *
- * Content Panel *
- * *
- ******************************************************************************/
-
-.theme-presets.SBKIT-content-panel .selection-handles {
- -fx-fill: white;
- -fx-stroke: blue;
- -fx-stroke-width: 1;
- -fx-stroke-type: inside;
-}
-
-.theme-presets.SBKIT-content-panel .selection-handles-dim {
- -fx-fill: white;
- -fx-stroke: gray;
- -fx-stroke-width: 1;
- -fx-stroke-type: inside;
-}
-
-.theme-presets.SBKIT-content-panel .selection-rect {
- -fx-stroke: null;
- -fx-fill: rgba(0, 0, 0, 0.05);
-}
-
-.theme-presets.SBKIT-content-panel .selection-wire {
- -fx-stroke: rgb(25, 164, 255);
- -fx-stroke-width: 1;
- -fx-fill: null;
-}
-
-.theme-presets.SBKIT-content-panel .selection-gap {
- -fx-stroke: null;
- -fx-fill: lightgrey;
- -fx-opacity: 0.5;
-}
-
-.theme-presets.SBKIT-content-panel .parent-ring {
- /* -fx-stroke is setup from user preferences */
- -fx-stroke-width: 7;
- -fx-stroke-type: outside;
- -fx-opacity: 0.5;
- -fx-fill: null;
-}
-
-.theme-presets.SBKIT-content-panel .target-ring {
- /* -fx-stroke is setup from user preferences */
- -fx-stroke-width: 7;
- -fx-stroke-type: inside;
- -fx-opacity: 0.9;
- -fx-fill: null;
-}
-
-.theme-presets.SBKIT-content-panel .target-crack {
- -fx-stroke-width: 5;
- -fx-stroke-type: centered;
- -fx-stroke-line-cap: butt;
- -fx-stroke: black;
- -fx-opacity: 0.5;
- -fx-fill: null;
-}
-
-.theme-presets.SBKIT-content-panel .resize-rudder {
- -fx-stroke-width: 1;
- -fx-opacity: 0.3;
- -fx-stroke-dash-array: 8 8;
-}
-
-/*******************************************************************************
- * Content Panel - FXML 'drag items here' prompts *
- ******************************************************************************/
-
-.theme-presets.SBKIT-content-panel .stage-prompt {
- -fx-font-size: 1.231em; /* 16px (base pixel size of 13px) */
- -fx-text-fill: derive(-sb-content-text, 100%);
- -fx-text-alignment: center;
- -fx-alignment: center;
- -fx-wrap-text: true;
- -fx-label-padding: 16;
- -fx-background-color: transparent;
- -fx-border-color: -sb-sharp-edge-hi;
- -fx-border-width: 1;
- -fx-border-style: segments(1px, 2px);
-}
-
-.theme-presets.SBKIT-content-panel .stage-prompt-default {
- -fx-font-size: 1.231em; /* 16px (base pixel size of 13px) */
- -fx-text-fill: -sb-content-text;
- -fx-text-alignment: center;
- -fx-alignment: center;
- -fx-wrap-text: true;
- -fx-label-padding: 16;
- -fx-background-color: white;
- /*-fx-effect: dropshadow( gaussian, rgba(0, 0, 0, 0.3), 15, 0.0, 0, 10 );*/
-}
-
-/*******************************************************************************
- * Content Panel - GridPane Chrome #0 : common properties *
- ******************************************************************************/
-
-.theme-presets.SBKIT-content-panel .tray {
- -fx-border-color: rgba(255, 255, 255, 0.4), rgba(0, 0, 0, 0.5), rgba(255, 255, 255, 0.5);
- -fx-border-insets: 0, 1, 2;
- -fx-border-radius: 5 5 0 0, 4 4 0 0, 3 3 0 0;
- -fx-background-color: #bbddff; /* Can be overwritten by user preferences */
- -fx-background-radius: 2 2 0 0;
- -fx-background-insets: 3;
- -fx-alignment: center;
-}
-
-.theme-presets.SBKIT-content-panel .tray.south {
- -fx-border-radius: 0 0 5 5, 0 0 4 4, 0 0 3 3;
- -fx-background-radius: 0 0 2 2;
-}
-
-.theme-presets.SBKIT-content-panel .tray.text {
- -fx-text-fill: black;
- -fx-text-overrun: leading-word-ellipsis;
- -fx-font-size: 0.769em; /* 10px (base pixel size of 13px) */
-}
-
-.theme-presets.SBKIT-content-panel .tray.west .text {
- -fx-rotate: +90;
-}
-
-.theme-presets.SBKIT-content-panel .tray.east .text {
- -fx-rotate: -90;
-}
-
-/*******************************************************************************
- * Content Panel - GridPane Chrome #1 : trays and cells of selected gridpane *
- ******************************************************************************/
-
-.theme-presets.SBKIT-content-panel .gap {
- -fx-stroke: transparent;
- -fx-fill: rgba(0,0,0,0.2);
-}
-
-.theme-presets.SBKIT-content-panel .gap.selected {
- -fx-fill: rgba(0,0,0,0.4);
-}
-
-.theme-presets.SBKIT-content-panel .gap.hilit {
- -fx-stroke: rgba(0,0,0,0.4);
- -fx-stroke-line-cap: butt;
- /* -fx-stroke-width is setup programmatically */
-}
-
-.theme-presets.SBKIT-content-panel .gap.empty {
- -fx-stroke: rgba(0,0,0,0.4);
- -fx-stroke-line-cap: butt;
- -fx-stroke-dash-array: 3 3;
-}
-
-.theme-presets.SBKIT-content-panel .tray.selected {
- -fx-border-color: rgba(255, 255, 255, 0.4), rgba(0, 0, 0, 1), rgba(255, 255, 255, 0.5);
- -fx-background-color: yellow;
-}
-
-.theme-presets.SBKIT-content-panel .tray.selected .text {
- -fx-text-fill: rgba(0,0,0,0.8);
-}
-
-/*******************************************************************************
- * Content Panel - BorderPane *
- ******************************************************************************/
-
-.theme-presets.SBKIT-content-panel .target-ring.BorderPane {
- -fx-alignment: CENTER;
- -fx-border-width: 1;
- -fx-border-color: rgba(0,0,0,0.1);
- -fx-background-color: rgba(0,0,0,0.1);
- -fx-text-fill: grey;
-}
-
-.theme-presets.SBKIT-content-panel .target-ring.selected.BorderPane {
- -fx-alignment: CENTER;
- -fx-border-width: 1;
- -fx-border-color: rgba(0,0,0,0.1);
- -fx-background-color: rgba(0,0,0,0.4);
- -fx-text-fill: grey;
-}
-
-/*******************************************************************************
- * Content Panel - Marquee Chrome *
- ******************************************************************************/
-
-.theme-presets.SBKIT-content-panel .marquee {
-/* -fx-fill: rgba(178, 178, 229, 0.2);*/
- -fx-fill: rgba(150, 150, 150, 0.2);
- -fx-stroke: rgba(0, 0, 0, 0.3);
- -fx-stroke-type: inside;
-}
-
-/*******************************************************************************
- * Content Panel - Resize Shadow *
- ******************************************************************************/
-
-.theme-presets.SBKIT-content-panel .resize-shadow {
- -fx-background-color: rgba(255, 255, 0.0, 0.5);
- -fx-border-width: 1;
- -fx-border-style: dotted;
- -fx-border-color: black;
-}
-
-/*******************************************************************************
- * Content Panel - Resize Shadow *
- ******************************************************************************/
-
-.theme-presets.SBKIT-content-panel .css-pick-chrome {
- -fx-background-color: rgba(0.0, 255, 0.0, 0.5);
- -fx-border-width: 1;
- -fx-border-style: dotted;
- -fx-border-color: black;
-}
-
-/*******************************************************************************
- * Content Panel - Outline Mode *
- ******************************************************************************/
-
-.theme-presets.SBKIT-content-panel .outline-ring {
- -fx-stroke: rgba(0,0,0,0.2);
- -fx-stroke-type: inside;
- -fx-fill: rgba(0,0,0,0.01);
-}
-
-
-/*******************************************************************************
- * *
- * Inspector Panel *
- * *
- ******************************************************************************/
-
-.theme-presets.SBKIT-inspector-panel .secondary-section-title {
- -fx-text-fill: -sb-header-text-dimmed;
-}
-
-/* Specific css for the Inspector SplitPane */
-.theme-presets.SBKIT-inspector-panel > .split-pane-divider {
- -fx-background-color: transparent;
- -fx-background-insets: -1 0 -3 0;
- -fx-border-width: 0;
- -fx-padding: 0;
-}
-
-/*******************************************************************************
- * *
- * Property Sheet Panels (Inspector, Controller) *
- * *
- ******************************************************************************/
-
-/*******************************************************************************
- * Property Sheet Panels - General Appearance *
- ******************************************************************************/
-
-.property-sheet {
- -fx-font-size: 0.875em;
-}
-
-.theme-presets.property-sheet .label {
- -fx-text-fill: -sb-content-text;
- -fx-padding: 4 0 3 0;
-}
-
-.theme-presets.property-sheet .button,
-.theme-presets.property-sheet .toggle-button {
- -fx-text-fill: -sb-content-text;
-}
-
-.theme-presets.property-sheet .check-box .box {
- -fx-background-radius: 0;
- -fx-padding: 0.231em 0.231em 0.154em 0.154em;
-}
-.theme-presets.property-sheet .check-box:selected .box {
- -fx-background-radius: 0;
- -fx-padding: 0.308em;
-}
-.theme-presets.property-sheet .check-box:selected > .box > .mark,
-.theme-presets.property-sheet .check-box:indeterminate > .box > .mark {
- -fx-background-color: -sb-content-detail;
- -fx-background-insets: 0;
- -fx-padding: 0.308em 0.308em 0.385em 0.385em;
-}
-
-.theme-presets.property-sheet .hyperlink,
-.theme-presets.property-sheet .hyperlink:visited {
- -fx-text-fill: -sb-content-text;
- -fx-padding: 3 4 2 0;
- -fx-underline: false;
-}
-.theme-presets.property-sheet .hyperlink:hover,
-.theme-presets.property-sheet .hyperlink:visited:hover {
- -fx-underline: true;
-}
-
-.theme-presets.property-sheet .button,
-.theme-presets.property-sheet .choice-box,
-.theme-presets.property-sheet .menu-button,
-.theme-presets.property-sheet .toggle-button {
- -fx-padding: 4 6 3 6;
- -fx-background-radius: 0;
-}
-
-.theme-presets.property-sheet .text-field {
- -fx-text-fill: -sb-content-text;
- -fx-padding: 4 5 3 5;
- -fx-background-radius: 0;
-}
-
-.theme-presets.property-sheet .text-area {
- -fx-text-fill: -sb-content-text;
- -fx-background-radius: 0;
-}
-.theme-presets.property-sheet .text-area .content {
- -fx-padding: 3 5 3 5;
-}
-
-.theme-presets.property-sheet .choice-box > .open-button,
-.theme-presets.property-sheet .menu-button > .arrow-button {
- -fx-padding: 2 0 2 0;
-}
-.theme-presets.property-sheet .choice-box > .label,
-.theme-presets.property-sheet .menu-button > .label {
- -fx-padding: 0 4 0 0;
-}
-.theme-presets.property-sheet .choice-box > .open-button > .arrow,
-.theme-presets.property-sheet .menu-button > .arrow-button > .arrow {
- -fx-background-color: -sb-content-detail;
- -fx-background-insets: 0;
- -fx-padding: 0.154em 0.308em 0.154em 0.231em; /* 2 4 2 3 */
-}
-
-.theme-presets.property-sheet .small-label {
- -fx-font-size: 0.750em; /* 9 */
- -fx-text-fill: -sb-content-text-dimmed;
- -fx-padding: 0;
-}
-
-.inspector-message .text {
- /* Used for 'No Selection' and 'No Results' messages */
- -fx-fill: -sb-content-text-dimmed;
-}
-
-.theme-presets.property-sheet .cog-menubutton {
- -fx-background-color: -sb-content-background;
- -fx-background-radius: 0;
- -fx-padding: 4 0 3 1;
- -fx-graphic-text-gap: 0;
- -fx-min-width: 10;
- -fx-max-width: 10;
- -fx-min-height: 10;
-}
-.theme-presets.property-sheet .cog-menubutton:hover {
- -fx-background-color: derive(-sb-content-background, -10%), -sb-content-background;
- -fx-background-insets: 0, 1;
-}
-.theme-presets.property-sheet .cog-menubutton:focused {
- -fx-background-color: -fx-focus-color, -fx-background;
-}
-.theme-presets.property-sheet .cog-menubutton > .arrow-button {
- visibility: hidden;
- -fx-padding: 0;
-}
-.theme-presets.property-sheet .cog-menubutton > .arrow {
- -fx-shape: null;
- -fx-padding: 0;
-}
-
-/*******************************************************************************
- * Property Sheet Panels - CSS Override property decoration *
- ******************************************************************************/
-
-.theme-presets.property-sheet .css-override {
- -fx-background-color: -sb-css-winner-color;
- -fx-border-color: derive(-sb-sharp-edge-lo, 0%);
- -fx-border-style: dotted;
-}
-.theme-presets.property-sheet .css-override > .hyperlink {
- -fx-padding: 0;
-}
-
-/*******************************************************************************
- * Property Sheet Panels - Sub Section Titles *
- ******************************************************************************/
-
-.sub-section-background {
- -fx-background-color:
- derive(-sb-sharp-edge-lo, 65%),
- linear-gradient(to left, derive(-sb-content-background, 40%) 0%, -sb-content-background 70%);
- -fx-background-insets: 7 -1 8 -10, 8 -1 9 -10;
- -fx-padding: 8 10 8 0;
-}
-
-/*******************************************************************************
- * Property Sheet Panels - Insets Editor *
- ******************************************************************************/
-
-.theme-presets.property-sheet .insets-icon-top {
- -fx-background-color: -sb-content-detail, -sb-flat, -sb-content-background;
- -fx-background-insets: 0, 1 0 0 0, 1;
-}
-.theme-presets.property-sheet .insets-icon-right {
- -fx-background-color: -sb-content-detail, -sb-flat, -sb-content-background;
- -fx-background-insets: 0, 0 1 0 0, 1;
-}
-.theme-presets.property-sheet .insets-icon-bottom {
- -fx-background-color: -sb-content-detail, -sb-flat, -sb-content-background;
- -fx-background-insets: 0, 0 0 1 0, 1;
-}
-.theme-presets.property-sheet .insets-icon-left {
- -fx-background-color: -sb-content-detail, -sb-flat, -sb-content-background;
- -fx-background-insets: 0, 0 0 0 1, 1;
-}
-
-.theme-presets.property-sheet .insets-copy-button-shape {
- -fx-shape: "M1.25,7.5c-0.13,0-0.259-0.051-0.357-0.15C0.7,7.152,0.703,6.836,0.9,
- 6.643L3.598,4L0.9,1.357 C0.703,1.164,0.7,0.847,0.893,0.65c0.194-0.196,0.51-0.2,
- 0.708-0.007L5.027,4L1.6,7.357C1.502,7.453,1.376,7.5,1.25,7.5z";
- -fx-background-color: -sb-content-detail;
- -fx-min-width: 4;
- -fx-max-width: 4;
- -fx-min-height: 8;
- -fx-max-height: 8;
-}
-.theme-presets.property-sheet .insets-copy-button {
- -fx-background-color: null;
- -fx-background-radius: 0;
- -fx-min-width: 10;
- -fx-max-width: 10;
-}
-.theme-presets.property-sheet .insets-copy-button:hover {
- -fx-background-color: derive(-sb-content-background, -10%), -sb-content-background;
- -fx-background-insets: 0 1 0 1, 1 2 1 2;
-}
-.theme-presets.property-sheet .insets-copy-button:focused {
- -fx-background-color: -fx-focus-color, -fx-background;
- -fx-background-insets: 0 1 0 1, 1 2 1 2;
-}
-
-/*******************************************************************************
- * Property Sheet Panels - Rotate Editor *
- ******************************************************************************/
-
-.theme-presets.property-sheet .rotation-dial {
- -fx-background-radius: 100;
-}
-.theme-presets.property-sheet .rotation-handle {
- -fx-background-color: -sb-sharp-edge-lo, derive(-sb-flat, 30%);
- -fx-background-insets: 14 5 14 23, 15 6 15 24;
- -fx-background-radius: 20, 20;
-}
-
-/*******************************************************************************
- * Property Sheet Panels - Anchor Pane Constraints Editor *
- ******************************************************************************/
-
-.theme-presets.property-sheet .ap-constraints-outer-border {
- -fx-border-color: -sb-line-art;
- -fx-border-insets: -1;
-}
-.theme-presets.property-sheet .ap-constraints-inner-border {
- -fx-border-color: -sb-line-art;
-}
-.theme-presets.property-sheet .ap-constraints-shape {
- -fx-background-color: -sb-line-art;
-}
-.theme-presets.property-sheet .ap-constraints-toggle:selected .ap-constraints-shape {
- -fx-background-color: -sb-line-art-accent;
-}
-.theme-presets.property-sheet .ap-constraints-toggle {
- -fx-background-color: transparent;
- -fx-padding: 3;
-}
-.theme-presets.property-sheet .ap-constraints-toggle:hover {
- -fx-cursor: hand;
- -fx-background-color: #cccccc, -fx-base;
- -fx-background-insets: 1, 2;
-}
-.theme-presets.property-sheet .ap-constraints-toggle:focused {
- -fx-background-color: -fx-focus-color, -fx-inner-border, -fx-base, -fx-faint-focus-color, -fx-base;
- -fx-background-insets: -0.2, 1, 2, -1.4, 2.6;
-}
-
-/*******************************************************************************
- * Property Sheet Panels - Multi Row Editor Buttons *
- ******************************************************************************/
-
-.theme-presets.property-sheet .multi-row-plus-button {
- -fx-text-fill: -sb-content-detail;
- -fx-padding: 4 3 3 4;
- -fx-min-width: 17;
-}
-
-.theme-presets.property-sheet .multi-row-menubutton {
- -fx-padding: 4 5 3 1;
- -fx-min-width: 17;
-}
-
-/*******************************************************************************
- * Property Sheet Panels - Symbol Prefix @ @/ / # etc *
- ******************************************************************************/
-
-.theme-presets.property-sheet .symbol-prefix {
- -fx-text-fill: -sb-content-text-dimmed;
- -fx-background-color:
- derive(-sb-content-background, -15%), -sb-content-background;
- -fx-background-insets: 0, 1 0 1 1;
- -fx-padding: 4 3 3 5;
-}
-
-/*******************************************************************************
- * Property Sheet Panels - Suggestive ListView *
- ******************************************************************************/
-
-.theme-presets.property-sheet .auto-suggest-popup,
-.theme-presets.property-sheet .auto-suggest-popup .custom-menu-item {
- -fx-padding: 0;
-}
-.theme-presets.property-sheet .auto-suggest-popup .custom-menu-item .list-view {
- -fx-background-color: -sb-sharp-edge-lo, white;
- -fx-background-insets: 0, 1;
-}
-
-/*******************************************************************************
- * Property Sheet Panels - TableView *
- ******************************************************************************/
-
-.theme-presets.property-sheet .table-view .placeholder .label {
- -fx-text-fill: -sb-content-text-dimmed;
-}
-.table-cell {
- -fx-padding: 3 4 1 4;
-}
-.theme-presets.property-sheet .table-row-cell {
- -fx-background-color: -fx-table-cell-border-color, -fx-background;
-}
-.theme-presets.property-sheet .table-row-cell .text {
- -fx-fill: -sb-content-text;
-}
-.theme-presets.property-sheet .table-view .column-header,
-.theme-presets.property-sheet .table-view .filler,
-.theme-presets.property-sheet .table-view > .column-header-background > .show-hide-columns-button,
-.theme-presets.property-sheet .table-view:constrained-resize .filler,
-.theme-presets.property-sheet .tree-table-view:constrained-resize .filler {
- -fx-padding: 2 6 2 6;
-}
-.theme-presets.property-sheet .column-header .label {
- -fx-text-fill: -sb-content-text;
- -fx-font-weight: normal;
- -fx-alignment: CENTER_LEFT;
-}
-/* Selected rows when table-view IS focused */
-.theme-presets.property-sheet .table-view:focused .table-row-cell:filled:selected,
-.theme-presets.property-sheet .table-view:focused .table-row-cell .table-cell:selected {
- -fx-background: -sb-selected-bar-color;
- -fx-table-cell-border-color: -sb-selected-bar-color;
-}
-/* Selected rows when table-view is NOT focused */
-.theme-presets.property-sheet .table-view .table-row-cell:filled:selected,
-.theme-presets.property-sheet .table-view .table-row-cell .table-cell:selected {
- -fx-background: -sb-selected-bar-unfocused-color;
- -fx-table-cell-border-color: -sb-selected-bar-unfocused-color;
-}
-
-/*******************************************************************************
- * *
- * CSS Panel *
- * *
- ******************************************************************************/
-
-.theme-presets.css-panel-background {
- -fx-background-color: -sb-sharp-edge-lo, -sb-content-background;
- -fx-background-insets: 0, 1 0 0 0;
-}
-
-/*******************************************************************************
- * CSS Panel - TableView *
- ******************************************************************************/
-
-.theme-presets.SBKIT-css-panel .table-view .placeholder {
- -fx-background-color: -sb-content-background;
-}
-.theme-presets.SBKIT-css-panel .table-view .placeholder .label {
- -fx-text-fill: -sb-content-text-dimmed;
-}
-.theme-presets.SBKIT-css-panel .table-view .hyperlink {
- -fx-font-size: 0.875em;
- -fx-padding: 0 0 0 4;
- -fx-border-width: 0px;
- -fx-text-fill: -sb-content-text;
-}
-.theme-presets.SBKIT-css-panel .table-view .label {
- -fx-font-size: 0.875em;
- -fx-padding: 0 0 0 4;
- -fx-text-fill: -sb-content-text;
-}
-.theme-presets.SBKIT-css-panel .table-view {
- -fx-background-color: white;
- -fx-background-insets: 0;
- -fx-border-width: 0;
- -fx-padding: 0;
-}
-.theme-presets.SBKIT-css-panel .table-row-cell, .table-row-cell:selected {
- -fx-background-color: derive(-sb-line-art, 30%), -sb-content-background;
- -fx-background-insets: 0, 0 1 1 0;
-}
-.theme-presets.SBKIT-css-panel .table-cell {
- -fx-background-color: derive(-sb-line-art, 30%), -sb-content-background;
- -fx-background-insets: 0, 0 1 1 0;
- -fx-border-width: 0;
- -fx-padding: 0;
-}
-.theme-presets.SBKIT-css-panel .table-cell:last-visible {
- -fx-background-insets: 0, 0 0 1 0;
-}
-.theme-presets.SBKIT-css-panel .table-view .column-header {
- -fx-background-color: -sb-sharp-edge-lo, -sb-sharp-edge-hi, -sb-flat;
- -fx-background-insets: -1 0 0 0, 0 1 1 0, 1 1 1 0;
-}
-.theme-presets.SBKIT-css-panel .table-view .column-header .label {
- -fx-text-fill: -sb-content-text;
- -fx-font-weight: normal;
- -fx-alignment: CENTER_LEFT;
- -fx-padding: 0 0 0 5;
-}
-.theme-presets.SBKIT-css-panel .table-view .filler {
- -fx-background-color: -sb-sharp-edge-lo, -sb-sharp-edge-hi, -sb-flat;
- -fx-background-insets: -1 0 0 0, 0 1 1 0, 1 1 1 0;
-}
-
-.theme-presets.SBKIT-css-panel .notAppliedStyleLine .line {
- -fx-border-width: 0;
- -fx-background-color:black;
-}
-
-.theme-presets.SBKIT-css-panel .winner-background {
- -fx-background-color: -sb-css-winner-color;
- -fx-background-insets: 0 1 1 0;
-}
-
-.theme-presets.SBKIT-css-panel .note-label .text {
- -fx-font-size: 0.750em;
- -fx-fill: -sb-content-text-dimmed;
-}
-
-.theme-presets.SBKIT-css-panel .css-panel-message .text {
- /* Used for 'Multiple Selection' message */
- -fx-fill: -sb-content-text-dimmed;
- -fx-font-size: 0.875em;
-}
-
-/*******************************************************************************
- * CSS Panel - Picking Mode Toggle Buttons *
- ******************************************************************************/
-
-.theme-presets.SBKIT-css-panel .cursor-shape {
- -fx-shape: "M9.084,7.833c-1.709,0.25-3.242,0.734-3.242,0.734l2.783,4.892l-1.708,1L3.904,9.454C2.713,
- 9.967,1.208,11.5,1.208,11.5L1,1 L9.084,7.833z";
- -fx-background-color: -sb-content-text;
- -fx-min-width: 8;
- -fx-max-width: 8;
- -fx-min-height: 13;
- -fx-max-height: 13;
-}
-
-.theme-presets.SBKIT-css-panel .css-cursor-shape {
- -fx-shape: "M9.083,7.833C4.833,8.25,1,11,1,11V1L9.083,7.833z M8,14H6v-3h2v-1H5v5h3V14z M12,
- 12h-2v-1h2v-1H9v3h2v1H9v1h3V12z M16,12 h-2v-1h2v-1h-3v3h2v1h-2v1h3V12z";
- -fx-background-color: -sb-content-text;
- -fx-min-width: 15;
- -fx-max-width: 15;
- -fx-min-height: 15;
- -fx-max-height: 15;
-}
-
-.theme-presets.SBKIT-css-panel .toggle-button {
- -fx-background-color: -sb-sharp-edge-lo, -sb-sharp-edge-hi, -sb-flat;
- -fx-background-insets: 0, 0 0 1 0, 1 0 1 0;
- -fx-background-radius: 0;
- -fx-min-width: 25;
- -fx-min-height: 25;
-}
-.theme-presets.SBKIT-css-panel .toggle-button:selected {
- -fx-background-color:
- derive(-sb-sharp-edge-lo, -25%),
- derive(-sb-sharp-edge-lo, -10%),
- linear-gradient(to bottom, derive(-sb-flat, -20% ) 0%, derive(-sb-flat, -12% ) 20%);
- -fx-background-insets: -1 0 0 0, 0, 0 1 1 1;
-}
-.theme-presets.SBKIT-css-panel .toggle-button:focused {
- -fx-background-color:
- -fx-focus-color,
- linear-gradient(to bottom, derive(-sb-flat, -20% ) 0%, derive(-sb-flat, -12% ) 20%);
- -fx-background-insets: -1 0 0 0, 0 1 1 1;
-}
-.theme-presets.SBKIT-css-panel .css-toggle-left {
- -fx-background-insets: 0, 0 0 1 1, 1 0 1 1;
-}
-
-/*******************************************************************************
- * CSS Panel - Stylelable Path *
- ******************************************************************************/
-
-.theme-presets.SBKIT-css-panel .styleable-path {
- -fx-background-color: -sb-sharp-edge-lo, -sb-sharp-edge-hi, -sb-flat;
- -fx-background-insets: -1 0 0 0, 0 0 1 0, 1 0 1 0;
-}
-.theme-presets.SBKIT-css-panel .styleable-path .label {
- -fx-font-size: 0.875em;
- -fx-text-fill: -sb-header-text;
- -fx-padding: 0 12 0 8;
-}
-.theme-presets.SBKIT-css-panel .styleable-path .hyperlink {
- -fx-font-size: 0.875em;
- -fx-text-fill: -sb-header-text;
- -fx-padding: 0 0 0 0;
- -fx-border-width: 0;
-}
-.theme-presets.SBKIT-css-panel .styleable-path .button {
- -fx-background-color: -sb-sharp-edge-lo, derive(-sb-sharp-edge-hi, 10%);
- -fx-background-insets: 0, 1;
- -fx-background-radius: 100;
- -fx-min-width: 16;
- -fx-max-width: 16;
- -fx-min-height: 16;
- -fx-max-height: 16;
-}
-.theme-presets.SBKIT-css-panel .styleable-path .button:hover {
- -fx-background-color: derive(-sb-sharp-edge-lo, -10%), derive(-sb-sharp-edge-hi, 40%);
-}
-.theme-presets.SBKIT-css-panel .styleable-path-button-shape {
- -fx-shape: "M 0 -3.5 v 7 l 4 -3.5 z";
- -fx-background-color: -sb-content-text;
- -fx-min-width: 5;
- -fx-max-width: 5;
- -fx-min-height: 6;
- -fx-max-height: 6;
-}
-.theme-presets.SBKIT-css-panel .styleable-path-optional-label .text {
- -fx-fill: -sb-header-text-dimmed;
-}
-
-/*******************************************************************************
- * CSS Panel - Lookup Button *
- ******************************************************************************/
-
-.theme-presets.SBKIT-css-panel .lookup-button {
- -fx-background-color: transparent;
- -fx-background-insets: 0;
-}
-.theme-presets.SBKIT-css-panel .lookup-button .label {
- -fx-padding: 0;
-}
-.theme-presets.SBKIT-css-panel .lookup-button .arrow-button {
- -fx-padding: 0 3 2 2;
-}
-.theme-presets.SBKIT-css-panel .lookup-button .arrow-button > .arrow {
- -fx-padding: 0 0.231em 0.154em 0.154em;
- -fx-background-color: -sb-content-detail;
- -fx-effect: null;
-}
-.theme-presets.SBKIT-css-panel .lookup-button:hover .arrow-button {
- -fx-background-color: -sb-content-detail, white;
- -fx-background-insets: 0 0 3 0, 1 1 4 0;
- -fx-background-radius: 0, 0;
-}
-
-/*******************************************************************************
- * CSS Panel - Cog Button *
- ******************************************************************************/
-
-.theme-presets.SBKIT-css-panel .css-panel-cog-menubutton {
- -fx-background-color: transparent;
- -fx-background-radius: 0;
- -fx-graphic-text-gap: 0;
- -fx-min-width: 16;
- -fx-max-width: 16;
- -fx-min-height: 12;
- -fx-max-height: 12;
-}
-.theme-presets.SBKIT-css-panel .css-panel-cog-menubutton:hover {
- -fx-background-color: derive(-sb-sharp-edge-lo, 20%), -sb-css-winner-color;
- -fx-background-insets: 0, 1;
-}
-.theme-presets.SBKIT-css-panel .css-panel-cog-menubutton:focused {
- -fx-background-color: -fx-focus-color, -fx-background;
-}
-.theme-presets.SBKIT-css-panel .css-panel-cog-menubutton > .arrow-button {
- visibility: hidden;
- -fx-padding: 0;
-}
-.theme-presets.SBKIT-css-panel .css-panel-cog-menubutton > .arrow {
- -fx-shape: null;
- -fx-padding: 0;
-}
diff --git a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/DragController.java b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/DragController.java
deleted file mode 100644
index 7a818a29f7..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/DragController.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.oracle.javafx.scenebuilder.kit.editor.drag;
-
-import java.util.List;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import javafx.application.Platform;
-import javafx.beans.property.ObjectProperty;
-import javafx.beans.property.Property;
-import javafx.beans.property.SimpleObjectProperty;
-import javafx.scene.input.TransferMode;
-
-import com.oracle.javafx.scenebuilder.kit.editor.EditorController;
-import com.oracle.javafx.scenebuilder.kit.editor.drag.source.AbstractDragSource;
-import com.oracle.javafx.scenebuilder.kit.editor.drag.source.DocumentDragSource;
-import com.oracle.javafx.scenebuilder.kit.editor.drag.target.AbstractDropTarget;
-import com.oracle.javafx.scenebuilder.kit.editor.drag.target.RootDropTarget;
-import com.oracle.javafx.scenebuilder.kit.editor.job.BatchJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.Job;
-import com.oracle.javafx.scenebuilder.kit.editor.job.atomic.BackupSelectionJob;
-import com.oracle.javafx.scenebuilder.kit.editor.job.atomic.UpdateSelectionJob;
-import com.oracle.javafx.scenebuilder.kit.fxom.FXOMObject;
-import com.oracle.javafx.scenebuilder.kit.metadata.util.DesignHierarchyPath;
-
-/**
- *
- */
-public class DragController {
-
- private final EditorController editorController;
- private final ObjectProperty dragSourceProperty
- = new SimpleObjectProperty<>(null);
- private final ObjectProperty dropTargetProperty
- = new SimpleObjectProperty<>(null);
- private LiveUpdater liveUpdater;
- private Job backupSelectionJob;
- private boolean liveUpdateEnabled;
- private boolean dropAccepted;
- private AbstractDropTarget committedDropTarget;
- private Timer mouseTimer;
-
- public DragController(EditorController editorController) {
- this.editorController = editorController;
- }
-
- public void begin(AbstractDragSource dragSource) {
- assert dragSource != null;
- assert dragSource.isAcceptable();
- assert getDragSource() == null;
- assert getDropTarget() == null;
- assert liveUpdater == null;
- assert backupSelectionJob == null;
- assert dropAccepted == false;
- assert committedDropTarget == null;
- assert mouseTimer == null;
-
- liveUpdater = new LiveUpdater(dragSource, editorController);
- dragSourceProperty.set(dragSource);
- dropTargetProperty.set(null);
-
- // Backup and clear the selection
- backupSelectionJob = new BackupSelectionJob(editorController);
- editorController.getSelection().clear();
- }
-
- public void end() {
- assert getDragSource() != null;
-
- liveUpdater.setDropTarget(null);
-
- /*
- * Note 1: we reset the drop target before performing the drop operation.
- * This makes content panel hide the drop target ring before fxom update
- * and scene graph refresh.
- * Note 2: dropAccepted is reset before dropTargetProperty
- * so that listeners can invoke isDropAccepted().
- */
- dropAccepted = false;
- dropTargetProperty.set(null);
-
- if (committedDropTarget != null) {
- assert committedDropTarget.acceptDragSource(getDragSource());
- final Job dropJob
- = committedDropTarget.makeDropJob(getDragSource(), editorController);
- final Job selectJob
- = new UpdateSelectionJob(getDragSource().getDraggedObjects(), editorController);
- final BatchJob batchJob
- = new BatchJob(editorController, dropJob.getDescription());
- if (committedDropTarget.isSelectRequiredAfterDrop()) {
- batchJob.addSubJob(backupSelectionJob);
- }
- batchJob.addSubJob(dropJob);
- if (committedDropTarget.isSelectRequiredAfterDrop()) {
- batchJob.addSubJob(selectJob);
- }
- editorController.getJobManager().push(batchJob);
- }
-
- if (mouseTimer != null) {
- mouseTimer.cancel();
- mouseTimer = null;
- }
- liveUpdater = null;
- backupSelectionJob = null;
- committedDropTarget = null;
- dragSourceProperty.set(null);
-
- }
-
- public AbstractDragSource getDragSource() {
- return dragSourceProperty.get();
- }
-
- public Property dragSourceProperty() {
- return dragSourceProperty;
- }
-
- public void setDropTarget(AbstractDropTarget newDropTarget) {
- assert getDragSource() != null;
- assert (newDropTarget == null) || (this.committedDropTarget == null);
-
- /*
- * Update drop target property.
- * Note that this.dropAccepted is updated before so that
- * drop target listeners can invoke isDropAccepted().
- */
- if (newDropTarget == null) {
- dropAccepted = false;
- } else if (isDragSourceInParentChain(newDropTarget)) {
- dropAccepted = false;
- } else {
- dropAccepted = newDropTarget.acceptDragSource(getDragSource());
- }
- dropTargetProperty.set(newDropTarget);
-
- trackMouse();
-
- if (dropAccepted) {
- assert getDropTarget() != null;
- assert getDropTarget().acceptDragSource(getDragSource());
- assert getDragSource().getDraggedObjects().isEmpty() == false;
-
- final FXOMObject firstObject = getDragSource().getDraggedObjects().get(0);
- final FXOMObject currentParent = firstObject.getParentObject();
- final FXOMObject nextParent = getDropTarget().getTargetObject();
-
- if ((currentParent == nextParent) && liveUpdateEnabled) {
- liveUpdater.setDropTarget(newDropTarget);
- }
- }
- }
-
- public AbstractDropTarget getDropTarget() {
- return dropTargetProperty.get();
- }
-
- public Property dropTargetProperty() {
- return dropTargetProperty;
- }
-
- public boolean isDropAccepted() {
- return dropAccepted;
- }
-
- public TransferMode[] getAcceptedTransferModes() {
- final TransferMode[] result;
-
- if (getDropTarget() == null) {
- result = TransferMode.NONE;
- } else if (dropAccepted) {
- if (getDragSource() instanceof DocumentDragSource) {
- result = new TransferMode[] { TransferMode.MOVE };
- } else {
- result = new TransferMode[] { TransferMode.COPY };
- }
- } else {
- result = TransferMode.NONE;
- }
-
- assert (result.length == 0) || (getDropTarget() != null);
-
- return result;
- }
-
- public void commit() {
- assert isDropAccepted();
- assert committedDropTarget == null;
-
- committedDropTarget = getDropTarget();
- }
-
- public boolean isLiveUpdated() {
- return getDropTarget() == liveUpdater.getDropTarget();
- }
-
- /*
- * Private
- */
-
- private void mouseDidStopMoving() {
- if (dropAccepted
- && (getDropTarget() != liveUpdater.getDropTarget())
- && liveUpdateEnabled) {
- liveUpdater.setDropTarget(getDropTarget());
- }
- }
-
- private static final long MOUSE_TIMER_DELAY = 500; // ms
- private void trackMouse() {
- final boolean runAsDaemon = true;
-
- if (mouseTimer == null) {
- mouseTimer = new Timer(runAsDaemon);
- } else {
- mouseTimer.cancel();
- mouseTimer = new Timer(runAsDaemon);
- }
-
- mouseTimer.schedule(new TimerTask() {
- @Override public void run() {
- Platform.runLater(() -> {
- mouseTimer = null;
- mouseDidStopMoving();
- });
- }
- }, MOUSE_TIMER_DELAY);
- }
-
- /**
- * Returns true if one of the dragged object is in the parent chain of the
- * specified drop target, false otherwise.
- *
- * @param newDropTarget the drop target
- * @return true if one of the dragged object is in the parent chain of the
- * specified drop target, false otherwise
- */
- private boolean isDragSourceInParentChain(AbstractDropTarget newDropTarget) {
- assert newDropTarget != null;
- boolean result;
-
- if (newDropTarget instanceof RootDropTarget) {
- // dragSource is dragged over an empty document
- result = false;
- } else {
- final List draggedObjects
- = getDragSource().getDraggedObjects();
- final DesignHierarchyPath dropTargetPath
- = new DesignHierarchyPath(newDropTarget.getTargetObject());
-
- result = false;
- for (FXOMObject draggedObject : draggedObjects) {
- final DesignHierarchyPath draggedObjectPath
- = new DesignHierarchyPath(draggedObject);
- final DesignHierarchyPath commonPath
- = draggedObjectPath.getCommonPathWith(dropTargetPath);
- // If one of the dragged objects is in the parent chain
- // of the drop target, we abort the DND gesture
- if (commonPath.equals(draggedObjectPath)) {
- result = true;
- break;
- }
- }
- }
-
- return result;
- }
-}
diff --git a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/LiveUpdater.java b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/LiveUpdater.java
deleted file mode 100644
index 959b708409..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/LiveUpdater.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.oracle.javafx.scenebuilder.kit.editor.drag;
-
-import com.oracle.javafx.scenebuilder.kit.editor.EditorController;
-import com.oracle.javafx.scenebuilder.kit.editor.drag.source.AbstractDragSource;
-import com.oracle.javafx.scenebuilder.kit.editor.drag.target.AbstractDropTarget;
-import com.oracle.javafx.scenebuilder.kit.editor.job.Job;
-
-/**
- *
- */
-class LiveUpdater {
-
- private final AbstractDragSource dragSource;
- private final EditorController editorController;
- private AbstractDropTarget dropTarget;
- private Job dropTargetMoveJob;
-
- public LiveUpdater(AbstractDragSource dragSource, EditorController editorController) {
- assert dragSource != null;
- assert editorController != null;
-
- this.dragSource = dragSource;
- this.editorController = editorController;
- }
-
- public void setDropTarget(AbstractDropTarget newDropTarget) {
- assert (newDropTarget == null) || (this.dropTarget != newDropTarget);
-
- /*
- * \ newDropTarget | |
- * this.dropTarget | null | non null
- * ------------------+---------------------+------------------------
- * | | (A)
- * null | nop | move to new drop target
- * | |
- * ------------------+---------------------+------------------------
- * | (B) | (C)
- * not null | undo last move | undo last move
- * | | move to new drop target
- * ------------------+---------------------+------------------------
- *
- */
-
- if (this.dropTarget != null) {
- assert this.dropTargetMoveJob != null;
- this.dropTargetMoveJob.undo();
- }
- this.dropTarget = newDropTarget;
- this.dropTargetMoveJob = null;
- if (this.dropTarget != null) {
- this.dropTargetMoveJob = this.dropTarget.makeDropJob(dragSource, editorController);
- this.dropTargetMoveJob.execute();
- }
- }
-
- public AbstractDropTarget getDropTarget() {
- return dropTarget;
- }
-}
diff --git a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/source/AbstractDragSource.java b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/source/AbstractDragSource.java
deleted file mode 100644
index 62fa4828b7..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/source/AbstractDragSource.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.oracle.javafx.scenebuilder.kit.editor.drag.source;
-
-import com.oracle.javafx.scenebuilder.kit.fxom.FXOMObject;
-import java.util.List;
-import javafx.scene.Node;
-import javafx.scene.image.Image;
-import javafx.scene.input.ClipboardContent;
-import javafx.stage.Window;
-
-/**
- *
- */
-public abstract class AbstractDragSource {
-
- private final Window ownerWindow;
-
- public AbstractDragSource(Window ownerWindow) {
- this.ownerWindow = ownerWindow;
- }
-
- public Window getOwnerWindow() {
- return ownerWindow;
- }
-
- public abstract boolean isAcceptable();
- public abstract List getDraggedObjects();
- public abstract FXOMObject getHitObject();
- public abstract double getHitX();
- public abstract double getHitY();
- public abstract ClipboardContent makeClipboardContent();
- public abstract Image makeDragView();
- public abstract Node makeShadow();
- public abstract String makeDropJobDescription();
- public abstract boolean isNodeOnly();
- public abstract boolean isSingleImageViewOnly();
- public abstract boolean isSingleTooltipOnly();
- public abstract boolean isSingleContextMenuOnly();
-
-}
diff --git a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/source/DocumentDragSource.java b/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/source/DocumentDragSource.java
deleted file mode 100644
index 7c25ebb38e..0000000000
--- a/apps/scenebuilder/SceneBuilderKit/src/com/oracle/javafx/scenebuilder/kit/editor/drag/source/DocumentDragSource.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates.
- * All rights reserved. Use is subject to license terms.
- *
- * This file is available and licensed under the following license:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the distribution.
- * - Neither the name of Oracle Corporation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-package com.oracle.javafx.scenebuilder.kit.editor.drag.source;
-
-import com.oracle.javafx.scenebuilder.kit.editor.EditorController;
-import com.oracle.javafx.scenebuilder.kit.editor.i18n.I18N;
-import com.oracle.javafx.scenebuilder.kit.editor.images.ImageUtils;
-import com.oracle.javafx.scenebuilder.kit.fxom.FXOMInstance;
-import com.oracle.javafx.scenebuilder.kit.fxom.FXOMObject;
-import com.oracle.javafx.scenebuilder.kit.metadata.util.ClipboardEncoder;
-import com.oracle.javafx.scenebuilder.kit.metadata.util.DesignHierarchyMask;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import javafx.geometry.Bounds;
-import javafx.geometry.Point2D;
-import javafx.scene.Group;
-import javafx.scene.Node;
-import javafx.scene.chart.Axis;
-import javafx.scene.chart.Chart;
-import javafx.scene.control.ContextMenu;
-import javafx.scene.control.Label;
-import javafx.scene.control.Tooltip;
-import javafx.scene.image.Image;
-import javafx.scene.image.ImageView;
-import javafx.scene.input.ClipboardContent;
-import javafx.stage.Window;
-
-/**
- *
- */
-public class DocumentDragSource extends AbstractDragSource {
-
- private final List draggedObjects = new ArrayList<>();
- private final FXOMObject hitObject;
- private final double hitX;
- private final double hitY;
- private final boolean nodeOnly;
- private final boolean singleImageViewOnly;
- private final boolean singleTooltipOnly;
- private final boolean singleContextMenuOnly;
-
- public DocumentDragSource(
- List draggedObjects,
- FXOMObject hitObject,
- double hitX,
- double hitY,
- Window ownerWindow) {
- super(ownerWindow);
-
- assert draggedObjects != null;
- assert hitObject != null;
- assert draggedObjects.contains(hitObject);
-
- this.draggedObjects.addAll(draggedObjects);
- this.hitObject = hitObject;
- this.hitX = hitX;
- this.hitY = hitY;
- this.nodeOnly = checkForNodeOnly();
-
- if (draggedObjects.size() != 1) {
- this.singleImageViewOnly = false;
- this.singleTooltipOnly = false;
- this.singleContextMenuOnly = false;
- } else {
- final FXOMObject draggedObject = draggedObjects.get(0);
- if (draggedObject instanceof FXOMInstance) {
- final Object sceneGraphObject = draggedObject.getSceneGraphObject();
- this.singleImageViewOnly = sceneGraphObject instanceof ImageView;
- this.singleTooltipOnly = sceneGraphObject instanceof Tooltip;
- this.singleContextMenuOnly = sceneGraphObject instanceof ContextMenu;
- } else {
- this.singleImageViewOnly = false;
- this.singleTooltipOnly = false;
- this.singleContextMenuOnly = false;
- }
- }
- }
-
- public DocumentDragSource(
- List draggedObjects,
- FXOMObject hitObject,
- Window ownerWindow) {
- super(ownerWindow);
-
- assert draggedObjects != null;
- assert hitObject != null;
- assert draggedObjects.contains(hitObject);
-
- this.draggedObjects.addAll(draggedObjects);
- this.hitObject = hitObject;
-
- final Point2D hitPoint = computeDefaultHit(hitObject);
- this.hitX = hitPoint.getX();
- this.hitY = hitPoint.getY();
- this.nodeOnly = checkForNodeOnly();
-
- if (draggedObjects.size() != 1) {
- this.singleImageViewOnly = false;
- this.singleTooltipOnly = false;
- this.singleContextMenuOnly = false;
- } else {
- final FXOMObject draggedObject = draggedObjects.get(0);
- if (draggedObject instanceof FXOMInstance) {
- final Object sceneGraphObject = draggedObject.getSceneGraphObject();
- this.singleImageViewOnly = sceneGraphObject instanceof ImageView;
- this.singleTooltipOnly = sceneGraphObject instanceof Tooltip;
- this.singleContextMenuOnly = sceneGraphObject instanceof ContextMenu;
- } else {
- this.singleImageViewOnly = false;
- this.singleTooltipOnly = false;
- this.singleContextMenuOnly = false;
- }
- }
- }
-
- private static Point2D computeDefaultHit(FXOMObject fxomObject) {
- final double hitX, hitY;
- if (fxomObject.getSceneGraphObject() instanceof Node) {
- final Node sceneGraphNode = (Node) fxomObject.getSceneGraphObject();
- final Bounds lb = sceneGraphNode.getLayoutBounds();
- hitX = (lb.getMinX() + lb.getMaxX()) / 2.0;
- hitY = (lb.getMinY() + lb.getMaxY()) / 2.0;
- } else {
- hitX = 0.0;
- hitY = 0.0;
- }
-
- return new Point2D(hitX,hitY);
- }
-
- /*
- * AbstractDragSource
- */
-
- @Override
- public boolean isAcceptable() {
- /*
- * Check if dragged objects contain any Axis.
- * If one axis has a Chart parent, then drag operation should not be possible
- * (because an Axis cannot be disconnected from its parent Chart).
- * In that case, this drag source is declared as 'non acceptable'.
- */
-
- boolean result = true;
- for (FXOMObject draggedObject : draggedObjects) {
- if (draggedObject.getSceneGraphObject() instanceof Axis) {
- final FXOMObject parentObject = draggedObject.getParentObject();
- if ((parentObject != null) && (parentObject.getSceneGraphObject() instanceof Chart)) {
- result = false;
- break;
- }
- }
- }
-
- return result;
- }
-
-
- @Override
- public List getDraggedObjects() {
- return draggedObjects;
- }
-
- @Override
- public FXOMObject getHitObject() {
- return hitObject;
- }
-
- @Override
- public double getHitX() {
- return hitX;
- }
-
- @Override
- public double getHitY() {
- return hitY;
- }
-
- @Override
- public ClipboardContent makeClipboardContent() {
-
- // Encode the dragged objects in FXML
- final ClipboardEncoder encoder = new ClipboardEncoder(draggedObjects);
- assert encoder.isEncodable();
- final ClipboardContent result = encoder.makeEncoding();
-
- return result;
- }
-
- @Override
- public Image makeDragView() {
- final Image image;
- final DesignHierarchyMask mask = new DesignHierarchyMask(hitObject);
- final URL resource = mask.getClassNameIconURL();
- // Resource may be null for unresolved classes
- if (resource == null) {
- image = ImageUtils.getNodeIcon("MissingIcon.png"); //NOI18N
- } else {
- image = new Image(resource.toExternalForm());
- }
-
- final Label visualNode = new Label();
- visualNode.setGraphic(new ImageView(image));
-// visualNode.setText(mask.getClassNameInfo());
- visualNode.getStylesheets().add(EditorController.getStylesheet().toString());
- visualNode.getStyleClass().add("drag-preview"); //NOI18N
-
- return ImageUtils.getImageFromNode(visualNode);
- }
-
- @Override
- public Node makeShadow() {
- final Group result = new Group();
-
- result.getStylesheets().add(EditorController.getStylesheet().toString());
-
- for (FXOMObject draggedObject : draggedObjects) {
- if (draggedObject.getSceneGraphObject() instanceof Node) {
- final Node sceneGraphNode = (Node) draggedObject.getSceneGraphObject();
- final DragSourceShadow shadowNode = new DragSourceShadow();
- shadowNode.setupForNode(sceneGraphNode);
-// assert shadowNode.getLayoutBounds().equals(sceneGraphNode.getLayoutBounds());
- shadowNode.getTransforms().add(sceneGraphNode.getLocalToParentTransform());
- result.getChildren().add(shadowNode);
- }
- }
-
- // Translate the group so that it renders (hitX, hitY) above (layoutX, layoutY).
- final Point2D hitPoint;
- if (hitObject.getSceneGraphObject() instanceof Node) {
- final Node hitNode = (Node) hitObject.getSceneGraphObject();
- hitPoint = hitNode.localToParent(hitX, hitY);
- } else {
- hitPoint = Point2D.ZERO;
- }
- result.setTranslateX(-hitPoint.getX());
- result.setTranslateY(-hitPoint.getY());
-
- return result;
- }
-
- @Override
- public String makeDropJobDescription() {
- final String result;
-
- if (draggedObjects.size() == 1) {
- final FXOMObject draggedObject = draggedObjects.get(0);
- final Object sceneGraphObject = draggedObject.getSceneGraphObject();
- if (sceneGraphObject == null) {
- result = I18N.getString("drop.job.move.single.unresolved");
- } else {
- result = I18N.getString("drop.job.move.single.resolved",
- sceneGraphObject.getClass().getSimpleName());
- }
- } else {
- final Set