org.concord.biologica.ui
Class PedigreeView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--org.concord.biologica.ui.UIView
                          |
                          +--org.concord.biologica.ui.PedigreeView
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.ComponentListener, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.event.ItemListener, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable

public final class PedigreeView
extends UIView
implements java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.event.ItemListener, java.beans.PropertyChangeListener, java.awt.event.FocusListener

The pedigree view of BioLogica.

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

Version:
$Revision: 1.6 $ $Date: 2002/04/22 17:33:57 $
Author:
$Author: ed $
See Also:
UIProp.BACKGROUND, UIProp.CHARACTERISTICS_TEXT_VISIBLE, UIProp.CHROMOSOME_TOOL_PICK_ON_ORGANISM, UIProp.CROSS_SUCCEEDED, UIProp.CROSS_TOOL_ENABLED, UIProp.CROSS_TOOL_VISIBLE, UIProp.FONT, UIProp.FOREGROUND, 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_IMAGES_VISIBLE, UIProp.ORGANISM_REMOVED_FROM_VIEW, UIProp.SELECTION_TOOL_ENABLED, UIProp.SELECTION_TOOL_VISIBLE, UIProp.SEX_TEXT_VISIBLE, UIProp.SNIP_TOOL_ENABLED, UIProp.SNIP_TOOL_VISIBLE, UIProp.SPECIES_TEXT_VISIBLE, UIProp.TEXT_INDENT, UIProp.TEXT_LINE_SPACING, UIProp.TRAIT_PULLDOWN_ENABLED, UIProp.TRAIT_PULLDOWN_VISIBLE, 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
 
Field Summary
static int OFFSPRING_MODE_FIXED
           
static java.lang.String OFFSPRING_MODE_FIXED_STRING
           
static int OFFSPRING_MODE_MALE_FEMALE
           
static java.lang.String OFFSPRING_MODE_MALE_FEMALE_STRING
           
static int OFFSPRING_MODE_MIN_MAX
           
