public class MenuBarSkin extends BehaviorSkinBase<MenuBar,BehaviorBase<MenuBar>> implements TraverseListener
IS_TOUCH_SUPPORTED| Constructor and Description |
|---|
MenuBarSkin(MenuBar control)
*
Constructors *
*
|
| Modifier and Type | Method and Description |
|---|---|
protected double |
computeMaxHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Computes the maximum allowable height of the Skin, based on the provided
width.
|
protected double |
computeMinHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Computes the minimum allowable height of the Skin, based on the provided
width.
|
protected double |
computeMinWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Computes the minimum allowable width of the Skin, based on the provided
height.
|
protected double |
computePrefHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the preferred height of this
SkinBase. |
protected double |
computePrefWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the preferred width of this
SkinBase. |
ObjectProperty<Pos> |
containerAlignmentProperty() |
void |
dispose()
Called by a Skinnable when the Skin is replaced on the Skinnable.
|
static List<CssMetaData<? extends Styleable,?>> |
getClassCssMetaData() |
Pos |
getContainerAlignment() |
List<CssMetaData<? extends Styleable,?>> |
getCssMetaData()
This method should delegate to
Node.getClassCssMetaData() so that
a Node's CssMetaData can be accessed without the need for reflection. |
double |
getSpacing() |
protected void |
layoutChildren(double x,
double y,
double w,
double h)
Layout the menu bar.
|
void |
onTraverse(Node node,
Bounds bounds) |
protected Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
Object... parameters)
*
Accessibility handling *
*
|
void |
setContainerAlignment(Pos value) |
static void |
setDefaultSystemMenuBar(MenuBar menuBar) |
void |
setSpacing(double value) |
protected double |
snappedBottomInset()
Utility method to get the bottom inset which includes padding and border
inset.
|
protected double |
snappedLeftInset()
Utility method to get the left inset which includes padding and border
inset.
|
protected double |
snappedRightInset()
Utility method to get the right inset which includes padding and border
inset.
|
protected double |
snappedTopInset()
*
Layout *
*
|
DoubleProperty |
spacingProperty() |
getBehavior, handleControlPropertyChanged, registerChangeListener, unregisterChangeListenercomputeBaselineOffset, computeMaxWidth, consumeMouseEvents, executeAccessibleAction, getChildren, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, snapPosition, snapSize, snapSpacepublic MenuBarSkin(MenuBar control)
public static void setDefaultSystemMenuBar(MenuBar menuBar)
public final void setSpacing(double value)
public final double getSpacing()
public final DoubleProperty spacingProperty()
public final void setContainerAlignment(Pos value)
public final Pos getContainerAlignment()
public final ObjectProperty<Pos> containerAlignmentProperty()
public void dispose()
BehaviorSkinBaseSkin.getSkinnable() and Skin.getNode()
should return null following a call to dispose. Calling dispose twice
has no effect.dispose in interface Skin<MenuBar>dispose in class BehaviorSkinBase<MenuBar,BehaviorBase<MenuBar>>public void onTraverse(Node node, Bounds bounds)
onTraverse in interface TraverseListenerprotected double snappedTopInset()
snappedTopInset in class SkinBase<MenuBar>protected double snappedBottomInset()
SkinBasesnappedBottomInset in class SkinBase<MenuBar>protected double snappedLeftInset()
SkinBasesnappedLeftInset in class SkinBase<MenuBar>protected double snappedRightInset()
SkinBasesnappedRightInset in class SkinBase<MenuBar>protected void layoutChildren(double x,
double y,
double w,
double h)
layoutChildren in class SkinBase<MenuBar>protected double computeMinWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
SkinBasecomputeMinWidth in class SkinBase<MenuBar>height - The height of the Skin, in case this value might dictate
the minimum width.topInset - the pixel snapped top insetrightInset - the pixel snapped right insetbottomInset - the pixel snapped bottom insetleftInset - the pixel snapped left insetprotected double computePrefWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
SkinBaseSkinBase. The default
implementation calculates this width as the width of the area occupied
by its managed children when they are positioned at their
current positions at their preferred widths.computePrefWidth in class SkinBase<MenuBar>height - the height that should be used if preferred width depends on ittopInset - the pixel snapped top insetrightInset - the pixel snapped right insetbottomInset - the pixel snapped bottom insetleftInset - the pixel snapped left insetprotected double computeMinHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
SkinBasecomputeMinHeight in class SkinBase<MenuBar>width - The width of the Skin, in case this value might dictate
the minimum height.topInset - the pixel snapped top insetrightInset - the pixel snapped right insetbottomInset - the pixel snapped bottom insetleftInset - the pixel snapped left insetprotected double computePrefHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
SkinBaseSkinBase. The default
implementation calculates this height as the height of the area occupied
by its managed children when they are positioned at their current
positions at their preferred heights.computePrefHeight in class SkinBase<MenuBar>width - the width that should be used if preferred height depends on ittopInset - the pixel snapped top insetrightInset - the pixel snapped right insetbottomInset - the pixel snapped bottom insetleftInset - the pixel snapped left insetprotected double computeMaxHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
SkinBasecomputeMaxHeight in class SkinBase<MenuBar>width - The width of the Skin, in case this value might dictate
the maximum height.topInset - the pixel snapped top insetrightInset - the pixel snapped right insetbottomInset - the pixel snapped bottom insetleftInset - the pixel snapped left insetpublic static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
public List<CssMetaData<? extends Styleable,?>> getCssMetaData()
Node.getClassCssMetaData() so that
a Node's CssMetaData can be accessed without the need for reflection.getCssMetaData in class SkinBase<MenuBar>protected Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
queryAccessibleAttribute in class SkinBase<MenuBar>Node.queryAccessibleAttribute(javafx.scene.AccessibleAttribute, java.lang.Object...)Copyright © 2025. All rights reserved.