Top Description Inners Fields Constructors Methods
com.dlsc.gemsfx

public Class ResponsivePane

extends StackPane
Class Inheritance
Imports
javafx.beans.property.BooleanProperty, .DoubleProperty, .ObjectProperty, .ObjectPropertyBase, .SimpleBooleanProperty, javafx.collections.ListChangeListener, javafx.css.CssMetaData, .PseudoClass, .Styleable, .StyleableDoubleProperty, .StyleableObjectProperty, .StyleableProperty, javafx.css.converter.EnumConverter, .SizeConverter, javafx.geometry.Insets, .Side, javafx.scene.Node, javafx.scene.layout.Pane, .Region, .StackPane, java.util.ArrayList, .Collections, .List, .Objects

ResponsivePane is a container that allows for responsive behavior of a sidebar and a main content panel. Depending on the specified position of the sidebar (LEFT or RIGHT), it will automatically adjust its visibility based on the width of the pane. When the window width is narrow, the sidebar is hidden, and only the content panel is shown. When the window width is moderate, both a small sidebar and a large sidebar, along with the content panel, are displayed. When the window width is wide, both the large sidebar and the main content pane are shown. Similarly, if the sidebar is positioned at the TOP or BOTTOM, its visibility will be adjusted based on the height of the pane. However, it is also possible to force the sidebar to be displayed regardless of the window size.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class

Field Summary

Modifier and TypeField and Description
private static final PseudoClass
private ObjectProperty<Node>
private static final PseudoClass
COVERING_PSEUDOCLASS

This pseudo-class is applied only when both smallSideBar is visible and largeSideBar is also visible and overlapping smallSideBar.

private static final Side
private static final PseudoClass
FORCED_PSEUDOCLASS

This pseudo-class is applied only when both smallSideBar is visible and largeSideBar is forced to display.

private BooleanProperty
private DoubleProperty
private final GlassPane
private final BooleanProperty
public ObjectProperty<Node>
private BooleanProperty
private static final PseudoClass
private static final PseudoClass
private static final PseudoClass
private static final PseudoClass
private static final PseudoClass
private ObjectProperty<Side>
public ObjectProperty<Node>
private static final PseudoClass

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private double
boundSize(double pref, double min, double max)

private double
computeNodeHeight(Node node, boolean isSideBarInHorizontal)

private double
computeNodeWidth(Node node, boolean isSideBarInHorizontal)

public final ObjectProperty<Node>
public final BooleanProperty
forceLargeSidebarDisplayProperty()

This property, when value is true, forces the display of the large sidebar even when the small sidebar is visible.

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

Hides javafx.scene.layout.StackPane.getClassCssMetaData.

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

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

Overrides javafx.scene.layout.StackPane.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 double
public final Node
public Side
public final Node
public String
getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method.

public final boolean
public final boolean
public final BooleanProperty
largeSidebarCoversSmallProperty()

This property determines the display behavior of the large sidebar in relation to the small sidebar when the large sidebar is forced to display.

public final ObjectProperty<Node>
protected void
layoutChildren()

Overrides javafx.scene.layout.StackPane.layoutChildren.

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

public final void
public final void
setForceLargeSidebarDisplay(boolean forceLargeSidebarDisplay)

public void
setGap(double gap)

public final void
public final void
setLargeSidebarCoversSmall(boolean largeSidebarCoversSmall)

public void
setSide(Side side)

public final void
public final ObjectProperty<Side>
public final ObjectProperty<Node>
private void
updatePseudoClasses(final Side currentSide)

Inherited from javafx.scene.layout.StackPane:
alignmentPropertyclearConstraintscomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthgetAlignmentgetAlignmentgetContentBiasgetMarginrequestLayoutsetAlignmentsetAlignmentsetMargin

Field Detail

BOTTOM_PSEUDOCLASSback to summary
private static final PseudoClass BOTTOM_PSEUDOCLASS
contentback to summary
private ObjectProperty<Node> content
COVERING_PSEUDOCLASSback to summary
private static final PseudoClass COVERING_PSEUDOCLASS

This pseudo-class is applied only when both smallSideBar is visible and largeSideBar is also visible and overlapping smallSideBar.

