diff --git a/libs/DrAST-1.2.2.jar b/libs/DrAST-1.2.2.jar index 399bbeb6c19fd40e3b411d1527a8f5e98d4ed1be..3860976b6f7296c8c4e8edb8f06544d326577876 100644 Binary files a/libs/DrAST-1.2.2.jar and b/libs/DrAST-1.2.2.jar differ diff --git a/statemachine.drast/01-initial.png b/statemachine.drast/01-initial.png new file mode 100644 index 0000000000000000000000000000000000000000..0403c6d187631ff3f5dea3c77ca09af155840b27 Binary files /dev/null and b/statemachine.drast/01-initial.png differ diff --git a/statemachine.drast/02-transformed.png b/statemachine.drast/02-transformed.png new file mode 100644 index 0000000000000000000000000000000000000000..48408c68cffc42b0da26daf7ae5362a1baff4708 Binary files /dev/null and b/statemachine.drast/02-transformed.png differ diff --git a/statemachine.drast/build.gradle b/statemachine.drast/build.gradle index caf43116b58c2a4e5dd223428e52601b50a94957..5901d4a8a54da98c148b055357262995cd4061a3 100644 --- a/statemachine.drast/build.gradle +++ b/statemachine.drast/build.gradle @@ -1,34 +1,42 @@ +buildscript { + repositories.mavenCentral() + + dependencies { + classpath group: 'org.jastadd', name: 'jastaddgradle', version: '1.13.3' + } +} + +plugins { + id 'java' + id 'application' + id "idea" + id 'org.openjfx.javafxplugin' version "0.0.8" apply false +} + group 'de.tudresden.inf.st' version '0.1' -apply plugin: 'java' -apply plugin: 'application' -apply plugin: "idea" dependencies { - implementation project(':statemachine.solution') implementation files('../libs/DrAST-1.2.2.jar') - implementation fileTree(dir: "${System.properties['java.home']}", include: '**/jfxrt.jar') + implementation project(':statemachine.solution') } -sourceSets.main.java.srcDir "src/main/java" - run { mainClassName = 'de.tudresden.inf.st.statemachine.DrAstRunner' - standardInput = System.in + + jvmArgs '-Xmx4096m', + '--add-opens', 'javafx.graphics/javafx.scene.text=ALL-UNNAMED', + '--add-exports', 'javafx.graphics/com.sun.javafx.text=ALL-UNNAMED' } run.dependsOn ':statemachine.solution:jar' run.doFirst { environment 'JAVA_TOOL_OPTIONS', '-Dlog4j2.disableJmx=true' } -task jarDrAst(type: Jar, dependsOn: ':statemachine.base:jar') { - group = "build" - description = 'create a jar to run the DrAST visual debugger tool' - manifest { - attributes 'Implementation-Title': 'DrAST visual debugger tool for StateMachine', - 'Implementation-Version': project.version, - 'Main-Class': 'de.tudresden.inf.st.statemachine.DrAstRunner' + +jar { + apply plugin: 'org.openjfx.javafxplugin' + javafx { + version = "11" + modules = ['javafx.controls', 'javafx.fxml', 'javafx.swing'] } - archivesBaseName = 'drast-statemachine-all' - from { sourceSets.main.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } - with jar } diff --git a/statemachine.drast/src/main/java/de/tudresden/inf/st/statemachine/DrAstRunner.java b/statemachine.drast/src/main/java/de/tudresden/inf/st/statemachine/DrAstRunner.java index ecab21020f7dd6be3de06e03f027bc7fadd444da..3dcc5daa4ecd15a2ace637e6132e4c3fd7453aab 100644 --- a/statemachine.drast/src/main/java/de/tudresden/inf/st/statemachine/DrAstRunner.java +++ b/statemachine.drast/src/main/java/de/tudresden/inf/st/statemachine/DrAstRunner.java @@ -1,83 +1,19 @@ package de.tudresden.inf.st.statemachine; -import drast.Log; -import drast.model.DrAST; import drast.model.DrASTSettings; -import drast.model.TreeFilter; import drast.views.gui.DrASTGUI; -import drast.views.gui.GUIData; -import drast.views.gui.controllers.Controller; -import drast.views.gui.graph.GraphView; -import javafx.application.Platform; -import javafx.fxml.FXMLLoader; -import javafx.geometry.Rectangle2D; -import javafx.scene.Parent; -import javafx.scene.Scene; -import javafx.scene.control.ScrollPane; -import javafx.stage.Screen; -import javafx.stage.Stage; /** * Extended runner for DrAST * * @author jmey - Initial contribution */ -public class DrAstRunner extends DrASTGUI { +public class DrAstRunner { public static void main(String[] args) { - - openView(); - System.exit(0); - - } - - private static final GUIData mon = new GUIData(); - private static Controller con; - private static boolean guiHasBeenCreated = false; - - private static void openView() { - guiHasBeenCreated = true; DrASTSettings.put(DrASTSettings.PREV_JAR, "../statemachine.solution/build/libs/statemachine.solution-0.1.jar"); - DrASTSettings.put(DrASTSettings.PREV_TAIL_ARGS, "-Dlog4j2.disable.jmx=true"); - launch(); - con.onApplicationClose(); - } - - public void setRoot(Object root) { - long timeStart = System.currentTimeMillis(); - DrAST newAst = new DrAST(root, TreeFilter.readFilter(con.getFilter())); - Log.info("Filter update: done after %d ms", System.currentTimeMillis() - timeStart); - Platform.runLater(() -> { - mon.reset(newAst); - if (guiHasBeenCreated) { - con.onSetRoot(); - } else { - openView(); - } - - }); - } - - public void start(Stage stage) throws Exception { - FXMLLoader loader = new FXMLLoader(); - Parent rootView = loader.load(this.getClass().getResource("/main.fxml").openStream()); - con = loader.getController(); - mon.setParentStage(stage); - mon.setController(con); - mon.setDrASTUI(this); - mon.setStage(stage); - GraphView graphview = new GraphView(mon); - graphview.setOnMouseClicked((event) -> graphview.getParent().requestFocus()); - mon.setGraphView(graphview); - con.init(mon); - Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds(); - stage.setTitle("Statemachine DrAST 1.2.2"); - stage.setScene(new Scene(rootView, primaryScreenBounds.getWidth(), primaryScreenBounds.getHeight() - 100.0D)); - stage.show(); - ScrollPane center = (ScrollPane)rootView.lookup("#graphViewScrollPane"); - center.setContent(graphview); - Platform.runLater(() -> graphview.setPreferredSize((int)center.getWidth(), (int)center.getHeight())); - con.loadPreviousFilter(); + DrASTSettings.put(DrASTSettings.PREV_FIRST_ARG, "../statemachine.solution/src/test/resources/empty.sm"); + DrASTGUI.main(args); } } diff --git a/statemachine.solution/build.gradle b/statemachine.solution/build.gradle index 2102617cd55c98ad5baa52d4d146b0f5ba810fac..2dd4b0d9f166efba710ed4d04cc19d241692a4e7 100644 --- a/statemachine.solution/build.gradle +++ b/statemachine.solution/build.gradle @@ -21,7 +21,11 @@ configurations { File genSrc = file("src/gen/java") idea.module.generatedSourceDirs += genSrc sourceSets.main.java.srcDir genSrc -//jar.manifest.attributes('Main-Class': 'de.tudresden.inf.st.statemachine.Main') + +jar { + from { sourceSets.main.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } + manifest.attributes('Main-Class': 'de.tudresden.inf.st.statemachine.Main') +} dependencies { implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jackson_version}"