public class MenuBarSkin
extends <any>
MenuBar
control. In essence it is
a simple toolbar. For the time being there is no overflow behavior and we just
hide nodes which fall outside the bounds.MenuBar
Type | Property and Description |
---|---|
<any> |
containerAlignment
Specifies the alignment of the menu buttons inside the MenuBar (by default
it is Pos.TOP_LEFT).
|
DoubleProperty |
spacing
Specifies the spacing between menu buttons on the MenuBar.
|
Modifier and Type | Field and Description |
---|---|
private static <any> |
ALIGNMENT |
private <any> |
altKeyEventHandler |
private boolean |
altKeyPressed |
private HBox |
container
*
Private fields *
*
|
private <any> |
containerAlignment
Specifies the alignment of the menu buttons inside the MenuBar (by default
it is Pos.TOP_LEFT).
|
private static Stage |
currentMenuBarStage |
(package private) java.lang.Runnable |
firstMenuRunnable |
private Menu |
focusedMenu |
private int |
focusedMenuIndex |
private <any> |
keyEventHandler |
private <any> |
menuActionEventHandler
*
Listeners / Callbacks *
*
|
private <any> |
menuBarFocusedPropertyListener |
private <any> |
menuItemListener |
private <any> |
menuVisibilityChangeListener |
private <any> |
mouseEventHandler |
private Menu |
openMenu |
private MenuBarButton |
openMenuButton |
private boolean |
pendingDismiss |
private <any> |
sceneChangeListener |
private DoubleProperty |
spacing
Specifies the spacing between menu buttons on the MenuBar.
|
private static <any> |
SPACING
*
CSS *
*
|
private static <any> |
stages |
private static java.util.List<<any>> |
STYLEABLES |
private static java.util.WeakHashMap<Stage,java.lang.ref.Reference<MenuBarSkin>> |
systemMenuMap |
private <any> |
weakSceneAltKeyEventHandler |
private <any> |
weakSceneKeyEventHandler |
private <any> |
weakSceneMouseEventHandler |
private <any> |
weakWindowFocusListener |
private <any> |
weakWindowSceneListener |
private static java.util.List<MenuBase> |
wrappedDefaultMenus |
private java.util.List<MenuBase> |
wrappedMenus |
Constructor and Description |
---|
MenuBarSkin(MenuBar control)
Creates a new MenuBarSkin instance, installing the necessary child
nodes into the Control
children list, as
well as the necessary input mappings for handling key, mouse, etc events. |
Modifier and Type | Method and Description |
---|---|
private void |
cleanUpSystemMenu() |
private void |
clearMenuButtonHover() |
protected double |
computeMaxHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset) |
protected double |
computeMinHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset) |
protected double |
computeMinWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset) |
protected double |
computePrefHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset) |
protected double |
computePrefWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset) |
<any> |
containerAlignmentProperty()
Specifies the alignment of the menu buttons inside the MenuBar (by default
it is Pos.TOP_LEFT).
|
void |
dispose() |
private java.util.Optional<<any>> |
findSibling(Direction dir,
int startIndex) |
static java.util.List<<any>> |
getClassCssMetaData()
Returns the CssMetaData associated with this class, which may include the
CssMetaData of its superclasses.
|
Pos |
getContainerAlignment()
Gets the value of the property containerAlignment.
|
java.util.List<<any>> |
getCssMetaData() |
(package private) int |
getFocusedMenuIndex() |
private int |
getMenuBarButtonIndex(MenuBarButton m) |
private static MenuBarSkin |
getMenuBarSkin(Stage stage) |
(package private) MenuButton |
getNodeForMenu(int i)
*
Private implementation *
*
|
double |
getSpacing()
Gets the value of the property spacing.
|
private static void |
initSystemMenuBar() |
private boolean |
isMenuEmpty(Menu menu) |
protected void |
layoutChildren(double x,
double y,
double w,
double h) |
private boolean |
menuContainsCustomMenuItem(Menu menu) |
private void |
menuModeEnd() |
private void |
menuModeStart(int newIndex) |
private boolean |
menusContainCustomMenuItem() |
private void |
moveToMenu(Direction dir,
boolean doShow) |
protected java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters) |
private void |
rebuildUI() |
private void |
resetOpenMenu() |
void |
setContainerAlignment(Pos value)
Sets the value of the property containerAlignment.
|
static void |
setDefaultSystemMenuBar(MenuBar menuBar)
Set the default system menu bar.
|
private void |
setFocusedMenuIndex(int index) |
void |
setSpacing(double value)
Sets the value of the property spacing.
|
private static void |
setSystemMenu(Stage stage) |
private void |
showMenu(Menu menu) |
private void |
showMenu(Menu menu,
boolean selectFirstItem) |
protected double |
snappedBottomInset() |
protected double |
snappedLeftInset() |
protected double |
snappedRightInset() |
protected double |
snappedTopInset() |
DoubleProperty |
spacingProperty()
Specifies the spacing between menu buttons on the MenuBar.
|
private void |
unSelectMenus() |
private void |
updateActionListeners(MenuItem item,
boolean add) |
private void |
updateFocusedIndex() |
public final DoubleProperty spacingProperty
getSpacing()
,
setSpacing(double)
public final <any> containerAlignmentProperty
private static final <any> stages
private final HBox container
private Menu openMenu
private MenuBarButton openMenuButton
private Menu focusedMenu
private int focusedMenuIndex
private static java.util.WeakHashMap<Stage,java.lang.ref.Reference<MenuBarSkin>> systemMenuMap
private static java.util.List<MenuBase> wrappedDefaultMenus
private static Stage currentMenuBarStage
private java.util.List<MenuBase> wrappedMenus
private <any> weakSceneKeyEventHandler
private <any> weakSceneMouseEventHandler
private <any> weakSceneAltKeyEventHandler
private <any> weakWindowFocusListener
private <any> weakWindowSceneListener
private <any> keyEventHandler
private <any> altKeyEventHandler
private <any> mouseEventHandler
private <any> menuBarFocusedPropertyListener
private <any> sceneChangeListener
private <any> menuVisibilityChangeListener
private boolean pendingDismiss
private boolean altKeyPressed
private <any> menuActionEventHandler
private <any> menuItemListener
java.lang.Runnable firstMenuRunnable
private DoubleProperty spacing
private <any> containerAlignment
private static final <any> SPACING
private static final <any> ALIGNMENT
private static final java.util.List<<any>> STYLEABLES
public MenuBarSkin(MenuBar control)
children
list, as
well as the necessary input mappings for handling key, mouse, etc events.control
- The control that this skin should be installed onto.private void showMenu(Menu menu)
private void showMenu(Menu menu, boolean selectFirstItem)
private void setFocusedMenuIndex(int index)
public static void setDefaultSystemMenuBar(MenuBar menuBar)
menuBar
- the menu barprivate static MenuBarSkin getMenuBarSkin(Stage stage)
private static void setSystemMenu(Stage stage)
private static void initSystemMenuBar()
public final void setSpacing(double value)
public final double getSpacing()
public final DoubleProperty spacingProperty()
getSpacing()
,
setSpacing(double)
public final void setContainerAlignment(Pos value)
public final Pos getContainerAlignment()
public final <any> containerAlignmentProperty()
public void dispose()
protected double snappedTopInset()
protected double snappedBottomInset()
protected double snappedLeftInset()
protected double snappedRightInset()
protected void layoutChildren(double x, double y, double w, double h)
protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
protected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
MenuButton getNodeForMenu(int i)
int getFocusedMenuIndex()
private boolean menusContainCustomMenuItem()
private boolean menuContainsCustomMenuItem(Menu menu)
private int getMenuBarButtonIndex(MenuBarButton m)
private void updateActionListeners(MenuItem item, boolean add)
private void rebuildUI()
private void cleanUpSystemMenu()
private boolean isMenuEmpty(Menu menu)
private void resetOpenMenu()
private void unSelectMenus()
private void menuModeStart(int newIndex)
private void menuModeEnd()
private void moveToMenu(Direction dir, boolean doShow)
private java.util.Optional<<any>> findSibling(Direction dir, int startIndex)
private void updateFocusedIndex()
private void clearMenuButtonHover()
public static java.util.List<<any>> getClassCssMetaData()
public java.util.List<<any>> getCssMetaData()
protected java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)