- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.control.Control
-
- org.controlsfx.control.HiddenSidesPane
-
- All Implemented Interfaces:
Styleable
,EventTarget
,Skinnable
public class HiddenSidesPane extends Control
A pane used to display a full-size content node and four initially hidden nodes on the four sides. The hidden nodes can be made visible by moving the mouse cursor to the edges (seesetTriggerDistance(double)
) of the pane. The hidden node will appear (at its preferred width or height) with a short slide-in animation. The node will disappear again as soon as the mouse cursor exits it. A hidden node / side can also be pinned by callingsetPinnedSide(Side)
. It will remain visible as long as it stays pinned.Screenshot
The following screenshots shows the right side node hovering over a table after it was made visible:Code Sample
HiddenSidesPane pane = new HiddenSidesPane(); pane.setContent(new TableView()); pane.setRight(new ListView());
-
-
Property Summary
Properties Type Property Description ObjectProperty<Duration>
animationDelay
Returns the animation delay property.ObjectProperty<Duration>
animationDuration
Returns the animation duration property.ObjectProperty<Node>
bottom
Returns the value of the bottom node property.ObjectProperty<Node>
content
The property that is used to store a reference to the content node.ObjectProperty<Node>
left
Returns the value of the left node property.ObjectProperty<Side>
pinnedSide
Returns the pinned side property.ObjectProperty<Node>
right
Returns the value of the right node property.ObjectProperty<Node>
top
The property used to store a reference to the node shown at the top side of the pane.DoubleProperty
triggerDistance
The property that stores the distance to the pane's edges that will trigger the appearance of the hidden side nodes.
Setting the property to zero or a negative value will disable this functionality, so a hidden side can only be made visible withsetPinnedSide(Side)
.-
Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltip
-
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, width
-
Properties inherited from class javafx.scene.Parent
needsLayout
-
Properties 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_SIZE
-
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
-
Constructor Summary
Constructors Constructor Description HiddenSidesPane()
Constructs a new pane with no content and no side nodes.HiddenSidesPane(Node content, Node top, Node right, Node bottom, Node left)
Constructs a new pane with the given content node and the four side nodes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectProperty<Duration>
animationDelayProperty()
Returns the animation delay property.ObjectProperty<Duration>
animationDurationProperty()
Returns the animation duration property.ObjectProperty<Node>
bottomProperty()
Returns the value of the bottom node property.ObjectProperty<Node>
contentProperty()
The property that is used to store a reference to the content node.protected Skin<?>
createDefaultSkin()
Duration
getAnimationDelay()
Returns the animation delayDuration
getAnimationDuration()
Returns the animation delayNode
getBottom()
Returns the value of the bottom node property.Node
getContent()
Returns the value of the content node property.Node
getLeft()
Returns the value of the left node property.Side
getPinnedSide()
Returns the value of the pinned side property.Node
getRight()
Returns the value of the right node property.Node
getTop()
Returns the value of the top node property.double
getTriggerDistance()
Returns the value of the trigger distance property.protected String
getUserAgentStylesheet(Class<?> clazz, String fileName)
A helper method that ensures that the resource based lookup of the user agent stylesheet only happens once.void
hide()
Hides the currently showing sideObjectProperty<Node>
leftProperty()
Returns the value of the left node property.ObjectProperty<Side>
pinnedSideProperty()
Returns the pinned side property.ObjectProperty<Node>
rightProperty()
Returns the value of the right node property.void
setAnimationDelay(Duration duration)
Set the animation delayvoid
setAnimationDuration(Duration duration)
Set the animation delayvoid
setBottom(Node bottom)
Sets the value of the bottom node property.void
setContent(Node content)
Sets the value of the content node property.void
setLeft(Node left)
Sets the value of the left node property.void
setPinnedSide(Side side)
Sets the value of the pinned side property.void
setRight(Node right)
Sets the value of the right node property.void
setTop(Node top)
Sets the value of the top node property.void
setTriggerDistance(double distance)
Set the value of the trigger distance property.void
show(Side side)
Shows a specific sideObjectProperty<Node>
topProperty()
The property used to store a reference to the node shown at the top side of the pane.DoubleProperty
triggerDistanceProperty()
The property that stores the distance to the pane's edges that will trigger the appearance of the hidden side nodes.
Setting the property to zero or a negative value will disable this functionality, so a hidden side can only be made visible withsetPinnedSide(Side)
.-
Methods inherited from class javafx.scene.control.Control
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, executeAccessibleAction, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, queryAccessibleAttribute, setContextMenu, setSkin, setTooltip, skinProperty, tooltipProperty
-
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, 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, widthProperty
-
Methods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
-
Methods 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, getContentBias, 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, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
-
-
-
Property Detail
-
triggerDistance
public final DoubleProperty triggerDistanceProperty
The property that stores the distance to the pane's edges that will trigger the appearance of the hidden side nodes.
Setting the property to zero or a negative value will disable this functionality, so a hidden side can only be made visible withsetPinnedSide(Side)
.- See Also:
getTriggerDistance()
,setTriggerDistance(double)
-
content
public final ObjectProperty<Node> contentProperty
The property that is used to store a reference to the content node. The content node will fill the entire width and height of the pane.- See Also:
getContent()
,setContent(Node)
-
top
public final ObjectProperty<Node> topProperty
The property used to store a reference to the node shown at the top side of the pane.- See Also:
getTop()
,setTop(Node)
-
right
public final ObjectProperty<Node> rightProperty
Returns the value of the right node property.- Returns:
- the right node property value
-
bottom
public final ObjectProperty<Node> bottomProperty
Returns the value of the bottom node property.- Returns:
- the bottom node property value
-
left
public final ObjectProperty<Node> leftProperty
Returns the value of the left node property.- Returns:
- the left node property value
-
pinnedSide
public final ObjectProperty<Side> pinnedSideProperty
Returns the pinned side property. The value of this property determines if one of the four hidden sides stays visible all the time.- See Also:
getPinnedSide()
,setPinnedSide(Side)
-
animationDelay
public final ObjectProperty<Duration> animationDelayProperty
Returns the animation delay property. The value of this property determines the delay before the hidden side slide in / slide out animation starts to play.- See Also:
getAnimationDelay()
,setAnimationDelay(Duration)
-
animationDuration
public final ObjectProperty<Duration> animationDurationProperty
Returns the animation duration property. The value of this property determines the fade in time for a hidden side to become visible.
-
-
Constructor Detail
-
HiddenSidesPane
public HiddenSidesPane(Node content, Node top, Node right, Node bottom, Node left)
Constructs a new pane with the given content node and the four side nodes. Each one of the side nodes may be null.- Parameters:
content
- the primary node that will fill the entire width and height of the panetop
- the hidden node on the top sideright
- the hidden node on the right sidebottom
- the hidden node on the bottom sideleft
- the hidden node on the left side
-
HiddenSidesPane
public HiddenSidesPane()
Constructs a new pane with no content and no side nodes.
-
-
Method Detail
-
createDefaultSkin
protected Skin<?> createDefaultSkin()
- Overrides:
createDefaultSkin
in classControl
-
triggerDistanceProperty
public final DoubleProperty triggerDistanceProperty()
The property that stores the distance to the pane's edges that will trigger the appearance of the hidden side nodes.
Setting the property to zero or a negative value will disable this functionality, so a hidden side can only be made visible withsetPinnedSide(Side)
.- See Also:
getTriggerDistance()
,setTriggerDistance(double)
-
getTriggerDistance
public final double getTriggerDistance()
Returns the value of the trigger distance property.- Returns:
- the trigger distance property value
-
setTriggerDistance
public final void setTriggerDistance(double distance)
Set the value of the trigger distance property.
Setting the property to zero or a negative value will disable this functionality, so a hidden side can only be made visible withsetPinnedSide(Side)
.- Parameters:
distance
- the new value for the trigger distance property
-
contentProperty
public final ObjectProperty<Node> contentProperty()
The property that is used to store a reference to the content node. The content node will fill the entire width and height of the pane.- See Also:
getContent()
,setContent(Node)
-
getContent
public final Node getContent()
Returns the value of the content node property.- Returns:
- the content node property value
-
setContent
public final void setContent(Node content)
Sets the value of the content node property.- Parameters:
content
- the new content node
-
topProperty
public final ObjectProperty<Node> topProperty()
The property used to store a reference to the node shown at the top side of the pane.- See Also:
getTop()
,setTop(Node)
-
getTop
public final Node getTop()
Returns the value of the top node property.- Returns:
- the top node property value
-
setTop
public final void setTop(Node top)
Sets the value of the top node property.- Parameters:
top
- the top node value
-
rightProperty
public final ObjectProperty<Node> rightProperty()
Returns the value of the right node property.- Returns:
- the right node property value
-
getRight
public final Node getRight()
Returns the value of the right node property.- Returns:
- the right node property value
-
setRight
public final void setRight(Node right)
Sets the value of the right node property.- Parameters:
right
- the right node value
-
bottomProperty
public final ObjectProperty<Node> bottomProperty()
Returns the value of the bottom node property.- Returns:
- the bottom node property value
-
getBottom
public final Node getBottom()
Returns the value of the bottom node property.- Returns:
- the bottom node property value
-
setBottom
public final void setBottom(Node bottom)
Sets the value of the bottom node property.- Parameters:
bottom
- the bottom node value
-
leftProperty
public final ObjectProperty<Node> leftProperty()
Returns the value of the left node property.- Returns:
- the left node property value
-
getLeft
public final Node getLeft()
Returns the value of the left node property.- Returns:
- the left node property value
-
setLeft
public final void setLeft(Node left)
Sets the value of the left node property.- Parameters:
left
- the left node value
-
pinnedSideProperty
public final ObjectProperty<Side> pinnedSideProperty()
Returns the pinned side property. The value of this property determines if one of the four hidden sides stays visible all the time.- See Also:
getPinnedSide()
,setPinnedSide(Side)
-
getPinnedSide
public final Side getPinnedSide()
Returns the value of the pinned side property.- Returns:
- the pinned side property value
-
setPinnedSide
public final void setPinnedSide(Side side)
Sets the value of the pinned side property.- Parameters:
side
- the new pinned side value
-
animationDelayProperty
public final ObjectProperty<Duration> animationDelayProperty()
Returns the animation delay property. The value of this property determines the delay before the hidden side slide in / slide out animation starts to play.- See Also:
getAnimationDelay()
,setAnimationDelay(Duration)
-
getAnimationDelay
public final Duration getAnimationDelay()
Returns the animation delay- Returns:
- animation delay
-
setAnimationDelay
public final void setAnimationDelay(Duration duration)
Set the animation delay- Parameters:
duration
- slide in animation delay
-
animationDurationProperty
public final ObjectProperty<Duration> animationDurationProperty()
Returns the animation duration property. The value of this property determines the fade in time for a hidden side to become visible.
-
getAnimationDuration
public final Duration getAnimationDuration()
Returns the animation delay- Returns:
- animation delay
-
setAnimationDuration
public final void setAnimationDuration(Duration duration)
Set the animation delay- Parameters:
duration
- animation duration
-
show
public void show(Side side)
Shows a specific side- Parameters:
side
- the side to show
-
hide
public void hide()
Hides the currently showing side
-
getUserAgentStylesheet
protected final String getUserAgentStylesheet(Class<?> clazz, String fileName)
A helper method that ensures that the resource based lookup of the user agent stylesheet only happens once. Caches the external form of the resource.- Parameters:
clazz
- the class used for the resource lookupfileName
- the name of the user agent stylesheet- Returns:
- the external form of the user agent stylesheet (the path)
-
-