org.concord.biologica.engine
Class SpeciesImage

java.lang.Object
  |
  +--org.xml.sax.HandlerBase
        |
        +--org.concord.biologica.engine.EngineObject
              |
              +--org.concord.biologica.engine.SpeciesImage
All Implemented Interfaces:
org.xml.sax.DocumentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, java.io.Serializable

public final class SpeciesImage
extends EngineObject
implements java.io.Serializable

This class represents an image containing some of the graphics for drawing the organisms of a particular species. Every species must have one or more of these image objects in order to draw its organisms.

All the images for a given species MUST use the same cell size - the width and height of cells in the tables shown in the pictures below. So the image column width and image row height numbers are kept in the Species object, not here. A Species' column width and row height apply to all the SpeciesImage objects in that Species.

Essentially this class maps phenotypes to drawing operations for the species. A species image is a collection of species image cells in rows and columns as shown below. Each row and column has one or more characteristics associated with it. An image cell - the portion of the species image at a given row and column - is the image to be drawn for an organism with the characteristics of that column and row.

For convenience in managing the characteristics associated with each row and column, a SpeciesImage object has a collection of SpeciesImageColumn and another collection SpeciesImageRow objects. These SpeciesImageColumn and SpeciesImageRow objects each represent one column or row in the SpeciesImage and manage the characteristics for that column or row.

<-- Species Image Columns --> +----------+----------+----------+----------+-----> | | | | | ^ | Image | Image | Image | Image | Images --> | | (0,0) | (0,1) | (0,2) | (0,3) | | | | | | | | | | | | S +----------+----------+----------+----------+-----> p | | | | | e | Image | Image | Image | Image | c | (1,0) | (1,1) | (1,2) | (1,3) | i | | | | | e | | | | | s +----------+----------+----------+----------+-----> | | | | | I | Image | | | | m | (2,0) | ... | | | a | | | | | g | | | | | e +----------+----------+----------+----------+-----> | | | | | R | | | | | o | ... | | | | w | | | | | s | | | | | +----------+----------+----------+----------+-----> | | | | | | | | | | | | | | | | | | | | | | | | v | | | | | +----------+----------+----------+----------+-----> | | | | | | | | | | v v v v v Each of the above cells is the same size and contains either a complete image for an organism or a partial image.

For example, for humans, the above SpeciesImage might have only 2 cells - a male image and a female image - and each cell would contain the complete image to be drawn.

Another example, for dragons, a SpeciesImage might have many, many cells where the color characteristics are across the top (e.g. Blue, Brown, Gold, Green, Purple, Yellow) and other characteristics would be down the left side (e.g. Dead, Plain Tail, Fancy Tail, Arrow Tail, etc.) So drawing a dragon means determining the characteristics of the dragon and then picking out and drawing the correct cells from the dragon SpeciesImage's. A second SpeciesImage for dragon might have the head images for the dragon. A third SpeciesImage for dragon might have the wing types, etc.

