From 52bda3f025118056d5e9773d18f2e277130c7607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Pereda?= Date: Fri, 27 Sep 2024 21:52:57 +0200 Subject: [PATCH] Add module-info descriptors and ResourcesProvider (#720) * Add module-info descriptors and ResourcesProvider * reorder javafx modules * use require transitive on modules which provide public API elements * make public SkeletonContext * Add default empty constructors to Kit to avoid lint warnings * add transitive to aether.api --- app/pom.xml | 2 +- .../javafx/scenebuilder/app/AppPlatform.java | 8 +- .../app/DocumentWindowController.java | 6 +- .../scenebuilder/app/ResourceController.java | 4 +- .../javafx/scenebuilder/app/i18n/I18N.java | 6 +- app/src/main/java/module-info.java | 60 +++++ .../scenebuilder/kit/ResourceUtils.java | 6 +- .../kit/editor/EditorPlatform.java | 8 +- .../drag/target/AbstractDropTarget.java | 7 +- .../editor/drag/target/RootDropTarget.java | 5 + .../kit/editor/images/ImageUtils.java | 6 +- .../scenebuilder/kit/editor/job/JobUtils.java | 5 + .../editor/job/gridpane/GridPaneJobUtils.java | 5 + .../job/wrap/FXOMObjectCourseComparator.java | 5 + .../kit/editor/job/wrap/WrapJobUtils.java | 5 + .../kit/editor/messagelog/MessageLog.java | 7 +- .../content/driver/SplitPaneDesignInfoX.java | 4 + .../content/driver/TabPaneDesignInfoX.java | 5 +- .../content/driver/TableViewDesignInfoX.java | 5 +- .../driver/TreeTableViewDesignInfoX.java | 5 +- .../panel/content/guides/AbstractSegment.java | 7 +- .../panel/content/guides/SegmentIndex.java | 3 + .../panel/content/util/BoundsUnion.java | 7 +- .../panel/content/util/BoundsUtils.java | 7 +- .../panel/content/util/DistanceUtils.java | 6 +- .../kit/editor/panel/content/util/Picker.java | 8 +- .../editor/panel/css/CssPanelController.java | 6 +- .../kit/editor/panel/css/NodeCssState.java | 6 +- .../HierarchyAnimationScheduler.java | 5 + .../treeview/HierarchyTreeViewUtils.java | 5 + .../panel/inspector/editors/Editor.java | 5 + .../panel/inspector/editors/EditorUtils.java | 6 +- .../kit/editor/panel/library/LibraryUtil.java | 6 +- .../library/maven/preset/MavenPresets.java | 8 +- .../panel/util/AbstractPopupController.java | 7 +- .../kit/editor/report/ErrorReport.java | 7 +- .../selection/AbstractSelectionGroup.java | 7 +- .../kit/editor/selection/Selection.java | 7 +- .../scenebuilder/kit/fxom/FXOMNodes.java | 7 +- .../scenebuilder/kit/fxom/glue/GlueNode.java | 6 +- .../fxom/sampledata/SampleDataGenerator.java | 7 +- .../scenebuilder/kit/glossary/Glossary.java | 7 +- .../javafx/scenebuilder/kit/i18n/I18N.java | 9 +- .../kit/i18n/spi/I18NResourcesProvider.java | 37 +++ .../I18NResourcesProviderImpl.java} | 30 ++- .../kit/library/BuiltinSectionComparator.java | 7 +- .../scenebuilder/kit/library/Library.java | 8 +- .../library/LibraryItemNameComparator.java | 7 +- .../kit/metadata/util/ColorEncoder.java | 7 +- .../ValuePropertyMetadataClassComparator.java | 5 + .../ValuePropertyMetadataNameComparator.java | 5 + .../kit/skeleton/SkeletonContext.java | 4 +- .../kit/skeleton/SkeletonCreatorJRuby.java | 6 +- .../kit/skeleton/SkeletonCreatorJava.java | 6 +- .../kit/skeleton/SkeletonCreatorKotlin.java | 6 +- .../scenebuilder/kit/util/CssInternal.java | 6 +- .../scenebuilder/kit/util/JavaLanguage.java | 7 +- .../scenebuilder/kit/util/MathUtils.java | 7 +- .../kit/util/PaintConvertUtil.java | 6 +- .../scenebuilder/kit/util/URLUtils.java | 7 +- .../javafx/scenebuilder/kit/util/Utils.java | 36 +++ .../kit/util/control/effectpicker/Utils.java | 5 + .../paintpicker/PaintPickerController.java | 5 + kit/src/main/java/module-info.java | 230 ++++++++++++++++++ pom.xml | 4 +- 65 files changed, 684 insertions(+), 70 deletions(-) create mode 100644 app/src/main/java/module-info.java create mode 100644 kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/spi/I18NResourcesProvider.java rename kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/{I18NControl.java => spi/I18NResourcesProviderImpl.java} (68%) create mode 100644 kit/src/main/java/module-info.java diff --git a/app/pom.xml b/app/pom.xml index 4843ccbd4..6659f97ec 100644 --- a/app/pom.xml +++ b/app/pom.xml @@ -11,7 +11,7 @@ - com.oracle.javafx.scenebuilder.app.SceneBuilderApp + com.gluonhq.scenebuilder.app/com.oracle.javafx.scenebuilder.app.SceneBuilderApp ${maven.build.timestamp} ${maven.build.timestamp.format} diff --git a/app/src/main/java/com/oracle/javafx/scenebuilder/app/AppPlatform.java b/app/src/main/java/com/oracle/javafx/scenebuilder/app/AppPlatform.java index 3d7e77235..98e183e19 100644 --- a/app/src/main/java/com/oracle/javafx/scenebuilder/app/AppPlatform.java +++ b/app/src/main/java/com/oracle/javafx/scenebuilder/app/AppPlatform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Gluon and/or its affiliates. + * Copyright (c) 2017, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -56,7 +56,11 @@ public class AppPlatform { private static String messageBoxFolder; private static String logsFolder; private static MessageBox messageBox; - + + AppPlatform() { + // no-op + } + public static synchronized String getApplicationDataFolder() { if (applicationDataFolder == null) { diff --git a/app/src/main/java/com/oracle/javafx/scenebuilder/app/DocumentWindowController.java b/app/src/main/java/com/oracle/javafx/scenebuilder/app/DocumentWindowController.java index 89e1c2ef0..1ec055b5b 100644 --- a/app/src/main/java/com/oracle/javafx/scenebuilder/app/DocumentWindowController.java +++ b/app/src/main/java/com/oracle/javafx/scenebuilder/app/DocumentWindowController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Gluon and/or its affiliates. + * Copyright (c) 2016, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -1031,6 +1031,10 @@ public boolean isUnused() { public static class TitleComparator implements Comparator { + public TitleComparator() { + // no-op + } + @Override public int compare(DocumentWindowController d1, DocumentWindowController d2) { final int result; diff --git a/app/src/main/java/com/oracle/javafx/scenebuilder/app/ResourceController.java b/app/src/main/java/com/oracle/javafx/scenebuilder/app/ResourceController.java index ced064bbc..86bc3615e 100644 --- a/app/src/main/java/com/oracle/javafx/scenebuilder/app/ResourceController.java +++ b/app/src/main/java/com/oracle/javafx/scenebuilder/app/ResourceController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Gluon and/or its affiliates. + * Copyright (c) 2016, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -46,7 +46,7 @@ /** * */ -class ResourceController { +public class ResourceController { private final DocumentWindowController documentWindowController; private File resourceFile; diff --git a/app/src/main/java/com/oracle/javafx/scenebuilder/app/i18n/I18N.java b/app/src/main/java/com/oracle/javafx/scenebuilder/app/i18n/I18N.java index bfa2c45eb..61f7b9c53 100644 --- a/app/src/main/java/com/oracle/javafx/scenebuilder/app/i18n/I18N.java +++ b/app/src/main/java/com/oracle/javafx/scenebuilder/app/i18n/I18N.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -33,14 +34,11 @@ import java.text.MessageFormat; import java.util.ResourceBundle; -import com.oracle.javafx.scenebuilder.kit.i18n.I18NControl; public class I18N { private static ResourceBundle bundle; - private static ResourceBundle.Control utf8EncodingControl = new I18NControl(); - public static String getString(String key) { return getBundle().getString(key); } @@ -53,7 +51,7 @@ public static String getString(String key, Object... arguments) { public static synchronized ResourceBundle getBundle() { if (bundle == null) { final String packageName = I18N.class.getPackage().getName(); - bundle = ResourceBundle.getBundle(packageName + ".SceneBuilderApp",utf8EncodingControl); //NOI18N + bundle = ResourceBundle.getBundle(packageName + ".SceneBuilderApp"); //NOI18N } return bundle; diff --git a/app/src/main/java/module-info.java b/app/src/main/java/module-info.java new file mode 100644 index 000000000..31f010d22 --- /dev/null +++ b/app/src/main/java/module-info.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2024, Gluon 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 and Gluon 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. + */ + +module com.gluonhq.scenebuilder.app { + requires javafx.web; + requires javafx.fxml; + requires javafx.media; + requires javafx.swing; + requires transitive com.gluonhq.scenebuilder.kit; + requires java.logging; + requires java.prefs; + requires javax.json.api; + + opens com.oracle.javafx.scenebuilder.app to javafx.fxml; + opens com.oracle.javafx.scenebuilder.app.about to javafx.fxml; + opens com.oracle.javafx.scenebuilder.app.i18n to javafx.fxml; + opens com.oracle.javafx.scenebuilder.app.menubar to javafx.fxml; + opens com.oracle.javafx.scenebuilder.app.message to javafx.fxml; + opens com.oracle.javafx.scenebuilder.app.preferences to javafx.fxml; + opens com.oracle.javafx.scenebuilder.app.registration to javafx.fxml; + opens com.oracle.javafx.scenebuilder.app.report to javafx.fxml; + opens com.oracle.javafx.scenebuilder.app.tracking to javafx.fxml; + opens com.oracle.javafx.scenebuilder.app.util to javafx.fxml; + opens com.oracle.javafx.scenebuilder.app.welcomedialog; + + uses com.oracle.javafx.scenebuilder.kit.i18n.spi.I18NResourcesProvider; + + exports com.oracle.javafx.scenebuilder.app; + exports com.oracle.javafx.scenebuilder.app.menubar; + exports com.oracle.javafx.scenebuilder.app.preferences; +} \ No newline at end of file diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/ResourceUtils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/ResourceUtils.java index 03b32a4fd..3f3992bd6 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/ResourceUtils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/ResourceUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Gluon and/or its affiliates. + * Copyright (c) 2017, 2024, Gluon and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: @@ -50,6 +50,10 @@ public class ResourceUtils { private static List videoExtensions; private static List mediaExtensions; + ResourceUtils() { + // no-op + } + public static String getToolStylesheet(ToolTheme theme) { switch(theme) { case DARK: diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/EditorPlatform.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/EditorPlatform.java index e2a4e2ac2..50e729735 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/EditorPlatform.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/EditorPlatform.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Gluon and/or its affiliates. + * Copyright (c) 2016, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -242,7 +242,11 @@ public String getStylesheetURL() { return GlistenStyleClasses.impl_loadResource("theme_" + name().toLowerCase(Locale.ROOT) + ".css"); } } - + + EditorPlatform() { + // no-op + } + public static String getPlatformThemeStylesheetURL() { // Return USER_AGENT css, which is Modena for fx 8.0 return Theme.MODENA.getStylesheetURL(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/drag/target/AbstractDropTarget.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/drag/target/AbstractDropTarget.java index d73f0f4ad..1087cc179 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/drag/target/AbstractDropTarget.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/drag/target/AbstractDropTarget.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -40,7 +41,11 @@ * */ public abstract class AbstractDropTarget { - + + AbstractDropTarget() { + // no-op + } + public abstract FXOMObject getTargetObject(); public abstract boolean acceptDragSource(AbstractDragSource dragSource); public abstract Job makeDropJob(AbstractDragSource dragSource, EditorController editorController); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/drag/target/RootDropTarget.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/drag/target/RootDropTarget.java index abbf56aea..bdd009185 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/drag/target/RootDropTarget.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/drag/target/RootDropTarget.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -43,6 +44,10 @@ */ public class RootDropTarget extends AbstractDropTarget { + public RootDropTarget() { + // no-op + } + /* * AbstractDropTarget */ diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/images/ImageUtils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/images/ImageUtils.java index ec409e915..016727d5c 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/images/ImageUtils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/images/ImageUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Gluon and/or its affiliates. + * Copyright (c) 2016, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -66,6 +66,10 @@ public abstract class ImageUtils { private static ImageCursor css_cursor; private static final WeakHashMap> imageCache = new WeakHashMap<>(); + ImageUtils() { + // no-op + } + public static Image getImage(URL resource) { // No resource found for the specified name if (resource == null) { diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/JobUtils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/JobUtils.java index 81c909888..4de72d0d3 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/JobUtils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/JobUtils.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -50,6 +51,10 @@ */ public class JobUtils { + private JobUtils() { + // no-op + } + public static void addColumnConstraints( final FXOMDocument fxomDocument, final FXOMInstance gridPane, diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/gridpane/GridPaneJobUtils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/gridpane/GridPaneJobUtils.java index 8e5e0bfaf..65e0da6dd 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/gridpane/GridPaneJobUtils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/gridpane/GridPaneJobUtils.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -55,6 +56,10 @@ public enum Position { ABOVE, BELOW, BEFORE, AFTER } + GridPaneJobUtils() { + // no-op + } + /** * Returns the list of target GridPane objects. * diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/wrap/FXOMObjectCourseComparator.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/wrap/FXOMObjectCourseComparator.java index 89c0415ed..a5790318c 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/wrap/FXOMObjectCourseComparator.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/wrap/FXOMObjectCourseComparator.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -118,6 +119,10 @@ public int index() { } } + FXOMObjectCourseComparator() { + // no-op + } + /** ************************************************************************* * * * Comparator on row axis AND column axis * diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/wrap/WrapJobUtils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/wrap/WrapJobUtils.java index defa4f4ea..b40222d34 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/wrap/WrapJobUtils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/job/wrap/WrapJobUtils.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -52,6 +53,10 @@ */ public class WrapJobUtils { + WrapJobUtils() { + // no-op + } + /** * Returns the property name of the specified container to be used for wrapping jobs. * May be either the children or the content property name diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/messagelog/MessageLog.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/messagelog/MessageLog.java index 91aab1609..ea127c372 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/messagelog/MessageLog.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/messagelog/MessageLog.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -46,7 +47,11 @@ * */ public class MessageLog { - + + public MessageLog() { + // no-op + } + private final List entries = new ArrayList<>(); private final SimpleIntegerProperty revision = new SimpleIntegerProperty(); private final SimpleIntegerProperty numOfWarningMessages = new SimpleIntegerProperty(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/SplitPaneDesignInfoX.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/SplitPaneDesignInfoX.java index 191b157bc..f4f7ce2a2 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/SplitPaneDesignInfoX.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/SplitPaneDesignInfoX.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -44,6 +45,9 @@ */ public class SplitPaneDesignInfoX { + public SplitPaneDesignInfoX() { + // no-op + } /** * Convert from local coordinates to divider position coordinates (0-1). diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TabPaneDesignInfoX.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TabPaneDesignInfoX.java index b28d78c2d..93b019345 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TabPaneDesignInfoX.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TabPaneDesignInfoX.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Gluon and/or its affiliates. + * Copyright (c) 2017, 2024 Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -52,6 +52,9 @@ */ public class TabPaneDesignInfoX /* extends TabDesignInfo */ { + public TabPaneDesignInfoX() { + // no-op + } /** * Returns the node representing the tab header in the TabPane skin. diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TableViewDesignInfoX.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TableViewDesignInfoX.java index 47ea3e39f..c32bcdcab 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TableViewDesignInfoX.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TableViewDesignInfoX.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Gluon and/or its affiliates. + * Copyright (c) 2017, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -55,6 +55,9 @@ */ public class TableViewDesignInfoX /* extends TableViewDesignInfo */ { + public TableViewDesignInfoX() { + // no-op + } public Bounds getColumnBounds(TableColumn tableColumn) { final TableView tv = tableColumn.getTableView(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TreeTableViewDesignInfoX.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TreeTableViewDesignInfoX.java index 2923f9054..0d9792562 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TreeTableViewDesignInfoX.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/driver/TreeTableViewDesignInfoX.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Gluon and/or its affiliates. + * Copyright (c) 2017, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -55,6 +55,9 @@ */ public class TreeTableViewDesignInfoX { + public TreeTableViewDesignInfoX() { + // no-op + } public Bounds getColumnBounds(TreeTableColumn treeTableColumn) { final TreeTableView tv = treeTableColumn.getTreeTableView(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/guides/AbstractSegment.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/guides/AbstractSegment.java index 62a6cea12..7db9a69e8 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/guides/AbstractSegment.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/guides/AbstractSegment.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -36,7 +37,11 @@ * */ public abstract class AbstractSegment implements Comparable { - + + AbstractSegment() { + // no-op + } + public abstract double getX1(); public abstract double getY1(); public abstract double getX2(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/guides/SegmentIndex.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/guides/SegmentIndex.java index 2183b3234..b2f60b011 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/guides/SegmentIndex.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/guides/SegmentIndex.java @@ -45,6 +45,9 @@ public class SegmentIndex { private final List segments = new ArrayList<>(); private boolean sorted; + public SegmentIndex() { + // no-op + } public void addSegment(AbstractSegment s) { segments.add(s); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/BoundsUnion.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/BoundsUnion.java index d42bbd812..9059afdd0 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/BoundsUnion.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/BoundsUnion.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -42,7 +43,11 @@ public class BoundsUnion { private Bounds result; - + + public BoundsUnion() { + // no-op + } + public void add(Bounds b) { if (result == null) { result = b; diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/BoundsUtils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/BoundsUtils.java index 5e6a029cd..afb3ac001 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/BoundsUtils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/BoundsUtils.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -42,7 +43,11 @@ * */ public class BoundsUtils { - + + BoundsUtils() { + // no-op + } + public static Bounds makeBounds(Point2D p1, Point2D p2) { return new BoundingBox( Math.min(p1.getX(), p2.getX()), diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/DistanceUtils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/DistanceUtils.java index 3c26bd12e..e24a20e98 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/DistanceUtils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/DistanceUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Gluon and/or its affiliates. + * Copyright (c) 2018, 2024, Gluon and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: @@ -37,6 +37,10 @@ public class DistanceUtils { + DistanceUtils() { + // no-op + } + /** * Calculates distance from point to line * diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/Picker.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/Picker.java index bbe9f0f06..c9a655cc4 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/Picker.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/content/util/Picker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Gluon and/or its affiliates. + * Copyright (c) 2018, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -56,7 +56,11 @@ public class Picker { private final Set excludes = new HashSet<>(); private final List matches = new ArrayList<>(); - + + public Picker() { + // no-op + } + /** * Returns the list of nodes below (sceneX, sceneY). * Topmost node is at index 0. diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/css/CssPanelController.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/css/CssPanelController.java index 301bb095e..109a32456 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/css/CssPanelController.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/css/CssPanelController.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Gluon and/or its affiliates. + * Copyright (c) 2017, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -185,6 +185,10 @@ public enum View { */ public static abstract class Delegate { + public Delegate() { + // no-op + } + public abstract void revealInspectorEditor(ValuePropertyMetadata propMeta); } diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/css/NodeCssState.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/css/NodeCssState.java index 28c8fd6f4..124a3b49b 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/css/NodeCssState.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/css/NodeCssState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Gluon and/or its affiliates. + * Copyright (c) 2017, 2024, Gluon and/or its affiliates. * Copyright (c) 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -427,6 +427,10 @@ public final Collection getUserAgentStyles() { */ public static class RuleComparator implements Comparator { + RuleComparator() { + // no-op + } + @Override public int compare(MatchingRule t, MatchingRule t1) { int originComparaison = compareOrigin( diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/hierarchy/HierarchyAnimationScheduler.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/hierarchy/HierarchyAnimationScheduler.java index 90da16f8d..5b543b7b4 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/hierarchy/HierarchyAnimationScheduler.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/hierarchy/HierarchyAnimationScheduler.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -52,6 +53,10 @@ public class HierarchyAnimationScheduler { // The bigger it is, the slower the animation will be. private final double rate = 4.0; + public HierarchyAnimationScheduler() { + // no-op + } + public void playDecrementAnimation(final ScrollBar scrollBar) { assert scrollBar != null; final double minValue = scrollBar.getMin(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/hierarchy/treeview/HierarchyTreeViewUtils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/hierarchy/treeview/HierarchyTreeViewUtils.java index 899d64529..1921183b8 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/hierarchy/treeview/HierarchyTreeViewUtils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/hierarchy/treeview/HierarchyTreeViewUtils.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -46,6 +47,10 @@ */ public abstract class HierarchyTreeViewUtils { + HierarchyTreeViewUtils() { + // no-op + } + /** * Returns the TreeCells for the specified TreeView. * diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/Editor.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/Editor.java index 5d2070309..cd380994e 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/Editor.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/Editor.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -57,6 +58,10 @@ public abstract class Editor { public static final String INDETERMINATE_STR = "-"; //NOI18N + Editor() { + // no-op + } + public abstract Node getValueEditor(); public abstract MenuButton getMenu(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/EditorUtils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/EditorUtils.java index 3eee5f2e3..72866b45b 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/EditorUtils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/EditorUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2022, Gluon and/or its affiliates. + * Copyright (c) 2017, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -80,6 +80,10 @@ public class EditorUtils { static final String[] FXML_RESERVED_KEYWORDS = {"null"}; //NOI18N private static final String FXINCLUDE_JAVADOC_URL = "https://openjfx.io/javadoc/11/javafx.fxml/javafx/fxml/doc-files/introduction_to_fxml.html#include_elements"; + EditorUtils() { + // no-op + } + public static void makeWidthStretchable(final Node node) { Parent p = node.getParent(); if (p == null) { diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/LibraryUtil.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/LibraryUtil.java index b6d1842e4..c5013b5f2 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/LibraryUtil.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/LibraryUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019 Gluon and/or its affiliates. + * Copyright (c) 2016, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -45,6 +45,10 @@ public class LibraryUtil { public static final String FOLDERS_LIBRARY_FILENAME = "library.folders"; //NOI18N + LibraryUtil() { + // no-op + } + public static boolean isJarPath(Path path) { final String pathString = path.toString().toLowerCase(Locale.ROOT); return pathString.endsWith(".jar"); //NOI18N diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/maven/preset/MavenPresets.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/maven/preset/MavenPresets.java index b36a9dbe3..87a76df43 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/maven/preset/MavenPresets.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/library/maven/preset/MavenPresets.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Gluon and/or its affiliates. + * Copyright (c) 2016, 2024, Gluon and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: @@ -41,7 +41,11 @@ public class MavenPresets { public static final String SONATYPE = "Sonatype"; public static final String GLUON_NEXUS = "Gluon Nexus"; public static final String LOCAL = "Local"; - + + MavenPresets() { + // no-op + } + private static final List REPOSITORIES = Arrays.asList( new Repository(MAVEN, "default", "https://repo1.maven.org/maven2/"), new Repository(SONATYPE + " (snapshots)", "default", "https://oss.sonatype.org/content/repositories/snapshots"), diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/util/AbstractPopupController.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/util/AbstractPopupController.java index 9a786d541..bfec1d9ce 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/util/AbstractPopupController.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/util/AbstractPopupController.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -52,7 +53,11 @@ public abstract class AbstractPopupController { private Popup popup; private Node anchor; private Window anchorWindow; - + + public AbstractPopupController() { + // no-op + } + /** * Returns the root FX object of this popup. * When called the first time, this method invokes {@link #makeRoot()} diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/report/ErrorReport.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/report/ErrorReport.java index 047e56f01..f4dcd511a 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/report/ErrorReport.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/report/ErrorReport.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -56,7 +57,11 @@ * */ public class ErrorReport { - + + public ErrorReport() { + // no-op + } + private final Map> entries = new HashMap<>(); private final Map cssParsingReports = new HashMap<>(); private FXOMDocument fxomDocument; diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/selection/AbstractSelectionGroup.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/selection/AbstractSelectionGroup.java index 1bc483e95..5cef398ed 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/selection/AbstractSelectionGroup.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/selection/AbstractSelectionGroup.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -42,7 +43,11 @@ public abstract class AbstractSelectionGroup implements Cloneable { public abstract FXOMObject getAncestor(); public abstract boolean isValid(FXOMDocument fxomDocument); - + + AbstractSelectionGroup() { + // no-op + } + @Override public AbstractSelectionGroup clone() throws CloneNotSupportedException { diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/selection/Selection.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/selection/Selection.java index 1688bb5ba..252f838d0 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/selection/Selection.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/selection/Selection.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -52,7 +53,11 @@ * */ public class Selection { - + + public Selection() { + // no-op + } + private AbstractSelectionGroup group; private final SimpleIntegerProperty revision = new SimpleIntegerProperty(); private boolean lock; diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/FXOMNodes.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/FXOMNodes.java index 96d87766e..b201ba55d 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/FXOMNodes.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/FXOMNodes.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Gluon and/or its affiliates. + * Copyright (c) 2022, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -70,7 +70,10 @@ */ public class FXOMNodes { - + FXOMNodes() { + // no-op + } + /** * Sorts the specified set of objects according their location in * the fxom document. Objets are sorted according depth first order. diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/glue/GlueNode.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/glue/GlueNode.java index 7cc6385a4..8c2ec8338 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/glue/GlueNode.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/glue/GlueNode.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -36,5 +37,8 @@ * */ public abstract class GlueNode { - + + GlueNode() { + // no-op + } } diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/sampledata/SampleDataGenerator.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/sampledata/SampleDataGenerator.java index 9b9a61225..f45b9d16e 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/sampledata/SampleDataGenerator.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/fxom/sampledata/SampleDataGenerator.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -55,7 +56,11 @@ public class SampleDataGenerator { private final Map sampleDataMap = new HashMap<>(); - + + public SampleDataGenerator() { + // no-op + } + public void assignSampleData(FXOMObject startObject) { assert startObject != null; diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/glossary/Glossary.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/glossary/Glossary.java index 377667c12..576b0821b 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/glossary/Glossary.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/glossary/Glossary.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -43,7 +44,11 @@ public abstract class Glossary { private final SimpleIntegerProperty revision = new SimpleIntegerProperty(); - + + Glossary() { + // no-op + } + /** * Returns candidate controller classes tracked by this glossary. * If fxmlLocation is not null, this glossary may use it to filter the diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/I18N.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/I18N.java index 0b643dd64..93425e20a 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/I18N.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/I18N.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -41,8 +42,10 @@ public class I18N { private static ResourceBundle bundle; - private static ResourceBundle.Control utf8EncodingControl = new I18NControl(); - + I18N() { + // no-op + } + public static String getString(String key) { return getBundle().getString(key); } @@ -55,7 +58,7 @@ public static String getString(String key, Object... arguments) { public static synchronized ResourceBundle getBundle() { if (bundle == null) { final String packageName = I18N.class.getPackage().getName(); - bundle = ResourceBundle.getBundle(packageName + ".SceneBuilderKit",utf8EncodingControl); //NOI18N + bundle = ResourceBundle.getBundle(packageName + ".SceneBuilderKit"); //NOI18N } return bundle; diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/spi/I18NResourcesProvider.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/spi/I18NResourcesProvider.java new file mode 100644 index 000000000..d92a61e70 --- /dev/null +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/spi/I18NResourcesProvider.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024, Gluon 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 and Gluon 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.i18n.spi; + +import java.util.spi.ResourceBundleProvider; + +public interface I18NResourcesProvider extends ResourceBundleProvider { } diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/I18NControl.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/spi/I18NResourcesProviderImpl.java similarity index 68% rename from kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/I18NControl.java rename to kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/spi/I18NResourcesProviderImpl.java index 6b1a2b99a..5f66c50c9 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/I18NControl.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/i18n/spi/I18NResourcesProviderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Gluon and/or its affiliates. + * Copyright (c) 2024, Gluon and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: @@ -13,7 +13,7 @@ * - 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 + * - Neither the name of Oracle Corporation and Gluon nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -29,30 +29,40 @@ * (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.i18n; +package com.oracle.javafx.scenebuilder.kit.i18n.spi; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.Locale; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; import java.util.logging.Level; import java.util.logging.Logger; +import java.util.spi.AbstractResourceBundleProvider; + +public class I18NResourcesProviderImpl extends AbstractResourceBundleProvider implements I18NResourcesProvider { + + public I18NResourcesProviderImpl() { + // no-op + } -public class I18NControl extends ResourceBundle.Control { @Override - public ResourceBundle newBundle(String baseName, Locale locale, String format, ClassLoader loader, boolean reload) { + public ResourceBundle getBundle(String baseName, Locale locale) { String bundleName = toBundleName(baseName, locale); - String resourceName = toResourceName(bundleName, "properties"); - try (InputStream is = loader.getResourceAsStream(resourceName); - InputStreamReader isr = new InputStreamReader(is, "UTF-8"); + String resourceName = ResourceBundle.Control + .getControl(ResourceBundle.Control.FORMAT_DEFAULT) + .toResourceName(bundleName, "properties"); + try (InputStream is = Files.newInputStream(Path.of(resourceName)); + InputStreamReader isr = new InputStreamReader(is, StandardCharsets.UTF_8); BufferedReader reader = new BufferedReader(isr)) { return new PropertyResourceBundle(reader); } catch (IOException e) { - Logger.getLogger(getClass().getName()).log(Level.WARNING, "Failed to create ResourceBundle: ", e); + Logger.getLogger(getClass().getName()).log(Level.WARNING, "Failed to create ResourceBundle for bundleName: " + bundleName + " and resourceName: " + resourceName, e); return null; } } diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/BuiltinSectionComparator.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/BuiltinSectionComparator.java index d20cd6480..b91b2a57d 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/BuiltinSectionComparator.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/BuiltinSectionComparator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Gluon and/or its affiliates. + * Copyright (c) 2016, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -55,7 +55,10 @@ public class BuiltinSectionComparator implements Comparator { orderedSections.add(BuiltinLibrary.TAG_3D); } - + public BuiltinSectionComparator() { + // no-op + } + /* * Comparator */ diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/Library.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/Library.java index 9c270327f..7566b68f8 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/Library.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/Library.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Gluon and/or its affiliates. + * Copyright (c) 2022, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -43,7 +43,11 @@ * A collection of [LibraryItem]. */ public abstract class Library { - + + public Library() { + // no-op + } + private final ObservableList itemsProperty = FXCollections.observableArrayList(); private final ObjectProperty classLoaderProperty = new SimpleObjectProperty<>(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/LibraryItemNameComparator.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/LibraryItemNameComparator.java index bda3a28e4..814921319 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/LibraryItemNameComparator.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/library/LibraryItemNameComparator.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -39,7 +40,11 @@ * */ public class LibraryItemNameComparator implements Comparator { - + + public LibraryItemNameComparator() { + // no-op + } + /** * The comparison done here is performed on the name property of the * LibraryItem, and it is done ignoring the case. diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ColorEncoder.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ColorEncoder.java index 5de9bf66a..360373e52 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ColorEncoder.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ColorEncoder.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -44,7 +45,11 @@ public class ColorEncoder { private static Map standardColors; private static Map standardColorNames; - + + ColorEncoder() { + // no-op + } + public static String encodeColor(Color color) { final String colorName = getStandardColorNames().get(color); final String result; diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ValuePropertyMetadataClassComparator.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ValuePropertyMetadataClassComparator.java index a1c978620..abc4f3bbb 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ValuePropertyMetadataClassComparator.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ValuePropertyMetadataClassComparator.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -39,6 +40,10 @@ */ public class ValuePropertyMetadataClassComparator implements Comparator { + public ValuePropertyMetadataClassComparator() { + // no-op + } + @Override public int compare(ValuePropertyMetadata propMeta1, ValuePropertyMetadata propMeta2) { String className1; diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ValuePropertyMetadataNameComparator.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ValuePropertyMetadataNameComparator.java index 084842d33..329e66247 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ValuePropertyMetadataNameComparator.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/metadata/util/ValuePropertyMetadataNameComparator.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -39,6 +40,10 @@ */ public class ValuePropertyMetadataNameComparator implements Comparator { + public ValuePropertyMetadataNameComparator() { + // no-op + } + @Override public int compare(ValuePropertyMetadata propMeta1, ValuePropertyMetadata propMeta2) { String name1 = propMeta1.getName().getName(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonContext.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonContext.java index f5b4c5232..f12560e64 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonContext.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Gluon and/or its affiliates. + * Copyright (c) 2021, 2024, Gluon and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: @@ -47,7 +47,7 @@ import java.util.TreeMap; import java.util.TreeSet; -class SkeletonContext { +public class SkeletonContext { private final String fxController; private final String documentName; diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorJRuby.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorJRuby.java index 866b21a8d..00da8ffd7 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorJRuby.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorJRuby.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023, Gluon and/or its affiliates. + * Copyright (c) 2023, 2024, Gluon and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: @@ -45,6 +45,10 @@ public class SkeletonCreatorJRuby implements SkeletonConverter { static final String NL = System.lineSeparator(); static final String INDENT = " "; //NOI18N + SkeletonCreatorJRuby() { + // no-op + } + public String createFrom(SkeletonContext context) { final StringBuilder sb = new StringBuilder(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorJava.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorJava.java index fa205c012..cc1b09bc2 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorJava.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorJava.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Gluon and/or its affiliates. + * Copyright (c) 2021, 2024, Gluon and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: @@ -33,6 +33,10 @@ public class SkeletonCreatorJava extends AbstractSkeletonCreator { + SkeletonCreatorJava() { + // no-op + } + @Override void appendPackage(SkeletonContext context, StringBuilder sb) { String controller = context.getFxController(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorKotlin.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorKotlin.java index ed9c68e70..587cfc11f 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorKotlin.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/skeleton/SkeletonCreatorKotlin.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021, Gluon and/or its affiliates. + * Copyright (c) 2021, 2024, Gluon and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: @@ -33,6 +33,10 @@ public class SkeletonCreatorKotlin extends AbstractSkeletonCreator { + SkeletonCreatorKotlin() { + // no-op + } + @Override void appendPackage(SkeletonContext context, StringBuilder sb) { String controller = context.getFxController(); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/CssInternal.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/CssInternal.java index e2c6e51f0..07ea4eea7 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/CssInternal.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/CssInternal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Gluon and/or its affiliates. + * Copyright (c) 2017, 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -75,6 +75,10 @@ */ public class CssInternal { + CssInternal() { + // no-op + } + private final static String[] themeUrls = { Theme.CASPIAN_EMBEDDED_HIGH_CONTRAST.getStylesheetURL(), Theme.CASPIAN_EMBEDDED_QVGA_HIGH_CONTRAST.getStylesheetURL(), diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/JavaLanguage.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/JavaLanguage.java index 32d87ad7d..2de9a6a3b 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/JavaLanguage.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/JavaLanguage.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -39,7 +40,11 @@ * */ public class JavaLanguage { - + + JavaLanguage() { + // no-op + } + /** * Returns true if value is a valid identifier (as specified * in Java Language Specification, section 3.8). diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/MathUtils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/MathUtils.java index bafa6297d..88d664313 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/MathUtils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/MathUtils.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -35,7 +36,11 @@ * */ public class MathUtils { - + + MathUtils() { + // no-op + } + /** * Returns true if the two specified double values are approximately equals. * @param v1 first double to check diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/PaintConvertUtil.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/PaintConvertUtil.java index bc7be4781..e5700e458 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/PaintConvertUtil.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/PaintConvertUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Gluon and/or its affiliates. + * Copyright (c) 2022, 2024, Gluon and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following license: @@ -47,6 +47,10 @@ public class PaintConvertUtil { private static final int ROUNDING_FACTOR = 10000;//Use for round to 4 decimal places + PaintConvertUtil() { + // no-op + } + public static String convertPaintToCss(Paint fxPaint) { if (fxPaint instanceof LinearGradient) { LinearGradient paint = (LinearGradient) fxPaint; diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/URLUtils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/URLUtils.java index 777507edd..166155c94 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/URLUtils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/URLUtils.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -42,7 +43,11 @@ * */ public class URLUtils { - + + URLUtils() { + // no-op + } + public static boolean equals(URL url1, URL url2) { boolean result; diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/Utils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/Utils.java index 1f594b9e2..d41268f3e 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/Utils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/Utils.java @@ -1,3 +1,34 @@ +/* + * Copyright (c) 2017, 2024, Gluon 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 and Gluon 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.util; import com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument; @@ -7,6 +38,11 @@ import java.net.URISyntaxException; public class Utils { + + Utils() { + // no-op + } + public static final String makeTitle(FXOMDocument fxomDocument) { final String title; diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/control/effectpicker/Utils.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/control/effectpicker/Utils.java index 359e12577..5ea247424 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/control/effectpicker/Utils.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/control/effectpicker/Utils.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -52,6 +53,10 @@ public abstract class Utils { + Utils() { + // no-op + } + public static final Effect newInstance(Class clazz) { assert clazz != null; return newInstance(clazz.getSimpleName()); diff --git a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/control/paintpicker/PaintPickerController.java b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/control/paintpicker/PaintPickerController.java index 514a01591..4153ffe2c 100644 --- a/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/control/paintpicker/PaintPickerController.java +++ b/kit/src/main/java/com/oracle/javafx/scenebuilder/kit/util/control/paintpicker/PaintPickerController.java @@ -1,4 +1,5 @@ /* + * Copyright (c) 2024, Gluon and/or its affiliates. * Copyright (c) 2012, 2014, Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * @@ -79,6 +80,10 @@ public class PaintPickerController { public final static RadialGradient DEFAULT_RADIAL = new RadialGradient(0.0, 0.0, 0.5, 0.5, 0.5, true, CycleMethod.NO_CYCLE); + PaintPickerController() { + // no-op + } + public final ObjectProperty paintProperty() { return paint; } diff --git a/kit/src/main/java/module-info.java b/kit/src/main/java/module-info.java new file mode 100644 index 000000000..e69654db4 --- /dev/null +++ b/kit/src/main/java/module-info.java @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2024, Gluon 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 and Gluon 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. + */ + +module com.gluonhq.scenebuilder.kit { + requires transitive javafx.graphics; + requires transitive javafx.controls; + requires transitive javafx.fxml; + requires javafx.swing; + requires javafx.media; + requires transitive javafx.web; + + requires com.gluonhq.charm.glisten; + requires static javax.json.api; + requires transitive static java.prefs; + + requires transitive static aether.api; + requires static aether.connector.basic; + requires static aether.impl; + requires static aether.spi; + requires static aether.transport.file; + requires static aether.transport.http; + requires static aether.util; + requires static org.apache.commons.codec; + requires static org.apache.httpcomponents.httpclient; + requires static org.apache.httpcomponents.httpcore; + requires static commons.lang3; + requires static maven.aether.provider; + requires static plexus.utils; + + opens com.oracle.javafx.scenebuilder.kit to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.alert to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.css; + opens com.oracle.javafx.scenebuilder.kit.editor; + opens com.oracle.javafx.scenebuilder.kit.editor.drag to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.drag.source to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.drag.target to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.images to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.job to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.job.atomic to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.job.gridpane to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.job.gridpane.v2 to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.job.reference to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.job.togglegroup to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.job.wrap to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.messagelog to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.curve to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.gridpane to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.handles to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.outline to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.pring to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.relocater to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.resizer to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.rudder to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.tring to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.gesture to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.gesture.key to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.gesture.mouse to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.guides to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.mode to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.content.util to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.css to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.hierarchy to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.hierarchy.treeview to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.info to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.inspector to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.util to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.popupeditors to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.library to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.library.manager to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.library.maven to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.library.maven.preset to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.library.maven.repository to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.library.maven.repository.dialog to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.library.maven.search to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.util to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.panel.util.dialog to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.report to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.search to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.selection to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.editor.util to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.fxom to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.fxom.glue to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.fxom.sampledata to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.glossary to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.i18n to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.i18n.spi to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.library to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.library.user to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.library.util to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.metadata to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.metadata.klass to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.metadata.property to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.metadata.property.value to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.metadata.util to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.preferences to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.preview to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.selectionbar to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.skeleton to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.template; + opens com.oracle.javafx.scenebuilder.kit.util to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.util.control.effectpicker to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.util.control.effectpicker.editors to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.util.control.paintpicker to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.util.control.paintpicker.colorpicker to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.util.control.paintpicker.gradientpicker to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.util.control.paintpicker.rotator to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.util.control.paintpicker.slider to javafx.fxml; + opens com.oracle.javafx.scenebuilder.kit.util.eventnames to javafx.fxml; + + provides com.oracle.javafx.scenebuilder.kit.i18n.spi.I18NResourcesProvider with com.oracle.javafx.scenebuilder.kit.i18n.spi.I18NResourcesProviderImpl; + + exports com.oracle.javafx.scenebuilder.kit; + exports com.oracle.javafx.scenebuilder.kit.alert; + exports com.oracle.javafx.scenebuilder.kit.editor; + exports com.oracle.javafx.scenebuilder.kit.editor.drag; + exports com.oracle.javafx.scenebuilder.kit.editor.drag.source; + exports com.oracle.javafx.scenebuilder.kit.editor.drag.target; + exports com.oracle.javafx.scenebuilder.kit.editor.images; + exports com.oracle.javafx.scenebuilder.kit.editor.job; + exports com.oracle.javafx.scenebuilder.kit.editor.job.atomic; + exports com.oracle.javafx.scenebuilder.kit.editor.job.gridpane; + exports com.oracle.javafx.scenebuilder.kit.editor.job.gridpane.v2; + exports com.oracle.javafx.scenebuilder.kit.editor.job.reference; + exports com.oracle.javafx.scenebuilder.kit.editor.job.togglegroup; + exports com.oracle.javafx.scenebuilder.kit.editor.job.wrap; + exports com.oracle.javafx.scenebuilder.kit.editor.messagelog; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.curve; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.gridpane; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.handles; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.outline; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.pring; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.relocater; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.resizer; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.rudder; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.tring; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.gesture; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.gesture.key; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.gesture.mouse; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.guides; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.mode; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.content.util; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.css; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.hierarchy; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.hierarchy.treeview; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.info; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.inspector; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.editors.util; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.inspector.popupeditors; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.library; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.library.manager; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.library.maven; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.library.maven.preset; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.library.maven.repository; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.library.maven.repository.dialog; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.library.maven.search; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.util; + exports com.oracle.javafx.scenebuilder.kit.editor.panel.util.dialog; + exports com.oracle.javafx.scenebuilder.kit.editor.report; + exports com.oracle.javafx.scenebuilder.kit.editor.search; + exports com.oracle.javafx.scenebuilder.kit.editor.selection; + exports com.oracle.javafx.scenebuilder.kit.editor.util; + exports com.oracle.javafx.scenebuilder.kit.fxom; + exports com.oracle.javafx.scenebuilder.kit.fxom.glue; + exports com.oracle.javafx.scenebuilder.kit.fxom.sampledata; + exports com.oracle.javafx.scenebuilder.kit.glossary; + exports com.oracle.javafx.scenebuilder.kit.i18n; + exports com.oracle.javafx.scenebuilder.kit.i18n.spi; + exports com.oracle.javafx.scenebuilder.kit.library; + exports com.oracle.javafx.scenebuilder.kit.library.user; + exports com.oracle.javafx.scenebuilder.kit.library.util; + exports com.oracle.javafx.scenebuilder.kit.metadata; + exports com.oracle.javafx.scenebuilder.kit.metadata.klass; + exports com.oracle.javafx.scenebuilder.kit.metadata.property; + exports com.oracle.javafx.scenebuilder.kit.metadata.property.value; + exports com.oracle.javafx.scenebuilder.kit.metadata.property.value.list; + exports com.oracle.javafx.scenebuilder.kit.metadata.property.value.effect; + exports com.oracle.javafx.scenebuilder.kit.metadata.property.value.effect.light; + exports com.oracle.javafx.scenebuilder.kit.metadata.property.value.paint; + exports com.oracle.javafx.scenebuilder.kit.metadata.property.value.keycombination; + exports com.oracle.javafx.scenebuilder.kit.metadata.util; + exports com.oracle.javafx.scenebuilder.kit.preferences; + exports com.oracle.javafx.scenebuilder.kit.preview; + exports com.oracle.javafx.scenebuilder.kit.selectionbar; + exports com.oracle.javafx.scenebuilder.kit.skeleton; + exports com.oracle.javafx.scenebuilder.kit.template; + exports com.oracle.javafx.scenebuilder.kit.util; + exports com.oracle.javafx.scenebuilder.kit.util.control.effectpicker; + exports com.oracle.javafx.scenebuilder.kit.util.control.effectpicker.editors; + exports com.oracle.javafx.scenebuilder.kit.util.control.paintpicker; + exports com.oracle.javafx.scenebuilder.kit.util.control.paintpicker.colorpicker; + exports com.oracle.javafx.scenebuilder.kit.util.control.paintpicker.gradientpicker; + exports com.oracle.javafx.scenebuilder.kit.util.control.paintpicker.rotator; + exports com.oracle.javafx.scenebuilder.kit.util.control.paintpicker.slider; + exports com.oracle.javafx.scenebuilder.kit.util.eventnames; +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 9ffe3f844..0e6651a2c 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,8 @@ ${main.class.name} - + + @@ -149,6 +150,7 @@ false 1 + --add-opens=javafx.fxml/javafx.fxml=com.gluonhq.scenebuilder.kit