org.apache.pivot.wtk.skin
Class ListButtonSkin

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.ListButtonSkin
All Implemented Interfaces:
ButtonListener, ButtonPressListener, ButtonStateListener, ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ComponentTooltipListener, ConstrainedVisual, ListButton.Skin, ListButtonListener, ListButtonSelectionListener, Skin, Visual
Direct Known Subclasses:
TerraListButtonSkin

public abstract class ListButtonSkin
extends ButtonSkin
implements ListButton.Skin, ListButtonListener, ListButtonSelectionListener

Abstract base class for list button skins.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ListButtonListener
ListButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ListButtonSelectionListener
ListButtonSelectionListener.Adapter
 
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  ListView listView
           
protected  Window listViewPopup
           
protected  boolean pressed
           
 
Fields inherited from class org.apache.pivot.wtk.skin.ButtonSkin
highlighted
 
Constructor Summary
ListButtonSkin()
           
 
Method Summary
 void disabledItemFilterChanged(ListButton listButton, Filter<?> previousDisabledItemFilter)
          Called when a list button's disabled item filter 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.
 Window getListViewPopup()
           
abstract  Bounds getTriggerBounds()
           
 void install(Component component)
          Associates a skin with a component.
 void itemRendererChanged(ListButton listButton, ListView.ItemRenderer previousItemRenderer)
          Called when a list button's item renderer has changed.
 boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
          SPACE Repaints the component to reflect the pressed state and opens the popup.
 boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
          SPACE 'presses' the button.
 boolean keyTyped(Component component, char character)
          Select the next enabled list item where the first character of the rendered text matches the typed key (case insensitive).
 void listDataChanged(ListButton listButton, List<?> previousListData)
          Called when a list button's list data has changed.
 void listSizeChanged(ListButton listButton, int previousListSize)
          Called when a list button's list size 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 mouseOut(Component component)
          Called when the mouse exits a component.
 boolean mouseUp(Component component, Mouse.Button button, int x, int y)
          Called when a mouse button is released over a component.
 void repeatableChanged(ListButton listButton)
          Called when a list button's repeatable flag has changed.
 void selectedIndexChanged(ListButton listButton, int previousSelectedIndex)
          Called when a list button's selected index has changed.
 void selectedItemChanged(ListButton listButton, Object previousSelectedItem)
          Called when a list button's selected item has changed.
 
Methods inherited from class org.apache.pivot.wtk.skin.ButtonSkin
actionChanged, buttonDataChanged, buttonGroupChanged, buttonPressed, dataRendererChanged, layout, mouseOver, 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, isFocusable, isOpaque, 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.ConstrainedVisual
getPreferredHeight, getPreferredWidth
 
Methods inherited from interface org.apache.pivot.wtk.Visual
paint
 

Field Detail

listView

protected ListView listView

listViewPopup

protected Window listViewPopup

pressed

protected boolean pressed
Constructor Detail

ListButtonSkin

public ListButtonSkin()
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.

getListViewPopup

public Window getListViewPopup()
Specified by:
getListViewPopup in interface ListButton.Skin

getTriggerBounds

public abstract Bounds getTriggerBounds()

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.

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 ButtonSkin
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.

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.

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.

keyPressed

public boolean keyPressed(Component component,
                          int keyCode,
                          Keyboard.KeyLocation keyLocation)
SPACE Repaints the component to reflect the pressed state and opens the popup.
UP Selects the previous enabled list item.
DOWN Selects the next enabled list item.

Specified by:
keyPressed in interface ComponentKeyListener
Overrides:
keyPressed in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.
See Also:
keyReleased(Component, int, org.apache.pivot.wtk.Keyboard.KeyLocation)

keyReleased

public boolean keyReleased(Component component,
                           int keyCode,
                           Keyboard.KeyLocation keyLocation)
SPACE 'presses' the button.

Specified by:
keyReleased in interface ComponentKeyListener
Overrides:
keyReleased in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

keyTyped

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

Specified by:
keyTyped in interface ComponentKeyListener
Overrides:
keyTyped in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

listDataChanged

public void listDataChanged(ListButton listButton,
                            List<?> previousListData)
Description copied from interface: ListButtonListener
Called when a list button's list data has changed.

Specified by:
listDataChanged in interface ListButtonListener

itemRendererChanged

public void itemRendererChanged(ListButton listButton,
                                ListView.ItemRenderer previousItemRenderer)
Description copied from interface: ListButtonListener
Called when a list button's item renderer has changed.

Specified by:
itemRendererChanged in interface ListButtonListener

repeatableChanged

public void repeatableChanged(ListButton listButton)
Description copied from interface: ListButtonListener
Called when a list button's repeatable flag has changed.

Specified by:
repeatableChanged in interface ListButtonListener

disabledItemFilterChanged

public void disabledItemFilterChanged(ListButton listButton,
                                      Filter<?> previousDisabledItemFilter)
Description copied from interface: ListButtonListener
Called when a list button's disabled item filter has changed.

Specified by:
disabledItemFilterChanged in interface ListButtonListener

listSizeChanged

public void listSizeChanged(ListButton listButton,
                            int previousListSize)
Description copied from interface: ListButtonListener
Called when a list button's list size has changed.

Specified by:
listSizeChanged in interface ListButtonListener

selectedIndexChanged

public void selectedIndexChanged(ListButton listButton,
                                 int previousSelectedIndex)
Description copied from interface: ListButtonSelectionListener
Called when a list button's selected index has changed.

Specified by:
selectedIndexChanged in interface ListButtonSelectionListener
Parameters:
listButton - The source of the event.
previousSelectedIndex - If the selection changed directly, contains the index that was previously selected. Otherwise, contains the current selection.

selectedItemChanged

public void selectedItemChanged(ListButton listButton,
                                Object previousSelectedItem)
Description copied from interface: ListButtonSelectionListener
Called when a list button's selected item has changed.

Specified by:
selectedItemChanged in interface ListButtonSelectionListener
Parameters:
listButton - The source of the event.
previousSelectedItem - The item that was previously selected, or null if the previous selection cannot be determined.