Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main' into jpro-mai…
Browse files Browse the repository at this point in the history
…l-module

# Conflicts:
#	CHANGELOG.md
#	gradle.properties
  • Loading branch information
besidev committed Jul 3, 2024
2 parents c39efaa + 015a462 commit 6ba3786
Show file tree
Hide file tree
Showing 20 changed files with 217 additions and 134 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
Expand Down
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
### 0.3.3-SNAPSHOT (TBD)

#### Features
* Implemented and added `jpro-mail` module to the platform. This module provides an API to send emails from a
JavaFX/JPro application.
* Implemented and added `jpro-mail` module to the platform. This module provides an API to send emails from a
JavaFX/JPro application.

#### Improvements
* Updated **JPro** to version `2024.2.1`.
* Updated **SimpleFX** dependencies to version `3.2.34`.
* Added `popup` sample application to the examples list for the `jpro-routing-popup` module.

#### Bugfixes
* Export `jpro-routing-core` module from `jpro-routing-dev` module to make it available externally when only
`jpro-routing-dev` is included in the project.
* Fixed some dependency requirements in the `JPro Routing` modules.
* Fixed the stylesheet path in the `jpro-routing-popup` module for the SimplePopup control.

----------------------

Expand All @@ -23,7 +34,7 @@ Screen sharing button "toggles" now it's state - making it possible to switch ba
### 0.3.1 (May 14, 2024)

