Configuring and Using the NoteToy Demo Program

Last revised: 11Feb2002 GLG

Table of Contents

Configuring the Demo

The NoteToy demo is a NoteToyFrame that reads settings (properties) from the plain text file "NoteToy-settings.txt". It uses the Platform class to select a Notification implementation as the factory. You can override the platform's default selection by setting the "notetoy.class" property in the settings file. If the class you set can't be instantiated on the platform, then the platform's default is used instead.

The actual Notification imp selected for the platform determines which of the four check-boxes will be enabled or disabled. If the imp does not support a particular capability, then the corresponding check-box is disabled. The Notification.getCapabilities() method is used to do this.

Other properties you set in "NoteToy-settings.txt" determine the icon, sound, and alert-text that will be displayed. Obviously, if the imp doesn't have the capability, it doesn't matter what value you assign to the property. However, you should still use the proper type (don't assign a sound-number of "xyz", since "xyz" isn't a number).

Here are the property names that you can set. If you don't assign a value, or if you assign an invalid value, a default (in parentheses) is used instead:

The program reads its settings file only once, when it starts up. If you edit the settings, you must quit and rerun the program in order for the changes to be seen.

Using the NoteToy Program

The main NoteToy program window contains a label, four checkboxes, and two buttons. Click its close box to quit, or select Quit from its menu.

The label above the checkboxes tells you exactly which Notification imp is in use.

Each checkbox determines the presence or absence of a single Notification modality. If a checkbox is disabled, then the Notification imp does not have that capability, and you can't assign that modality to the Notification.

When you click the "Post" button, the checkboxes are used to set the modalities of a Notification. A background thread is then told to delay 5 seconds before posting that Notification. The 5 secs gives you time to switch the NoteToy program from front to some non-front position (background, hidden, minimized, etc.). Or you can leave NoteToy in its front position and observe the result.

Five secs after clicking "Post", the Notification is actually post()'ed. Its modalities are presented, and at the same time two timed tasks begin. The first task delays 15 secs and then rescinds the Notification. The second task waits up to 10 secs for a user-response to an alerting Notification. This second task is only started for alerting Notifications. It is not started if there's no alert.

When the Notification is posted, you can interact with the presented elements, or leave them alone to observe the behavior if no user interaction occurs. The precise behavior is system and platform dependent.

At any time, you can reconfigure the checkboxes and "Post" another Notification. If you do this, the prior Notification is rescinded, reconfigured, and then reposted. The NoteToy program only uses a single Notification.

You can also click "Rescind" at any time to rescind the Notification, or to prevent its posting in the first place.


To Greg's Home Page
To Greg's Software Page