static java.lang.String OFFSPRING_MODE_MIN_MAX_STRING
           
 
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
PedigreeView()
          Creates a pedigree view.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          React to actions
 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.
 void addOrganism(Organism anOrganism, int xLocation, int yLocation, java.lang.String aTraitName)
          Add an organism to this view and specify the trait to show, which is used only if this is the first organism added to the view.
 void componentHidden(java.awt.event.ComponentEvent event)
          Component events
 void componentMoved(java.awt.event.ComponentEvent event)
           
 void componentResized(java.awt.event.ComponentEvent event)
           
 void componentShown(java.awt.event.ComponentEvent event)
           
 boolean containsOrganism(Organism anOrganism)
          Returns whether or not the given organism is in this view.
 void focusGained(java.awt.event.FocusEvent event)
          Handle focus gained event - do nothing in most cases.
 void focusLost(java.awt.event.FocusEvent event)
          Handle focus lost event - check text in most cases.
 int getActiveTool()
          Get the active tool.
 java.util.Enumeration getFamilies()
          Get the set of pedigreeFamilies in this view.
 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
 int getOrganismImageSize()
          Get the organism image size for this view.
 java.util.Enumeration getOrganisms()
          Get the set of pedigreeOrganisms in this view.
 PedigreeOrganismView getPedigreeOrganismView()
          Get the pedigree organism view in this view.
 SelectionSet getSelectionSet()
          Get the current selection set
 Species getSpecies()
          Get the current species.
 int getTextIndent()
          Get the text indent for this view.
 int getTextLineSpacing()
          Get the text line spacing for this view, the number of pixels between lines of text below an organism.
 java.lang.String getTrait()
          Get the trait for this view.
 javax.swing.JButton getUtilityButton()
           
 boolean isCharacteristicsTextVisible()
          Is the characteristics text visible?
 boolean isChromosomeToolEnabled()
          Is the chromosome tool enabled?
 boolean isChromosomeToolVisible()
          Is the chromosome tool visible?
 boolean isCrossOverEnabled()
          Is cross over enabled?
 boolean isCrossOverTurnOn()
          Is the Cross over turn on?
 boolean isCrossOverVisible()
          Is the cross over check box visibled?
 boolean isCrossToolEnabled()
          Is the cross tool enabled?
 boolean isCrossToolVisible()
          Is the cross tool visible?
 boolean isLockSymbolVisible()
          Is the lock symbol visible?
 boolean isNameTextVisible()
          Is the name text visible?
 boolean isOffspringModePulldownEnabled()
          Is the offspring mode pulldown enabled?
 boolean isOffspringModePulldownVisible()
          Is the offspring mode pulldown visible?
 boolean isOnlyLiveChildren()
          Is the Only Live Children flag true?
 boolean isOrganismImagesVisible()
          Is the organism images visible?
 boolean isSelectionToolEnabled()
          Is the selection tool enabled?
 boolean isSelectionToolVisible()
          Is the selection tool visible?
 boolean isSexTextVisible()
          Is the sex text visible?
 boolean isSnipToolEnabled()
          Is the snip tool enabled?
 boolean isSnipToolVisible()
          Is the snip tool visible?
 boolean isSpeciesTextVisible()
          Is the species text visible?
 boolean isTraitPulldownVisible()
          Is the trait pulldown visible?
 void itemStateChanged(java.awt.event.ItemEvent event)
          Handle combo box item changed events.
 void paintComponent(java.awt.Graphics g)
          Draw the graphics in this view.
 void processPendingTextEdits()
          Process pending text edit control modifications before allowing something else to occur in the user interface.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Handle property change events
 void removeAll()
          Remove all objects in this view, both organisms and families.
 void removeAllFamilies()
          Remove all pedigreeFamilies, with no notificaition
 void removeAllOrganisms()
          Remove all pedigreeOrganisms
 boolean removeFamily(Family aFamily)
          Removes a family from this view.
 boolean removeOrganism(Organism anOrganism)
          Removes an organism from this view.
 void setActiveTool(int anActiveTool)
          Set the active tool
 void setBounds(int x, int y, int width, int height)
          Set the bounds of this view.
 void setCharacteristicsTextVisible(boolean aCharacteristicsTextVisible)
          Set the characteristics text visible boolean.
 void setChromosomeToolEnabled(boolean aChromosomeToolEnabled)
          Set the chromosome tool enabled state.
 void setChromosomeToolVisible(boolean aChromosomeToolVisible)
          Set the chromosome tool visibility.
 void setCrossOverEnabled(boolean aCrossOverEnabled)
          set the Cross over check box enabled state
 void setCrossOverPossibility(int p)
          set Cross over possibility
 void setCrossOverTurnOn(boolean aBlnCrossOverTurnOn)
           
 void setCrossOverVisible(boolean aCrossOverVisible)
          set the Cross over check box visible state
 void setCrossToolEnabled(boolean aCrossToolEnabled)
          Set the cross tool enabled state.
 void setCrossToolVisible(boolean aCrossToolVisible)
          Set the cross tool visibility.
 void setFixedNumberChildren(int aFixedNumberChildren)
          Set the fixed number of children from a breeding.
 void setLockSymbolVisible(boolean aLockSymbolVisible)
          Set the lock symbol visible boolean.
 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 setNameTextVisible(boolean aNameTextVisible)
          Set the name text visible boolean.
 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 setOffspringModePulldownEnabled(boolean anOffspringModePulldownEnabled)
          Set the offspring mode pulldown enabled state.
 void setOffspringModePulldownVisible(boolean anOffspringModePulldownVisible)
          Set the offspring mode pulldown visibility.
 void setOnlyLiveChildren(boolean onlyLiveChildren)
          Set the Only Live Children flag
 void setOrganismImageSize(int anOrganismImageSize)
          Set the organism image size for this view.
 void setOrganismImagesVisible(boolean visible)
          Set the organism images visible
 void setSelectionSet(SelectionSet aSelectionSet)
          Set the current selection set.
 void setSelectionToolEnabled(boolean aSelectionToolEnabled)
          Set the selection tool enabled state.
 void setSelectionToolVisible(boolean aSelectionToolVisible)
          Set the selection tool visibility.
 void setSexTextVisible(boolean aSexTextVisible)
          Set the sex text visible boolean.
 void setSnipToolEnabled(boolean aSnipToolEnabled)
          Set the snip tool enabled state.
 void setSnipToolVisible(boolean aSnipToolVisible)
          Set the snip tool visibility.
 void setSpeciesTextVisible(boolean aSpeciesTextVisible)
          Set the species text visible boolean.
 void setTextIndent(int aTextIndent)
          Set the text indent for this view.
 void setTextLineSpacing(int aTextLineSpacing)
          Set the text line spacing for this view, the number of pixels between lines of text below an organism.
 void setTrait(java.lang.String aTraitName)
          Set the trait for this view.
 void setTraitPulldownEnabled(boolean aTraitPulldownEnabled)
          Set the trait pulldown enabled state.
 void setTraitPulldownVisible(boolean aTraitPulldownVisible)
          Set the trait pulldown visibility.
 void setVisible(boolean isVisible)
           
 void toolChanged(int aTool)
          Method called by ToolView when the current tool changes.
 void updateControls()
          Update the state (visibility, enabled, values) of the controls.
 void updateSize()
          Update the size of this view.
 
