org.concord.biologica.ui
Class ToolView

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

public final class ToolView
extends UIView
implements java.awt.event.ActionListener, java.awt.event.ComponentListener

The tool view of BioLogica.

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

Version:
$Revision: 1.2 $ $Date: 2002/02/20 17:48:46 $
Author:
$Author: dima $
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 TOOL_VIEW_HORIZONTAL
          Horizontal orientation
static int TOOL_VIEW_VERTICAL
          Vertical orientation
 
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
ToolView()
          Creates a tool view.
ToolView(int anOrientation)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          React to actions
 void addTool(int aTool)
          Add the given tool to the view
 void addView(java.awt.Container aView)
          Add a view to the list of views that care about which tool in this tool view is active.
 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)
           
 int getActiveTool()
          Get the active tool id.
 int getOrientation()
          Get the orientation of the view - horizontal or vertical.
 java.awt.Dimension getPreferredSize()
          Return the preferred size of this application
 boolean isToolEnabled(int aTool)
          Is the tool enabled?
 boolean isToolVisible(int aTool)
          Is the tool visible?
 void removeTool(int aTool)
          Remove the given tool from the view
 void removeView(java.awt.Container aView)
          Remove a view to the list of views that care about which tool in this tool view is active.
 void setActiveTool(int anActiveTool)
          Set the active tool
 void setOrientation(int anOrientation)
          Set the orientation of the view - horizontal or vertical.
 void setToolEnabled(int aTool, boolean aToolEnabled)
          Set the tool enabled state.
 void setToolVisible(int aTool, boolean aToolVisible)
          Set the tool visibility.
 void updateSize()
          Update the size of this view.
 
Methods inherited from class org.concord.biologica.ui.UIView
addPropertyChangeListener, getLocalImage, 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, 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

TOOL_VIEW_HORIZONTAL

public static final int TOOL_VIEW_HORIZONTAL
Horizontal orientation

TOOL_VIEW_VERTICAL

public static final int TOOL_VIEW_VERTICAL
Vertical orientation
Constructor Detail

ToolView

public ToolView()
Creates a tool view.
Parameters:
anOrientation - int - horizontal or vertical
Throws:
java.lang.IllegalArgumentException - - input argument(s) illegal
See Also:
TOOL_VIEW_HORIZONTAL, TOOL_VIEW_VERTICAL

ToolView

public ToolView(int anOrientation)
Method Detail

getPreferredSize

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

getOrientation

public int getOrientation()
Get the orientation of the view - horizontal or vertical.
Returns:
int - horizontal or vertical
See Also:
TOOL_VIEW_HORIZONTAL, TOOL_VIEW_VERTICAL

setOrientation

public void setOrientation(int anOrientation)
Set the orientation of the view - horizontal or vertical.
Parameters:
anOrientation - int - horizontal or vertical
Throws:
java.lang.IllegalArgumentException - - input argument(s) illegal
See Also:
TOOL_VIEW_HORIZONTAL, TOOL_VIEW_VERTICAL

addTool

public void addTool(int aTool)
Add the given tool to the view
Parameters:
aTool - int - a tool to add

removeTool

public void removeTool(int aTool)
Remove the given tool from the view
Parameters:
aTool - int - a tool to add

getActiveTool

public int getActiveTool()
Get the active tool id.
Returns:
int - the active tool

setActiveTool

public void setActiveTool(int anActiveTool)
Set the active tool
Parameters:
anActiveTool - int - the new active tool

isToolEnabled

public boolean isToolEnabled(int aTool)
Is the tool enabled?
Parameters:
aTool - int - tool id
Returns:
boolean - is the tool enabled?

setToolEnabled

public void setToolEnabled(int aTool,
                           boolean aToolEnabled)
Set the tool enabled state.
Parameters:
aTool - int - tool id
aToolEnabled - boolean - enabled?

isToolVisible

public boolean isToolVisible(int aTool)
Is the tool visible?
Parameters:
aTool - int - tool id
Returns:
boolean - is the tool visible?

setToolVisible

public void setToolVisible(int aTool,
                           boolean aToolVisible)
Set the tool visibility.
Parameters:
aToolVisible - boolean - visible?

addView

public void addView(java.awt.Container aView)
Add a view to the list of views that care about which tool in this tool view is active.

If the given view is a UIView, it will be notified when the tool changes.

All views are told to set their cursor, even views that are not UIView's.

Parameters:
aView - Container - a new view to add, should not be null

removeView

public void removeView(java.awt.Container aView)
Remove a view to the list of views that care about which tool in this tool view is active.

Parameters:
aView - Container - a new view to add, should not be null

updateSize

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

actionPerformed

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

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