org.greenstone.gs3client
Class QueryForm

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 org.greenstone.gs3client.QueryForm
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, ColourCombo.ColourChangeable

public class QueryForm
extends javax.swing.JPanel
implements java.awt.event.ActionListener, java.awt.event.KeyListener, ColourCombo.ColourChangeable

Panel that represents a Query Form based on GS3 describe response XML messages sent by a Query Service. An inner panel will contain all the actual form controls. The form can be reset to empty which will clear its contents. Its contents can be reset to display controls appropriate to new Query Service describe response XML messages.

Author:
ak19
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
protected  GS3JavaClient client
          Handle to the running instance of the GS3JavaClient in order to have access to its methods
protected  javax.swing.JPanel paramsPanel
          Panel to contain all the form controls specific to the chosen Query Service.
protected  QueryFormData[] paramTags
          Query parameters specified by the query services
protected  javax.swing.JButton searchButton
          Search button that will cause the search to be executed when pressed
 
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
QueryForm(GS3JavaClient client)
          Constructor that instantiates this Form's internal GUI items.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Called when this QueryForm's search button is pressed: the data entered/controls settings specified by the user are passed to the digital library's Query Service in order to perform the search.
 void changeUIColour()
          Changes the colour of the query form and its controls to the current colours set in class ColourCombo.
 void clear()
          Call this method to empty all the form controls.
 void formFromQueryServiceDescribe(org.w3c.dom.Element el)
          Sets up the the query form for display (queryPanel) given the XML of the response-message returned by a "describe" request sent to a Query Service.
 void keyPressed(java.awt.event.KeyEvent e)
          Defined by KeyListener interface.
 void keyReleased(java.awt.event.KeyEvent e)
          Called when the searchButton was in focus and a key was pressed.
 void keyTyped(java.awt.event.KeyEvent e)
          Defined by KeyListener interface.
protected  void searchButtonPressed()
          Called when the searchButton was clicked or when it was in focus and the enter key was pressed.
 
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, getName, 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
 

Field Detail

client

protected GS3JavaClient client
Handle to the running instance of the GS3JavaClient in order to have access to its methods


paramsPanel

protected javax.swing.JPanel paramsPanel
Panel to contain all the form controls specific to the chosen Query Service.


searchButton

protected javax.swing.JButton searchButton
Search button that will cause the search to be executed when pressed


paramTags

protected QueryFormData[] paramTags
Query parameters specified by the query services

Constructor Detail

QueryForm

public QueryForm(GS3JavaClient client)
Constructor that instantiates this Form's internal GUI items.

Parameters:
client - - handle to the running instance of the GS3JavaClient
Method Detail

clear

public void clear()
Call this method to empty all the form controls. This Query Form component can then be reused.


changeUIColour

public void changeUIColour()
Changes the colour of the query form and its controls to the current colours set in class ColourCombo. Specified by the ColourCombo.ColourChangeable interface.

Specified by:
changeUIColour in interface ColourCombo.ColourChangeable

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Called when this QueryForm's search button is pressed: the data entered/controls settings specified by the user are passed to the digital library's Query Service in order to perform the search.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Defined by KeyListener interface. Does nothing.

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Defined by KeyListener interface. Does nothing.

Specified by:
keyTyped in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Called when the searchButton was in focus and a key was pressed. If this key was the Enter button, then the search is performed: the data entered/controls settings specified by the user are passed to the digital library's Query Service in order to perform the search.

Specified by:
keyReleased in interface java.awt.event.KeyListener

searchButtonPressed

protected void searchButtonPressed()
Called when the searchButton was clicked or when it was in focus and the enter key was pressed. The search is performed by passing the data entered/controls settings specified by the user to the digital library's Query Service in order to perform the search.


formFromQueryServiceDescribe

public void formFromQueryServiceDescribe(org.w3c.dom.Element el)
Sets up the the query form for display (queryPanel) given the XML of the response-message returned by a "describe" request sent to a Query Service. That is, generates the query form as specified by the given response XML for a Query describe.

Parameters:
el - - a serviceResponseXML for a describe request that specifies how the paramsPanel should look.