pivot.wtk.skin.terra
Class TerraMenuBarSkin

java.lang.Object
  extended by pivot.wtk.skin.ComponentSkin
      extended by pivot.wtk.skin.ContainerSkin
          extended by pivot.wtk.skin.terra.TerraMenuBarSkin
All Implemented Interfaces:
ComponentKeyListener, ComponentLayoutListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ConstrainedVisual, ContainerListener, MenuBarListener, Skin, Visual

public class TerraMenuBarSkin
extends ContainerSkin
implements MenuBarListener

Menu bar skin.

Author:
gbrown

Nested Class Summary
 
Nested classes/interfaces inherited from class pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Field Summary
 
Fields inherited from class pivot.wtk.skin.ComponentSkin
SHOW_TOOLTIP_TIMEOUT
 
Constructor Summary
TerraMenuBarSkin()
           
 
Method Summary
 void activeChanged(MenuBar menuBar)
          Called when the menu bar's active state has changed.
 java.awt.Color getColor()
           
 java.awt.Color getDisabledColor()
           
 java.awt.Font getFont()
           
 java.awt.Color getHighlightBackgroundColor()
           
 java.awt.Color getHighlightColor()
           
 int getPreferredHeight(int width)
          Returns the visual's preferred height given the provided width constraint.
 Dimensions getPreferredSize()
          Returns the visual's unconstrained preferred size.
 int getPreferredWidth(int height)
          Returns the visual's preferred width given the provided height constraint.
 int getSpacing()
           
 void install(Component component)
          Associates a skin with a component.
 void itemInserted(MenuBar menuBar, int index)
          Called when a menu bar item has been inserted.
 void itemsRemoved(MenuBar menuBar, int index, Sequence<MenuBar.Item> removed)
          Called when menu bar items have been removed.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void setBackgroundColor(int color)
           
 void setColor(java.awt.Color color)
           
 void setColor(int color)
           
 void setColor(java.lang.String color)
           
 void setDisabledColor(java.awt.Color disabledColor)
           
 void setDisabledColor(int color)
           
 void setDisabledColor(java.lang.String disabledColor)
           
 void setFont(java.awt.Font font)
           
 void setFont(java.lang.String font)
           
 void setHighlightBackgroundColor(java.awt.Color highlightBackgroundColor)
           
 void setHighlightBackgroundColor(int color)
           
 void setHighlightBackgroundColor(java.lang.String highlightBackgroundColor)
           
 void setHighlightColor(java.awt.Color highlightColor)
           
 void setHighlightColor(int color)
           
 void setHighlightColor(java.lang.String highlightColor)
           
 void setSpacing(int spacing)
           
 void uninstall()
          Dissociates a skin from a component.
 
Methods inherited from class pivot.wtk.skin.ContainerSkin
componentInserted, componentsRemoved, contextKeyChanged, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, paint, setBackgroundColor, setBackgroundColor, setBackgroundPaint
 
Methods inherited from class pivot.wtk.skin.ComponentSkin
cursorChanged, decodeColor, displayableChanged, enabledChanged, focusedChanged, getComponent, getHeight, getWidth, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, styleUpdated, tooltipTextChanged, visibleChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerraMenuBarSkin

public TerraMenuBarSkin()
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 ContainerSkin
Parameters:
component - The component to which the skin is being attached.

uninstall

public void uninstall()
Description copied from interface: Skin
Dissociates a skin from a component.

Specified by:
uninstall in interface Skin
Overrides:
uninstall in class ContainerSkin

getPreferredWidth

public int getPreferredWidth(int height)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred width given the provided height constraint.

Specified by:
getPreferredWidth in interface ConstrainedVisual
Overrides:
getPreferredWidth in class ContainerSkin
Parameters:
height - The height by which to constrain the preferred width, or -1 for no constraint.

getPreferredHeight

public int getPreferredHeight(int width)
Description copied from interface: ConstrainedVisual
Returns the visual's preferred height given the provided width constraint.

Specified by:
getPreferredHeight in interface ConstrainedVisual
Overrides:
getPreferredHeight in class ContainerSkin
Parameters:
width - The width by which to constrain the preferred height, or -1 for no constraint.

getPreferredSize

public Dimensions getPreferredSize()
Description copied from interface: ConstrainedVisual
Returns the visual's unconstrained preferred size.

Specified by:
getPreferredSize in interface ConstrainedVisual
Overrides:
getPreferredSize in class ComponentSkin

layout

public void layout()
Description copied from interface: Skin
If the component on which the skin is installed is a container, lays out the container's children.

Specified by:
layout in interface Skin

setBackgroundColor

public final void setBackgroundColor(int color)

getFont

public java.awt.Font getFont()

setFont

public void setFont(java.awt.Font font)

setFont

public final void setFont(java.lang.String font)

getColor

public java.awt.Color getColor()

setColor

public void setColor(java.awt.Color color)

setColor

public final void setColor(java.lang.String color)

setColor

public final void setColor(int color)

getDisabledColor

public java.awt.Color getDisabledColor()

setDisabledColor

public void setDisabledColor(java.awt.Color disabledColor)

setDisabledColor

public final void setDisabledColor(java.lang.String disabledColor)

setDisabledColor

public final void setDisabledColor(int color)

getHighlightColor

public java.awt.Color getHighlightColor()

setHighlightColor

public void setHighlightColor(java.awt.Color highlightColor)

setHighlightColor

public final void setHighlightColor(java.lang.String highlightColor)

setHighlightColor

public final void setHighlightColor(int color)

getHighlightBackgroundColor

public java.awt.Color getHighlightBackgroundColor()

setHighlightBackgroundColor

public void setHighlightBackgroundColor(java.awt.Color highlightBackgroundColor)

setHighlightBackgroundColor

public final void setHighlightBackgroundColor(java.lang.String highlightBackgroundColor)

setHighlightBackgroundColor

public final void setHighlightBackgroundColor(int color)

getSpacing

public int getSpacing()

setSpacing

public void setSpacing(int spacing)

itemInserted

public void itemInserted(MenuBar menuBar,
                         int index)
Description copied from interface: MenuBarListener
Called when a menu bar item has been inserted.

Specified by:
itemInserted in interface MenuBarListener

itemsRemoved

public void itemsRemoved(MenuBar menuBar,
                         int index,
                         Sequence<MenuBar.Item> removed)
Description copied from interface: MenuBarListener
Called when menu bar items have been removed.

Specified by:
itemsRemoved in interface MenuBarListener

activeChanged

public void activeChanged(MenuBar menuBar)
Description copied from interface: MenuBarListener
Called when the menu bar's active state has changed.

Specified by:
activeChanged in interface MenuBarListener