org.concord.biologica.ui
Class SmallFertilizationView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--org.concord.biologica.ui.UIView
                          |
                          +--org.concord.biologica.ui.SmallFertilizationView
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.beans.PropertyChangeListener, java.io.Serializable

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

This class represents a view which shows the 2 sex cells of 2 parents in the sex view and has controls for the user to conduct fertilization within this view of those 2 cells. An object of this class will generate the following property change events:

Version:
$Revision: 1.3 $ $Date: 2001/06/05 18:48:21 $
Author:
$Author: ed $
See Also:
UIProp.BACKGROUND, UIProp.FERTILIZATION_MANUALLY_DISABLED, UIProp.FERTILIZATION_MODEL, UIProp.FONT, UIProp.FOREGROUND, UIProp.SMALL_FERTILIZATION_MAGNIFY_BUTTON_PUSHED, 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
SmallFertilizationView()
          Creates a small fertilization view.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          React to actions
 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 goToAnimationStep(int aStep)
          Go to a particular step in the animation and stop there.
 boolean isAnimationSliderVisible()
          Check animation slider visibility.
 boolean isFertilizationManuallyDisabled()
          Get whether or not fertilization is manually disabled.
 boolean isMagnifyButtonVisible()
          Check magnify button visibility.
 boolean isStopToggleButtonVisible()
          Check stop toggle visibility.
 void paintComponent(java.awt.Graphics g)
          Draw the graphics in this view.
 void playAnimationForward()
          Play animation forward
 void propertyChange(java.beans.PropertyChangeEvent event)
          Handle property change events
 void setAnimationSliderEnabled(boolean enabled)
          Set animation slider enabled.
 void setAnimationSliderVisible(boolean visible)
          Set animation slider visibility.
 void setFertilizationManuallyDisabled(boolean aManuallyDisabled)
          Set whether fertilization is manually disabled or not.
 void setMagnifyButtonEnabled(boolean enabled)
          Set magnify button enabled.
 void setMagnifyButtonVisible(boolean visible)
          Set magnify button visibility.
 void setPlayForwardToggleButtonEnabled(boolean enabled)
          Set play forward toggle button enabled.
 void setPlayForwardToggleButtonVisible(boolean visible)
          Set play forward toggle button visibility.
 void setStopToggleButtonEnabled(boolean enabled)
          Set stop toggle enabled.
 void setStopToggleButtonVisible(boolean visible)
          Set stop toggle visibility.
 void stateChanged(javax.swing.event.ChangeEvent e)
          Change listener events
 void stopAnimation()
          Stop playing animation
 void updateSize()
           
 void updateSize(boolean forceUpdate)
          Update the size of this view.
 void updateState()
          Update the state of this view, usually called because the state of the underlying fertilization 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, 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, 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

SmallFertilizationView

public SmallFertilizationView()
Creates a small fertilization view.
Method Detail

isFertilizationManuallyDisabled

public final boolean isFertilizationManuallyDisabled()
Get whether or not fertilization is manually disabled.

Returns:
boolean - is fertilization manually disabled?

setFertilizationManuallyDisabled

public void setFertilizationManuallyDisabled(boolean aManuallyDisabled)
Set whether fertilization is manually disabled or not.

Parameters:
aManuallyDisabled - boolean - new manually disabled value

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.

updateState

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

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

updateSize

public void updateSize(boolean forceUpdate)
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.

updateSize

public void updateSize()

stopAnimation

public void stopAnimation()
Stop playing animation

playAnimationForward

public void playAnimationForward()
Play animation forward

goToAnimationStep

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

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

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