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 booleanhighlighted
-
Constructor Summary
Constructors Constructor Description ButtonSkin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionChanged(Button button, Action previousAction)Called when a button's action has changed.voidbuttonDataChanged(Button button, java.lang.Object previousButtonData)Called when a button's data has changed.voidbuttonGroupChanged(Button button, ButtonGroup previousButtonGroup)Called when a button's button group has changed.voidbuttonPressed(Button button)Called when a button is pressed.voiddataRendererChanged(Button button, Button.DataRenderer previousDataRenderer)Called when a button's data renderer 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.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.voidlayout()If the component on which the skin is installed is a container, lays out the container's children.voidmouseOut(Component component)Called when the mouse exits a component.voidmouseOver(Component component)Called when the mouse enters a component.voidstateChanged(Button button, Button.State previousState)Called when a button's state has changed.voidtoggleButtonChanged(Button button)Called when a button's toggle button flag has changed.voidtriStateChanged(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: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 classComponentSkin- Parameters:
component- The component to which the skin is being attached.
-
layout
public void layout()
Description copied from interface:SkinIf 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: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 classComponentSkin- 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 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:ComponentMouseListenerCalled when the mouse enters a component.Default is to do nothing.
- Specified by:
mouseOverin interfaceComponentMouseListener- Overrides:
mouseOverin classComponentSkin- Parameters:
component- Component that is now under the mouse pointer.
-
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 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:ButtonListenerCalled when a button's data has changed.- Specified by:
buttonDataChangedin 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:ButtonListenerCalled when a button's data renderer has changed.- Specified by:
dataRendererChangedin 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:ButtonListenerCalled when a button's action has changed.- Specified by:
actionChangedin 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:ButtonListenerCalled when a button's toggle button flag has changed.- Specified by:
toggleButtonChangedin interfaceButtonListener- Parameters:
button- The button that changed.
-
triStateChanged
public void triStateChanged(Button button)
Description copied from interface:ButtonListenerCalled when a button's tri-state flag has changed.- Specified by:
triStateChangedin interfaceButtonListener- Parameters:
button- The button that changed.
-
buttonGroupChanged
public void buttonGroupChanged(Button button, ButtonGroup previousButtonGroup)
Description copied from interface:ButtonListenerCalled when a button's button group has changed.- Specified by:
buttonGroupChangedin 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:ButtonStateListenerCalled when a button's state has changed.- Specified by:
stateChangedin 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:ButtonPressListenerCalled when a button is pressed.- Specified by:
buttonPressedin interfaceButtonPressListener- Parameters:
button- The button that was just pressed.
-
-