edu.washington.NVisF.plotter
Class PlotterMessageHandler

java.lang.Object
  |
  +--edu.washington.NVisF.plotter.PlotterMessageHandler

public class PlotterMessageHandler
extends java.lang.Object

The PlotterMessageHandler provides static methods to handle exceptions and messages generated by plotting classes. In many cases, it is preferable to use these methods to notify the user what went wrong but try to continue without throwing an exception. The current algorithm simply prints to the standard error stream. An single instance of this class is self-maintained and provided to all classes through the Instance() method (this is an example of the Singleton pattern, if you're familiar with that terminology).


Method Summary
static void handleException(java.lang.Exception e)
          does something with the supplied Exception; is null-safe
static void handleMessage(java.lang.String message)
          does something with the provided message for the user
static PlotterMessageHandler Instance()
          returns the single instance of this class
static void setPrintStackTrace(boolean flag)
          if flag is true, the stack trace for exceptions will be printed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

Instance

public static PlotterMessageHandler Instance()
returns the single instance of this class

handleException

public static void handleException(java.lang.Exception e)
does something with the supplied Exception; is null-safe

handleMessage

public static void handleMessage(java.lang.String message)
does something with the provided message for the user

setPrintStackTrace

public static void setPrintStackTrace(boolean flag)
if flag is true, the stack trace for exceptions will be printed. Default is true.