Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module-info descriptors and ResourcesProvider #720

Merged
merged 11 commits into from
Sep 27, 2024
2 changes: 1 addition & 1 deletion app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>

<properties>
<main.class.name>com.oracle.javafx.scenebuilder.app.SceneBuilderApp</main.class.name>
<main.class.name>com.gluonhq.scenebuilder.app/com.oracle.javafx.scenebuilder.app.SceneBuilderApp</main.class.name>
<!-- For about.properties file -->
<buildDate>${maven.build.timestamp}</buildDate>
<buildDateFormat>${maven.build.timestamp.format}</buildDateFormat>
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -56,7 +56,11 @@ public class AppPlatform {
private static String messageBoxFolder;
private static String logsFolder;
private static MessageBox<MessageBoxMessage> messageBox;


AppPlatform() {
// no-op
}

public static synchronized String getApplicationDataFolder() {

if (applicationDataFolder == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -1031,6 +1031,10 @@ public boolean isUnused() {

public static class TitleComparator implements Comparator<DocumentWindowController> {

public TitleComparator() {
// no-op
}

@Override
public int compare(DocumentWindowController d1, DocumentWindowController d2) {
final int result;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -46,7 +46,7 @@
/**
*
*/
class ResourceController {
public class ResourceController {

private final DocumentWindowController documentWindowController;
private File resourceFile;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down
60 changes: 60 additions & 0 deletions app/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -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;
Oliver-Loeffler marked this conversation as resolved.
Show resolved Hide resolved
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;
Oliver-Loeffler marked this conversation as resolved.
Show resolved Hide resolved
Oliver-Loeffler marked this conversation as resolved.
Show resolved Hide resolved
exports com.oracle.javafx.scenebuilder.app.menubar;
exports com.oracle.javafx.scenebuilder.app.preferences;
}
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -50,6 +50,10 @@ public class ResourceUtils {
private static List<String> videoExtensions;
private static List<String> mediaExtensions;

ResourceUtils() {
// no-op
}

public static String getToolStylesheet(ToolTheme theme) {
switch(theme) {
case DARK:
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -43,6 +44,10 @@
*/
public class RootDropTarget extends AbstractDropTarget {

public RootDropTarget() {
// no-op
}

/*
* AbstractDropTarget
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -66,6 +66,10 @@ public abstract class ImageUtils {
private static ImageCursor css_cursor;
private static final WeakHashMap<String, Reference<Image>> imageCache = new WeakHashMap<>();

ImageUtils() {
// no-op
}

public static Image getImage(URL resource) {
// No resource found for the specified name
if (resource == null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -50,6 +51,10 @@
*/
public class JobUtils {

private JobUtils() {
// no-op
}

public static void addColumnConstraints(
final FXOMDocument fxomDocument,
final FXOMInstance gridPane,
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -55,6 +56,10 @@ public enum Position {
ABOVE, BELOW, BEFORE, AFTER
}

GridPaneJobUtils() {
// no-op
}

/**
* Returns the list of target GridPane objects.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -118,6 +119,10 @@ public int index() {
}
}

FXOMObjectCourseComparator() {
// no-op
}

/** *************************************************************************
* *
* Comparator on row axis AND column axis *
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -46,7 +47,11 @@
*
*/
public class MessageLog {


public MessageLog() {
// no-op
}

private final List<MessageLogEntry> entries = new ArrayList<>();
private final SimpleIntegerProperty revision = new SimpleIntegerProperty();
private final SimpleIntegerProperty numOfWarningMessages = new SimpleIntegerProperty();
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -44,6 +45,9 @@
*/
public class SplitPaneDesignInfoX {

public SplitPaneDesignInfoX() {
// no-op
}

/**
* Convert from local coordinates to divider position coordinates (0-1).
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -52,6 +52,9 @@
*/
public class TabPaneDesignInfoX /* extends TabDesignInfo */ {

public TabPaneDesignInfoX() {
// no-op
}

/**
* Returns the node representing the tab header in the TabPane skin.
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -55,6 +55,9 @@
*/
public class TableViewDesignInfoX /* extends TableViewDesignInfo */ {

public TableViewDesignInfoX() {
// no-op
}

public Bounds getColumnBounds(TableColumn<?,?> tableColumn) {
final TableView<?> tv = tableColumn.getTableView();
Expand Down
Loading