Skip to content

Commit

Permalink
🔖 Bump and release modules: [components, core, release]
Browse files Browse the repository at this point in the history
🔖 Bump components and release modules to version 11.24.2
🔖 Bump core module to version 11.8.1

[Project]
⬆️ Upgrade Gradle to version 8.5

[Components Module]
- Behaviors Package
🐛 Fixed bug in selectable components' behavior triggering fire() twice and thus causing any action to be performed twice

[Core Module]
- Utils Package
✨ Added utils for JavaFX windows
✨ Added resizer for JavaFX stages
✨ PositionUtils: added method to detect baseline positions

Signed-off-by: palexdev <alessandro.parisi406@gmail.com>
  • Loading branch information
palexdev committed Jan 22, 2024
1 parent 4332a56 commit fa161ac
Show file tree
Hide file tree
Showing 16 changed files with 290 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .idea/discord.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jdk=11
testJdk=17

# Modules
mfx=11.24.1
mfxcore=11.8.0
mfx=11.24.2
mfxcore=11.8.1
mfxeffects=11.3.1
mfxlocalization=11.1.0
mfxresources=11.9.1
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion modules/components/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Maven #
#--------------------------------------#
POM_ARTIFACT_ID=mfxcomponents
VERSION_NAME=11.24.1
VERSION_NAME=11.24.2

POM_NAME=mfxcomponents
POM_DESCRIPTION=Material Design/Modern components for JavaFX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
import io.github.palexdev.mfxcore.selection.SelectionProperty;
import io.github.palexdev.mfxcore.utils.EnumUtils;
import javafx.event.ActionEvent;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;

import java.util.function.Consumer;

/**
* This is the default behavior used by all {@link MFXCheckbox} components.
Expand All @@ -43,6 +49,28 @@ public MFXCheckboxBehavior(MFXCheckbox button) {
// Overridden Methods
//================================================================================

/**
* {@inheritDoc}
* <p></p>
* Overridden to not trigger {@link MFXCheckbox#fire()} twice as it is already handled by {@link #handleSelection()}
*/
@Override
public void mouseClicked(MouseEvent me, Consumer<MouseEvent> callback) {
if (me.getButton() == MouseButton.PRIMARY) handleSelection();
if (callback != null) callback.accept(me);
}

/**
* {@inheritDoc}
* <p></p>
* Overridden to not trigger {@link MFXCheckbox#fire()} twice as it is already handled by {@link #handleSelection()}
*/
@Override
public void keyPressed(KeyEvent ke, Consumer<KeyEvent> callback) {
if (ke.getCode() == KeyCode.ENTER) handleSelection();
if (callback != null) callback.accept(ke);
}

/**
* {@inheritDoc}
* <p></p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
package io.github.palexdev.mfxcomponents.behaviors;

import io.github.palexdev.mfxcomponents.controls.buttons.MFXIconButton;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;

import java.util.function.Consumer;

/**
* This is the default behavior used by all {@link MFXIconButton} components.
Expand All @@ -20,6 +26,29 @@ public MFXIconButtonBehavior(MFXIconButton button) {
//================================================================================
// Overridden Methods
//================================================================================

/**
* {@inheritDoc}
* <p></p>
* Overridden to not trigger {@link MFXIconButton#fire()} twice as it is already handled by {@link #handleSelection()}
*/
@Override
public void mouseClicked(MouseEvent me, Consumer<MouseEvent> callback) {
if (me.getButton() == MouseButton.PRIMARY) handleSelection();
if (callback != null) callback.accept(me);
}

/**
* {@inheritDoc}
* <p></p>
* Overridden to not trigger {@link MFXIconButton#fire()} twice as it is already handled by {@link #handleSelection()}
*/
@Override
public void keyPressed(KeyEvent ke, Consumer<KeyEvent> callback) {
if (ke.getCode() == KeyCode.ENTER) handleSelection();
if (callback != null) callback.accept(ke);
}

@Override
protected void handleSelection() {
MFXIconButton btn = getNode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
* is and remains the first child of the component to avoid this from covering the other children.
*/
// TODO dragged state is not implemented yet
// TODO we should implement a way to specify extra states too (such as selected), even though out of specs
public class MaterialSurface extends Region implements MFXStyleable {
//================================================================================
// Static Properties
Expand Down Expand Up @@ -124,7 +125,7 @@ public MaterialSurface initRipple(Consumer<MFXRippleGenerator> config) {
* The opacity is determined by the current interaction state on the owner. The values are specified by:
* {@link #hoverOpacityProperty()}, {@link #focusOpacityProperty()} and {@link #pressOpacityProperty()}.
* <p></p>
* The state check are delegated to: {@link #isOwnerDisabled()}, {@link #isOwnerPressed()},
* The state checks are delegated to: {@link #isOwnerDisabled()}, {@link #isOwnerPressed()},
* {@link #isOwnerFocused()} and {@link #isOwnerHover()}, listed in order of priority.
* <p></p>
* The opacity is set immediately or through an animation started by {@link #animateBackground(double)}.
Expand Down
2 changes: 1 addition & 1 deletion modules/core/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Maven #
#--------------------------------------#
POM_ARTIFACT_ID=mfxcore
VERSION_NAME=11.8.0
VERSION_NAME=11.8.1

POM_NAME=mfxcore
POM_DESCRIPTION=Core components for MaterialFX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public WhenEvent<T> register() {

/**
* Invoked by {@link #register()} if everything went well. Here, the construct is added to a static Map that retains
* all the built constructs, the mapping is as follows: Node -> Set<WhenEvent<?>>.
* all the built constructs, the mapping is as follows: {@code Node -> Set<WhenEvent<?>>}.
* <p>
* Finally, the built {@link EventHandler} is added on the specified Node.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ public static boolean isLeft(Pos pos) {
public static boolean isRight(Pos pos) {
return pos == Pos.TOP_RIGHT || pos == Pos.CENTER_RIGHT || pos == Pos.BOTTOM_RIGHT;
}

public static boolean isBaseline(Pos pos) {
return pos == Pos.BASELINE_LEFT || pos == Pos.BASELINE_CENTER || pos == Pos.BASELINE_RIGHT;
}
}
Loading

0 comments on commit fa161ac

Please sign in to comment.