Class DockingPane
java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.Control
com.dlsc.gemsfx.docking.DockingPane
- All Implemented Interfaces:
javafx.css.Styleable, javafx.event.EventTarget, javafx.scene.control.Skinnable
public class DockingPane
extends javafx.scene.control.Control
Control associated with exactly one
DockingContext. It owns one pane tree and renders each dockable as a
title tab with a close affordance; only the selected tab's content is displayed.
Hold Shift when starting a tab drag to move its entire tab group, preserving tab order and selection.
Shift-double-click a tab or its strip to maximize or restore its group within this pane.
The tab group containing the active dockable has the active pseudo-class.
Internal floating groups are displayed above this pane's regular layout, including a maximized
group. Drag their headers to move them and their borders or corners to resize them. Entering or
leaving internal floating mode is controlled through the context's API.-
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.ReadOnlyObjectProperty<Dockable> The currently active dockable of this pane, ornull.final javafx.beans.property.ReadOnlyObjectProperty<List<DockingFloatingGroup>> Immutable snapshots of the internal floating groups, ordered back to front.final javafx.beans.property.ReadOnlyObjectProperty<DockingLayoutNode> An immutable snapshot of this pane's regular split/tab layout, excludinginternal floating groups.final javafx.beans.property.ReadOnlyObjectProperty<Dockable> The selected dockable in the maximized tab group, ornullwhen no group is maximized.final javafx.beans.property.ObjectProperty<javafx.scene.Node> The node displayed in the center of this pane when it contains no dockables.Properties inherited from class javafx.scene.control.Control
contextMenu, skin, tooltipProperties 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 -
Field Summary
Fields 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
ConstructorsModifierConstructorDescriptionprotectedDockingPane(DockingContext dockingContext) Creates a pane belonging to the supplied context. -
Method Summary
Modifier and TypeMethodDescriptionfinal javafx.beans.property.ReadOnlyObjectProperty<Dockable> The currently active dockable of this pane, ornull.final booleancanMoveDockable(String draggedId, String targetId, DockingPosition position) Tests whether the specified dockable can be moved relative to a target dockable.final booleancanMoveDockableToPaneEdge(String id, DockingPosition edge) Tests whether a dockable can be placed beside this pane's entire layout.protected javafx.scene.control.Skin<?> final javafx.beans.property.ReadOnlyObjectProperty<List<DockingFloatingGroup>> Immutable snapshots of the internal floating groups, ordered back to front.final DockableGets the value of theactiveDockableproperty.Returns an immutable snapshot of the dockables currently contained in this pane.final DockingContextReturns the context this pane belongs to.final List<DockingFloatingGroup> Gets the value of thefloatingGroupsproperty.final DockingLayoutNodeGets the value of thelayoutRootproperty.final DockableGets the value of themaximizedDockableproperty.final javafx.scene.NodeGets the value of theplaceholderproperty.final booleanTests whether a dockable belongs to an internal floating group in this pane.final javafx.beans.property.ReadOnlyObjectProperty<DockingLayoutNode> An immutable snapshot of this pane's regular split/tab layout, excludinginternal floating groups.final javafx.beans.property.ReadOnlyObjectProperty<Dockable> The selected dockable in the maximized tab group, ornullwhen no group is maximized.final booleanmoveDockable(String id, double x, double y, double width, double height, String hoveredId) Resolves a drop target from pane-relative coordinates and moves the dockable there.final booleanmoveDockable(String draggedId, String targetId, DockingPosition position) Moves the specified dockable relative to a target dockable.final booleanmoveDockableToPaneEdge(String id, DockingPosition edge) Places a dockable beside this pane's entire layout, rather than beside one tab group.final javafx.beans.property.ObjectProperty<javafx.scene.Node> The node displayed in the center of this pane when it contains no dockables.final voidselectDockable(String id) Selects the dockable with the given ID and makes it the active dockable.final voidsetMaximizedDockable(Dockable dockable) Sets the value of themaximizedDockableproperty.final voidsetPlaceholder(javafx.scene.Node placeholder) Sets the value of theplaceholderproperty.final voidupdateDividerPositions(List<Integer> path, List<Double> positions) Atomically records all divider positions of a split.final voidupdateFloatingGroupBounds(String id, javafx.geometry.Rectangle2D bounds) Updates an internal floating group's bounds and captures its nearest horizontal and vertical edges.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, tooltipPropertyMethods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, 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, widthPropertyMethods inherited from class javafx.scene.Parent
getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, 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, 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, visiblePropertyMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javafx.css.Styleable
getStyleableNode
-
Property Details
-
floatingGroups
public final javafx.beans.property.ReadOnlyObjectProperty<List<DockingFloatingGroup>> floatingGroupsPropertyImmutable snapshots of the internal floating groups, ordered back to front. Includes tab order, selection and persistent edge-relative geometry.- See Also:
-
placeholder
public final javafx.beans.property.ObjectProperty<javafx.scene.Node> placeholderPropertyThe node displayed in the center of this pane when it contains no dockables. The default is aDockingPanePlaceholderwith a theme-aware vector illustration of a docking workspace and optional text. Set this property tonullto leave an empty pane blank.- See Also:
-
activeDockable
The currently active dockable of this pane, ornull. Clicking or focusing a dockable's content or tab makes it active. When a dockable becomes active, focus moves to the first focusable node of its content, or to its tab if the content has no focusable node, even if the focus was outside this pane.- See Also:
-
maximizedDockable
The selected dockable in the maximized tab group, ornullwhen no group is maximized. Maximization is temporary and is not included in layout snapshots. UsesetMaximizedDockable(Dockable)to maximize a dockable belonging to this pane, or passnullto restore the normal layout. While a group is maximized, docking moves into, out of, or within this pane, external docking drops, and internal or window floating are rejected. Tab selection, closing, and restoring the normal layout remain available.- See Also:
-
layoutRoot
An immutable snapshot of this pane's regular split/tab layout, excludinginternal floating groups. A new snapshot is published on every structural or selection change to that layout, so observers must not rely on node identity.- See Also:
-
-
Constructor Details
-
DockingPane
Creates a pane belonging to the supplied context. Applications should create panes via the context's pane factory andDockingContext.createPane().- Parameters:
dockingContext- the owning context
-
-
Method Details
-
floatingGroupsProperty
public final javafx.beans.property.ReadOnlyObjectProperty<List<DockingFloatingGroup>> floatingGroupsProperty()Immutable snapshots of the internal floating groups, ordered back to front. Includes tab order, selection and persistent edge-relative geometry.- Returns:
- the floating groups property
- See Also:
-
getFloatingGroups
Gets the value of thefloatingGroupsproperty.- Property description:
- Immutable snapshots of the internal floating groups, ordered back to front. Includes tab order, selection and persistent edge-relative geometry.
- Returns:
- the value of the
floatingGroupsproperty - See Also:
-
isDockableFloating
Tests whether a dockable belongs to an internal floating group in this pane. This does not indicate whether the pane itself is hosted in a floating window.- Parameters:
id- the dockable ID- Returns:
trueif internally floating in this pane, orfalseif docked or not present
-
updateFloatingGroupBounds
Updates an internal floating group's bounds and captures its nearest horizontal and vertical edges. Coordinates are relative to this pane's content area, excluding padding.- Parameters:
id- any dockable in the floating groupbounds- the requested bounds, with finite coordinates and positive dimensions- Throws:
IllegalArgumentException- if the dockable is not internally floating in this pane
-
getUserAgentStylesheet
- Overrides:
getUserAgentStylesheetin classjavafx.scene.layout.Region
-
createDefaultSkin
protected javafx.scene.control.Skin<?> createDefaultSkin()- Overrides:
createDefaultSkinin classjavafx.scene.control.Control
-
getDockingContext
Returns the context this pane belongs to.- Returns:
- the docking context
-
placeholderProperty
public final javafx.beans.property.ObjectProperty<javafx.scene.Node> placeholderProperty()The node displayed in the center of this pane when it contains no dockables. The default is aDockingPanePlaceholderwith a theme-aware vector illustration of a docking workspace and optional text. Set this property tonullto leave an empty pane blank.- Returns:
- the placeholder property
- See Also:
-
getPlaceholder
public final javafx.scene.Node getPlaceholder()Gets the value of theplaceholderproperty.- Property description:
- The node displayed in the center of this pane when it contains no dockables.
The default is a
DockingPanePlaceholderwith a theme-aware vector illustration of a docking workspace and optional text. Set this property tonullto leave an empty pane blank. - Returns:
- the value of the
placeholderproperty - See Also:
-
setPlaceholder
public final void setPlaceholder(javafx.scene.Node placeholder) Sets the value of theplaceholderproperty.- Property description:
- The node displayed in the center of this pane when it contains no dockables.
The default is a
DockingPanePlaceholderwith a theme-aware vector illustration of a docking workspace and optional text. Set this property tonullto leave an empty pane blank. - Parameters:
placeholder- the value for theplaceholderproperty- See Also:
-
activeDockableProperty
The currently active dockable of this pane, ornull. Clicking or focusing a dockable's content or tab makes it active. When a dockable becomes active, focus moves to the first focusable node of its content, or to its tab if the content has no focusable node, even if the focus was outside this pane.- Returns:
- the active dockable property
- See Also:
-
getActiveDockable
Gets the value of theactiveDockableproperty.- Property description:
- The currently active dockable of this pane, or
null. Clicking or focusing a dockable's content or tab makes it active. When a dockable becomes active, focus moves to the first focusable node of its content, or to its tab if the content has no focusable node, even if the focus was outside this pane. - Returns:
- the value of the
activeDockableproperty - See Also:
-
maximizedDockableProperty
The selected dockable in the maximized tab group, ornullwhen no group is maximized. Maximization is temporary and is not included in layout snapshots. UsesetMaximizedDockable(Dockable)to maximize a dockable belonging to this pane, or passnullto restore the normal layout. While a group is maximized, docking moves into, out of, or within this pane, external docking drops, and internal or window floating are rejected. Tab selection, closing, and restoring the normal layout remain available.- Returns:
- the maximized dockable property
- See Also:
-
getMaximizedDockable
Gets the value of themaximizedDockableproperty.- Property description:
- The selected dockable in the maximized tab group, or
nullwhen no group is maximized. Maximization is temporary and is not included in layout snapshots. UsesetMaximizedDockable(Dockable)to maximize a dockable belonging to this pane, or passnullto restore the normal layout. While a group is maximized, docking moves into, out of, or within this pane, external docking drops, and internal or window floating are rejected. Tab selection, closing, and restoring the normal layout remain available. - Returns:
- the value of the
maximizedDockableproperty - See Also:
-
setMaximizedDockable
Sets the value of themaximizedDockableproperty.- Property description:
- The selected dockable in the maximized tab group, or
nullwhen no group is maximized. Maximization is temporary and is not included in layout snapshots. UsesetMaximizedDockable(Dockable)to maximize a dockable belonging to this pane, or passnullto restore the normal layout. While a group is maximized, docking moves into, out of, or within this pane, external docking drops, and internal or window floating are rejected. Tab selection, closing, and restoring the normal layout remain available. - Parameters:
dockable- the value for themaximizedDockableproperty- See Also:
-
layoutRootProperty
An immutable snapshot of this pane's regular split/tab layout, excludinginternal floating groups. A new snapshot is published on every structural or selection change to that layout, so observers must not rely on node identity.- Returns:
- the layout root property
- See Also:
-
getLayoutRoot
Gets the value of thelayoutRootproperty.- Property description:
- An immutable snapshot of this pane's regular split/tab layout, excluding
internal floating groups. A new snapshot is published on every structural or selection change to that layout, so observers must not rely on node identity. - Returns:
- the value of the
layoutRootproperty - See Also:
-
selectDockable
Selects the dockable with the given ID and makes it the active dockable.- Parameters:
id- the dockable ID- Throws:
IllegalArgumentException- if the dockable is not part of this pane
-
updateDividerPositions
Atomically records all divider positions of a split. Observers oflayoutRootProperty()are notified with one new snapshot after the entire vector has been validated.- Parameters:
path- ordered child indices leading from the layout root to the splitpositions- one fewer positions than children, finite and nondecreasing within [0, 1]- Throws:
IllegalArgumentException- if the path or positions are invalid
-
canMoveDockable
Tests whether the specified dockable can be moved relative to a target dockable.- Parameters:
draggedId- the ID of the dockable to movetargetId- the ID of the target dockableposition- the target position- Returns:
trueif the move is valid
-
moveDockable
Moves the specified dockable relative to a target dockable.- Parameters:
draggedId- the ID of the dockable to movetargetId- the ID of the target dockableposition- the target position- Returns:
trueif the move was completed
-
canMoveDockableToPaneEdge
Tests whether a dockable can be placed beside this pane's entire layout.- Parameters:
id- the ID of an open dockable in this contextedge- the outer edge: LEFT, RIGHT, TOP, or BOTTOM- Returns:
trueif the move is valid;falsefor an invalid edge or a lone tab in this pane
-
moveDockableToPaneEdge
Places a dockable beside this pane's entire layout, rather than beside one tab group. The dockable is removed from its source before the remaining layout is wrapped in a new split.- Parameters:
id- the ID of an open dockable in this contextedge- the outer edge: LEFT, RIGHT, TOP, or BOTTOM- Returns:
trueif the move completed;falseif it was invalid
-
moveDockable
public final boolean moveDockable(String id, double x, double y, double width, double height, String hoveredId) Resolves a drop target from pane-relative coordinates and moves the dockable there.- Parameters:
id- the ID of the dockable to movex- horizontal drop coordinate within this paney- vertical drop coordinate within this panewidth- width used to resolve the target zoneheight- height used to resolve the target zonehoveredId- ID of the title under the pointer, ornull- Returns:
trueif a valid target was resolved and the move completed
-
getDockables
-