MDateSelector

mseries.Calendar
Class MDateSelector

java.lang.Object
  extended by mseries.Calendar.MDateSelector
All Implemented Interfaces:
ActionListener, EventListener, MMonthListener

public class MDateSelector
extends Object
implements ActionListener, MMonthListener

The controller for the DateSelector. This class is the programming interface and should be the only class in the package of which knowledge is needed in order to use the MDateSelector.


Field Summary
protected  Color[] background
           
protected  Color[] foreground
           
 
Constructor Summary
MDateSelector(Date min, Date max)
           
 
Method Summary
 void actionPerformed(ActionEvent event)
           
 void dataChanged(MMonthEvent e)
          Reacts to all changes in the data model (MMonth) which is given by the event type.
 int getChangerStyle()
          Deprecated. use setConstraints and a constraints object instead
 MDateSelectorConstraints getConstraints()
          Gets the constraints object that contains the parameters used to configure the pop up calendar
 MDateSelectorPanel getDisplay()
          Gets a panel which is a self contained component to represent the calendar grid and scrollbar, defaults to current date
 MDateSelectorPanel getDisplay(Date date)
          Gets a panel which is a self contained component to represent the calendar grid and scrollbar
 Date getValue()
          Returns the currently selected date value
 void setBackground(int day, Color color)
          Deprecated. use setConstraints and a constraints object instead
 void setChangerStyle(int style)
          Deprecated. use setConstraints and a constraints object instead
 void setConstraints(MDateSelectorConstraints c)
          Sets the constraints object that contains the parameters used to configure the pop up calendar
 void setDateFormatter(DateFormat userDf)
          The passed date format object is used to format the date displayed at the top of the calendar popup
 void setFirstDay(int firstDay)
          Deprecated. use setConstraints and a constraints object instead
 void setForeground(int day, Color color)
          Deprecated. use setConstraints and a constraints object instead
 void setImageFile(String imageFile)
          Deprecated. use setConstraints and a constraints object instead
 void setMaximum(Date max)
          Sets the maximum date value allowed
 void setMinimum(Date min)
          Sets the minimum date value allowed
 void setTextLocalizer(ResourceBundle rb)
          Deprecated. use setConstraints and a constraints object instead
 void show(Component parent, Point pnt, Date date)
          Makes the calendar visible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

background

protected Color[] background

foreground

protected Color[] foreground
Constructor Detail

MDateSelector

public MDateSelector(Date min,
                     Date max)
Method Detail

getDisplay

public MDateSelectorPanel getDisplay()
Gets a panel which is a self contained component to represent the calendar grid and scrollbar, defaults to current date

Returns:
a MDateSelectorPanel

setImageFile

public void setImageFile(String imageFile)
Deprecated. use setConstraints and a constraints object instead


setForeground

public void setForeground(int day,
                          Color color)
Deprecated. use setConstraints and a constraints object instead


setBackground

public void setBackground(int day,
                          Color color)
Deprecated. use setConstraints and a constraints object instead


setConstraints

public void setConstraints(MDateSelectorConstraints c)
Sets the constraints object that contains the parameters used to configure the pop up calendar

Parameters:
c - the constraints object
See Also:
getConstraints()

getConstraints

public MDateSelectorConstraints getConstraints()
Gets the constraints object that contains the parameters used to configure the pop up calendar

See Also:
setConstraints(mseries.Calendar.MDateSelectorConstraints)

getDisplay

public MDateSelectorPanel getDisplay(Date date)
Gets a panel which is a self contained component to represent the calendar grid and scrollbar

Parameters:
date - the date to display in the calendar
Returns:
a MDateSelectorPanel

setChangerStyle

public void setChangerStyle(int style)
Deprecated. use setConstraints and a constraints object instead


getChangerStyle

public int getChangerStyle()
Deprecated. use setConstraints and a constraints object instead


show

public void show(Component parent,
                 Point pnt,
                 Date date)
Makes the calendar visible

Parameters:
parent - the parent or container
pnt - the position of the popup in the container
date - the initial date to display

setMinimum

public void setMinimum(Date min)
Sets the minimum date value allowed

Parameters:
min - the earliest possible date

setMaximum

public void setMaximum(Date max)
Sets the maximum date value allowed

Parameters:
max - the earliest possible date

setFirstDay

public void setFirstDay(int firstDay)
Deprecated. use setConstraints and a constraints object instead

The first column on the calendar grid shows the dates for the day passed here.

Parameters:
firstDay - a day constant from java.util.Calendar such as Calendar.SUNDAY

setTextLocalizer

public void setTextLocalizer(ResourceBundle rb)
Deprecated. use setConstraints and a constraints object instead

The ResourceBundle passed should be able to localize the strings on the button labels and calendar day headings, defaults are provided.

Parameters:
rb - a ResourceBundle to do the localization

setDateFormatter

public void setDateFormatter(DateFormat userDf)
The passed date format object is used to format the date displayed at the top of the calendar popup

Parameters:
userDf - a DateFormat object configured to format as required

dataChanged

public void dataChanged(MMonthEvent e)
Reacts to all changes in the data model (MMonth) which is given by the event type. from mseries.utils.MMonthListener interface

Specified by:
dataChanged in interface MMonthListener

actionPerformed

public void actionPerformed(ActionEvent event)
Specified by:
actionPerformed in interface ActionListener

getValue

public Date getValue()
Returns the currently selected date value

Returns:
the date selected

MDateSelector

Copyright © 2001-2007 M Newstead. All Rights Reserved.