Top Description Fields Constructors Methods
com.dlsc.gemsfx

public Class ThreeItemsPane

extends Pane
Class Inheritance
Imports
javafx.beans.InvalidationListener, javafx.beans.property.DoubleProperty, .ObjectProperty, .SimpleDoubleProperty, .SimpleObjectProperty, javafx.geometry.Insets, .Orientation, javafx.scene.Node, javafx.scene.layout.Pane, java.util.List

A custom layout container that arranges up to three child nodes in either a horizontal or vertical orientation. This pane allows spacing between the nodes and provides methods to control the alignment and orientation of the child nodes.

The container manages three possible child nodes, identified as item1, item2, and item3. The layout updates dynamically whenever the nodes or properties such as orientation or spacing are modified.

Features include: - Dynamic management of child nodes: up to three nodes can be added and arranged. - Adjustable orientation: supports horizontal and vertical alignment through the orientation property. - Customizable spacing: allows setting the spacing between child nodes.

Override methods provide computed sizes for use during layouts, including preferred, minimum, and maximum widths and heights.

Field Summary

Modifier and TypeField and Description
private Orientation
private boolean
private final ObjectProperty<Node>
private final ObjectProperty<Node>
private final ObjectProperty<Node>
private final ObjectProperty<Orientation>
private final DoubleProperty

Constructor Summary

AccessConstructor and Description
public
ThreeItemsPane()

Constructs a new instance of the ThreeItemsPane class.

Method Summary

Modifier and TypeMethod and Description
protected double
computeMaxHeight(double width)

Overrides javafx.scene.layout.Region.computeMaxHeight.

Computes the maximum height of this region.

protected double
computeMaxWidth(double height)

Overrides javafx.scene.layout.Region.computeMaxWidth.

Computes the maximum width for this region.

protected double
computeMinHeight(double width)

Overrides javafx.scene.layout.Region.computeMinHeight.

Computes the minimum height of this region.

protected double
computeMinWidth(double height)

Overrides javafx.scene.layout.Region.computeMinWidth.

Computes the minimum width of this region.

protected double
computePrefHeight(double width)

Overrides javafx.scene.layout.Region.computePrefHeight.

Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy.

protected double
computePrefWidth(double height)

Overrides javafx.scene.layout.Region.computePrefWidth.

Computes the preferred width of this region for the given height.

public Orientation

Returns:

null unless one of its children has a content bias.
getContentBias
()

Overrides javafx.scene.Node.getContentBias.

Returns the orientation of a node's resizing bias for layout purposes.

public final Node
public final Node
public final Node
public final Orientation
public final double
public final ObjectProperty<Node>

Returns:

the property object representing the first item Node
item1Property
()

Returns the property object for the first item in the ThreeItemsPane.

public final ObjectProperty<Node>

Returns:

the property object representing the second item Node
item2Property
()

Returns the property object for the second item in the ThreeItemsPane.

public final ObjectProperty<Node>

Returns:

the property object representing the first item Node
item3Property
()

Returns the property object for the third item in the ThreeItemsPane.

protected void
layoutChildren()

Overrides javafx.scene.Parent.layoutChildren.

Invoked during the layout pass to layout the children in this Parent.

private void
layoutChildrenHorizontally(Insets insets, double width, double height, Node item1, Node item2, Node item3)

private void
layoutChildrenVertically(Insets insets, double width, double height, Node item1, Node item2, Node item3)

public final ObjectProperty<Orientation>

Returns:

the orientation property
orientationProperty
()

Returns the property object for the orientation of the ThreeItemsPane.

public void
requestLayout()

Overrides javafx.scene.Parent.requestLayout.

Requests a layout pass to be performed before the next scene is rendered.

public final void
setItem1(Node item1)

public final void
setItem2(Node item2)

public final void
setItem3(Node item3)

public void
public final void
setSpacing(double spacing)

public final DoubleProperty
private void
Inherited from javafx.scene.layout.Pane:
getChildren

Field Detail

biasback to summary
private Orientation bias
biasDirtyback to summary
private boolean biasDirty
item1back to summary
private final ObjectProperty<Node> item1
item2back to summary
private final ObjectProperty<Node> item2
item3back to summary
private final ObjectProperty<Node> item3
orientationback to summary
private final ObjectProperty<Orientation> orientation
spacingback to summary
private final DoubleProperty spacing

Constructor Detail

ThreeItemsPaneback to summary
public ThreeItemsPane()

Constructs a new instance of the ThreeItemsPane class.

Method Detail

computeMaxHeightback to summary
protected double computeMaxHeight(double width)

Overrides javafx.scene.layout.Region.computeMaxHeight.

Doc from javafx.scene.layout.Region.computeMaxHeight.

Computes the maximum height of this region. Returns Double.MAX_VALUE by default. Region subclasses may override this method to return a different value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.

