java.lang.Object
org.snapfx.model.DockNode
- All Implemented Interfaces:
DockElement
Wrapper class for a dockable JavaFX node.
Encapsulates a JavaFX Node with metadata such as title and ID.
Uses two types of IDs:
- dockNodeId: Type-based identifier used by the factory to create nodes (e.g., "editor", "console")
- layoutId: Unique identifier for this specific instance in the layout (managed by framework)
-
Property Summary
PropertiesTypePropertyDescriptionjavafx.beans.property.BooleanPropertyReturns the observable closeable property.javafx.beans.property.ObjectProperty<javafx.scene.Node> Returns the observable content property.javafx.beans.property.ObjectProperty<javafx.scene.image.Image> Returns the observable icon property.javafx.beans.property.StringPropertyReturns the observable title property. -
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines where a hidden node should be restored. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.beans.property.BooleanPropertyReturns the observable closeable property.javafx.beans.property.ObjectProperty<javafx.scene.Node> Returns the observable content property.javafx.scene.NodeGets the value of thecontentproperty.Returns the type-based dockNodeId used by the factory.Returns where this hidden node should be restored.javafx.scene.image.ImagegetIcon()Gets the value of theiconproperty.getId()Returns the unique layout ID for this node instance.Returns the last known floating always-on-top state for this node.Returns the remembered floating height.Returns the remembered floating width.Returns the remembered floating x-position.Returns the remembered floating y-position.Returns the remembered restore dock position.Returns the remembered tab index for center/tab restores.Returns the remembered restore target element used for hidden/sidebar/floating restore flows.Returns the parent container, ornullif this is the root.getTitle()Gets the value of thetitleproperty.javafx.beans.property.ObjectProperty<javafx.scene.image.Image> Returns the observable icon property.booleanGets the value of thecloseableproperty.voidsetCloseable(boolean closeable) Sets the value of thecloseableproperty.voidsetContent(javafx.scene.Node content) Sets the value of thecontentproperty.voidsetHiddenRestoreTarget(DockNode.HiddenRestoreTarget hiddenRestoreTarget) Sets where this hidden node should be restored.voidsetIcon(javafx.scene.image.Image icon) Sets the value of theiconproperty.voidsetLastFloatingAlwaysOnTop(Boolean lastFloatingAlwaysOnTop) Sets the last known floating always-on-top state for this node.voidsetLastFloatingHeight(Double lastFloatingHeight) Sets the remembered floating height.voidsetLastFloatingWidth(Double lastFloatingWidth) Sets the remembered floating width.voidsetLastFloatingX(Double lastFloatingX) Sets the remembered floating x-position.voidsetLastFloatingY(Double lastFloatingY) Sets the remembered floating y-position.voidsetLastKnownPosition(DockPosition lastKnownPosition) Sets the remembered restore dock position.voidsetLastKnownTabIndex(Integer lastKnownTabIndex) Sets the remembered tab index for center/tab restores.voidsetLastKnownTarget(DockElement lastKnownTarget) Sets the remembered restore target element.voidsetLayoutId(String layoutId) Sets the unique layout ID for this node instance.voidsetParent(DockContainer parent) Sets the parent container.voidSets the value of thetitleproperty.javafx.beans.property.StringPropertyReturns the observable title property.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.snapfx.model.DockElement
removeFromParent
-
Property Details
-
title
public javafx.beans.property.StringProperty titlePropertyReturns the observable title property.- See Also:
-
content
public javafx.beans.property.ObjectProperty<javafx.scene.Node> contentPropertyReturns the observable content property.- See Also:
-
icon
public javafx.beans.property.ObjectProperty<javafx.scene.image.Image> iconPropertyReturns the observable icon property.- See Also:
-
closeable
public javafx.beans.property.BooleanProperty closeablePropertyReturns the observable closeable property.- See Also:
-
-
Constructor Details
-
DockNode
Creates a DockNode with an auto-generated UUID as both dockNodeId and layoutId. Note: UUIDs change between sessions, making persistence unreliable. For proper save/load support, use the constructor with a custom dockNodeId.- Parameters:
content- JavaFX content nodetitle- node title
-
DockNode
Creates a DockNode with a custom dockNodeId. Use this constructor for nodes that need to be persisted across sessions. The layoutId will be auto-generated by the framework when added to the layout.- Parameters:
dockNodeId- Type-based identifier for this node (e.g., "editor", "console", "projectExplorer")content- The JavaFX node to displaytitle- The title shown in headers and tabs
-
-
Method Details
-
getId
Returns the unique layout ID for this node instance. This ID is used for positioning in the layout structure. It is automatically generated by the framework when the node is added to a layout.- Specified by:
getIdin interfaceDockElement- Returns:
- unique layout element ID
-
getDockNodeId
Returns the type-based dockNodeId used by the factory. This ID identifies the type of node (e.g., "editor", "console").- Returns:
- type-based dock-node ID
-
setLayoutId
Sets the unique layout ID for this node instance. This is called by the framework when the node is added to a layout.- Parameters:
layoutId- unique layout instance ID
-
getTitle
Gets the value of thetitleproperty.- Property description:
- Returns the observable title property.
- Returns:
- the value of the
titleproperty - See Also:
-
titleProperty
public javafx.beans.property.StringProperty titleProperty()Returns the observable title property.- Returns:
- title property
- See Also:
-
setTitle
Sets the value of thetitleproperty.- Property description:
- Returns the observable title property.
- Parameters:
title- the value for thetitleproperty- See Also:
-
getContent
public javafx.scene.Node getContent()Gets the value of thecontentproperty.- Property description:
- Returns the observable content property.
- Returns:
- the value of the
contentproperty - See Also:
-
contentProperty
public javafx.beans.property.ObjectProperty<javafx.scene.Node> contentProperty()Returns the observable content property.- Returns:
- content property
- See Also:
-
setContent
public void setContent(javafx.scene.Node content) Sets the value of thecontentproperty.- Property description:
- Returns the observable content property.
- Parameters:
content- the value for thecontentproperty- See Also:
-
getIcon
public javafx.scene.image.Image getIcon()Gets the value of theiconproperty.- Property description:
- Returns the observable icon property.
- Returns:
- the value of the
iconproperty - See Also:
-
iconProperty
public javafx.beans.property.ObjectProperty<javafx.scene.image.Image> iconProperty()Returns the observable icon property.- Returns:
- icon property
- See Also:
-
setIcon
public void setIcon(javafx.scene.image.Image icon) Sets the value of theiconproperty.- Property description:
- Returns the observable icon property.
- Parameters:
icon- the value for theiconproperty- See Also:
-
isCloseable
public boolean isCloseable()Gets the value of thecloseableproperty.- Property description:
- Returns the observable closeable property.
- Returns:
- the value of the
closeableproperty - See Also:
-
closeableProperty
public javafx.beans.property.BooleanProperty closeableProperty()Returns the observable closeable property.- Returns:
- closeable property
- See Also:
-
setCloseable
public void setCloseable(boolean closeable) Sets the value of thecloseableproperty.- Property description:
- Returns the observable closeable property.
- Parameters:
closeable- the value for thecloseableproperty- See Also:
-
getParent
Description copied from interface:DockElementReturns the parent container, ornullif this is the root.- Specified by:
getParentin interfaceDockElement- Returns:
- parent container or
null
-
setParent
Description copied from interface:DockElementSets the parent container.- Specified by:
setParentin interfaceDockElement- Parameters:
parent- parent container, ornullfor detached/root state
-
getLastKnownTarget
Returns the remembered restore target element used for hidden/sidebar/floating restore flows.- Returns:
- last known target element, or
null
-
setLastKnownTarget
Sets the remembered restore target element.- Parameters:
lastKnownTarget- remembered target element, ornull
-
getLastKnownPosition
Returns the remembered restore dock position.- Returns:
- last known dock position, or
null
-
setLastKnownPosition
Sets the remembered restore dock position.- Parameters:
lastKnownPosition- remembered dock position, ornull
-
getLastKnownTabIndex
Returns the remembered tab index for center/tab restores.- Returns:
- last known tab index, or
null
-
setLastKnownTabIndex
Sets the remembered tab index for center/tab restores.- Parameters:
lastKnownTabIndex- remembered tab index, ornull
-
getLastFloatingX
Returns the remembered floating x-position.- Returns:
- last known floating x-position, or
null
-
setLastFloatingX
Sets the remembered floating x-position.- Parameters:
lastFloatingX- floating x-position, ornull
-
getLastFloatingY
Returns the remembered floating y-position.- Returns:
- last known floating y-position, or
null
-
setLastFloatingY
Sets the remembered floating y-position.- Parameters:
lastFloatingY- floating y-position, ornull
-
getLastFloatingWidth
Returns the remembered floating width.- Returns:
- last known floating width, or
null
-
setLastFloatingWidth
Sets the remembered floating width.- Parameters:
lastFloatingWidth- floating width, ornull
-
getLastFloatingHeight
Returns the remembered floating height.- Returns:
- last known floating height, or
null
-
setLastFloatingHeight
Sets the remembered floating height.- Parameters:
lastFloatingHeight- floating height, ornull
-
getLastFloatingAlwaysOnTop
Returns the last known floating always-on-top state for this node.- Returns:
- last known always-on-top state, or
null
-
setLastFloatingAlwaysOnTop
Sets the last known floating always-on-top state for this node.- Parameters:
lastFloatingAlwaysOnTop- remembered always-on-top state, ornull
-
getHiddenRestoreTarget
Returns where this hidden node should be restored.- Returns:
- hidden restore target
-
setHiddenRestoreTarget
Sets where this hidden node should be restored.- Parameters:
hiddenRestoreTarget- hidden restore target, defaults toDockNode.HiddenRestoreTarget.DOCKEDwhennull
-
toString
-