org.concord.biologica.ui
Class AllInOneView

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

public final class AllInOneView
extends UIView
implements java.awt.event.ActionListener, javax.swing.event.MenuListener, java.awt.event.ItemListener, java.beans.PropertyChangeListener, java.awt.image.ImageObserver, SelectionPresenter

This class represents a view which contains and acts as a parent or manager of all of the other views of BioLogica. A script should use this view when they want to give a user an open-ended interface to all of the functionality of BioLogica.

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

Version:
$Revision: 1.2 $ $Date: 2001/06/05 18:48:24 $
Author:
$Author: ed $
See Also:
UIProp.BACKGROUND, UIProp.FONT, UIProp.FOREGROUND, 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 WINDOW_MODE_EXPORT_SPECIES_FILE
          Export Species window mode, meaning the file chooser is shown for choosing a species file to export.
static int WINDOW_MODE_IMPORT_SPECIES_FILE
          Import Species window mode, meaning the file chooser is shown for choosing a species file to import.
static int WINDOW_MODE_NORMAL
          Normal window mode, meaning we have a world open and the normal views can be seen.
static int WINDOW_MODE_OPEN_WORLD_FILE
          Open window mode, meaning the file chooser is shown for choosing a world file to open.
static int WINDOW_MODE_SAVE_WORLD_FILE_AS
          Save As window mode, meaning the file chooser is shown for choosing a world file to save to.
static int WINDOW_MODE_STARTUP
          Startup window mode, meaning we want ALL views visible so they all get the proper look and feel.
static int WINDOW_MODE_WELCOME
          Welcome window mode, meaning no world is currently open and we want some text on the screen telling the user to choose New or Open...
 
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
AllInOneView()
          Creates BioLogica AllInOne view
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          React to actions
 void doSelectionOrganismStuff(Organism selectedOrganism)
          Do selection organism stuff
 java.io.File enforceFileExtension(java.io.File aFile, java.lang.String anExtension)
          Enforce the proper file extension, if possible
 ChromosomeView getChromosomeView()
          Get the chromosome view
 boolean getFileControlsVisible()
          Get file controls visible
 boolean getMemoryMenuVisible()
          Get memory menu visible
 MultipleOrganismView getMultipleOrganismView()
          Get the multiple organism view
 ObjectPropertiesView getObjectPropertiesView()
          Get the object properties view
 PedigreeView getPedigreeView()
          Get the pedigree view
 java.awt.Dimension getPreferredSize()
          Return the preferred size of this application
 SelectionSet getSelectionSet()
          Get the current selection set
 SexView getSexView()
          Get the sex view
 boolean getSpeciesPulldownVisible()
          Get species pulldown visible
 boolean getTreePaneVisible()
          Get the tree pane visibility
 TreeView getTreeView()
          Get the tree view
 void itemStateChanged(java.awt.event.ItemEvent event)
          Handle combo box item changed events.
 void menuCanceled(javax.swing.event.MenuEvent e)
           
 void menuDeselected(javax.swing.event.MenuEvent e)
           
 void menuSelected(javax.swing.event.MenuEvent e)
          React to menu events
 void propertyChange(java.beans.PropertyChangeEvent event)
          Handle property change events
 void selectionChanged()
          Selection changed notification
 void setCurrentWorld(World aWorld)
          Set the current world.
 void setFileControlsVisible(boolean aVisible)
          Set file controls visible
 void setFont(java.awt.Font aFont)
          Set the font for this view.
 void setMemoryMenuVisible(boolean aVisible)
          Set memory menu visible
 void setSelectionSet(SelectionSet aSelectionSet)
          Set the current selection set.
 void setSpeciesPulldownVisible(boolean aVisible)
          Set species pulldown visible
 void setTreePaneVisible(boolean aVisible)
          Set the tree pane visibility.
 void setWindowMode(int aWindowMode)
          Set window mode, updating window appropriately.
 
Methods inherited from class org.concord.biologica.ui.UIView
addPropertyChangeListener, getLocalImage, paintBackground, removePropertyChangeListener, setBackground, 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, paintComponent, 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
 
Methods inherited from interface java.awt.image.ImageObserver
imageUpdate
 

Field Detail

WINDOW_MODE_STARTUP

public static final int WINDOW_MODE_STARTUP
Startup window mode, meaning we want ALL views visible so they all get the proper look and feel. This mode is only briefly used during startup.

WINDOW_MODE_WELCOME

public static final int WINDOW_MODE_WELCOME
Welcome window mode, meaning no world is currently open and we want some text on the screen telling the user to choose New or Open... to create or open a world.

WINDOW_MODE_OPEN_WORLD_FILE

public static final int WINDOW_MODE_OPEN_WORLD_FILE
Open window mode, meaning the file chooser is shown for choosing a world file to open.

WINDOW_MODE_SAVE_WORLD_FILE_AS

public static final int WINDOW_MODE_SAVE_WORLD_FILE_AS
Save As window mode, meaning the file chooser is shown for choosing a world file to save to.

WINDOW_MODE_IMPORT_SPECIES_FILE

public static final int WINDOW_MODE_IMPORT_SPECIES_FILE
Import Species window mode, meaning the file chooser is shown for choosing a species file to import.

WINDOW_MODE_EXPORT_SPECIES_FILE

public static final int WINDOW_MODE_EXPORT_SPECIES_FILE
Export Species window mode, meaning the file chooser is shown for choosing a species file to export.

WINDOW_MODE_NORMAL

public static final int WINDOW_MODE_NORMAL
Normal window mode, meaning we have a world open and the normal views can be seen.
Constructor Detail

AllInOneView

public AllInOneView()
Creates BioLogica AllInOne view
Method Detail

getFileControlsVisible

public boolean getFileControlsVisible()
Get file controls visible
Returns:
boolean - visible of file controls

setFileControlsVisible

public void setFileControlsVisible(boolean aVisible)
Set file controls visible
Parameters:
aVisible - boolean - new visible of file controls

getSpeciesPulldownVisible

public boolean getSpeciesPulldownVisible()
Get species pulldown visible
Returns:
boolean - visibility of species pulldown

setSpeciesPulldownVisible

public void setSpeciesPulldownVisible(boolean aVisible)
Set species pulldown visible
Parameters:
aVisible - boolean - new visibility of species pulldown

getMemoryMenuVisible

public boolean getMemoryMenuVisible()
Get memory menu visible
Returns:
boolean - visible of memory menu

setMemoryMenuVisible

public void setMemoryMenuVisible(boolean aVisible)
Set memory menu visible
Parameters:
aVisible - boolean - new visible of memory menu

getPreferredSize

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

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

getTreeView

public TreeView getTreeView()
Get the tree view
Returns:
TreeView - the tree view

getObjectPropertiesView

public ObjectPropertiesView getObjectPropertiesView()
Get the object properties view
Returns:
ObjectPropertiesView - the object properties view

getPedigreeView

public PedigreeView getPedigreeView()
Get the pedigree view
Returns:
PedigreeView - the pedigree view

getMultipleOrganismView

public MultipleOrganismView getMultipleOrganismView()
Get the multiple organism view
Returns:
MultipleOrganismView - the multiple organism view

getSexView

public SexView getSexView()
Get the sex view
Returns:
SexView - the sex view

getChromosomeView

public ChromosomeView getChromosomeView()
Get the chromosome view
Returns:
ChromosomeView - the chromosome view

selectionChanged

public void selectionChanged()
Selection changed notification
Specified by:
selectionChanged in interface SelectionPresenter

doSelectionOrganismStuff

public void doSelectionOrganismStuff(Organism selectedOrganism)
Do selection organism stuff

actionPerformed

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

getTreePaneVisible

public boolean getTreePaneVisible()
Get the tree pane visibility
Returns:
boolean - visibility of tree pane

setTreePaneVisible

public void setTreePaneVisible(boolean aVisible)
Set the tree pane visibility. Do nothing if visibility is not changing.
Parameters:
aVisible - boolean - new visibility

enforceFileExtension

public java.io.File enforceFileExtension(java.io.File aFile,
                                         java.lang.String anExtension)
Enforce the proper file extension, if possible
Parameters:
aFile - File - a possible file
anExtension - String - filename extension to enforce (e.g. "xml", "blw" or "bls")
Returns:
File - proper file with enforced extension, null if it can't be done, may be input aFile if that's okay, else new File with correct extension

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

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 - item changed event

setFont

public void setFont(java.awt.Font aFont)
Set the font for this view. If a null font is specified, the view will revert back to its default font.

Overrides:
setFont in class UIView
Parameters:
aFont - Font - a new font, if null, then will revert to default font

setCurrentWorld

public void setCurrentWorld(World aWorld)
Set the current world.
Parameters:
aWorld - World - a world, may be null

setWindowMode

public void setWindowMode(int aWindowMode)
Set window mode, updating window appropriately.
Parameters:
aWindowMode - int - new window mode

menuSelected

public void menuSelected(javax.swing.event.MenuEvent e)
React to menu events
Specified by:
menuSelected in interface javax.swing.event.MenuListener

menuDeselected

public void menuDeselected(javax.swing.event.MenuEvent e)
Specified by:
menuDeselected in interface javax.swing.event.MenuListener

menuCanceled

public void menuCanceled(javax.swing.event.MenuEvent e)
Specified by:
menuCanceled in interface javax.swing.event.MenuListener