Top Description Inners Fields Constructors Methods
com.dlsc.gemsfx

public Class StretchingTilePane

extends Pane
Class Inheritance
Imports
javafx.beans.property.DoubleProperty, javafx.css.CssMetaData, .Styleable, .StyleableDoubleProperty, .StyleableProperty, javafx.css.converter.SizeConverter, javafx.geometry.Orientation, javafx.scene.Node, javafx.scene.layout.Pane, .Region, java.util.ArrayList, .Collections, .List

A specialized pane that can be used to display a list of tiles (nodes) in one or more rows. The pane first calculates how many tiles fit next to each other in a row and then arranges them in a grid. The tiles are stretched to fill the entire width of each row. All tiles have the same height and width.

Note

the main difference to the standard JavaFX TilePane is that the tiles are stretched to fill the entire width of each row.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private DoubleProperty
private DoubleProperty

Constructor Summary

AccessConstructor and Description
public
StretchingTilePane()

Constructs a new tile pane with an horizontal gap of 0 and a vertical gap of 0.

public
StretchingTilePane(double
the horizontal gap between the tiles.
hgap
,
double
the vertical gap between the tiles.
vgap
)

Constructs a new tile pane with the given horizontal and vertical gap.

public
StretchingTilePane(double
the horizontal gap between the tiles.
hgap
,
double
the vertical gap between the tiles.
vgap
,
Node...
the child nodes to be added to the tile pane.
children
)

Constructs a new tile pane with the specified horizontal and vertical gaps and an optional list of child nodes.

Method Summary

Modifier and TypeMethod and Description
private double
private double
protected double
computeMinHeight(double width)

Overrides javafx.scene.layout.Region.computeMinHeight.

Computes the minimum height 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.

public static List<CssMetaData<? extends Styleable, ?>>
getClassCssMetaData()

Hides javafx.scene.layout.Region.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

public Orientation

Returns:

the content bias.
getContentBias
()

Overrides javafx.scene.Node.getContentBias.

We need the content bias to be horizontal so that the component's width will be considered for layout purposes.

public List<CssMetaData<? extends Styleable, ?>>
getCssMetaData()

Overrides javafx.scene.layout.Region.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

This method should delegate to Node#getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.

public final double
public final double
public final DoubleProperty

Returns:

the horizontal gap property.
hgapProperty
()

The horizontal gap between the tiles.

protected void
layoutChildren()

Overrides javafx.scene.Parent.layoutChildren.

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

public final void
setHgap(double value)

public final void
setVgap(double value)

public final DoubleProperty

Returns:

the vertical gap property.
vgapProperty
()

The vertical gap between the tiles.

Inherited from javafx.scene.layout.Pane:
getChildren

Field Detail

hgapback to summary
private DoubleProperty hgap
vgapback to summary
private DoubleProperty vgap

Constructor Detail

StretchingTilePaneback to summary
public StretchingTilePane()

Constructs a new tile pane with an horizontal gap of 0 and a vertical gap of 0.

StretchingTilePaneback to summary
public StretchingTilePane(double hgap, double vgap)

Constructs a new tile pane with the given horizontal and vertical gap.

Parameters
hgap:double

the horizontal gap between the tiles.

vgap:double

the vertical gap between the tiles.

StretchingTilePaneback to summary
public StretchingTilePane(double hgap, double vgap, Node... children)

Constructs a new tile pane with the specified horizontal and vertical gaps and an optional list of child nodes.

Parameters
hgap:double

the horizontal gap between the tiles.

vgap:double

the vertical gap between the tiles.

children:Node[]

the child nodes to be added to the tile pane.

Method Detail

computeMaximumPreferredTileHeightback to summary
private double computeMaximumPreferredTileHeight(double w)
computeMaximumPreferredTileWidthback to summary
private double computeMaximumPreferredTileWidth()
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
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
getClassCssMetaDataback to summary
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()

Hides javafx.scene.layout.Region.getClassCssMetaData.

Doc from javafx.scene.layout.Region.getClassCssMetaData.

Gets the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

getContentBiasback to summary
public Orientation getContentBias()

Overrides javafx.scene.Node.getContentBias.

We need the content bias to be horizontal so that the component's width will be considered for layout purposes.

Returns:Orientation

the content bias.

Annotations
@Override
getCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData()

Overrides javafx.scene.layout.Region.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

Doc from javafx.scene.layout.Region.getCssMetaData.

This method should delegate to Node#getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.

Annotations
@Override
getHgapback to summary
public final double getHgap()
getVgapback to summary
public final double getVgap()
hgapPropertyback to summary
public final DoubleProperty hgapProperty()

The horizontal gap between the tiles.

Returns:DoubleProperty

the horizontal gap property.

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
setHgapback to summary
public final void setHgap(double value)
setVgapback to summary
public final void setVgap(double value)
vgapPropertyback to summary
public final DoubleProperty vgapProperty()

The vertical gap between the tiles.

Returns:DoubleProperty

the vertical gap property.

com.dlsc.gemsfx back to summary

private Class StretchingTilePane.StyleableProperties

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final CssMetaData<StretchingTilePane, Number>
private static final List<CssMetaData<? extends Styleable, ?>>
private static final CssMetaData<StretchingTilePane, Number>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

HGAPback to summary
private static final CssMetaData<StretchingTilePane, Number> HGAP
STYLEABLESback to summary
private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES
VGAPback to summary
private static final CssMetaData<StretchingTilePane, Number> VGAP

Constructor Detail

StyleablePropertiesback to summary
private StyleableProperties()