public class Layer
extends javafx.scene.layout.Pane
A Layer is an overlay that can be shown above any View
.
Layer is managed by GlassPane
and is automatically added/removed depending on the
value of the showingProperty()
.
A Layer follows a life cycle triggering various life cycle events during the process.
The life cycle event 'showing' is called as soon as show()
is called followed by playing the show transition
.
Once the show transition is complete, the life cycle event 'shown' is triggered.
Similarly, when hide()
is called, life cycle event 'hiding' is triggered followed by a call to
'hidden' event when the hide transition
has completed animating.
A background fade can be set by calling setBackgroundFade(double)
this will fade the background to a darker color, bringing more attention to what
is shown by this layer making it distinct from the content underneath. The background can
also be set transparent to mouse events by using Node.mouseTransparentProperty()
.
View
,
GlassPane
,
MobileApplication
Type | Property and Description |
---|---|
javafx.beans.property.BooleanProperty |
autoHide
Represents whether this Layer should hide when it is clicked outside its
bounds.When set to false, the background is transparent to mouse events.
|
javafx.beans.property.DoubleProperty |
backgroundFade
Sets a background fade making the background a darker color and with this
bringing more attention to what is shown by this Layer.
|
javafx.beans.property.ObjectProperty<java.util.function.Function<Layer,javafx.animation.Transition>> |
hideTransitionFactory
The factory that returns the
Transition for the given layer
which should be used during its disappearance. |
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> |
onHidden
Called just after the Layer has been hidden.
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> |
onHiding
Called just prior to the Layer being hidden.
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> |
onShowing
Called just prior to the Layer being shown.
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> |
onShown
Called just after the Layer is shown.
|
javafx.beans.property.ReadOnlyBooleanProperty |
showing
Represents whether this Layer is currently showing on screen or not.
|
javafx.beans.property.ObjectProperty<java.util.function.Function<Layer,javafx.animation.Transition>> |
showTransitionFactory
The factory that returns the
Transition for the given layer
which should be used during its appearance. |
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, impl_showMnemonics, impl_treeVisible, 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, visible
Constructor and Description |
---|
Layer()
Creates a new Layer instance.
|
Modifier and Type | Method and Description |
---|---|
javafx.beans.property.BooleanProperty |
autoHideProperty()
Represents whether this Layer should hide when it is clicked outside its
bounds.When set to false, the background is transparent to mouse events.
|
javafx.beans.property.DoubleProperty |
backgroundFadeProperty()
Sets a background fade making the background a darker color and with this
bringing more attention to what is shown by this Layer.
|
double |
getBackgroundFade()
Gets the value of the property backgroundFade.
|
java.util.function.Function<Layer,javafx.animation.Transition> |
getHideTransitionFactory()
Gets the value of the property hideTransitionFactory.
|
javafx.event.EventHandler<LifecycleEvent> |
getOnHidden()
Gets the value of the property onHidden.
|
javafx.event.EventHandler<LifecycleEvent> |
getOnHiding()
Gets the value of the property onHiding.
|
javafx.event.EventHandler<LifecycleEvent> |
getOnShowing()
Gets the value of the property onShowing.
|
javafx.event.EventHandler<LifecycleEvent> |
getOnShown()
Gets the value of the property onShown.
|
java.util.function.Function<Layer,javafx.animation.Transition> |
getShowTransitionFactory()
Gets the value of the property showTransitionFactory.
|
void |
hide()
If this layer is showing, calling this method will hide it.
|
javafx.beans.property.ObjectProperty<java.util.function.Function<Layer,javafx.animation.Transition>> |
hideTransitionFactoryProperty()
The factory that returns the
Transition for the given layer
which should be used during its disappearance. |
boolean |
isAutoHide()
Gets the value of the property autoHide.
|
boolean |
isShowing()
Gets the value of the property showing.
|
void |
layoutChildren()
Override this method to add the layout logic for your layer.
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> |
onHiddenProperty()
Called just after the Layer has been hidden.
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> |
onHidingProperty()
Called just prior to the Layer being hidden.
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> |
onShowingProperty()
Called just prior to the Layer being shown.
|
javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> |
onShownProperty()
Called just after the Layer is shown.
|
void |
setAutoHide(boolean value)
Sets the value of the property autoHide.
|
void |
setBackgroundFade(double level)
Sets the value of the property backgroundFade.
|
void |
setHideTransitionFactory(java.util.function.Function<Layer,javafx.animation.Transition> value)
Sets the value of the property hideTransitionFactory.
|
void |
setOnHidden(javafx.event.EventHandler<LifecycleEvent> value)
Sets the value of the property onHidden.
|
void |
setOnHiding(javafx.event.EventHandler<LifecycleEvent> value)
Sets the value of the property onHiding.
|
void |
setOnShowing(javafx.event.EventHandler<LifecycleEvent> value)
Sets the value of the property onShowing.
|
void |
setOnShown(javafx.event.EventHandler<LifecycleEvent> value)
Sets the value of the property onShown.
|
void |
setShowTransitionFactory(java.util.function.Function<Layer,javafx.animation.Transition> value)
Sets the value of the property showTransitionFactory.
|
void |
show()
Shows the layer by installing it on the
GlassPane . |
javafx.beans.property.ReadOnlyBooleanProperty |
showingProperty()
Represents whether this Layer is currently showing on screen or not.
|
javafx.beans.property.ObjectProperty<java.util.function.Function<Layer,javafx.animation.Transition>> |
showTransitionFactoryProperty()
The factory that returns the
Transition for the given layer
which should be used during its appearance. |
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, 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, requestLayout, 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, getContentBias, 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.ReadOnlyBooleanProperty showingProperty
isShowing()
public final javafx.beans.property.BooleanProperty autoHideProperty
isAutoHide()
,
setAutoHide(boolean)
public final javafx.beans.property.ObjectProperty<java.util.function.Function<Layer,javafx.animation.Transition>> showTransitionFactoryProperty
Transition
for the given layer
which should be used during its appearance.getShowTransitionFactory()
,
setShowTransitionFactory(Function)
public final javafx.beans.property.ObjectProperty<java.util.function.Function<Layer,javafx.animation.Transition>> hideTransitionFactoryProperty
Transition
for the given layer
which should be used during its disappearance.getHideTransitionFactory()
,
setHideTransitionFactory(Function)
public final javafx.beans.property.DoubleProperty backgroundFadeProperty
getBackgroundFade()
,
setBackgroundFade(double)
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> onShowingProperty
show transition
starts.getOnShowing()
,
setOnShowing(EventHandler)
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> onShownProperty
show transition
ends.getOnShown()
,
setOnShown(EventHandler)
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> onHidingProperty
hide transition
starts.getOnHiding()
,
setOnHiding(EventHandler)
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> onHiddenProperty
hide transition
ends.
This allows the developer to clean up resources or perform other tasks when the
Layer is hidden.getOnHidden()
,
setOnHidden(EventHandler)
public final javafx.beans.property.ReadOnlyBooleanProperty showingProperty()
isShowing()
public final boolean isShowing()
public final javafx.beans.property.BooleanProperty autoHideProperty()
isAutoHide()
,
setAutoHide(boolean)
public final boolean isAutoHide()
public final void setAutoHide(boolean value)
public final javafx.beans.property.ObjectProperty<java.util.function.Function<Layer,javafx.animation.Transition>> showTransitionFactoryProperty()
Transition
for the given layer
which should be used during its appearance.getShowTransitionFactory()
,
setShowTransitionFactory(Function)
public final java.util.function.Function<Layer,javafx.animation.Transition> getShowTransitionFactory()
Transition
for the given layer
which should be used during its appearance.public final void setShowTransitionFactory(java.util.function.Function<Layer,javafx.animation.Transition> value)
Transition
for the given layer
which should be used during its appearance.public final javafx.beans.property.ObjectProperty<java.util.function.Function<Layer,javafx.animation.Transition>> hideTransitionFactoryProperty()
Transition
for the given layer
which should be used during its disappearance.getHideTransitionFactory()
,
setHideTransitionFactory(Function)
public final java.util.function.Function<Layer,javafx.animation.Transition> getHideTransitionFactory()
Transition
for the given layer
which should be used during its disappearance.public final void setHideTransitionFactory(java.util.function.Function<Layer,javafx.animation.Transition> value)
Transition
for the given layer
which should be used during its disappearance.public final javafx.beans.property.DoubleProperty backgroundFadeProperty()
getBackgroundFade()
,
setBackgroundFade(double)
public final void setBackgroundFade(double level)
public final double getBackgroundFade()
public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> onShowingProperty()
show transition
starts.getOnShowing()
,
setOnShowing(EventHandler)
public final void setOnShowing(javafx.event.EventHandler<LifecycleEvent> value)
show transition
starts.public final javafx.event.EventHandler<LifecycleEvent> getOnShowing()
show transition
starts.public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> onShownProperty()
show transition
ends.getOnShown()
,
setOnShown(EventHandler)
public final void setOnShown(javafx.event.EventHandler<LifecycleEvent> value)
show transition
ends.public final javafx.event.EventHandler<LifecycleEvent> getOnShown()
show transition
ends.public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> onHidingProperty()
hide transition
starts.getOnHiding()
,
setOnHiding(EventHandler)
public final void setOnHiding(javafx.event.EventHandler<LifecycleEvent> value)
hide transition
starts.public final javafx.event.EventHandler<LifecycleEvent> getOnHiding()
hide transition
starts.public final javafx.beans.property.ObjectProperty<javafx.event.EventHandler<LifecycleEvent>> onHiddenProperty()
hide transition
ends.
This allows the developer to clean up resources or perform other tasks when the
Layer is hidden.getOnHidden()
,
setOnHidden(EventHandler)
public final void setOnHidden(javafx.event.EventHandler<LifecycleEvent> value)
hide transition
ends.
This allows the developer to clean up resources or perform other tasks when the
Layer is hidden.public final javafx.event.EventHandler<LifecycleEvent> getOnHidden()
hide transition
ends.
This allows the developer to clean up resources or perform other tasks when the
Layer is hidden.public void show()
GlassPane
.
Also, fires LifecycleEvent.SHOWING
event. This is followed by playing the show transition, if any.
After the animation is complete, LifecycleEvent.SHOWN
is fired.
No-op if showingProperty()
is true.
public void hide()
LifecycleEvent.SHOWN
has been fired.
LifecycleEvent.HIDING
is fired as soon as the method is called. LifecycleEvent.HIDDEN
is fired after the hide transition has finished.
No-op if showingProperty()
is false.
public void layoutChildren()
layoutChildren
in class javafx.scene.Parent