DEFAULT_SIDEback to summary
private static final Side DEFAULT_SIDE
FORCED_PSEUDOCLASSback to summary
private static final PseudoClass FORCED_PSEUDOCLASS

This pseudo-class is applied only when both smallSideBar is visible and largeSideBar is forced to display.

forceLargeSidebarDisplayback to summary
private BooleanProperty forceLargeSidebarDisplay
gapback to summary
private DoubleProperty gap
glassPaneback to summary
private final GlassPane glassPane
glassPaneNeedHideback to summary
private final BooleanProperty glassPaneNeedHide
largeSidebarback to summary
public ObjectProperty<Node> largeSidebar
largeSidebarCoversSmallback to summary
private BooleanProperty largeSidebarCoversSmall
LEFT_PSEUDOCLASSback to summary
private static final PseudoClass LEFT_PSEUDOCLASS
RIGHT_PSEUDOCLASSback to summary
private static final PseudoClass RIGHT_PSEUDOCLASS
SHOWING_LARGE_PSEUDOCLASSback to summary
private static final PseudoClass SHOWING_LARGE_PSEUDOCLASS
SHOWING_NONE_PSEUDOCLASSback to summary
private static final PseudoClass SHOWING_NONE_PSEUDOCLASS
SHOWING_SMALL_PSEUDOCLASSback to summary
private static final PseudoClass SHOWING_SMALL_PSEUDOCLASS
sideback to summary
private ObjectProperty<Side> side
smallSidebarback to summary
public ObjectProperty<Node> smallSidebar
TOP_PSEUDOCLASSback to summary
private static final PseudoClass TOP_PSEUDOCLASS

Constructor Detail

ResponsivePaneback to summary
public ResponsivePane()

Method Detail

boundSizeback to summary
private double boundSize(double pref, double min, double max)
computeNodeHeightback to summary
private double computeNodeHeight(Node node, boolean isSideBarInHorizontal)
computeNodeWidthback to summary
private double computeNodeWidth(Node node, boolean isSideBarInHorizontal)
contentPropertyback to summary
public final ObjectProperty<Node> contentProperty()
forceLargeSidebarDisplayPropertyback to summary
public final BooleanProperty forceLargeSidebarDisplayProperty()

This property, when value is true, forces the display of the large sidebar even when the small sidebar is visible.

gapPropertyback to summary
public final DoubleProperty gapProperty()
getClassCssMetaDataback to summary
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()

Hides javafx.scene.layout.StackPane.getClassCssMetaData.

Doc from javafx.scene.layout.StackPane.getClassCssMetaData.

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

getContentback to summary
public final Node getContent()
getCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData()

Overrides javafx.scene.layout.StackPane.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

Doc from javafx.scene.layout.StackPane.getCssMetaData.

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

Annotations
@Override
getGapback to summary
public double getGap()
getLargeSidebarback to summary
public final Node getLargeSidebar()
getSideback to summary
public Side getSide()
getSmallSidebarback to summary
public final Node getSmallSidebar()
getUserAgentStylesheetback to summary
public String getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

Doc from javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. These styles are used in addition to whatever user-agent stylesheets are in use. This provides a mechanism for third parties to introduce styles for custom controls.

The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL does not have a [scheme:] component, the URL is considered to be the [path] component only. Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to the root of the application's classpath.

Subclasses overriding this method should not assume any particular implementation approach as to the number and frequency with which it is called. For this reason, attempting any kind of dynamic implementation (i.e. returning different user agent stylesheet values) based on some state change is highly discouraged, as there is no guarantee when, or even if, this method will be called. Some JavaFX CSS implementations may choose to cache this response for an indefinite period of time, and therefore there should be no expectation around when this method is called.



