|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.concord.biologica.ui.MeiosisChromosomeModel
MeiosisChromosomeModel contains the data describing the meiosis 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 meiosis 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.
Field Summary | |
static int |
BOTTOM_LEFT_GAMETE_CHROMOSOME
|
static int |
BOTTOM_RIGHT_GAMETE_CHROMOSOME
|
static int |
FIRST_STRAND
|
static int |
LEFT_DAUGHTER_CELL_CHROMOSOME
|
static int |
ORIG_CELL_CHROMOSOME
Types of chromosome models |
static int |
P_STRAND_ONE
Types of chromosome model strands |
static int |
P_STRAND_TWO
|
static int |
Q_STRAND_ONE
|
static int |
Q_STRAND_TWO
|
static int |
RIGHT_DAUGHTER_CELL_CHROMOSOME
|
static int |
SECOND_STRAND
|
static int |
TOP_LEFT_GAMETE_CHROMOSOME
|
static int |
TOP_RIGHT_GAMETE_CHROMOSOME
|
static int |
UNSPECIFIED_STRAND
Number of chromosome model strands, used in creating gamete chromosome models only. |
Constructor Summary | |
MeiosisChromosomeModel(MeiosisModel aMeiosisModel,
OrganismChromosome anOrganismChromosome,
int aMeiosisChromosomeModelType,
MeiosisChromosomeModel aPreviousMeiosisChromosomeModel,
int aPreviousMeiosisChromosomeModelStrand,
java.awt.Rectangle anEnclosingViewRectangle,
int aVisibleChromosomePairNumber,
java.awt.Color aColor)
Creates a new instance of MeiosisChromosomeModel with the given chromosome, meiosis model, type and previous chromosome model. |
Method Summary | |
void |
clearTemporaryOffsets()
Clear temporary offsets. |
void |
delete()
Delete this chromosome model. |
float |
getAnglePStrandAtCentromereAtLastStep()
Get the angle of the P strand of the chromosome at the centromere at the last step of this chromosome's portion of meiosis. |
float |
getAngleQStrandAtCentromereAtLastStep()
Get the angle of the Q strand of the chromosome at the centromere at the last step of this chromosome's portion of meiosis. |
OrganismChromosome |
getChromosome()
Get the chromosome for this model. |
int |
getChromosomeModelType()
Get the chromosome model type of this chromosome model |
int |
getNumberType()
Get the number/type of this chromosome model, zero if no chromosome. |
MeiosisChromosomeModel |
getPreviousMeiosisChromosomeModel()
Return the previous meiosis chromosome model. |
OrganismAllele[] |
getPStrandOneAlleles()
Get the array of organism alleles for P strand one. |
java.awt.Color[] |
getPStrandOneColors()
Get the array of Colors for P strand one. |
OrganismAllele[] |
getPStrandTwoAlleles()
Get the array of organism alleles for P strand two. |
java.awt.Color[] |
getPStrandTwoColors()
Get the array of Colors for P strand two. |
OrganismAllele[] |
getQStrandOneAlleles()
Get the array of organism alleles for Q strand one. |
java.awt.Color[] |
getQStrandOneColors()
Get the array of Colors for Q strand one. |
OrganismAllele[] |
getQStrandTwoAlleles()
Get the array of organism alleles for Q strand two. |
java.awt.Color[] |
getQStrandTwoColors()
Get the array of Colors for Q strand two. |
OrganismAllele[] |
getStrandAlleles(int aStrand)
Get the array of Alleles for the given strand. |
java.awt.Color[] |
getStrandColors(int aStrand)
Get the array of Colors for the given strand |
int |
getXCentromereAtStep(int aStep)
Get the X centromere location as an int at the given meiosis step (NOT the array index!!). |
int[] |
getXPStrandOnePoints(int aMeiosisStep)
Get the array of int's for x coordinates of P strand one at the given meiosis step. |
int[] |
getXPStrandTwoPoints(int aMeiosisStep)
Get the array of int's for x coordinates of P strand two at the given meiosis step. |
int[] |
getXQStrandOnePoints(int aMeiosisStep)
Get the array of int's for x coordinates of Q strand one at the given meiosis step. |
int[] |
getXQStrandTwoPoints(int aMeiosisStep)
Get the array of int's for x coordinates of Q strand two at the given meiosis step. |
int |
getXTemporaryOffset()
Get the X temporary offset of this chromosome. |
int |
getYCentromereAtStep(int aStep)
Get the Y centromere location as an int at the given meiosis step (NOT the array index!!). |
int[] |
getYPStrandOnePoints(int aMeiosisStep)
Get the array of int's for y coordinates of P strand one at the given meiosis step. |
int[] |
getYPStrandTwoPoints(int aMeiosisStep)
Get the array of int's for y coordinates of P strand two at the given meiosis step. |
int[] |
getYQStrandOnePoints(int aMeiosisStep)
Get the array of int's for y coordinates of Q strand one at the given meiosis step. |
int[] |
getYQStrandTwoPoints(int aMeiosisStep)
Get the array of int's for y coordinates of Q strand two at the given meiosis step. |
int |
getYTemporaryOffset()
Get the Y temporary offset of this chromosome. |
boolean |
isVisible()
Get whether this model is visible (true) or not visible (false). |
void |
setAlleleAndColorVectors(java.awt.Color aDefaultColor)
Set the vectors for the alleles and colors of this meiosis chromosome model. |
void |
setEnclosingViewRectangle(java.awt.Rectangle newEnclosingViewRectangle)
Set the enclosing rectangle for the view containing a display of this chromosome model. |
void |
setMeiosisChromosomeModelType(int newType)
Set chromosome model type. |
void |
setPreviousMeiosisChromosomeModel(MeiosisChromosomeModel aPreviousMeiosisChromosomeModel)
Set the previous chromosome model of this chromosome model. |
void |
setPStrandOneAlleles(OrganismAllele[] arr)
|
void |
setPStrandOneColors(java.awt.Color[] arr)
|
void |
setPStrandTwoAlleles(OrganismAllele[] arr)
|
void |
setPStrandTwoColors(java.awt.Color[] arr)
|
void |
setQStrandOneAlleles(OrganismAllele[] arr)
|
void |
setQStrandOneColors(java.awt.Color[] arr)
|
void |
setQStrandTwoAlleles(OrganismAllele[] arr)
|
void |
setQStrandTwoColors(java.awt.Color[] arr)
|
void |
setStrandAlleles(int aStrand,
OrganismAllele[] alleles)
Set the array of Alleles for the given strand. |
void |
setStrandColors(int aStrand,
java.awt.Color[] colors)
Set the array of Colors for the given strand. |
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 |
public static final int ORIG_CELL_CHROMOSOME
public static final int LEFT_DAUGHTER_CELL_CHROMOSOME
public static final int RIGHT_DAUGHTER_CELL_CHROMOSOME
public static final int TOP_LEFT_GAMETE_CHROMOSOME
public static final int BOTTOM_LEFT_GAMETE_CHROMOSOME
public static final int TOP_RIGHT_GAMETE_CHROMOSOME
public static final int BOTTOM_RIGHT_GAMETE_CHROMOSOME
public static final int P_STRAND_ONE
public static final int Q_STRAND_ONE
public static final int P_STRAND_TWO
public static final int Q_STRAND_TWO
public static final int UNSPECIFIED_STRAND
public static final int FIRST_STRAND
public static final int SECOND_STRAND
Constructor Detail |
public MeiosisChromosomeModel(MeiosisModel aMeiosisModel, OrganismChromosome anOrganismChromosome, int aMeiosisChromosomeModelType, MeiosisChromosomeModel aPreviousMeiosisChromosomeModel, int aPreviousMeiosisChromosomeModelStrand, java.awt.Rectangle anEnclosingViewRectangle, int aVisibleChromosomePairNumber, java.awt.Color aColor)
The previous chromosome model varies with the type. For an "original cell" chromosome model, the previous chromosome model is null as the original cell is first. For a "daughter cell" chromosome model, the previous chromosome model is the "original cell" chromosome model. For a "gamete" chromosome model, the previous chromosome model is the daughter cell.
The previous chromosome model is used to make sure that the transition from one state to the next across significant boundaries is smooth during meiosis animation. For example, when transitioning from the original cell to 2 daughter cells, the chromosome model(s) used changes from the single original cell chromosome model to the 2 daughter cell chromosome models. Ditto when going from daughter cell chromosome models to gamete chromosome models.
aMeiosisModel
- MeiosisModel - the parent meiosis model, may not be nullanOrganismChromosome
- OrganismChromosome - the organism chromosome upon which to base model, may not be nullaMeiosisChromosomeModelType
- int - the type of this chromosome model (original, daughter, gamete, etc.)aPreviousMeiosisChromosomeModel
- MeiosisChromosomeModel - the previous chromosome model chronologically.aPreviousMeiosisChromosomeModelStrand
- int - the strand of previous chromosome model chronologically from which this model is formed (FIRST_STRAND, SECOND_STRAND, etc.)anEnclosingViewRectangle
- Rectangle - an enclosing rectangle for the chromosome's viewaChromosomeVisiblePairNumber
- int - the number of the chromosome pair that this model is part of (e.g. 1) - zero if not visibleaColor
- Color - the color of the chromosomejava.lang.IllegalArgumentException
- - illegal argumentMethod Detail |
public void delete()
public void setMeiosisChromosomeModelType(int newType)
newType
- int - new type of chromosome modelpublic void setPreviousMeiosisChromosomeModel(MeiosisChromosomeModel aPreviousMeiosisChromosomeModel)
public void setEnclosingViewRectangle(java.awt.Rectangle newEnclosingViewRectangle)
This method will adjust the locations of the chromosome model coordinates to scale properly when the view is resized by the user.
newEnlosingViewRectangle
- Rectangle - an enclosing rectangle for this model's viewpublic boolean isVisible()
public int getXTemporaryOffset()
public int getYTemporaryOffset()
public void setTemporaryOffsets(int anXTemporaryOffset, int aYTemporaryOffset)
anXTemporaryOffset
- int - an X temporary offsetaYTemporaryOffset
- int - a Y temporary offsetpublic void clearTemporaryOffsets()
public int getXCentromereAtStep(int aStep)
aStep
- int - step of meiosis (not array index!!)java.lang.IllegalArgumentException
- - illegal step inputpublic int getYCentromereAtStep(int aStep)
aStep
- int - step of meiosis (not array index!!)java.lang.IllegalArgumentException
- - illegal step inputpublic float getAnglePStrandAtCentromereAtLastStep()
public float getAngleQStrandAtCentromereAtLastStep()
public int[] getXPStrandOnePoints(int aMeiosisStep)
aMeiosisStep
- int - the meiosis step value (NOT the array index)public int[] getYPStrandOnePoints(int aMeiosisStep)
aMeiosisStep
- int - the meiosis step value (NOT the array index)public int[] getXPStrandTwoPoints(int aMeiosisStep)
aMeiosisStep
- int - the meiosis step value (NOT the array index)public int[] getYPStrandTwoPoints(int aMeiosisStep)
aMeiosisStep
- int - the meiosis step value (NOT the array index)public int[] getXQStrandOnePoints(int aMeiosisStep)
aMeiosisStep
- int - the meiosis step value (NOT the array index)public int[] getYQStrandOnePoints(int aMeiosisStep)
aMeiosisStep
- int - the meiosis step value (NOT the array index)public int[] getXQStrandTwoPoints(int aMeiosisStep)
aMeiosisStep
- int - the meiosis step value (NOT the array index)public int[] getYQStrandTwoPoints(int aMeiosisStep)
aMeiosisStep
- int - the meiosis step value (NOT the array index)public void setAlleleAndColorVectors(java.awt.Color aDefaultColor)
Note that calling this method after doing a crossing over on a daughter cell meiosis chromosome model will undo the crossing over changes. That may or may not be what you intended, so be careful.
aDefaultColor
- Color - use this color if you have no other choice, must be specified
for ORIG_CELL_CHROMOSOME chromosome modelspublic void setStrandAlleles(int aStrand, OrganismAllele[] alleles)
aStrand
- int - the strandOrganismAllele[]
- - array of Organism Alleles along given strand of chromosomepublic OrganismAllele[] getStrandAlleles(int aStrand)
aStrand
- int - the strandpublic OrganismAllele[] getPStrandOneAlleles()
public void setPStrandOneAlleles(OrganismAllele[] arr)
public OrganismAllele[] getPStrandTwoAlleles()
public void setPStrandTwoAlleles(OrganismAllele[] arr)
public OrganismAllele[] getQStrandOneAlleles()
public void setQStrandOneAlleles(OrganismAllele[] arr)
public OrganismAllele[] getQStrandTwoAlleles()
public void setQStrandTwoAlleles(OrganismAllele[] arr)
public void setStrandColors(int aStrand, java.awt.Color[] colors)
aStrand
- int - the strandColor[]
- - array of Colors along given strand of chromosomepublic java.awt.Color[] getStrandColors(int aStrand)
aStrand
- int - the strandpublic java.awt.Color[] getPStrandOneColors()
public void setPStrandOneColors(java.awt.Color[] arr)
public java.awt.Color[] getPStrandTwoColors()
public void setPStrandTwoColors(java.awt.Color[] arr)
public java.awt.Color[] getQStrandOneColors()
public void setQStrandOneColors(java.awt.Color[] arr)
public java.awt.Color[] getQStrandTwoColors()
public void setQStrandTwoColors(java.awt.Color[] arr)
public MeiosisChromosomeModel getPreviousMeiosisChromosomeModel()
public int getChromosomeModelType()
public int getNumberType()
public OrganismChromosome getChromosome()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |