diff --git a/README.md b/README.md index 8b8f2a8..5d05188 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ A repository with three variants of a javafx projects, with maven setup for Java 16 and JavaFX 16, and JUnit 5 (Jupiter) and TestFX for testing. -To make the project(s) more interesting, it is the start of an [RPN](https://en.wikipedia.org/wiki/Reverse_Polish_notation) calculator (look for `// TODO`) markers). The core logic is almost implemented (in [Calc.java](javafx-template/src/main/java/app/Calc.java)), the fxml file (in [App.fxml](javafx-template/src/main/resources/app/App.fxml) is almost complete, but the controller class (in [AppController.java](javafx-template/src/main/java/app/AppController.java) is pretty limited. And last, but not least, there is a TestFX-based test (in [AppTest.java](javafx-template/src/test/java/app/AppTest.java), see the [README](javafx-template/src/test/java/app/README.md) for details about what it tests). +To make the project(s) more interesting, it is the start of an [RPN](https://en.wikipedia.org/wiki/Reverse_Polish_notation) calculator (look for `// TODO`) markers). The core logic is almost implemented (in [Calc.java](javafx-template/src/main/java/app/Calc.java)), the fxml file (in [Calc.fxml](javafx-template/src/main/resources/app/App.fxml) is almost complete, but the controller class (in [CalcController.java](javafx-template/src/main/java/app/AppController.java) is pretty limited. And last, but not least, there is a TestFX-based test (in [CalcAppTest.java](javafx-template/src/test/java/app/AppTest.java), see the [README](javafx-template/src/test/java/app/README.md) for details about what it tests). ## javafx-template @@ -21,6 +21,6 @@ Template for multi-module, multi-package javafx project. All projects can be tried out by cd-ing into the corresponding folder and using `mvn`: -- compile with `mvn compile` (after `cd javafx-template` of course) +- compile with `mvn compile` (after `cd oysteikt-calc` of course) - test with `mvn test` (it should fail until you complete the RPN calculator) - run with `mvn javafx:run` (it should open, but not work properly) diff --git a/oysteikt-calc/pom.xml b/oysteikt-calc/pom.xml index 66bb246..7d10054 100644 --- a/oysteikt-calc/pom.xml +++ b/oysteikt-calc/pom.xml @@ -2,8 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 it1901 - javafx-template - 0.0.1-SNAPSHOT + oysteikt-calc + 1.0.0 UTF-8 @@ -90,7 +90,7 @@ - app.App + oysteikt.calc.CalcApp diff --git a/oysteikt-calc/src/main/java/app/Calc.java b/oysteikt-calc/src/main/java/oysteikt/calc/Calc.java similarity index 99% rename from oysteikt-calc/src/main/java/app/Calc.java rename to oysteikt-calc/src/main/java/oysteikt/calc/Calc.java index f769f6f..cc90df3 100644 --- a/oysteikt-calc/src/main/java/app/Calc.java +++ b/oysteikt-calc/src/main/java/oysteikt/calc/Calc.java @@ -1,4 +1,4 @@ -package app; +package oysteikt.calc; import java.util.ArrayList; import java.util.List; diff --git a/oysteikt-calc/src/main/java/app/App.java b/oysteikt-calc/src/main/java/oysteikt/calc/CalcApp.java similarity index 85% rename from oysteikt-calc/src/main/java/app/App.java rename to oysteikt-calc/src/main/java/oysteikt/calc/CalcApp.java index 4d2dc02..1fc4a92 100644 --- a/oysteikt-calc/src/main/java/app/App.java +++ b/oysteikt-calc/src/main/java/oysteikt/calc/CalcApp.java @@ -1,4 +1,4 @@ -package app; +package oysteikt.calc; import javafx.application.Application; import javafx.fxml.FXMLLoader; @@ -11,11 +11,11 @@ import java.io.IOException; /** * JavaFX App */ -public class App extends Application { +public class CalcApp extends Application { @Override public void start(Stage stage) throws IOException { - FXMLLoader fxmlLoader = new FXMLLoader(this.getClass().getResource("App.fxml")); + FXMLLoader fxmlLoader = new FXMLLoader(this.getClass().getResource("Calc.fxml")); Parent parent = fxmlLoader.load(); stage.setScene(new Scene(parent)); stage.show(); diff --git a/oysteikt-calc/src/main/java/app/AppController.java b/oysteikt-calc/src/main/java/oysteikt/calc/CalcController.java similarity index 96% rename from oysteikt-calc/src/main/java/app/AppController.java rename to oysteikt-calc/src/main/java/oysteikt/calc/CalcController.java index e72afad..047b383 100644 --- a/oysteikt-calc/src/main/java/app/AppController.java +++ b/oysteikt-calc/src/main/java/oysteikt/calc/CalcController.java @@ -1,4 +1,4 @@ -package app; +package oysteikt.calc; import java.util.List; import java.util.function.BinaryOperator; @@ -10,11 +10,11 @@ import javafx.scene.control.Label; import javafx.scene.control.Labeled; import javafx.scene.control.ListView; -public class AppController { +public class CalcController { private Calc calc; - public AppController() { + public CalcController() { calc = new Calc(0.0, 0.0, 0.0); } diff --git a/oysteikt-calc/src/main/resources/app/App.fxml b/oysteikt-calc/src/main/resources/oysteikt/calc/Calc.fxml similarity index 97% rename from oysteikt-calc/src/main/resources/app/App.fxml rename to oysteikt-calc/src/main/resources/oysteikt/calc/Calc.fxml index 5e9e25f..2fb7647 100644 --- a/oysteikt-calc/src/main/resources/app/App.fxml +++ b/oysteikt-calc/src/main/resources/oysteikt/calc/Calc.fxml @@ -5,7 +5,7 @@ -