diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2e28be3..8b2afef 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,11 +1,12 @@ [versions] jdk = "21" +javafx = "23" ikonliJavafx = "12.3.1" slf4j = "2.0.16" ikonli = "12.3.1" junit = "5.11.4" testcontainers = "1.20.4" -mockito = "5.14.2" +mockito = "5.15.2" gestalt = "0.35.1" eclipseCollections = "12.0.0.M3" jackson = "2.18.2" @@ -17,10 +18,10 @@ fury = "0.9.0" avajeValidaor = "2.4" h2 = "2.3.232" asciidoctor = "4.0.4" -avajeInject = "11.1-RC1" +avajeInject = "11.1" record-builder = "44" mutinyVertx = "3.17.1" -schemacrawler = "16.24.2" +schemacrawler = "16.25.1" polyglot = "24.1.1" ebean = "15.8.1" immutables = "2.10.1" @@ -34,11 +35,10 @@ maniftest = { id = "com.coditory.manifest", version = "1.1.0" } shadow = { id = "com.gradleup.shadow", version = "9.0.0-beta4" } jlink = { id = "org.beryx.jlink", version = "3.1.1" } graalvm = { id = "org.graalvm.buildtools.native", version = "0.10.4" } -spotless = { id = "com.diffplug.spotless", version = "7.0.0.BETA4" } +spotless = { id = "com.diffplug.spotless", version = "7.0.1" } sass = { id = "io.miret.etienne.sass", version = "1.5.1" } ebean = { id = "io.ebean", version.ref = "ebean" } semver = { id = "com.xenoterracide.gradle.semver", version = "0.11.5" } -frontend = { id = "org.siouan.frontend-jdk21", version = "10.0.0" } docker = { id = "com.bmuschko.docker-java-application", version = "9.4.0" } javamodularity = { id = "org.javamodularity.moduleplugin", version = "1.8.15" } asciidoctorJvm = { id = "org.asciidoctor.jvm.convert", version.ref = "asciidoctor" } @@ -63,7 +63,7 @@ slf4jJdkPlatform = { group = "org.slf4j", name = "slf4j-jdk-platform-logging", v slf4jJulBridage = { group = "org.slf4j", name = "jul-to-slf4j", version.ref = "slf4j" } oshi = { group = "com.github.oshi", name = "oshi-core-java11", version = "6.6.5" } -logback = { group = "ch.qos.logback", name = "logback-classic", version = "1.5.15" } +logback = { group = "ch.qos.logback", name = "logback-classic", version = "1.5.16" } #UI simpleicon = { group = "org.kordamp.ikonli", name = "ikonli-simpleicons-pack", version.ref = "ikonli" } @@ -81,7 +81,7 @@ junit-bom = { group = "org.junit", name = "junit-bom", version.ref = "junit" } junit-juiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit" } junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit" } junit-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junit" } -junit-platform-suite = { group = "org.junit.platform", name = "junit-platform-suite", version = "1.11.3" } +junit-platform-suite = { group = "org.junit.platform", name = "junit-platform-suite", version = "1.11.4" } junit-perf = { group = "com.github.noconnor", name = "junitperf-junit5", version = "1.37.0" } testcontainers-bom = { group = "org.testcontainers", name = "testcontainers-bom", version.ref = "testcontainers" } testcontainers = { group = "org.testcontainers", name = "testcontainers", version.ref = "testcontainers" } @@ -101,7 +101,7 @@ guava = { group = "com.google.guava", name = "guava", version = "33.4.0-jre" } mysql = { group = "com.mysql", name = "mysql-connector-j", version = "9.1.0" } postgres = { group = "org.postgresql", name = "postgresql", version = "42.7.4" } h2 = { group = "com.h2database", name = "h2", version.ref = "h2" } -sqlite = { group = "org.xerial", name = "sqlite-jdbc", version = "3.47.1.0" } +sqlite = { group = "org.xerial", name = "sqlite-jdbc", version = "3.47.2.0" } eclipse-collections-api = { group = "org.eclipse.collections", name = "eclipse-collections-api", version.ref = "eclipseCollections" } eclipse-collections = { group = "org.eclipse.collections", name = "eclipse-collections", version.ref = "eclipseCollections" } @@ -148,7 +148,7 @@ jgit-lfs = { group = "org.eclipse.jgit", name = "org.eclipse.jgit.lfs", version. jgit-ssh = { group = "org.eclipse.jgit", name = "org.eclipse.jgit.ssh.apache", version.ref = "jgit" } jgit-http = { group = "org.eclipse.jgit", name = "org.eclipse.jgit.http.apache", version.ref = "jgit" } -jsh = { group = "com.github.mwiede", name = "jsch", version = "0.2.21" } +jsh = { group = "com.github.mwiede", name = "jsch", version = "0.2.22" } vertx-core = { group = "io.vertx", name = "vertx-core", version.ref = "vertx" } vertx-junit5 = { group = "io.vertx", name = "vertx-junit5", version.ref = "vertx" } @@ -211,4 +211,5 @@ theme-detector = { group = "com.github.Dansoftowner", name = "jSystemThemeDetect lombok-plugin = { group = "name.remal.gradle-plugins.lombok", name = "lombok", version = "2.2.14" } bootstrap = { group = "org.webjars", name = "bootstrap", version = "5.3.3" } -tailwindcss = { group = "org.webjars.npm", name = "tailwindcss", version = "4.0.0-beta.3" } \ No newline at end of file +tailwindcss = { group = "org.webjars.npm", name = "tailwindcss", version = "4.0.0-beta.3" } +auto-factory = {group="com.google.auto.factory",name="auto-factory",version="1.1.0"} \ No newline at end of file diff --git a/visual-app/build.gradle.kts b/visual-app/build.gradle.kts index f15659c..2c5da3e 100644 --- a/visual-app/build.gradle.kts +++ b/visual-app/build.gradle.kts @@ -120,7 +120,7 @@ dependencies { javafx { modules(*javafxModules.toTypedArray()) - version = "23" + version = libs.versions.javafx.get() configurations = arrayOf( IMPLEMENTATION, diff --git a/visual-app/src/main/java/module-info.java b/visual-app/src/main/java/module-info.java index e83dadf..fa00340 100644 --- a/visual-app/src/main/java/module-info.java +++ b/visual-app/src/main/java/module-info.java @@ -41,7 +41,7 @@ requires io.avaje.validation; requires com.github.benmanes.caffeine; requires jdk.management; - + requires org.visual.editor; requires io.smallrye.mutiny.vertx.core; requires com.jthemedetector; diff --git a/visual-app/src/main/java/org/visual/app/component/EditorContainer.java b/visual-app/src/main/java/org/visual/app/component/EditorContainer.java deleted file mode 100644 index 7bcadfc..0000000 --- a/visual-app/src/main/java/org/visual/app/component/EditorContainer.java +++ /dev/null @@ -1,23 +0,0 @@ -package org.visual.app.component; - -import javafx.scene.layout.AnchorPane; -import lombok.extern.slf4j.Slf4j; -import lombok.val; - -@Slf4j -public class EditorContainer extends AnchorPane { - - private final GridBackground gridBackground = new GridBackground(); - - public EditorContainer() { - getChildren().add(gridBackground); - } - - @Override - protected void layoutChildren() { - super.layoutChildren(); - val width = getWidth(); - val height = getHeight(); - gridBackground.resizeRelocate(0, 0, width, height); - } -} diff --git a/visual-app/src/main/java/org/visual/app/context/DiagramContext.java b/visual-app/src/main/java/org/visual/app/context/DiagramContext.java index 5c26df2..217be5d 100644 --- a/visual-app/src/main/java/org/visual/app/context/DiagramContext.java +++ b/visual-app/src/main/java/org/visual/app/context/DiagramContext.java @@ -4,7 +4,7 @@ import jakarta.inject.Singleton; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.visual.data.structure.diagram.VisualDiagram; +import org.visual.data.structure.diagram.VDiagram; import java.util.List; @@ -13,9 +13,9 @@ @RequiredArgsConstructor public class DiagramContext { - private final List diagrams = new ObjectArrayList<>(); + private final List diagrams = new ObjectArrayList<>(); - public void add(VisualDiagram diagram) { + public void add(VDiagram diagram) { diagrams.add(diagram); } } diff --git a/visual-app/src/main/java/org/visual/app/controller/dialog/GettingStartedController.java b/visual-app/src/main/java/org/visual/app/controller/dialog/GettingStartedController.java index 3c7b6ae..96d71b3 100644 --- a/visual-app/src/main/java/org/visual/app/controller/dialog/GettingStartedController.java +++ b/visual-app/src/main/java/org/visual/app/controller/dialog/GettingStartedController.java @@ -17,7 +17,6 @@ import lombok.val; import org.visual.app.component.NavigationPane; import org.visual.app.context.DiagramContext; -import org.visual.app.util.CreateDiagram; import java.io.File; import java.net.URL; @@ -71,15 +70,15 @@ public void handleCreateNewWorkspace(ActionEvent actionEvent) { } public void handleCreateNewDiagram() { - Uni.createFrom().item(CreateDiagram.createDefaultDiagram()) - .log() - .invoke(diagramContext::add) - .subscribe().with(t -> { - Platform.runLater(() -> { - val stage = (Stage) root.getScene().getWindow(); - stage.close(); - }); - }); +// Uni.createFrom().item(CreateDiagram.createDefaultDiagram()) +// .log() +// .invoke(diagramContext::add) +// .subscribe().with(t -> { +// Platform.runLater(() -> { +// val stage = (Stage) root.getScene().getWindow(); +// stage.close(); +// }); +// }); } public void handleExit() { diff --git a/visual-app/src/main/java/org/visual/app/controller/workspace/EditorController.java b/visual-app/src/main/java/org/visual/app/controller/workspace/EditorController.java index 59b7812..c641235 100644 --- a/visual-app/src/main/java/org/visual/app/controller/workspace/EditorController.java +++ b/visual-app/src/main/java/org/visual/app/controller/workspace/EditorController.java @@ -3,15 +3,10 @@ import jakarta.inject.Singleton; import javafx.fxml.FXML; import javafx.fxml.Initializable; -import javafx.scene.control.ScrollPane; -import javafx.scene.layout.Background; -import javafx.scene.paint.Color; import lombok.extern.slf4j.Slf4j; -import lombok.val; -import org.visual.app.component.DataContent; -import org.visual.app.component.DraggableStackPane; -import org.visual.app.component.EditorContainer; -import org.visual.app.model.DatabaseObjBuilder; +import org.visual.editor.core.VisualEditor; +import org.visual.editor.view.EditorContainer; +import org.visual.editor.view.model.EditorProperties; import java.net.URL; import java.util.ResourceBundle; @@ -22,22 +17,20 @@ public class EditorController implements Initializable { @FXML private EditorContainer container; - @FXML - private ScrollPane root; + + private final EditorProperties properties = new EditorProperties(); + + private final VisualEditor visualEditor = new VisualEditor(properties); @Override public void initialize(URL url, ResourceBundle resourceBundle) { - val stackPane = new DraggableStackPane(); - stackPane.setBackground(Background.fill(Color.ALICEBLUE)); - val dc = new DataContent(DatabaseObjBuilder.builder() - .name("test") - .type("test") - .build()); - container.setOnMouseDragged(event -> { - System.err.println(container.getWidth()); - System.err.println(container.getHeight()); - }); - stackPane.getChildren().add(dc); - container.getChildren().add(stackPane); +// val model = VModel.builder() +// .version("1.0") +// .type("graph") +// .contentWidth(1000.0) +// .contentHeight(1000.0) +// .build(); +// visualEditor.setModel(model); +// container.setVisualEditor(visualEditor); } } diff --git a/visual-app/src/main/java/org/visual/app/lifecycle/SetupThemeLifecycle.java b/visual-app/src/main/java/org/visual/app/lifecycle/SetupThemeLifecycle.java index 3f748c4..bfceeb2 100644 --- a/visual-app/src/main/java/org/visual/app/lifecycle/SetupThemeLifecycle.java +++ b/visual-app/src/main/java/org/visual/app/lifecycle/SetupThemeLifecycle.java @@ -20,6 +20,7 @@ public class SetupThemeLifecycle implements ViewLifecycle { @Override public void onInit() { setUserAgentStylesheet(detectTheme()); + detector.registerListener(isDark -> setUserAgentStylesheet(isDark ? new PrimerDark().getUserAgentStylesheet() : new PrimerLight().getUserAgentStylesheet())); } private @NotNull String detectTheme() { diff --git a/visual-app/src/main/java/org/visual/app/util/CreateDiagram.java b/visual-app/src/main/java/org/visual/app/util/CreateDiagram.java index 5ba73b7..e036a70 100644 --- a/visual-app/src/main/java/org/visual/app/util/CreateDiagram.java +++ b/visual-app/src/main/java/org/visual/app/util/CreateDiagram.java @@ -1,34 +1,26 @@ package org.visual.app.util; import lombok.experimental.UtilityClass; -import lombok.val; -import org.visual.data.structure.diagram.VisualDiagram; -import org.visual.data.structure.diagram.VisualDiagramMetadata; -import org.visual.data.structure.graph.VisualGraphicalObject; -import org.visual.data.structure.graph.VisualProperties; - -import java.util.Date; -import java.util.UUID; @UtilityClass public class CreateDiagram { - public VisualDiagram createDefaultDiagram() { - val meta = VisualDiagramMetadata.builder().createAt(new Date()) - .lastModifiedAt(new Date()) - .title("untitled") - .build(); - val prop = VisualProperties - .builder() - .color("red") - .borderWidth(1) - .borderColor("non") - .width(20.0) - .height(20.0) - .build(); - VisualGraphicalObject.builder().id(UUID.randomUUID().toString()).type("rec").x(20).y(20).properties(prop).build(); - return VisualDiagram.builder().version("0.1") - .metadata(meta) - .build(); - } +// public VisualDiagram createDefaultDiagram() { +// val meta = VisualDiagramMetadata.builder().createAt(new Date()) +// .lastModifiedAt(new Date()) +// .title("untitled") +// .build(); +// val prop = VisualProperties +// .builder() +// .color("red") +// .borderWidth(1) +// .borderColor("non") +// .width(20.0) +// .height(20.0) +// .build(); +// VisualGraphicalObject.builder().id(UUID.randomUUID().toString()).type("rec").x(20).y(20).properties(prop).build(); +// return VisualDiagram.builder().version("0.1") +// .metadata(meta) +// .build(); +// } } diff --git a/visual-app/src/main/resources/org/visual/app/view/workspace/Editor.fxml b/visual-app/src/main/resources/org/visual/app/view/workspace/Editor.fxml index f9cd9fb..00ec2b1 100644 --- a/visual-app/src/main/resources/org/visual/app/view/workspace/Editor.fxml +++ b/visual-app/src/main/resources/org/visual/app/view/workspace/Editor.fxml @@ -1,23 +1,12 @@ - - - - - - + - - - - - -