Java Date Picker v3.2

com.standbysoft.component.date.swing.plaf.basic
Class AbstractDatePickerUI

java.lang.Object
  extended byjavax.swing.plaf.ComponentUI
      extended bycom.standbysoft.component.date.swing.plaf.DateUI
          extended bycom.standbysoft.component.date.swing.plaf.basic.AbstractDatePickerUI
Direct Known Subclasses:
BasicDatePickerUI

public abstract class AbstractDatePickerUI
extends DateUI

Defines the general structure that is used by subclasses to implement the actual UI delegate for JDatePicker.

Such a delegate uses a simple combo box and a calendar to select/edit a date.

See Also:
BasicDatePickerUI

Field Summary
protected  JComboBoxExt comboBox
          Combo box used to create the date picker.
protected  JDatePicker datePicker
          Component for which this UI is registered.
protected  JMonthView monthView
          Calendar component used with the combo box to select dates.
 
Constructor Summary
AbstractDatePickerUI()
           
 
Method Summary
protected abstract  JComboBoxExt createComboBox()
          Creates the combo box that is used by the date picker to select a date.
protected abstract  java.awt.LayoutManager createLayout()
          Creates a LayoutManager that manages the combo box used to select/edit the date.
protected abstract  JMonthView createMonthView()
          Creates the calendar component that will be used by JDatePicker to select a date.
protected  java.beans.PropertyChangeListener createPropertyChangeListener()
          Creates a PropertyChangeListener that keeps track of the changes in the JDatePicker component.
protected  void installComponents()
          Installs all the components needed by JDatePicker to implement its behavior.
protected  void installDefaults()
          Installs the default font and colors on the JDatePicker component.
protected  void installKeyboardActions()
           
protected  void installListeners()
          Creates and installs the listeners for the date picker.
 void installUI(javax.swing.JComponent c)
          Registers all the UI stuff needed to make the specified component work.
 boolean isPopupVisible(JDatePicker c)
           
static void registerDateComboBoxUI(java.lang.String lf, java.lang.Class ui)
          Registers a ComboBoxUI object that also implements ComboBoxUIExt for a specified look and feel.
 void setPopupVisible(JDatePicker c, boolean v)
           
protected  void uninstallComponents()
           
protected  void uninstallDefaults()
           
protected  void uninstallListeners()
          Uninstalls the listeners from the date field.
 void uninstallUI(javax.swing.JComponent c)
           
static void unregisterDateComboBoxUI(java.lang.String lf)
          Unregisters the ComboBoxUI object that also implements ComboBoxUIExt for a specified look and feel.
protected abstract  void updateBackground()
          Updates the background color for the supporting combo box.
protected abstract  void updateCalendarBackground()
          Updates the background color of the calendar
protected abstract  void updateCalendarDisplayToday()
          Specifies whether the calendar displays the today button or not.
protected abstract  void updateCalendarForeground()
          Updates the foreground color of the calendar
protected abstract  void updateCalendarRenderer()
           
protected abstract  void updateCalendarTitleBackground()
          Updates the title background color of the calendar
protected abstract  void updateCalendarTitleForeground()
          Updates the title foreground color of the calendar
protected abstract  void updateCalendarTrailingForeground()
          Updates the trailing foreground color of the calendar
protected abstract  void updateCalendarVisible()
          Specifies whether the drop down calendar should be displayed or not.
protected abstract  void updateCalendarWeekNumbersVisible()
          Specifies whether the calendar displays the week numbers or not.
protected abstract  void updateDateFormat()
           
protected abstract  void updateDateSelectionModel()
          Updates the selection model for the components of the date picker
protected abstract  void updateEditable()
          Updates the editable state of the date picker components.
protected abstract  void updateEnabled()
          Updates the enabled state of the children Components based on the enabled state of the JDatePicker.
protected abstract  void updateFont()
          Updates the font for the date picker components.
protected abstract  void updateForeground()
          Updates the foreground color for the supporting combo box.
protected abstract  void updateLocale()
          Updates the locale for the date picker components.
protected abstract  void updateToolTipText()
          Updates the tooltip text for the date picker component.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

datePicker

protected JDatePicker datePicker
Component for which this UI is registered.


comboBox

protected JComboBoxExt comboBox
Combo box used to create the date picker.


monthView

protected JMonthView monthView
Calendar component used with the combo box to select dates.

Constructor Detail

AbstractDatePickerUI

public AbstractDatePickerUI()
Method Detail

installUI

public void installUI(javax.swing.JComponent c)
Registers all the UI stuff needed to make the specified component work. In other words, this is the place where the component's look and feel is created.

See Also:
installDefaults(), installComponents(), installListeners(), installKeyboardActions()