Annotations
@Override
computeMaxWidthback to summary
protected double computeMaxWidth(double height)

Overrides javafx.scene.layout.Region.computeMaxWidth.

Doc from javafx.scene.layout.Region.computeMaxWidth.

Computes the maximum width for this region. Returns Double.MAX_VALUE by default. Region subclasses may override this method to return an different value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.

Annotations
@Override
computeMinHeightback to summary
protected double computeMinHeight(double width)

Overrides javafx.scene.layout.Region.computeMinHeight.

Doc from javafx.scene.layout.Region.computeMinHeight.

Computes the minimum height of this region. Returns the sum of the top and bottom insets by default. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.

Annotations
@Override
computeMinWidthback to summary
protected double computeMinWidth(double height)

Overrides javafx.scene.layout.Region.computeMinWidth.

Doc from javafx.scene.layout.Region.computeMinWidth.

Computes the minimum width of this region. Returns the sum of the left and right insets by default. region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.

Annotations
@Override
computePrefHeightback to summary
protected double computePrefHeight(double width)

Overrides javafx.scene.layout.Region.computePrefHeight.

Doc from javafx.scene.layout.Region.computePrefHeight.

Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.

Annotations
@Override
computePrefWidthback to summary
protected double computePrefWidth(double height)

Overrides javafx.scene.layout.Region.computePrefWidth.

Doc from javafx.scene.layout.Region.computePrefWidth.

Computes the preferred width of this region for the given height. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.

Annotations
@Override
getContentBiasback to summary
public Orientation getContentBias()

Overrides javafx.scene.Node.getContentBias.

Doc from javafx.scene.Node.getContentBias.

Returns the orientation of a node's resizing bias for layout purposes. If the node type has no bias, returns null. If the node is resizable and it's height depends on its width, returns HORIZONTAL, else if its width depends on its height, returns VERTICAL.

Resizable subclasses should override this method to return an appropriate value.

Returns:Orientation

null unless one of its children has a content bias.

Annotations
@Override
getItem1back to summary
public final Node getItem1()
getItem2back to summary
public final Node getItem2()
getItem3back to summary
public final Node getItem3()
getOrientationback to summary
public final Orientation getOrientation()
getSpacingback to summary
public final double getSpacing()
item1Propertyback to summary
public final ObjectProperty<Node> item1Property()

Returns the property object for the first item in the ThreeItemsPane. This property represents the first Node managed by the pane.

Returns:ObjectProperty<Node>

the property object representing the first item Node

item2Propertyback to summary
public final ObjectProperty<Node> item2Property()

Returns the property object for the second item in the ThreeItemsPane. This property represents the second Node managed by the pane.

Returns:ObjectProperty<Node>

the property object representing the second item Node

item3Propertyback to summary
public final ObjectProperty<Node> item3Property()

Returns the property object for the third item in the ThreeItemsPane. This property represents the third Node managed by the pane.

Returns:ObjectProperty<Node>

the property object representing the first item Node

layoutChildrenback to summary
protected void layoutChildren()

Overrides javafx.scene.Parent.layoutChildren.

Doc from javafx.scene.Parent.layoutChildren.

Invoked during the layout pass to layout the children in this Parent. By default it will only set the size of managed, resizable content to their preferred sizes and does not do any node positioning.

Subclasses should override this function to layout content as needed.

Annotations
@Override
layoutChildrenHorizontallyback to summary
private void layoutChildrenHorizontally(Insets insets, double width, double height, Node item1, Node item2, Node item3)
layoutChildrenVerticallyback to summary
private void layoutChildrenVertically(Insets insets, double width, double height, Node item1, Node item2, Node item3)
orientationPropertyback to summary
public final ObjectProperty<Orientation> orientationProperty()

Returns the property object for the orientation of the ThreeItemsPane. This property determines whether the layout of the items is horizontal or vertical.

Returns:ObjectProperty<Orientation>

the orientation property

requestLayoutback to summary
public void requestLayout()

Overrides javafx.scene.Parent.requestLayout.

Doc from javafx.scene.Parent.requestLayout.

Requests a layout pass to be performed before the next scene is rendered. This is batched up asynchronously to happen once per "pulse", or frame of animation.

If this parent is either a layout root or unmanaged, then it will be added directly to the scene's dirty layout list, otherwise requestParentLayout will be invoked.

Annotations
@Override
setItem1back to summary
public final void setItem1(Node item1)
setItem2back to summary
public final void setItem2(Node item2)
setItem3back to summary
public final void setItem3(Node item3)
setOrientationback to summary
public void setOrientation(Orientation orientation)
setSpacingback to summary
public final void setSpacing(double spacing)
spacingPropertyback to summary
public final DoubleProperty spacingProperty()
updateChildrenback to summary
private void updateChildren()