org.concord.biologica.ui
Class BigMeiosisView

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

public final class BigMeiosisView
extends UIView
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.ActionListener, java.awt.event.ComponentListener, javax.swing.event.ChangeListener, java.beans.PropertyChangeListener

This class represents a view which shows the sex cell of a parent in the sex view and has controls for the user to conduct meiosis within this view on that sex cell.

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

Version:
$Revision: 1.7 $ $Date: 2002/04/11 21:39:33 $
Author:
$Author: qliao $
See Also:
UIProp.ALIGNMENT_CONTROLS_VISIBLE, UIProp.BACKGROUND, UIProp.BIG_FATHER_MEIOSIS_MAGNIFY_BUTTON_PUSHED, UIProp.BIG_MOTHER_MEIOSIS_MAGNIFY_BUTTON_PUSHED, UIProp.CROSSOVER_CONTROLS_VISIBLE, UIProp.FONT, UIProp.FOREGROUND, UIProp.MEIOSIS_MODEL, 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.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
BigMeiosisView()
          Creates a big meiosis view.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          React to actions
 void autoCrossing()
           
 void autoCrossOver(int x1, int y1)
          Handle autoCrossing Over
 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)
           
 void doCrossingOver()
          Do the actual crossing over now given the current crossing over state.
protected  java.util.Vector getGameteChromosomeModels(int modelType)
           
 SmallMeiosisView getSmallMeiosisView()
          Get the small meiosis view.
protected  int getTypeFromCellArc(CellArc cellArc)
           
 void goToAnimationStep(int aStep)
          Go to a particular step in the animation and stop there.
 void hideSwitchAlignmentButtons()
          Hide switch alignment buttons
 boolean isAlignmentControlsVisible()
          Get alignment controls visibility
 boolean isAnimationSliderVisible()
          Check animation slider visibility.
 boolean isCrossoverControlsVisible()
          Get crossover controls visibility
 boolean isGoToEndButtonVisible()
          Check go to end button visibility.
 boolean isGoToStartButtonVisible()
          Check go to start button visibility.
 boolean isMagnifyButtonVisible()
          Check magnify button visibility.
 boolean isPlayBackwardFastToggleButtonVisible()
          Check play backward fast toggle button visibility.
 boolean isPlayBackwardToggleButtonVisible()
          Check play backward toggle button visibility.
 boolean isplayForwardFastToggleButtonVisible()
          Check play forward fast toggle button visibility.
 boolean isPlayForwardToggleButtonVisible()
          Check play forward toggle button visibility.
 boolean isStepBackwardButtonVisible()
          Check step backward button visibility.
 boolean isStepForwardButtonVisible()
          Check step forward button visibility.
 boolean isStopToggleButtonVisible()
          Check stop toggle visibility.
 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
protected  void paintAlleleList(java.awt.Graphics g, CellArc boundary)
           
 void paintComponent(java.awt.Graphics g)
           
 void playAnimationBackward()
          Play animation backward
 void playAnimationBackwardFast()
          Play animation backward fast
 void playAnimationForward()
          Play animation forward
 void playAnimationForwardFast()
          Play animation forward fast
 void playCrossoverAnimation()
          Play the crossover animation
 void propertyChange(java.beans.PropertyChangeEvent event)
          Handle property change events
 void setAlignmentControlsVisible(boolean aVisible)
          Set alignment controls visibility
 void setAnimationSliderEnabled(boolean enabled)
          Set animation slider enabled.
 void setAnimationSliderVisible(boolean visible)
          Set animation slider visibility.
 void setCrossoverControlsVisible(boolean aVisible)
          Set crossover controls visibility
 void setGoToEndButtonEnabled(boolean enabled)
          Set go to end button enabled.
 void setGoToEndButtonVisible(boolean visible)
          Set go to end button visibility.
 void setGoToStartButtonEnabled(boolean enabled)
          Set go to start button enabled.
 void setGoToStartButtonVisible(boolean visible)
          Set go to start button visibility.
 void setMagnifyButtonEnabled(boolean enabled)
          Set magnify button enabled.
 void setMagnifyButtonVisible(boolean visible)
          Set magnify button visibility.
 void setPlayBackwardFastToggleButtonEnabled(boolean enabled)
          Set play backward fast toggle button enabled.
 void setPlayBackwardFastToggleButtonVisible(boolean visible)
          Set play backward fast toggle button visibility.
 void setPlayBackwardToggleButtonEnabled(boolean enabled)
          Set play backward toggle button enabled.
 void setPlayBackwardToggleButtonVisible(boolean visible)
          Set play backward toggle button visibility.
 void setplayForwardFastToggleButtonEnabled(boolean enabled)
          Set play forward fast toggle button enabled.
 void setplayForwardFastToggleButtonVisible(boolean visible)
          Set play forward fast toggle button visibility.
 void setPlayForwardToggleButtonEnabled(boolean enabled)
          Set play forward toggle button enabled.
 void setPlayForwardToggleButtonVisible(boolean visible)
          Set play forward toggle button visibility.
 void setStepBackwardButtonEnabled(boolean enabled)
          Set step backward button enabled.
 void setStepBackwardButtonVisible(boolean visible)
          Set step backward button visibility.
 void setStepForwardButtonEnabled(boolean enabled)
          Set step forward button enabled.
 void setStepForwardButtonVisible(boolean visible)
          Set step forward button visibility.
 void setStopToggleButtonEnabled(boolean enabled)
          Set stop toggle enabled.
 void setStopToggleButtonVisible(boolean visible)
          Set stop toggle visibility.
 void showSwitchAlignmentButtons()
          Show switch alignment buttons
 void startBlinking()
          Start blinking if there is a first cut and the blinking timer isn't already running.
 void stateChanged(javax.swing.event.ChangeEvent e)
          Change listener events
 void stepAnimationBackward()
          Step animation backward one step
 void stepAnimationForward()
          Step animation forward one step
 void stopAnimation()
          Stop playing animation
 void stopBlinking()
          Stop blinking
 void toolChanged(int aTool)
          Method called by ToolView when the current tool changes.
 void updateSize()
          Update the size of this view.
 void updateState()
          Update the state of this view, usually called because the state of the underlying meiosis model has changed somehow and this view should reflect that changed state.
 
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, 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, removeAll, 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, 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

