org.concord.biologica.ui
Class PedigreeOrganismView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--org.concord.biologica.ui.UIView
                          |
                          +--org.concord.biologica.ui.OrganismView
                                |
                                +--org.concord.biologica.ui.PedigreeOrganismView
All Implemented Interfaces:
java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.beans.PropertyChangeListener, SelectionPresenter, java.io.Serializable

public final class PedigreeOrganismView
extends OrganismView
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.beans.PropertyChangeListener, SelectionPresenter

The pedigree organism view of BioLogica.

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

Version:
$Revision: 1.14 $ $Date: 2002/04/16 19:07:05 $
Author:
$Author: qliao $
See Also:
UIProp.BACKGROUND, UIProp.CHARACTERISTICS_TEXT_VISIBLE, UIProp.CHROMOSOME_TOOL_PICK_ON_ORGANISM, UIProp.CROSS_SUCCEEDED, UIProp.FIXED_NUMBER_CHILDREN, UIProp.FONT, UIProp.FOREGROUND, UIProp.LOCK_SYMBOL_VISIBLE, UIProp.MAXIMUM_NUMBER_CHILDREN, UIProp.MINIMUM_NUMBER_CHILDREN, UIProp.NAME_TEXT_VISIBLE, UIProp.NUMBER_FEMALE_CHILDREN, UIProp.NUMBER_MALE_CHILDREN, UIProp.OFFSPRING_MODE, UIProp.ORGANISM_ADDED_TO_VIEW, UIProp.ORGANISM_IMAGE_SIZE, UIProp.ORGANISM_REMOVED_FROM_VIEW, UIProp.PEDIGREE_TOOL_PICK_ON_ORGANISM, UIProp.SEX_TEXT_VISIBLE, UIProp.SNIP_TOOL_PICK_ON_FAMILY, UIProp.SNIP_TOOL_PICK_ON_ORGANISM, UIProp.SPECIES_TEXT_VISIBLE, UIProp.TEXT_INDENT, UIProp.TEXT_LINE_SPACING, UIProp.TRAIT, PropertyChangeListener, Serialized Form

Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Fields inherited from class org.concord.biologica.ui.OrganismView
characteristicsTextVisible, highlightColor, hotspotOrganism, hotspotOrganismImage, lockSymbolVisible, nameTextVisible, organismImageSize, selectionColor, sexTextVisible, speciesTextVisible, textIndent, textLineSpacing
 
Fields inherited from class org.concord.biologica.ui.UIView
changes, fontAscent, fontDescent, fontHeight, fontMetrics, preferredHeight, preferredWidth, scrollPane
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PedigreeOrganismView()
          Creates a pedigree organism view.
 
Method Summary
 void addFamily(Family aFamily, int xLocation, int yLocation)
          Add a family to this view.
 void addOrganism(Organism anOrganism, int xLocation, int yLocation)
          Add an organism to this view without any required ties to a family.
 void addOrganism(Organism anOrganism, int xLocation, int yLocation, java.lang.String aTraitName)
          Add an organism to this view without any required ties to a family.
 boolean containsOrganism(Organism anOrganism)
          Returns whether or not the given organism is in this view.
 int findLevelForFamily(PedigreeFamily aPedigreeFamily)
          Find the level containing the pedigreeFamily
 int findLevelForOrganism(PedigreeOrganism aPedigreeOrganism)
          Find the level containing the pedigreeOrganism
 PedigreeFamily findPedigreeFamily(Family aFamily)
          Find the pedigreeFamily corresponding to a given family
 PedigreeFamily findPedigreeFamily(Family aFamily, int[] returnLevel)
          Find the PedigreeFamily for the given Family
 PedigreeOrganism findPedigreeOrganism(Organism anOrganism)
          Find the pedigreeOrganism corresponding to a given organism.
 int getActiveTool()
          Get the active tool.
 boolean getCrossOverTurnOn()
          Is cross over turn on?
 java.util.Enumeration getFamilies()
           
 Family getFamilyForParents(Organism parentOne, Organism parentTwo)
          Get the Family for the given parent Organisms
 int getFixedNumberChildren()
          Get the fixed number of children from a breeding.
 int getMaximumNumberChildren()
          Get the maximum number of children from a breeding.
 int getMinimumNumberChildren()
          Get the minimum number of children from a breeding.
 int getNumberFemaleChildren()
          Get the number of female children to create in a family when the view is in PedigreeView.OFFSPRING_MODE_MALE_FEMALE mode.
 int getNumberMaleChildren()
          Get the number of male children to create in a family when the view is in PedigreeView.OFFSPRING_MODE_MALE_FEMALE mode.
 int getNumberOfFamilies()
          Get the number of pedigreeFamilies in this view.
 int getNumberOfOrganisms()
          Get the number of pedigreeOrganisms in this view.
 int getOffspringMode()
          Get the offspring mode
 java.util.Enumeration getOrganisms()
          Get the set of pedigreeOrganisms in this view.
 SelectionSet getSelectionSet()
          Get the current selection set
 Species getSpecies()
          Get the current species.
 Trait getTrait()
          Get the trait for this view.
 boolean isOnlyLiveChildren()
          Is the Only Live Children flag true?
 boolean isOrganismImagesVisible()
          Is the organism images visible?
 void mouseClicked(java.awt.event.MouseEvent event)
          Handle mouse click events
 void mouseDragged(java.awt.event.MouseEvent event)
          Handle mouse dragged event
 void mouseEntered(java.awt.event.MouseEvent event)
          Handle mouse entered event
 void mouseExited(java.awt.event.MouseEvent event)
          Handle mouse exited event
 void mouseMoved(java.awt.event.MouseEvent event)
          Handle mouse moved event
 void mousePressed(java.awt.event.MouseEvent event)
          Handle mouse pressed event.
 void mouseReleased(java.awt.event.MouseEvent event)
          Handle mouse released event.
 void paintComponent(java.awt.Graphics g)
          Draw the graphics in this view.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Handle property change events
 void removeAll()
          Remove all the objects in this view, both organisms and families, without deleting anything.
 boolean removeFamily(Family aFamily)
          Removes a family from this view.
 boolean removeOrganism(Organism anOrganism)
          Removes an organism from this view.
 void selectionChanged()
          Selection changed
 void setActiveTool(int anActiveTool)
          Set the active tool
 void setCrossOverCheckBox(javax.swing.JCheckBox box)
           
 void setCrossOverPossibility(double p)
           
 void setCrossOverTurnOn(boolean on)
          Set cross over turn on?
 void setFixedNumberChildren(int aFixedNumberChildren)
          Set the fixed number of children from a breeding.
 void setMaximumNumberChildren(int aMaximumNumberChildren)
          Set the maximum number of children from a breeding.
 void setMinimumNumberChildren(int aMinimumNumberChildren)
          Set the minimum number of children from a breeding.
 void setMinMaxNumberChildren(int aMinimumNumberChildren, int aMaximumNumberChildren)
          Set the minimum and maximum number of children from a breeding.
 void setNumberFemaleChildren(int aNumberFemaleChildren)
          Set the number of female children to create in a family when the view is in PedigreeView.OFFSPRING_MODE_MALE_FEMALE mode.
 void setNumberMaleChildren(int aNumberMaleChildren)
          Set the number of male children to create in a family when the view is in PedigreeView.OFFSPRING_MODE_MALE_FEMALE mode.
 void setNumberMaleFemaleChildren(int aNumberFemaleChildren, int aNumberMaleChildren)
          Set the number of female and male children to create in a family when the view is in PedigreeView.OFFSPRING_MODE_MALE_FEMALE mode.
 void setOffspringMode(int anOffspringMode)
          Set the offspring mode
 void setOffspringModePulldown(BioComboBox anOffspringModePulldown)
          Set the offspring mode pulldown.
 void setOnlyLiveChildren(boolean anOnlyLiveChildren)
          Set the Only Live Children flag
 void setOrganismImagesVisible(boolean visible)
          Set the organism images visible
 void setScrollPane(javax.swing.JScrollPane aScrollPane)
          Tell this view its scroll pane.
 void setSelectionSet(SelectionSet aSelectionSet)
          Set the current selection set.
 void setSpecies(Species aSpecies)
          Set the current species.
 void setTrait(java.lang.String aTraitName)
          Set the trait for this view.
 void setTraitPulldown(BioComboBox aTraitPulldown)
          Set the trait pulldown.
 