So a dragon Bodies SpeciesImage might look something like: Blue Brown Green Gold +----------+----------+----------+----------+ D | | | | | e | Blue + | Brown + | Green + | Gold + | a | Dead | Dead | Dead | Dead | d | Dragon | Dragon | Dragon | Dragon | | | | | | +----------+----------+----------+----------+ 4 P | | | | | L l T | Blue + | Brown + | Green + | Gold + | e + a a | Plain | Plain | Plain | Plain | g i i | Tail + | Tail + | Tail + | Tail + | s n l | 4 Legs | 4 Legs | 4 Legs | 4 Legs | +----------+----------+----------+----------+ 4 F | | | | | L a T | Blue + | Brown + | Green + | Gold + | e + n a | Fancy | Fancy | Fancy | Fancy | g c i | Tail + | Tail + | Tail + | Tail + | s y l | 4 Legs | 4 Legs | 4 Legs | 4 Legs | +----------+----------+----------+----------+ 4 A | | | | | L r T | Blue + | Brown + | Green + | Gold + | e + r a | Arrow | Arrow | Arrow | Fancy | g o i | Tail + | Tail + | Tail + | Tail + | s w l | 4 Legs | 4 Legs | 4 Legs | 4 Legs | +----------+----------+----------+----------+ 0 P | | | | | L l T | Blue + | Brown + | Green + | Gold + | e + a a | Plain | Plain | Plain | Plain | g i i | Tail + | Tail + | Tail + | Tail + | s n l | 0 Legs | 0 Legs | 0 Legs | 0 Legs | +----------+----------+----------+----------+ 0 F | | | | | L a T | Blue + | Brown + | Green + | Gold + | e + n a | Fancy | Fancy | Fancy | Fancy | g c i | Tail + | Tail + | Tail + | Tail + | s y l | 0 Legs | 0 Legs | 0 Legs | 0 Legs | +----------+----------+----------+----------+ 0 A | | | | | L r T | Blue + | Brown + | Green + | Gold + | e + r a | Arrow | Arrow | Arrow | Fancy | g o i | Tail + | Tail + | Tail + | Tail + | s w l | 0 Legs | 0 Legs | 0 Legs | 0 Legs | +----------+----------+----------+----------+ 2 P | | | | | L l T | Blue + | Brown + | Green + | Gold + | e + a a | Plain | Plain | Plain | Plain | g i i | Tail + | Tail + | Tail + | Tail + | s n l | 2 Legs | 2 Legs | 2 Legs | 2 Legs | +----------+----------+----------+----------+ 2 F | | | | | L a T | Blue + | Brown + | Green + | Gold + | e + n a | Fancy | Fancy | Fancy | Fancy | g c i | Tail + | Tail + | Tail + | Tail + | s y l | 2 Legs | 2 Legs | 2 Legs | 2 Legs | +----------+----------+----------+----------+ 2 A | | | | | L r T | Blue + | Brown + | Green + | Gold + | e + r a | Arrow | Arrow | Arrow | Fancy | g o i | Tail + | Tail + | Tail + | Tail + | s w l | 2 Legs | 2 Legs | 2 Legs | 2 Legs | +----------+----------+----------+----------+ Drawing a particular dragon organism means drawing 1 or more of the image cells from 1 or more SpeciesImage's. For a dead dragon, we'd draw just one cell from one SpeciesImage (because all dead dragons look the same or all the variations in one SpeciesImage). For a live dragon, we'd draw 4 to 6 cells from multiple SpeciesImage depending on the phenotype of the dragon.

In general, drawing an organism of a species amounts to:

The actual GIF image file corresponding to a SpeciesImage object MUST, MUST be in the file named: /species//_.gif For example, the GIF image for a SpeciesImage of the name "bodies" of the large size in the species "dragon" must be in the file: /species/dragon/bodies_large.gif Sorry about this restrictiveness, but it's the only simple way I could think to avoid machine or platform dependent image paths. There are 6 image sizes: SpeciesImage.XXSMALL_IMAGE_SIZE - xxsmall SpeciesImage.XSMALL_IMAGE_SIZE - xsmall SpeciesImage.SMALL_IMAGE_SIZE - small SpeciesImage.MEDIUM_IMAGE_SIZE - medium SpeciesImage.LARGE_IMAGE_SIZE - large SpeciesImage.XLARGE_IMAGE_SIZE - xlarge and each size must have a file with the appropriate name. For example, the dragon species has the following 5 files for bodies: /species/dragon/bodies_xxsmall.gif /species/dragon/bodies_xsmall.gif /species/dragon/bodies_small.gif /species/dragon/bodies_medium.gif /species/dragon/bodies_large.gif /species/dragon/bodies_xlarge.gif The species creator determines the exact sizes of the images for each size. Every image must have EXACTLY the same number of columns and rows and the same rules for pulling images from the files.

