org.apache.pivot.wtk.skin.terra
Class TerraMenuSkin

java.lang.Object
  extended by org.apache.pivot.wtk.skin.ComponentSkin
      extended by org.apache.pivot.wtk.skin.ContainerSkin
          extended by org.apache.pivot.wtk.skin.terra.TerraMenuSkin
All Implemented Interfaces:
org.apache.pivot.wtk.ComponentKeyListener, org.apache.pivot.wtk.ComponentListener, org.apache.pivot.wtk.ComponentMouseButtonListener, org.apache.pivot.wtk.ComponentMouseListener, org.apache.pivot.wtk.ComponentMouseWheelListener, org.apache.pivot.wtk.ComponentStateListener, org.apache.pivot.wtk.ComponentTooltipListener, org.apache.pivot.wtk.ConstrainedVisual, org.apache.pivot.wtk.ContainerListener, org.apache.pivot.wtk.ContainerMouseListener, org.apache.pivot.wtk.Menu.SectionListener, org.apache.pivot.wtk.MenuListener, org.apache.pivot.wtk.Skin, org.apache.pivot.wtk.Visual

public class TerraMenuSkin
extends org.apache.pivot.wtk.skin.ContainerSkin
implements org.apache.pivot.wtk.MenuListener, org.apache.pivot.wtk.Menu.SectionListener

Menu skin.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
org.apache.pivot.wtk.skin.ContainerSkin.IndexFocusTraversalPolicy
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.MenuListener
org.apache.pivot.wtk.MenuListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerListener
org.apache.pivot.wtk.ContainerListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerMouseListener
org.apache.pivot.wtk.ContainerMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
org.apache.pivot.wtk.ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
org.apache.pivot.wtk.ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
org.apache.pivot.wtk.ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
org.apache.pivot.wtk.ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
org.apache.pivot.wtk.ComponentKeyListener.Adapter
 
Constructor Summary
TerraMenuSkin()
           
 
Method Summary
 void activeItemChanged(org.apache.pivot.wtk.Menu menu, org.apache.pivot.wtk.Menu.Item previousActiveItem)
           
 Color getActiveBackgroundColor()
           
 Color getActiveColor()
           
 Color getColor()
           
 Color getDisabledColor()
           
 Font getFont()
           
 int getMargin()
           
 Color getMarginColor()
           
 int getPreferredHeight(int width)
           
 org.apache.pivot.wtk.Dimensions getPreferredSize()
           
 int getPreferredWidth(int height)
           
 int getSectionSpacing()
           
 Color getSeparatorColor()
           
 boolean getShowKeyboardShortcuts()
           
 void install(org.apache.pivot.wtk.Component component)
           
 boolean isFocusable()
           
 void itemInserted(org.apache.pivot.wtk.Menu.Section section, int index)
           
 void itemsRemoved(org.apache.pivot.wtk.Menu.Section section, int index, org.apache.pivot.collections.Sequence<org.apache.pivot.wtk.Menu.Item> removed)
           
 boolean keyPressed(org.apache.pivot.wtk.Component component, int keyCode, org.apache.pivot.wtk.Keyboard.KeyLocation keyLocation)
          UP Select the previous enabled menu item.
 boolean keyReleased(org.apache.pivot.wtk.Component component, int keyCode, org.apache.pivot.wtk.Keyboard.KeyLocation keyLocation)
          SPACE 'presses' the active menu item if it does not have a sub-menu.
 boolean keyTyped(org.apache.pivot.wtk.Component component, char character)
          Select the next enabled menu item where the first character of the rendered text matches the typed key (case insensitive).
 void layout()
           
 void nameChanged(org.apache.pivot.wtk.Menu.Section section, String previousName)
           
 void paint(Graphics2D graphics)
           
 void sectionInserted(org.apache.pivot.wtk.Menu menu, int index)
           
 void sectionsRemoved(org.apache.pivot.wtk.Menu menu, int index, org.apache.pivot.collections.Sequence<org.apache.pivot.wtk.Menu.Section> removed)
           
 void setActiveBackgroundColor(Color activeBackgroundColor)
           
 void setActiveBackgroundColor(String activeBackgroundColor)
           
 void setActiveColor(Color activeColor)
           
 void setActiveColor(String activeColor)
           
 void setColor(Color color)
           
 void setColor(String color)
           
 void setDisabledColor(Color disabledColor)
           
 void setDisabledColor(String disabledColor)
           
 void setFont(org.apache.pivot.collections.Dictionary<String,?> font)
           
 void setFont(Font font)
           
 void setFont(String font)
           
 void setMargin(int margin)
           
 void setMarginColor(Color marginColor)
           
 void setSectionSpacing(int sectionSpacing)
           
 void setSeparatorColor(Color separatorColor)
           
 void setShowKeyboardShortcuts(boolean showKeyboardShortcuts)
           
 
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isOpaque, mouseDown, mouseMove, mouseUp, mouseWheel, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint, setBackgroundPaint
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, getBaseline, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, 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
 

Constructor Detail

TerraMenuSkin

public TerraMenuSkin()
Method Detail

install

public void install(org.apache.pivot.wtk.Component component)
Specified by:
install in interface org.apache.pivot.wtk.Skin
Overrides:
install in class org.apache.pivot.wtk.skin.ContainerSkin

isFocusable

public boolean isFocusable()
Specified by:
isFocusable in interface org.apache.pivot.wtk.Skin
Overrides:
isFocusable in class org.apache.pivot.wtk.skin.ContainerSkin

getPreferredWidth