Methods inherited from class org.concord.biologica.ui.OrganismView
getDefaultHighlightColor, getDefaultSelectionColor, getHighlightColor, getOrganismCellDimensions, getOrganismImageSize, getSelectionColor, getTextIndent, getTextLineSpacing, imageUpdate, isCharacteristicsTextVisible, isLockSymbolVisible, isNameTextVisible, isSexTextVisible, isSpeciesTextVisible, preloadSpeciesImages, setCharacteristicsTextVisible, setDefaultHighlightColor, setDefaultSelectionColor, setHighlightColor, setLockSymbolVisible, setNameTextVisible, setOrganismImageSize, setSelectionColor, setSexTextVisible, setSpeciesTextVisible, setTextIndent, setTextLineSpacing, updateHotspotOnMousePress, updateHotspotOnMouseReleased
 
Methods inherited from class org.concord.biologica.ui.UIView
addPropertyChangeListener, getLocalImage, getPreferredSize, paintBackground, removePropertyChangeListener, setBackground, setFont, setForeground, toolChanged, updateFont
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PedigreeOrganismView

public PedigreeOrganismView()
Creates a pedigree organism view.
Method Detail

setScrollPane

public void setScrollPane(javax.swing.JScrollPane aScrollPane)
Tell this view its scroll pane.
Overrides:
setScrollPane in class UIView
Parameters:
aScrollPane - JScrollPane - the scroll pane containing this view

getOffspringMode

public int getOffspringMode()
Get the offspring mode
Returns:
int - the offspring mode

setOffspringMode

public void setOffspringMode(int anOffspringMode)
Set the offspring mode
Parameters:
anOffspringMode - int - the new offspring mode
Throws:
java.lang.IllegalArgumentException - - input offspring mode illegal

getSelectionSet

public SelectionSet getSelectionSet()
Get the current selection set
Specified by:
getSelectionSet in interface SelectionPresenter
Returns:
SelectionSet - the current selection set

setSelectionSet

public void setSelectionSet(SelectionSet aSelectionSet)
Set the current selection set.
Specified by:
setSelectionSet in interface SelectionPresenter
Parameters:
aSelectionSet - SelectionSet - a new selection set

isOrganismImagesVisible

public boolean isOrganismImagesVisible()
Is the organism images visible?
Returns:
boolean - organism images visible?

setOrganismImagesVisible

public void setOrganismImagesVisible(boolean visible)
Set the organism images visible
Parameters:
visible - boolean - visible?

isOnlyLiveChildren

public boolean isOnlyLiveChildren()
Is the Only Live Children flag true?
Returns:
boolean - onlyLiveChildren

setOnlyLiveChildren

public void setOnlyLiveChildren(boolean anOnlyLiveChildren)
Set the Only Live Children flag
Parameters:
anOnlyLiveChildren - boolean - only live children?

getActiveTool

public int getActiveTool()
Get the active tool.
Returns:
int - the active tool

setActiveTool

public void setActiveTool(int anActiveTool)
Set the active tool
Parameters:
anActiveTool - int - the new active tool

addFamily

public void addFamily(Family aFamily,
                      int xLocation,
                      int yLocation)