An object of this class will generate the following property change events:

  • EngineProp.DELETED - object has been deleted
  • EngineProp.HOTSPOT_COLOR - hotspot color has changed
  • EngineProp.HOTSPOT_RADIUS - hotspot radius has changed
  • EngineProp.ID - object's id has changed
  • EngineProp.IMAGE_TYPE - the image type has changed
  • EngineProp.LOCKED_STATE - the object's locked state has changed
  • EngineProp.NAME - name of this species image has changed
  • EngineProp.SPECIES_IMAGE_COLUMN_ADDED - column added
  • EngineProp.SPECIES_IMAGE_COLUMN_REMOVED - column removed
  • EngineProp.SPECIES_IMAGE_ROW_ADDED - row added
  • EngineProp.SPECIES_IMAGE_ROW_REMOVED - row removed

Version:
$Revision: 1.13 $ $Date: 2002/04/02 23:34:24 $
Author:
$Author: dima $
See Also:
EngineProp.DELETED, EngineProp.HOTSPOT_COLOR, EngineProp.HOTSPOT_RADIUS, EngineProp.ID, EngineProp.IMAGE_TYPE, EngineProp.LOCKED_STATE, EngineProp.NAME, EngineProp.SPECIES_IMAGE_COLUMN_ADDED, EngineProp.SPECIES_IMAGE_COLUMN_REMOVED, EngineProp.SPECIES_IMAGE_ROW_ADDED, EngineProp.SPECIES_IMAGE_ROW_REMOVED, PropertyChangeListener, Serialized Form

Field Summary
static int HOTSPOT_IMAGE_TYPE
           
static int INVISIBLE_IMAGE_TYPE
           
static int LARGE_IMAGE_SIZE
           
static int MEDIUM_IMAGE_SIZE
           
static int NORMAL_IMAGE_TYPE
          Possible image types:
static int SCOPE_IMAGE_TYPE
           
static int SMALL_IMAGE_SIZE
           
static int UNKNOWN_IMAGE_SIZE
          Image sizes, generally used as follows:
static int XLARGE_IMAGE_SIZE
           
static int XSMALL_IMAGE_SIZE
           
static int XXSMALL_IMAGE_SIZE
           
 
Fields inherited from class org.concord.biologica.engine.EngineObject
AUTOMATIC_LOCKED, AUTOMATIC_LOCKED_STRING, changes, deleted, FALSE, id, lockedState, MANUAL_AND_AUTOMATIC_LOCKED, MANUAL_AND_AUTOMATIC_LOCKED_STRING, MANUAL_LOCKED, MANUAL_LOCKED_STRING, NULL_ID, TRUE, UNLOCKED, UNLOCKED_STRING, xmlElementContext
 
Constructor Summary
SpeciesImage(Species aSpecies, java.lang.String aName)
          Creates a new species image given a species and a name.
SpeciesImage(Species aSpecies, java.lang.String anElementName, int anElementID, com.sun.xml.parser.Parser anXMLParser, ImportContext importContext)
          Create a new species image and start handling XML parsing events to set the properties of this object.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Receive notification of character data.
 void delete()
          Delete this object, notifying parent objects and deleting any child objects.
 void delete(boolean notifyChange)
           
 boolean drawDataImage(java.awt.Graphics g, int sizeID, int rowIndex, int columnIndex, java.awt.Component c)
           
 boolean drawDataImage(java.awt.Graphics g, int sizeID, int rowIndex, int columnIndex, int xInit, int yInit, java.awt.Component c)
           
 boolean drawDataImage(int[] pixels, int worig, int horig, int sizeID, int rowIndex, int columnIndex)
           
 void endElement(java.lang.String anElementName)
          Handle notification that the parsing of the given element has ended.
