Package org.jdesktop.swingx.plaf.basic
Class CalendarHeaderHandler
java.lang.Object
org.jdesktop.swingx.plaf.basic.CalendarHeaderHandler
- Direct Known Subclasses:
BasicCalendarHeaderHandler
,SpinningCalendarHeaderHandler
Provides and wires a component appropriate as a calendar navigation header.
The design idea is to support a pluggable header for a zoomable (PENDING JW:
naming!) JXMonthView. Then custom implementations can be tailored to exactly
fit their needs.
To install a custom implementation, register the class name of the custom
header handler with the key CalendarHeaderHandler.uiControllerID
, example:
UIManager.put(CalendarHeaderHandler.uiControllerID, "com.foo.bar.MagicHeaderHandler")
Basic navigation action should (will) be defined by the ui delegate itself (PENDING
JW: still incomplete in BasicMonthViewUI). This handler can modify/enhance
them as appropriate for its context.
PENDING JW: those icons ... who's responsible? Shouldn't we use any of the default arrows as defined in the laf anyway (are there any?)
Note: this is work-in-progress, be prepared to change if subclassing for custom requirements!
- Author:
- Jeanette Winzenburg
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Icon
protected Icon
protected JXMonthView
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Synchronizes internal state which depends on the month view's componentOrientation.protected abstract JComponent
Creates and returns the component used as header in a zoomable monthView.protected Font
Create a derived font used to when painting various pieces of the month view component.protected void
Synchronizes internal state which depends on the month view's font.Returns a component to be used as header in a zoomable month view, guaranteed to be not null.void
install
(JXMonthView monthView) Installs this handler to the given month view.protected void
Creates and registered listeners on the monthView as appropriate.protected void
Installs and configures navigational actions.protected void
Synchronizes internal state which depends on the month view's monthStringBackground.void
uninstall
(JXMonthView monthView) Uninstalls this handler from the given target month view.protected void
Unregisters listeners which had been installed to the monthView.
-
Field Details
-
uiControllerID
- See Also:
-
monthView
-
monthDown
-
monthUp
-
-
Constructor Details
-
CalendarHeaderHandler
public CalendarHeaderHandler()
-
-
Method Details
-
install
Installs this handler to the given month view.- Parameters:
monthView
- the target month view to install to.
-
uninstall
Uninstalls this handler from the given target month view.- Parameters:
monthView
- the target month view to install from.
-
getHeaderComponent
Returns a component to be used as header in a zoomable month view, guaranteed to be not null.- Returns:
- a component to be used as header in a zoomable JXMonthView
-
installListeners
protected void installListeners()Creates and registered listeners on the monthView as appropriate. This implementation registers a PropertyChangeListener which synchronizes internal state on changes of componentOrientation, font and monthStringBackground. -
uninstallListeners
protected void uninstallListeners()Unregisters listeners which had been installed to the monthView. -
monthStringBackgroundChanged
protected void monthStringBackgroundChanged()Synchronizes internal state which depends on the month view's monthStringBackground. -
fontChanged
protected void fontChanged()Synchronizes internal state which depends on the month view's font. -
componentOrientationChanged
protected void componentOrientationChanged()Synchronizes internal state which depends on the month view's componentOrientation. This implementation updates the month navigation icons and the header component's orientation. -
createCalendarHeader
Creates and returns the component used as header in a zoomable monthView.- Returns:
- the component used as header in a zoomable monthView, guaranteed to be not null.
-
createDerivedFont
Create a derived font used to when painting various pieces of the month view component. This method will be called whenever the font on the component is set so a new derived font can be created.- Returns:
- font
-