net.sourceforge.nite.gui.util
Class QueryWindow

java.lang.Object
  extended by net.sourceforge.nite.gui.util.QueryWindow
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Runnable, java.util.EventListener, javax.swing.event.TreeSelectionListener, QueryHandler

public class QueryWindow
extends java.lang.Object
implements QueryHandler, javax.swing.event.TreeSelectionListener, java.awt.event.ActionListener, java.lang.Runnable

Provides a search interface window to allow interaction with other interfaces. Search interface adapted from code by Holger Voormann and Halyna Seniv

Author:
jonathan

Constructor Summary
QueryWindow(NOMWriteCorpus nom)
          just set up a query handler for the NOM - no window popped up!
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          This handles the interface actions
 void deregisterResultHandler(QueryResultHandler display)
          remove an interface element that will be informed of results
 void performQuery(java.lang.String newQuery)
          Perform the query and display the results on-screen
 void popupSearchWindow()
          pop up the search window.
 void querySubmitted(java.lang.String query)
           
 void registerResultHandler(QueryResultHandler display)
          add an interface element that will be informed of results.
 void run()
          New query will be executed by a new thread.
 void savePreferences()
           
 void valueChanged(javax.swing.event.TreeSelectionEvent tse)
          TreeSelectionEvents - highlight the result on the registered displays
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryWindow

public QueryWindow(NOMWriteCorpus nom)
just set up a query handler for the NOM - no window popped up!

Method Detail

popupSearchWindow

public void popupSearchWindow()
pop up the search window.

Specified by:
popupSearchWindow in interface QueryHandler

registerResultHandler

public void registerResultHandler(QueryResultHandler display)
add an interface element that will be informed of results.

Specified by:
registerResultHandler in interface QueryHandler

deregisterResultHandler

public void deregisterResultHandler(QueryResultHandler display)
remove an interface element that will be informed of results

Specified by:
deregisterResultHandler in interface QueryHandler

performQuery

public void performQuery(java.lang.String newQuery)
Perform the query and display the results on-screen

Specified by:
performQuery in interface QueryHandler

valueChanged

public void valueChanged(javax.swing.event.TreeSelectionEvent tse)
TreeSelectionEvents - highlight the result on the registered displays

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

savePreferences

public void savePreferences()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
This handles the interface actions

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

run

public void run()
New query will be executed by a new thread.

Specified by:
run in interface java.lang.Runnable

querySubmitted

public void querySubmitted(java.lang.String query)