protected  java.lang.String getDataPathName(java.lang.String name)
           
 java.net.URL getDataResource(java.lang.String nameResource)
           
 java.awt.Image getDataSourceImage(int[] pixels, int worig, int horig, int sizeID, int rowID, int columnID, int[] xoffset, int[] yoffset)
           
 java.awt.Image getDataSourceImage(int sizeID, int rowID, int columnID, int[] xoffset, int[] yoffset, java.awt.Component c)
           
 java.awt.Color getHotspotColor()
          Get the hotspot color of this species image
 int getHotspotRadius()
          Get the hotspot radius for this species image.
 java.awt.Image getImage(int imageSize, java.awt.Component component)
          Get the actual Image object for this species image.
protected  java.lang.String getImagePathName(java.lang.String name)
           
 int getImageType()
          Get the image type for this species image.
 java.lang.String getName()
          Return the name of this species image.
 int getNumberOfSpeciesImageColumns()
          Get the number of species image columns for this species image.
 int getNumberOfSpeciesImageRows()
          Get the number of species image columns for this species image.
 java.lang.String getSource(int imageSize)
          Return the file of this species image in File form.
 Species getSpecies()
          Return the species of this object.
 java.util.Enumeration getSpeciesImageColumns()
          Returns an enumeration over the vector of species image columns in this species image.
 SpeciesImageRow getSpeciesImageRowAt(int aRowIndex)
          Returns a specific species image row, null if invalid row.
 java.util.Enumeration getSpeciesImageRows()
          Returns an enumeration over the vector of species image columns in this species image.
 World getWorld()
          Get the world containing this object.
 void ignorableWhitespace(char[] ch, int start, int length)
          Receive notification of ignorable white space character data.
protected  void initializeImageSource(java.lang.String name)
           
 void initImageDownloading(int sizeID, java.awt.Component c)
           
 boolean isDataSourceExist(int imageSize)
           
static boolean isImageVisible()
           
 void preloadSpeciesImageSize(int imageSize)
           
 void setAutomaticLocked(boolean automaticLocked)
          Set or unset the automatic locked state of this object, leaving other components of the locked state untouched.
 void setHotspotColor(java.awt.Color aColor)
          Set the hotspot color of this species image
 void setHotspotRadius(int aHotspotRadius)
          Set the hotspot radius of this species image.
 void setImageType(int anImageType)
          Set the image type of this species image.
static void setImageVisible(boolean visible)
           
 void setLockedState(int aLockedState)
          Set the lock state of the object, recursively setting the lock state of children objects.
 void setManualLocked(boolean manualLocked)
          Set or unset the manual locked state of this object, leaving other components of the locked state untouched.
 void setName(java.lang.String aName)
          Set the name of this species image.
 void startElement(java.lang.String anElementName, org.xml.sax.AttributeList amap)
          Handle notification that the parser has hit the start of a new element with the given name and attributes.
 java.lang.String toString()
          Return a string representation of this object.
 void updateFilename()
          Called by parent species when it's name changes, as this image cares.
 void updateOrganismImage(OrganismImage anOrganismImage)
          Update an organism image given the current state of this species image, its rows and columns.
 void writeToStream(java.io.PrintWriter stream)
          Writes this object to the given stream in XML format.
 
Methods inherited from class org.concord.biologica.engine.EngineObject
addPropertyChangeListener, getID, getLockedState, getLockedStateAsString, isAutomaticLocked, isDeleted, isLocked, isManualLocked, notifySelected, release, removePropertyChangeListener, setID, setLockedStateAsString
 
Methods inherited from class org.xml.sax.HandlerBase
endDocument, error, fatalError, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, startDocument, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_IMAGE_SIZE

public static final int UNKNOWN_IMAGE_SIZE
Image sizes, generally used as follows:

XXSMALL_IMAGE_SIZE - default in population view, often used in pedigree, impossible to discern phenotype XSMALL_IMAGE_SIZE - default in pedigree view, barely possible to discern phenotype SMALL_IMAGE_SIZE - smallest where you can easily discern phenotype MEDIUM_IMAGE_SIZE - used sometimes in multiple and single organism views, may discern phenotype LARGE_IMAGE_SIZE - default size in multiple and single organism views, easily discern phenotype XLARGE_IMAGE_SIZE - extra large size for special circumstances


