|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
lemurproject.indri.ui.RetUI
public class RetUI
User interface for indri retrieval.
Nested Class Summary | |
---|---|
private class |
RetUI.DocTableListener
Listener on the retrieved documents table that enables populating the document text frame with the selection of a document. |
private class |
RetUI.QueryTreeListener
Listener for the query tree to update highlighting when the query node selection changes. |
private class |
RetUI.UIQueryNode
Adapter for QueryAnnotationNode for populating the query tree display. |
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private static java.lang.String |
aboutText
About the GUI. |
(package private) java.lang.String |
acroreadProg
external viewers Acrobat.exe or AcroRd32.exe |
(package private) java.util.Map |
annotations
Map containing query annotations for highlighting. |
(package private) javax.swing.JTable |
answerAll
Retrieved documents table |
private boolean |
blinking
Semaphore for the blinker thread |
(package private) int |
currentDoc
Index into result holders for the current document |
(package private) int |
currentDocId
Result holder for currently selected document id |
(package private) ParsedDocument |
currentParsedDoc
Result holder for parsed documents |
private static java.awt.Cursor |
def
cursors |
(package private) javax.swing.JFrame |
docHtmlFrame
Frame for showing document html document |
(package private) javax.swing.JTextPane |
docHtmlPane
Document html pane. |
(package private) int[] |
docids
Result holder for document internal ids |
(package private) javax.swing.JTree |
docQueryTree
Query tree display |
(package private) javax.swing.JFrame |
docTextFrame
Frame for showing document text and query tree. |
(package private) javax.swing.JTextPane |
docTextPane
Document text pane. |
private javax.swing.JList |
documents
Enable multiple indexes |
private javax.swing.DefaultListModel |
documentsModel
hold the file names |
(package private) QueryEnvironment |
env
Indri query environment for retrieval. |
(package private) boolean |
envInit
Flag for whether or not the query environment has been initialized. |
private javax.swing.JFileChooser |
fc
File chooser starting in current directory |
(package private) java.lang.Thread |
getDocHtmlThread
getDocHtml Thread |
(package private) java.lang.Thread |
getDocTextThread
getDocText Thread |
(package private) javax.swing.JButton |
go
Search and Clear buttons |
private static java.lang.String |
helpFile
Help file for the application |
private javax.swing.JFrame |
helpFrame
Frame for help window |
private static java.lang.String |
iconFile
Little lemur icon |
private javax.swing.JList |
indexes
Enable multiple indexes |
private javax.swing.DefaultListModel |
indexesModel
hold the file names |
private static java.awt.Color |
lightYellow
colors |
private static java.awt.Color |
linen
colors |
(package private) int |
maxDocs
Maximum number of documents to retrieve for a query |
(package private) java.lang.String[] |
names
Result holder for document external ids |
private static java.awt.Color |
navyBlue
colors |
(package private) javax.swing.JTextField |
numDocs
Number of documents to retrieve input |
(package private) java.lang.String |
powerpointProg
external viewers Powerpnt.exe |
(package private) javax.swing.JLabel |
progress
Progress indicator output |
(package private) javax.swing.JTextField |
query
Query input |
(package private) QueryAnnotation |
results
Result holder for query retrieval. |
(package private) java.lang.Thread |
runQuestionThread
runQuestion Thread |
(package private) ScoredExtentResult[] |
scored
Result holder for document scored extents |
(package private) javax.swing.JButton |
scoreDisplay
Search and Clear buttons |
(package private) boolean |
showScores
Are we showing scores? |
(package private) javax.swing.JLabel |
status
Status line output |
(package private) javax.swing.JButton |
stop
Search and Clear buttons |
(package private) java.lang.String[] |
titles
Result holder for document titles |
private static java.awt.Cursor |
wait
cursors |
(package private) java.lang.String |
wordProg
external viewers Word.exe |
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 | |
---|---|
RetUI()
Initialize the query environment and indexes model. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
altgetDocText()
Populate the document text frame with the selected document. |
private java.lang.Thread |
blinker(java.lang.String s1,
java.lang.String s2)
Blink a pair of messages on the status line |
private void |
clearAll()
Clear everything |
private void |
clearHighlight(javax.swing.text.StyledDocument myDoc,
javax.swing.text.MutableAttributeSet highlight)
Clear all highlighting markup in a styled document. |
private static void |
createAndShowGUI()
Make the containing frame, menubar, and an instance of RetUI. |
protected static javax.swing.ImageIcon |
createImageIcon(java.lang.String path)
Returns an ImageIcon, or null if the path was invalid. |
void |
error(java.lang.String s)
Display an error message in the progress label. |
void |
getDocHtml()
Populate a document text frame with html -- no highlighting. |
void |
getDocText()
|
private void |
highlight(javax.swing.tree.DefaultMutableTreeNode query)
Insert highlighting markup into a styled document, starting from the given node of the query tree. |
private void |
highlight(RetUI.UIQueryNode q,
javax.swing.text.StyledDocument myDoc,
javax.swing.text.MutableAttributeSet highlight)
Highlight the current document in the document text pane with respect to the given query node. |
void |
init()
Create the gui elements, including the help frame. |
static void |
main(java.lang.String[] args)
Fire it up. |
private javax.swing.tree.DefaultMutableTreeNode |
makeChildNode(QueryAnnotationNode query)
Make a DefaultMutableTreeNode out of a QueryAnnotationNode. |
private void |
makeDocHtmlFrame()
Make the frame for displaying html documents |
private javax.swing.JTable |
makeDocsTable()
Make a JTable and associated DocsTableModel for containing query result sets. |
private void |
makeDocTextFrame()
Make the frame for displaying highlighted retrieved documents with both document text and the query tree. |
private void |
makeHelp()
Create the frame that shows the help file and render the html. |
private javax.swing.JMenuItem |
makeMenuItem(java.lang.String label)
Make a menu item with appropriate colors and this as its listener. |
private javax.swing.tree.DefaultTreeModel |
makeTreeModel(QueryAnnotationNode query)
Create a TreeModel from a QueryAnnotationNode. |
void |
openIndex()
Present a file chooser to select an index to open. |
void |
openServer()
Present an input dialog to obtain a hostname and optional port number. |
void |
removeIndex()
Remove the selected index from the list. |
void |
runQuestion()
Run the given query in a separate thread. |
private void |
setPaths()
Set the paths to the external viewer programs |
private void |
spawnViewer()
Spawn an external viewer for pdf, doc, or ppt (Win only) |
private java.lang.String |
trim(java.lang.String s)
Strip leading pathname, if any. |
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, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, 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 |
---|
private final javax.swing.JFileChooser fc
private static final java.lang.String aboutText
private static final java.lang.String helpFile
private static final java.lang.String iconFile
private javax.swing.JFrame helpFrame
javax.swing.JButton go
javax.swing.JButton stop
javax.swing.JButton scoreDisplay
javax.swing.JLabel status
javax.swing.JLabel progress
javax.swing.JTextField query
javax.swing.JTextField numDocs
javax.swing.JTable answerAll
javax.swing.JFrame docTextFrame
javax.swing.JTextPane docTextPane
javax.swing.JFrame docHtmlFrame
javax.swing.JTextPane docHtmlPane
javax.swing.JTree docQueryTree
QueryEnvironment env
java.util.Map annotations
QueryAnnotation results
ScoredExtentResult[] scored
ParsedDocument currentParsedDoc
int currentDocId
java.lang.String[] names
java.lang.String[] titles
int[] docids
int currentDoc
int maxDocs
boolean envInit
private javax.swing.JList documents
private javax.swing.DefaultListModel documentsModel
private javax.swing.JList indexes
private javax.swing.DefaultListModel indexesModel
private static final java.awt.Color lightYellow
private static final java.awt.Color navyBlue
private static final java.awt.Color linen
private static java.awt.Cursor wait
private static java.awt.Cursor def
java.lang.String wordProg
java.lang.String powerpointProg
java.lang.String acroreadProg
boolean showScores
volatile java.lang.Thread getDocTextThread
volatile java.lang.Thread getDocHtmlThread
volatile java.lang.Thread runQuestionThread
private volatile boolean blinking
Constructor Detail |
---|
public RetUI()
Method Detail |
---|
public void init()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
private void clearAll()
public void removeIndex()
public void openIndex()
public void openServer()
public void runQuestion()
private void setPaths()
private void makeHelp()
private void makeDocTextFrame()
private void makeDocHtmlFrame()
private void spawnViewer()
public void altgetDocText()
public void getDocText()
public void getDocHtml()
private void highlight(javax.swing.tree.DefaultMutableTreeNode query) throws java.lang.InterruptedException
query
- The query tree node to highlight
java.lang.InterruptedException
private void clearHighlight(javax.swing.text.StyledDocument myDoc, javax.swing.text.MutableAttributeSet highlight)
myDoc
- The StyledDocument to highlighthighlight
- The highlighting attributesprivate void highlight(RetUI.UIQueryNode q, javax.swing.text.StyledDocument myDoc, javax.swing.text.MutableAttributeSet highlight) throws java.lang.InterruptedException
q
- The query node to highlight extents formyDoc
- The StyledDocument to highlighthighlight
- The highlighting attributes
java.lang.InterruptedException
private javax.swing.tree.DefaultTreeModel makeTreeModel(QueryAnnotationNode query)
query
- The QueryAnnotationNode to use as the root of the tree
query
private javax.swing.tree.DefaultMutableTreeNode makeChildNode(QueryAnnotationNode query)
query
- The QueryAnnotationNode to insert into the tree.
private java.lang.Thread blinker(java.lang.String s1, java.lang.String s2)
s1
- The first message to displays2
- The second message to display
public void error(java.lang.String s)
s
- The error message to display.private java.lang.String trim(java.lang.String s)
private javax.swing.JTable makeDocsTable()
private javax.swing.JMenuItem makeMenuItem(java.lang.String label)
this as its listener.
- Parameters:
label
- The label for the menu item
- Returns:
- The menu item
protected static javax.swing.ImageIcon createImageIcon(java.lang.String path)
path
- the image file to load.
private static void createAndShowGUI()
public static void main(java.lang.String[] args)
args
- ignored
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |