Dock

abstract class Dock(val dockID: String, val harbour: Harbour) : Region

Docks are panels at the edges of a stage, which can be contracted to save screen real-estate, then shown again with a press of a button.

A Dock is part of a Harbour. Each Dock can be placed on any of the four sides, and each side has a Primary and Secondary group of docks. Only 1 dock within each group can be visible at any time. Expanding a dock will contract the previously visible dock (if there is one).

You can hide/show a dock programmatically using the visible property. Docks can be hidden/shown via a toggle button, which is part of the HarbourSide, not part of the Dock itself.

When a dock is hidden, it is removed from the scene-graph (i.e. Dock.scene == null and Dock.parent == null).

Theme DSL

"dock" {
    child( ".container" ) { // A BorderPane

        child( ".title_bar" ) {
            child( ".container" ) {

                child( ".hide" ) { // The 'Hide' Button (the default theme sets the graphic to a horizontal bar)
                }
            }
        }
    }
}

Inheritors

Constructors

Link copied to clipboard
constructor(dockID: String, harbour: Harbour)

Properties

Link copied to clipboard

Which sides of the harbour this Dock can be moved to by the user.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Set this to false to prevent the user closing this Dock. Closing the Dock programmatically is not affected by this.

Link copied to clipboard
open override val children: ObservableList<Node>
Link copied to clipboard
Link copied to clipboard

The main content of the Dock.

Link copied to clipboard
Link copied to clipboard

Each side of the Harbour has two sets of Docks, primary or secondary. This decides if this Dock is placed in the primary set if not explicitly specified. See Harbour.add

Link copied to clipboard
Link copied to clipboard

Determines which side of the Harbour this Dock will be placed if not explicitly specified. See Harbour.add.

Link copied to clipboard

A Unique identifier. Used when loading/saving the meta-data.

Link copied to clipboard
Link copied to clipboard
var icon: Image?
Link copied to clipboard

An optional icon, which is displayed to the left of the title in the ToggleButtons at the side of the Harbour as well as in the title-bar of the dock.

Link copied to clipboard
Link copied to clipboard

Optional text which is appended (with a space) to the title in the ToggleButtons at the side of the Harbour. These can be used a visual hints for a shortcut, which makes this Dock visible.

Link copied to clipboard

Is this dock in the primary or secondary set of docks? If this Dock is not within a Harbour (yet), then this value is meaningless.

Link copied to clipboard
var side: Side

The side of the Harbour that this dock occupies. If this Dock is not within a Harbour (yet), then this value is meaningless.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Buttons (or other Nodes), which appear in the title-bar of this Dock. Initially, this contains only a close button. If you want the close button to remain on the far right, then add items at the front of the list.

Link copied to clipboard

Appears in to ToggleButton at the side of the Harbour, as well as in the title-bar of the dock.

Functions

Link copied to clipboard
open fun close()

Removes this Dock.

Link copied to clipboard

This PopupMenu appears when the user right-clicks the Dock's ToggleButton, or the Dock's title.

Link copied to clipboard
open override fun nodeMaxHeight(): Float
Link copied to clipboard
open override fun nodeMaxWidth(): Float