JDatePicker v4.3

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

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

public abstract class AbstractMonthUI
extends DateUI

Defines the general structure that is used by subclasses to implement the actual UI delegate for JMonth. Such a delegate has a body section where the current month is displayed and an optional title to display month related information.

A delegate like this can be configured to display or not selected weeks or week days as selected using the JMonth.isWeekLabelsHighlighted client property. By default, this property is not set.

 	JMonth month = new JMonth();
 	month.putClientProperty("JMonth.isWeekLabelsHighlighted", Boolean.TRUE);
 

See Also:
How to Configure UI Delegates, BasicMonthUI

Field Summary
protected  javax.swing.JComponent body
          Component that represents the actual monthView month.
protected  JMonth month
          JMonth component for which this UI delegate is installed.
protected  javax.swing.JComponent title
          Component that groups the title month and title year components.
 
Constructor Summary
AbstractMonthUI()
           
 
Method Summary
protected abstract  javax.swing.JComponent createBody()
          Creates the component that represents the actual calendar month.
protected  java.lang.Object[] createDefaults()
          Creates a list of default values for some of the properties of JMonth.
protected  java.awt.LayoutManager createLayout()
          Creates a LayoutManager that manages the title, and month children of JMonth.
protected abstract  javax.swing.JComponent createTitle()
          Creates the title component that displays information about the current month specified in JMonth.
protected  void initializeDefaults()
          Registers the default values created for some of the properties of JMonth with the UIManager.
protected  void installComponents()
          Installs all the components needed by JMonth to implement its behavior.
protected  void installDefaults()
          Installs the default font and colors on the JMonth component.
protected  void installKeyboardActions()
          Register all keyboard actions on the JMonth.
protected  void installListeners()
          Attaches listeners to the JMonth component.
 void installUI(javax.swing.JComponent c)
          Registers all the UI stuff needed to make the specified component work.
protected  void uninstallComponents()
          Uninstalls all registered components.
protected  void uninstallKeyboardActions()
          Uninstalls the keyboard actions associated with the JMonth component.
protected  void uninstallListeners()
          Detaches listeners from the JMonth component.
 void uninstallUI(javax.swing.JComponent c)
          Unregisters all the UI stuff needed to make the specified component work.
protected abstract  void updateDatesOrientation()
          Updates the settings when the orientation of the dates changes.
protected abstract  void updateEnabled()
          Updates the enabled state of the children components based on the enabled state of the JMonth.
protected abstract  void updateFont()
          Updates the font for the JMonth components.
protected abstract  void updateForeground()
          Updates the foreground color for the dates.
protected abstract  void updateGridColor()
          Updates the month grid.
protected abstract  void updateHorizontalLinesVisible()
          Updates the visibility of the horizontal lines.
protected abstract  void updateLocale()
          Updates the locale for the JMonth components.
protected abstract  void updateMonthBackground()
          Updates the background color for the month.
protected abstract  void updateMonthModel()
          Updates the settings when the month model changes.
protected abstract  void updateTimeZone()
          Updates the settings when the time zone changes.
protected abstract  void updateTitle()
          Updates the title information that identifies the current month.
protected abstract  void updateTitleBackground()
          Updates the color for the title background.
protected abstract  void updateTitleForeground()
          Updates the color for the title foreground.
protected abstract  void updateTrailingForeground()
          Updates the foreground color for the trailing dates.
protected abstract  void updateVerticalLinesVisible()
          Updates the visibility of the vertical lines.
protected abstract  void updateWeekModel()
          Updates the settings when the week model changes.
protected abstract  void updateWeekNamesVisible()
          Updates the visibility of the week days names.
protected abstract  void updateWeekNumbersVisible()
          Updates the visibility of the week numbers.
 
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

month

protected JMonth month
JMonth component for which this UI delegate is installed.


title

protected javax.swing.JComponent title
Component that groups the title month and title year components.

See Also:
createTitle()

body

protected javax.swing.JComponent body
Component that represents the actual monthView month.

See Also:
createBody()
Constructor Detail

AbstractMonthUI

public AbstractMonthUI()
Method Detail

createDefaults

protected java.lang.Object[] createDefaults()

Creates a list of default values for some of the properties of JMonth. These values are instances of objects that implement the UIResource interface. For instance, default fonts are created using the FontUIResource class while colors using the ColorUIResource class.

