org.greenstone.gs3client
Class SearchResultsDisplay

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.SearchResultsDisplay
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.TreeSelectionListener, ColourCombo.ColourChangeable

public class SearchResultsDisplay
extends javax.swing.JPanel
implements javax.swing.event.TreeSelectionListener, ColourCombo.ColourChangeable

The Search panel inside the Java-client's tab pane that's labelled "Search Results". This panel contains two tree views: - one for displaying the list of search results (top-level documents or document - one for displaying the structure of document nodes selected in the list of search results. This panel also contains an area where the selected documentNode's metadata is displayed, and a text area where the textual or image content of a selected documentNode is displayed.

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
          Access to the running instance of GS3JavaClient
protected  javax.swing.JEditorPane docContentEditPane
           
protected  javax.swing.JSplitPane docInfoPane
           
protected  javax.swing.JSplitPane docInfoWithContent
           
protected  javax.swing.JTree docStructureTree
           
(package private) static org.apache.log4j.Logger LOG
          The Logger for this class
protected  javax.swing.JList metanames
           
protected  javax.swing.JList metavalues
           
protected  javax.swing.JPopupMenu popup
          Context menu that pops up when users right click in the browse tree area
protected  javax.swing.JTree searchResultsTree
           
protected  javax.swing.JSplitPane treeviewSplitPane
           
 
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
SearchResultsDisplay(GS3JavaClient client)
          Constructor that creates the Search Panel and its internal GUI items.
 
Method Summary
 void changeUIColour()
          Changes the colour of the query form and its controls to the current colours set in class ColourCombo.
 void clear()
          Clears the service-specific buttons in the browseBar and the service-specific display-data.
 java.awt.Dimension getPreferredSize()
          Overrode this method to resize the splitpanes within, upon resize.
protected  void restructureWithNewRoot(DocumentNodeData rootDocNode)
          Restructures the docStructureTree with a new rootNode when a different search result has been clicked.
 void setResults(DocumentNodeData[] resultDocs)
          Restructures the searchResultsTree when another search has been made, so that the search results contain a new list of documentNodeData objects.
 void valueChanged(javax.swing.event.TreeSelectionEvent e)
          Part of the TreeSelectionListener interface.
 
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, 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

LOG

static org.apache.log4j.Logger LOG
The Logger for this class


client

protected GS3JavaClient client
Access to the running instance of GS3JavaClient


searchResultsTree

protected javax.swing.JTree searchResultsTree

docStructureTree

protected javax.swing.JTree docStructureTree

docInfoPane

protected javax.swing.JSplitPane docInfoPane

docInfoWithContent

protected javax.swing.JSplitPane docInfoWithContent

treeviewSplitPane

protected javax.swing.JSplitPane treeviewSplitPane

docContentEditPane

protected javax.swing.JEditorPane docContentEditPane

metanames

protected javax.swing.JList metanames

metavalues

protected javax.swing.JList metavalues

popup

protected javax.swing.JPopupMenu popup
Context menu that pops up when users right click in the browse tree area

Constructor Detail

SearchResultsDisplay

public SearchResultsDisplay(GS3JavaClient client)
Constructor that creates the Search Panel and its internal GUI items.

Parameters:
client - is the running instance of the client application through which its methods can be accessed.
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrode this method to resize the splitpanes within, upon resize. It calculates the size of this panel, as well as setting those of the splitpanes it contains based on the size of the parent container.

Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
the preferred dimensions of this JPanel.

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

clear

public void clear()
Clears the service-specific buttons in the browseBar and the service-specific display-data. The rest of the GUI (split panes, panels) remain as they are. Resets the contents of the widgets in this panel.


setResults

public void setResults(DocumentNodeData[] resultDocs)
Restructures the searchResultsTree when another search has been made, so that the search results contain a new list of documentNodeData objects.

Parameters:
resultDocs - - the list of (new) DocumentNodeData objects that have been returned as the results of a query/search operation.

restructureWithNewRoot

protected void restructureWithNewRoot(DocumentNodeData rootDocNode)
Restructures the docStructureTree with a new rootNode when a different search result has been clicked.

Parameters:
rootDocNode - - the new root DocumentNodeData whose structure is to be displayed in the docStructureTree.

valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent e)
Part of the TreeSelectionListener interface. When this is called, an item has been clicked in either the searchResultsTree or the docStructureTree. This method displays the metadata and textual contents accordingly of the selected documentNodeData object.

Specified by:
valueChanged in interface javax.swing.event.TreeSelectionListener