org.apache.pivot.wtk.skin
Class ButtonSkin

java.lang.Object
  extended by org.apache.pivot.wtk.skin.ComponentSkin
      extended by org.apache.pivot.wtk.skin.ButtonSkin
All Implemented Interfaces:
ButtonListener, ButtonPressListener, ButtonStateListener, ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ComponentTooltipListener, ConstrainedVisual, Skin, Visual
Direct Known Subclasses:
CalendarButtonSkin, CheckboxSkin, ColorChooserButtonSkin, LinkButtonSkin, ListButtonSkin, MenuBarItemSkin, MenuButtonSkin, MenuItemSkin, PushButtonSkin, RadioButtonSkin, TerraAccordionSkin.PanelHeaderSkin, TerraCalendarSkin.DateButtonSkin, TerraPanoramaSkin.ScrollButtonSkin, TerraTabPaneSkin.TabButtonSkin

public abstract class ButtonSkin
extends ComponentSkin
implements ButtonListener, ButtonStateListener, ButtonPressListener

Abstract base class for button 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  boolean highlighted
           
 
Constructor Summary
ButtonSkin()
           
 
Method Summary
 void actionChanged(Button button, Action previousAction)
          Called when a button's action has changed.
 void buttonDataChanged(Button button, Object previousButtonData)
          Called when a button's data has changed.
 void buttonGroupChanged(Button button, ButtonGroup previousButtonGroup)
          Called when a button's button group has changed.
 void buttonPressed(Button button)
          Called when a button is pressed.
 void dataRendererChanged(Button button, Button.DataRenderer previousDataRenderer)
          Called when a button's data renderer has changed.
 void enabledChanged(Component component)
          Called when a component's enabled state has changed.
 void focusedChanged(Component component, Component obverseComponent)
          Called when a component's focused state has changed.
 void install(Component component)
          Associates a skin with a component.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void mouseOut(Component component)
          Called when the mouse exits a component.
 void mouseOver(Component component)
          Called when the mouse enters a component.
 void stateChanged(Button button, Button.State previousState)
          Called when a button's state has changed.
 void toggleButtonChanged(Button button)
          Called when a button's toggle button flag has changed.
 void triStateChanged(Button button)
          Called when a button's tri-state flag has changed.
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, getBaseline, getBaseline, getComponent, getHeight, getPreferredSize, getWidth, heightLimitsChanged, invalidateComponent, isFocusable, isOpaque, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, 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
 
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
getPreferredHeight, getPreferredWidth
 
Methods inherited from interface org.apache.pivot.wtk.Visual
paint
 

Field Detail

highlighted

protected boolean highlighted
Constructor Detail

ButtonSkin

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

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

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 ComponentSkin
Parameters:
component - The component whose enabled state is changing.

focusedChanged

public void focusedChanged(Component component,
                           Component obverseComponent)
Description copied from interface: ComponentStateListener
Called when a component's focused state has changed.

This will be called both when a component gains focus and when it loses focus. The currently focused component has already been set when this method is called, so that the new state of the component can be determined by calling the Component.isFocused() method.

Specified by:
focusedChanged in interface ComponentStateListener
Overrides:
focusedChanged in class ComponentSkin
Parameters:
component - The component that is either gaining focus or the one that previously had focus and is now losing it.
obverseComponent - If the component is gaining focus, this is the component that is losing focus. If the component is losing focus this is the component that is gaining the focus instead.

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 ComponentSkin

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 ComponentSkin

buttonDataChanged

public void buttonDataChanged(Button button,
                              Object previousButtonData)
Description copied from interface: ButtonListener
Called when a button's data has changed.

Specified by:
buttonDataChanged in interface ButtonListener

dataRendererChanged

public void dataRendererChanged(Button button,
                                Button.DataRenderer previousDataRenderer)
Description copied from interface: ButtonListener
Called when a button's data renderer has changed.

Specified by:
dataRendererChanged in interface ButtonListener

actionChanged

public void actionChanged(Button button,
                          Action previousAction)
Description copied from interface: ButtonListener
Called when a button's action has changed.

Specified by:
actionChanged in interface ButtonListener

toggleButtonChanged

public void toggleButtonChanged(Button button)
Description copied from interface: ButtonListener
Called when a button's toggle button flag has changed.

Specified by:
toggleButtonChanged in interface ButtonListener

triStateChanged

public void triStateChanged(Button button)
Description copied from interface: ButtonListener
Called when a button's tri-state flag has changed.

Specified by:
triStateChanged in interface ButtonListener

buttonGroupChanged

public void buttonGroupChanged(Button button,
                               ButtonGroup previousButtonGroup)
Description copied from interface: ButtonListener
Called when a button's button group has changed.

Specified by:
buttonGroupChanged in interface ButtonListener

stateChanged

public void stateChanged(Button button,
                         Button.State previousState)
Description copied from interface: ButtonStateListener
Called when a button's state has changed.

Specified by:
stateChanged in interface ButtonStateListener

buttonPressed

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

Specified by:
buttonPressed in interface ButtonPressListener