package com.example.javafx.app;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class MyApp extends Application {

    @Override public void start(Stage stage) {
        Scene scene = new Scene(new Group());
        scene.getStylesheets().add("/com/example/javafx/app/mystyles.css");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
Annotations
@Override
isForceLargeSidebarDisplayback to summary
public final boolean isForceLargeSidebarDisplay()
isLargeSidebarCoversSmallback to summary
public final boolean isLargeSidebarCoversSmall()
largeSidebarCoversSmallPropertyback to summary
public final BooleanProperty largeSidebarCoversSmallProperty()

This property determines the display behavior of the large sidebar in relation to the small sidebar when the large sidebar is forced to display. When set to true, the large sidebar will cover the small sidebar. When set to false, the large sidebar will position itself next to the small sidebar without overlaying, ensuring both sidebars are visible and accessible to the user.

largeSidebarPropertyback to summary
public final ObjectProperty<Node> largeSidebarProperty()
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
setContentback to summary
public final void setContent(Node value)
setForceLargeSidebarDisplayback to summary
public final void setForceLargeSidebarDisplay(boolean forceLargeSidebarDisplay)
setGapback to summary
public void setGap(double gap)
setLargeSidebarback to summary
public final void setLargeSidebar(Node value)
setLargeSidebarCoversSmallback to summary
public final void setLargeSidebarCoversSmall(boolean largeSidebarCoversSmall)
setSideback to summary
public void setSide(Side side)
setSmallSidebarback to summary
public final void setSmallSidebar(Node value)
sidePropertyback to summary
public final ObjectProperty<Side> sideProperty()
smallSidebarPropertyback to summary
public final ObjectProperty<Node> smallSidebarProperty()
updatePseudoClassesback to summary
private void updatePseudoClasses(final Side currentSide)
com.dlsc.gemsfx back to summary

private final Class ResponsivePane.NodeProperty

extends ObjectPropertyBase<Node>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private boolean
private Node
private final String
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv
NodeProperty(String propertyName)

Method Summary

Modifier and TypeMethod and Description
public Object
getBean()

Implements javafx.beans.property.ReadOnlyProperty.getBean.

Returns the Object that contains this property.

public String
getName()

Implements javafx.beans.property.ReadOnlyProperty.getName.

Returns the name of this property.

protected void
invalidated()

Overrides javafx.beans.property.ObjectPropertyBase.invalidated.

The method invalidated() can be overridden to receive invalidation notifications.

public void
setSuppressLayoutChanges(boolean suppress)

Inherited from javafx.beans.property.ObjectPropertyBase:
addListeneraddListenerbindfireValueChangedEventgetisBoundremoveListenerremoveListenersettoStringunbind

Field Detail

isBeingInvalidatedback to summary
private boolean isBeingInvalidated
oldValueback to summary
private Node oldValue
propertyNameback to summary
private final String propertyName
suppressLayoutChangesback to summary
private boolean suppressLayoutChanges

Constructor Detail

NodePropertyback to summary
pack-priv NodeProperty(String propertyName)

Method Detail

getBeanback to summary
public Object getBean()

Implements javafx.beans.property.ReadOnlyProperty.getBean.

Doc from javafx.beans.property.ReadOnlyProperty.getBean.

Returns the Object that contains this property. If this property is not contained in an Object, null is returned.

Annotations
@Override
getNameback to summary
public String getName()

Implements javafx.beans.property.ReadOnlyProperty.getName.

Doc from javafx.beans.property.ReadOnlyProperty.getName.

Returns the name of this property. If the property does not have a name, this method returns an empty String.

Annotations
@Override
invalidatedback to summary
protected void invalidated()

Overrides javafx.beans.property.ObjectPropertyBase.invalidated.

Doc from javafx.beans.property.ObjectPropertyBase.invalidated.

The method invalidated() can be overridden to receive invalidation notifications. This is the preferred option in Objects defining the property, because it requires less memory. The default implementation is empty.

Annotations
@Override
setSuppressLayoutChangesback to summary
public void setSuppressLayoutChanges(boolean suppress)
com.dlsc.gemsfx back to summary

private Class ResponsivePane.StyleableProperties

extends Object
Class Inheritance

Field Summary

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

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

GAPback to summary
private static final CssMetaData<ResponsivePane, Number> GAP
SIDEback to summary
private static final CssMetaData<ResponsivePane, Side> SIDE
STYLEABLESback to summary
private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES

Constructor Detail

StyleablePropertiesback to summary
private StyleableProperties()