Add a family to this view. If the parents or children are not already in the view, this method will create and arbitrarily place them in the view.

If neither parent is in the view, the given x, y coordinates are used to place the mother organism and then the father and children positions are calculated relative to the mother's position.

Parameters:
aFamily - Family - a family to add, may not be null nor already in the view
xLocation - int - x location of first parent organism, ignored if a parent already in view
yLocation - int - y location of first parent organism, ignored if a parent already in view
Throws:
java.lang.IllegalArgumentException - - input organism null

removeFamily

public boolean removeFamily(Family aFamily)
Removes a family from this view. This method returns false if aFamily is null.

Parameters:
aFamily - Family - a family, may be null
Returns:
boolean indicating whether or not the family was found and removed

getNumberOfFamilies

public int getNumberOfFamilies()
Get the number of pedigreeFamilies in this view.
Returns:
int - number of pedigreeFamilies in this view (0 or greater)

addOrganism

public void addOrganism(Organism anOrganism,
                        int xLocation,
                        int yLocation,
                        java.lang.String aTraitName)
Add an organism to this view without any required ties to a family. The trait name specified will be used to set the trait ONLY IF THIS IS THE FIRST ORGANISM ADDED TO THE VIEW. Otherwise, aTraitName is ignored.

Note: X and Y locations are now ignored. Placement is done via new PedigreeLevel class. This interface should be changed to take a level number instead of X and Y coordinates.

Parameters:
anOrganism - Organism - an organism to add, may not be null
xLocation - int - x location of organism
yLocation - int - y location of organism
aTraitName - String - a trait name, if null then full organism images will be shown
Throws:
java.lang.IllegalArgumentException - - input organism null

addOrganism

public void addOrganism(Organism anOrganism,
                        int xLocation,
                        int yLocation)
Add an organism to this view without any required ties to a family.

Note: X and Y locations are now ignored. Placement is done via new PedigreeLevel class. This interface should be changed to take a level number instead of X and Y coordinates.

Parameters:
anOrganism - Organism - an organism to add, may not be null
xLocation - int - x location of organism
yLocation - int - y location of organism
Throws:
java.lang.IllegalArgumentException - - input organism null

removeOrganism

public boolean removeOrganism(Organism anOrganism)
Removes an organism from this view. This method returns false if anOrganism is null.

Parameters:
anOrganism - Organism - an organism, may be null
Returns:
boolean indicating whether or not the organism was found and removed

getNumberOfOrganisms

public int getNumberOfOrganisms()
Get the number of pedigreeOrganisms in this view.
Returns:
int - number of pedigreeOrganisms in this view (0 or greater)

getOrganisms

public java.util.Enumeration getOrganisms()
Get the set of pedigreeOrganisms in this view.
Returns:
Enumeration - enumeration over the set of pedigreeOrganisms in this view

getFamilies

public java.util.Enumeration getFamilies()

removeAll

public void removeAll()
Remove all the objects in this view, both organisms and families, without deleting anything.

Remove all the listeners and then the objects.

Overrides:
removeAll in class java.awt.Container

getSpecies

public Species getSpecies()
Get the current species.

Returns:
Species - the current species, may be null

setSpecies

public void setSpecies(Species aSpecies)
Set the current species.

Parameters:
aSpecies - Species - new current species, may be null

setTraitPulldown

public void setTraitPulldown(BioComboBox aTraitPulldown)
Set the trait pulldown. This method exists so the containing pedigree view can tell this view the pulldown and this view can keep the items in thee pulldown current as the species of this view changes.
Parameters:
aTraitPulldown - BioComboBox - a trait pulldown, may be null

setCrossOverCheckBox

public void setCrossOverCheckBox(javax.swing.JCheckBox box)

setOffspringModePulldown

public void setOffspringModePulldown(BioComboBox anOffspringModePulldown)
Set the offspring mode pulldown. This method exists so the containing pedigree view can tell this view the pulldown and this view can keep the selected item in the pulldown current as the offspring mode of this view changes.

