| java.lang.Object org.geotools.gui.swing.ExceptionMonitor
ExceptionMonitor | final public class ExceptionMonitor (Code) | | Utility which enables exception messages to be displayed in a Swing component. The
standard
java.lang.Exception class contains methods which write the exception to the
error console. This
ExceptionMonitor class adds static methods which make the message,
and eventually the exception trace, appear in a viewer component.
since: 2.0 version: $Id: ExceptionMonitor.java 27848 2007-11-12 13:10:32Z desruisseaux $ author: Martin Desruisseaux |
main | public static void main(String[] args)(Code) | | Display a dummy exception. This method is provided only as an easy
way to test the dialog appearance from the command line.
|
paintStackTrace | public static void paintStackTrace(Graphics2D graphics, Rectangle widgetBounds, Throwable exception)(Code) | | Writes the specified exception trace in the specified graphics context. This method is
useful when an exception has occurred inside a
Component.paint method and we want
to write it rather than leaving an empty window.
Parameters: graphics - Graphics context in which to write exception. The graphics context shouldbe in its initial state (default affine transform, default colour, etc...) Parameters: widgetBounds - Size of the trace which was being drawn. Parameters: exception - Exception whose trace we want to write. |
show | public static void show(Component owner, Throwable exception)(Code) | | Displays an error message for the specified exception. Note that this method can
be called from any thread (not necessarily the Swing thread).
Parameters: owner - Component in which the exception is produced, or null if unknown. Parameters: exception - Exception which has been thrown and is to be reported to the user. |
show | public static void show(Component owner, Throwable exception, String message)(Code) | | Displays an error message for the specified exception. Note that this method can
be called from any thread (not necessarily the Swing thread).
Parameters: owner - Component in which the exception is produced, or null if unknown. Parameters: exception - Exception which has been thrown and is to be reported to the user. Parameters: message - Message to display. If this parameter is null, thenException.getLocalizedMessage will be called to obtain the message. |
|
|