|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ptolemy.gui.MessageHandler | +--ptolemy.gui.GraphicalMessageHandler
This is a message handler that reports errors in a graphical dialog box. When an applet or application starts up, it should call setContext() to specify a component with respect to which the display window should be created. This ensures that if the application is iconified or deiconified, that the display window goes with it. If the context is not specified, then the display window is centered on the screen, but iconifying and deiconifying may not work as desired.
This class is based on (and contains code from) the diva GUIUtilities class.
Field Summary | |
protected static java.awt.Component |
_context
|
Constructor Summary | |
GraphicalMessageHandler()
|
Method Summary | |
protected void |
_error(java.lang.String info)
Show the specified error message. |
protected void |
_error(java.lang.String info,
java.lang.Throwable throwable)
Show the specified message and throwable information. |
protected void |
_message(java.lang.String info)
Show the specified message in a modal dialog. |
protected void |
_warning(java.lang.String info)
Show the specified message in a modal dialog. |
protected void |
_warning(java.lang.String info,
java.lang.Throwable throwable)
Show the specified message and throwable information in a modal dialog. |
protected boolean |
_yesNoQuestion(java.lang.String question)
Ask the user a yes/no question, and return true if the answer is yes. |
static java.awt.Component |
getContext()
Get the component set by a call to setContext(), or null if none. |
static void |
setContext(java.awt.Component context)
Set the component with respect to which the display window should be created. |
Methods inherited from class ptolemy.gui.MessageHandler |
error, error, getMessageHandler, message, setMessageHandler, shortDescription, warning, warning, yesNoQuestion |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.awt.Component _context
Constructor Detail |
public GraphicalMessageHandler()
Method Detail |
public static java.awt.Component getContext()
setContext(Component)
public static void setContext(java.awt.Component context)
context
- The component context.getContext()
protected void _error(java.lang.String info)
_error
in class MessageHandler
info
- The message.protected void _error(java.lang.String info, java.lang.Throwable throwable)
_error
in class MessageHandler
info
- The message.throwable
- The throwable.CancelException
protected void _message(java.lang.String info)
_message
in class MessageHandler
info
- The message.protected void _warning(java.lang.String info) throws CancelException
_warning
in class MessageHandler
info
- The message.
CancelException
- If the user clicks on the "Cancel" button.protected void _warning(java.lang.String info, java.lang.Throwable throwable) throws CancelException
_warning
in class MessageHandler
info
- The message.throwable
- The throwable.
CancelException
- If the user clicks on the "Cancel" button.protected boolean _yesNoQuestion(java.lang.String question)
_yesNoQuestion
in class MessageHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |