Skip to content

Commit

Permalink
Added reflection info .... removed dependencies to AWT.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemmermann committed Oct 16, 2023
1 parent 93e99b5 commit fa6152d
Show file tree
Hide file tree
Showing 13 changed files with 3,607 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1/apache-maven-3.9.1-bin.zip
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.8/apache-maven-3.8.8-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
56 changes: 53 additions & 3 deletions app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,42 @@

<properties>
<maven.javadoc.skip>true</maven.javadoc.skip>
<gluonfx.plugin.version>1.0.21</gluonfx.plugin.version>
<javafx.plugin.version>0.0.8</javafx.plugin.version>
<mainClassName>com.dlsc.jfxcentral2.app.JFXCentral2App</mainClassName>
</properties>

<dependencies>
<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>display</artifactId>
<version>${attach.version}</version>
</dependency>

<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>lifecycle</artifactId>
<version>${attach.version}</version>
</dependency>

<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>statusbar</artifactId>
<version>${attach.version}</version>
</dependency>

<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>storage</artifactId>
<version>${attach.version}</version>
</dependency>

<dependency>
<groupId>com.gluonhq.attach</groupId>
<artifactId>util</artifactId>
<version>${attach.version}</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
Expand Down Expand Up @@ -409,17 +442,34 @@
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.8</version>
<version>${javafx.plugin.version}</version>
<configuration>
<mainClass>${mainClassName}</mainClass>
</configuration>
</plugin>

<plugin>
<groupId>com.gluonhq</groupId>
<artifactId>gluonfx-maven-plugin</artifactId>
<version>${gluonfx.plugin.version}</version>
<configuration>
<mainClass>com.dlsc.jfxcentral2.app.JFXCentral2App</mainClass>
<target>${gluonfx.target}</target>
<attachList>
<list>display</list>
<list>lifecycle</list>
<list>statusbar</list>
<list>storage</list>
</attachList>
<mainClass>${mainClassName}</mainClass>
</configuration>
</plugin>

<plugin>
<groupId>one.jpro</groupId>
<artifactId>jpro-maven-plugin</artifactId>
<version>${jpro.version}</version>
<configuration>
<mainClassName>com.dlsc.jfxcentral2.app.JFXCentral2App</mainClassName>
<mainClassName>${mainClassName}</mainClassName>
<releaseName>jfxcentral</releaseName>
<localJVMArgs>-Ddevelop=false</localJVMArgs>
<port>8088</port>
Expand Down
48 changes: 23 additions & 25 deletions app/src/main/java/com/dlsc/jfxcentral2/app/JFXCentral2App.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@
import org.apache.logging.log4j.Logger;
import simplefx.experimental.parts.FXFuture;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.PrintStream;
import java.util.Locale;
Expand All @@ -95,7 +93,7 @@ public class JFXCentral2App extends Application {
private static final Logger LOGGER = LogManager.getLogger(JFXCentral2App.class);
private final ObjectProperty<Size> size = new SimpleObjectProperty<>(Size.LARGE);

private TrayIconManager trayIconManager;
// private TrayIconManager trayIconManager;

static {
if (WebAPI.isBrowser() || !RepositoryManager.isCountryEqualToChina()) {
Expand All @@ -106,21 +104,21 @@ public class JFXCentral2App extends Application {
@Override
public void start(Stage stage) {
// This is a workaround to prevent a deadlock between the TrayIcon and the JPro ImageManager
BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
bi.createGraphics();
// BufferedImage bi = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
// bi.createGraphics();

if (!WebAPI.isBrowser()) {
System.setProperty("prism.lcdtext", "false");
System.setProperty("routing.scrollpane", PrettyScrollPane.class.getName());

if (Taskbar.isTaskbarSupported()) {
Taskbar taskbar = Taskbar.getTaskbar();
if (taskbar.isSupported(Taskbar.Feature.ICON_IMAGE)) {
Toolkit defaultToolkit = Toolkit.getDefaultToolkit();
Image dockIcon = defaultToolkit.getImage(JFXCentral2App.class.getResource("app-icon.png"));
taskbar.setIconImage(dockIcon);
}
}
// if (Taskbar.isTaskbarSupported()) {
// Taskbar taskbar = Taskbar.getTaskbar();
// if (taskbar.isSupported(Taskbar.Feature.ICON_IMAGE)) {
// Toolkit defaultToolkit = Toolkit.getDefaultToolkit();
// Image dockIcon = defaultToolkit.getImage(JFXCentral2App.class.getResource("app-icon.png"));
// taskbar.setIconImage(dockIcon);
// }
// }
}

// set jpro.imagemanager.cache to ~/.jfxcentral/imagecache
Expand All @@ -138,22 +136,22 @@ public void start(Stage stage) {
routeNode.start(sessionManager);

// tray icon
if (!WebAPI.isBrowser() && SystemTray.isSupported()) {
RepositoryManager.repositoryUpdatedProperty().addListener(it -> {
if (trayIconManager == null) {
trayIconManager = new TrayIconManager(stage, sessionManager);
} else {
trayIconManager.refresh();
}
});
}
// if (!WebAPI.isBrowser() && SystemTray.isSupported()) {
// RepositoryManager.repositoryUpdatedProperty().addListener(it -> {
// if (trayIconManager == null) {
// trayIconManager = new TrayIconManager(stage, sessionManager);
// } else {
// trayIconManager.refresh();
// }
// });
// }

// customs stage for decorations / the chrome
CustomStage customStage = new CustomStage(stage, routeNode, sessionManager);
customStage.setCloseHandler(() -> {
if (SystemTray.isSupported()) {
trayIconManager.hide();
}
// if (SystemTray.isSupported()) {
// trayIconManager.hide();
// }
stage.close();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ private static void initialLoad(ProgressMonitor monitor) throws Exception {
CloneCommand cloneCmd = Git.cloneRepository()
.setProgressMonitor(monitor)
.setURI(repoUrl)
.
.setBranch("live")
.setDepth(1)
.setDirectory(repoDirectory);
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/resources/META-INF/native-image/filter-file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ "rules": [
{"excludeClasses" : "com.sun.glass.ui.mac.*"},
{"excludeClasses" : "com.sun.glass.ui.gtk.*"},
{"excludeClasses" : "com.sun.glass.ui.win.*"},
{"excludeClasses" : "com.sun.prism.es2.*"},
{"excludeClasses" : "com.sun.prism.d3d.*"},
{"excludeClasses" : "com.sun.scenario.effect.impl.es2.*"},
{"excludeClasses" : "com.sun.scenario.effect.impl.hw.d3d.*"},
{"excludeClasses" : "com.gluonhq.attach.**"}
]
}
Loading

0 comments on commit fa6152d

Please sign in to comment.