org.proteinshader.graphics.exceptions
Class GlyphImageException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.proteinshader.graphics.exceptions.GlyphException
              extended by org.proteinshader.graphics.exceptions.GlyphImageException
All Implemented Interfaces:
Serializable

public class GlyphImageException
extends GlyphException

To report errors that occur while creating a Glyph.

This subclass of GlyphException is intended to be used when the image for an individual glyph could not be copied from a larger image that contains a set of glyphs. This error would occur if there was a problem calculating the correct pixel index positions for extracting the glyph image. Therefore, this exception class has data members for storing all of the information relevant to the attempted extraction.

See Also:
Serialized Form

Constructor Summary
GlyphImageException(String name, int x1, int y1, int x2, int y2, int bytesPerPixel, int glyphWidth, int glyphHeight, int glyphSetImageWidth, int glyphSetImageHeight)
          The message given this constructor can be retrieved using getMessage().
 
Method Summary
 int getBytesPerPixel()
          Returns the number of bytes per pixel for the glyph.
 int getGlyphHeight()
          Returns the height of the Glyph in pixels.
 int getGlyphSetImageHeight()
          Returns the height in pixels of the glyph set image.
 int getGlyphSetImageWidth()
          Returns the width in pixels of the glyph set image.
 int getGlyphWidth()
          Returns the width of the Glyph in pixels.
 String getName()
          Returns the name of the glyph.
 int getX1()
          Returns the x-coordinate of the top left corner of the glyph.
 int getX2()
          Returns the x-coordinate of the bottom right corner of the glyph.
 int getY1()
          Returns the y-coordinate of the top left corner of the glyph.
 int getY2()
          Returns the y-coordinate of the bottom right corner of the glyph.
 
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

GlyphImageException

public GlyphImageException(String name,
                           int x1,
                           int y1,
                           int x2,
                           int y2,
                           int bytesPerPixel,
                           int glyphWidth,
                           int glyphHeight,
                           int glyphSetImageWidth,
                           int glyphSetImageHeight)
The message given this constructor can be retrieved using getMessage().

Parameters:
name - the name of a glyph is usually a single character.
x1 - x-coordinate of upper left corner of the glyph.
y1 - y-coordinate of upper left corner of the glyph.
x2 - x-coordinate of lower right corner of the glyph.
y2 - y-coordinate of lower right corner of the glyph.
bytesPerPixel - there can be 1 to 4 bytes per pixel.
glyphWidth - the width of the Glyph image in pixels.
glyphHeight - the height of the Glyph image in pixels.
glyphSetImageWidth - the GlyphSet image width in pixels.
glyphSetImageHeight - the GlyphSet image height in pixels.
Method Detail

getName

public String getName()
Returns the name of the glyph. The name is usually only one character, but a glyph can sometimes represent two or more characters.

Returns:
The name as a String.

getX1

public int getX1()
Returns the x-coordinate of the top left corner of the glyph.

Returns:
The x-coordinate of the top left corner of the glyph.

getY1

public int getY1()
Returns the y-coordinate of the top left corner of the glyph.

Returns:
The y-coordinate of the top left corner of the glyph.

getX2

public int getX2()
Returns the x-coordinate of the bottom right corner of the glyph.

Returns:
The x-coordinate of the bottom right corner of the glyph.

getY2

public int getY2()
Returns the y-coordinate of the bottom right corner of the glyph.

Returns:
The y-coordinate of the bottom right corner of the glyph.

getBytesPerPixel

public int getBytesPerPixel()
Returns the number of bytes per pixel for the glyph.

Returns:
The number of bytes per pixel.

getGlyphWidth

public int getGlyphWidth()
Returns the width of the Glyph in pixels.

Returns:
The width in bytes.

getGlyphHeight

public int getGlyphHeight()
Returns the height of the Glyph in pixels.

Returns:
The height in pixels.

getGlyphSetImageWidth

public int getGlyphSetImageWidth()
Returns the width in pixels of the glyph set image.

Returns:
The width in pixels.

getGlyphSetImageHeight

public int getGlyphSetImageHeight()
Returns the height in pixels of the glyph set image.

Returns:
The height in pixels.


Copyright © 2007-2008