Parameters:
anOffspringPulldown - BioComboBox - an offspring pulldown, may be null

getTrait

public Trait getTrait()
Get the trait for this view.

Returns:
Trait - the trait to draw, null if whole organism

setTrait

public void setTrait(java.lang.String aTraitName)
Set the trait for this view. If aTrait is null, the whole organism's phenotype will be drawn.

Parameters:
aTraitName - String - the name of the trait to draw, may be null to cause whole organisms to be drawn

getFixedNumberChildren

public int getFixedNumberChildren()
Get the fixed number of children from a breeding.

Returns:
int - fixed number of children from a breeding

setFixedNumberChildren

public void setFixedNumberChildren(int aFixedNumberChildren)
Set the fixed number of children from a breeding.

Parameters:
aFixedNumberChildren - int - fixed number of children from a breeding
Throws:
java.lang.IllegalArgumentException - - new fixed number illegal

getMaximumNumberChildren

public int getMaximumNumberChildren()
Get the maximum number of children from a breeding.

Returns:
int - maximum number of children from a breeding

setMaximumNumberChildren

public void setMaximumNumberChildren(int aMaximumNumberChildren)
Set the maximum number of children from a breeding. This must be higher than the minimum or else an exception is thrown.

Parameters:
aMaximumNumberChildren - int - maximum number of children from a breeding
Throws:
java.lang.IllegalArgumentException - - new maximum illegal, may be less than minimum

getMinimumNumberChildren

public int getMinimumNumberChildren()
Get the minimum number of children from a breeding.

Returns:
int - minimum number of children from a breeding

setMinimumNumberChildren

public void setMinimumNumberChildren(int aMinimumNumberChildren)
Set the minimum number of children from a breeding. This must be less than the maximum or else an exception is thrown.

Parameters:
aMinimumNumberChildren - int - minimum number of children from a breeding
Throws:
java.lang.IllegalArgumentException - - new minimum illegal, may be more than maximum

setMinMaxNumberChildren

public void setMinMaxNumberChildren(int aMinimumNumberChildren,
                                    int aMaximumNumberChildren)
Set the minimum and maximum number of children from a breeding. The minimum must be less than or equal to the maximum or else an exception is thrown.

Parameters:
aMinimumNumberChildren - int - minimum number of children from a breeding
aMaximumNumberChildren - int - maximum number of children from a breeding
Throws:
java.lang.IllegalArgumentException - - new minimum illegal, may be more than maximum

getNumberFemaleChildren

public int getNumberFemaleChildren()
Get the number of female children to create in a family when the view is in PedigreeView.OFFSPRING_MODE_MALE_FEMALE mode.

Returns:
int - number of female children

setNumberFemaleChildren

public void setNumberFemaleChildren(int aNumberFemaleChildren)
Set the number of female children to create in a family when the view is in PedigreeView.OFFSPRING_MODE_MALE_FEMALE mode.

Parameters:
aNumberFemaleChildren - int - new number of female children, must be >= 0
Throws:
java.lang.IllegalArgumentException - - new value illegal

getNumberMaleChildren

public int getNumberMaleChildren()
Get the number of male children to create in a family when the view is in PedigreeView.OFFSPRING_MODE_MALE_FEMALE mode.

Returns:
int - number of male children

setNumberMaleChildren

public void setNumberMaleChildren(int aNumberMaleChildren)
Set the number of male children to create in a family when the view is in PedigreeView.OFFSPRING_MODE_MALE_FEMALE mode.

Parameters:
aNumberMaleChildren - int - new number of male children, must be >= 0
Throws:
java.lang.IllegalArgumentException - - new value illegal

setNumberMaleFemaleChildren

public void setNumberMaleFemaleChildren(int aNumberFemaleChildren,
                                        int aNumberMaleChildren)
Set the number of female and male children to create in a family when the view is in PedigreeView.OFFSPRING_MODE_MALE_FEMALE mode.

Parameters:
aNumberFemaleChildren - int - new number of female children, must be >= 0
aNumberMaleChildren - int - new number of male children, must be >= 0
Throws:
java.lang.IllegalArgumentException - - new value illegal

containsOrganism

public boolean containsOrganism(Organism anOrganism)
Returns whether or not the given organism is in this view.
Parameters:
anOrganism - Organism - the organism to find
Returns:
boolean true (in view) or false (not in view)

findPedigreeOrganism

public PedigreeOrganism findPedigreeOrganism(Organism anOrganism)
Find the pedigreeOrganism corresponding to a given organism.
Parameters:
anOrganism - Organism - the organism to find
Returns:
PedigreeOrganism - the pedigree organism for the given organism

findPedigreeFamily

public PedigreeFamily findPedigreeFamily(Family aFamily)
Find the pedigreeFamily corresponding to a given family
Parameters:
aFamily - Family - the family to find
Returns:
PedigreeFamily - the pedigree family for the given family

findPedigreeFamily

public PedigreeFamily findPedigreeFamily(Family aFamily,
                                         int[] returnLevel)
Find the PedigreeFamily for the given Family
Parameters:
aFamily - Family - the Family to find
returnLevel - int[] - the resulting level (in the first array element)
Returns:
PedgireeLevel - the resulting PedigreeFamily or null.

findLevelForOrganism

public int findLevelForOrganism(PedigreeOrganism aPedigreeOrganism)
Find the level containing the pedigreeOrganism
Parameters:
aPedigreeOrganism - PedigreeOrganism - the pedigree organism to find
Returns:
int - the level containing it or -1 if not found.

findLevelForFamily

public int findLevelForFamily(PedigreeFamily aPedigreeFamily)
Find the level containing the pedigreeFamily
Parameters:
aPedigreeFamily - PedigreeFamily - the pedigree organism to find
Returns:
int - the level containing it or -1 if not found.

getFamilyForParents

public Family getFamilyForParents(Organism parentOne,
                                  Organism parentTwo)
Get the Family for the given parent Organisms
Parameters:
parentOne - Organism - the first parent Organism
parentTwo - Organism - the second parent Organism
Returns:
Family - the resulting Family or null.

setCrossOverTurnOn

public void setCrossOverTurnOn(boolean on)
Set cross over turn on?
Returns:
on boolean --Turn on?

getCrossOverTurnOn

public boolean getCrossOverTurnOn()
Is cross over turn on?
Returns:
boolean --Turn on?

paintComponent

public void paintComponent(java.awt.Graphics g)
Draw the graphics in this view. First paint the connections and then the families and organisms so to ensure that the organisms are drawn on top of the connections. Draw the rubberbanding for crossing and for the selection rectangle.
Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - Graphics - the given graphics to use in drawing

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
Handle mouse click events
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
event - MouseEvent - the event object

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent event)
Handle mouse entered event
Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
event - MouseEvent - the event object

mouseExited

public void mouseExited(java.awt.event.MouseEvent event)
Handle mouse exited event
Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
event - MouseEvent - the event object

mousePressed

public void mousePressed(java.awt.event.MouseEvent event)
Handle mouse pressed event. Handles Snipping, Chromosome and Pedigree tools. Assists in handling Selection.
Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
event - MouseEvent - the event object

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent event)
Handle mouse released event. Handles Crossing and assists in handling Selection.
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
event - MouseEvent - the event object

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent event)
Handle mouse dragged event
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
event - MouseEvent - the event object

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent event)
Handle mouse moved event
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
event - MouseEvent - the event object

selectionChanged

public void selectionChanged()
Selection changed
Specified by:
selectionChanged in interface SelectionPresenter

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Handle property change events
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
event - PropertyChangeEvent - the property change event

setCrossOverPossibility

public void setCrossOverPossibility(double p)