org.apache.pivot.wtk.skin
Class MenuBarItemSkin
java.lang.Object
org.apache.pivot.wtk.skin.ComponentSkin
org.apache.pivot.wtk.skin.ButtonSkin
org.apache.pivot.wtk.skin.MenuBarItemSkin
- All Implemented Interfaces:
- ButtonListener, ButtonPressListener, ButtonStateListener, ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ComponentTooltipListener, ConstrainedVisual, MenuBar.ItemListener, Skin, Visual
- Direct Known Subclasses:
- TerraMenuBarItemSkin
public abstract class MenuBarItemSkin
- extends ButtonSkin
- implements MenuBar.ItemListener
Abstract base class for menu bar item skins.
Method Summary |
void |
activeChanged(MenuBar.Item menuBarItem)
Called when an item's active state has changed. |
void |
enabledChanged(Component component)
Called when a component's enabled state has changed. |
void |
install(Component component)
Associates a skin with a component. |
boolean |
isFocusable()
By default, skins are focusable. |
void |
menuChanged(MenuBar.Item menuBarItem,
Menu previousMenu)
Called when an item's menu has changed. |
boolean |
mouseClick(Component component,
Mouse.Button button,
int x,
int y,
int count)
Called when a mouse button is clicked over a component. |
boolean |
mouseDown(Component component,
Mouse.Button button,
int x,
int y)
Called when a mouse button is pressed over a component. |
void |
mouseOver(Component component)
Called when the mouse enters a component. |
boolean |
mouseUp(Component component,
Mouse.Button button,
int x,
int y)
Called when a mouse button is released over a component. |
Methods inherited from class org.apache.pivot.wtk.skin.ButtonSkin |
actionChanged, buttonDataChanged, buttonGroupChanged, buttonPressed, dataRendererChanged, focusedChanged, layout, mouseOut, stateChanged, toggleButtonChanged, triStateChanged |
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin |
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, getBaseline, getBaseline, getComponent, getHeight, getPreferredSize, getWidth, heightLimitsChanged, invalidateComponent, isOpaque, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseMove, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.pivot.wtk.Visual |
paint |
menuPopup
protected MenuPopup menuPopup
MenuBarItemSkin
public MenuBarItemSkin()
install
public void install(Component component)
- Description copied from interface:
Skin
- Associates a skin with a component.
- Specified by:
install
in interface Skin
- Overrides:
install
in class ButtonSkin
- Parameters:
component
- The component to which the skin is being attached.
isFocusable
public boolean isFocusable()
- Description copied from class:
ComponentSkin
- By default, skins are focusable.
- Specified by:
isFocusable
in interface Skin
- Overrides:
isFocusable
in class ComponentSkin
- Returns:
- true if this skin is focusable; false, otherwise.
mouseOver
public void mouseOver(Component component)
- Description copied from interface:
ComponentMouseListener
- Called when the mouse enters a component.
- Specified by:
mouseOver
in interface ComponentMouseListener
- Overrides:
mouseOver
in class ButtonSkin
mouseDown
public boolean mouseDown(Component component,
Mouse.Button button,
int x,
int y)
- Description copied from interface:
ComponentMouseButtonListener
- Called when a mouse button is pressed over a component.
- Specified by:
mouseDown
in interface ComponentMouseButtonListener
- Overrides:
mouseDown
in class ComponentSkin
- Returns:
- true to consume the event; false to allow it to
propagate.
mouseUp
public boolean mouseUp(Component component,
Mouse.Button button,
int x,
int y)
- Description copied from interface:
ComponentMouseButtonListener
- Called when a mouse button is released over a component.
- Specified by:
mouseUp
in interface ComponentMouseButtonListener
- Overrides:
mouseUp
in class ComponentSkin
- Returns:
- true to consume the event; false to allow it to
propagate.
mouseClick
public boolean mouseClick(Component component,
Mouse.Button button,
int x,
int y,
int count)
- Description copied from interface:
ComponentMouseButtonListener
- Called when a mouse button is clicked over a component.
- Specified by:
mouseClick
in interface ComponentMouseButtonListener
- Overrides:
mouseClick
in class ComponentSkin
- Returns:
- true to consume the event; false to allow it to
propagate.
enabledChanged
public void enabledChanged(Component component)
- Description copied from interface:
ComponentStateListener
- Called when a component's enabled state has changed.
Called both when the component is enabled and when it is disabled.
The component's enabled
flag has already been set when this
method is called so the new state can be determined by calling the
Component.isEnabled()
method.
- Specified by:
enabledChanged
in interface ComponentStateListener
- Overrides:
enabledChanged
in class ButtonSkin
- Parameters:
component
- The component whose enabled state is changing.
menuChanged
public void menuChanged(MenuBar.Item menuBarItem,
Menu previousMenu)
- Description copied from interface:
MenuBar.ItemListener
- Called when an item's menu has changed.
- Specified by:
menuChanged
in interface MenuBar.ItemListener
activeChanged
public void activeChanged(MenuBar.Item menuBarItem)
- Description copied from interface:
MenuBar.ItemListener
- Called when an item's active state has changed.
- Specified by:
activeChanged
in interface MenuBar.ItemListener