public int getPreferredWidth(int height)
Specified by:
getPreferredWidth in interface org.apache.pivot.wtk.ConstrainedVisual
Overrides:
getPreferredWidth in class org.apache.pivot.wtk.skin.ContainerSkin

getPreferredHeight

public int getPreferredHeight(int width)
Specified by:
getPreferredHeight in interface org.apache.pivot.wtk.ConstrainedVisual
Overrides:
getPreferredHeight in class org.apache.pivot.wtk.skin.ContainerSkin

getPreferredSize

public org.apache.pivot.wtk.Dimensions getPreferredSize()
Specified by:
getPreferredSize in interface org.apache.pivot.wtk.ConstrainedVisual
Overrides:
getPreferredSize in class org.apache.pivot.wtk.skin.ComponentSkin

layout

public void layout()
Specified by:
layout in interface org.apache.pivot.wtk.Skin

paint

public void paint(Graphics2D graphics)
Specified by:
paint in interface org.apache.pivot.wtk.Visual
Overrides:
paint in class org.apache.pivot.wtk.skin.ContainerSkin

getFont

public Font getFont()

setFont

public void setFont(Font font)

setFont

public final void setFont(String font)

setFont

public final void setFont(org.apache.pivot.collections.Dictionary<String,?> font)

getColor

public Color getColor()

setColor

public void setColor(Color color)

setColor

public final void setColor(String color)

getDisabledColor

public Color getDisabledColor()

setDisabledColor

public void setDisabledColor(Color disabledColor)

setDisabledColor

public final void setDisabledColor(String disabledColor)

getActiveColor

public Color getActiveColor()

setActiveColor

public void setActiveColor(Color activeColor)

setActiveColor

public final void setActiveColor(String activeColor)

getActiveBackgroundColor

public Color getActiveBackgroundColor()

setActiveBackgroundColor

public void setActiveBackgroundColor(Color activeBackgroundColor)

setActiveBackgroundColor

public final void setActiveBackgroundColor(String activeBackgroundColor)

getMarginColor

public Color getMarginColor()

setMarginColor

public void setMarginColor(Color marginColor)

getMargin

public int getMargin()

setMargin

public void setMargin(int margin)

getSeparatorColor

public Color getSeparatorColor()

setSeparatorColor

public void setSeparatorColor(Color separatorColor)

getSectionSpacing

public int getSectionSpacing()

setSectionSpacing

public void setSectionSpacing(int sectionSpacing)

getShowKeyboardShortcuts

public boolean getShowKeyboardShortcuts()

setShowKeyboardShortcuts

public void setShowKeyboardShortcuts(boolean showKeyboardShortcuts)

keyPressed

public boolean keyPressed(org.apache.pivot.wtk.Component component,
                          int keyCode,
                          org.apache.pivot.wtk.Keyboard.KeyLocation keyLocation)
UP Select the previous enabled menu item.
DOWN Select the next enabled menu item.
LEFT Close the current sub-menu.
RIGHT Open the sub-menu of the current menu item.
ENTER 'presses' the active menu item if it does not have a sub-menu.

Specified by:
keyPressed in interface org.apache.pivot.wtk.ComponentKeyListener
Overrides:
keyPressed in class org.apache.pivot.wtk.skin.ComponentSkin

keyReleased

public boolean keyReleased(org.apache.pivot.wtk.Component component,
                           int keyCode,
                           org.apache.pivot.wtk.Keyboard.KeyLocation keyLocation)
SPACE 'presses' the active menu item if it does not have a sub-menu.

Specified by:
keyReleased in interface org.apache.pivot.wtk.ComponentKeyListener
Overrides:
keyReleased in class org.apache.pivot.wtk.skin.ComponentSkin

keyTyped

public boolean keyTyped(org.apache.pivot.wtk.Component component,
                        char character)
Select the next enabled menu item where the first character of the rendered text matches the typed key (case insensitive).

Specified by:
keyTyped in interface org.apache.pivot.wtk.ComponentKeyListener
Overrides:
keyTyped in class org.apache.pivot.wtk.skin.ComponentSkin

sectionInserted

public void sectionInserted(org.apache.pivot.wtk.Menu menu,
                            int index)
Specified by:
sectionInserted in interface org.apache.pivot.wtk.MenuListener

sectionsRemoved

public void sectionsRemoved(org.apache.pivot.wtk.Menu menu,
                            int index,
                            org.apache.pivot.collections.Sequence<org.apache.pivot.wtk.Menu.Section> removed)
Specified by:
sectionsRemoved in interface org.apache.pivot.wtk.MenuListener

itemInserted

public void itemInserted(org.apache.pivot.wtk.Menu.Section section,
                         int index)
Specified by:
itemInserted in interface org.apache.pivot.wtk.Menu.SectionListener

itemsRemoved

public void itemsRemoved(org.apache.pivot.wtk.Menu.Section section,
                         int index,
                         org.apache.pivot.collections.Sequence<org.apache.pivot.wtk.Menu.Item> removed)
Specified by:
itemsRemoved in interface org.apache.pivot.wtk.Menu.SectionListener

nameChanged

public void nameChanged(org.apache.pivot.wtk.Menu.Section section,
                        String previousName)
Specified by:
nameChanged in interface org.apache.pivot.wtk.Menu.SectionListener

activeItemChanged

public void activeItemChanged(org.apache.pivot.wtk.Menu menu,
                              org.apache.pivot.wtk.Menu.Item previousActiveItem)
Specified by:
activeItemChanged in interface org.apache.pivot.wtk.MenuListener