Class AbstractMFXRippleGenerator<T extends IRipple>
- Type Parameters:
T- the types of ripple accepted by the generator
- All Implemented Interfaces:
IRippleGenerator<T>,Styleable,EventTarget
- Direct Known Subclasses:
MFXCircleRippleGenerator
Also defines the style class ("mfx-ripple-generator") for all generators that extend this class.
When generating ripples, four are three important information: - Region: the generator must have a reference to the Region in which it will generate ripples.
- Position: the generator must know where you want to generate the ripple, so x and y coordinates (positionFunction.
- Ripple type/shape: the generator must know what kind of ripple you want to generate (circle, rectangle...), rippleSupplier.
- Clip/Ripple Bounds: the generator should know the bounds beyond which the ripple must not go. In JavaFX to achieve such behavior there is the clip concept, clipSupplier.
-
Property Summary
PropertiesTypePropertyDescriptionSpecifies if the background of the region should be animated too.Specifies if theDropShadoweffect of the region should be animates too.Specifies ifisWithinBounds(MouseEvent)should be called before generating the ripple.Specifies by how many levels the shadow should be increased.Specifies the action to perform when aAbstractMFXRippleGenerator.RippleGeneratorEvent.ANIMATION_FINISHED_EVENTis fired.Properties 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 -
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEvents class for RippleGenerators. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BooleanPropertyprotected final BooleanPropertyprotected final ObservableStack<Animation>protected final BooleanPropertyprotected final IntegerPropertyprotected Function<MouseEvent,PositionBean> protected final Regionprotected final StringFields 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 if the background of the region should be animated too.Specifies if theDropShadoweffect of the region should be animates too.Specifies ifisWithinBounds(MouseEvent)should be called before generating the ripple.Specifies by how many levels the shadow should be increased.voidConvenience method to fireAbstractMFXRippleGenerator.RippleGeneratorEventevents.abstract voidgenerateRipple(MouseEvent event) Abstract method.intGets the value of the property depthLevelOffset.Gets the value of the property onAnimationFinished.protected voidThis method must be called by all subclasses in the constructor after the super call.booleanGets the value of the property animateBackground.booleanGets the value of the property animateShadow.booleanGets the value of the property checkBounds.protected booleanisWithinBounds(MouseEvent event) Checks if the mouse event coordinates are within theBoundsof the region.Specifies the action to perform when aAbstractMFXRippleGenerator.RippleGeneratorEvent.ANIMATION_FINISHED_EVENTis fired.voidsetAnimateBackground(boolean animateBackground) Sets the value of the property animateBackground.voidsetAnimateShadow(boolean animateShadow) Sets the value of the property animateShadow.voidsetCheckBounds(boolean checkBounds) Sets the value of the property checkBounds.voidsetDepthLevelOffset(int depthLevelOffset) Sets the value of the property depthLevelOffset.voidsetOnAnimationFinished(EventHandler<AbstractMFXRippleGenerator.RippleGeneratorEvent> onAnimationFinished) Sets the value of the property onAnimationFinished.Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, 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
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, layoutChildren, lookup, needsLayoutProperty, queryAccessibleAttribute, 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, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, 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, toString, 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 io.github.palexdev.materialfx.effects.ripple.base.IRippleGenerator
defaultClipSupplier, defaultPositionFunction, defaultRippleSupplier, getClipSupplier, getRegion, getRipplePositionFunction, getRippleSupplier, setClipSupplier, setRipplePositionFunction, setRippleSupplierMethods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
animateBackground
Specifies if the background of the region should be animated too.The animation generally consists in temporarily adding a shape to the generator, set its fill same as the ripple color, and manipulate its opacity with a timeline.
-
animateShadow
Specifies if theDropShadoweffect of the region should be animates too.Mostly used for
MFXButtons.- See Also:
-
checkBounds
Specifies ifisWithinBounds(MouseEvent)should be called before generating the ripple.The purpose of this property is to disable/bypass the bounds check, it may happen in some cases that the check must be disabled to make the generator work properly. An example is the
MFXCheckboxSkin.- See Also:
-
depthLevelOffset
Specifies by how many levels the shadow should be increased. For example if theDropShadoweffect is ofDepthLevel.LEVEL1and the offset is set to 2 then the shadow will shift toDepthLevel.LEVEL3, (reverted at the end of the animation of course). -
onAnimationFinished
public EventHandlerProperty<AbstractMFXRippleGenerator.RippleGeneratorEvent> onAnimationFinishedPropertySpecifies the action to perform when aAbstractMFXRippleGenerator.RippleGeneratorEvent.ANIMATION_FINISHED_EVENTis fired.
-
-
Field Details
-
STYLE_CLASS
- See Also:
-
animationsStack
-
region
-
clipSupplier
-
rippleSupplier
-
positionFunction
-
animateBackground
-
animateShadow
-
checkBounds
-
depthLevelOffset
-
onAnimationFinished
public final EventHandlerProperty<AbstractMFXRippleGenerator.RippleGeneratorEvent> onAnimationFinished
-
-
Constructor Details
-
AbstractMFXRippleGenerator
-
-
Method Details
-
generateRipple
Abstract method. Every generator must provide a way to generate ripples. -
initialize
protected void initialize()This method must be called by all subclasses in the constructor after the super call. It is responsible for setting the style class, the region size and firingAbstractMFXRippleGenerator.RippleGeneratorEventevents. -
isWithinBounds
Checks if the mouse event coordinates are within theBoundsof the region. -
isAnimateBackground
public boolean isAnimateBackground()Gets the value of the property animateBackground.- Property description:
- Specifies if the background of the region should be animated too.
The animation generally consists in temporarily adding a shape to the generator, set its fill same as the ripple color, and manipulate its opacity with a timeline.
-
animateBackgroundProperty
Specifies if the background of the region should be animated too.The animation generally consists in temporarily adding a shape to the generator, set its fill same as the ripple color, and manipulate its opacity with a timeline.
-
setAnimateBackground
public void setAnimateBackground(boolean animateBackground) Sets the value of the property animateBackground.- Property description:
- Specifies if the background of the region should be animated too.
The animation generally consists in temporarily adding a shape to the generator, set its fill same as the ripple color, and manipulate its opacity with a timeline.
-
isAnimateShadow
public boolean isAnimateShadow()Gets the value of the property animateShadow.- Property description:
- Specifies if the
DropShadoweffect of the region should be animates too.Mostly used for
MFXButtons.
-
animateShadowProperty
Specifies if theDropShadoweffect of the region should be animates too.Mostly used for
MFXButtons.- See Also:
-
setAnimateShadow
public void setAnimateShadow(boolean animateShadow) Sets the value of the property animateShadow.- Property description:
- Specifies if the
DropShadoweffect of the region should be animates too.Mostly used for
MFXButtons.
-
isCheckBounds
public boolean isCheckBounds()Gets the value of the property checkBounds.- Property description:
- Specifies if
isWithinBounds(MouseEvent)should be called before generating the ripple.The purpose of this property is to disable/bypass the bounds check, it may happen in some cases that the check must be disabled to make the generator work properly. An example is the
MFXCheckboxSkin.
-
checkBoundsProperty
Specifies ifisWithinBounds(MouseEvent)should be called before generating the ripple.The purpose of this property is to disable/bypass the bounds check, it may happen in some cases that the check must be disabled to make the generator work properly. An example is the
MFXCheckboxSkin.- See Also:
-
setCheckBounds
public void setCheckBounds(boolean checkBounds) Sets the value of the property checkBounds.- Property description:
- Specifies if
isWithinBounds(MouseEvent)should be called before generating the ripple.The purpose of this property is to disable/bypass the bounds check, it may happen in some cases that the check must be disabled to make the generator work properly. An example is the
MFXCheckboxSkin.
-
getDepthLevelOffset
public int getDepthLevelOffset()Gets the value of the property depthLevelOffset.- Property description:
- Specifies by how many levels the shadow should be increased.
For example if the
DropShadoweffect is ofDepthLevel.LEVEL1and the offset is set to 2 then the shadow will shift toDepthLevel.LEVEL3, (reverted at the end of the animation of course).
-
depthLevelOffsetProperty
Specifies by how many levels the shadow should be increased. For example if theDropShadoweffect is ofDepthLevel.LEVEL1and the offset is set to 2 then the shadow will shift toDepthLevel.LEVEL3, (reverted at the end of the animation of course). -
setDepthLevelOffset
public void setDepthLevelOffset(int depthLevelOffset) Sets the value of the property depthLevelOffset.- Property description:
- Specifies by how many levels the shadow should be increased.
For example if the
DropShadoweffect is ofDepthLevel.LEVEL1and the offset is set to 2 then the shadow will shift toDepthLevel.LEVEL3, (reverted at the end of the animation of course).
-
getOnAnimationFinished
Gets the value of the property onAnimationFinished.- Property description:
- Specifies the action to perform when a
AbstractMFXRippleGenerator.RippleGeneratorEvent.ANIMATION_FINISHED_EVENTis fired.
-
onAnimationFinishedProperty
public EventHandlerProperty<AbstractMFXRippleGenerator.RippleGeneratorEvent> onAnimationFinishedProperty()Specifies the action to perform when aAbstractMFXRippleGenerator.RippleGeneratorEvent.ANIMATION_FINISHED_EVENTis fired. -
setOnAnimationFinished
public void setOnAnimationFinished(EventHandler<AbstractMFXRippleGenerator.RippleGeneratorEvent> onAnimationFinished) Sets the value of the property onAnimationFinished.- Property description:
- Specifies the action to perform when a
AbstractMFXRippleGenerator.RippleGeneratorEvent.ANIMATION_FINISHED_EVENTis fired.
-
fireGeneratorEvent
public void fireGeneratorEvent(EventType<AbstractMFXRippleGenerator.RippleGeneratorEvent> eventType) Convenience method to fireAbstractMFXRippleGenerator.RippleGeneratorEventevents.
-