XXSMALL_IMAGE_SIZE

public static final int XXSMALL_IMAGE_SIZE

XSMALL_IMAGE_SIZE

public static final int XSMALL_IMAGE_SIZE

SMALL_IMAGE_SIZE

public static final int SMALL_IMAGE_SIZE

MEDIUM_IMAGE_SIZE

public static final int MEDIUM_IMAGE_SIZE

LARGE_IMAGE_SIZE

public static final int LARGE_IMAGE_SIZE

XLARGE_IMAGE_SIZE

public static final int XLARGE_IMAGE_SIZE

NORMAL_IMAGE_TYPE

public static final int NORMAL_IMAGE_TYPE
Possible image types:

NORMAL_IMAGE_TYPE - normal, phenotype image type, shown in all cases for an organism HOTSPOT_IMAGE_TYPE - an image shown for the organism when a hotspot is pressed SCOPE_IMAGE_TYPE - an image shown when an organism is clicked on with the scope tool INVISIBLE_IMAGE_TYPE - an image shown when an organism is invisible


HOTSPOT_IMAGE_TYPE

public static final int HOTSPOT_IMAGE_TYPE

SCOPE_IMAGE_TYPE

public static final int SCOPE_IMAGE_TYPE

INVISIBLE_IMAGE_TYPE

public static final int INVISIBLE_IMAGE_TYPE
Constructor Detail

SpeciesImage

public SpeciesImage(Species aSpecies,
                    java.lang.String aName)
Creates a new species image given a species and a name.

Parameters:
aSpecies - Species - the species containing this image, may not be null
aName - String - the species image name, may not be null
Throws:
java.lang.IllegalArgumentException - - input argument(s) illegal

SpeciesImage

public SpeciesImage(Species aSpecies,
                    java.lang.String anElementName,
                    int anElementID,
                    com.sun.xml.parser.Parser anXMLParser,
                    ImportContext importContext)
Create a new species image and start handling XML parsing events to set the properties of this object.

Parameters:
aSpecies - Species - the enclosing species for this new species image
anElementName - String - the element name
anElementID - int - the element id
anXMLParser - com.sun.xml.parser.Parser - the element parser
importContext - ImportContext - import context for mapping ids from file to this world
Throws:
java.lang.IllegalArgumentException - - input arguments illegal
Method Detail

getImagePathName

protected java.lang.String getImagePathName(java.lang.String name)

getDataPathName

protected java.lang.String getDataPathName(java.lang.String name)

initializeImageSource

protected void initializeImageSource(java.lang.String name)

getDataResource

public java.net.URL getDataResource(java.lang.String nameResource)

preloadSpeciesImageSize

public void preloadSpeciesImageSize(int imageSize)

startElement

public void startElement(java.lang.String anElementName,
                         org.xml.sax.AttributeList amap)
                  throws org.xml.sax.SAXException
Handle notification that the parser has hit the start of a new element with the given name and attributes.

For internal elements (elements that are non-EngineObject instance variables of this object), call xmlElementContext.startElement() and xmlElementContext will receive the remaining element notifications. For external elements (elements that are EngineObject instance variables of this object), create an object of the appropriate class and that object will receive the remaining element notifications.

Overrides:
startElement in class org.xml.sax.HandlerBase
Parameters:
anElementName - String - name of element
amap - AttributeList - an attribute list

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Receive notification of character data.
Overrides:
characters in class org.xml.sax.HandlerBase
Parameters:
ch - char[] - characters
start - int - start of string
length - int - length of string

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
Receive notification of ignorable white space character data.
Overrides:
ignorableWhitespace in class org.xml.sax.HandlerBase
Parameters:
ch - char[] - characters
start - int - start of string
length - int - length of string

