Class GraphicsUtilities

  extended byorg.geotools.resources.GraphicsUtilities

public final class GraphicsUtilities
extends java.lang.Object

A set of utilities methods for painting in a Graphics2D handle. Method in this class was used to be in ExceptionMonitor. We had to extract them in a separated class in order to avoid dependencies of renderer module toward the GUI one, especially since the extracted methods are not Swing specific.

$Id: 17672 2006-01-19 00:25:55Z desruisseaux $
Martin Desruisseaux

Method Summary
static void paintStackTrace(java.awt.Graphics2D graphics, java.awt.Rectangle widgetBounds, java.lang.Throwable exception)
          Writes the specified exception trace in the specified graphics context.
static java.lang.String printStackTrace(java.lang.Throwable exception)
          Returns an exception trace.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public static void paintStackTrace(java.awt.Graphics2D graphics,
                                   java.awt.Rectangle widgetBounds,
                                   java.lang.Throwable exception)
Writes the specified exception trace in the specified graphics context. This method is useful when an exception has occurred inside a Component.paint(java.awt.Graphics) method and we want to write it rather than leaving an empty window.

exception - Exception whose trace we want to write.
graphics - Graphics context in which to write exception. The graphics context should be in its initial state (default affine transform, default colour, etc...)
widgetBounds - Size of the trace which was being drawn.


public static java.lang.String printStackTrace(java.lang.Throwable exception)
Returns an exception trace. All tabs will have been replaced by 4 white spaces. This method was used to be a private one in ExceptionMonitor. Do not rely on it.

Copyright © GeoTools. All Rights Reserved.