JDatePicker v4.3

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

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
              extended bycom.standbysoft.component.date.swing.plaf.basic.BasicMonthUI
                  extended bycom.standbysoft.component.date.swing.plaf.basic.DefaultMonthUI

public class DefaultMonthUI
extends BasicMonthUI

Default implementation for a JMonth UI delegate.

It has a meaningful title that displays the current month and year. The month can be changed using a popup that is displayed when it is clicked while the year can be changed using a spinner. The spinner is displayed when the year is clicked.

This type of title is similar to that used by the Outlook calendar. You can define your own title by extending BasicMonthUI.


Field Summary
 
Fields inherited from class com.standbysoft.component.date.swing.plaf.basic.BasicMonthUI
titleMonth, titleYear
 
Fields inherited from class com.standbysoft.component.date.swing.plaf.basic.AbstractMonthUI
body, month, title
 
Constructor Summary
DefaultMonthUI()
           
 
Method Summary
protected  javax.swing.JComponent createTitleMonth()
          Creates the component that displays month information from JMonth.
protected  javax.swing.JComponent createTitleYear()
          Creates the component that displays year information from JMonth.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Creates a new instance of this class.
protected  void installListeners()
          Attaches listeners to the JMonth component.
protected  void uninstallComponents()
          Uninstalls all registered components.
protected  void uninstallListeners()
          Detaches listeners from the JMonth component.
protected  void updateLocale()
          Updates the locale for the month components.
protected  void updateTitle()
          Does nothing because this implementation does not have a title.
protected  void updateTitleBackground()
          Updates the color for the title background.
protected  void updateTitleForeground()
          Updates the color for the title foreground.
 
Methods inherited from class com.standbysoft.component.date.swing.plaf.basic.BasicMonthUI
createBody, createTitle, createTitleLayout, updateDatesOrientation, updateEnabled, updateFont, updateForeground, updateGridColor, updateHorizontalLinesVisible, updateMonthBackground, updateMonthModel, updateTimeZone, updateTrailingForeground, updateVerticalLinesVisible, updateWeekModel, updateWeekNamesVisible, updateWeekNumbersVisible
 
Methods inherited from class com.standbysoft.component.date.swing.plaf.basic.AbstractMonthUI
createDefaults, createLayout, initializeDefaults, installComponents, installDefaults, installKeyboardActions, installUI, uninstallKeyboardActions, uninstallUI
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, 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
 

Constructor Detail

DefaultMonthUI

public DefaultMonthUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Creates a new instance of this class.

Returns:
a new instance of this class.

createTitleYear

protected javax.swing.JComponent createTitleYear()
Creates the component that displays year information from JMonth. You can override it to create whatever title component you find fit. If null is returned, then this component is ignored and it is not added to the title.

Overrides:
createTitleYear in class BasicMonthUI
Returns:
a component that displays the current year and that can change it by means of a spinner when clicked.
See Also:
BasicMonthUI.createTitle()

createTitleMonth

protected javax.swing.JComponent createTitleMonth()
Creates the component that displays month information from JMonth. You can override it to create whatever title component you find fit. If null is returned, then this component is ignored and it is not added to the title.

Overrides:
createTitleMonth in class BasicMonthUI
Returns:
a component that displays the name of the current month. When clicked, a pop up that allows changing the month is displayed.
See Also:
BasicMonthUI.createTitle()

updateTitle

protected void updateTitle()
Description copied from class: BasicMonthUI
Does nothing because this implementation does not have a title.

Overrides:
updateTitle in class BasicMonthUI

installListeners

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

Overrides:
installListeners in class BasicMonthUI

uninstallComponents

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

Overrides:
uninstallComponents in class BasicMonthUI
See Also:
AbstractMonthUI.uninstallUI(JComponent)

uninstallListeners

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

Overrides:
uninstallListeners in class BasicMonthUI

updateTitleForeground

protected void updateTitleForeground()
Description copied from class: AbstractMonthUI
Updates the color for the title foreground.

Overrides:
updateTitleForeground in class BasicMonthUI

updateTitleBackground

protected void updateTitleBackground()
Description copied from class: AbstractMonthUI
Updates the color for the title background.

Overrides:
updateTitleBackground in class BasicMonthUI

updateLocale

protected void updateLocale()
Updates the locale for the month components.

Overrides:
updateLocale in class BasicMonthUI

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.