endElement

public void endElement(java.lang.String anElementName)
                throws org.xml.sax.SAXException
Handle notification that the parsing of the given element has ended.
Overrides:
endElement in class org.xml.sax.HandlerBase
Parameters:
anElementName - String - the element name

delete

public void delete()
Delete this object, notifying parent objects and deleting any child objects.

When this method is successful, a property change event is generated for the property named EngineProp.DELETED.

Overrides:
delete in class EngineObject

delete

public void delete(boolean notifyChange)

toString

public java.lang.String toString()
Return a string representation of this object.

Overrides:
toString in class EngineObject
Returns:
String - string representation of object

getSpecies

public Species getSpecies()
Return the species of this object.

Returns:
Species - species of this object, never null

getWorld

public World getWorld()
Get the world containing this object.

Overrides:
getWorld in class EngineObject
Returns:
World - the world containing this object, never null.

getName

public java.lang.String getName()
Return the name of this species image. May be null.

Returns:
String - name of this species image, may not be null.

setName

public void setName(java.lang.String aName)
Set the name of this species image.

When this method is successful, a property change event is fired for the property named EngineProp.NAME.

Parameters:
aName - String - the new name of this species image, may not be null
Throws:
java.lang.IllegalArgumentException - - input argument illegal
ObjectDeletedException - - object is deleted and cannot be modified
ObjectLockedException - - object is locked and cannot be modified

updateFilename

public void updateFilename()
Called by parent species when it's name changes, as this image cares.

getSource

public java.lang.String getSource(int imageSize)
Return the file of this species image in File form.
Parameters:
imageSize - int - the image size (e.g. XSMALL_IMAGE_SIZE)
Returns:
File - file containing this image, may be null

getImage

public java.awt.Image getImage(int imageSize,
                               java.awt.Component component)
Get the actual Image object for this species image. It's expected this method will be called by code wishing to draw some portion of this image (e.g. the OrganismView). The actual Image is loaded the first time this method is called and then the Image is cached for future use.
Parameters:
imageSize - int - the image size (e.g. XSMALL_IMAGE_SIZE)
component - Component - the component on whose behalf we'll get image, may not be null
Returns:
Image - the image

setAutomaticLocked

public void setAutomaticLocked(boolean automaticLocked)
Set or unset the automatic locked state of this object, leaving other components of the locked state untouched. Recursively sets the automatic locked state of children of this object.

When this property is changed, a property change event is fired for the property named EngineProp.LOCKED_STATE.

Overrides:
setAutomaticLocked in class EngineObject
Parameters:
automaticLocked - boolean - object should be automatic locked (true) or not (false)

setManualLocked

public void setManualLocked(boolean manualLocked)
Set or unset the manual locked state of this object, leaving other components of the locked state untouched. Recursively sets the manual locked state of children of this object.

When this property is changed, a property change event is fired for the property named EngineProp.LOCKED_STATE.

Overrides:
setManualLocked in class EngineObject
Parameters:
manualLocked - boolean - object should be manually locked (true) or not (false)

setLockedState

public void setLockedState(int aLockedState)
Set the lock state of the object, recursively setting the lock state of children objects.

When this property is changed, a property change event is fired for the property named EngineProp.LOCKED_STATE.

Overrides:
setLockedState in class EngineObject
Parameters:
aLockedState - int - new locked state of this object
Throws:
java.lang.IllegalArgumentException - - new locked state invalid

getSpeciesImageColumns

public java.util.Enumeration getSpeciesImageColumns()
Returns an enumeration over the vector of species image columns in this species image.

Returns:
Enumeration - an enumeration over the species image columns in this species image

getNumberOfSpeciesImageColumns

public int getNumberOfSpeciesImageColumns()
Get the number of species image columns for this species image.

Returns:
int - the number of species image columns

getSpeciesImageRows

