StageStyle#EXTENDED
window for platforms that use client-side decorations (Windows and Linux/GTK). This control supports
left-to-right and right-to-left orientations, as well as a customizable layout order of buttons.
Region — -FX-INTERNAL-header-button-container
| CSS property | Values | Default | Comment |
|---|---|---|---|
| -fx-button-placement | [ left | right ] | right | Specifies the placement of the header buttons on the left or the right side of the window. |
| -fx-button-vertical-alignment | [ center | stretch ] | center | Specifies the vertical alignment of the header buttons, either centering the buttons within the preferred height or stretching the buttons to fill the preferred height. |
| -fx-button-default-height | <double> | 0 | Specifies the default height of the header buttons, which is used when the application does not specify a preferred button height. |
| CSS property | Values | Default | Comment |
|---|---|---|---|
| -fx-button-order | <integer> | 0/1/2 | Specifies the layout order of a button relative to the other buttons. Lower values are laid out before higher values. |
| Style class | Applies to | Comment |
|---|---|---|
| .dark | all buttons |
This style class will be present if HeaderBar#systemColorSchemeProperty(Stage)
or Scene. specifies a dark color scheme.
|
| .restore | -FX-INTERNAL-maximize-button |
This style class will be present if Stage#isMaximized() is true |
Implementation Note
This control is used by the WinWindow.createHeaderButtonOverlay() and
GtkWindow.createHeaderButtonOverlay() implementations for StageStyle#EXTENDED
windows. It is not used by the macOS implementation.
| Modifier and Type | Class and Description |
|---|---|
| private class | HeaderButtonOverlay.
Contains the sizes of the window buttons, the total width and height of the window button area, and its placement. |
| private static enum | |
| private class | |
| private static class | HeaderButtonOverlay.
Contains the computed size for a window button. |
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private static final PseudoClass | |
| private static final CssMetaData | |
| private static final CssMetaData | |
| private static final CssMetaData | |
| private Node | |
| private final BooleanProperty | buttonDarkStyle
Specifies whether header buttons should use a dark style. |
| private final StyleableDoubleProperty | buttonDefaultHeight
Specifies the default height of header buttons. |
| private final StyleableObjectProperty | buttonPlacement
Specifies the placement of the header buttons on the left or the right side of the window. |
| private final DoubleProperty | buttonPrefHeight
Specifies the preferred height of header buttons. |
| private final StyleableObjectProperty | buttonVerticalAlignment
Specifies the vertical alignment of the header buttons. |
| private final HeaderButtonOverlay. | |
| private static final String | |
| private static final PseudoClass | |
| private final HeaderButtonOverlay. | |
| private final HeaderButtonOverlay. | |
| private final HeaderButtonOverlay. | |
| private static final List | |
| private final ObjectProperty | metrics
The metrics (placement and size) of header buttons. |
| private final boolean | |
| private final List | orderedButtons
Contains the buttons in the order as they will appear on the window. |
| private static final PseudoClass | |
| private static final String | |
| private final boolean | |
| private final Subscription | |
| private final boolean | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | HeaderButtonOverlay(ObservableValue<String> stylesheet, boolean modalOrOwned, boolean utility, boolean rightToLeft)
|
| Modifier and Type | Method and Description |
|---|---|
| private static double | |
| private static double | boundedSize(double min, double pref, double max)
Hides javafx. Computes the value based on the given min and max values. |
| private static double | |
| public HeaderButtonType | Returns: theButtonType or nullthe X coordinate, in pixels relative to the window x, double the Y coordinate, in pixels relative to the window y)Classifies and returns the button type at the specified coordinate, or returns
|
| public BooleanProperty | |
| public DoubleProperty | |
| public void | |
| private void | |
| protected Region | |
| private double | |
| public List | getCssMetaData()
Overrides javafx. Implements javafx. This method should delegate to |
| private double | |
| private void | |
| public boolean | Returns: true if the event was handled, false otherwisethe event type type, int the button type button, double the X coordinate, in pixels relative to the window x, double the Y coordinate, in pixels relative to the window y)Handles the specified mouse event. |
| private void | |
| private void | |
| private void | |
| protected void | layoutChildren()
Overrides javafx. Invoked during the layout pass to layout the children in this
|
| public ReadOnlyObjectProperty | |
| private void | |
| private void | |
| private void | |
| private void | |
| private boolean | |
| private void | |
| private void | |
| private void | |
| public boolean | usesMirroring()
Overrides javafx. Determines whether a node should be mirrored when node orientation is right-to-left. |
| ACTIVE_PSEUDOCLASS | back to summary |
|---|---|
| private static final PseudoClass ACTIVE_PSEUDOCLASS | |
| BUTTON_DEFAULT_HEIGHT_METADATA | back to summary |
|---|---|
| private static final CssMetaData<HeaderButtonOverlay, Number> BUTTON_DEFAULT_HEIGHT_METADATA | |
| BUTTON_PLACEMENT_METADATA | back to summary |
|---|---|
| private static final CssMetaData<HeaderButtonOverlay, HeaderButtonOverlay. | |
| BUTTON_VERTICAL_ALIGNMENT_METADATA | back to summary |
|---|---|
| private static final CssMetaData<HeaderButtonOverlay, HeaderButtonOverlay. | |
| buttonAtMouseDown | back to summary |
|---|---|
| private Node buttonAtMouseDown | |
| buttonDarkStyle | back to summary |
|---|---|
| private final BooleanProperty buttonDarkStyle Specifies whether header buttons should use a dark style. | |
| buttonDefaultHeight | back to summary |
|---|---|
| private final StyleableDoubleProperty buttonDefaultHeight Specifies the default height of header buttons.
This property corresponds to the | |
| buttonPlacement | back to summary |
|---|---|
| private final StyleableObjectProperty<HeaderButtonOverlay. Specifies the placement of the header buttons on the left or the right side of the window.
This property corresponds to the | |
| buttonPrefHeight | back to summary |
|---|---|
| private final DoubleProperty buttonPrefHeight Specifies the preferred height of header buttons.
Negative values are interpreted as "no preference", which causes the buttons to be laid out
with their preferred height set to the value of | |
| buttonVerticalAlignment | back to summary |
|---|---|
| private final StyleableObjectProperty<HeaderButtonOverlay. Specifies the vertical alignment of the header buttons.
This property corresponds to the | |
| closeButton | back to summary |
|---|---|
| private final HeaderButtonOverlay. | |
| DARK_STYLE_CLASS | back to summary |
|---|---|
| private static final String DARK_STYLE_CLASS | |
| HOVER_PSEUDOCLASS | back to summary |
|---|---|
| private static final PseudoClass HOVER_PSEUDOCLASS | |
| iconifyButton | back to summary |
|---|---|
| private final HeaderButtonOverlay. | |
| layoutInfo | back to summary |
|---|---|
| private final HeaderButtonOverlay. | |
| maximizeButton | back to summary |
|---|---|
| private final HeaderButtonOverlay. | |
| METADATA | back to summary |
|---|---|
| private static final List<CssMetaData<?, ?>> METADATA | |
| metrics | back to summary |
|---|---|
| private final ObjectProperty<HeaderButtonMetrics> metrics The metrics (placement and size) of header buttons. | |
| modalOrOwned | back to summary |
|---|---|
| private final boolean modalOrOwned | |
| orderedButtons | back to summary |
|---|---|
| private final List<HeaderButtonOverlay. Contains the buttons in the order as they will appear on the window.
This list is automatically updated by the implementation of | |
| PRESSED_PSEUDOCLASS | back to summary |
|---|---|
| private static final PseudoClass PRESSED_PSEUDOCLASS | |
| RESTORE_STYLE_CLASS | back to summary |
|---|---|
| private static final String RESTORE_STYLE_CLASS | |
| rightToLeft | back to summary |
|---|---|
| private final boolean rightToLeft | |
| subscriptions | back to summary |
|---|---|
| private final Subscription subscriptions | |
| utility | back to summary |
|---|---|
| private final boolean utility | |
| UTILITY_STYLE_CLASS | back to summary |
|---|---|
| private static final String UTILITY_STYLE_CLASS | |
| HeaderButtonOverlay | back to summary |
|---|---|
| public HeaderButtonOverlay(ObservableValue<String> stylesheet, boolean modalOrOwned, boolean utility, boolean rightToLeft) | |
| boundedHeight | back to summary |
|---|---|
| private static double boundedHeight(Node node) | |
| boundedSize | back to summary |
|---|---|
| private static double boundedSize(double min, double pref, double max) Hides javafx. Doc from javafx. Computes the value based on the given min and max values. We encode in this method the logic surrounding various edge cases, such as when the min is specified as greater than the max, or the max less than the min, or a pref value that exceeds either the max or min in their extremes. If the min is greater than the max, then we want to make sure the returned value is the min. In other words, in such a case, the min becomes the only acceptable return value. If the min and max values are well ordered, and the pref is less than the min then the min is returned. Likewise, if the values are well ordered and the pref is greater than the max, then the max is returned. If the pref lies between the min and the max, then the pref is returned. | |
| boundedWidth | back to summary |
|---|---|
| private static double boundedWidth(Node node) | |
| buttonAt | back to summary |
|---|---|
| public HeaderButtonType buttonAt(double x, double y) Classifies and returns the button type at the specified coordinate, or returns
| |
| buttonDarkStyleProperty | back to summary |
|---|---|
| public BooleanProperty buttonDarkStyleProperty() | |
| buttonPrefHeightProperty | back to summary |
|---|---|
| public DoubleProperty buttonPrefHeightProperty() | |
| dispose | back to summary |
|---|---|
| public void dispose() | |
| ensureRegionPrefHeight | back to summary |
|---|---|
| private void ensureRegionPrefHeight(Region region, double height) | |
| getButtonGlyph | back to summary |
|---|---|
| protected Region getButtonGlyph(HeaderButtonType buttonType) | |
| getButtonOffsetY | back to summary |
|---|---|
| private double getButtonOffsetY(double buttonHeight) | |
| getCssMetaData | back to summary |
|---|---|
| public List Overrides javafx. Implements javafx. Doc from javafx. This method should delegate to
| |
| getEffectiveButtonHeight | back to summary |
|---|---|
| private double getEffectiveButtonHeight() | |
| handleMouseDown | back to summary |
|---|---|
| private void handleMouseDown(Node node) | |
| handleMouseEvent | back to summary |
|---|---|
| public boolean handleMouseEvent(int type, int button, double x, double y) Handles the specified mouse event.
| |
| handleMouseExit | back to summary |
|---|---|
| private void handleMouseExit() | |
| handleMouseOver | back to summary |
|---|---|
| private void handleMouseOver(Node button) | |
| handleMouseUp | back to summary |
|---|---|
| private void handleMouseUp(Node node, HeaderButtonType buttonType) | |
| layoutChildren | back to summary |
|---|---|
| protected void layoutChildren() Overrides javafx. Doc from javafx. Invoked during the layout pass to layout the children in this
Subclasses should override this function to layout content as needed.
| |
| metricsProperty | back to summary |
|---|---|
| public ReadOnlyObjectProperty | |
| onFocusedChanged | back to summary |
|---|---|
| private void onFocusedChanged(boolean focused) | |
| onMaximizedChanged | back to summary |
|---|---|
| private void onMaximizedChanged(boolean maximized) | |
| onResizableChanged | back to summary |
|---|---|
| private void onResizableChanged(boolean resizable) | |
| toggleStyleClass | back to summary |
|---|---|
| private void toggleStyleClass(Node node, String styleClass, boolean enabled) | |
| updateButtonLayoutInfo | back to summary |
|---|---|
| private boolean updateButtonLayoutInfo() | |
| updateButtonMetrics | back to summary |
|---|---|
| private void updateButtonMetrics() | |
| updateStyleClass | back to summary |
|---|---|
| private void updateStyleClass() | |
| updateStylesheet | back to summary |
|---|---|
| private void updateStylesheet(String stylesheet) | |
| usesMirroring | back to summary |
|---|---|
| public boolean usesMirroring() Overrides javafx. Doc from javafx. Determines whether a node should be mirrored when node orientation is right-to-left.
When a node is mirrored, the origin is automatically moved to the
top right corner causing the node to layout children and draw from
right to left using a mirroring transformation. Some nodes may wish
to draw from right to left without using a transformation. These
nodes will answer
| |
| Modifier and Type | Field and Description |
|---|---|
| private final HeaderButtonOverlay. | |
| private boolean | |
| private final double[] | |
| private double | |
| private double |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public HeaderButtonOverlay. | |
| public double[] | |
| public boolean | |
| public double | |
| public double | |
| pack-priv boolean |
| buttonSizes | back to summary |
|---|---|
| private final HeaderButtonOverlay. | |
| left | back to summary |
|---|---|
| private boolean left | |
| temp | back to summary |
|---|---|
| private final double[] temp | |
| totalHeight | back to summary |
|---|---|
| private double totalHeight | |
| totalWidth | back to summary |
|---|---|
| private double totalWidth | |
| ButtonLayoutInfo | back to summary |
|---|---|
| private ButtonLayoutInfo() | |
| buttonSizeAt | back to summary |
|---|---|
| public HeaderButtonOverlay. | |
| getLayoutOffsetsForWidth | back to summary |
|---|---|
| public double[] getLayoutOffsetsForWidth(double width) | |
| left | back to summary |
|---|---|
| public boolean left() | |
| totalHeight | back to summary |
|---|---|
| public double totalHeight() | |
| totalWidth | back to summary |
|---|---|
| public double totalWidth() | |
| update | back to summary |
|---|---|
| pack-priv boolean update(Region button1, double width1, double height1, Region button2, double width2, double height2, Region button3, double width3, double height3, double totalWidth, double totalHeight, boolean left) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final HeaderButtonOverlay. | |
| public static final HeaderButtonOverlay. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static HeaderButtonOverlay. | |
| public static HeaderButtonOverlay. |
| LEFT | back to summary |
|---|---|
| public static final HeaderButtonOverlay. | |
| RIGHT | back to summary |
|---|---|
| public static final HeaderButtonOverlay. | |
| ButtonPlacement | back to summary |
|---|---|
| private ButtonPlacement() | |
| valueOf | back to summary |
|---|---|
| public static HeaderButtonOverlay. | |
| values | back to summary |
|---|---|
| public static HeaderButtonOverlay. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final CssMetaData | |
| private final StyleableIntegerProperty | buttonOrder
Specifies the layout order of this button relative to the other buttons. |
| private final Region | |
| private static final List | |
| private final HeaderButtonType |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public HeaderButtonType | |
| public List | getCssMetaData()
Overrides javafx. Implements javafx. This method should delegate to |
| protected void | layoutChildren()
Overrides javafx. Invoked during the layout pass to layout the children in this
|
| BUTTON_ORDER_METADATA | back to summary |
|---|---|
| private static final CssMetaData<HeaderButtonOverlay. | |
| buttonOrder | back to summary |
|---|---|
| private final StyleableIntegerProperty buttonOrder Specifies the layout order of this button relative to the other buttons. Buttons with a lower value are laid out before buttons with a higher value.
This property corresponds to the | |
| glyph | back to summary |
|---|---|
| private final Region glyph | |
| METADATA | back to summary |
|---|---|
| private static final List<CssMetaData<?, ?>> METADATA | |
| type | back to summary |
|---|---|
| private final HeaderButtonType type | |
| ButtonRegion | back to summary |
|---|---|
| pack-priv ButtonRegion(HeaderButtonType type, String styleClass, int order) | |
| getButtonOrder | back to summary |
|---|---|
| public int getButtonOrder() | |
| getButtonType | back to summary |
|---|---|
| public HeaderButtonType getButtonType() | |
| getCssMetaData | back to summary |
|---|---|
| public List Overrides javafx. Implements javafx. Doc from javafx. This method should delegate to
| |
| layoutChildren | back to summary |
|---|---|
| protected void layoutChildren() Overrides javafx. Doc from javafx. Invoked during the layout pass to layout the children in this
Subclasses should override this function to layout content as needed.
| |
| Modifier and Type | Field and Description |
|---|---|
| private Region | |
| private double | |
| private double |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Region | |
| public double | |
| pack-priv boolean | |
| public double |
| button | back to summary |
|---|---|
| private Region button | |
| height | back to summary |
|---|---|
| private double height | |
| width | back to summary |
|---|---|
| private double width | |
| ButtonSizeInfo | back to summary |
|---|---|
| private ButtonSizeInfo() | |
| button | back to summary |
|---|---|
| public Region button() | |
| height | back to summary |
|---|---|
| public double height() | |
| update | back to summary |
|---|---|
| pack-priv boolean update(Region button, double width, double height) | |
| width | back to summary |
|---|---|
| public double width() | |
| Modifier and Type | Field and Description |
|---|---|
| public static final HeaderButtonOverlay. | |
| public static final HeaderButtonOverlay. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static HeaderButtonOverlay. | |
| public static HeaderButtonOverlay. |
| CENTER | back to summary |
|---|---|
| public static final HeaderButtonOverlay. | |
| STRETCH | back to summary |
|---|---|
| public static final HeaderButtonOverlay. | |
| ButtonVerticalAlignment | back to summary |
|---|---|
| private ButtonVerticalAlignment() | |
| valueOf | back to summary |
|---|---|
| public static HeaderButtonOverlay. | |
| values | back to summary |
|---|---|
| public static HeaderButtonOverlay. | |