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 the brightness of Scene#fillProperty()
as determined by Utils#calculateAverageBrightness(Paint) is less than 0.5
|
| .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 static enum | |
| private class | |
| 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 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 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 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 final DoubleProperty | prefButtonHeight
Specifies the preferred height of header buttons. |
| 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)
References Deprecated
HeaderButtonType is deprecated or references (maybe indirectly) at least one deprecated element.
Classifies and returns the button type at the specified coordinate, or returns
|
| public void | |
| private void | |
| protected Region | getButtonGlyph(HeaderButtonType buttonType)
References Deprecated
HeaderButtonType is deprecated or references (maybe indirectly) at least one deprecated element.
|
| 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 | handleMouseUp(Node node, HeaderButtonType buttonType)
References Deprecated
HeaderButtonType is deprecated or references (maybe indirectly) at least one deprecated element.
|
| private boolean | |
| protected void | layoutChildren()
Overrides javafx. Invoked during the layout pass to layout the children in this
|
| public ReadOnlyObjectProperty | |
| private void | |
| private void | |
| private void | |
| public DoubleProperty | |
| 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 | |
| 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 | |
| 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. | |
| 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 | |
| prefButtonHeight | back to summary |
|---|---|
| private final DoubleProperty prefButtonHeight 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 | |
| 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)
References Deprecated
See corresponding docs for further information. Classifies and returns the button type at the specified coordinate, or returns
| |
| 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)
References Deprecated
See corresponding docs for further information. | |
| 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)
References Deprecated
See corresponding docs for further information. | |
| isDarkBackground | back to summary |
|---|---|
| private boolean isDarkBackground(Paint paint) | |
| 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) | |
| prefButtonHeightProperty | back to summary |
|---|---|
| public DoubleProperty prefButtonHeightProperty() | |
| toggleStyleClass | back to summary |
|---|---|
| private void toggleStyleClass(Node node, String styleClass, boolean enabled) | |
| 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 |
|---|---|
| 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 | type
References Deprecated
HeaderButtonType is deprecated or references (maybe indirectly) at least one deprecated element.
|
| Access | Constructor and Description |
|---|---|
| pack-priv | ButtonRegion(HeaderButtonType type, String styleClass, int order)
References Deprecated
HeaderButtonType is deprecated or references (maybe indirectly) at least one deprecated element.
|
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public HeaderButtonType | getButtonType()
References Deprecated
HeaderButtonType is deprecated or references (maybe indirectly) at least one deprecated element.
|
| 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
References Deprecated
See corresponding docs for further information. | |
| ButtonRegion | back to summary |
|---|---|
| pack-priv ButtonRegion(HeaderButtonType type, String styleClass, int order)
References Deprecated
See corresponding docs for further information. | |
| getButtonOrder | back to summary |
|---|---|
| public int getButtonOrder() | |
| getButtonType | back to summary |
|---|---|
| public HeaderButtonType getButtonType()
References Deprecated
See corresponding docs for further information. | |
| 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 |
|---|---|
| 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. | |