installDefaults

protected void installDefaults()
Installs the default font and colors on the JDatePicker component.


installComponents

protected void installComponents()

Installs all the components needed by JDatePicker to implement its behavior.

See Also:
createLayout(), createMonthView(), createComboBox()

createLayout

protected abstract java.awt.LayoutManager createLayout()
Creates a LayoutManager that manages the combo box used to select/edit the date.

Returns:
a LayoutManager for the date picker.

createMonthView

protected abstract JMonthView createMonthView()

Creates the calendar component that will be used by JDatePicker to select a date. If you want to provide your own JMonthView instance, keep in mind that its instance will be used by this delegate so all operations should pass through the JDatePicker interface methods.

Returns:
a calendar that will be used by the date picker to select dates.

createComboBox

protected abstract JComboBoxExt createComboBox()
Creates the combo box that is used by the date picker to select a date.

Returns:
actual combo box.

installListeners

protected void installListeners()
Creates and installs the listeners for the date picker. This method is called when the UI is installed.


createPropertyChangeListener

protected java.beans.PropertyChangeListener createPropertyChangeListener()
Creates a PropertyChangeListener that keeps track of the changes in the JDatePicker component. If this method returns null then it will not be added to the date field.

Returns:
an instance PropertyChangeListener or null.

installKeyboardActions

protected void installKeyboardActions()

uninstallUI

public void uninstallUI(javax.swing.JComponent c)

uninstallDefaults

protected void uninstallDefaults()

uninstallComponents

protected void uninstallComponents()

uninstallListeners

protected void uninstallListeners()
Uninstalls the listeners from the date field. This method is called when the UI is uninstalled.


setPopupVisible

public void setPopupVisible(JDatePicker c,
                            boolean v)

isPopupVisible

public boolean isPopupVisible(JDatePicker c)

updateEnabled

protected abstract void updateEnabled()
Updates the enabled state of the children Components based on the enabled state of the JDatePicker.


updateFont

protected abstract void updateFont()
Updates the font for the date picker components.


updateCalendarRenderer

protected abstract void updateCalendarRenderer()

updateCalendarBackground

protected abstract void updateCalendarBackground()
Updates the background color of the calendar


updateCalendarForeground

protected abstract void updateCalendarForeground()
Updates the foreground color of the calendar


updateCalendarTitleBackground

protected abstract void updateCalendarTitleBackground()
Updates the title background color of the calendar


updateCalendarTitleForeground

protected abstract void updateCalendarTitleForeground()
Updates the title foreground color of the calendar


updateCalendarTrailingForeground

protected abstract void updateCalendarTrailingForeground()
Updates the trailing foreground color of the calendar


updateCalendarDisplayToday

protected abstract void updateCalendarDisplayToday()
Specifies whether the calendar displays the today button or not.


updateCalendarVisible

protected abstract void updateCalendarVisible()
Specifies whether the drop down calendar should be displayed or not.


updateCalendarWeekNumbersVisible

protected abstract void updateCalendarWeekNumbersVisible()
Specifies whether the calendar displays the week numbers or not.


updateDateSelectionModel

protected abstract void updateDateSelectionModel()
Updates the selection model for the components of the date picker


updateLocale

protected abstract void updateLocale()
Updates the locale for the date picker components.


updateEditable

protected abstract void updateEditable()
Updates the editable state of the date picker components.


updateToolTipText

protected abstract void updateToolTipText()
Updates the tooltip text for the date picker component.


updateForeground

protected abstract void updateForeground()
Updates the foreground color for the supporting combo box.


updateBackground

protected abstract void updateBackground()
Updates the background color for the supporting combo box.


updateDateFormat

protected abstract void updateDateFormat()

registerDateComboBoxUI

public static void registerDateComboBoxUI(java.lang.String lf,
                                          java.lang.Class ui)
Registers a ComboBoxUI object that also implements ComboBoxUIExt for a specified look and feel. The UI will be used by the date combobox to display the calendar.

Parameters:
lf - look and feel for which the ui is registered, com.sun.java.swing.plaf.motif.MotifLookAndFeel for instance
ui - ComboBoxUI object associated with the look and feel

unregisterDateComboBoxUI

public static void unregisterDateComboBoxUI(java.lang.String lf)
Unregisters the ComboBoxUI object that also implements ComboBoxUIExt for a specified look and feel.

Parameters:
lf - look and feel for which the ui is registered, com.sun.java.swing.plaf.motif.MotifLookAndFeel for instance

Java Date Picker v3.2

Visit www.javadatepicker.com for further information or send us your suggestions.

Copyright © 2003-2004 Stand By Soft Ltd. All Rights Reserved.