BigMeiosisView

public BigMeiosisView()
Creates a big meiosis view.
Method Detail

getSmallMeiosisView

public SmallMeiosisView getSmallMeiosisView()
Get the small meiosis view. May be null.
Returns:
SmallMeiosisView - small meiosis view for which this is a big meiosis view, may be null

doCrossingOver

public void doCrossingOver()
Do the actual crossing over now given the current crossing over state.

updateState

public void updateState()
Update the state of this view, usually called because the state of the underlying meiosis model has changed somehow and this view should reflect that changed state.

paintComponent

public void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

getGameteChromosomeModels

protected java.util.Vector getGameteChromosomeModels(int modelType)

getTypeFromCellArc

protected int getTypeFromCellArc(CellArc cellArc)

paintAlleleList

protected void paintAlleleList(java.awt.Graphics g,
                               CellArc boundary)

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.

showSwitchAlignmentButtons

public void showSwitchAlignmentButtons()
Show switch alignment buttons

hideSwitchAlignmentButtons

public void hideSwitchAlignmentButtons()
Hide switch alignment buttons

isAlignmentControlsVisible

public boolean isAlignmentControlsVisible()
Get alignment controls visibility
Returns:
boolean - visibility

setAlignmentControlsVisible

public void setAlignmentControlsVisible(boolean aVisible)
Set alignment controls visibility
Parameters:
aVisible - boolean - visibility

isCrossoverControlsVisible

public boolean isCrossoverControlsVisible()
Get crossover controls visibility
Returns:
boolean - visibility

setCrossoverControlsVisible

public void setCrossoverControlsVisible(boolean aVisible)
Set crossover controls visibility
Parameters:
aVisible - boolean - visibility

setMagnifyButtonVisible

public void setMagnifyButtonVisible(boolean visible)
Set magnify button visibility.
Parameters:
visible - boolean - visibility (0 to 100)

setMagnifyButtonEnabled

public void setMagnifyButtonEnabled(boolean enabled)
Set magnify button enabled.
Parameters:
enabled - boolean

setAnimationSliderVisible

public void setAnimationSliderVisible(boolean visible)
Set animation slider visibility.
Parameters:
visible - boolean - visibility (0 to 100)

setAnimationSliderEnabled

public void setAnimationSliderEnabled(boolean enabled)
Set animation slider enabled.
Parameters:
enabled - boolean

setStopToggleButtonVisible

public void setStopToggleButtonVisible(boolean visible)
Set stop toggle visibility.
Parameters:
visible - boolean - visibility (0 to 100)

setStopToggleButtonEnabled

public void setStopToggleButtonEnabled(boolean enabled)
Set stop toggle enabled.
Parameters:
enabled - boolean

setPlayForwardToggleButtonVisible

public void setPlayForwardToggleButtonVisible(boolean visible)
Set play forward toggle button visibility.
Parameters:
visible - boolean - visibility (0 to 100)

setPlayForwardToggleButtonEnabled

public void setPlayForwardToggleButtonEnabled(boolean enabled)
Set play forward toggle button enabled.
Parameters:
enabled - boolean

isMagnifyButtonVisible

public boolean isMagnifyButtonVisible()
Check magnify button visibility.

isAnimationSliderVisible

public boolean isAnimationSliderVisible()
Check animation slider visibility.

isStopToggleButtonVisible

public boolean isStopToggleButtonVisible()
Check stop toggle visibility.

isPlayForwardToggleButtonVisible

public boolean isPlayForwardToggleButtonVisible()
Check play forward toggle button visibility.

setGoToStartButtonVisible

public void setGoToStartButtonVisible(boolean visible)
Set go to start button visibility.
Parameters:
visible - boolean - visibility

setGoToStartButtonEnabled

public void setGoToStartButtonEnabled(boolean enabled)
Set go to start button enabled.
Parameters:
enabled - boolean

setPlayBackwardFastToggleButtonVisible

public void setPlayBackwardFastToggleButtonVisible(boolean visible)
Set play backward fast toggle button visibility.
Parameters:
visible - boolean - visibility

setPlayBackwardFastToggleButtonEnabled

public void setPlayBackwardFastToggleButtonEnabled(boolean enabled)
Set play backward fast toggle button enabled.
Parameters:
enabled - boolean

setPlayBackwardToggleButtonVisible

public void setPlayBackwardToggleButtonVisible(boolean visible)
Set play backward toggle button visibility.
Parameters:
visible - boolean - visibility

setPlayBackwardToggleButtonEnabled

public void setPlayBackwardToggleButtonEnabled(boolean enabled)
Set play backward toggle button enabled.
Parameters:
enabled - boolean

setStepBackwardButtonVisible

public void setStepBackwardButtonVisible(boolean visible)
Set step backward button visibility.
Parameters:
visible - boolean - visibility

setStepBackwardButtonEnabled

public void setStepBackwardButtonEnabled(boolean enabled)
Set step backward button enabled.
Parameters:
enabled - boolean

setStepForwardButtonVisible

public void setStepForwardButtonVisible(boolean visible)
Set step forward button visibility.
Parameters:
visible - boolean - visibility

setStepForwardButtonEnabled

public void setStepForwardButtonEnabled(boolean enabled)
Set step forward button enabled.
Parameters:
enabled - boolean

setplayForwardFastToggleButtonVisible

public void setplayForwardFastToggleButtonVisible(boolean visible)
Set play forward fast toggle button visibility.
Parameters:
visible - boolean - visibility

setplayForwardFastToggleButtonEnabled

public void setplayForwardFastToggleButtonEnabled(boolean enabled)
Set play forward fast toggle button enabled.
Parameters:
enabled - boolean

setGoToEndButtonVisible

public void setGoToEndButtonVisible(boolean visible)
Set go to end button visibility.
Parameters:
visible - boolean - visibility

setGoToEndButtonEnabled

public void setGoToEndButtonEnabled(boolean enabled)
Set go to end button enabled.
Parameters:
enabled - boolean

isGoToStartButtonVisible

public boolean isGoToStartButtonVisible()
Check go to start button visibility.

isPlayBackwardFastToggleButtonVisible

public boolean isPlayBackwardFastToggleButtonVisible()
Check play backward fast toggle button visibility.

isPlayBackwardToggleButtonVisible

public boolean isPlayBackwardToggleButtonVisible()
Check play backward toggle button visibility.

isStepBackwardButtonVisible

public boolean isStepBackwardButtonVisible()
Check step backward button visibility.

isStepForwardButtonVisible

public boolean isStepForwardButtonVisible()
Check step forward button visibility.

isplayForwardFastToggleButtonVisible

public boolean isplayForwardFastToggleButtonVisible()
Check play forward fast toggle button visibility.

isGoToEndButtonVisible

public boolean isGoToEndButtonVisible()
Check go to end button visibility.

mouseClicked

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

mouseEntered

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

mouseExited

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

mousePressed

public void mousePressed(java.awt.event.MouseEvent event)
Handle mouse pressed event
Specified by:
mousePressed in interface java.awt.event.MouseListener

autoCrossOver

public void autoCrossOver(int x1,
                          int y1)
Handle autoCrossing Over

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent event)
Handle mouse released event
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseDragged

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

mouseMoved

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

playCrossoverAnimation

public void playCrossoverAnimation()
Play the crossover animation

playAnimationBackwardFast

public void playAnimationBackwardFast()
Play animation backward fast

playAnimationBackward

public void playAnimationBackward()
Play animation backward

stepAnimationBackward

public void stepAnimationBackward()
Step animation backward one step

stopAnimation

public void stopAnimation()
Stop playing animation

stepAnimationForward

public void stepAnimationForward()
Step animation forward one step

playAnimationForward

public void playAnimationForward()
Play animation forward

playAnimationForwardFast

public void playAnimationForwardFast()
Play animation forward fast

goToAnimationStep

public void goToAnimationStep(int aStep)
Go to a particular step in the animation and stop there.
Parameters:
aStep - int - a step (0 to 100)

startBlinking

public void startBlinking()
Start blinking if there is a first cut and the blinking timer isn't already running.

stopBlinking

public void stopBlinking()
Stop blinking

autoCrossing

public void autoCrossing()

actionPerformed

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

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Change listener events
Specified by:
stateChanged in interface javax.swing.event.ChangeListener

toolChanged

public void toolChanged(int aTool)
Method called by ToolView when the current tool changes. If we get a tool other than snip, we default to the selection tool. In other words, we ignore tools that we don't understand (e.g. DNA tool, Cross tool).

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

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