Top Description Fields Constructors Methods
com.dlsc.gemsfx.infocenter

public Class InfoCenterPane

extends StackPane
Class Inheritance
Imports
javafx.animation.AnimationTimer, .KeyFrame, .KeyValue, .Timeline, javafx.beans.InvalidationListener, .Observable, javafx.beans.property.BooleanProperty, .DoubleProperty, .ObjectProperty, .ReadOnlyBooleanWrapper, .SimpleBooleanProperty, .SimpleDoubleProperty, .SimpleObjectProperty, javafx.event.EventHandler, .WeakEventHandler, javafx.geometry.Insets, javafx.scene.Node, javafx.scene.input.MouseButton, .MouseEvent, javafx.scene.layout.StackPane, javafx.scene.shape.Rectangle, javafx.util.Duration, one.jpro.platform.utils.TreeShowing

A pane used for managing a single instance of InfoCenterView. The pane will show or hide the view depending on various criteria, e.g. events that have been received or the auto-hide feature is kicking in.

Note

There is a known issue with the InfoCenterPane component on Windows systems where ghost images of previously hidden InfoCenterViews may appear occasionally. This problem does not occur on macOS, suggesting it may be a bug specific to the JavaFX implementation on Windows.

Workaround: To prevent this issue, avoid using InfoCenterPane directly as the root of a Scene. Instead, wrap InfoCenterPane in another layout container, such as a StackPane or another suitable container. This arrangement helps to resolve the rendering anomaly.

   InfoCenterPane infoCenterPane = new InfoCenterPane();
   StackPane root = new StackPane(infoCenterPane);

Field Summary

Modifier and TypeField and Description
private BooleanProperty
private ObjectProperty<Duration>
private final ObjectProperty<Node>
private static final boolean
private static final Duration
private static final boolean
private static final boolean
private static final Duration
private final InfoCenterView
private ObjectProperty<InfoCenterViewPos>
private final ReadOnlyBooleanWrapper
private final EventHandler<MouseEvent>
private BooleanProperty
private BooleanProperty
private ObjectProperty<Duration>
private final Timeline
private final DoubleProperty
private final WeakEventHandler<MouseEvent>

Constructor Summary

AccessConstructor and Description
public
InfoCenterPane()

Constructs a new pane with no content.

public
InfoCenterPane(Node content)

Constructs a new pane with the given content node.

Method Summary

Modifier and TypeMethod and Description
public final ObjectProperty<Duration>

Returns:

the auto-hide duration
autoHideDurationProperty
()

