java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
javafx.scene.control.Labeled
javafx.scene.control.ButtonBase
javafx.scene.control.Button
io.github.palexdev.materialfx.controls.MFXButton
- All Implemented Interfaces:
Styleable,EventTarget,Skinnable
This is the implementation of a button following Google's material design guidelines in JavaFX.
Extends Button, redefines the style class to "mfx-button" for usage in CSS and
includes a RippleGenerator to generate ripple effects on click.
-
Property Summary
PropertiesTypePropertyDescriptionSpecifies the appearance of this control.Specifies if therippleRadiusMultiplierProperty()should be computed automatically.Specifies how intense is theDropShadoweffect applied to this control.Specifies if the button's background should also be animated.Specifies if the button's shadow should also be animated.Specifies the ripple generator's animations speed.Specifies the opacity for the background animation.final ObjectProperty<Paint>Specifies the ripples color of this control.Specifies the number by which the ripples' radius will be multiplied.Specifies the radius of the ripples.Properties inherited from class javafx.scene.control.Button
cancelButton, defaultButtonProperties inherited from class javafx.scene.control.ButtonBase
armed, onActionProperties inherited from class javafx.scene.control.Labeled
alignment, contentDisplay, ellipsisString, font, graphic, graphicTextGap, labelPadding, lineSpacing, mnemonicParsing, textAlignment, textFill, textOverrun, text, underline, wrapTextProperties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltipProperties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, widthProperties inherited from class javafx.scene.Parent
needsLayoutProperties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible -
Field Summary
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZEFields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the appearance of this control.Specifies if therippleRadiusMultiplierProperty()should be computed automatically.protected Skin<?>Specifies how intense is theDropShadoweffect applied to this control.Gets the value of the property buttonType.List<CssMetaData<? extends Styleable,?>> static List<CssMetaData<? extends Styleable,?>> Gets the value of the property depthLevel.doubleGets the value of the property rippleAnimationSpeed.doubleGets the value of the property rippleBackgroundOpacity.final PaintGets the value of the property rippleColor.doubleGets the value of the property rippleRadius.doubleGets the value of the property rippleRadiusMultiplier.booleanGets the value of the property computeRadiusMultiplier.booleanGets the value of the property rippleAnimateBackground.booleanGets the value of the property rippleAnimateShadow.Specifies if the button's background should also be animated.Specifies if the button's shadow should also be animated.Specifies the ripple generator's animations speed.Specifies the opacity for the background animation.final ObjectProperty<Paint>Specifies the ripples color of this control.Specifies the number by which the ripples' radius will be multiplied.Specifies the radius of the ripples.voidsetButtonType(ButtonType buttonType) Sets the value of the property buttonType.voidsetComputeRadiusMultiplier(boolean computeRadiusMultiplier) Sets the value of the property computeRadiusMultiplier.voidsetDepthLevel(DepthLevel depthLevel) Sets the value of the property depthLevel.voidsetRippleAnimateBackground(boolean rippleAnimateBackground) Sets the value of the property rippleAnimateBackground.voidsetRippleAnimateShadow(boolean rippleAnimateShadow) Sets the value of the property rippleAnimateShadow.voidsetRippleAnimationSpeed(double rippleAnimationSpeed) Sets the value of the property rippleAnimationSpeed.voidsetRippleBackgroundOpacity(double rippleBackgroundOpacity) Sets the value of the property rippleBackgroundOpacity.final voidsetRippleColor(Paint rippleColor) Sets the value of the property rippleColor.voidsetRippleRadius(double rippleRadius) Sets the value of the property rippleRadius.voidsetRippleRadiusMultiplier(double rippleRadiusMultiplier) Sets the value of the property rippleRadiusMultiplier.protected voidBinds the button's ripple properties to the ripple generator ones.Methods inherited from class javafx.scene.control.Button
cancelButtonProperty, defaultButtonProperty, fire, isCancelButton, isDefaultButton, setCancelButton, setDefaultButtonMethods inherited from class javafx.scene.control.ButtonBase
arm, armedProperty, disarm, executeAccessibleAction, getOnAction, isArmed, onActionProperty, setOnActionMethods inherited from class javafx.scene.control.Labeled
alignmentProperty, contentDisplayProperty, ellipsisStringProperty, fontProperty, getAlignment, getClassCssMetaData, getContentBias, getContentDisplay, getEllipsisString, getFont, getGraphic, getGraphicTextGap, getInitialAlignment, getLabelPadding, getLineSpacing, getText, getTextAlignment, getTextFill, getTextOverrun, graphicProperty, graphicTextGapProperty, isMnemonicParsing, isUnderline, isWrapText, labelPaddingProperty, lineSpacingProperty, mnemonicParsingProperty, setAlignment, setContentDisplay, setEllipsisString, setFont, setGraphic, setGraphicTextGap, setLineSpacing, setMnemonicParsing, setText, setTextAlignment, setTextFill, setTextOverrun, setUnderline, setWrapText, textAlignmentProperty, textFillProperty, textOverrunProperty, textProperty, toString, underlineProperty, wrapTextPropertyMethods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipPropertyMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthPropertyMethods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBoundsMethods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visiblePropertyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
computeRadiusMultiplier
Specifies if therippleRadiusMultiplierProperty()should be computed automatically. -
rippleAnimateBackground
Specifies if the button's background should also be animated. -
rippleAnimateShadow
Specifies if the button's shadow should also be animated. -
rippleAnimationSpeed
Specifies the ripple generator's animations speed. -
rippleBackgroundOpacity
Specifies the opacity for the background animation. (ifrippleAnimateBackgroundProperty()is true). -
rippleColor
Specifies the ripples color of this control.- See Also:
-
rippleRadius
Specifies the radius of the ripples.- See Also:
-
rippleRadiusMultiplier
Specifies the number by which the ripples' radius will be multiplied. -
depthLevel
Specifies how intense is theDropShadoweffect applied to this control.The
DropShadoweffect is used to make the control appearRAISED.- See Also:
-
buttonType
Specifies the appearance of this control. According to material design there are two types of buttons:-
FLAT-
If the new type isRAISEDFLATthen setEffect(null) is called so that a user can also specify it's own effects for the button.- See Also:
-
-
Constructor Details
-
MFXButton
public MFXButton() -
MFXButton
-
MFXButton
-
MFXButton
-
-
Method Details
-
getRippleGenerator
-
setupRippleGenerator
protected void setupRippleGenerator()Binds the button's ripple properties to the ripple generator ones. -
isComputeRadiusMultiplier
public boolean isComputeRadiusMultiplier()Gets the value of the property computeRadiusMultiplier.- Property description:
- Specifies if the
rippleRadiusMultiplierProperty()should be computed automatically.
-
computeRadiusMultiplierProperty
Specifies if therippleRadiusMultiplierProperty()should be computed automatically. -
setComputeRadiusMultiplier
public void setComputeRadiusMultiplier(boolean computeRadiusMultiplier) Sets the value of the property computeRadiusMultiplier.- Property description:
- Specifies if the
rippleRadiusMultiplierProperty()should be computed automatically.
-
isRippleAnimateBackground
public boolean isRippleAnimateBackground()Gets the value of the property rippleAnimateBackground.- Property description:
- Specifies if the button's background should also be animated.
-
rippleAnimateBackgroundProperty
Specifies if the button's background should also be animated. -
setRippleAnimateBackground
public void setRippleAnimateBackground(boolean rippleAnimateBackground) Sets the value of the property rippleAnimateBackground.- Property description:
- Specifies if the button's background should also be animated.
-
isRippleAnimateShadow
public boolean isRippleAnimateShadow()Gets the value of the property rippleAnimateShadow.- Property description:
- Specifies if the button's shadow should also be animated.
-
rippleAnimateShadowProperty
Specifies if the button's shadow should also be animated. -
setRippleAnimateShadow
public void setRippleAnimateShadow(boolean rippleAnimateShadow) Sets the value of the property rippleAnimateShadow.- Property description:
- Specifies if the button's shadow should also be animated.
-
getRippleAnimationSpeed
public double getRippleAnimationSpeed()Gets the value of the property rippleAnimationSpeed.- Property description:
- Specifies the ripple generator's animations speed.
-
rippleAnimationSpeedProperty
Specifies the ripple generator's animations speed. -
setRippleAnimationSpeed
public void setRippleAnimationSpeed(double rippleAnimationSpeed) Sets the value of the property rippleAnimationSpeed.- Property description:
- Specifies the ripple generator's animations speed.
-
getRippleBackgroundOpacity
public double getRippleBackgroundOpacity()Gets the value of the property rippleBackgroundOpacity.- Property description:
- Specifies the opacity for the background animation. (if
rippleAnimateBackgroundProperty()is true).
-
rippleBackgroundOpacityProperty
Specifies the opacity for the background animation. (ifrippleAnimateBackgroundProperty()is true). -
setRippleBackgroundOpacity
public void setRippleBackgroundOpacity(double rippleBackgroundOpacity) Sets the value of the property rippleBackgroundOpacity.- Property description:
- Specifies the opacity for the background animation. (if
rippleAnimateBackgroundProperty()is true).
-
getRippleColor
Gets the value of the property rippleColor.- Property description:
- Specifies the ripples color of this control.
-
rippleColorProperty
Specifies the ripples color of this control.- See Also:
-
setRippleColor
Sets the value of the property rippleColor.- Property description:
- Specifies the ripples color of this control.
-
getRippleRadius
public double getRippleRadius()Gets the value of the property rippleRadius.- Property description:
- Specifies the radius of the ripples.
-
rippleRadiusProperty
Specifies the radius of the ripples.- See Also:
-
setRippleRadius
public void setRippleRadius(double rippleRadius) Sets the value of the property rippleRadius.- Property description:
- Specifies the radius of the ripples.
-
getRippleRadiusMultiplier
public double getRippleRadiusMultiplier()Gets the value of the property rippleRadiusMultiplier.- Property description:
- Specifies the number by which the ripples' radius will be multiplied.
-
rippleRadiusMultiplierProperty
Specifies the number by which the ripples' radius will be multiplied. -
setRippleRadiusMultiplier
public void setRippleRadiusMultiplier(double rippleRadiusMultiplier) Sets the value of the property rippleRadiusMultiplier.- Property description:
- Specifies the number by which the ripples' radius will be multiplied.
-
getDepthLevel
Gets the value of the property depthLevel.- Property description:
- Specifies how intense is the
DropShadoweffect applied to this control.The
DropShadoweffect is used to make the control appearRAISED.
-
depthLevelProperty
Specifies how intense is theDropShadoweffect applied to this control.The
DropShadoweffect is used to make the control appearRAISED.- See Also:
-
setDepthLevel
Sets the value of the property depthLevel.- Property description:
- Specifies how intense is the
DropShadoweffect applied to this control.The
DropShadoweffect is used to make the control appearRAISED.
-
getButtonType
Gets the value of the property buttonType.- Property description:
- Specifies the appearance of this control. According to material design there are two types of buttons:
-
FLAT-
If the new type isRAISEDFLATthen setEffect(null) is called so that a user can also specify it's own effects for the button.
-
buttonTypeProperty
Specifies the appearance of this control. According to material design there are two types of buttons:-
FLAT-
If the new type isRAISEDFLATthen setEffect(null) is called so that a user can also specify it's own effects for the button.- See Also:
-
setButtonType
Sets the value of the property buttonType.- Property description:
- Specifies the appearance of this control. According to material design there are two types of buttons:
-
FLAT-
If the new type isRAISEDFLATthen setEffect(null) is called so that a user can also specify it's own effects for the button.
-
getControlCssMetaDataList
-
createDefaultSkin
- Overrides:
createDefaultSkinin classButton
-
getControlCssMetaData
- Overrides:
getControlCssMetaDatain classLabeled
-
getUserAgentStylesheet
- Overrides:
getUserAgentStylesheetin classRegion
-