Package org.apache.pivot.wtk.skin
Class CalendarButtonSkin
- java.lang.Object
-
- org.apache.pivot.wtk.skin.ComponentSkin
-
- org.apache.pivot.wtk.skin.ButtonSkin
-
- org.apache.pivot.wtk.skin.CalendarButtonSkin
-
- All Implemented Interfaces:
ButtonListener
,ButtonPressListener
,ButtonStateListener
,CalendarButton.Skin
,CalendarButtonListener
,CalendarButtonSelectionListener
,ComponentKeyListener
,ComponentListener
,ComponentMouseButtonListener
,ComponentMouseListener
,ComponentMouseWheelListener
,ComponentStateListener
,ComponentTooltipListener
,ConstrainedVisual
,Skin
,Visual
- Direct Known Subclasses:
TerraCalendarButtonSkin
public abstract class CalendarButtonSkin extends ButtonSkin implements CalendarButton.Skin, CalendarButtonListener, CalendarButtonSelectionListener
Abstract base class for calendar 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.CalendarButtonListener
CalendarButtonListener.Adapter, CalendarButtonListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.CalendarButtonSelectionListener
CalendarButtonSelectionListener.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 Calendar
calendar
protected Window
calendarPopup
protected boolean
pressed
-
Fields inherited from class org.apache.pivot.wtk.skin.ButtonSkin
highlighted
-
-
Constructor Summary
Constructors Constructor Description CalendarButtonSkin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disabledDateFilterChanged(CalendarButton calendarButton, Filter<CalendarDate> previousDisabledDateFilter)
Called when a calendar button's disabled date 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
getCalendarPopup()
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.boolean
keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
SPACE
Repaints the component to reflect the pressed state.boolean
keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
SPACE
'presses' the button.void
localeChanged(CalendarButton calendarButton, java.util.Locale previousLocale)
Called when a calendar button's locale has changed.void
monthChanged(CalendarButton calendarButton, int previousMonth)
Called when a calendar button's month value has changed.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
selectedDateChanged(CalendarButton calendarButton, CalendarDate previousSelectedDate)
Called when a calendar button's selected date has changed.void
yearChanged(CalendarButton calendarButton, int previousYear)
Called when a calendar button's year value 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, keyTyped, locationChanged, menuHandlerChanged, mouseClick, 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: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 classButtonSkin
- Parameters:
component
- The component to which the skin is being attached.
-
getCalendarPopup
public Window getCalendarPopup()
- Specified by:
getCalendarPopup
in interfaceCalendarButton.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 theComponent.isEnabled()
method.- Specified by:
enabledChanged
in interfaceComponentStateListener
- Overrides:
enabledChanged
in classButtonSkin
- 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 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:ComponentMouseListener
Called when the mouse exits a component.Default is to do nothing.
- Specified by:
mouseOut
in interfaceComponentMouseListener
- Overrides:
mouseOut
in 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:ComponentMouseButtonListener
Called when a mouse button is pressed over a component.- Specified by:
mouseDown
in interfaceComponentMouseButtonListener
- Overrides:
mouseDown
in 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:
true
to consume the event;false
to allow it to propagate (default).
-
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 interfaceComponentMouseButtonListener
- Overrides:
mouseUp
in 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:
true
to consume the event;false
to allow it to propagate (default).
-
keyPressed
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
SPACE
Repaints the component to reflect the pressed state.- Specified by:
keyPressed
in interfaceComponentKeyListener
- Overrides:
keyPressed
in 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:
true
to consume the event;false
to 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:
keyReleased
in interfaceComponentKeyListener
- Overrides:
keyReleased
in 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:
true
to consume the event;false
to allow it to propagate.
-
yearChanged
public void yearChanged(CalendarButton calendarButton, int previousYear)
Description copied from interface:CalendarButtonListener
Called when a calendar button's year value has changed.- Specified by:
yearChanged
in interfaceCalendarButtonListener
- Parameters:
calendarButton
- The calendar button that changed.previousYear
- The previously selected year.
-
monthChanged
public void monthChanged(CalendarButton calendarButton, int previousMonth)
Description copied from interface:CalendarButtonListener
Called when a calendar button's month value has changed.- Specified by:
monthChanged
in interfaceCalendarButtonListener
- Parameters:
calendarButton
- The calendar button that changed.previousMonth
- The previously selected month.
-
localeChanged
public void localeChanged(CalendarButton calendarButton, java.util.Locale previousLocale)
Description copied from interface:CalendarButtonListener
Called when a calendar button's locale has changed.- Specified by:
localeChanged
in interfaceCalendarButtonListener
- Parameters:
calendarButton
- The calendar button that changed.previousLocale
- The previously selected locale for the calendar.
-
disabledDateFilterChanged
public void disabledDateFilterChanged(CalendarButton calendarButton, Filter<CalendarDate> previousDisabledDateFilter)
Description copied from interface:CalendarButtonListener
Called when a calendar button's disabled date filter has changed.- Specified by:
disabledDateFilterChanged
in interfaceCalendarButtonListener
- Parameters:
calendarButton
- The calendar button that changed.previousDisabledDateFilter
- The previous disabled date filter.
-
selectedDateChanged
public void selectedDateChanged(CalendarButton calendarButton, CalendarDate previousSelectedDate)
Description copied from interface:CalendarButtonSelectionListener
Called when a calendar button's selected date has changed.- Specified by:
selectedDateChanged
in interfaceCalendarButtonSelectionListener
- Parameters:
calendarButton
- The calendar button that changed.previousSelectedDate
- The date that was previously selected in the calendar.
-
-