org.proteinshader.gui.exceptions
Class ScreenShotException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.proteinshader.gui.exceptions.ScreenShotException
All Implemented Interfaces:
Serializable

public class ScreenShotException
extends Exception

Used to report an error that prevented a screen shot from being taken.

In addition to the standard error message, the requested format and File to write to can be stored and recovered with getFormat() and getFile(), respectively. If a lower-level exception was caught and rethrown, its message can be stored and then recovered with getLowerLevelMessage().

See Also:
Serialized Form

Constructor Summary
ScreenShotException(ImageFormatEnum format, File file, String message)
          The message given this constructor can be retrieved using getMessage().
ScreenShotException(ImageFormatEnum format, File file, String message, String lowerLevelMessage)
          The message given this constructor can be retrieved using getMessage().
 
Method Summary
 File getFile()
          Returns the file object that holds the name and path of the file to write the screen shot to.
 ImageFormatEnum getFormat()
          Returns the format type for the image file that could not be written.
 String getLowerLevelMessage()
          Returns the message (if any) that was obtained from a lower-level exception (for example, from an IOException or an IllegalArgumentException).
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScreenShotException

public ScreenShotException(ImageFormatEnum format,
                           File file,
                           String message,
                           String lowerLevelMessage)
The message given this constructor can be retrieved using getMessage().

Parameters:
format - the format type for the image file to create.
file - holds the name and path for the image file to create.
message - a description of the problem.
lowerLevelMessage - message copied from lower-level exception.

ScreenShotException

public ScreenShotException(ImageFormatEnum format,
                           File file,
                           String message)
The message given this constructor can be retrieved using getMessage().

Parameters:
format - the format type for the image file to create.
file - holds the name and path for the image file to create.
message - a description of the problem.
Method Detail

getFormat

public ImageFormatEnum getFormat()
Returns the format type for the image file that could not be written. The format could be null.

Returns:
The image format type as an enum.

getFile

public File getFile()
Returns the file object that holds the name and path of the file to write the screen shot to. The File returned could be null.

Returns:
The format type as a String (for example, "PNG" or "JPG").

getLowerLevelMessage

public String getLowerLevelMessage()
Returns the message (if any) that was obtained from a lower-level exception (for example, from an IOException or an IllegalArgumentException). The String returned could be null.

Returns:
The lower-exception message as a String.


Copyright © 2007-2008