Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ instructions provided in "_**Fork the Repository**_" section in [GitHub document
5. Run the Komet application with the following command:

```bash
./mvnw -f application javafx:run
./mvnw -f dev javafx:run
```

6. You can open Komet code using your favorite IDE like _Eclipse_ or _IntelliJ Idea_ and try running it from there.
Expand All @@ -80,7 +80,7 @@ instructions provided in "_**Fork the Repository**_" section in [GitHub document
After building Komet, you can run it with JPro on your local machine by following these steps:
1. Execute the following command to run the Komet application in your web browser:
```bash
./mvnw -f application -Pjpro jpro:run
./mvnw -f dev -Pjpro jpro:run
```
The default web browser should open automatically, displaying the Komet application. If it doesn't, navigate
to `http://localhost:8080` in your browser.
Expand Down
104 changes: 3 additions & 101 deletions application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,7 @@
<version>1.56.0-SNAPSHOT</version>
</parent>
<artifactId>application</artifactId>
<!-- Required for ScenicView. -->
<!--
<repositories>
<repository>
<id>jpro-repository</id>
<url>https://sandec.jfrog.io/artifactory/repo</url>
</repository>
</repositories>-->
<dependencies>

<!-- THE FORK has a small change, to allow opening it in JPro as a popup -->

<!--
<dependency>
<groupId>org.scenic-view</groupId>
<artifactId>scenic-view</artifactId>
<version>11.0.3-SNAPSHOT-FORK</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
</dependency>-->
<dependency>
<groupId>de.jangassen</groupId>
<artifactId>nsmenufx</artifactId>
Expand Down Expand Up @@ -222,9 +201,9 @@
<id>default-cli</id>
<phase>package</phase>
<!-- <phase>none</phase> -->
<goals>
<!--<goals>
<goal>jlink</goal>
</goals>
</goals>-->
<configuration>
<launcher>launchKomet</launcher>
<jlinkImageName>kometRuntimeImage</jlinkImageName>
Expand All @@ -242,61 +221,6 @@
</options>
</configuration>
</execution>
<execution>
<!-- Configuration for debugging -->
<id>debug</id>
<phase>package</phase>
<!-- <phase>none</phase>-->
<goals>
<goal>jlink</goal>
</goals>
<configuration>
<launcher>debugKomet</launcher>
<jlinkImageName>kometDebugRuntimeImage</jlinkImageName>
<jlinkVerbose>true</jlinkVerbose>
<jlinkZipName>kometDebugJlink</jlinkZipName>
<options>
<option>--add-opens</option>
<option>javafx.graphics/javafx.scene=org.controlsfx.controls</option>
<option>--add-exports</option>
<option>javafx.controls/com.sun.javafx.scene.control.behavior=dev.ikm.komet.navigator
</option>
<option>
-Djava.util.concurrent.ForkJoinPool.common.exceptionHandler=dev.ikm.tinkar.common.alert.UncaughtExceptionAlertStreamer
</option>
<option>
-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:8000
</option>
</options>
</configuration>
</execution>
<execution>
<!-- Configuration for profiling -->
<id>profile</id>
<phase>package</phase>
<!-- <phase>none</phase>-->
<goals>
<goal>jlink</goal>
</goals>
<configuration>
<launcher>profileKomet</launcher>
<jlinkImageName>kometProfileRuntimeImage</jlinkImageName>
<jlinkVerbose>true</jlinkVerbose>
<jlinkZipName>kometProfileJlink</jlinkZipName>
<options>
<option>--add-opens</option>
<option>javafx.graphics/javafx.scene=org.controlsfx.controls</option>
<option>--add-exports</option>
<option>javafx.controls/com.sun.javafx.scene.control.behavior=dev.ikm.komet.navigator</option>
<option>--add-exports</option>
<option>javafx.base/com.sun.javafx.event=one.jpro.platform.file</option>
<option>-Djava.util.concurrent.ForkJoinPool.common.exceptionHandler=dev.ikm.tinkar.common.alert.UncaughtExceptionAlertStreamer</option>
<option>
-agentpath:/Applications/JProfiler.app/Contents/Resources/app/bin/macos/libjprofilerti.jnilib=port=8849
</option>
</options>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -338,29 +262,6 @@
</plugins>
</build>
<profiles>
<profile>
<id>scenic-view</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencies>
<!-- https://mvnrepository.com/artifact/net.raumzeitfalle.fx/scenic-view -->
<dependency>
<groupId>net.raumzeitfalle.fx</groupId>
<artifactId>scenic-view</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-web -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openjfx/javafx-swing -->
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
</dependency>
</dependencies>
</profile>
<!-- Profile to run JPackage to create installer(s), this profile can only be run with release versions-->
<profile>
<id>create-installer</id>
Expand Down Expand Up @@ -571,6 +472,7 @@
<releaseName>komet</releaseName>
<releasePlatforms>
<!-- Sets the platforms to be included in the zip generated via jpro:release -->
<releasePlatform>current</releasePlatform>
<releasePlatform>linux</releasePlatform> <!-- includes linux x64 builds -->
<releasePlatform>linux-aarch64</releasePlatform> <!-- includes linux aarch64 builds -->
</releasePlatforms>
Expand Down
35 changes: 6 additions & 29 deletions application/src/main/java/dev/ikm/komet/app/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
import java.util.prefs.BackingStoreException;

import static dev.ikm.komet.app.AppState.*;
import static dev.ikm.komet.app.LoginFeatureFlag.ENABLED_WEB_ONLY;
import static dev.ikm.komet.app.util.CssFile.KOMET_CSS;
import static dev.ikm.komet.app.util.CssFile.KVIEW_CSS;
import static dev.ikm.komet.app.util.CssUtils.addStylesheets;
Expand Down Expand Up @@ -112,6 +111,7 @@ public class App extends Application {
static final boolean IS_DESKTOP = !IS_BROWSER && PlatformUtils.isDesktop();
static final boolean IS_MAC = !IS_BROWSER && PlatformUtils.isMac();
static final boolean IS_MAC_AND_NOT_TESTFX_TEST = IS_MAC && !isTestFXTest();
public static boolean REQUIRE_LOGIN = WebAPI.isBrowser();
final StackPane rootPane = createRootPane();
Image appIcon;
LandingPageController landingPageController;
Expand Down Expand Up @@ -276,7 +276,11 @@ public void start(Stage stage) {
stage.setScene(scene);

// Handle the login feature based on the platform and the provided feature flag
handleLoginFeature(ENABLED_WEB_ONLY, stage);
if(REQUIRE_LOGIN) {
startLogin(stage);
} else {
startSelectDataSource(stage);
}

addEventFilters(stage);

Expand All @@ -291,33 +295,6 @@ public void start(Stage stage) {
}
}

/**
* Handles the login feature based on the provided {@link LoginFeatureFlag} and platform.
*
* @param loginFeatureFlag the current state of the login feature
* @param stage the current application stage
*/
public void handleLoginFeature(LoginFeatureFlag loginFeatureFlag, Stage stage) {
switch (loginFeatureFlag) {
case ENABLED_WEB_ONLY -> {
if (IS_BROWSER) {
startLogin(stage);
} else {
startSelectDataSource(stage);
}
}
case ENABLED_DESKTOP_ONLY -> {
if (IS_DESKTOP) {
startLogin(stage);
} else {
startSelectDataSource(stage);
}
}
case ENABLED -> startLogin(stage);
case DISABLED -> startSelectDataSource(stage);
}
}

/**
* Initiates the login process by setting the application state to {@link AppState#LOGIN}
* and launching the login page.
Expand Down
39 changes: 14 additions & 25 deletions application/src/main/java/dev/ikm/komet/app/AppMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.prefs.BackingStoreException;

import static dev.ikm.komet.app.App.*;
Expand All @@ -66,6 +68,8 @@ public AppMenu(App app) {
this.app = app;
}

public static Function<Parent, Menu> devMenuFactory = null;

/**
* create the menu for windows used on a journal window (ie no vbox at the top of a border pane)
* @param borderPane border pane for the journal
Expand Down Expand Up @@ -128,7 +132,10 @@ void generateMsWindowsMenu(BorderPane kometRoot, Stage stage, VBox topBarVBox) {
menuBar.getMenus().add(fileMenu);
menuBar.getMenus().add(editMenu);
menuBar.getMenus().add(windowMenu);
//menuBar.getMenus().add(createDevMenu(kometRoot));
if (devMenuFactory != null) {
menuBar.getMenus().add(devMenuFactory.apply(kometRoot));
}

if (topBarVBox != null) {
// add MS Windows menu to the classic komet menu
Platform.runLater(() -> topBarVBox.getChildren().addFirst(menuBar));
Expand All @@ -152,28 +159,6 @@ Menu createExchangeMenu() {
return exchangeMenu;
}

/*
// This can be used to add a developer menu with Scenic View
// This is very useful for debugging JavaFX applications.
// Therefore this comment shouldn't be deleted
Menu createDevMenu(Parent node) {
Menu devMenu = new Menu("Dev");

MenuItem reloadMenuItem = new MenuItem("Scenic View");
reloadMenuItem.setOnAction(actionEvent -> {
var stage2 = new Stage();
if(WebAPI.isBrowser()) {
WebAPI.getWebAPI(node.getScene()).openStageAsPopup(stage2);
}
ScenicView.show(node, stage2);
});
// Add shortcut Ctrl+Shift+S to open Scenic View
KeyCombination scenicViewKeyCombo = new KeyCodeCombination(KeyCode.S, KeyCombination.CONTROL_DOWN, KeyCombination.SHIFT_DOWN);
reloadMenuItem.setAccelerator(scenicViewKeyCombo);
devMenu.getItems().add(reloadMenuItem);
return devMenu;
}*/

public void showAboutDialog() {
AboutDialog aboutDialog = new AboutDialog();
aboutDialog.showAndWait();
Expand Down Expand Up @@ -215,7 +200,9 @@ public void createMenuOptions(BorderPane landingPageRoot) {
menuBar.getMenus().add(viewMenu);
menuBar.getMenus().add(windowMenu);
menuBar.getMenus().add(exchangeMenu);
//menuBar.getMenus().add(createDevMenu(landingPageRoot));
if(devMenuFactory!=null){
menuBar.getMenus().add(devMenuFactory.apply(landingPageRoot));
}
landingPageRoot.setTop(menuBar);
}

Expand Down Expand Up @@ -290,7 +277,9 @@ void setupMenus(Parent parent) {
Menu helpMenu = createHelpMenu();
menuBar.getMenus().add(helpMenu);

// menuBar.getMenus().add(createDevMenu(parent));
if (devMenuFactory != null) {
menuBar.getMenus().add(devMenuFactory.apply(parent));
}
}

private Menu createFileMenu() {
Expand Down
42 changes: 0 additions & 42 deletions application/src/main/java/dev/ikm/komet/app/LoginFeatureFlag.java

This file was deleted.

Loading
Loading