Methods inherited from class org.concord.biologica.ui.UIView
addPropertyChangeListener, getLocalImage, getPreferredSize, paintBackground, removePropertyChangeListener, setBackground, setFont, setForeground, setScrollPane, 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, 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, imageUpdate, 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, 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
 

Field Detail

OFFSPRING_MODE_FIXED

public static final int OFFSPRING_MODE_FIXED

OFFSPRING_MODE_FIXED_STRING

public static final java.lang.String OFFSPRING_MODE_FIXED_STRING

OFFSPRING_MODE_MIN_MAX

public static final int OFFSPRING_MODE_MIN_MAX

OFFSPRING_MODE_MIN_MAX_STRING

public static final java.lang.String OFFSPRING_MODE_MIN_MAX_STRING

OFFSPRING_MODE_MALE_FEMALE

public static final int OFFSPRING_MODE_MALE_FEMALE

OFFSPRING_MODE_MALE_FEMALE_STRING

public static final java.lang.String OFFSPRING_MODE_MALE_FEMALE_STRING
Constructor Detail

PedigreeView

public PedigreeView()
Creates a pedigree view.
Method Detail

getPedigreeOrganismView

public PedigreeOrganismView getPedigreeOrganismView()
Get the pedigree organism view in this view.
Returns:
PedigreeOrganismView - the pedigree organism view of this larger view

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)

addOrganism

public void addOrganism(Organism anOrganism,
                        int xLocation,
                        int yLocation)
Add an organism to this view.

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

addOrganism

public void addOrganism(Organism anOrganism,
                        int xLocation,
                        int yLocation,
                        java.lang.String aTraitName)
Add an organism to this view and specify the trait to show, which is used only if this is the first organism added to the view. If there are organisms in the view already, aTraitName is ignored and the caller must set the trait by calling setTrait().

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 - the name of a trait to show, null causes full organisms to be shown
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

removeAllOrganisms

public void removeAllOrganisms()
Remove all pedigreeOrganisms

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

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

removeAllFamilies

public void removeAllFamilies()
Remove all pedigreeFamilies, with no notificaition

getNumberOfFamilies

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

getFamilies

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

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.

removeAll

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

Overrides:
removeAll in class java.awt.Container

getOffspringMode

public int getOffspringMode()
Get the offspring mode
Returns:
int - the offspring mode
See Also:
OFFSPRING_MODE_FIXED, OFFSPRING_MODE_MIN_MAX, OFFSPRING_MODE_MALE_FEMALE

setOffspringMode

public void setOffspringMode(int anOffspringMode)
Set the offspring mode
Parameters:
anOffspringMode - int - the new offspring mode
See Also:
OFFSPRING_MODE_FIXED, OFFSPRING_MODE_MIN_MAX, OFFSPRING_MODE_MALE_FEMALE

getUtilityButton

public javax.swing.JButton getUtilityButton()

isOnlyLiveChildren

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

setOnlyLiveChildren

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

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?

getActiveTool

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

toolChanged

public void toolChanged(int aTool)
Method called by ToolView when the current tool changes.

Overrides:
toolChanged in class UIView
Parameters:
aTool - int - the active tool

setActiveTool

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

isSelectionToolEnabled

public boolean isSelectionToolEnabled()
Is the selection tool enabled?
Returns:
boolean - is the selection tool enabled?

setSelectionToolEnabled

public void setSelectionToolEnabled(boolean aSelectionToolEnabled)
Set the selection tool enabled state.
Parameters:
aSelectionToolEnabled - boolean - enabled?

isCrossToolEnabled

public boolean isCrossToolEnabled()
Is the cross tool enabled?
Returns:
boolean - is the cross tool enabled?

setCrossToolEnabled

public void setCrossToolEnabled(boolean aCrossToolEnabled)
Set the cross tool enabled state.
Parameters:
aCrossToolEnabled - boolean - enabled?

isSnipToolEnabled

public boolean isSnipToolEnabled()
Is the snip tool enabled?
Returns:
boolean - is the snip tool enabled?

setSnipToolEnabled

public void setSnipToolEnabled(boolean aSnipToolEnabled)
Set the snip tool enabled state.
Parameters:
aSnipToolEnabled - boolean - enabled?

isChromosomeToolEnabled

