org.concord.biologica.ui
Class UIView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--org.concord.biologica.ui.UIView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
AllInOneView, BigFertilizationView, BigMeiosisView, ChromosomeView, DNAView, ObjectPropertiesView, OrganismView, PedigreeView, SmallFertilizationView, SmallMeiosisView, ToolView

public class UIView
extends javax.swing.JComponent

The basic user interface view of BioLogica.

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

Version:
$Revision: 1.3 $ $Date: 2001/08/31 15:57:48 $
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
protected  java.beans.PropertyChangeSupport changes
          Utility object which manages property change events and listeners.
protected  int fontAscent
          Font ascent
protected  int fontDescent
          Font descent
protected  int fontHeight
          Font height
protected  java.awt.FontMetrics fontMetrics
          Font metrics
protected  int preferredHeight
          Preferred height of this view.
protected  int preferredWidth
          Preferred width of this view.
protected  javax.swing.JScrollPane scrollPane
          Optional scroll pane parent of this view.
 
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
protected UIView()
          Creates a user interface view.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener aListener)
          Add a property change listener for properties.
static javax.swing.ImageIcon getLocalImage(java.lang.String path)
           
 java.awt.Dimension getPreferredSize()
          Return the preferred size of this canvas
protected  void paintBackground(java.awt.Graphics g, java.awt.Rectangle bounds)
          Paint the background of this view using the given Graphics and bounds rectangle.
 void removePropertyChangeListener(java.beans.PropertyChangeListener aListener)
          Remove a property change listener for properties.
 void setBackground(java.awt.Color aBackground)
          Set the background color for this view.
 void setFont(java.awt.Font aFont)
          Set the font for this view.
 void setForeground(java.awt.Color aForeground)
          Set the foreground color for this view.
 void setScrollPane(javax.swing.JScrollPane aScrollPane)
          Tell this view its scroll pane.
 void toolChanged(int aTool)
          Method called by ToolView when the current tool changes.
protected  void updateFont(java.awt.Graphics g)
          Update the font settings
 
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
 

Field Detail

fontMetrics

protected java.awt.FontMetrics fontMetrics
Font metrics

fontAscent

protected int fontAscent
Font ascent

fontDescent

protected int fontDescent
Font descent

fontHeight

protected int fontHeight
Font height

scrollPane

protected javax.swing.JScrollPane scrollPane
Optional scroll pane parent of this view.

preferredWidth

protected int preferredWidth
Preferred width of this view.

preferredHeight

protected int preferredHeight
Preferred height of this view.

changes

protected transient java.beans.PropertyChangeSupport changes
Utility object which manages property change events and listeners.
Constructor Detail

UIView

protected UIView()
Creates a user interface view.
Method Detail

getLocalImage

public static javax.swing.ImageIcon getLocalImage(java.lang.String path)

setScrollPane

public void setScrollPane(javax.swing.JScrollPane aScrollPane)
Tell this view its scroll pane. Most views that care will override this method and update scrollbars when this method is called.

Parameters:
aScrollPane - JScrollPane - the scroll pane containing this view, may be null

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 javax.swing.JComponent
Parameters:
aFont - Font - a new font, if null, then will revert to default font

toolChanged

public void toolChanged(int aTool)
Method called by ToolView when the current tool changes.

Parameters:
aTool - int - the active tool

updateFont

protected void updateFont(java.awt.Graphics g)
Update the font settings
Parameters:
g - Graphics

setBackground

public void setBackground(java.awt.Color aBackground)
Set the background color for this view. If a null background color is specified, the view will revert back to its default background color.

Overrides:
setBackground in class javax.swing.JComponent
Parameters:
aBackground - Color - a new background color. If null, then will revert to default background color.

setForeground

public void setForeground(java.awt.Color aForeground)
Set the foreground color for this view. If a null foreground color is specified, the view will revert back to its default foreground color.

Overrides:
setForeground in class javax.swing.JComponent
Parameters:
aForeground - Color - a new color, if null, then will revert to default foreground color

getPreferredSize

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

paintBackground

protected void paintBackground(java.awt.Graphics g,
                               java.awt.Rectangle bounds)
Paint the background of this view using the given Graphics and bounds rectangle. This method is unfortunately necessary until I figure out how to get the views to draw their own backgrounds using standard Swing methods.

Parameters:
g - Graphics - graphics to use, may not be null
bounds - Rectangle - rectangle to use, may not be null

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener aListener)
Add a property change listener for properties.
Overrides:
addPropertyChangeListener in class javax.swing.JComponent
Parameters:
aListener - PropertyChangeListener - a new listener

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener aListener)
Remove a property change listener for properties.
Overrides:
removePropertyChangeListener in class javax.swing.JComponent
Parameters:
aListener - PropertyChangeListener - a listener to remove