public class FloatingActionButton extends Layer
Layer
that can be placed in to a
MobileLayoutPane
to provide users with a quick way of performing a
primary action in a user interface.Type | Property and Description |
---|---|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.event.ActionEvent>> |
onAction
The
EventHandler that will be called when the user interacts with the
floating action button. |
javafx.beans.property.StringProperty |
text
The text (either actual text, or a
MaterialDesignIcon graphic)
to display inside the floating action button |
autoHideProperty, mobileLayoutPaneProperty, showingProperty
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, heightProperty, insetsProperty, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, opaqueInsetsProperty, paddingProperty, prefHeightProperty, prefWidthProperty, scaleShapeProperty, shapeProperty, snapToPixelProperty, widthProperty
impl_traversalEngineProperty, needsLayoutProperty
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, cacheHintProperty, cacheProperty, clipProperty, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, focusedProperty, focusTraversableProperty, hoverProperty, idProperty, impl_showMnemonicsProperty, impl_treeVisibleProperty, inputMethodRequestsProperty, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParentTransformProperty, localToSceneTransformProperty, managedProperty, mouseTransparentProperty, nodeOrientationProperty, 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, pickOnBoundsProperty, pressedProperty, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, styleProperty, translateXProperty, translateYProperty, translateZProperty, visibleProperty
Modifier and Type | Field and Description |
---|---|
static java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> |
BOTTOM_CENTER
Places the floating action button in the bottom-center section of the user interface.
|
static java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> |
BOTTOM_LEFT
Places the floating action button in the bottom-left section of the user interface.
|
static java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> |
BOTTOM_RIGHT
Places the floating action button in the bottom-right section of the user interface.
|
static java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> |
TOP_LEFT
Places the floating action button in the top-left section of the user interface.
|
static java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> |
TOP_RIGHT
Places the floating action button in the top-right section of the user interface.
|
Constructor and Description |
---|
FloatingActionButton()
Creates a new FloatingActionButton instance with the default graphic
(
MaterialDesignIcon.ADD ) and no onAction handler installed
(to set an onAction handler call setOnAction(EventHandler) ). |
FloatingActionButton(java.lang.String text,
javafx.event.EventHandler<javafx.event.ActionEvent> onAction)
Creates a new FloatingActionButton instance with the provided text and the
provided event handler set as the onAction handler.
|
Modifier and Type | Method and Description |
---|---|
javafx.event.EventHandler<javafx.event.ActionEvent> |
getOnAction()
Returns the
EventHandler asigned to the floating
action button |
java.lang.String |
getText()
Returns the text to be displayed inside the floating action button
|
void |
layoutChildren()
Override this method to add the layout logic for your layer.
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.event.ActionEvent>> |
onActionProperty()
The
EventHandler that will be called when the user interacts with the
floating action button. |
void |
setFloatingActionButtonHandler(java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> c)
The floating action button handler is the method that is called to determine
the positioning of the floating action button in the layout pane.
|
void |
setOnAction(javafx.event.EventHandler<javafx.event.ActionEvent> onAction)
Sets the
EventHandler for the floating action button |
void |
setText(java.lang.String text)
Sets the text to be displayed inside the floating action button
|
javafx.beans.property.StringProperty |
textProperty()
The text (either actual text, or a
MaterialDesignIcon graphic)
to display inside the floating action button |
autoHideProperty, dispose, getMobileLayoutPane, hide, initialize, isAutoHide, isShowing, mobileLayoutPaneProperty, setAutoHide, setShowing, show, showingProperty
alignmentProperty, clearConstraints, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getAlignment, getAlignment, getClassCssMetaData, getContentBias, getCssMetaData, getMargin, requestLayout, setAlignment, setAlignment, setMargin
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, 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, snapSize, snapSpace, snapToPixelProperty, widthProperty
getBaselineOffset, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processCSS, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBounds
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, 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, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_cssGetFocusTraversableInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, 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, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
public final javafx.beans.property.StringProperty textProperty
MaterialDesignIcon
graphic)
to display inside the floating action buttongetText()
,
setText(String)
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.event.ActionEvent>> onActionProperty
EventHandler
that will be called when the user interacts with the
floating action button.getOnAction()
,
setOnAction(EventHandler)
public static final java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> TOP_LEFT
setFloatingActionButtonHandler(Function)
.public static final java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> TOP_RIGHT
setFloatingActionButtonHandler(Function)
.public static final java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> BOTTOM_LEFT
setFloatingActionButtonHandler(Function)
.public static final java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> BOTTOM_CENTER
setFloatingActionButtonHandler(Function)
.public static final java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> BOTTOM_RIGHT
setFloatingActionButtonHandler(Function)
.public FloatingActionButton()
MaterialDesignIcon.ADD
) and no onAction handler installed
(to set an onAction handler call setOnAction(EventHandler)
).
It is important to note that this constructor does not install the
floating action button into any MobileLayoutPane
(via its
MobileLayoutPane.getLayers()
method.
public FloatingActionButton(java.lang.String text, javafx.event.EventHandler<javafx.event.ActionEvent> onAction)
It is important to note that this constructor does not install the
floating action button into any MobileLayoutPane
(via its
MobileLayoutPane.getLayers()
method.
text
- MaterialDesignIcon
textonAction
- the event handlerpublic final javafx.beans.property.StringProperty textProperty()
MaterialDesignIcon
graphic)
to display inside the floating action buttongetText()
,
setText(String)
public final java.lang.String getText()
String
with the textpublic final void setText(java.lang.String text)
text
- A String
with the text to be setpublic final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<javafx.event.ActionEvent>> onActionProperty()
EventHandler
that will be called when the user interacts with the
floating action button.getOnAction()
,
setOnAction(EventHandler)
public final javafx.event.EventHandler<javafx.event.ActionEvent> getOnAction()
EventHandler
asigned to the floating
action buttonEventHandler
public final void setOnAction(javafx.event.EventHandler<javafx.event.ActionEvent> onAction)
EventHandler
for the floating action buttononAction
- the EventHandler
public final void setFloatingActionButtonHandler(java.util.function.Function<FloatingActionButton,javafx.geometry.Point2D> c)
MobileLayoutPane
, including:
c
- a Function
that manages to set the position
of the flaoting action buttonpublic void layoutChildren()
StackPane
algorithm.layoutChildren
in class Layer