public boolean isChromosomeToolEnabled()
Is the chromosome tool enabled?
Returns:
boolean - is the chromosome tool enabled?

setChromosomeToolEnabled

public void setChromosomeToolEnabled(boolean aChromosomeToolEnabled)
Set the chromosome tool enabled state.
Parameters:
aChromosomeToolEnabled - boolean - enabled?

setCrossOverPossibility

public void setCrossOverPossibility(int p)
set Cross over possibility

isCrossOverEnabled

public boolean isCrossOverEnabled()
Is cross over enabled?
Returns:
boolean - Is cross over enabled?

setCrossOverEnabled

public void setCrossOverEnabled(boolean aCrossOverEnabled)
set the Cross over check box enabled state
Parameters:
aCrossOverEnabled - boolean - enabled?

isCrossOverVisible

public boolean isCrossOverVisible()
Is the cross over check box visibled?
Returns:
boolean - Is the cross over check box visibled?

setCrossOverVisible

public void setCrossOverVisible(boolean aCrossOverVisible)
set the Cross over check box visible state
Parameters:
aCrossOverEnabled - boolean - visible?

isCrossOverTurnOn

public boolean isCrossOverTurnOn()
Is the Cross over turn on?
Returns:
boolean - visible?

setCrossOverTurnOn

public void setCrossOverTurnOn(boolean aBlnCrossOverTurnOn)

setTraitPulldownEnabled

public void setTraitPulldownEnabled(boolean aTraitPulldownEnabled)
Set the trait pulldown enabled state.
Parameters:
aTraitPulldownEnabled - boolean - enabled?

isOffspringModePulldownEnabled

public boolean isOffspringModePulldownEnabled()
Is the offspring mode pulldown enabled?
Returns:
boolean - is the offspring mode pulldown enabled?

setOffspringModePulldownEnabled

public void setOffspringModePulldownEnabled(boolean anOffspringModePulldownEnabled)
Set the offspring mode pulldown enabled state.
Parameters:
anOffspringModePulldownEnabled - boolean - enabled?

isSelectionToolVisible

public boolean isSelectionToolVisible()
Is the selection tool visible?
Returns:
boolean - is the selection tool visible

setSelectionToolVisible

public void setSelectionToolVisible(boolean aSelectionToolVisible)
Set the selection tool visibility.
Parameters:
aSelectionToolVisible - boolean - visible?

isCrossToolVisible

public boolean isCrossToolVisible()
Is the cross tool visible?
Returns:
boolean - is the cross tool visible

setCrossToolVisible

public void setCrossToolVisible(boolean aCrossToolVisible)
Set the cross tool visibility.
Parameters:
aCrossToolVisible - boolean - visible?

isSnipToolVisible

public boolean isSnipToolVisible()
Is the snip tool visible?
Returns:
boolean - is the snip tool visible

setSnipToolVisible

public void setSnipToolVisible(boolean aSnipToolVisible)
Set the snip tool visibility.
Parameters:
aSnipToolVisible - boolean - visible?

isChromosomeToolVisible

public boolean isChromosomeToolVisible()
Is the chromosome tool visible?
Returns:
boolean - is the chromosome tool visible

setChromosomeToolVisible

public void setChromosomeToolVisible(boolean aChromosomeToolVisible)
Set the chromosome tool visibility.
Parameters:
aChromosomeToolVisible - boolean - visible?

isTraitPulldownVisible

public boolean isTraitPulldownVisible()
Is the trait pulldown visible?
Returns:
boolean - is the trait pulldown visible?

setTraitPulldownVisible

public void setTraitPulldownVisible(boolean aTraitPulldownVisible)
Set the trait pulldown visibility.
Parameters:
aTraitPulldownVisible - boolean - visible?

isOffspringModePulldownVisible

public boolean isOffspringModePulldownVisible()
Is the offspring mode pulldown visible?
Returns:
boolean - is the offspring mode pulldown visible?

setOffspringModePulldownVisible

public void setOffspringModePulldownVisible(boolean anOffspringModePulldownVisible)
Set the offspring mode pulldown visibility.
Parameters:
anOffspringModePulldownVisible - boolean - visible?

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

getTrait

public java.lang.String getTrait()
Get the trait for this view.

Returns:
String - the name of the trait to draw

getSpecies

public Species getSpecies()
Get the current species.

Returns:
Species - the current species, may be null

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 maximum illegal, may be less than minimum

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

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Set the bounds of this view.

Overrides:
setBounds in class java.awt.Component
Parameters:
x - int - x of top left corner
y - int - y of top left corner
width - int - width
height - int - height

