MDateSelector

Package mseries.Calendar

The Calendar package provides a popup Calendar widget which is used when date entry is required.

See:
          Description

Interface Summary
GridSelectionListener Interface to which any object must conform if it is to be informed of changes to a grid cell
MDateChanger  
MDateSelectorConstraints The calendar panel, popup and pull down is configured using a constraints object that implements this interface.
MFieldListener Interface to which any object must conform if it is to be informed of changes to an MSeries field such as MDateEntryField.
MMonthListener Interface to which any object must conform if it is to be informed of changes to the MMonth data model.
SpecialDayModel Classes implementing this interface define which days are treated as special in the CalendarPanel.
 

Class Summary
CalendarPanel This is the component that forms the Calendar Grid.
DateSelectorRB  
DefaultSpecialDayModel  
GridSelectionEvent An Event class used to notify listeners that ther has been a change in the Selceted grid square
Header  
MButtonChanger A changer component for use in the calendar pull down
MDateDisplay Date entry widget with built in Formatter/Parser and Calendar popup to facilitate input.
MDateSelector The controller for the DateSelector.
MDateSelectorPanel A calender component that shows one month at a time with controls to change the month and year.
MDateSelectorPanelBeanInfo Bean Info class for MDateSelectorPanel.
MDateSelectorUI GUI for the date selector (Calendar) popup
MDateTimeValueEditor  
MDateValueEditor  
MDefaultPullDownConstraints The defualt implementation of MDateSelectorConstraints
MFirstDayEditor  
MMonth The business end of the DateSelector component.
MMonthEvent An Event class used to notify listeners that ther has been a change in the MMonth data model
MonthPopup  
MSpinnerChanger  
MTextLocaliserEditor  
TestIt  
TestSpecialDayModel  
 

Exception Summary
MDateOutOfRangeException  
 

Package mseries.Calendar Description

The Calendar package provides a popup Calendar widget which is used when date entry is required. You may already have a custom date entry field and simply need to provide a call to the MDateSelector. My test harness triggers it on a right mouse click, the code fragment for do this is reproduced below.

    public void mouseReleased(MouseEvent e)
    {
        if (e.isPopupTrigger())
        {
            try
            {
                date = df.parse(getText());
            }
            catch(ParseException pe)
            {
                date = null;
            }

            MDateSelector popup;
            popup = new MDateSelector();
            if (minDate!=null)
                popup.setMinimum(minDate);
            if (maxDate!=null)
                popup.setMaximum(maxDate);

            Point p=e.getPoint();
            p.x+=getBounds(null).x;
            p.y+=getBounds(null).y;

            popup.setFirstDay(Calendar.MONDAY);
            popup.setForeground(Calendar.SATURDAY, Color.blue);
            popup.setForeground(Calendar.SUNDAY, Color.blue);
            popup.show(getParent(), p, date);

            date = popup.getValue(); 
            setText(date==null ? "" : shortFormatter.format(date));
            popup=null;
        }
    } 
The CalendarPanel component may also be used separately in any other context for example a appointment book application to assist in finding dates.


MDateSelector

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