org.concord.biologica.ui
Class FertilizationChromosomeModel

java.lang.Object
  |
  +--org.concord.biologica.ui.FertilizationChromosomeModel

public final class FertilizationChromosomeModel
extends java.lang.Object

FertilizationChromosomeModel contains the data describing the fertilization state for a given chromosome. It does not contain the code for drawing the animation as that is in the view objects that show meiosis.

This class and the associated fertilization model class assume a display space of 0 to 1000 by 0 to 1000 and all locations are within that range. This means a user of these model classes must scale locations appropriately from this coordinate system to their own in order to draw the chromosomes.

Version:
$Revision: 1.2 $ $Date: 2002/04/05 20:26:48 $
Author:
$Author: qliao $

Field Summary
static int FEMALE_GAMETE_CHROMOSOME
          Types of fertilization chromosome models
static int MALE_GAMETE_CHROMOSOME
           
 
Constructor Summary
FertilizationChromosomeModel(int aFertilizationChromosomeModelType, FertilizationModel aFertilizationModel, MeiosisChromosomeModel aMeiosisChromosomeModel, java.awt.Rectangle anEnclosingViewRectangle)
          Creates a new instance of FertilizationChromosomeModel with the given type, fertilization model and meiosis chromosome model.
 
Method Summary
 void clearTemporaryOffsets()
          Clear temporary offsets.
 void delete()
          Delete this chromosome model.
 ChromosomeSpecification getChromosomeSpecification()
          Get a ChromosomeSpecification for this model.
 OrganismAllele[] getPStrandAlleles()
          Get the array of organism alleles for P strand.
 java.awt.Color[] getPStrandColors()
          Get the array of Colors for P strand.
 OrganismAllele[] getQStrandAlleles()
          Get the array of organism alleles for Q strand.
 java.awt.Color[] getQStrandColors()
          Get the array of Colors for Q strand.
 float getXCentromereAtStep(int aStep)
          Get the X centromere location as an int at the given fertilization step (NOT the array index!!).
 int[] getXPStrandPoints(int aFertilizationStep)
          Get the array of int's for x coordinates of P strand at the given fertilization step.
 int[] getXQStrandPoints(int aFertilizationStep)
          Get the array of int's for x coordinates of Q strand at the given fertilization step.
 int getXTemporaryOffset()
          Get the X temporary offset of this chromosome.
 float getYCentromereAtStep(int aStep)
          Get the Y centromere location as an int at the given fertilization step (NOT the array index!!).
 int[] getYPStrandPoints(int aFertilizationStep)
          Get the array of int's for y coordinates of P strand at the given meiosis step.
 int[] getYQStrandPoints(int aFertilizationStep)
          Get the array of int's for y coordinates of Q strand at the given fertilization step.
 int getYTemporaryOffset()
          Get the Y temporary offset of this chromosome.
 void setAlleleVectors()
          Set allele vectors to show which alleles are at which array positions on the chromosomes.
 void setEnclosingViewRectangle(java.awt.Rectangle newEnclosingViewRectangle)
          Set the enclosing rectangle for the view containing a display of this chromosome model.
 void setTemporaryOffsets(int anXTemporaryOffset, int aYTemporaryOffset)
          Set the temporary offsets of this chromosome.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEMALE_GAMETE_CHROMOSOME

public static final int FEMALE_GAMETE_CHROMOSOME
Types of fertilization chromosome models

MALE_GAMETE_CHROMOSOME

public static final int MALE_GAMETE_CHROMOSOME
Constructor Detail

FertilizationChromosomeModel

public FertilizationChromosomeModel(int aFertilizationChromosomeModelType,
                                    FertilizationModel aFertilizationModel,
                                    MeiosisChromosomeModel aMeiosisChromosomeModel,
                                    java.awt.Rectangle anEnclosingViewRectangle)
Creates a new instance of FertilizationChromosomeModel with the given type, fertilization model and meiosis chromosome model.

Parameters:
aFertilizationChromosomeModelType - int - the type of this chromosome model (male or female)
aFertilizationModel - FertilizationModel - the parent fertilization model, may not be null
aMeiosisChromosomeModel - MeiosisChromosomeModel - the meiosis chromosome model from a gamete
anEnclosingViewRectangle - Rectangle - an enclosing rectangle for the chromosome's view
Throws:
java.lang.IllegalArgumentException - - illegal argument
Method Detail

delete

