I haven't been doing much programming for a while, but I have a small project to do in B4j and wanted a dockable interface. I came across this
https://github.com/RobertBColton/DockFX which appears to do what I want.
To test it I recreated the example app (java code here :
https://github.com/RobertBColton/DockFX/blob/master/src/main/java/org/dockfx/demo/DockFX.java )
The B4j project is attached. The library hasn't been updated for a while, but I think I can use it as is, so I thought I would share it in case anybody else wanted to.
Download the zipped jar file (
dockfx-0.1b.zip ) from here :
https://github.com/RobertBColton/DockFX/releases , unzip it and copy to your additional libraries folder.
For documentation, I'm afraid you'll have to read the java code available on github.
It's LGPL3 licensed, make sure it's appropriate for your project.
Requires JavaObject and Reflection libraries, see the Test app code for explanations.
06 Jan 2017 : Added jDockFXCV - Custom View version see
Post7
06 Jan 2017 : Added more methods, including return underlying Node as Pane (if it is one) to load layouts on. Pass Null to the Initialization and a Pane will be created in the Class.
Spoiler: DockPane Documentation
jDockFX
Library:
jDockFX
Author: Steve Laming
Version: 0.03
Depends on:
javaobject, jreflection, dockfx-0.1b
Class:
DockPane
Class Description:
The parent on which DockNodes can be Docked[/I]
Methods:
AsJO As JavaObject
Get the underlying object as a JavaObject
AsNode As Node
Get the underlying object as a Node
DesignerCreateView (Base As Pane , Lbl As Label , Props As Map ) As String
Called from the designer on creation
GetBase As Pane
Get the BasePane for this CustomView
Initialize (vCallback As Object , vEventName As String ) As String
Called from the designer on initialization
IsInitialized As Boolean
Tests whether the object has been initialized.
NodeCount As Int
Returns the number of DockNodes attached to this DockPane
SetDefaultUserAgentStylesheet As String
Initialize the default styles For the dock pane And undocked nodes using the DockFX
library's internal Default.css stylesheet
unlike other custom control libraries this allows the user To override them globally
using the style manager just As they can with internal JavaFX controls
this must be called after the primary stage Is shown
https://bugs.openjdk.java.net/browse/JDK-8132900
SplitPane As SplitPane
Gets the underlying SplitPane for this DockPane
Spoiler: DockNode Documentation
jDockFX
Library:
jDockFX
Author: Steve Laming
Version: 0.03
Depends on:
javaobject, jreflection, dockfx-0.1b
Class:
DockNode
Class Description:
DockNode class represents a dockable Node which can be added to a DockPane[/I]
Properties:
Closable (Value As Boolean ) As Boolean
Get / Set the closable property for this DockNode
Contents (Value As Node ) As Node
Get / Set (replace) the current Content Node
DockTitleBar (Value As Node ) As Node
Get/Set the titlebar for this Dock, set it to Null to disable docking and undocking
Pane As Pane - [Read Only]
Returns the underlying Node as a Pane (if it is one Null if not). You can add nodes or load a layout to this.
Tag (Value As Object ) As Object
Get / Set the Tag Object for this DockNode
Methods:
Dock (Parent As DockPane , Location As String ) As DockNode
Dock this node to a parent.
Parent a DockPane
Location one of "CENTER", "TOP", "BOTTOM", "LEFT" or "RIGHT"
Graphic (FilePath As String , FileName As String ) As DockNode
Set a Graphic for this DockNode. Returns this DockNode
Initialize (Module As Object , EventName As String , Title As String , Node As Node ) As DockNode
Initializes the object.
Module - for callback
EventName - for callback
Title - the title for the DockNode
Node - the content of this DockNode, Pass Null if you want to load a layout later
Returns this DockNode
IsDocked As Boolean
Get the current Docked Status of this DockNode
IsInitialized As Boolean
Tests whether the object has been initialized.
PrefSize (Width As Double , Height As Double ) As DockNode
Set the pref size for this DockNode. Returns this DockNode
RemoveDockTitleBar (Archive As Boolean ) As DockNode
Remove the DockTitleBar (Disables undocking / Docking) and optionally archive it so we can restore it later
RestoreDockTitleBar As DockNode
Restore an archived DockTitleBar