Package pamViewFX.fxNodes.hidingPane
Class HidingPane
java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.layout.Pane
javafx.scene.layout.StackPane
pamViewFX.fxNodes.hidingPane.HidingPane
- All Implemented Interfaces:
javafx.css.Styleable
,javafx.event.EventTarget
public class HidingPane
extends javafx.scene.layout.StackPane
Hiding pane which can be added to any node.
A hiding pane can either be overlaid in which case it appears over the parent node or it can push the parent node out of the way. Panes can be orientated to appear from the LEFT, RIGHT, TOP or BOTTOM.
- Author:
- Jamie Macaulay
-
Property Summary
TypePropertyDescriptionjavafx.beans.property.BooleanProperty
The showing property for the hiding pane.Properties inherited from class javafx.scene.layout.StackPane
alignment
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, focusVisible, focusWithin, 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
ConstructorDescriptionHidingPane
(javafx.geometry.Side side, javafx.scene.layout.Region hidePane, javafx.scene.layout.Pane holderPane, boolean overlay) Constructor top create a new hiding pane.HidingPane
(javafx.geometry.Side side, javafx.scene.layout.Region hidePane, javafx.scene.layout.Pane holderPane, boolean overlay, double offset) Constructor top create a new hiding pane. -
Method Summary
Modifier and TypeMethodDescriptionstatic javafx.animation.Timeline
createAnimation
(javafx.beans.property.DoubleProperty paneTanslateProperty, double newSize, long duration) Create a time line to show or hide a pane.long
Get the duration in milliseconds of the slide animation.Get the button which hides the pane.javafx.scene.layout.Pane
Get the pane which contains this hiding pane.Get the button which shows the hide pane.double
Get the opacity of the show button when the mouse is outside the button.javafx.animation.Timeline
Get the timeline which closes the hiding panejavafx.animation.Timeline
Get the timeline which opens hiding tab pane.void
Called whenever the hid animation has finished.boolean
boolean
Check whether the hiding pane is showing.boolean
Check whether the hide pane shows content at the start of the hide animation or end.void
Remove the hide button from the hiding pane.void
void
setDuration
(long duration) Set the duration of the slide animation.void
setHideButtonPos
(javafx.geometry.Side side) Set the position of the hiding button.void
setPrefSize
(double prefWidth, double prefHeight) If the preferred size is set for the hiding pane then the expanded size, the animation, the show button binding property and position of the pane must be reset.void
setShowButton
(PamButton showButton) void
setShowButtonOpacity
(double showButtonOpacity) Set the opacity of the show button when the mouse is outside.void
setVisibleImmediatly
(boolean visibleImmediatly) Set whether the hide pane shows content at the start of the hide animation or end.void
Called whenever the show animation has finished.void
showHidePane
(boolean show) Show or hide the pane.void
showHidePane
(boolean show, boolean animate) Show the hide panejavafx.beans.property.BooleanProperty
The showing property for the hiding pane.void
styleHideButton
(PamButton button) Style the button to have an image of arrow.void
styleHideButton
(PamButton button, javafx.geometry.Side side) Style the button to have an image of arrow.void
translatePanel
(double distance) Move the hiding panel to show or hide a certain distance.Methods inherited from class javafx.scene.layout.StackPane
alignmentProperty, clearConstraints, getAlignment, getAlignment, getClassCssMetaData, getContentBias, getCssMetaData, getMargin, requestLayout, setAlignment, setAlignment, setMargin
Methods inherited from class javafx.scene.layout.Pane
getChildren
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, isResizable, isScaleShape, isSnapToPixel, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefWidth, setScaleShape, setShape, setSnapToPixel, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPositionX, snapPositionY, snapSizeX, snapSizeY, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
Methods inherited from class javafx.scene.Parent
getBaselineOffset, getChildrenUnmodifiable, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute
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, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, 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, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, 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, setEffect, setEventDispatcher, setFocusTraversable, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
showing
public javafx.beans.property.BooleanProperty showingPropertyThe showing property for the hiding pane.- See Also:
-
-
Constructor Details
-
HidingPane
public HidingPane(javafx.geometry.Side side, javafx.scene.layout.Region hidePane, javafx.scene.layout.Pane holderPane, boolean overlay, double offset) Constructor top create a new hiding pane.- Parameters:
side
- - the side the hiding pane appears from.hidePane
- - content for hiding pane.holderPane
- - the pane holding the hiding pane.overlay
- - whether the pane is overlaid or not. Overlaid means the pane appears over the node rather than pushing it to one side.offset
- - set the offset.
-
HidingPane
public HidingPane(javafx.geometry.Side side, javafx.scene.layout.Region hidePane, javafx.scene.layout.Pane holderPane, boolean overlay) Constructor top create a new hiding pane.- Parameters:
side
- - the side the hiding pane appears from.hidePane
- - content for hiding pane.holderPane
- - the pane holding the hiding pane.overlay
- - whether the pane is overlaid or not. Overlaid means the pane appears over the node rather than pushing it to one side.
-
-
Method Details
-
setShowButton
-
isHorizontal
public boolean isHorizontal() -
resetHideAnimation
public void resetHideAnimation() -
styleHideButton
Style the button to have an image of arrow.- Parameters:
button
- -button to style
-
styleHideButton
Style the button to have an image of arrow.- Parameters:
button
- -button to styleside
- - the side the button should be styled for.
-
setPrefSize
public void setPrefSize(double prefWidth, double prefHeight) If the preferred size is set for the hiding pane then the expanded size, the animation, the show button binding property and position of the pane must be reset.- Overrides:
setPrefSize
in classjavafx.scene.layout.Region
-
setHideButtonPos
public void setHideButtonPos(javafx.geometry.Side side) Set the position of the hiding button. This will depend on the Side property of the panel.- Parameters:
side
- - hiding pane side.
-
removeHideButton
public void removeHideButton()Remove the hide button from the hiding pane. For example, used if the pane is non user controllable. -
createAnimation
public static javafx.animation.Timeline createAnimation(javafx.beans.property.DoubleProperty paneTanslateProperty, double newSize, long duration) Create a time line to show or hide a pane.- Parameters:
paneTanslateProperty
- -the translate property e.g. whether to change the preferred height/width, max height/width etc.newSize
- - the new size of the propertyduration
- - the duration of the animation in millis- Returns:
- the time line for the animation
-
hideFinished
public void hideFinished()Called whenever the hid animation has finished. -
showFinished
public void showFinished()Called whenever the show animation has finished. -
translatePanel
public void translatePanel(double distance) Move the hiding panel to show or hide a certain distance.- Parameters:
distance
- . The distance in pixels to move the panel. Positive to open the panel and negative to move the panel towards closed.
-
showHidePane
public void showHidePane(boolean show) Show or hide the pane.- Parameters:
showing
- -
-
showHidePane
public void showHidePane(boolean show, boolean animate) Show the hide pane- Parameters:
show
- - tru to opne the pane. False to close the pnaeanimate
- - true to show and animation and false to show no animation.
-
getHideButton
Get the button which hides the pane.- Returns:
- the button which hides the pane.
-
getShowButton
Get the button which shows the hide pane. This is generally not on the pane itself but needs to be added to another pane.- Returns:
- the button which shows the pane.
-
getDuration
public long getDuration()Get the duration in milliseconds of the slide animation.- Returns:
- the slide animation duration in milliseconds.
-
setDuration
public void setDuration(long duration) Set the duration of the slide animation. (The animation which occurs when the panel is shown/hidden)- Parameters:
duration
- - duration of the slide animation in milliseconds.
-
getHolderPane
public javafx.scene.layout.Pane getHolderPane()Get the pane which contains this hiding pane.- Returns:
- the pane the hiding pane is located in.
-
getTimeLineShow
public javafx.animation.Timeline getTimeLineShow()Get the timeline which opens hiding tab pane.- Returns:
- TimelIne which opens the hiding pane.
-
getTimeLineHide
public javafx.animation.Timeline getTimeLineHide()Get the timeline which closes the hiding pane- Returns:
- TimeLine which closes the hiding pane.
-
isVisibleImmediatly
public boolean isVisibleImmediatly()Check whether the hide pane shows content at the start of the hide animation or end.- Returns:
- true if shows the pane at the start of the animation.
-
setVisibleImmediatly
public void setVisibleImmediatly(boolean visibleImmediatly) Set whether the hide pane shows content at the start of the hide animation or end.- Parameters:
true
- if shows the pane at the start of the animation.
-
showingProperty
public javafx.beans.property.BooleanProperty showingProperty()The showing property for the hiding pane.- Returns:
- the showing property
-
isShowing
public boolean isShowing()Check whether the hiding pane is showing.- Returns:
- true if showing.
-
getShowButtonOpacity
public double getShowButtonOpacity()Get the opacity of the show button when the mouse is outside the button.- Returns:
- the opacity of the show button.
-
setShowButtonOpacity
public void setShowButtonOpacity(double showButtonOpacity) Set the opacity of the show button when the mouse is outside.
-