public java.util.Enumeration getSpeciesImageRows()
Returns an enumeration over the vector of species image columns in this species image.

Returns:
Enumeration - an enumeration over the species image columns in this species image

getSpeciesImageRowAt

public SpeciesImageRow getSpeciesImageRowAt(int aRowIndex)
Returns a specific species image row, null if invalid row.
Parameters:
aRowIndex - int - a row index
Returns:
SpeciesImageRow - a SpeciesImageRow, null if invalid

getNumberOfSpeciesImageRows

public int getNumberOfSpeciesImageRows()
Get the number of species image columns for this species image.

Returns:
int - the number of species image columns

updateOrganismImage

public void updateOrganismImage(OrganismImage anOrganismImage)
Update an organism image given the current state of this species image, its rows and columns. Usually this amounts to determining which row and column pair satisfies the characteristics of the organism associated with the given organism image.
Parameters:
anOrganismImage - OrganismImage - organism image to update, may not be null

setImageVisible

public static void setImageVisible(boolean visible)

isImageVisible

public static boolean isImageVisible()

getImageType

public int getImageType()
Get the image type for this species image.

Returns:
int - image type of this species image

setImageType

public void setImageType(int anImageType)
Set the image type of this species image.

Parameters:
anImageType - int - new image type

getHotspotColor

public java.awt.Color getHotspotColor()
Get the hotspot color of this species image
Returns:
Color - hotspot color

setHotspotColor

public void setHotspotColor(java.awt.Color aColor)
Set the hotspot color of this species image
Parameters:
aColor - Color - the new hotspot color
Throws:
java.lang.IllegalArgumentException - - input color null

getHotspotRadius

public int getHotspotRadius()
Get the hotspot radius for this species image.

Returns:
int - hotspot radius of this species image

setHotspotRadius

public void setHotspotRadius(int aHotspotRadius)
Set the hotspot radius of this species image.

Parameters:
aHotspotRadius - int - new hotspot radius

writeToStream

public void writeToStream(java.io.PrintWriter stream)
                   throws java.io.IOException
Writes this object to the given stream in XML format. Usually this method is used to write the object to a file for saving it, but that is potentially not the only use.

We could supply a default implementation that knows how to write the id value. But that convenience is not chosen because it's never correct to use just this implementation of these methods, so I'd rather have a compilation fail if a derived class fails to implement this method.

The inverse of this method is a constructor that takes a org.xml.sax.Parser argument and other arguments.

Overrides:
writeToStream in class EngineObject
Parameters:
stream - PrintWriter - print stream
Throws:
java.lang.IllegalArgumentException - - input arguments illegal
java.io.IOException - - an IO error occurred in java libraries

isDataSourceExist

public boolean isDataSourceExist(int imageSize)

getDataSourceImage

public java.awt.Image getDataSourceImage(int sizeID,
                                         int rowID,
                                         int columnID,
                                         int[] xoffset,
                                         int[] yoffset,
                                         java.awt.Component c)

getDataSourceImage

public java.awt.Image getDataSourceImage(int[] pixels,
                                         int worig,
                                         int horig,
                                         int sizeID,
                                         int rowID,
                                         int columnID,
                                         int[] xoffset,
                                         int[] yoffset)

initImageDownloading

public void initImageDownloading(int sizeID,
                                 java.awt.Component c)

drawDataImage

public boolean drawDataImage(java.awt.Graphics g,
                             int sizeID,
                             int rowIndex,
                             int columnIndex,
                             java.awt.Component c)

drawDataImage

public boolean drawDataImage(java.awt.Graphics g,
                             int sizeID,
                             int rowIndex,
                             int columnIndex,
                             int xInit,
                             int yInit,
                             java.awt.Component c)

drawDataImage

public boolean drawDataImage(int[] pixels,
                             int worig,
                             int horig,
                             int sizeID,
                             int rowIndex,
                             int columnIndex)