Package org.apache.pivot.wtk.skin
Class ButtonSkin
- java.lang.Object
-
- org.apache.pivot.wtk.skin.ComponentSkin
-
- 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, 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
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
highlighted
-
Constructor Summary
Constructors Constructor Description ButtonSkin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionChanged(Button button, Action previousAction)
Called when a button's action has changed.void
buttonDataChanged(Button button, java.lang.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)
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.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
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, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseUp, 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:ComponentSkin
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.- Specified by:
install
in interfaceSkin
- Overrides:
install
in classComponentSkin
- 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.
-
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 theComponent.isEnabled()
method.- Specified by:
enabledChanged
in interfaceComponentStateListener
- Overrides:
enabledChanged
in classComponentSkin
- 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 interfaceComponentStateListener
- Overrides:
focusedChanged
in classComponentSkin
- 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.Default is to do nothing.
- Specified by:
mouseOver
in interfaceComponentMouseListener
- Overrides:
mouseOver
in classComponentSkin
- Parameters:
component
- Component that is now under the mouse pointer.
-
mouseOut
public void mouseOut(Component component)
Description copied from interface:ComponentMouseListener
Called when the mouse exits a component.Default is to do nothing.
- Specified by:
mouseOut
in interfaceComponentMouseListener
- Overrides:
mouseOut
in classComponentSkin
- Parameters:
component
- Component that has now lost the mouse pointer.
-
buttonDataChanged
public void buttonDataChanged(Button button, java.lang.Object previousButtonData)
Description copied from interface:ButtonListener
Called when a button's data has changed.- Specified by:
buttonDataChanged
in interfaceButtonListener
- Parameters:
button
- The button that changed.previousButtonData
- The previous value of the button data.
-
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 interfaceButtonListener
- Parameters:
button
- The button that changed.previousDataRenderer
- The previous data renderer for the button.
-
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 interfaceButtonListener
- Parameters:
button
- The button that changed.previousAction
- The previous action that was assigned to the button.
-
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 interfaceButtonListener
- Parameters:
button
- The button that changed.
-
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 interfaceButtonListener
- Parameters:
button
- The button that changed.
-
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 interfaceButtonListener
- Parameters:
button
- The button whose group changed.previousButtonGroup
- The button group the button used to belong to (can benull
).
-
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 interfaceButtonStateListener
- Parameters:
button
- The button whose state changed.previousState
- The previous state of the button.
-
buttonPressed
public void buttonPressed(Button button)
Description copied from interface:ButtonPressListener
Called when a button is pressed.- Specified by:
buttonPressed
in interfaceButtonPressListener
- Parameters:
button
- The button that was just pressed.
-
-