diff --git a/java/embedControlJavaFx/README.md b/java/embedControlJavaFx/README.md index e9a5532..3f6edb0 100644 --- a/java/embedControlJavaFx/README.md +++ b/java/embedControlJavaFx/README.md @@ -6,13 +6,15 @@ Contained in this package is the source code for the complete user interface tha It is likely before any public release that you'll want to customize the application. This can easily be acheived by editing the images and forms stored in the `src/main/resources` folder. A few of the most common ones are provided here: -* `fximg/large_icon.png` is the icon drawn by the application forms. -* `fximg/embedCONTROL.ico` is the start up application icon, only used by the packager on Windows -* `fximg/MyIcons.icns` is the start up application icon, only used by the packager on macOS +* `version.properties` this contains the name of the application, and the build version and timestamp (the later are set during a maven build). * `aboutPage.fxml` is the JavaFX form definition for the about window. * `generalSettings.fxml` is the JavaFX settings form definition, only change this if you also modify the controller accordingly. * `mainWindow.fxml` is the main window when the app starts -* `version.properties` is automatically set by maven during the build +* `fximg/large_icon.png` is the icon drawn by the application forms. +* `fximg/embedCONTROL.ico` is the start up application icon, only used by the packager on Windows +* `fximg/MyIcons.icns` is the start up application icon, only used by the packager on macOS + +You can use the EmbedControl icon or logo to show compatibility with TagVal protocol. You can also provide your own custom pages, each page must extend from `PanelPresentable` and can be added to the navigation manager, in this case the `JfxNavigationHeader` in `RemoteConnectionPanel` using `navigationManager.addCustomMenuPanel(subMenuCustom, myPanelPresentable)`. diff --git a/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/EmbedControlApp.java b/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/EmbedControlApp.java index 723deb5..9674303 100644 --- a/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/EmbedControlApp.java +++ b/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/EmbedControlApp.java @@ -38,7 +38,7 @@ public void start(Stage primaryStage) throws Exception { // At this point we build a JavaFX stage and load up our main window primaryStage.getIcons().add(new Image( Objects.requireNonNull(getClass().getResourceAsStream("/fximg/large_icon.png")))); - primaryStage.setTitle("embedCONTROL desktop"); + primaryStage.setTitle(applicationContext.getHelper().getTitle()); FXMLLoader loader = new FXMLLoader(getClass().getResource("/mainWindow.fxml")); Pane myPane = loader.load(); diff --git a/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/RemoteUiEmbedControlContext.java b/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/RemoteUiEmbedControlContext.java index 272365e..3ccad4a 100644 --- a/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/RemoteUiEmbedControlContext.java +++ b/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/RemoteUiEmbedControlContext.java @@ -66,7 +66,7 @@ public void initialize(MainWindowController controller) { allPresentableViews.addAll(defaultViews); allPresentableViews.addAll(loadedPanels); - controller.initialise(getSettings(), allPresentableViews, versionHelper); + controller.initialise(allPresentableViews, versionHelper); } diff --git a/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/VersionHelper.java b/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/VersionHelper.java index ed06040..b10abcf 100644 --- a/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/VersionHelper.java +++ b/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/VersionHelper.java @@ -27,4 +27,12 @@ public VersionInfo getVersion() { public String getBuildTimestamp() { return props.getProperty("build.timestamp", ""); } + + public String getShortTitle() { + return props.getProperty("build.shortTitle"); + } + + public String getTitle() { + return props.getProperty("build.title"); + } } diff --git a/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/dialog/AboutController.java b/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/dialog/AboutController.java index aed1fd7..f98d6b2 100644 --- a/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/dialog/AboutController.java +++ b/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/dialog/AboutController.java @@ -7,9 +7,11 @@ public class AboutController { public Label versionLabel; + public Label titleLabel; public void initialise(VersionHelper versionHelper) { versionLabel.setText("Version " + versionHelper.getVersion() + " built on " + versionHelper.getBuildTimestamp()); + titleLabel.setText(versionHelper.getTitle()); } public void onVisitDocs(ActionEvent actionEvent) { diff --git a/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/dialog/MainWindowController.java b/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/dialog/MainWindowController.java index 75a1bdb..74d3301 100644 --- a/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/dialog/MainWindowController.java +++ b/java/embedControlJavaFx/src/main/java/com/thecoderscorner/embedcontrol/jfxapp/dialog/MainWindowController.java @@ -7,7 +7,6 @@ package com.thecoderscorner.embedcontrol.jfxapp.dialog; import com.thecoderscorner.embedcontrol.core.controlmgr.PanelPresentable; -import com.thecoderscorner.embedcontrol.core.service.GlobalSettings; import com.thecoderscorner.embedcontrol.jfxapp.VersionHelper; import javafx.collections.ObservableList; import javafx.scene.Node; @@ -42,17 +41,16 @@ public class MainWindowController { public Label versionField; public ListView> connectionList; public BorderPane detailPane; - private GlobalSettings settings; + public Label titleBranding; private PanelPresentable currentlyDisplayed; - public void initialise(GlobalSettings settings, ObservableList> initialPanels, VersionHelper versionHelper) { - this.settings = settings; - + public void initialise(ObservableList> initialPanels, VersionHelper versionHelper) { + titleBranding.setText(versionHelper.getShortTitle()); versionField.setText("Version " + versionHelper.getVersion()); - connectionList.setCellFactory(list -> new PanelPresentableListCell()); + connectionList.setCellFactory(_ -> new PanelPresentableListCell()); connectionList.setItems(initialPanels); - connectionList.getSelectionModel().selectedItemProperty().addListener((observableValue, oldVal, newVal) -> { + connectionList.getSelectionModel().selectedItemProperty().addListener((_, _, newVal) -> { if(newVal != null) { try { logger.log(INFO, "Change panel to ", newVal.getPanelName()); diff --git a/java/embedControlJavaFx/src/main/resources/aboutPage.fxml b/java/embedControlJavaFx/src/main/resources/aboutPage.fxml index f892b49..d63dbfa 100644 --- a/java/embedControlJavaFx/src/main/resources/aboutPage.fxml +++ b/java/embedControlJavaFx/src/main/resources/aboutPage.fxml @@ -14,7 +14,7 @@ -