Package org.apache.pivot.wtk.skin
Class ListButtonSkin
- java.lang.Object
-
- org.apache.pivot.wtk.skin.ComponentSkin
-
- org.apache.pivot.wtk.skin.ButtonSkin
-
- 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.ButtonListener
ButtonListener.Adapter, ButtonListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ButtonPressListener
ButtonPressListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ButtonStateListener
ButtonStateListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter, ComponentKeyListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter, ComponentListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter, ComponentMouseButtonListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter, ComponentMouseListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseWheelListener
ComponentMouseWheelListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter, ComponentStateListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentTooltipListener
ComponentTooltipListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ListButtonListener
ListButtonListener.Adapter, ListButtonListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ListButtonSelectionListener
ListButtonSelectionListener.Adapter, ListButtonSelectionListener.Listeners
-
-
Field Summary
Fields Modifier and Type Field Description protected ListViewlistViewprotected WindowlistViewPopupprotected booleanpressed-
Fields inherited from class org.apache.pivot.wtk.skin.ButtonSkin
highlighted
-
-
Constructor Summary
Constructors Constructor Description ListButtonSkin()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddisabledItemFilterChanged(ListButton listButton, Filter<?> previousDisabledItemFilter)Called when a list button's disabled item filter has changed.voidenabledChanged(Component component)Called when a component's enabled state has changed.voidfocusedChanged(Component component, Component obverseComponent)Called when a component's focused state has changed.WindowgetListViewPopup()abstract BoundsgetTriggerBounds()voidinstall(Component component)Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.voiditemRendererChanged(ListButton listButton, ListView.ItemRenderer previousItemRenderer)Called when a list button's item renderer has changed.booleankeyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)booleankeyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation)SPACE'presses' the button.booleankeyTyped(Component component, char character)Select the next enabled list item where the first character of the rendered text matches the typed key (case insensitive).voidlistDataChanged(ListButton listButton, List<?> previousListData)Called when a list button's list data has changed.voidlistSizeChanged(ListButton listButton, int previousListSize)Called when a list button's list size has changed.booleanmouseClick(Component component, Mouse.Button button, int x, int y, int count)Called when a mouse button is clicked over a component.booleanmouseDown(Component component, Mouse.Button button, int x, int y)Called when a mouse button is pressed over a component.voidmouseOut(Component component)Called when the mouse exits a component.booleanmouseUp(Component component, Mouse.Button button, int x, int y)Called when a mouse button is released over a component.voidrepeatableChanged(ListButton listButton)Called when a list button's repeatable flag has changed.voidselectedIndexChanged(ListButton listButton, int previousSelectedIndex)Called when a list button's selected index has changed.voidselectedItemChanged(ListButton listButton, java.lang.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
colorFromObject, colorFromObject, colorFromObject, colorFromObject, currentTheme, cursorChanged, decodeFont, defaultBackgroundColor, defaultForegroundColor, dragSourceChanged, dropTargetChanged, fontFromObject, getBaseline, getBaseline, getColor, getComponent, getFocusRectangleStroke, getHeight, getPreferredSize, getSize, getTextInputMethodListener, getThemeFont, getWidth, heightLimitsChanged, invalidateComponent, isFocusable, isOpaque, locationChanged, menuHandlerChanged, mouseMove, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setDefaultStyles, setSize, sizeChanged, themeHasThickFocusRectangle, themeHasTransitionEnabled, themeIsDark, themeIsFlat, 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, setSize
-
-
-
-
Method Detail
-
install
public void install(Component component)
Description copied from class:ComponentSkinMust be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.- Specified by:
installin interfaceSkin- Overrides:
installin classButtonSkin- Parameters:
component- The component to which the skin is being attached.
-
getListViewPopup
public Window getListViewPopup()
- Specified by:
getListViewPopupin interfaceListButton.Skin
-
getTriggerBounds
public abstract Bounds getTriggerBounds()
-
enabledChanged
public void enabledChanged(Component component)
Description copied from interface:ComponentStateListenerCalled when a component's enabled state has changed.Called both when the component is enabled and when it is disabled. The component's
enabledflag has already been set when this method is called so the new state can be determined by calling theComponent.isEnabled()method.- Specified by:
enabledChangedin interfaceComponentStateListener- Overrides:
enabledChangedin classButtonSkin- Parameters:
component- The component whose enabled state is changing.
-
focusedChanged
public void focusedChanged(Component component, Component obverseComponent)
Description copied from interface:ComponentStateListenerCalled 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:
focusedChangedin interfaceComponentStateListener- Overrides:
focusedChangedin classButtonSkin- 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:ComponentMouseListenerCalled when the mouse exits a component.Default is to do nothing.
- Specified by:
mouseOutin interfaceComponentMouseListener- Overrides:
mouseOutin classButtonSkin- Parameters:
component- Component that has now lost the mouse pointer.
-
mouseDown
public boolean mouseDown(Component component, Mouse.Button button, int x, int y)
Description copied from interface:ComponentMouseButtonListenerCalled when a mouse button is pressed over a component.- Specified by:
mouseDownin interfaceComponentMouseButtonListener- Overrides:
mouseDownin classComponentSkin- Parameters:
component- Component that is under the mouse pointer.button- Which mouse button was pressed.x- X position of the mouse.y- Y position of the mouse.- Returns:
trueto consume the event;falseto allow it to propagate (default).
-
mouseUp
public boolean mouseUp(Component component, Mouse.Button button, int x, int y)
Description copied from interface:ComponentMouseButtonListenerCalled when a mouse button is released over a component.- Specified by:
mouseUpin interfaceComponentMouseButtonListener- Overrides:
mouseUpin classComponentSkin- Parameters:
component- Component user the mouse pointer.button- Which mouse button that was released.x- X position of the mouse.y- Y position of the mouse.- Returns:
trueto consume the event;falseto allow it to propagate (default).
-
mouseClick
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
Description copied from interface:ComponentMouseButtonListenerCalled when a mouse button is clicked over a component.- Specified by:
mouseClickin interfaceComponentMouseButtonListener- Overrides:
mouseClickin classComponentSkin- Parameters:
component- Component user the mouse pointer.button- Which mouse button was clicked.x- X position of the mouse.y- Y position of the mouse.count- Number of clicks (1 = single click, 2 = double click, etc.).- Returns:
trueto consume the event;falseto allow it to propagate (default).
-
keyPressed
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
SPACERepaints the component to reflect the pressed state and opens the popup.
UPSelects the previous enabled list item.
DOWNSelects the next enabled list item.- Specified by:
keyPressedin interfaceComponentKeyListener- Overrides:
keyPressedin classComponentSkin- Parameters:
component- Component that has the focus.keyCode- The key code for the key that was pressed.keyLocation- Location value for the key (left or right for shift keys, etc.).- Returns:
trueto consume the event;falseto allow it to propagate.- See Also:
keyReleased(Component, int, Keyboard.KeyLocation)
-
keyReleased
public boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
SPACE'presses' the button.- Specified by:
keyReleasedin interfaceComponentKeyListener- Overrides:
keyReleasedin classComponentSkin- Parameters:
component- Component that has the focus, that is receiving this key event.keyCode- Code for the key that was released.keyLocation- Location of the key.- Returns:
trueto consume the event;falseto 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:
keyTypedin interfaceComponentKeyListener- Overrides:
keyTypedin classComponentSkin- Parameters:
component- Component that has the focus, that is receiving this key.character- The decoded character that was typed.- Returns:
trueto consume the event;falseto allow it to propagate.
-
listDataChanged
public void listDataChanged(ListButton listButton, List<?> previousListData)
Description copied from interface:ListButtonListenerCalled when a list button's list data has changed.- Specified by:
listDataChangedin interfaceListButtonListener- Parameters:
listButton- The list button that has changed.previousListData- The previous list data.
-
itemRendererChanged
public void itemRendererChanged(ListButton listButton, ListView.ItemRenderer previousItemRenderer)
Description copied from interface:ListButtonListenerCalled when a list button's item renderer has changed.- Specified by:
itemRendererChangedin interfaceListButtonListener- Parameters:
listButton- The list button that was changed.previousItemRenderer- The previous renderer for the button's items.
-
repeatableChanged
public void repeatableChanged(ListButton listButton)
Description copied from interface:ListButtonListenerCalled when a list button's repeatable flag has changed.- Specified by:
repeatableChangedin interfaceListButtonListener- Parameters:
listButton- The list button that has changed.
-
disabledItemFilterChanged
public void disabledItemFilterChanged(ListButton listButton, Filter<?> previousDisabledItemFilter)
Description copied from interface:ListButtonListenerCalled when a list button's disabled item filter has changed.- Specified by:
disabledItemFilterChangedin interfaceListButtonListener- Parameters:
listButton- The list button that has changed.previousDisabledItemFilter- The previous disabled item filter for the list button.
-
listSizeChanged
public void listSizeChanged(ListButton listButton, int previousListSize)
Description copied from interface:ListButtonListenerCalled when a list button's list size has changed.- Specified by:
listSizeChangedin interfaceListButtonListener- Parameters:
listButton- The list button that has changed.previousListSize- The previous value of the visible list size.
-
selectedIndexChanged
public void selectedIndexChanged(ListButton listButton, int previousSelectedIndex)
Description copied from interface:ListButtonSelectionListenerCalled when a list button's selected index has changed.- Specified by:
selectedIndexChangedin interfaceListButtonSelectionListener- 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, java.lang.Object previousSelectedItem)
Description copied from interface:ListButtonSelectionListenerCalled when a list button's selected item has changed.- Specified by:
selectedItemChangedin interfaceListButtonSelectionListener- Parameters:
listButton- The source of the event.previousSelectedItem- The item that was previously selected, ornullif the previous selection cannot be determined.
-
-