The list is structured as follows: [key1, value1, key2, value2, ...] where the keys identify the properties and the values indicate the default values for these properties.

The keys returned in the list by this method are:

  1. Month.font
  2. Month.gridColor
  3. Month.titleBackground
  4. Month.titleForeground
  5. Month.foreground
  6. Month.trailingForeground
  7. Month.monthBackground
  8. Month.dateRenderer
    1. Returns:
      a list of default values for some of the properties of JMonth
      See Also:
      initializeDefaults(), installDefaults()

initializeDefaults

protected void initializeDefaults()

Registers the default values created for some of the properties of JMonth with the UIManager.

See Also:
installDefaults()

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 JMonth component.


installComponents

protected void installComponents()
Installs all the components needed by JMonth to implement its behavior. This implementation uses a title and an actual month for this.

See Also:
createLayout(), createTitle(), createBody()

createLayout

protected java.awt.LayoutManager createLayout()
Creates a LayoutManager that manages the title, and month children of JMonth. These two children must be added with a constraint that identifies their role: "Title" and "Month". The default layout manager can handle the absence of any of these children.

Returns:
a LayoutManager for the title and actual month components.
See Also:
createBody(), createTitle()

createTitle

protected abstract javax.swing.JComponent createTitle()

Creates the title component that displays information about the current month specified in JMonth. This information should refer to the current month and year.

You can override it to create whatever title you find fit. If null is returned, then this component is ignored and it is not added to JMonth.

Returns:
title component with JMonth status information or null to indicate a missing title.
See Also:
installComponents()

createBody

protected abstract javax.swing.JComponent createBody()

Creates the component that represents the actual calendar month.

Returns:
actual calendar month.

installListeners

protected void installListeners()
Attaches listeners to the JMonth component.


installKeyboardActions

protected void installKeyboardActions()
Register all keyboard actions on the JMonth.


uninstallUI

public void uninstallUI(javax.swing.JComponent c)
Unregisters 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 removed.

See Also:
uninstallKeyboardActions(), uninstallListeners(), uninstallComponents()

uninstallComponents

protected void uninstallComponents()
Uninstalls all registered components. You should override this method if you extend this class and provide your own components.

See Also:
uninstallUI(JComponent)

uninstallListeners

protected void uninstallListeners()
Detaches listeners from the JMonth component.


uninstallKeyboardActions

protected void uninstallKeyboardActions()
Uninstalls the keyboard actions associated with the JMonth component.


updateFont

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


updateLocale

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


updateEnabled

protected abstract void updateEnabled()
Updates the enabled state of the children components based on the enabled state of the JMonth.


updateGridColor

protected abstract void updateGridColor()
Updates the month grid.


updateHorizontalLinesVisible

protected abstract void updateHorizontalLinesVisible()
Updates the visibility of the horizontal lines.


updateVerticalLinesVisible

protected abstract void updateVerticalLinesVisible()
Updates the visibility of the vertical lines.


updateWeekNumbersVisible

protected abstract void updateWeekNumbersVisible()
Updates the visibility of the week numbers.


updateWeekNamesVisible

protected abstract void updateWeekNamesVisible()
Updates the visibility of the week days names.


updateTitle

protected abstract void updateTitle()
Updates the title information that identifies the current month. This is used when the current month is changed or the names of the months change.


updateTitleForeground

protected abstract void updateTitleForeground()
Updates the color for the title foreground.


updateTitleBackground

protected abstract void updateTitleBackground()
Updates the color for the title background.


updateForeground

protected abstract void updateForeground()
Updates the foreground color for the dates.


updateMonthBackground

protected abstract void updateMonthBackground()
Updates the background color for the month.


updateTrailingForeground

protected abstract void updateTrailingForeground()
Updates the foreground color for the trailing dates.


updateMonthModel

protected abstract void updateMonthModel()
Updates the settings when the month model changes.


updateWeekModel

protected abstract void updateWeekModel()
Updates the settings when the week model changes.


updateDatesOrientation

protected abstract void updateDatesOrientation()
Updates the settings when the orientation of the dates changes.


updateTimeZone

protected abstract void updateTimeZone()
Updates the settings when the time zone changes.


JDatePicker v4.3

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

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