Initial commit
This commit is contained in:
20
gui/run/pom.xml
Normal file
20
gui/run/pom.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>ch.gtache.fro.gui</groupId>
|
||||
<artifactId>gui</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>gui-run</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ch.gtache.fro.gui</groupId>
|
||||
<artifactId>gui-fx</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,23 @@
|
||||
package ch.gtache.fro.gui.run;
|
||||
|
||||
import ch.gtache.fro.gui.run.modules.DaggerFroComponent;
|
||||
import javafx.application.Application;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* The main application class
|
||||
*/
|
||||
public final class FroApplication extends Application {
|
||||
|
||||
@Override
|
||||
public void start(final Stage stage) throws IOException {
|
||||
final var component = DaggerFroComponent.create();
|
||||
final var loader = component.getMainLoader();
|
||||
loader.load();
|
||||
stage.setScene(new Scene(loader.getRoot()));
|
||||
stage.show();
|
||||
}
|
||||
}
|
||||
21
gui/run/src/main/java/ch/gtache/fro/gui/run/Main.java
Normal file
21
gui/run/src/main/java/ch/gtache/fro/gui/run/Main.java
Normal file
@@ -0,0 +1,21 @@
|
||||
package ch.gtache.fro.gui.run;
|
||||
|
||||
import javafx.application.Application;
|
||||
|
||||
/**
|
||||
* The main class
|
||||
*/
|
||||
public final class Main {
|
||||
|
||||
private Main() {
|
||||
}
|
||||
|
||||
/**
|
||||
* The main method
|
||||
*
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(final String[] args) {
|
||||
Application.launch(FroApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package ch.gtache.fro.gui.run.modules;
|
||||
|
||||
import ch.gtache.fro.modules.gui.fx.FXModule;
|
||||
import ch.gtache.fro.modules.gui.impl.GuiCoreModule;
|
||||
import ch.gtache.fro.modules.impl.CoreModule;
|
||||
import dagger.Component;
|
||||
import jakarta.inject.Singleton;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
|
||||
@Singleton
|
||||
@Component(modules = {CoreModule.class, GuiCoreModule.class, FXModule.class})
|
||||
public interface FroComponent {
|
||||
|
||||
/**
|
||||
* Returns the FXMLLoader for the main view
|
||||
*
|
||||
* @return the FXMLLoader
|
||||
*/
|
||||
FXMLLoader getMainLoader();
|
||||
}
|
||||
|
||||
14
gui/run/src/main/java/module-info.java
Normal file
14
gui/run/src/main/java/module-info.java
Normal file
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* GUI run module for the FRO project
|
||||
*/
|
||||
module ch.gtache.fro.gui.run {
|
||||
requires ch.gtache.fro.gui.fx;
|
||||
requires ch.gtache.fro.core;
|
||||
requires dagger;
|
||||
requires javafx.graphics;
|
||||
requires javafx.fxml;
|
||||
requires jakarta.inject;
|
||||
requires ch.gtache.fro.gui.core;
|
||||
|
||||
exports ch.gtache.fro.gui.run to javafx.graphics;
|
||||
}
|
||||
Reference in New Issue
Block a user