beans_bg.gif (4735 bytes)

Demo Readme


Calendar  Bean Suite Version 2.0

These demos show how you can create applications that contain the Calendar bean, theme beans and plugin beans. 

To see the wiring and run the application in VisualAge for Java 2.0, import the calendar jar file (in the lib directory) and the demo dat file (in the demo directory) into VisualAge for Java 2.0. The dat file contains a demo package that you can add to any project in your VisualAge for Java workspace. Use VisualAge for Java 's "Check Class Path..." option to compute the correct CLASSPATH setting before you run the demo application. This ensures that VisualAge for Java can locate all the classes needed to run the application.

How to Run These Demos

  1. First, make sure the Calendar Bean Suite is properly installed as described in the documentation provided with this package.
  2. Change to the demo directory and type: java runDemoX (where X is equal to the number of  the demo you want to run). This starts DemoX.

Demo1

What the Demo Does

This demo shows you how to use the Calendar bean in a simple application. It also shows how to use one of the existing themes and add functionality to the calendar bean by adding one of the available plugins.

The result of the application is shown in the following figure.

  Calendar Demo   NotePlugin Demo

Figure 1 - runDemo1 Application

 

The functions shown in this example are simple:

  1. Choose a date by selecting the appropriate year and month from the respective drop down lists, and choose the day by clicking on the required day of month on the calendars interface (by default current date is set).
  2. To access the NotePlugin, click the right button of the mouse and choose NotePlugin from the popup menu.
  3. Click the Update button to save your note for the day or click the Cancel button to return to the calendar bean without saving the note.

 

Wiring Instructions

To build the application, do the following:

  1. Create a new class with the Frame superclass.
  2. Drop on the frame:
    1. Calendar bean
    2. NotePlugin bean
  3. Drop the BlueTheme bean on the design surface (outside the frame).
  4. Make the following connections:
    1. Connect this of the BlueTheme to the inputTheme property of the Calendar bean.
    2. Connect this of the NotePlugin to the inputPlugin. property of the Calendar bean.
    3. Connect onActionCanceledEvent event of NotePlugin with visible() property of Calendar bean and set the connection parameter to true
    4. . Also check the Pass event data checkbox.
    5. Connect onActionPerformedEvent event of NotePlugin with visible() property of Calendar bean and set the connection parameter to true
    6. . Also check the Pass event data checkbox.

   The wiring for this application is shown in the following figure.

NotePlugin Wiring

Figure 2 - runDemo1 Wiring Diagram

 

Demo2

What the Demo Does

This demo shows you how to add the DayPlugin bean to the Calendar. 

The result of the application is shown in the following figure.

Calendar Demo   DayPlugin Demo

Figure 3 - runDemo2 Application

 

The functions shown in this example are simple:

  1. Choose a date by selecting the appropriate year and month from the respective drop down lists, and choose the day by clicking on the required day of month  on the calendars interface (by default current date is set).
  2. To access the DayPlugin, click the right button of the mouse and choose DayPlugin from popup menu.
  3. Select the time interval by choosing a start time and and end time.
  4. Click the OK button to save the interval as a string and the interval start and end time or click the Cancel button to return to the Calendar bean without saving the previous values.

Wiring Instructions

To build the application, do the following:

  1. Create a new class with the Frame superclass.
  2. Drop on the frame:
    1. Calendar bean
    2. DayPlugin bean
  3. Make the following connections:
    1. Connect this of the DayPlugin to the inputPlugin property of the Calendar bean.
    2. Connect onActionCanceledEvent event of DayPlugin with visible() property of Calendar bean and set the connection parameter to true
    3. . Also check the Pass event data checkbox.
    4. Connect onActionPerformedEvent event of DayPlugin with visible() property of Calendar bean and set the connection parameter to true
    5. . Also check the Pass event data checkbox.
  4. Set the following Design time properties of the DayPlugin bean:
    1. timeStep property, to a  value in minutes (1-59).
    2. initialTimeInterval property using its property editor. It consists of start and end time of the interval in the day which will be divided into steps as given by timeStep property.
    3. timeFormat24h property, if true 24 hour mode is used, if false 12 hour mode is used.

The wiring for  this application is shown in the following figure.

DayPlugin Wiring

Figure 4- runDemo2 Wiring Diagram

 

Demo3

What the Demo Does

This demo shows you how to add the ToDoPlugin bean to the Calendar. 

The result of the application is shown in the following figure.

Calendar Demo  

Figure 5 - runDemo3 Application

 

The functions shown in this example are simple:

  1. Choose a date by selecting the appropriate year and month from the respective drop down lists, and choose the day by clicking on the required day of month on the calendars interface (by default current date is set).
  2. To access the ToDoPlugin, click the right button of the mouse and choose ToDoPlugin from the popup menu.
  3. In the ToDoPlugin window, by default system date and time are displayed. To set the time of your todo item, press the New button, change the time (hours and minutes),  then enter your todo item. If there already is a todo item in this time slot it will be displayed.
  4. Click the Update button to save your todo item.
  5. Click the Discard button to delete an already saved todo item or click the Cancel button to return to  the Calendar bean without saving.
 

Wiring Instructions

To build the application, do the following:

  1. Create a new class with the Frame superclass.
  2. Drop on the frame:
    1. Calendar bean
    2. ToDoPlugin bean
  3. Make the following connections:
    1. Connect this of the ToDoPlugin to the inputPlugin property of the Calendar bean.
    2. Connect onActionCanceledEvent event of DayPlugin with visible() property of Calendar bean and set the connection parameter to true. Also check the Pass event data checkbox.

The wiring for  this application is shown in the following figure.

DayPlugin Wiring

Figure 6- runDemo3 Wiring Diagram