org.formaria.swing.date
Interface AppointmentProvider


public interface AppointmentProvider

An interface used by the CalendarPanel to find appointments

Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.

$Revision: 1.2 $


Method Summary
 Appointment[] getAppointments(java.util.Calendar c)
          Get the appoints for a particular date
 

Method Detail

getAppointments

Appointment[] getAppointments(java.util.Calendar c)
Get the appoints for a particular date
      public Appointment[] getAppointments( Calendar c )
      {
        int dayOfMonth = c.get( Calendar.DAY_OF_MONTH );
        if (( dayOfMonth == 18 ) || ( dayOfMonth == 1 )){
          Appointment events[] = new Appointment[ 2 ];
          events[ 0 ] = new Appointment();
          events[ 0 ].bkColor = new Color( 252, 231, 255, 128 );
          events[ 0 ].fgColor = Color.black;
          events[ 0 ].title = ( dayOfMonth == 6 ) ? "Breakfast with Basil Faulty" : "Meet John Doe";
          Calendar start = (Calendar)calendar.clone();
          start.set( Calendar.HOUR_OF_DAY, 8 );
          start.set( Calendar.MINUTE, 0 );
          events[ 0 ].startTime = start;
          Calendar end = (Calendar)start.clone();
          end.set( Calendar.MINUTE, 45 );
          events[ 0 ].endTime = end;

          events[ 1 ] = new Appointment();
          events[ 1 ].bkColor = new Color( 231, 231, 255, 128 );
          events[ 1 ].fgColor = Color.black;
          events[ 1 ].title = ( dayOfMonth == 6 ) ? "Lunch" : "Conference call";
          start = (Calendar)calendar.clone();
          start.set( Calendar.HOUR_OF_DAY, 12 );
          start.set( Calendar.MINUTE, 5 );
          events[ 1 ].startTime = start;
          end = (Calendar)start.clone();
          end.set( Calendar.HOUR_OF_DAY, 13 );
          end.set( Calendar.MINUTE, 45 );
          events[ 1 ].endTime = end;
          return events;
        }
        return new Appointment[ 0 ];
      }