A duration after which the pane will automatically hide the info center (if it isn't currently pinned and the mouse cursor is not on top of the info center).

public final BooleanProperty

Returns:

true if the info center hides automatically after a certain period of time
autoHideProperty
()

A flag that determines if the info center view should automatically disappear again after a certain timeout duration.

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.StackPane.computeMinHeight.

Computes the minimum height of this region.

protected double
computeMinWidth(double height)

Overrides javafx.scene.layout.StackPane.computeMinWidth.

Computes the minimum width of this region.

protected double
computePrefHeight(double width)

Overrides javafx.scene.layout.StackPane.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.StackPane.computePrefWidth.

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

public final ObjectProperty<Node>

Returns:

the content node property
contentProperty
()

The property that is used to store a reference to the content node.

public final Duration
public final Node
public final InfoCenterView
public final InfoCenterViewPos
public final Duration
private void
hide()

public final ObjectProperty<InfoCenterViewPos>

Returns:

the position of the info center view
infoCenterViewPosProperty
()

The position of the InfoCenterView within this pane.

public final boolean
public final boolean
public final boolean
protected void
layoutChildren()

Overrides javafx.scene.layout.StackPane.layoutChildren.

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

public final BooleanProperty

Returns:

true if the info center view is pinned
pinnedProperty
()

A flag that can be used to pin the info center view so that it will not hide under any circumstances.

public final void
setAutoHide(boolean autoHide)

public final void
setAutoHideDuration(Duration autoHideDuration)

public final void
setContent(Node content)

public final void
public final void
setPinned(boolean pinned)

public final void
setShowInfoCenter(boolean showInfoCenter)

public final void
private void
show()

public final BooleanProperty

Returns:

true if the info center shall be shown
showInfoCenterProperty
()

The flag that controls whether the info center shall be shown or not.

public final ObjectProperty<Duration>

Returns:

animation duration for the sliding in and out of the info center view
slideInDurationProperty
()

The duration used for the "slide in" / "slide out" animation when the info center view gets shown or hidden.

private void
Inherited from javafx.scene.layout.StackPane:
alignmentPropertyclearConstraintsgetAlignmentgetAlignmentgetClassCssMetaDatagetContentBiasgetCssMetaDatagetMarginrequestLayoutsetAlignmentsetAlignmentsetMargin

Field Detail

autoHideback to summary
private BooleanProperty autoHide
autoHideDurationback to summary
private ObjectProperty<Duration> autoHideDuration
contentback to summary
private final ObjectProperty<Node> content
DEFAULT_AUTO_HIDEback to summary
private static final boolean DEFAULT_AUTO_HIDE
DEFAULT_AUTO_HIDE_DURATIONback to summary
private static final Duration DEFAULT_AUTO_HIDE_DURATION
DEFAULT_PINNEDback to summary
private static final boolean DEFAULT_PINNED
DEFAULT_SHOW_INFO_CENTERback to summary
private static final boolean DEFAULT_SHOW_INFO_CENTER
DEFAULT_SLIDE_IN_DURATIONback to summary
private static final Duration DEFAULT_SLIDE_IN_DURATION
infoCenterViewback to summary
private final InfoCenterView infoCenterView
infoCenterViewPosback to summary
private ObjectProperty<InfoCenterViewPos> infoCenterViewPos
insideInfoCenterback to summary
private final ReadOnlyBooleanWrapper insideInfoCenter
mouseClickedHandlerback to summary
private final EventHandler<MouseEvent> mouseClickedHandler
pinnedback to summary
private BooleanProperty pinned
showInfoCenterback to summary
private BooleanProperty showInfoCenter
slideInDurationback to summary
private ObjectProperty<Duration> slideInDuration
timelineback to summary
private final Timeline timeline
visibilityback to summary
private final DoubleProperty visibility
weakMouseClickedHandlerback to summary
private final WeakEventHandler<MouseEvent> weakMouseClickedHandler

Constructor Detail

InfoCenterPaneback to summary
public InfoCenterPane()

Constructs a new pane with no content.

InfoCenterPaneback to summary
public InfoCenterPane(Node content)

Constructs a new pane with the given content node.

Method Detail

autoHideDurationPropertyback to summary
public final ObjectProperty<Duration> autoHideDurationProperty()

A duration after which the pane will automatically hide the info center (if it isn't currently pinned and the mouse cursor is not on top of the info center).

Returns:ObjectProperty<Duration>

the auto-hide duration

autoHidePropertyback to summary
public final BooleanProperty autoHideProperty()

A flag that determines if the info center view should automatically disappear again after a certain timeout duration.

Returns:BooleanProperty

true if the info center hides automatically after a certain period of time

See Also
autoHideDuration
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.StackPane.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.StackPane.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.StackPane.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.StackPane.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
contentPropertyback to summary
public final ObjectProperty<Node> contentProperty()

The property that is used to store a reference to the content node. The content node will fill the entire width and height of the pane.

Returns:ObjectProperty<Node>

the content node property

getAutoHideDurationback to summary
public final Duration getAutoHideDuration()
getContentback to summary
public final Node getContent()
getInfoCenterViewback to summary
public final InfoCenterView getInfoCenterView()
getInfoCenterViewPosback to summary
public final InfoCenterViewPos getInfoCenterViewPos()
getSlideInDurationback to summary
public final Duration getSlideInDuration()
hideback to summary
private void hide()
infoCenterViewPosPropertyback to summary
public final ObjectProperty<InfoCenterViewPos> infoCenterViewPosProperty()

The position of the InfoCenterView within this pane. The horizontal component determines which side the info center slides in from (left or right), and the vertical component determines whether it is placed at the top, center, or bottom. The default value is InfoCenterViewPos#TOP_RIGHT.

Returns:ObjectProperty<InfoCenterViewPos>

the position of the info center view

isAutoHideback to summary
public final boolean isAutoHide()
isPinnedback to summary
public final boolean isPinned()
isShowInfoCenterback to summary
public final boolean isShowInfoCenter()
layoutChildrenback to summary
protected void layoutChildren()

Overrides javafx.scene.layout.StackPane.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
pinnedPropertyback to summary
public final BooleanProperty pinnedProperty()

A flag that can be used to pin the info center view so that it will not hide under any circumstances.

Returns:BooleanProperty

true if the info center view is pinned

setAutoHideback to summary
public final void setAutoHide(boolean autoHide)
setAutoHideDurationback to summary
public final void setAutoHideDuration(Duration autoHideDuration)
setContentback to summary
public final void setContent(Node content)
setInfoCenterViewPosback to summary
public final void setInfoCenterViewPos(InfoCenterViewPos infoCenterViewPos)
setPinnedback to summary
public final void setPinned(boolean pinned)
setShowInfoCenterback to summary
public final void setShowInfoCenter(boolean showInfoCenter)
setSlideInDurationback to summary
public final void setSlideInDuration(Duration duration)
showback to summary
private void show()
showInfoCenterPropertyback to summary
public final BooleanProperty showInfoCenterProperty()

The flag that controls whether the info center shall be shown or not.

Returns:BooleanProperty

true if the info center shall be shown

slideInDurationPropertyback to summary
public final ObjectProperty<Duration> slideInDurationProperty()

The duration used for the "slide in" / "slide out" animation when the info center view gets shown or hidden.

Returns:ObjectProperty<Duration>

animation duration for the sliding in and out of the info center view

updateChildrenback to summary
private void updateChildren()