Skip to content

Commit

Permalink
Merge pull request #650 from dlsc-software-consulting-gmbh/develop
Browse files Browse the repository at this point in the history
Misc.
  • Loading branch information
dlemmermann authored Jul 30, 2024
2 parents 860e6b5 + a4d2a6a commit dcafb37
Show file tree
Hide file tree
Showing 37 changed files with 212 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@
"name":"com.sun.prism.shader.FillRoundRect_Color_Loader",
"methods":[{"name":"loadShader","parameterTypes":["com.sun.prism.ps.ShaderFactory","java.io.InputStream"] }]
},
{
"name":"com.sun.prism.shader.FillRoundRect_LinearGradient_PAD_Loader",
"methods":[{"name":"loadShader","parameterTypes":["com.sun.prism.ps.ShaderFactory","java.io.InputStream"] }]
},
{
"name":"com.sun.prism.shader.Mask_TextureRGB_Loader",
"methods":[{"name":"loadShader","parameterTypes":["com.sun.prism.ps.ShaderFactory","java.io.InputStream"] }]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package com.dlsc.jfxcentral2.components;

import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.TextField;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import org.kordamp.ikonli.javafx.FontIcon;
import org.kordamp.ikonli.materialdesign.MaterialDesign;

public class MobileSearchTextField extends BorderPane {

public MobileSearchTextField() {
getStyleClass().add("text-input");

getStyleClass().add("mobile-search-text-field");

TextField textField = new TextField();
textField.textProperty().bindBidirectional(textProperty());
textField.promptTextProperty().bind(promptText);

HBox.setHgrow(textField, Priority.ALWAYS);

FontIcon icon = new FontIcon(MaterialDesign.MDI_MAGNIFY);
BorderPane.setAlignment(icon, Pos.CENTER);
BorderPane.setMargin(textField, new Insets(0, 10, 0, 10));

setLeft(icon);
setCenter(textField);
}

private final StringProperty text = new SimpleStringProperty();

public String getText() {
return text.get();
}

public StringProperty textProperty() {
return text;
}

public void setText(String text) {
this.text.set(text);
}

public final void clear() {
text.set("");
}

private final StringProperty promptText = new SimpleStringProperty();

public String getPromptText() {
return promptText.get();
}

public StringProperty promptTextProperty() {
return promptText;
}

public void setPromptText(String promptText) {
this.promptText.set(promptText);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class BlogsFilterView extends SimpleModelObjectSearchFilterView<Blog> {

public BlogsFilterView() {
getStyleClass().add("blogs-filter-view");
setSearchPromptText("Search for a blog");
setSearchPromptText("Search for a blog ...");

setOnSearch(text -> blog -> StringUtils.isBlank(text)
|| StringUtils.containsIgnoreCase(blog.getName(), text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class BooksFilterView extends SimpleModelObjectSearchFilterView<Book> {

public BooksFilterView() {
getStyleClass().add("books-filter-view");
setSearchPromptText("Search for a book");
setSearchPromptText("Search for a book ...");

setOnSearch(text -> book -> StringUtils.isBlank(text)
|| StringUtils.containsIgnoreCase(book.getName(), text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class CompaniesFilterView extends SimpleModelObjectSearchFilterView<Compa

public CompaniesFilterView() {
getStyleClass().add("companies-filter-view");
setSearchPromptText("Search for a company");
setSearchPromptText("Search for a company ...");

setOnSearch(text -> company -> StringUtils.isBlank(text)
|| StringUtils.containsIgnoreCase(company.getName(), text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public DocumentationFilterView() {
new SortItem<>("From Z to A", Comparator.comparing((Documentation modelObject) -> modelObject.getName().toLowerCase()).reversed()))
));

setSearchPromptText("Search for a Documentation");
setSearchPromptText("Search for documentation ...");

setOnSearch(text -> tool -> StringUtils.isBlank(text)
|| StringUtils.containsIgnoreCase(tool.getName(), text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class DownloadsFilterView extends SimpleModelObjectSearchFilterView<Downl

public DownloadsFilterView() {
getStyleClass().add("downloads-filter-view");
setSearchPromptText("Search for a download");
setSearchPromptText("Search for a download ...");

setOnSearch(text -> download -> StringUtils.isBlank(text)
|| StringUtils.containsIgnoreCase(download.getName(), text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class LearnFilterView extends SimpleModelObjectSearchFilterView<Learn> {
public LearnFilterView() {
getStyleClass().addAll("learn-filter-view", "tools-filter-view");

setSearchPromptText("Search for a lesson");
setSearchPromptText("Search for a lesson ...");

setOnSearch(text -> learn -> StringUtils.isBlank(text)
|| StringUtils.containsIgnoreCase(learn.getName(), text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class LibrariesFilterView extends SimpleModelObjectSearchFilterView<Libra

public LibrariesFilterView() {
getStyleClass().add("libraries-filter-view");
setSearchPromptText("Search for a library");
setSearchPromptText("Search for a library ...");

setOnSearch(text -> library -> StringUtils.isBlank(text)
|| StringUtils.containsIgnoreCase(library.getName(), text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class PeopleFilterView extends SimpleModelObjectSearchFilterView<Person> {
public PeopleFilterView() {
getStyleClass().add("people-filter-view");
setSearchPromptText("Search for a JFX person");
setSearchPromptText("Search for a person ...");

Label keysLabel = new Label("*KEY");
keysLabel.getStyleClass().add("keys-label");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ShowcaseFilterView extends SimpleModelObjectSearchFilterView<RealWo

public ShowcaseFilterView() {
getStyleClass().add("showcases-filter-view");
setSearchPromptText("Search for an application...");
setSearchPromptText("Search for an application ...");

if (domainFilterItems == null) {
domainFilterItems = getDomainFilterItems();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class TipsAndTricksFilterView extends SimpleModelObjectSearchFilterView<T
public TipsAndTricksFilterView() {
getStyleClass().add("tips-filter-view");

setSearchPromptText("Search for tips and tricks");
setSearchPromptText("Search for a tip or trick ...");

setOnSearch(text -> tip -> StringUtils.isBlank(text)
|| StringUtils.containsIgnoreCase(tip.getName(), text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class ToolsFilterView extends SimpleModelObjectSearchFilterView<Tool> {
public ToolsFilterView() {
getStyleClass().add("tools-filter-view");

setSearchPromptText("Search for a tool");
setSearchPromptText("Search for a tool ...");

setOnSearch(text -> tool -> StringUtils.isBlank(text)
|| StringUtils.containsIgnoreCase(tool.getName(), text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class TutorialsFilterView extends SimpleModelObjectSearchFilterView<Tutor
public TutorialsFilterView() {
getStyleClass().add("tutorials-filter-view");

setSearchPromptText("Search for a tutorial");
setSearchPromptText("Search for a tutorial ...");

setOnSearch(text -> tutorial -> StringUtils.isBlank(text)
|| StringUtils.containsIgnoreCase(tutorial.getName(), text)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public VideosFilterView() {
getStyleClass().add("videos-filter-view");

setSortGroup(null);
setSearchPromptText("Search for a video");
setSearchPromptText("Search for a video ...");

if (typeFilterItems == null) {
typeFilterItems = getVideoFilterItems(Video::getType, createFilterPredicate(Video::getType));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import com.dlsc.jfxcentral.data.DataRepository2;
import com.dlsc.jfxcentral.data.model.Video;
import com.dlsc.jfxcentral2.components.CustomMarkdownView;
import com.dlsc.jfxcentral2.utils.VideoViewFactory;
import javafx.scene.Node;
import javafx.scene.control.Label;

public class VideoOverviewBox extends SimpleOverviewBox<Video> {

Expand All @@ -17,7 +19,14 @@ public VideoOverviewBox(Video video) {
}

@Override
protected Node createBottomNode() {
protected Node createTopNode() {
return VideoViewFactory.createVideoViewNode(getModel());
}

@Override
protected Node createBottomNode() {
CustomMarkdownView markdownView = new CustomMarkdownView();
markdownView.setMdString(getModel().getDescription());
return markdownView;
}
}
4 changes: 3 additions & 1 deletion components/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
requires batik.dom;
requires batik.svggen;
requires com.github.weisj.jsvg;
requires org.apache.commons.validator;
requires org.apache.commons.logging;

requires fr.brouillard.oss.cssfx;

Expand All @@ -28,7 +30,6 @@
requires jpro.webapi;
requires one.jpro.platform.routing.core;
requires java.desktop;
requires commons.validator;
requires com.dlsc.jfxcentral2.iconfont;
requires com.google.gson;

Expand Down Expand Up @@ -96,6 +97,7 @@
requires org.kordamp.ikonli.win10;
requires org.kordamp.ikonli.zondicons;
requires com.rometools.rome;
requires java.prefs;
// ikonli icon packs END

exports com.dlsc.jfxcentral2.components;
Expand Down
12 changes: 11 additions & 1 deletion components/src/main/resources/com/dlsc/jfxcentral2/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -8139,7 +8139,7 @@
}

/** ------------------------------------
* search-field-list-view (SearchField popup)
* search-field-list-view (MobileSearchTextField popup)
*/
.search-field-list-view {
-fx-pref-height: 350px !important;
Expand Down Expand Up @@ -9312,6 +9312,16 @@
-fx-padding: 10px 30px;
}

/* ----------------------------------------------------------------------------
* ScrollPane
*/

.scroll-pane {
-fx-padding: 0;
-fx-background-insets: 0; /* no focus border */
-fx-border-width: 0;
}

/* ----------------------------------------------------------------------------
* Pretty ScrollPane
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.dlsc.jfxcentral2.utils.PagePath;
import com.dlsc.jfxcentral2.utils.Subscribe;
import javafx.beans.property.ObjectProperty;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
Expand All @@ -32,6 +33,7 @@ public BottomMenuBar() {
EventBusUtil.register(this);

CustomToggleButton homeButton = new CustomToggleButton();
homeButton.setText("Home");
homeButton.setGraphic(new FontIcon(MaterialDesign.MDI_HOME));
homeButton.setMaxWidth(Double.MAX_VALUE);
homeButton.setUserData(PagePath.HOME);
Expand All @@ -46,37 +48,41 @@ public BottomMenuBar() {
HBox.setHgrow(homeButton, Priority.ALWAYS);

CustomToggleButton linksWeekButton = new CustomToggleButton();
linksWeekButton.setText("News");
linksWeekButton.setGraphic(new FontIcon(IkonUtil.getModelIkon(LinksOfTheWeek.class)));
linksWeekButton.setMaxWidth(Double.MAX_VALUE);
linksWeekButton.setUserData(PagePath.LINKS);
MobileLinkUtil.setLink(linksWeekButton, PagePath.LINKS);
HBox.setHgrow(linksWeekButton, Priority.ALWAYS);

CustomToggleButton showCaseButton = new CustomToggleButton();
showCaseButton.setGraphic(new FontIcon(IkonUtil.getModelIkon(RealWorldApp.class)));
showCaseButton.setMaxWidth(Double.MAX_VALUE);
showCaseButton.setUserData(PagePath.SHOWCASES);
MobileLinkUtil.setLink(showCaseButton, PagePath.SHOWCASES);
HBox.setHgrow(showCaseButton, Priority.ALWAYS);
CustomToggleButton showcasesButton = new CustomToggleButton();
showcasesButton.setText("Apps");
showcasesButton.setGraphic(new FontIcon(IkonUtil.getModelIkon(RealWorldApp.class)));
showcasesButton.setMaxWidth(Double.MAX_VALUE);
showcasesButton.setUserData(PagePath.SHOWCASES);
MobileLinkUtil.setLink(showcasesButton, PagePath.SHOWCASES);
HBox.setHgrow(showcasesButton, Priority.ALWAYS);

CustomToggleButton libraryButton = new CustomToggleButton();
libraryButton.setText("Libs");
libraryButton.setGraphic(new FontIcon(IkonUtil.getModelIkon(Library.class)));
libraryButton.setMaxWidth(Double.MAX_VALUE);
libraryButton.setUserData(PagePath.LIBRARIES);
MobileLinkUtil.setLink(libraryButton, PagePath.LIBRARIES);
HBox.setHgrow(libraryButton, Priority.ALWAYS);

CustomToggleButton peopleButton = new CustomToggleButton();
peopleButton.setText("People");
peopleButton.setGraphic(new FontIcon(IkonUtil.getModelIkon(Person.class)));
peopleButton.setMaxWidth(Double.MAX_VALUE);
peopleButton.setUserData(PagePath.PEOPLE);
MobileLinkUtil.setLink(peopleButton, PagePath.PEOPLE);
HBox.setHgrow(peopleButton, Priority.ALWAYS);

getChildren().addAll(homeButton, linksWeekButton, showCaseButton, libraryButton, peopleButton);
getChildren().addAll(homeButton, linksWeekButton, showcasesButton, libraryButton, peopleButton);

toggleGroup = new ToggleGroup();
toggleGroup.getToggles().addAll(homeButton, linksWeekButton, showCaseButton, libraryButton, peopleButton);
toggleGroup.getToggles().addAll(homeButton, linksWeekButton, showcasesButton, libraryButton, peopleButton);

setMaxHeight(Region.USE_PREF_SIZE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
import com.dlsc.jfxcentral.data.model.LearnRaspberryPi;
import com.dlsc.jfxcentral2.components.AvatarView;
import com.dlsc.jfxcentral2.components.CustomMarkdownView;
import com.dlsc.jfxcentral2.components.PrettyScrollPane;

import com.dlsc.jfxcentral2.utils.MobileLinkUtil;
import com.dlsc.jfxcentral2.utils.ModelObjectTool;
import javafx.beans.binding.Bindings;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
Expand All @@ -28,7 +29,7 @@ public class LearnPagination<T extends Learn> extends MobilePagination<T> {
private static final String DEFAULT_STYLE_CLASS = "learn-pagination";
private static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM);

private final PrettyScrollPane scrollPane = new PrettyScrollPane();
private final ScrollPane scrollPane = new ScrollPane();

public LearnPagination() {
getStyleClass().add(DEFAULT_STYLE_CLASS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import com.dlsc.jfxcentral.data.DataRepository2;
import com.dlsc.jfxcentral.data.model.LinksOfTheWeek;
import com.dlsc.jfxcentral2.components.CustomMarkdownView;
import com.dlsc.jfxcentral2.components.PrettyScrollPane;

import javafx.beans.binding.Bindings;
import javafx.scene.control.ScrollPane;

public class LotwPagination extends MobilePagination<LinksOfTheWeek> {

private static final String DEFAULT_STYLE_CLASS = "lotw-pagination";
private final PrettyScrollPane scrollPane = new PrettyScrollPane();
private final ScrollPane scrollPane = new ScrollPane();

public LotwPagination() {
getStyleClass().add(DEFAULT_STYLE_CLASS);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.dlsc.jfxcentral2.mobile.components;

import com.dlsc.gemsfx.SearchTextField;
import com.dlsc.jfxcentral.data.model.Documentation;
import com.dlsc.jfxcentral.data.model.ModelObject;
import com.dlsc.jfxcentral2.components.MobileSearchTextField;
import com.dlsc.jfxcentral2.mobile.utils.ListViewUtil;
import com.dlsc.jfxcentral2.utils.MobileLinkUtil;
import com.dlsc.jfxcentral2.utils.ModelObjectTool;
Expand Down Expand Up @@ -36,7 +36,7 @@ public class ModelListView<T extends ModelObject> extends VBox {
public ModelListView() {
getStyleClass().add(DEFAULT_STYLE_CLASS);

SearchTextField searchTextField = new SearchTextField(true);
MobileSearchTextField searchTextField = new MobileSearchTextField();
searchTextField.promptTextProperty().bind(promptTextProperty());
StackPane searchWrapper = new StackPane(searchTextField);
searchWrapper.getStyleClass().add("search-wrapper");
Expand Down
Loading

0 comments on commit dcafb37

Please sign in to comment.