public void delete()
Delete this chromosome model. Assume the meiosis model is calling this method and therefore we don't need to notify it.

setEnclosingViewRectangle

public void setEnclosingViewRectangle(java.awt.Rectangle newEnclosingViewRectangle)
Set the enclosing rectangle for the view containing a display of this chromosome model. Note that this is not always the rectangle enclosing the cell displaying this chromosome. This method will adjust the locations of the chromosome model coordinates to scale properly when the view is resized by the user.

Parameters:
newEnlosingViewRectangle - Rectangle - an enclosing rectangle for this model's view

getXTemporaryOffset

public int getXTemporaryOffset()
Get the X temporary offset of this chromosome.

Returns:
int - x temporary offset

getYTemporaryOffset

public int getYTemporaryOffset()
Get the Y temporary offset of this chromosome.

Returns:
int - y temporary offset

setTemporaryOffsets

public void setTemporaryOffsets(int anXTemporaryOffset,
                                int aYTemporaryOffset)
Set the temporary offsets of this chromosome.

Parameters:
anXTemporaryOffset - int - an X temporary offset
aYTemporaryOffset - int - a Y temporary offset

clearTemporaryOffsets

public void clearTemporaryOffsets()
Clear temporary offsets. A shortcut routine identical to calling setTemporaryOffsets(0,0).


getXCentromereAtStep

public float getXCentromereAtStep(int aStep)
Get the X centromere location as an int at the given fertilization step (NOT the array index!!).
Parameters:
aStep - int - step of fertilization (not array index!!)
Returns:
float - x location of centromere
Throws:
java.lang.IllegalArgumentException - - illegal step input

getYCentromereAtStep

public float getYCentromereAtStep(int aStep)
Get the Y centromere location as an int at the given fertilization step (NOT the array index!!).
Parameters:
aStep - int - step of fertilization (not array index!!)
Returns:
float - y location of centromere
Throws:
java.lang.IllegalArgumentException - - illegal step input

getXPStrandPoints

public int[] getXPStrandPoints(int aFertilizationStep)
Get the array of int's for x coordinates of P strand at the given fertilization step.
Parameters:
aFertilizationStep - int - the fertilization step value (NOT the array index)
Returns:
int[] - array of int values for x coordinates of P strand

getYPStrandPoints

public int[] getYPStrandPoints(int aFertilizationStep)
Get the array of int's for y coordinates of P strand at the given meiosis step.
Parameters:
aFertilizationStep - int - the fertilization step value (NOT the array index)
Returns:
int[] - array of int values for y coordinates of P strand

getXQStrandPoints

public int[] getXQStrandPoints(int aFertilizationStep)
Get the array of int's for x coordinates of Q strand at the given fertilization step.
Parameters:
aFertilizationStep - int - the fertilization step value (NOT the array index)
Returns:
int[] - array of int values for x coordinates of Q strand

getYQStrandPoints

public int[] getYQStrandPoints(int aFertilizationStep)
Get the array of int's for y coordinates of Q strand at the given fertilization step.
Parameters:
aFertilizationStep - int - the fertilization step value (NOT the array index)
Returns:
int[] - array of int values for y coordinates of Q strand

setAlleleVectors

public void setAlleleVectors()
Set allele vectors to show which alleles are at which array positions on the chromosomes.

getPStrandAlleles

public OrganismAllele[] getPStrandAlleles()
Get the array of organism alleles for P strand. Elements are null if there is no organism allele at that position, non-null if there is an allele there.
Returns:
OrganismAllele[] - array of OrganismAllele values along P strand of chromosome

getQStrandAlleles

public OrganismAllele[] getQStrandAlleles()
Get the array of organism alleles for Q strand. Elements are null if there is no organism allele at that position, non-null if there is an allele there.
Returns:
OrganismAllele[] - array of OrganismAllele values along Q strand of chromosome

getPStrandColors

public java.awt.Color[] getPStrandColors()
Get the array of Colors for P strand.
Returns:
Color[] - array of Colors along P strand of chromosome

getQStrandColors

public java.awt.Color[] getQStrandColors()
Get the array of Colors for Q strand.
Returns:
Color[] - array of Colors along Q strand of chromosome

getChromosomeSpecification

public ChromosomeSpecification getChromosomeSpecification()
Get a ChromosomeSpecification for this model. Typically this is used to create the child organism.

Returns:
ChromosomeSpecification for this chromosome model