monrovia.client.ui
Class MessageDialog

java.lang.Object
  |
  +--com.sun.kjava.Spotlet
        |
        +--monrovia.client.ui.MessageDialog

public class MessageDialog
extends com.sun.kjava.Spotlet

A pop-up modal dialog that displays a title string, text box full of text, and a dismiss button.


Fields inherited from class com.sun.kjava.Spotlet
CALCICON, KEY_HARD1, KEY_HARD2, KEY_HARD3, KEY_HARD4, KEY_POWER, MENUICON, NO_EVENT_OPTIONS, PAGEDOWN, PAGEUP, WANT_SYSTEM_KEYS
 
Constructor Summary
MessageDialog(com.sun.kjava.DialogOwner pOwner, java.lang.String pTitle, java.lang.String pMessage)
          Create a new message dialog.
 
Method Summary
 void dismissDialog()
          Dismiss the Dialog.
 void keyDown(int pKey)
          If we have a ScrollTextBox, then allow scrolling.
 void paint()
          Paint the Dialog.
 void penDown(int pX, int pY)
          If the user pressed the dismiss button, dismiss the Dialog.
 void penMove(int pX, int pY)
          If we have a ScrollTextBox, then allow scrolling.
 void showDialog()
          Show the Dialog: register it and paint it.
 
Methods inherited from class com.sun.kjava.Spotlet
beamReceive, beamSend, dispatch, getFlashID, penUp, register, setPalmEventOptions, unknownEvent, unregister
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageDialog

public MessageDialog(com.sun.kjava.DialogOwner pOwner,
                     java.lang.String pTitle,
                     java.lang.String pMessage)
Create a new message dialog. The contents of the box is passed in the pMessage parameter. A button is created which allows for dismissal of the Dialog. If the text overflows the text box, a ScrollTextBox is used to display it. The owner of the Dialog gets called through the DialogOwner interface dialogDismissed() method when the dialog is dismissed. The owner must then re-register the Spotlet that was running when the MessageDialog was created. It must also re-paint the screen as appropriate. The class implementation is based on the J2ME Dialog class.
Parameters:
pOwner - the owner of this Dialog
pTitle - the title of this Dialog - used when the Dialog is dismissed
pMessage - the contents of the TextBox
Method Detail

paint

public void paint()
Paint the Dialog.

showDialog

public void showDialog()
Show the Dialog: register it and paint it.

dismissDialog

public void dismissDialog()
Dismiss the Dialog. Unregister it and alert the owner.

penDown

public void penDown(int pX,
                    int pY)
If the user pressed the dismiss button, dismiss the Dialog. If we have a ScrollTextBox, then allow scrolling.
Overrides:
penDown in class com.sun.kjava.Spotlet
Parameters:
pX - the X coordinate of the user's press.
pY - the Y coordinate of the user's press.

penMove

public void penMove(int pX,
                    int pY)
If we have a ScrollTextBox, then allow scrolling.
Overrides:
penMove in class com.sun.kjava.Spotlet
Parameters:
pX - the X coordinate of the user's press.
pY - the Y coordinate of the user's press.

keyDown

public void keyDown(int pKey)
If we have a ScrollTextBox, then allow scrolling.
Overrides:
keyDown in class com.sun.kjava.Spotlet
Parameters:
pKey - the key pressed/entered by the user