Skip to content

Commit

Permalink
Merge pull request #656 from dlsc-software-consulting-gmbh/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
dlemmermann authored Sep 2, 2024
2 parents dcafb37 + cf8fb0f commit 368623d
Show file tree
Hide file tree
Showing 26 changed files with 690 additions and 296 deletions.
36 changes: 36 additions & 0 deletions .launchers/Install on iOS Device.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Install on iOS Device" type="MavenRunConfiguration" factoryName="Maven">
<MavenSettings>
<option name="myGeneralSettings" />
<option name="myRunnerSettings" />
<option name="myRunnerParameters">
<MavenRunnerParameters>
<option name="cmdOptions" />
<option name="profiles">
<set />
</option>
<option name="goals">
<list>
<option value="gluonfx:build" />
<option value="gluonfx:package" />
<option value="gluonfx:install" />
</list>
</option>
<option name="multimoduleDir" />
<option name="pomFileName" value="pom.xml" />
<option name="profilesMap">
<map>
<entry key="ios" value="true" />
</map>
</option>
<option name="projectsCmdOptionValues">
<list />
</option>
<option name="resolveToWorkspace" value="false" />
<option name="workingDirPath" value="$PROJECT_DIR$/app" />
</MavenRunnerParameters>
</option>
</MavenSettings>
<method v="2" />
</configuration>
</component>
2 changes: 1 addition & 1 deletion .launchers/JFXCentral2MobileApp (develop).run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<configuration default="false" name="JFXCentral2MobileApp (develop)" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="com.dlsc.jfxcentral2.app.JFXCentral2MobileApp" />
<module name="app" />
<option name="VM_PARAMETERS" value="-Ddevelop=true -Dsocial=false" />
<option name="VM_PARAMETERS" value="-Ddevelop=true -Dsocial=false -Dnative=true" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.dlsc.jfxcentral2.app.*" />
Expand Down
1 change: 1 addition & 0 deletions .launchers/JFXCentral2MobileApp.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<configuration default="false" name="JFXCentral2MobileApp" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="com.dlsc.jfxcentral2.app.JFXCentral2MobileApp" />
<module name="app" />
<option name="VM_PARAMETERS" value=" -Dnative=true" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.dlsc.jfxcentral2.app.*" />
Expand Down
18 changes: 1 addition & 17 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,2 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.8/apache-maven-3.8.8-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.dlsc.jfxcentral2.app.pages.MobileRefreshPage;
import com.dlsc.jfxcentral2.events.OpenWebLinkEvent;
import com.dlsc.jfxcentral2.events.RepositoryUpdatedEvent;
import com.dlsc.jfxcentral2.mobile.components.BottomMenuBar;
import com.dlsc.jfxcentral2.mobile.components.MobileDevelopToolBar;
import com.dlsc.jfxcentral2.mobile.pages.MainPage;
import com.dlsc.jfxcentral2.mobile.pages.MobileHomePage;
Expand All @@ -43,7 +42,7 @@
import com.dlsc.jfxcentral2.mobile.pages.details.MobileLearnDetailsPage;
import com.dlsc.jfxcentral2.mobile.pages.details.MobileLibraryDetailsPage;
import com.dlsc.jfxcentral2.mobile.pages.details.MobilePersonDetailsPage;
import com.dlsc.jfxcentral2.mobile.pages.details.MobileShowcaseMobileDetailsPage;
import com.dlsc.jfxcentral2.mobile.pages.details.MobileShowcaseDetailsPage;
import com.dlsc.jfxcentral2.mobile.pages.details.MobileTipDetailsPage;
import com.dlsc.jfxcentral2.mobile.pages.details.MobileToolDetailsPage;
import com.dlsc.jfxcentral2.mobile.pages.details.MobileTutorialDetailsPage;
Expand Down Expand Up @@ -135,7 +134,7 @@ public void start(Stage stage) {
scene.setFill(Color.web("#070B32"));
scene.widthProperty().addListener((it -> updateSizeProperty(scene)));
scene.getStylesheets().add(Objects.requireNonNull(NodeUtil.class.getResource("/com/dlsc/jfxcentral2/theme.css")).toExternalForm());
scene.getStylesheets().add(Objects.requireNonNull(BottomMenuBar.class.getResource("/com/dlsc/jfxcentral2/mobile/mobile.css")).toExternalForm());
scene.getStylesheets().add(Objects.requireNonNull(MainPage.class.getResource("/com/dlsc/jfxcentral2/mobile/mobile.css")).toExternalForm());
// scene.focusOwnerProperty().addListener(it -> System.out.println("focus owner: " + scene.getFocusOwner()));
updateSizeProperty(scene);

Expand Down Expand Up @@ -200,8 +199,8 @@ private MobileRouter createMobileRouter() {
.and(MobileRoute.redirect("/home", PagePath.HOME))
.and(MobileRoute.get(PagePath.LINKS, r -> MobileResponse.view(r, new MobileLinksOfTheWeekPage(size))))
.and(MobileRoute.get(PagePath.DOCUMENTATION, r -> MobileResponse.view(r, new MobileDocPage(size))))
.and(createCategoryOrDetailRoute(PagePath.SHOWCASES, RealWorldApp.class, () -> new MobileShowcasesCategoryPage(size), id -> new MobileShowcaseMobileDetailsPage(size, id)))
.and(createCategoryOrDetailRoute(PagePath.REAL_WORLD, RealWorldApp.class, () -> new MobileShowcasesCategoryPage(size), id -> new MobileShowcaseMobileDetailsPage(size, id)))
.and(createCategoryOrDetailRoute(PagePath.SHOWCASES, RealWorldApp.class, () -> new MobileShowcasesCategoryPage(size), id -> new MobileShowcaseDetailsPage(size, id)))
.and(createCategoryOrDetailRoute(PagePath.REAL_WORLD, RealWorldApp.class, () -> new MobileShowcasesCategoryPage(size), id -> new MobileShowcaseDetailsPage(size, id)))
.and(createCategoryOrDetailRoute(PagePath.LIBRARIES, Library.class, () -> new MobileLibrariesCategoryPage(size), id -> new MobileLibraryDetailsPage(size, id)))
.and(createCategoryOrDetailRoute(PagePath.PEOPLE, Person.class, () -> new MobilePeopleCategoryPage(size), id -> new MobilePersonDetailsPage(size, id)))
.and(createCategoryOrDetailRoute(PagePath.BLOGS, Blog.class, () -> new MobileBlogsCategoryPage(size), id -> new MobileBlogDetailsPage(size, id)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Region;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.text.TextAlignment;
Expand All @@ -35,6 +36,7 @@ public class MobileRefreshPage extends StackPane {

private final WeakInvalidationListener weakInvalidationListener = new WeakInvalidationListener(invalidationListener);
private final RepositoryUpdater repositoryUpdater = new RepositoryUpdater();
private final CustomImageView logo;

public MobileRefreshPage(ObjectProperty<Size> size) {
getStyleClass().add(DEFAULT_STYLE_CLASS);
Expand All @@ -44,10 +46,19 @@ public MobileRefreshPage(ObjectProperty<Size> size) {
invalidationListener.invalidated(null);
});

// top part (logo)
CustomImageView logo = new CustomImageView();
logo = new CustomImageView();
logo.getStyleClass().addAll("jfx-central-logo", "color");

boolean firstTimeSetup = RepositoryManager.isFirstTimeSetup();

if (firstTimeSetup) {
setupFirstTimeUI();
} else {
setupUpdateUI();
}
}

private void setupFirstTimeUI() {
// center part (intro pane)
IntroPane introPane = new IntroPane();
VBox.setVgrow(introPane, Priority.ALWAYS);
Expand All @@ -72,8 +83,8 @@ public MobileRefreshPage(ObjectProperty<Size> size) {
// bottom part
Button startButton = new Button("Get Started");
startButton.getStyleClass().add("start-button");
startButton.setVisible(RepositoryManager.isFirstTimeSetup());
startButton.setVisible(RepositoryManager.isFirstTimeSetup());
startButton.setVisible(true);
startButton.setVisible(true);
startButton.setOnAction(evt -> {
startButton.setVisible(false);
startButton.setManaged(false);
Expand All @@ -88,10 +99,22 @@ public MobileRefreshPage(ObjectProperty<Size> size) {
VBox content = new VBox(logo, introPane, bottomBox);
content.getStyleClass().add("content-box");
getChildren().add(content);
}

if (!RepositoryManager.isFirstTimeSetup()) {
repositoryUpdater.performUpdate(true);
}
private void setupUpdateUI() {
Label tipsLabel = new Label("Checking for updates ...");

Region dividingLine = new Region();
dividingLine.getStyleClass().add("dividing-line");

VBox updateContentBox = new VBox(logo, dividingLine, tipsLabel);
updateContentBox.getStyleClass().add("update-content-box");
updateContentBox.setMaxHeight(Region.USE_PREF_SIZE);

getChildren().add(updateContentBox);

// start the update process
repositoryUpdater.performUpdate(true);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,9 @@
{
"name":"java.util.Date"
},
{
"name":"javafx.animation.KeyValue"
},
{
"name":"javafx.scene.Camera"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
package com.dlsc.jfxcentral2.components;

import com.dlsc.jfxcentral2.utils.ExternalLinkUtil;
import javafx.application.Platform;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.control.ScrollPane;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.web.WebView;
import one.jpro.jproutils.treeshowing.TreeShowing;
import one.jpro.platform.mdfx.MarkdownView;
import one.jpro.platform.mdfx.extensions.ImageExtension;
import one.jpro.platform.mdfx.extensions.YoutubeExtension;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;
Expand All @@ -32,6 +38,41 @@ public CustomMarkdownView() {

getStyleClass().add("custom-markdown-view");
getStylesheets().add(Objects.requireNonNull(CustomMarkdownView.class.getResource("markdown.css")).toExternalForm());

TreeShowing.treeShowing(this).addListener(it -> setupWorkAroundForWebViewLayout());
Platform.runLater(this::setupWorkAroundForWebViewLayout);
mdStringProperty().addListener(it -> Platform.runLater(this::setupWorkAroundForWebViewLayout));
}

private void setupWorkAroundForWebViewLayout() {
List<WebView> webViews = new ArrayList<>();
getChildrenUnmodifiable().forEach(child -> collectWebViews(child, webViews));
webViews.forEach(view -> {
fixIt(view);
view.localToSceneTransformProperty().addListener((obs, oldV, newV) -> fixIt(view));
});
}

boolean fixing = false;

private void fixIt(WebView view) {
if (!fixing) {
fixing = true;
double width = view.getWidth();
double height = view.getHeight();
view.resize(width + 1, height + 1);
view.resize(width, height);
fixing = false;
}
}

private void collectWebViews(Node node, List<WebView> webViews) {
if (node instanceof WebView) {
webViews.add((WebView) node);
} else if (node instanceof Parent) {
Parent parent = (Parent) node;
parent.getChildrenUnmodifiable().forEach(child -> collectWebViews(child, webViews));
}
}

public CustomMarkdownView(String mdString) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
import javafx.scene.text.TextAlignment;
import one.jpro.platform.routing.LinkUtil;
import org.kordamp.ikonli.javafx.FontIcon;
import scala.Option;
Expand Down Expand Up @@ -36,14 +39,21 @@ public LinksOfTheWeekHeader() {
CustomImageView rssImageView = new CustomImageView();
rssImageView.setImage(RSS_IMAGE);
LinkUtil.setLinkInternalNoPush(rssImageView, "/lotw/rss.xml", Option.empty(), false);
//rssImageView.setVisible(false);
//rssImageView.setManaged(false);

HBox box = new HBox(label, rssImageView);
box.getStyleClass().add("rss-box");
box.setAlignment(Pos.CENTER);

setContent(box);
Label descriptionLabel = new Label("Do you have JavaFX news you want to share with the community? Let us know!\nSend a mail to [email protected]");
descriptionLabel.getStyleClass().add("description-label");
descriptionLabel.setWrapText(true);
descriptionLabel.setMinHeight(Region.USE_PREF_SIZE);
descriptionLabel.setTextAlignment(TextAlignment.CENTER);

VBox vbox = new VBox(20, box, descriptionLabel);
vbox.setAlignment(Pos.CENTER);

setContent(vbox);
setTitle("Links of the Week");
setIkon(IkonUtil.getModelIkon(LinksOfTheWeek.class));
setBackgroundImage(BACKGROUND_IMAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.dlsc.jfxcentral2.components.CustomMarkdownView;
import com.dlsc.jfxcentral2.components.PaneBase;
import com.dlsc.jfxcentral2.model.NameProvider;
import com.dlsc.jfxcentral2.utils.OSUtil;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
Expand Down Expand Up @@ -50,6 +51,9 @@ public OverviewBox(T model) {

VBox bodyBox = new VBox(topWrapper, markdownView, bottomWrapper);
bodyBox.getStyleClass().add("body-box");
if (OSUtil.isAndroidOrIOS()) {
bodyBox.getStyleClass().add("no-top-padding");
}

VBox contentBox = new VBox();
contentBox.getStyleClass().add("content-box");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.dlsc.jfxcentral.data.DataRepository2;
import com.dlsc.jfxcentral.data.model.RealWorldApp;
import com.dlsc.jfxcentral2.utils.OSUtil;
import javafx.geometry.HPos;
import javafx.geometry.VPos;
import javafx.scene.Node;
Expand Down Expand Up @@ -49,6 +50,7 @@ protected Node createTopNode() {

if (!isSmall()) {
GridPane gridPane = new GridPane();
gridPane.setVisible(!OSUtil.isAndroidOrIOS());
gridPane.getStyleClass().add("top-grid");
for (int i = 0; i < 4; i++) {
ColumnConstraints columnConstraints = new ColumnConstraints();
Expand Down Expand Up @@ -89,6 +91,7 @@ protected Node createTopNode() {
createdOnGroup.getHeader(),
createdOnLabel
);
topBox.setVisible(!OSUtil.isAndroidOrIOS());
createdOnLabel.getStyleClass().add("last");
topBox.getStyleClass().add("top-box");
return topBox;
Expand Down
1 change: 1 addition & 0 deletions components/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
requires org.kordamp.ikonli.zondicons;
requires com.rometools.rome;
requires java.prefs;
requires jpro.utils.treeshowing;
// ikonli icon packs END

exports com.dlsc.jfxcentral2.components;
Expand Down
13 changes: 13 additions & 0 deletions components/src/main/resources/com/dlsc/jfxcentral2/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -3273,6 +3273,11 @@
-fx-fit-height: 32px;
}

.links-of-the-week-header .description-label {
-fx-padding: 20px;
-fx-text-fill: -white;
}

/** ------------------------------------
* PersonDetailHeader
*/
Expand Down Expand Up @@ -6851,10 +6856,18 @@
-fx-padding: 20px 30px;
}

.overview-box:md-lg .body-box.no-top-padding {
-fx-padding: 0px 30px 20px 30px;
}

.overview-box:sm .body-box {
-fx-padding: 20px;
}

.overview-box:sm .body-box.no-top-padding {
-fx-padding: 0px 20px 20px 20px;
}

.overview-box > .content-box > .body-box {
-fx-spacing: 15px;
}
Expand Down
Loading

0 comments on commit 368623d

Please sign in to comment.