org.geotools.resources
Class GraphicsUtilities

java.lang.Object
  extended by org.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 org.geotools.gui.swing.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.

Since:
2.0
Version:
$Id: GraphicsUtilities.java 30640 2008-06-12 17:34:32Z acuster $
Author:
Martin Desruisseaux (IRD)

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

paintStackTrace

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.

Parameters:
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.

printStackTrace

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 org.geotools.gui.swing.ExceptionMonitor. Do not rely on it.



Copyright © 1996-2010 Geotools. All Rights Reserved.