getSelectionSet

public SelectionSet getSelectionSet()
Get the current selection set
Returns:
SelectionSet - the current selection set

setSelectionSet

public void setSelectionSet(SelectionSet aSelectionSet)
Set the current selection set.
Parameters:
aSelectionSet - SelectionSet - a new selection set

setVisible

public void setVisible(boolean isVisible)
Overrides:
setVisible in class javax.swing.JComponent

updateSize

public void updateSize()
Update the size of this view. To do this, get the current size of the view and update the models for anything shown in the view. Do not repaint or generate a repaint event, as that event is already coming automatically from AWT.

updateControls

public void updateControls()
Update the state (visibility, enabled, values) of the controls.


paintComponent

public void paintComponent(java.awt.Graphics g)
Draw the graphics in this view.
Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - Graphics - the given graphics to use in drawing

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
React to actions
Specified by:
actionPerformed in interface java.awt.event.ActionListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent event)
Handle combo box item changed events.
Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
event - ItemEvent - change event to handle

componentHidden

public void componentHidden(java.awt.event.ComponentEvent event)
Component events
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent event)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent event)
Specified by:
componentResized in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent event)
Specified by:
componentShown in interface java.awt.event.ComponentListener

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

isLockSymbolVisible

public boolean isLockSymbolVisible()
Is the lock symbol visible?
Returns:
boolean - is the lock symbol visible

setLockSymbolVisible

public void setLockSymbolVisible(boolean aLockSymbolVisible)
Set the lock symbol visible boolean.
Parameters:
aLockSymbolVisible - boolean - visible?

isCharacteristicsTextVisible

public boolean isCharacteristicsTextVisible()
Is the characteristics text visible?
Returns:
boolean - is the characteristics text visible

setCharacteristicsTextVisible

public void setCharacteristicsTextVisible(boolean aCharacteristicsTextVisible)
Set the characteristics text visible boolean.
Parameters:
aCharacteristicsTextVisible - boolean - visible?

isNameTextVisible

public boolean isNameTextVisible()
Is the name text visible?
Returns:
boolean - is the name text visible

setNameTextVisible

public void setNameTextVisible(boolean aNameTextVisible)
Set the name text visible boolean.
Parameters:
aNameTextVisible - boolean - visible?

isSexTextVisible

public boolean isSexTextVisible()
Is the sex text visible?
Returns:
boolean - is the sex text visible

setSexTextVisible

public void setSexTextVisible(boolean aSexTextVisible)
Set the sex text visible boolean.
Parameters:
aSexTextVisible - boolean - visible?

isSpeciesTextVisible

public boolean isSpeciesTextVisible()
Is the species text visible?
Returns:
boolean - is the species text visible

setSpeciesTextVisible

public void setSpeciesTextVisible(boolean aSpeciesTextVisible)
Set the species text visible boolean.
Parameters:
aSpeciesTextVisible - boolean - visible?

getOrganismImageSize

public int getOrganismImageSize()
Get the organism image size for this view.

Returns:
int - organism image size

setOrganismImageSize

public void setOrganismImageSize(int anOrganismImageSize)
Set the organism image size for this view. The size must be one of the SpeciesImage.XXX_IMAGE_SIZE static values.

Parameters:
anOrganismImageSize - int - a new organism image size
Throws:
java.lang.IllegalArgumentException - - illegal input value

getTextIndent

public int getTextIndent()
Get the text indent for this view.

Returns:
int - text indent

setTextIndent

public void setTextIndent(int aTextIndent)
Set the text indent for this view.

Parameters:
aTextIndent - int - a new text indent

getTextLineSpacing

public int getTextLineSpacing()
Get the text line spacing for this view, the number of pixels between lines of text below an organism.

Returns:
int - text line spacing

setTextLineSpacing

public void setTextLineSpacing(int aTextLineSpacing)
Set the text line spacing for this view, the number of pixels between lines of text below an organism.

Parameters:
aTextLineSpacing - int - a new text line spacing

focusGained

public void focusGained(java.awt.event.FocusEvent event)
Handle focus gained event - do nothing in most cases.
Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
event - FocusEvent - focus gained event

focusLost

public void focusLost(java.awt.event.FocusEvent event)
Handle focus lost event - check text in most cases.
Specified by:
focusLost in interface java.awt.event.FocusListener
Parameters:
event - FocusEvent - focus lost event

processPendingTextEdits

public void processPendingTextEdits()
Process pending text edit control modifications before allowing something else to occur in the user interface.