Skip to content

添加 JFXCheckBox 源码#5560

Merged
Glavo merged 1 commit intoHMCL-dev:mainfrom
Glavo:check-box
Feb 17, 2026
Merged

添加 JFXCheckBox 源码#5560
Glavo merged 1 commit intoHMCL-dev:mainfrom
Glavo:check-box

Conversation

@Glavo
Copy link
Member

@Glavo Glavo commented Feb 17, 2026

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the source code for the JFXCheckBox component, which is a Material Design implementation of a checkbox control from the JFoenix library. The component extends JavaFX's CheckBox class and provides custom styling properties for checked and unchecked colors, along with ripple effects and custom selection animations.

Changes:

  • Added JFXCheckBox control class with Material Design styling support
  • Implemented CSS-styleable properties for checked and unchecked colors
  • Created constructors and initialization logic following JFoenix patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

public void setCheckedColor(Paint color) {
this.checkedColor.set(color);
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential NullPointerException when calling setCheckedColor before checkedColor is initialized. The setter should call checkedColorProperty() first to ensure the property is initialized, or check if checkedColor is null. Compare this with the pattern used in JFXToggleButton where properties are initialized at declaration time, or consider following the lazy initialization pattern by calling the property getter method first.

Suggested change
this.checkedColor.set(color);
checkedColorProperty().set(color);

Copilot uses AI. Check for mistakes.
Comment on lines +116 to +117
public void setUnCheckedColor(Paint color) {
this.unCheckedColor.set(color);
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential NullPointerException when calling setUnCheckedColor before unCheckedColor is initialized. The setter should call unCheckedColorProperty() first to ensure the property is initialized, or check if unCheckedColor is null. This follows the same issue as setCheckedColor above.

Copilot uses AI. Check for mistakes.
Comment on lines +34 to +39
/// JFXCheckBox is the material design implementation of a checkbox.
/// it shows ripple effect and a custom selection animation.
///
/// @author Shadi Shaheen
/// @version 1.0
/// @since 2016-03-09
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent documentation style. This file uses triple-slash comments (///) for some documentation while other JFoenix components in the codebase use standard JavaDoc comments (/** /). For example, JFXToggleButton and JFXTextField use /* */ style. Consider using standard JavaDoc format for consistency with the rest of the codebase.

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +72
/// Initialize the style class to 'jfx-check-box'.
///
/// This is the selector class from which CSS can be used to style
/// this control.
private static final String DEFAULT_STYLE_CLASS = "jfx-check-box";

/// checkbox color property when selected
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent documentation style. Triple-slash comments (///) are used here while the codebase standard is JavaDoc comments (/** */). See JFXToggleButton.java and JFXPasswordField.java for examples of the standard format used throughout the codebase.

Copilot uses AI. Check for mistakes.
@Glavo Glavo merged commit f665856 into HMCL-dev:main Feb 17, 2026
8 checks passed
@Glavo Glavo deleted the check-box branch February 17, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments