edu.princeton.wordnet.browser
Class UI

java.lang.Object
  extended by edu.princeton.wordnet.browser.Controller
      extended by edu.princeton.wordnet.browser.UI
All Implemented Interfaces:
LookerUp

public class UI
extends Controller

Browser main frame

Author:
Bernard Bou

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.princeton.wordnet.browser.Controller
Controller.Code
 
Field Summary
private  javax.swing.event.HyperlinkListener hyperlinkPressed
           
private static org.apache.log4j.Logger LOG
           
private static long serialVersionUID
           
private  SmartCheckBoxMenuItem theConsoleMenuItem
          Smart button
private  javax.swing.JComboBox theEditor
          Editor
private  java.awt.Component theHome
          Home component
private  javax.swing.JLabel theIconStatus
          Status icon container
private  javax.swing.JFrame theMainFrame
           
private  javax.swing.JProgressBar theProgress
          Progress
private  javax.swing.JLabel theStatus
          Status
private  javax.swing.JTabbedPane theTabbedPane
          Tabbed pane
 
Fields inherited from class edu.princeton.wordnet.browser.Controller
theSettings
 
Constructor Summary
UI(java.lang.String[] theseArgs)
          Constructor
 
Method Summary
protected  void addHistory(java.lang.String thisLookup)
          Add lookup to history
protected  boolean confirm(java.lang.String[] thisMessage)
          Confirm
protected  java.beans.PropertyChangeListener getConsolePropertyListener()
          Get console property listener
protected  java.lang.String getLookup()
          Get lookup
protected  TreeView getTreeView()
          Get selected treeview
protected  java.util.List<TreeView> getTreeViews()
          Get tree views
protected  void handlePopup(java.awt.event.MouseEvent e, java.awt.event.ActionListener thisPopupActionListener)
          Handle popup trigger
protected  void internalHelp()
          Help as tab
private  java.awt.Component makeBrowserPane(java.net.URL thisUrl)
          Make HTML pane
private  javax.swing.JButton makeButton(java.lang.String thisText, java.lang.String thisTooltip, java.lang.String thisImage, Controller.Code thisCode)
          Make button
private  SmartCheckBoxMenuItem makeCheckboxItem(java.lang.String thisText, java.lang.String thisImage, Controller.Code thisCommand, int thisAcceleratorKey, java.lang.String thisProperty, boolean thisState)
          Make checkbox menu item
private  java.awt.Component makeHome()
          Make home pane
protected  HtmlView makeHtmlView(java.lang.String thisLookup, java.lang.String thisTooltip)
          Make Html view
private  javax.swing.JMenuBar makeMenuBar()
          Make menu bar
private  javax.swing.JMenuItem makeMenuItem(java.lang.String thisText, java.lang.String thisImage, Controller.Code thisCommand, int thisAcceleratorKey)
          Make menu item
protected  javax.swing.JPopupMenu makePopup(java.awt.event.ActionListener thisPopupActionListener)
          Make popup
private  java.awt.Component makeStatusbar(java.awt.Component thisEastComponent, java.awt.Component thisCenterComponent, java.awt.Component thisWestComponent)
          Make status bar
private  void makeTab(java.awt.Component thisComponent, java.lang.String thisTitle, java.lang.String thisToolTip)
          Make tabbed component
protected  void makeTextView(java.lang.String thisLookup, java.lang.String thisTooltip, java.lang.String thisText)
          Make text view
private  javax.swing.JToolBar makeToolbar()
          Make toolbar
protected  void makeTreeView(TreeView thisTreeView, java.lang.String thisLookup, java.lang.String thisTooltip, javax.swing.tree.TreeModel thisTreeModel)
          Make tree view
protected  void quit()
          Quit
protected  void reportClientError(java.lang.Throwable thisThrowable)
          Report Client Error
protected  void reportException(java.lang.Exception thisException)
          Report Exception
protected  void setConnected(boolean connected)
          Set status connected
protected  void setSearching(boolean searching)
          Set status searching
protected  void setStatus(java.lang.String thisMessage)
          Set status
 
Methods inherited from class edu.princeton.wordnet.browser.Controller
execute, lookup, lookup, lookupXml, lookupXmlRaw, mangle, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

LOG

private static final org.apache.log4j.Logger LOG

theMainFrame

private final javax.swing.JFrame theMainFrame

theTabbedPane

private javax.swing.JTabbedPane theTabbedPane
Tabbed pane


theEditor

private javax.swing.JComboBox theEditor
Editor


theStatus

private final javax.swing.JLabel theStatus
Status


theIconStatus

private final javax.swing.JLabel theIconStatus
Status icon container


theProgress

private final javax.swing.JProgressBar theProgress
Progress


theHome

private final java.awt.Component theHome
Home component


theConsoleMenuItem

private SmartCheckBoxMenuItem theConsoleMenuItem
Smart button


hyperlinkPressed

private final javax.swing.event.HyperlinkListener hyperlinkPressed
Constructor Detail

UI

public UI(java.lang.String[] theseArgs)
   throws java.io.IOException
Constructor

Parameters:
theseArgs - command line arguments
Throws:
java.io.IOException
Method Detail

makeHome

private java.awt.Component makeHome()
Make home pane


makeToolbar

private javax.swing.JToolBar makeToolbar()
Make toolbar


makeButton

private javax.swing.JButton makeButton(java.lang.String thisText,
                                       java.lang.String thisTooltip,
                                       java.lang.String thisImage,
                                       Controller.Code thisCode)
Make button

Parameters:
thisText - text
thisTooltip - tooltip
thisImage - image
thisCode - exceution code
Returns:
theButton

makeStatusbar

private java.awt.Component makeStatusbar(java.awt.Component thisEastComponent,
                                         java.awt.Component thisCenterComponent,
                                         java.awt.Component thisWestComponent)
Make status bar

Parameters:
thisEastComponent - east component
thisCenterComponent - center component
thisWestComponent - west component
Returns:
status bar

makeMenuBar

private javax.swing.JMenuBar makeMenuBar()
Make menu bar

Returns:
menu bar

makeMenuItem

private javax.swing.JMenuItem makeMenuItem(java.lang.String thisText,
                                           java.lang.String thisImage,
                                           Controller.Code thisCommand,
                                           int thisAcceleratorKey)
Make menu item

Parameters:
thisText - text
thisImage - image
thisCommand - command code
thisAcceleratorKey - accelerator key
Returns:
menu item

makeCheckboxItem

private SmartCheckBoxMenuItem makeCheckboxItem(java.lang.String thisText,
                                               java.lang.String thisImage,
                                               Controller.Code thisCommand,
                                               int thisAcceleratorKey,
                                               java.lang.String thisProperty,
                                               boolean thisState)
Make checkbox menu item

Parameters:
thisText - text
thisImage - image
thisCommand - command code
thisAcceleratorKey - accelerator key
thisState - initial state
Returns:
menu item

makeBrowserPane

private java.awt.Component makeBrowserPane(java.net.URL thisUrl)
Make HTML pane


makeTab

private void makeTab(java.awt.Component thisComponent,
                     java.lang.String thisTitle,
                     java.lang.String thisToolTip)
Make tabbed component

Parameters:
thisComponent -
thisTitle -
thisToolTip -

handlePopup

protected void handlePopup(java.awt.event.MouseEvent e,
                           java.awt.event.ActionListener thisPopupActionListener)
Handle popup trigger

Parameters:
e - mouse event
thisPopupActionListener - popup action listener

makePopup

protected javax.swing.JPopupMenu makePopup(java.awt.event.ActionListener thisPopupActionListener)
Make popup

Parameters:
thisPopupActionListener - popup action listener
Returns:
popup

makeTextView

protected void makeTextView(java.lang.String thisLookup,
                            java.lang.String thisTooltip,
                            java.lang.String thisText)
Description copied from class: Controller
Make text view

Specified by:
makeTextView in class Controller
Parameters:
thisLookup - title
thisTooltip - tooltip
thisText - text

makeHtmlView

protected HtmlView makeHtmlView(java.lang.String thisLookup,
                                java.lang.String thisTooltip)
Description copied from class: Controller
Make Html view

Specified by:
makeHtmlView in class Controller
Parameters:
thisLookup - title
thisTooltip - tooltip

makeTreeView

protected void makeTreeView(TreeView thisTreeView,
                            java.lang.String thisLookup,
                            java.lang.String thisTooltip,
                            javax.swing.tree.TreeModel thisTreeModel)
Description copied from class: Controller
Make tree view

Specified by:
makeTreeView in class Controller
Parameters:
thisTreeView - treeview
thisLookup - title
thisTooltip - tooltip
thisTreeModel - treemodel

confirm

protected boolean confirm(java.lang.String[] thisMessage)
Description copied from class: Controller
Confirm

Specified by:
confirm in class Controller
Parameters:
thisMessage - message
Returns:
true if confirmed

reportClientError

protected void reportClientError(java.lang.Throwable thisThrowable)
Description copied from class: Controller
Report Client Error

Specified by:
reportClientError in class Controller
Parameters:
thisThrowable - Throwable

reportException

protected void reportException(java.lang.Exception thisException)
Description copied from class: Controller
Report Exception

Specified by:
reportException in class Controller
Parameters:
thisException - Exception

internalHelp

protected void internalHelp()
Help as tab

Specified by:
internalHelp in class Controller

getLookup

protected java.lang.String getLookup()
Description copied from class: Controller
Get lookup

Specified by:
getLookup in class Controller
Returns:
lookup string

addHistory

protected void addHistory(java.lang.String thisLookup)
Description copied from class: Controller
Add lookup to history

Specified by:
addHistory in class Controller

getTreeView

protected TreeView getTreeView()
Description copied from class: Controller
Get selected treeview

Specified by:
getTreeView in class Controller
Returns:
selected treeview or null

getTreeViews

protected java.util.List<TreeView> getTreeViews()
Description copied from class: Controller
Get tree views

Specified by:
getTreeViews in class Controller
Returns:
list of tree view

setSearching

protected void setSearching(boolean searching)
Description copied from class: Controller
Set status searching

Specified by:
setSearching in class Controller
Parameters:
searching - whether client is searching

setStatus

protected void setStatus(java.lang.String thisMessage)
Description copied from class: Controller
Set status

Specified by:
setStatus in class Controller
Parameters:
thisMessage - message

setConnected

protected void setConnected(boolean connected)
Description copied from class: Controller
Set status connected

Specified by:
setConnected in class Controller
Parameters:
connected - whether client is connected

quit

protected void quit()
Description copied from class: Controller
Quit

Specified by:
quit in class Controller

getConsolePropertyListener

protected java.beans.PropertyChangeListener getConsolePropertyListener()
Description copied from class: Controller
Get console property listener

Specified by:
getConsolePropertyListener in class Controller