project35.soa.ontology.views
Class ListView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by project35.soa.ontology.views.ListView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.CaretListener, javax.swing.event.ListSelectionListener, OntologyView

public class ListView
extends javax.swing.JPanel
implements javax.swing.event.CaretListener, javax.swing.event.ListSelectionListener, OntologyView

Views an ontology as a list of alphabetised terms. Combines a list with a search field


Copyright (c) 2008 Kevin Garwood for Project35. The original code was developed by Kevin Garwood for the University of Manchester. Revisions have been made for Project35, a project that is independent of that institution. This code is licensed under the Academic Free License version 3.0. The code attribution for the original code is included here:

Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.


Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
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
ListView()
           
 
Method Summary
 void buildUI()
           
 boolean canViewSource(Project35FormContext project35FormContext, OntologySource ontologySource)
          determines if the view is capable of supporting terms provided by an ontology source
 void caretUpdate(javax.swing.event.CaretEvent event)
           
 void changeFont(java.awt.Font font)
           
 javax.swing.JComponent getComponent()
          gets the component that renders the view.
 java.lang.String getName()
          the name of the view.
 OntologyTerm[] getSelectedOntologyTerms(Project35FormContext project35FormContext)
          returns the selected terms in the view
 void reset()
          resets the display.
 void setOntologySource(Project35FormContext project35FormContext, OntologySource ontologySource)
          sets the ontology source for the view
 void setOntologyViewListener(OntologyViewListener ontologyViewListener)
          sets the ontology view listener.
 void showDescription(boolean showDescription)
           
 void update()
           
 void valueChanged(javax.swing.event.ListSelectionEvent event)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListView

public ListView()
Method Detail

showDescription

public void showDescription(boolean showDescription)

buildUI

public void buildUI()

changeFont

public void changeFont(java.awt.Font font)
Specified by:
changeFont in interface OntologyView

update

public void update()

caretUpdate

public void caretUpdate(javax.swing.event.CaretEvent event)
Specified by:
caretUpdate in interface javax.swing.event.CaretListener

getName

public java.lang.String getName()
the name of the view.

Specified by:
getName in interface OntologyView
Overrides:
getName in class java.awt.Component
Returns:
the name of the view

canViewSource

public boolean canViewSource(Project35FormContext project35FormContext,
                             OntologySource ontologySource)
Description copied from interface: OntologyView
determines if the view is capable of supporting terms provided by an ontology source

Specified by:
canViewSource in interface OntologyView
Parameters:
project35FormContext - a collection of environment variables that refer to different parts of the Project35 Application
ontologySource - provides terms to the view. The View performs introspection on the source by checking what marker interfaces the source supports. It uses these to determine whether it can support a particular kind of view.

reset

public void reset()
resets the display.

Specified by:
reset in interface OntologyView

setOntologySource

public void setOntologySource(Project35FormContext project35FormContext,
                              OntologySource ontologySource)
sets the ontology source for the view

Specified by:
setOntologySource in interface OntologyView
Parameters:
ontologySource - the ontology source
project35FormContext - a collection of environment variables that refer to different parts of the Project35 Application

getSelectedOntologyTerms

public OntologyTerm[] getSelectedOntologyTerms(Project35FormContext project35FormContext)
returns the selected terms in the view

Specified by:
getSelectedOntologyTerms in interface OntologyView
Parameters:
project35FormContext - a collection of environment variables that refer to different parts of the Project35 Application
Returns:
returns the selected items in the list

setOntologyViewListener

public void setOntologyViewListener(OntologyViewListener ontologyViewListener)
sets the ontology view listener. The listener waits for the user to choose terms in the view. An example ontology view listener is DefaultOntologyListener.

Specified by:
setOntologyViewListener in interface OntologyView
Parameters:
ontologyViewListener -

getComponent

public javax.swing.JComponent getComponent()
Description copied from interface: OntologyView
gets the component that renders the view.

Specified by:
getComponent in interface OntologyView
Returns:
the component that renders the view. Typically this will be an instance of a JPanel

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent event)
Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener