|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.concord.biologica.ui.MeiosisModel
MeiosisModel contains the data describing the meiosis process state for a given organism. It does not contain the code for drawing the animation as that is in the view objects that show meiosis.
This model and its associated chromosome models 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.
An object of this class will generate the following property change events:
UIProp.MEIOSIS_STARTED
,
UIProp.MEIOSIS_STEP
,
UIProp.MOVED_GAMETE
,
UIProp.ORGANISM
,
UIProp.SELECTED_GAMETE
,
PropertyChangeListener
Field Summary | |
static int |
BOTTOM_LEFT_GAMETE
|
static int |
BOTTOM_RIGHT_GAMETE
|
protected java.beans.PropertyChangeSupport |
changes
Utility object which manages property change events and listeners. |
static int |
NO_GAMETE
Gamete identifiers |
static int |
TOP_LEFT_GAMETE
|
static int |
TOP_RIGHT_GAMETE
|
Constructor Summary | |
MeiosisModel()
Creates a new instance of MeiosisModel with no organism. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener aListener)
Add a property change listener for properties. |
int |
decrementStep()
Decrement the current step of the meiosis, returning the new current step value. |
void |
delete()
Deletes this model and associated models |
java.util.Enumeration |
getBottomLeftGameteChromosomeModels()
Return an enumeration of the bottom left gamete chromosome models. |
java.util.Enumeration |
getBottomRightGameteChromosomeModels()
Return an enumeration of the bottom right gamete chromosome models. |
java.util.Vector[] |
getBranchs()
|
java.util.Vector |
getCellBoundaries()
Get CellArc and CellLine enumeration to use when drawing boundaries and spindles of cell(s). |
java.util.Vector |
getChromosomeModelEnumerations()
Get vector of the appropriate enumerations of chromosome models in this meiosis model. |
MeiosisChromosomeModel |
getCrossoverChromosomeModel(MeiosisChromosomeModel aMeiosisChromosomeModel)
Get the chromosome model for the chromosome that can crossover with the given chromosome model chromosome. |
java.util.Enumeration |
getGameteChromosomeModels(int aGamete)
Return an enumeration of the appropriate gamete chromosome models. |
int |
getMovedGamete()
Get the moved gamete |
java.util.Vector |
getMovedGameteChromosomeModels()
Get the moved gamete's chromosome models |
int |
getNumberOfVisibleChromosomePairs()
Returns the number of chromosome pairs to be aligned vertically in a cell during Metaphase 1 and Metaphase 2 during meiosis. |
Organism |
getOrganism()
Get the organism for this model, may be null. |
int |
getPhase(int aStep)
Get the phase of the meiosis at the given step. |
int |
getSelectedGamete()
Get the selected gamete |
int |
getStep()
Get the current step of the meiosis. |
java.util.Enumeration |
getTopLeftGameteChromosomeModels()
Return an enumeration of the top left gamete chromosome models. |
java.util.Enumeration |
getTopRightGameteChromosomeModels()
Return an enumeration of the top right gamete chromosome models. |
int |
incrementStep()
Increment the current step of the meiosis |
boolean |
isCrossOverHappened()
|
boolean |
isReplicated()
Returns whether the current step of meiosis represents a step in which chromosome are replicated. |
void |
moveGamete()
Move the gamete currently selected into fertilization. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
Handle property change events |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener aListener)
Remove a property change listener for properties. |
void |
selectGamete(int xMouse,
int yMouse)
Select the gamete closest to the given x, y coordinates. |
void |
setBranchs(java.util.Vector[] arr)
|
void |
setCrossOverHappened(boolean bln)
|
void |
setEnclosingViewRectangle(java.awt.Rectangle aRectangle)
Set the rectangle within which the meiosis model must confine itself and its chromosomes. |
int |
setStep(int aStep)
Set the current step of the meiosis. |
void |
switchHorizontalAlignment(int iChromosome)
Switch horizontal alignment of 2 chromosomes at step 33 and beyond in meiosis. |
void |
switchVerticalAlignment(int iChromosome)
Switch vertical alignment of 2 chromosomes at step 73 and beyond in meiosis. |
void |
unmoveGamete()
Unmove gamete. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NO_GAMETE
public static final int TOP_LEFT_GAMETE
public static final int BOTTOM_LEFT_GAMETE
public static final int TOP_RIGHT_GAMETE
public static final int BOTTOM_RIGHT_GAMETE
protected transient java.beans.PropertyChangeSupport changes
Constructor Detail |
public MeiosisModel()
Method Detail |
public void delete()
public Organism getOrganism()
public int decrementStep()
public int incrementStep()
public int getStep()
public int setStep(int aStep)
aStep
- int - new proposed current steppublic int getPhase(int aStep)
aStep
- int - the step of meiosispublic java.util.Enumeration getGameteChromosomeModels(int aGamete)
aGamete
- int - the gamete (TOP_LEFT_GAMETE, etc.)public java.util.Enumeration getTopLeftGameteChromosomeModels()
public java.util.Enumeration getBottomLeftGameteChromosomeModels()
public java.util.Enumeration getTopRightGameteChromosomeModels()
public java.util.Enumeration getBottomRightGameteChromosomeModels()
public java.util.Vector getChromosomeModelEnumerations()
In other words, if the current step is 0 to 30, a Vector holding a single Enumeration over the chromosome models of the original cell will be returned.
If the current step is 31 to 70, a Vector holding two Enumerations will be returned with the first Enumeration over the chromosome models of the left daughter cell and the second Enumeration over the chromosome models of the right daughter cell.v
If the current step is 71 to 100, a Vector holding four Enumerations will be returned with the first Enumeration over the chromosome models of the top left gamete, second over the bottom left gamete, third over the top right gamete and fourth over the bottom right gamete.
public java.util.Vector getCellBoundaries()
public void setEnclosingViewRectangle(java.awt.Rectangle aRectangle)
aRectangle
- Rectangle - the enclosing rectanglepublic int getNumberOfVisibleChromosomePairs()
public MeiosisChromosomeModel getCrossoverChromosomeModel(MeiosisChromosomeModel aMeiosisChromosomeModel)
aMeiosisChromosomeModel
- MeiosisChromosomeModel - the given meiosis chromosome modelpublic boolean isReplicated()
public void switchHorizontalAlignment(int iChromosome)
iChromosome
- int - number of chromosome (1-based number)public void switchVerticalAlignment(int iChromosome)
iChromosome
- int - number of chromosome (1-based number)public void selectGamete(int xMouse, int yMouse)
Usually this method is called from SmallMeiosisView.mousePressed()
xMouse
- int - mouse x coordinateyMouse
- int - mouse y coordinatepublic int getSelectedGamete()
public java.util.Vector getMovedGameteChromosomeModels()
public void moveGamete()
Usually this method is called when the user clicks on the move into fertilization button in the sex view.
If there is already a moved gamete, this call is ignored. The user must move the old moved gamete back into the meiosis view first.
If no gamete is selected, this call is ignored. The user must select a gamete first.
public int getMovedGamete()
public void unmoveGamete()
public void addPropertyChangeListener(java.beans.PropertyChangeListener aListener)
aListener
- PropertyChangeListener - a new listenerpublic void removePropertyChangeListener(java.beans.PropertyChangeListener aListener)
aListener
- PropertyChangeListener - a listener to removepublic void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
event
- PropertyChangeEvent - the property change eventpublic void setBranchs(java.util.Vector[] arr)
public java.util.Vector[] getBranchs()
public void setCrossOverHappened(boolean bln)
public boolean isCrossOverHappened()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |