project35.soa.ontology.views
Class PictureView

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.PictureView
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, OntologyView

public class PictureView
extends javax.swing.JPanel
implements OntologyView, java.awt.event.ActionListener

renders ontology terms as a collection of thumbnail images. It is one of the views supported by DefaultOntologyViewer. It only supports ontology sources which implement the project35.soa.ontology.sources.ImageDescriptionSupport interface.


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
PictureView()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
           
 boolean canViewSource(Project35FormContext project35FormContext, OntologySource ontologySource)
          determines if the view is capable of supporting terms provided by an ontology source
 void changeFont(java.awt.Font font)
           
 javax.swing.JComponent getComponent()
          gets the component that renders the view.
 java.lang.String getName()
          gets the name of the view
 OntologyServiceMetaData getOntologyServiceMetaData(Project35FormContext project35FormContext)
           
 OntologyTerm[] getSelectedOntologyTerms(Project35FormContext project35FormContext)
          gets the ontology terms selected in the view
 void reset()
          resets the display of terms in the view
 void setOntologySource(Project35FormContext project35FormContext, OntologySource ontologySource)
          sets the ontology source used by the view
 void setOntologyViewListener(OntologyViewListener ontologyViewListener)
          sets the object that listens for when end-users have finished selecting the terms they want to use to mark-up a field.
 
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

PictureView

public PictureView()
Method Detail

changeFont

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

getName

public java.lang.String getName()
Description copied from interface: OntologyView
gets the name of the view

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

getOntologyServiceMetaData

public OntologyServiceMetaData getOntologyServiceMetaData(Project35FormContext project35FormContext)

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.

setOntologySource

public void setOntologySource(Project35FormContext project35FormContext,
                              OntologySource ontologySource)
Description copied from interface: OntologyView
sets the ontology source used by the view

Specified by:
setOntologySource 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.

getSelectedOntologyTerms

public OntologyTerm[] getSelectedOntologyTerms(Project35FormContext project35FormContext)
Description copied from interface: OntologyView
gets the ontology terms selected 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

setOntologyViewListener

public void setOntologyViewListener(OntologyViewListener ontologyViewListener)
Description copied from interface: OntologyView
sets the object that listens for when end-users have finished selecting the terms they want to use to mark-up a field.

Specified by:
setOntologyViewListener in interface OntologyView
Parameters:
ontologyViewListener - the object that performs some action based on knowledge that a set of terms were selected in the view.

reset

public void reset()
Description copied from interface: OntologyView
resets the display of terms in the view

Specified by:
reset in interface OntologyView

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

actionPerformed

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