org.concord.biologica.ui
Class StaticOrganismView

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.StaticOrganismView
All Implemented Interfaces:
java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.beans.PropertyChangeListener, java.io.Serializable

public final class StaticOrganismView
extends OrganismView
implements java.awt.event.MouseListener, java.awt.image.ImageObserver, java.beans.PropertyChangeListener

A simple, static view that shows an organism and does nothing else.

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

Version:
$Revision: 1.1.1.1 $ $Date: 2001/04/28 00:39:21 $
Author:
$Author: ed $
See Also:
UIProp.BACKGROUND, UIProp.CHARACTERISTICS_TEXT_VISIBLE, UIProp.CHROMOSOME_TOOL_PICK_ON_ORGANISM, UIProp.FONT, UIProp.FOREGROUND, UIProp.LOCK_SYMBOL_VISIBLE, UIProp.NAME_TEXT_VISIBLE, UIProp.ORGANISM, UIProp.ORGANISM_IMAGE_SIZE, UIProp.SELECTION_TOOL_PICK_ON_STATIC_ORGANISM, UIProp.SEX_TEXT_VISIBLE, UIProp.SPECIES_TEXT_VISIBLE, UIProp.TEXT_INDENT, UIProp.TEXT_LINE_SPACING, 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
StaticOrganismView()
          Creates a parent organism view.
 
Method Summary
 Organism getOrganism()
          Get the organism shown in this view.
 java.awt.Dimension getPreferredSize()
          Return the preferred size of this canvas
 boolean imageUpdate(java.awt.Image anImage, int infoFlags, int x, int y, int width, int height)
          ImageObserver method
 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 setOrganism(Organism anOrganism)
          Set the current organism to be shown in this view.
 void toolChanged(int aTool)
          Method called by ToolView when the current tool changes.
 
Methods inherited from class org.concord.biologica.ui.OrganismView
getDefaultHighlightColor, getDefaultSelectionColor, getHighlightColor, getOrganismCellDimensions, getOrganismImageSize, getSelectionColor, getTextIndent, getTextLineSpacing, 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, 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, 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

StaticOrganismView

public StaticOrganismView()
Creates a parent organism view.
Throws:
java.lang.IllegalArgumentException - - one of input arguments null
Method Detail

getOrganism

public Organism getOrganism()
Get the organism shown in this view.
Returns:
Organism - the organism shown in the view, may be null

setOrganism

public void setOrganism(Organism anOrganism)
Set the current organism to be shown in this view.
Parameters:
anOrganism - Organism - the new organism to be shown in this view, may be null

paintComponent

public void paintComponent(java.awt.Graphics g)
Draw the graphics in this view. Uses the OrganismView.paintOrganism() method to do the really drawing.

Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - Graphics - the given graphics to use in drawing

getPreferredSize

public java.awt.Dimension getPreferredSize()
Return the preferred size of this canvas
Overrides:
getPreferredSize in class UIView
Returns:
Dimension - preferred size of canvas

imageUpdate

public boolean imageUpdate(java.awt.Image anImage,
                           int infoFlags,
                           int x,
                           int y,
                           int width,
                           int height)
ImageObserver method
Specified by:
imageUpdate in interface java.awt.image.ImageObserver
Overrides:
imageUpdate in class OrganismView

toolChanged

public void toolChanged(int aTool)
Method called by ToolView when the current tool changes. If we get a tool other than snip or chromosome, 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

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

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

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent event)
Handle mouse moved event

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