Implements database, adds profiles

This commit is contained in:
2025-10-01 22:23:00 +02:00
parent b2571c191f
commit d2da811868
86 changed files with 17323 additions and 483 deletions
+4
View File
@@ -24,6 +24,10 @@
<groupId>ch.gtache.fro</groupId>
<artifactId>fro-oiseaux-net</artifactId>
</dependency>
<dependency>
<groupId>ch.gtache.fro</groupId>
<artifactId>fro-h2</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
@@ -1,5 +1,6 @@
package ch.gtache.fro.gui.run;
import ch.gtache.fro.Initializer;
import ch.gtache.fro.gui.run.modules.DaggerFroComponent;
import javafx.application.Application;
import javafx.scene.Scene;
@@ -13,14 +14,15 @@ import java.io.IOException;
public final class FroApplication extends Application {
@Override
public void start(final Stage stage) throws IOException {
public void start(final Stage primaryStage) throws IOException {
final var component = DaggerFroComponent.create();
component.initializers().forEach(Initializer::initialize);
final var loader = component.getMainLoader();
loader.load();
stage.setScene(new Scene(loader.getRoot()));
stage.sizeToScene();
stage.setWidth(820);
stage.setHeight(900);
stage.show();
primaryStage.setScene(new Scene(loader.getRoot()));
primaryStage.sizeToScene();
primaryStage.setWidth(820);
primaryStage.setHeight(900);
primaryStage.show();
}
}
@@ -7,7 +7,7 @@ import org.apache.logging.log4j.Logger;
/**
* The main class
*/
public final class Main {
final class Main {
private static final Logger logger = LogManager.getLogger(Main.class);
@@ -19,7 +19,7 @@ public final class Main {
*
* @param args the command line arguments
*/
public static void main(final String[] args) {
static void main(final String[] args) {
Thread.setDefaultUncaughtExceptionHandler((t, e) -> logger.error("Uncaught exception on thread {}", t, e));
Application.launch(FroApplication.class, args);
}
@@ -1,7 +1,10 @@
package ch.gtache.fro.gui.run.modules;
import ch.gtache.fro.Initializer;
import ch.gtache.fro.modules.database.DatabaseModule;
import ch.gtache.fro.modules.gui.fx.FXModule;
import ch.gtache.fro.modules.gui.impl.GuiCoreModule;
import ch.gtache.fro.modules.h2.H2Module;
import ch.gtache.fro.modules.impl.CoreModule;
import ch.gtache.fro.modules.oiseaux.net.OiseauxNetModule;
import ch.gtache.fro.modules.vogelwarte.VogelwarteModule;
@@ -9,8 +12,10 @@ import dagger.Component;
import jakarta.inject.Singleton;
import javafx.fxml.FXMLLoader;
import java.util.Set;
@Singleton
@Component(modules = {CoreModule.class, GuiCoreModule.class, FXModule.class, VogelwarteModule.class, OiseauxNetModule.class})
@Component(modules = {CoreModule.class, DatabaseModule.class, FXModule.class, GuiCoreModule.class, H2Module.class, OiseauxNetModule.class, VogelwarteModule.class,})
public interface FroComponent {
/**
@@ -19,5 +24,12 @@ public interface FroComponent {
* @return the FXMLLoader
*/
FXMLLoader getMainLoader();
/**
* Returns the initializers for the application
*
* @return The initializers
*/
Set<Initializer> initializers();
}
+1
View File
@@ -4,6 +4,7 @@
module ch.gtache.fro.gui.run {
requires ch.gtache.fro.gui.fx;
requires ch.gtache.fro.core;
requires ch.gtache.fro.h2;
requires java.compiler;
requires javafx.graphics;
requires javafx.fxml;