#### Bugfixes
* Fixed the retrival of the domain from the request in the Request class in the `jpro-routing-core` module. Now `domain`
* Fixed the retrieval of the domain from the request in the Request class in the `jpro-routing-core` module. Now `domain`
in the route is correctly matched with the request domain.
* Fix the server url when `useLoopbackIpAddress` OAuth2 option is used.

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ To run the examples, you can use the following commands:
./gradlew jpro-media:example:run -Psample=media-recorder
./gradlew jpro-media:example:run -Psample=media-recorder-and-player
./gradlew jpro-routing:example:run -Psample=colors
./gradlew jpro-routing:example:run -Psample=popup
./gradlew jpro-routing:example:run -Psample=test
```

Expand All @@ -494,6 +495,7 @@ To run the examples, you can use the following commands:
./gradlew jpro-media:example:jproRun -Psample=media-recorder
./gradlew jpro-media:example:jproRun -Psample=media-recorder-and-player
./gradlew jpro-routing:example:jproRun -Psample=colors
./gradlew jpro-routing:example:jproRun -Psample=popup
./gradlew jpro-routing:example:jproRun -Psample=test
./gradlew jpro-webrtc:example:jproRun
./gradlew jpro-sipjs:example:jproRun
Expand Down
2 changes: 1 addition & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'org.bytedeco.gradle-javacpp-platform' version "$JAVACPP_VERSION"
id "org.javamodularity.moduleplugin" version "$MODULE_PLUGIN_VERSION"
id 'org.javamodularity.moduleplugin' version "$MODULE_PLUGIN_VERSION"
id 'org.openjfx.javafxplugin'
id 'jpro-gradle-plugin'
}
Expand Down
2 changes: 1 addition & 1 deletion example/src/main/resources/jpro/html/defaultpage
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<html>
<head>
<title>jpro Application: Hello JPro</title>
<title>JPro Platform Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">

<link rel="stylesheet" type="text/css" href="/jpro/css/jpro-fullscreen.css">
Expand Down
16 changes: 7 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
JPRO_PLATFORM_VERSION = 0.3.3-SNAPSHOT

JPRO_VERSION = 2024.2.0
JPRO_VERSION = 2024.2.1
JAVAFX_VERSION = 17.0.11
SIMPLEFX_VERSION = 3.2.33
JMEMORYBUDDY_VERSION = 0.5.3
SIMPLEFX_VERSION = 3.2.34
JMEMORYBUDDY_VERSION = 0.5.4
JNODES_VERSION = 0.8.1
SCENIC_VIEW_VERSION = 11.0.3-SNAPSHOT-FORK

JAVAFX_PLUGIN_VERSION = 0.1.0
MODULE_PLUGIN_VERSION = 1.8.12
MODULE_PLUGIN_VERSION = 1.8.15
OSDETECTOR_PLUGIN_VERSION = 1.7.3
ENSEMBLE_GRADLE_PLUGIN_VERSION = 0.1.0-SNAPSHOT
DEPENDENCY_CHECK_PLUGIN_VERSION = 9.1.0
Expand All @@ -21,19 +21,17 @@ FLEXMARK_VERSION = 0.64.8
JETBRAINS_ANNOTATIONS_VERSION = 24.1.0
AUTH0_JAVAJWT_VERSION = 4.4.0
AUTH0_JWKSRSA_VERSION = 0.22.1
JAKARTA_INJECT_VERSION = 2.0.1
JAKARTA_VALIDATION_VERSION = 3.0.2
JAKARTA_MAIL_API_VERSION = 2.1.3
ECLIPSE_ANGUS_MAIL_VERSION = 2.0.3
ECLIPSE_COLLECTIONS_VERSION = 11.1.0
CSSFX_VERSION = 11.5.1
IKONLI_VERSION = 12.3.1
ATLANTAFX_VERSION = 2.0.1
COMMONS_IO_VERSION = 2.16.1
JUNIT_VERSION = 5.10.2
ASSERTJ_VERSION = 3.25.3
JUNIT_VERSION = 5.10.3
ASSERTJ_VERSION = 3.26.0
HAMCREST_VERSION = 2.2
MOCKITO_VERSION = 5.11.0
MOCKITO_VERSION = 5.12.0
TESTFX_VERSION = 4.0.18
SLF4J_API_VERSION = 2.0.13
LOGBACK_VERSION = 1.5.6
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
2 changes: 1 addition & 1 deletion jpro-auth/core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.javamodularity.moduleplugin" version "$MODULE_PLUGIN_VERSION"
id 'org.javamodularity.moduleplugin' version "$MODULE_PLUGIN_VERSION"
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion jpro-auth/example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.javamodularity.moduleplugin" version "$MODULE_PLUGIN_VERSION"
id 'org.javamodularity.moduleplugin' version "$MODULE_PLUGIN_VERSION"
id 'org.openjfx.javafxplugin'
id 'jpro-gradle-plugin'
}
Expand Down
2 changes: 1 addition & 1 deletion jpro-mdfx/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.javamodularity.moduleplugin" version "$MODULE_PLUGIN_VERSION"
id 'org.javamodularity.moduleplugin' version "$MODULE_PLUGIN_VERSION"
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion jpro-mdfx/example/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "org.javamodularity.moduleplugin" version "$MODULE_PLUGIN_VERSION"
id 'org.javamodularity.moduleplugin' version "$MODULE_PLUGIN_VERSION"
id 'org.openjfx.javafxplugin'
id 'jpro-gradle-plugin'
}
Expand Down
3 changes: 2 additions & 1 deletion jpro-routing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ configure([project(':jpro-routing:core')]) {

configure([project(':jpro-routing:dev')]) {
dependencies {
implementation project(':jpro-routing:core')
api project(':jpro-routing:core')
api "org.kordamp.ikonli:ikonli-javafx:$IKONLI_VERSION"
api "org.kordamp.ikonli:ikonli-evaicons-pack:$IKONLI_VERSION"
api "org.kordamp.ikonli:ikonli-ionicons4-pack:$IKONLI_VERSION"
Expand Down Expand Up @@ -101,6 +101,7 @@ configure(project(':jpro-routing:example')) {

def examples = [
'colors': 'example.colors.ColorsApp',
'popup' : 'example.popup.PopupApp',
'test' : 'example.scala.TestWebApplication'
]
mainClassName = project.hasProperty("sample") ? examples[project.getProperties().get("sample")] : examples["colors"]
Expand Down
1 change: 1 addition & 0 deletions jpro-routing/core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
requires transitive org.slf4j;

requires transitive de.sandec.jnodes;
requires transitive de.sandec.jmemorybuddy;
requires transitive jpro.webapi;
requires transitive simplefx.core;
requires transitive simplefx.extended;
Expand Down
5 changes: 4 additions & 1 deletion jpro-routing/dev/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
* @author Besmir Beqiri
*/
open module one.jpro.platform.routing.dev {
requires transitive javafx.controls;
requires transitive one.jpro.platform.routing.core;
requires transitive javafx.controls;
requires transitive javafx.swing;
requires transitive javafx.web;
requires org.kordamp.ikonli.javafx;
requires org.kordamp.ikonli.evaicons;
requires org.kordamp.ikonli.ionicons4;
requires fr.brouillard.oss.cssfx;
requires org.scenicview.scenicview;

exports one.jpro.platform.routing.dev;
Expand Down
78 changes: 46 additions & 32 deletions jpro-routing/example/src/main/java/example/popup/PopupApp.java
Original file line number Diff line number Diff line change
@@ -1,62 +1,76 @@
package example.popup;

import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import one.jpro.platform.routing.Filters;
import one.jpro.platform.routing.Response;
import one.jpro.platform.routing.Route;
import one.jpro.platform.routing.RouteApp;
import one.jpro.platform.routing.dev.DevFilter;
import one.jpro.platform.routing.popup.PopupAPI;
import one.jpro.platform.routing.popup.simplepopup.SimplePopup;
import one.jpro.platform.routing.popup.simplepopup.SimplePopups;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.layout.VBox;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import simplefx.experimental.parts.FXFuture;

import static one.jpro.platform.routing.Route.*;
import static one.jpro.platform.routing.Route.get;
import static one.jpro.platform.routing.Route.redirect;

/**
* The {@code PopupApp} class extends {@code RouteApp} to demonstrate the use of popups in a JPro application.
* It showcases how to create and display simple informational popups and a loading screen based on asynchronous tasks.
*/
public class PopupApp extends RouteApp {

public static void main(String[] args) {
launch(args);
}

private static final Logger LOGGER = LoggerFactory.getLogger(PopupApp.class);

@Override
public Route createRoute() {
return Route.empty()
.and(redirect("/", "/popup"))
.and(get("/popup", (r) -> Response.node(popupSampleButtons())))
.filter(Filters.FullscreenFilter(true))
.filter(DevFilter.create());
}

/**
* Creates a {@code Node} containing buttons that demonstrate the popup functionality.
* One button shows a simple informational popup and the other displays a loading screen
* tied to a background task.
*
* @return A {@code Node} with configured buttons for demonstrating popup functionality.
*/
public Node popupSampleButtons() {
VBox result = new VBox();
VBox result = new VBox(8);

Button button1 = new Button("Show Popup1");
Button showPopupButton = new Button("Show Popup");
showPopupButton.setOnAction(event ->
PopupAPI.openPopup(getRouteNode(), SimplePopups.infoPopup("Title", "This is a simple popup")));

Button showLoading = new Button("Show Loading");
Button showLoadingScreen = new Button("Show Loading Screen");
showLoadingScreen.setOnAction(event ->
PopupAPI.showLoadingScreen(getRouteNode(), createWaitFuture(3000)));

result.getChildren().addAll(showPopupButton, showLoadingScreen);

button1.setOnAction(e -> {
SimplePopup popup = SimplePopups.infoPopup("Title", "This is a simple popup");
PopupAPI.openPopup(getRouteNode(), popup);
});
return result;
}

showLoading.setOnAction(e -> {
// Create Future, which takes 5 seconds to complete
FXFuture<Object> future = FXFuture.runBackground(() -> {
try {
Thread.sleep(3000);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
return null;
});

PopupAPI.showLoadingScreen(getRouteNode(), future);
/**
* Creates a {@code FXFuture} that takes a specified number of milliseconds to complete.
*
* @param millis the number of milliseconds to sleep
* @return A {@code FXFuture} object.
*/
private FXFuture<Object> createWaitFuture(long millis) {
return FXFuture.runBackground(() -> {
try {
Thread.sleep(millis);
} catch (InterruptedException ex) {
LOGGER.error("An error occurred while sleeping", ex);
}
return null;
});

result.getChildren().addAll(button1, showLoading);

return result;
}
}
Loading

0 comments on commit 6ba3786

Please sign in to comment.