org.apache.pivot.wtk.skin
Class MenuItemSkin

java.lang.Object
  extended by org.apache.pivot.wtk.skin.ComponentSkin
      extended by org.apache.pivot.wtk.skin.ButtonSkin
          extended by org.apache.pivot.wtk.skin.MenuItemSkin
All Implemented Interfaces:
ButtonListener, ButtonPressListener, ButtonStateListener, ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ComponentTooltipListener, ConstrainedVisual, Menu.ItemListener, Skin, Visual
Direct Known Subclasses:
TerraMenuItemSkin

public abstract class MenuItemSkin
extends ButtonSkin
implements Menu.ItemListener

Abstract base class for menu item skins.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ButtonListener
ButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter
 
Field Summary
protected  ApplicationContext.ScheduledCallback buttonPressCallback
           
protected  int buttonPressInterval
           
protected  MenuPopup menuPopup
           
 
Fields inherited from class org.apache.pivot.wtk.skin.ButtonSkin
highlighted
 
Constructor Summary
MenuItemSkin()
           
 
Method Summary
 void activeChanged(Menu.Item menuItem)
          Called when an item's active state has changed.
 void buttonPressed(Button button)
          Called when a button is pressed.
 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(Menu.Item menuItem, Menu previousMenu)
          Called when an item's menu has changed.
 boolean mouseDown(Component component, Mouse.Button button, int x, int y)
          Called when a mouse button is pressed over a component.
 void mouseOut(Component component)
          Called when the mouse exits 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, dataRendererChanged, focusedChanged, layout, 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, mouseClick, 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.ConstrainedVisual
getPreferredHeight, getPreferredWidth
 
Methods inherited from interface org.apache.pivot.wtk.Visual
paint
 

Field Detail

menuPopup

protected MenuPopup menuPopup

buttonPressInterval

protected int buttonPressInterval

buttonPressCallback

protected ApplicationContext.ScheduledCallback buttonPressCallback
Constructor Detail

MenuItemSkin

public MenuItemSkin()
Method Detail

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

mouseOut

public void mouseOut(Component component)
Description copied from interface: ComponentMouseListener
Called when the mouse exits a component.

Specified by:
mouseOut in interface ComponentMouseListener
Overrides:
mouseOut 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.

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.

buttonPressed

public void buttonPressed(Button button)
Description copied from interface: ButtonPressListener
Called when a button is pressed.

Specified by:
buttonPressed in interface ButtonPressListener
Overrides:
buttonPressed in class ButtonSkin

menuChanged

public void menuChanged(Menu.Item menuItem,
                        Menu previousMenu)
Description copied from interface: Menu.ItemListener
Called when an item's menu has changed.

Specified by:
menuChanged in interface Menu.ItemListener

activeChanged

public void activeChanged(Menu.Item menuItem)
Description copied from interface: Menu.ItemListener
Called when an item's active state has changed.

Specified by:
activeChanged in interface Menu.ItemListener