diff --git a/gradle.properties b/gradle.properties index 04758d08..eafd5c25 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,8 +20,8 @@ jdk=11 testJdk=17 # Modules -mfx=11.26.4 -mfxcore=11.10.4 +mfx=11.26.5 +mfxcore=11.10.5 mfxeffects=11.4.1 mfxlocalization=11.1.0 mfxresources=11.11.1 diff --git a/modules/components/CHANGELOG.md b/modules/components/CHANGELOG.md index 5bc63952..47f27e38 100644 --- a/modules/components/CHANGELOG.md +++ b/modules/components/CHANGELOG.md @@ -16,6 +16,21 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). [//]: ##[Unreleased] +## [11.26.5] - 31-10-2024 + +### Added + +- MFXProgressIndicator: allow to disable determinate progress animations + +### Changed + +- MFXCircularProgressIndicatorSkin: since the arcMultiplier depends on the layout, it should be a property, and the + progress should be adjusted every time it changes + +### Fixed + +- MFXProgressIndicator skins: take into account progress not starting as indeterminate + ## [11.26.4] - 27-10-2024 ### Added diff --git a/modules/components/gradle.properties b/modules/components/gradle.properties index 5ad812c5..561c62ec 100644 --- a/modules/components/gradle.properties +++ b/modules/components/gradle.properties @@ -3,7 +3,7 @@ # Maven # #--------------------------------------# POM_ARTIFACT_ID=mfxcomponents -VERSION_NAME=11.26.4 +VERSION_NAME=11.26.5 POM_NAME=mfxcomponents POM_DESCRIPTION=Material Design/Modern components for JavaFX diff --git a/modules/components/src/test/java/app/Showcase.java b/modules/components/src/test/java/app/Showcase.java index 45ef5ba1..973c286a 100644 --- a/modules/components/src/test/java/app/Showcase.java +++ b/modules/components/src/test/java/app/Showcase.java @@ -18,6 +18,11 @@ package app; +import java.util.ArrayList; +import java.util.List; +import java.util.function.BiFunction; +import java.util.function.Supplier; + import app.others.ui.*; import fr.brouillard.oss.cssfx.CSSFX; import io.github.palexdev.mfxcomponents.controls.buttons.MFXButton; @@ -57,11 +62,6 @@ import javafx.stage.Stage; import org.scenicview.ScenicView; -import java.util.ArrayList; -import java.util.List; -import java.util.function.BiFunction; -import java.util.function.Supplier; - public class Showcase extends Application implements MultipleViewApp { //================================================================================ // Properties @@ -113,7 +113,7 @@ protected void layoutChildren() { .applyOn(sp); Size ws = UIUtils.getWindowSize(); - Scene scene = new Scene(new StackPane(sp), ws.getWidth(), ws.getHeight()); + Scene scene = new Scene(new StackPane(sp), ws.getWidth(), ws.getHeight()); loadStyleSheet(scene); stage.setScene(scene); stage.setTitle("Buttons Playground"); @@ -124,7 +124,7 @@ protected void layoutChildren() { String iconDesc = themeVariant.get().equals("light") ? "fas-sun" : "fas-moon"; themeVariant.set(newVariant); loadStyleSheet(scene); - themeSwitcher.setIcon(new MFXFontIcon(iconDesc)); + themeSwitcher.setIcon(new MFXFontIcon(iconDesc)); }); sp.getChildren().add(themeSwitcher); @@ -186,7 +186,7 @@ private Node tbView() { private Node fabView() { VBox box = new VBox(50); box.setAlignment(Pos.TOP_CENTER); - box.setPadding(InsetsBuilder.all(10)); + box.setPadding(InsetsBuilder.uniform(10).get()); Node def = createFabsView("Floating Action Buttons", (s, i) -> new MFXFab(i)); Node surf = createFabsView("Floating Action Buttons (Surface)", (s, i) -> new MFXFab(i).setVariants(FABVariants.SURFACE)); Node sdy = createFabsView("Floating Action Buttons (Secondary)", (s, i) -> new MFXFab(i).setVariants(FABVariants.SECONDARY)); @@ -204,7 +204,7 @@ private Node extendedFabView() { }; VBox box = new VBox(50); box.setAlignment(Pos.TOP_CENTER); - box.setPadding(InsetsBuilder.all(10)); + box.setPadding(InsetsBuilder.uniform(10).get()); Node def = createExtendedFabView("Extended FABs", generator); Node surf = createExtendedFabView("Extended FABs (Surface)", generator.andThen(f -> f.setVariants(FABVariants.SURFACE))); Node sdy = createExtendedFabView("Extended FABs (Secondary)", generator.andThen(f -> f.setVariants(FABVariants.SECONDARY))); @@ -222,7 +222,7 @@ private Node iconButtonsView() { VBox box = new VBox(50); box.setAlignment(Pos.TOP_CENTER); - box.setPadding(InsetsBuilder.all(10)); + box.setPadding(InsetsBuilder.uniform(10).get()); Node standard = createIconButtonsView("Standard IconButtons", generator); Node filled = createIconButtonsView("Filled IconButtons", generator.andThen(b -> b.addVariants(IconButtonVariants.FILLED))); Node filledTonal = createIconButtonsView("Filled Tonal IconButtons", generator.andThen(b -> b.addVariants(IconButtonVariants.FILLED_TONAL))); @@ -253,8 +253,8 @@ private Node createButtonsView(String title, double length, BiFunction { - btn8.setIcon(FontAwesomeSolid.random()); + btn8.setIcon(FontAwesomeSolid.random()); e.consume(); }); @@ -316,15 +316,15 @@ private Node createExtendedFabView(String title, double length, BiFunction btn6.setExtended(!btn6.isExtended())); - btn7.setOnAction(e -> btn7.setIcon(FontAwesomeSolid.random())); + btn7.setOnAction(e -> btn7.setIcon(FontAwesomeSolid.random())); defTfp.add(btn0, btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8); return defTfp; @@ -357,11 +357,11 @@ private Node createIconButtonsView(String title, double length, BiFunction> generators = new ArrayList<>(List.of( - MFXCheckbox::new, + MFXCheckbox::new, () -> { MFXCheckbox c = new MFXCheckbox(); c.setDisable(true); @@ -460,7 +460,7 @@ private Node createCheckboxesView(String title) { for (Supplier g : generators) { MFXCheckbox c = g.get(); c.setAllowIndeterminate(true); - c.setState(TriState.INDETERMINATE); + c.setState(TriState.INDETERMINATE); defTP.add(c); } diff --git a/modules/components/src/test/java/app/buttons/FABTest.java b/modules/components/src/test/java/app/buttons/FABTest.java index f9ec955f..75041fd0 100644 --- a/modules/components/src/test/java/app/buttons/FABTest.java +++ b/modules/components/src/test/java/app/buttons/FABTest.java @@ -18,6 +18,8 @@ package app.buttons; +import java.util.function.Supplier; + import io.github.palexdev.mfxcomponents.controls.buttons.MFXButton; import io.github.palexdev.mfxcomponents.controls.fab.MFXFab; import io.github.palexdev.mfxcomponents.controls.fab.MFXFabBase; @@ -49,8 +51,6 @@ import javafx.stage.Stage; import org.scenicview.ScenicView; -import java.util.function.Supplier; - import static io.github.palexdev.mfxcomponents.theming.enums.FABVariants.*; public class FABTest extends Application { @@ -97,7 +97,11 @@ public void start(Stage primaryStage) { String theme = MFXResources.load("themes/material/md-purple-" + variant + ".css"); //String theme = MFXThemeManager.LIGHT.load(); pane.getStylesheets().add(theme); - pane.setPadding(InsetsBuilder.of(15, 5, 15, 5)); + pane.setPadding(InsetsBuilder.build() + .withVertical(15) + .withHorizontal(5) + .get() + ); ScrollPane sp = new ScrollPane(pane); sp.setFitToWidth(true); diff --git a/modules/components/src/test/java/app/popups/PopupTest.java b/modules/components/src/test/java/app/popups/PopupTest.java index 1dae83ac..0b6d2097 100644 --- a/modules/components/src/test/java/app/popups/PopupTest.java +++ b/modules/components/src/test/java/app/popups/PopupTest.java @@ -27,7 +27,7 @@ public void start(Stage primaryStage) { anchors.getItems().removeAll(Pos.BASELINE_CENTER, Pos.BASELINE_LEFT, Pos.BASELINE_RIGHT); anchors.getSelectionModel().select(Pos.BOTTOM_CENTER); StackPane.setAlignment(anchors, Pos.TOP_CENTER); - StackPane.setMargin(anchors, InsetsBuilder.top(20)); + StackPane.setMargin(anchors, InsetsBuilder.top(20).get()); MFXButton button = new MFXButton("Show Popup").filled(); diff --git a/modules/components/src/test/java/interactive/TestCheckboxes.java b/modules/components/src/test/java/interactive/TestCheckboxes.java index ea846519..050c0406 100644 --- a/modules/components/src/test/java/interactive/TestCheckboxes.java +++ b/modules/components/src/test/java/interactive/TestCheckboxes.java @@ -18,6 +18,10 @@ package interactive; +import java.util.List; +import java.util.concurrent.TimeoutException; +import java.util.stream.IntStream; + import io.github.palexdev.mfxcomponents.controls.checkbox.MFXCheckbox; import io.github.palexdev.mfxcomponents.controls.checkbox.TriState; import io.github.palexdev.mfxcomponents.theming.MaterialThemes; @@ -37,10 +41,6 @@ import org.testfx.framework.junit5.ApplicationExtension; import org.testfx.framework.junit5.Start; -import java.util.List; -import java.util.concurrent.TimeoutException; -import java.util.stream.IntStream; - import static org.junit.jupiter.api.Assertions.*; @ExtendWith(ApplicationExtension.class) @@ -289,7 +289,7 @@ MFXCheckbox[] getCheckboxes(int n) { private HBox setupStage() { HBox box = new HBox(20); box.setAlignment(Pos.CENTER_LEFT); - box.setPadding(InsetsBuilder.all(5)); + box.setPadding(InsetsBuilder.uniform(5).get()); try { Scene scene = new Scene(box, 400, 200); MaterialThemes.PURPLE_LIGHT.applyOn(scene); diff --git a/modules/components/src/test/java/interactive/TestInitSize.java b/modules/components/src/test/java/interactive/TestInitSize.java index 01c9b742..a0d38ae8 100644 --- a/modules/components/src/test/java/interactive/TestInitSize.java +++ b/modules/components/src/test/java/interactive/TestInitSize.java @@ -18,6 +18,8 @@ package interactive; +import java.util.concurrent.TimeoutException; + import io.github.palexdev.mfxcomponents.controls.buttons.MFXButton; import io.github.palexdev.mfxcomponents.controls.fab.MFXFab; import io.github.palexdev.mfxcomponents.theming.MaterialThemes; @@ -34,8 +36,6 @@ import org.testfx.framework.junit5.ApplicationExtension; import org.testfx.framework.junit5.Start; -import java.util.concurrent.TimeoutException; - import static org.junit.jupiter.api.Assertions.assertEquals; @ExtendWith(ApplicationExtension.class) @@ -90,7 +90,7 @@ void testLargeFab(FxRobot robot) { assertEquals(96, fab.getLayoutBounds().getWidth()); assertEquals(96, fab.getLayoutBounds().getHeight()); - robot.interact(() -> fab.setPrefSize(70, 70)); + robot.interact(() -> fab.setMinSize(70, 70)); assertEquals(70, fab.getLayoutBounds().getWidth()); assertEquals(70, fab.getLayoutBounds().getHeight()); } diff --git a/modules/core/CHANGELOG.md b/modules/core/CHANGELOG.md index 11e22a7a..5f39793e 100644 --- a/modules/core/CHANGELOG.md +++ b/modules/core/CHANGELOG.md @@ -16,6 +16,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). [//]: ##[Unreleased] +## [11.10.5] - 31-10-2024 + +### Changed + +- Removed CornerRadiusBuilder and reworked InsetsBuilder + ## [11.10.4] - 24-10-2024 ### Added diff --git a/modules/core/gradle.properties b/modules/core/gradle.properties index 20f1e949..40a73fa7 100644 --- a/modules/core/gradle.properties +++ b/modules/core/gradle.properties @@ -3,7 +3,7 @@ # Maven # #--------------------------------------# POM_ARTIFACT_ID=mfxcore -VERSION_NAME=11.10.4 +VERSION_NAME=11.10.5 POM_NAME=mfxcore POM_DESCRIPTION=Core components for MaterialFX diff --git a/modules/core/src/main/java/io/github/palexdev/mfxcore/builders/InsetsBuilder.java b/modules/core/src/main/java/io/github/palexdev/mfxcore/builders/InsetsBuilder.java index fbe019c0..92ccc3f7 100644 --- a/modules/core/src/main/java/io/github/palexdev/mfxcore/builders/InsetsBuilder.java +++ b/modules/core/src/main/java/io/github/palexdev/mfxcore/builders/InsetsBuilder.java @@ -44,6 +44,14 @@ public InsetsBuilder(Insets insets) { //================================================================================ // Static Methods //================================================================================ + public static InsetsBuilder build() { + return new InsetsBuilder(); + } + + public static Insets of(double top, double right, double bottom, double left) { + return new Insets(top, right, bottom, left); + } + public static InsetsBuilder uniform(double all) { return new InsetsBuilder(new Insets(all, all, all, all)); } @@ -77,6 +85,11 @@ public InsetsBuilder withRight(double right) { return this; } + public InsetsBuilder withVertical(double topBottom) { + insets = new Insets(topBottom, insets.getRight(), topBottom, insets.getLeft()); + return this; + } + public InsetsBuilder withBottom(double bottom) { return new InsetsBuilder(new Insets(0, 0, bottom, 0)); } @@ -86,6 +99,11 @@ public InsetsBuilder withLeft(double left) { return this; } + public InsetsBuilder withHorizontal(double leftRight) { + insets = new Insets(insets.getTop(), leftRight, insets.getBottom(), leftRight); + return this; + } + public Insets get() { return insets; } diff --git a/modules/core/src/main/java/io/github/palexdev/mfxcore/utils/fx/LayoutUtils.java b/modules/core/src/main/java/io/github/palexdev/mfxcore/utils/fx/LayoutUtils.java index daf4f4b2..be37c6f0 100644 --- a/modules/core/src/main/java/io/github/palexdev/mfxcore/utils/fx/LayoutUtils.java +++ b/modules/core/src/main/java/io/github/palexdev/mfxcore/utils/fx/LayoutUtils.java @@ -40,12 +40,12 @@ public static Position computePosition(Region parent, Node child, double areaX, Insets snappedMargin = margin == null ? Insets.EMPTY : margin; if (snapToPixel && snappedMargin != Insets.EMPTY) { - snappedMargin = InsetsBuilder.of( - parent.snapSpaceY(snappedMargin.getTop()), - parent.snapSpaceX(snappedMargin.getRight()), - parent.snapSpaceY(snappedMargin.getBottom()), - parent.snapSpaceX(snappedMargin.getLeft()) - ); + snappedMargin = InsetsBuilder.build() + .withTop(parent.snapSpaceY(snappedMargin.getTop())) + .withRight(parent.snapSpaceX(snappedMargin.getRight())) + .withBottom(parent.snapSpaceY(snappedMargin.getBottom())) + .withLeft(parent.snapSpaceX(snappedMargin.getLeft())) + .get(); } double xPosition = computeXPosition(parent, child, areaX, areaWidth, snappedMargin, false, hAlignment, snapToPixel, computeSizes); @@ -56,12 +56,12 @@ public static Position computePosition(Region parent, Node child, double areaX, public static double computeXPosition(Region parent, Node child, double areaX, double areaWidth, Insets margin, boolean snapMargin, HPos hAlignment, boolean snapToPixel, boolean computeSizes) { Insets snappedMargin = margin == null ? Insets.EMPTY : margin; if (snapMargin && snappedMargin != Insets.EMPTY) { - snappedMargin = InsetsBuilder.of( - parent.snapSpaceY(snappedMargin.getTop()), - parent.snapSpaceX(snappedMargin.getRight()), - parent.snapSpaceY(snappedMargin.getBottom()), - parent.snapSpaceX(snappedMargin.getLeft()) - ); + snappedMargin = InsetsBuilder.build() + .withTop(parent.snapSpaceY(snappedMargin.getTop())) + .withRight(parent.snapSpaceX(snappedMargin.getRight())) + .withBottom(parent.snapSpaceY(snappedMargin.getBottom())) + .withLeft(parent.snapSpaceX(snappedMargin.getLeft())) + .get(); } final double leftMargin = snappedMargin.getLeft(); @@ -74,12 +74,12 @@ public static double computeXPosition(Region parent, Node child, double areaX, d public static double computeYPosition(Region parent, Node child, double areaY, double areaHeight, double areaBaselineOffset, Insets margin, boolean snapMargin, VPos vAlignment, boolean snapToPixel, boolean computeSizes) { Insets snappedMargin = margin == null ? Insets.EMPTY : margin; if (snapMargin) { - snappedMargin = InsetsBuilder.of( - parent.snapSpaceY(snappedMargin.getTop()), - parent.snapSpaceX(snappedMargin.getRight()), - parent.snapSpaceY(snappedMargin.getBottom()), - parent.snapSpaceX(snappedMargin.getLeft()) - ); + snappedMargin = InsetsBuilder.build() + .withTop(parent.snapSpaceY(snappedMargin.getTop())) + .withRight(parent.snapSpaceX(snappedMargin.getRight())) + .withBottom(parent.snapSpaceY(snappedMargin.getBottom())) + .withLeft(parent.snapSpaceX(snappedMargin.getLeft())) + .get(); } final double topMargin = snappedMargin.getTop(); diff --git a/modules/release/CHANGELOG.md b/modules/release/CHANGELOG.md index 2532ac2e..fe8d34b1 100644 --- a/modules/release/CHANGELOG.md +++ b/modules/release/CHANGELOG.md @@ -16,6 +16,15 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). [//]: ##[Unreleased] +## [11.26.5] - 31-10-2024 + +- Bump components and release modules to version 11.26.5 +- Bump core module to version 11.10.5 + +## [11.26.4] - 27-10-2024 + +- Bump components and release modules to version 11.26.4 + ## [11.26.3] - 25-10-2024 - Bump components and release modules to version 11.26.3 diff --git a/modules/release/gradle.properties b/modules/release/gradle.properties index 92d00435..93295389 100644 --- a/modules/release/gradle.properties +++ b/modules/release/gradle.properties @@ -3,7 +3,7 @@ # Maven # #--------------------------------------# POM_ARTIFACT_ID=materialfx-all -VERSION_NAME=11.26.3 +VERSION_NAME=11.26.5 POM_NAME=materialfx-all POM_DESCRIPTION=Material Design/Modern components for JavaFX, now packed as a single Jar