org.concord.biologica.ui
Class MultipleOrganismView

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.MultipleOrganismView
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 MultipleOrganismView
extends OrganismView
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.beans.PropertyChangeListener, SelectionPresenter

The multiple organism view of BioLogica.

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

Version:
$Revision: 1.4 $ $Date: 2002/02/21 05:45:03 $
Author:
$Author: dima $
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_ADDED_TO_VIEW, UIProp.ORGANISM_IMAGE_SIZE, UIProp.ORGANISM_LAYOUT_STYLE, UIProp.ORGANISM_REMOVED_FROM_VIEW, UIProp.SELECTION_MODE, 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
 
Field Summary
static int ORGANISM_LAYOUT_STYLE_LEFT_TO_RIGHT_NO_WRAP
          An alternative organism layout style for this view - left to right with no wrap (e.g.
static int ORGANISM_LAYOUT_STYLE_LEFT_TO_RIGHT_WRAP
          Default organism layout style for this view - left to right and wrap (e.g.
static int ORGANISM_LAYOUT_STYLE_TOP_TO_BOTTOM_NO_WRAP
          An alternative organism layout style for this view - top to bottom with no wrap (e.g.
static int ORGANISM_LAYOUT_STYLE_TOP_TO_BOTTOM_WRAP
          An alternative organism layout style for this view - top to bottom and wrap (e.g.
 
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
MultipleOrganismView()
          Creates a multiple organism view.
 
Method Summary
 void addOrganism(Organism anOrganism)
          Add an organism to this view.
 int getNumberOfOrganisms()
          Get the number of organisms in this view.
 int getOrganismLayoutStyle()
          Get the current organism layout style.
 java.util.Enumeration getOrganisms()
          Get the set of organisms in this view.
 SelectionSet getSelectionSet()
          Get the current selection set
 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 removeAllOrganisms()
          Remove all organisms
 boolean removeOrganism(Organism anOrganism)
          Removes an organism from this view.
 void selectionChanged()
          Selection changed notification
 void setOrganismLayoutStyle(int anOrganismLayoutStyle)
          Set the current organism layout style.
 void setScrollPane(javax.swing.JScrollPane aScrollPane)
          Tell this view its scroll pane.
 void setSelectionSet(SelectionSet aSelectionSet)
          Set the current selection set.
 void toolChanged(int aTool)
          Method called by ToolView when the current tool changes.
 void updateScrollBars()
          Update the scroll bar extents based on the number of organisms
 
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, 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
 

Field Detail

ORGANISM_LAYOUT_STYLE_LEFT_TO_RIGHT_WRAP

public static final int ORGANISM_LAYOUT_STYLE_LEFT_TO_RIGHT_WRAP
Default organism layout style for this view - left to right and wrap (e.g. multiple rows).

ORGANISM_LAYOUT_STYLE_LEFT_TO_RIGHT_NO_WRAP

public static final int ORGANISM_LAYOUT_STYLE_LEFT_TO_RIGHT_NO_WRAP
An alternative organism layout style for this view - left to right with no wrap (e.g. single row).

ORGANISM_LAYOUT_STYLE_TOP_TO_BOTTOM_WRAP

public static final int ORGANISM_LAYOUT_STYLE_TOP_TO_BOTTOM_WRAP
An alternative organism layout style for this view - top to bottom and wrap (e.g. multiple columns).

ORGANISM_LAYOUT_STYLE_TOP_TO_BOTTOM_NO_WRAP

public static final int ORGANISM_LAYOUT_STYLE_TOP_TO_BOTTOM_NO_WRAP
An alternative organism layout style for this view - top to bottom with no wrap (e.g. single column).
Constructor Detail

MultipleOrganismView

public MultipleOrganismView()
Creates a multiple 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

addOrganism

public void addOrganism(Organism anOrganism)
Add an organism to this view.

Parameters:
anOrganism - Organism - an organism to add, may not be null
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 organisms

getNumberOfOrganisms

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

getOrganisms

public java.util.Enumeration getOrganisms()
Get the set of organisms in this view. A clone is returned, enabling you to delete the organisms without causing bugs in this code.

Returns:
Enumeration - enumeration over the set of organisms in this view

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

getOrganismLayoutStyle

public int getOrganismLayoutStyle()
Get the current organism layout style.
Returns:
int - current organism layout style

setOrganismLayoutStyle

public void setOrganismLayoutStyle(int anOrganismLayoutStyle)
Set the current organism layout style.
Parameters:
anOrganismLayoutStyle - int - a new organism layout style

updateScrollBars

public void updateScrollBars()
Update the scroll bar extents based on the number of organisms

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

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
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

selectionChanged

public void selectionChanged()
Selection changed notification
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