SingleContainer

open class SingleContainer(initialNode: Node? = null) : Region, WithContent

A container with one child, determined by contentProperty.

It may not be obvious at first, why this is so useful. If part of your scene-graph is dynamic, and changes whenever a property (or more than one property) changes, then consider using a SingleContainer, and binding its contentProperty to :

For more than 3 dependencies, you could add additional dependencies to OptionalNodeTernaryFunction using LazyObservableValue.addDependent.

For examples of SingleContainer look at the source code for TabPane, NodeInspector or DemoChoices.

Inheritors

Constructors

Link copied to clipboard
constructor(contentProperty: ObservableOptionalNode)
constructor(initialNode: Node? = null)

Properties

Link copied to clipboard
Link copied to clipboard

If this Node has more space

Link copied to clipboard
Link copied to clipboard

When true, visibleProperty is bound to content's visibleProperty. and when the content is null, visibleProperty is set to false.

Link copied to clipboard

The base class Node has no children, so this is an empty list.

Link copied to clipboard
override var content: Node?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

If true, then the height of content is the full extent of the container. (minus border and padding). Otherwise, the content is allocated at most its prefHeight, and is positioned according to alignment.

Link copied to clipboard
Link copied to clipboard

If true, then the width of content is the full height of the container (minus border and padding). Otherwise, the content is allocated at most its prefWidth, and is positioned according to alignment.

Functions

Link copied to clipboard
open override fun nodeMinHeight(): Float

Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinHeight. The default implementation returns 0.

Link copied to clipboard
open override fun nodeMinWidth(): Float

Each subclass of node can determine the minimum width it requires. This can be overridden on an ad-hoc basis using overrideMinWidth. The default implementation returns 0.

Link copied to clipboard
open override fun nodePrefHeight(): Float

Each subclass of node can determine its preferred height. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.

Link copied to clipboard
open override fun nodePrefWidth(): Float

Each subclass of node can determine its preferred width. As most nodes are composed of smaller nodes, this is typically calculated using evalPrefWidth of the child nodes, with extra added for spacing, padding and borders.

Link copied to clipboard
open override fun toString(): String