edu.northwestern.at.wordhoard.swing
Class AbstractWindow

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by edu.northwestern.at.utils.swing.WindowsMenuManager
                          extended by edu.northwestern.at.utils.swing.XFrame
                              extended by edu.northwestern.at.wordhoard.swing.AbstractWindow
All Implemented Interfaces:
PrintableContainer, AdjustAccountCommands, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants
Direct Known Subclasses:
AboutWindow, AnnotationWindow, FindWindow, FindWorkWindow, LemmaInfoWindow, LexiconWindow, ManageAccountsWindow, PosWindow, SysInfoWindow, TableOfContentsWindow, TConInfoWindow, WordClassWindow, WordHoardCalculatorWindow, WordHoardTabbedPaneWindow, WordInfoWindow

public abstract class AbstractWindow
extends XFrame
implements AdjustAccountCommands

An abstract base class for windows.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Nested classes/interfaces inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
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
protected  javax.swing.JMenuItem annotateCmd
           
protected  javax.swing.JMenuItem clearCmd
           
protected  javax.swing.JMenuItem copyCmd
           
protected  javax.swing.JMenuItem cutCmd
           
protected  javax.swing.JMenu editMenu
           
protected  javax.swing.JMenuItem newWorkSetCmd
           
protected  javax.swing.JMenuItem openWorkSetCmd
           
protected  AbstractWindow parentWindow
          The parent window, or null if none.
protected  javax.swing.JMenuItem pasteCmd
           
protected  javax.swing.JMenuItem saveAsCmd
           
protected  javax.swing.JMenuItem saveWordSetCmd
           
protected  javax.swing.JMenuItem saveWorkSetCmd
           
protected  javax.swing.JMenuItem selectAllCmd
           
protected  javax.swing.JMenuItem unselectCmd
           
protected  java.awt.event.WindowListener windowListener
           
 
Fields inherited from class edu.northwestern.at.utils.swing.XFrame
aboutBox, prefsWindow
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AbstractWindow(java.lang.String title, AbstractWindow parentWindow)
          Create a new abstract window.
 
Method Summary
 void about()
          Display "About" box.
 void adjustAccountCommands()
          Adjusts the account commands in this window.
protected  boolean clipboardHasPasteableData()
          Check if clipboard has pasteable data.
protected  void createWindowData()
          Create the actual window data.
 void dispose()
          Disposes the window.
 void enableAnnotateCmd(boolean enabled)
          Enables or disables the "Annotate" command.
 void enableCopyCmd(boolean enabled)
          Enables or disables the "Copy" commmand.
 void enableCutCmd(boolean enabled)
          Enables or disables the "Cut" commmand.
 void enableGetInfoCmd(boolean enabled)
          Enables or disables the "Get Info" command.
 void enableLineNumberCmds(boolean enabled)
          Enables or disables the line number commands.
 void enablePasteCmd(boolean enabled)
          Enables or disables the "Paste" commmand.
 void enableSelectAllCmd(boolean enabled)
          Enables or disables the "Select All" commmand.
 void enableShowHideAnnotationMarkersCmd(boolean enabled)
          Enables or disables the "Show/Hide Annotation Markers" command.
 void enableShowHideAnnotationPanelCmd(boolean enabled)
          Enables or disables the "Show/Hide Annotation Panel" command.
 void enableTranslationsCmd(boolean enabled)
          Enables or disables the "Translations, Transliterations, Etc" command.
protected  java.awt.Component findEditableComponent()
          Find an editable component.
protected  java.awt.Component findPrintableComponent()
          Find a printable component.
protected  SaveToFile findSaveableComponent()
          Find a saveable component.
protected  java.awt.Component findSelectableTextComponent()
          Find a component allowing text selection.
 Corpus getCorpus()
          Gets the corpus associated with this window.
 AbstractWindow getParentWindow()
          Gets the parent window.
 WorkPanel getWorkPanel()
          Gets the work panel associated with this window.
 void handleAboutCmd()
          Handles the "About" command.
 void handleAnnotateCmd()
          Handles the "Annotate" command.
 void handleClearCmd()
          Handles the "Clear" command.
 void handleCloseAllCmd()
          Handles the "Close All" command.
 void handleCloseCmd()
          Handles the "Close" command.
 void handleCopyCmd()
          Handles the "Copy" command.
 void handleCutCmd()
          Handles the "Cut" command.
 void handleEditMenuCanceledOrDeselected()
          Handles edit menu canceled or deselected.
 void handleEditMenuSelected()
          Handles edit menu selected.
 void handleEditorCmd()
          Handles the "Editor" command.
 void handleErrorCmd()
          Handles the "Send Error Report" command.
protected  void handleExportCmd()
          Handles "Export" command.
 void handleFileMenuSelected()
          Handles file menu selected.
 void handleFindWordsCmd()
          Handles the "Find Words" command.
 void handleFindWorksCmd()
          Handles the "Find Works" command.
 void handleFirstWindowActivation()
          Handles the first window activation event.
 void handleFontPrefsCmd()
          Handles the "Font Preferences" command.
 void handleGetInfoCmd()
          Handles the "Get Info" command.
 void handleGoToWordCmd(java.lang.String str)
          Handles the "Go To Word" command.
protected  void handleImportCmd()
          Handles "Import" command.
 void handleLastWindowClosed()
          Handles the last window closed.
 void handleLexiconCmd(Corpus corpus)
          Handles the lexicon commands.
 void handleLineNumberCmd(int n)
          Handles the line number commands.
 void handleLoginCmd()
          Handles the "Login" command.
 void handleLogoutCmd()
          Handles the "Logout" command.
 void handleManageAccountsCmd()
          Handles the "Manage Accounts" command.
 void handleNewWorkSetCmd()
          Handles "New Work Set" command.
 void handleOpenWorkSetCmd()
          Handles "Open Work Set" command.
 void handlePageSetupCmd()
          Handles "Page Setup" command.
 void handlePasteCmd()
          Handles the "Paste" command.
 void handlePosCmd()
          Handles the "Parts of Speech" command.
 void handlePrintCmd()
          Handles "Print" command.
 void handlePrintPreviewCmd()
          Handles "Print Preview" command.
 void handleQueryToolCmd()
          Handles the "Query Tool" command.
 void handleQuitCmd()
          Handles the "Quit" command.
 void handleRunScriptCmd()
          Handles the "Run Script" command.
 void handleSaveAsCmd()
          Handles "Save as" command.
 void handleSaveWordSetCmd()
          Handles "Save Word Set" command.
 void handleSaveWorkSetCmd()
          Handles "Save Work Set" command.
 void handleSelectAllCmd()
          Handles the "Select All" command.
 void handleShowHideAnnotationMarkersCmd()
          Handles the "Show/Hide Annotation Markers" command.
 void handleShowHideAnnotationPanelCmd()
          Handles the "Show/Hide Annotation Panel" command.
 void handleTConCmd()
          Handles the "Table of Contents" command.
 void handleTranslationsCmd()
          Handles the "Translations" command.
 void handleUnselectCmd()
          Handles the "Unselect" command.
 void handleWhCalcCmd()
          Handles the "WordHoard Calculator" command.
 void handleWordClassesCmd()
          Handles the "Word Classes" command.
 boolean isAnnotateAvailable()
          Determine is annotate menu item available.
 void positionNextTo(AbstractWindow parentWindow)
          Positions this window next to a parent window.
 void prefs()
          Route "prefs" to hamdleFontPrefs command.
 void quit()
          Quits the program.
 void removeTheWindowListener()
          Removes the window listener, is any.
 void sendErrorReport(Word word)
          Sends an error report.
 void setCorpus(Corpus corpus)
          Sets the corpus associated with this window.
 void setCutCopyPaste(CutCopyPaste copyable)
          Set menu status from a CutCopyPaste object.
 void setLoggedIn()
          Adjust menu items and settings for successful login.
 void setLoggedOut()
          Adjust menu items and settings for logout.
 void setNumberStanzas(boolean numberStanzas)
          Sets the number stanzas option.
 void setSelectAll(SelectAll selectAll)
          Set menu status from a SelectAll object.
 void setShowHideAnnotationMarkersCmdText(boolean markersShown)
          Sets the text of the "Show/Hide Annotation Markers" command.
 void setShowHideAnnotationPanelCmdText(boolean annotationsShown)
          Sets the text of the "Show/Hide Annotation Panel" command.
 
Methods inherited from class edu.northwestern.at.utils.swing.XFrame
common, doPageSetup, doPrint, doPrint, doPrint, doPrintPreview, doPrintPreview, doPrintPreview, pack, pack, setAboutBox, setDefaultImage, setPrefsWindow
 
Methods inherited from class edu.northwestern.at.utils.swing.WindowsMenuManager
getActiveWindow, getAllOpenWindows, getWindowsMenu, setJMenuBar, setTitle, setVisible, setWindowsMenu
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Field Detail

parentWindow

protected AbstractWindow parentWindow
The parent window, or null if none.


annotateCmd

protected javax.swing.JMenuItem annotateCmd

newWorkSetCmd

protected javax.swing.JMenuItem newWorkSetCmd

openWorkSetCmd

protected javax.swing.JMenuItem openWorkSetCmd

saveWorkSetCmd

protected javax.swing.JMenuItem saveWorkSetCmd

saveWordSetCmd

protected javax.swing.JMenuItem saveWordSetCmd

saveAsCmd

protected javax.swing.JMenuItem saveAsCmd

editMenu

protected javax.swing.JMenu editMenu

cutCmd

protected javax.swing.JMenuItem cutCmd

copyCmd

protected javax.swing.JMenuItem copyCmd

pasteCmd

protected javax.swing.JMenuItem pasteCmd

selectAllCmd

protected javax.swing.JMenuItem selectAllCmd

unselectCmd

protected javax.swing.JMenuItem unselectCmd

clearCmd

protected javax.swing.JMenuItem clearCmd

windowListener

protected java.awt.event.WindowListener windowListener
Constructor Detail

AbstractWindow

public AbstractWindow(java.lang.String title,
                      AbstractWindow parentWindow)
               throws PersistenceException
Create a new abstract window.

Parameters:
title - The window title.
parentWindow - The parent window, or null if none.
Throws:
PersistenceException
Method Detail

createWindowData

protected void createWindowData()
                         throws PersistenceException
Create the actual window data.

Throws:
PersistenceException

getParentWindow

public AbstractWindow getParentWindow()
Gets the parent window.

Returns:
The parent window, or null if none.

removeTheWindowListener

public void removeTheWindowListener()
Removes the window listener, is any.


getCorpus

public Corpus getCorpus()
Gets the corpus associated with this window.

Returns:
The corpus associated with this window, or null if none.

setCorpus

public void setCorpus(Corpus corpus)
Sets the corpus associated with this window.

Parameters:
corpus - The corpus associated with this window, or null if none.

getWorkPanel

public WorkPanel getWorkPanel()
Gets the work panel associated with this window.

Subclasses which contain a work panel should override this method to return the work panel. The default return value is null.

Returns:
The work panel, or null if none.

handleFirstWindowActivation

public void handleFirstWindowActivation()
Handles the first window activation event.

Subclasses may override this method to request focus or take other initialization actions when a window is first created and activated. The default action is to do nothing.


handleLastWindowClosed

public void handleLastWindowClosed()
Handles the last window closed.

When the last window is closed we quit the program.

Overrides:
handleLastWindowClosed in class WindowsMenuManager

handleAboutCmd

public void handleAboutCmd()
                    throws java.lang.Exception
Handles the "About" command.

Throws:
java.lang.Exception

about

public void about()
Display "About" box.

Overrides:
about in class XFrame

handleFontPrefsCmd

public void handleFontPrefsCmd()
                        throws java.lang.Exception
Handles the "Font Preferences" command.

Throws:
java.lang.Exception

prefs

public void prefs()
Route "prefs" to hamdleFontPrefs command.

Overrides:
prefs in class XFrame
Throws:
java.lang.Exception

sendErrorReport

public void sendErrorReport(Word word)
                     throws java.lang.Exception
Sends an error report.

Parameters:
word - Word, or null if none.
Throws:
java.lang.Exception

handleErrorCmd

public void handleErrorCmd()
                    throws java.lang.Exception
Handles the "Send Error Report" command.

Throws:
java.lang.Exception

handleGetInfoCmd

public void handleGetInfoCmd()
                      throws java.lang.Exception
Handles the "Get Info" command.

Subclasses may override this method to handle the "Get Info" command. The default action is to do nothing.

Throws:
java.lang.Exception

handleAnnotateCmd

public void handleAnnotateCmd()
                       throws java.lang.Exception
Handles the "Annotate" command.

Subclasses may override this method to handle the "Annotate" command. The default action is to do nothing.

Throws:
java.lang.Exception

handleTConCmd

public void handleTConCmd()
                   throws java.lang.Exception
Handles the "Table of Contents" command.

Throws:
java.lang.Exception

handleWordClassesCmd

public void handleWordClassesCmd()
                          throws java.lang.Exception
Handles the "Word Classes" command.

Throws:
java.lang.Exception

handleWhCalcCmd

public void handleWhCalcCmd()
                     throws java.lang.Exception
Handles the "WordHoard Calculator" command.

Throws:
java.lang.Exception

handlePosCmd

public void handlePosCmd()
                  throws java.lang.Exception
Handles the "Parts of Speech" command.

Throws:
java.lang.Exception

handleLoginCmd

public void handleLoginCmd()
Handles the "Login" command.


handleLogoutCmd

public void handleLogoutCmd()
Handles the "Logout" command.


handleEditorCmd

public void handleEditorCmd()
Handles the "Editor" command.


handleRunScriptCmd

public void handleRunScriptCmd()
Handles the "Run Script" command.


handleManageAccountsCmd

public void handleManageAccountsCmd()
                             throws java.lang.Exception
Handles the "Manage Accounts" command.

Throws:
java.lang.Exception

adjustAccountCommands

public void adjustAccountCommands()
Adjusts the account commands in this window.

Enables/disables the "Logout", "Manage Account", and "Annotate" commands and adjusts the text of the "Logout" command to read "Logout xxx" when the user is logged in with username "xxx". Also sets the availability of the Query and Sets menus, and the Export and Import commands of the File menu.

Specified by:
adjustAccountCommands in interface AdjustAccountCommands

handleQuitCmd

public void handleQuitCmd()
Handles the "Quit" command.


quit

public void quit()
Quits the program.

Overrides:
quit in class XFrame

handleFileMenuSelected

public void handleFileMenuSelected()
                            throws java.lang.Exception
Handles file menu selected.

Throws:
java.lang.Exception

handleNewWorkSetCmd

public void handleNewWorkSetCmd()
Handles "New Work Set" command.


handleOpenWorkSetCmd

public void handleOpenWorkSetCmd()
Handles "Open Work Set" command.


handleSaveWorkSetCmd

public void handleSaveWorkSetCmd()
Handles "Save Work Set" command.


handleSaveWordSetCmd

public void handleSaveWordSetCmd()
Handles "Save Word Set" command.


handleSaveAsCmd

public void handleSaveAsCmd()
Handles "Save as" command.


handlePageSetupCmd

public void handlePageSetupCmd()
Handles "Page Setup" command.


handlePrintPreviewCmd

public void handlePrintPreviewCmd()
Handles "Print Preview" command.


handlePrintCmd

public void handlePrintCmd()
Handles "Print" command.


findPrintableComponent

protected java.awt.Component findPrintableComponent()
Find a printable component.

Returns:
A printable component.

findSaveableComponent

protected SaveToFile findSaveableComponent()
Find a saveable component.

Returns:
A saveable component. Null=none by default.

findEditableComponent

protected java.awt.Component findEditableComponent()
Find an editable component.

Returns:
An editable component.

findSelectableTextComponent

protected java.awt.Component findSelectableTextComponent()
Find a component allowing text selection.

Returns:
A component allowing text selection.

handleExportCmd

protected void handleExportCmd()
Handles "Export" command.


handleImportCmd

protected void handleImportCmd()
Handles "Import" command.


handleEditMenuSelected

public void handleEditMenuSelected()
                            throws java.lang.Exception
Handles edit menu selected.

The default is to enable and disable the commands in the edit menu appropriately for a window which contains text components. If there is no currently focused text component, we look for a focused component that implements the CutCopyPaste and/or SelectAll interfaces. If neither is found, all commands are disabled. Otherwise, cut and copy are enabled iff the selection is not empty, paste is enabled if the system clipboard contains a non-empty text string, and select all is enabled if the text or editable component is not empty.

Subclasses which handle transfereable data other than text in text components should override this method.

Throws:
java.lang.Exception

handleEditMenuCanceledOrDeselected

public void handleEditMenuCanceledOrDeselected()
Handles edit menu canceled or deselected.

When the Edit menu is canceled or deselected, we reenable all the commands so that the command key shortcuts will still work.


handleCutCmd

public void handleCutCmd()
                  throws java.lang.Exception
Handles the "Cut" command.

The default is to cut the selected text from the currently focused editable component, if any.

Subclasses which can cut transfereable data other than text in text components should override this method.

Throws:
java.lang.Exception

handleCopyCmd

public void handleCopyCmd()
                   throws java.lang.Exception
Handles the "Copy" command.

The default is to copy the selected text from the currently focused editable component, if any

Subclasses which can copy transfereable data other than text in text components should override this method.

Throws:
java.lang.Exception

handlePasteCmd

public void handlePasteCmd()
                    throws java.lang.Exception
Handles the "Paste" command.

The default is to paste the system clipboard text into the currently focused editable component, if any.

Subclasses which can paste transfereable data other than text into text components should override this method.

Throws:
java.lang.Exception

handleSelectAllCmd

public void handleSelectAllCmd()
                        throws java.lang.Exception
Handles the "Select All" command.

The default is to select all of the text in the currently focused editable component, if any.

Subclasses which select data other than text should override this method.

Throws:
java.lang.Exception

handleUnselectCmd

public void handleUnselectCmd()
                       throws java.lang.Exception
Handles the "Unselect" command.

The default is to unselect any selected text in the currently focused editable component, if any.

Subclasses which select data other than text should override this method.

Throws:
java.lang.Exception

handleClearCmd

public void handleClearCmd()
                    throws java.lang.Exception
Handles the "Clear" command.

The default is to do nothing. A window may choose to clear its display in response to this command.

Throws:
java.lang.Exception

handleGoToWordCmd

public void handleGoToWordCmd(java.lang.String str)
                       throws java.lang.Exception
Handles the "Go To Word" command.

Parameters:
str - Initial word tag string for dialog field, or null if none.
Throws:
java.lang.Exception

handleFindWordsCmd

public void handleFindWordsCmd()
                        throws java.lang.Exception
Handles the "Find Words" command.

Throws:
java.lang.Exception

handleFindWorksCmd

public void handleFindWorksCmd()
                        throws java.lang.Exception
Handles the "Find Works" command.

Throws:
java.lang.Exception

handleQueryToolCmd

public void handleQueryToolCmd()
                        throws java.lang.Exception
Handles the "Query Tool" command.

Throws:
java.lang.Exception

handleLineNumberCmd

public void handleLineNumberCmd(int n)
                         throws java.lang.Exception
Handles the line number commands.

Subclasses may override this method to handle the line number commands. The default action is to do nothing.

Parameters:
n - 0 for no line numbers, 1 to number every line, or 5 to number every fifth line.
Throws:
java.lang.Exception

handleTranslationsCmd

public void handleTranslationsCmd()
                           throws java.lang.Exception
Handles the "Translations" command.

Subclasses may override this method to handle the "Translations" command. The default action is to do nothing.

Throws:
java.lang.Exception

handleShowHideAnnotationMarkersCmd

public void handleShowHideAnnotationMarkersCmd()
                                        throws java.lang.Exception
Handles the "Show/Hide Annotation Markers" command.

Subclasses may override this method to handle the "Show/Hide Annotation Markers" command. The default action is to do nothing.

Throws:
java.lang.Exception

handleShowHideAnnotationPanelCmd

public void handleShowHideAnnotationPanelCmd()
                                      throws java.lang.Exception
Handles the "Show/Hide Annotation Panel" command.

Subclasses may override this method to handle the "Show/Hide Annotation Panel" command. The default action is to do nothing.

Throws:
java.lang.Exception

handleLexiconCmd

public void handleLexiconCmd(Corpus corpus)
                      throws java.lang.Exception
Handles the lexicon commands.

Parameters:
corpus - The corpus.
Throws:
java.lang.Exception

handleCloseCmd

public void handleCloseCmd()
                    throws java.lang.Exception
Handles the "Close" command.

Throws:
java.lang.Exception

handleCloseAllCmd

public void handleCloseAllCmd()
                       throws java.lang.Exception
Handles the "Close All" command.

Throws:
java.lang.Exception

enableGetInfoCmd

public void enableGetInfoCmd(boolean enabled)
Enables or disables the "Get Info" command.

Parameters:
enabled - True to enable, false to disable.

enableAnnotateCmd

public void enableAnnotateCmd(boolean enabled)
Enables or disables the "Annotate" command.

Parameters:
enabled - True to enable, false to disable.

enableCutCmd

public void enableCutCmd(boolean enabled)
Enables or disables the "Cut" commmand.

Parameters:
enabled - True to enable, false to disable.

enableCopyCmd

public void enableCopyCmd(boolean enabled)
Enables or disables the "Copy" commmand.

Parameters:
enabled - True to enable, false to disable.

enablePasteCmd

public void enablePasteCmd(boolean enabled)
Enables or disables the "Paste" commmand.

Parameters:
enabled - True to enable, false to disable.

enableSelectAllCmd

public void enableSelectAllCmd(boolean enabled)
Enables or disables the "Select All" commmand.

Parameters:
enabled - True to enable, false to disable.

enableLineNumberCmds

public void enableLineNumberCmds(boolean enabled)
Enables or disables the line number commands.

Parameters:
enabled - True to enable, false to disable.

enableTranslationsCmd

public void enableTranslationsCmd(boolean enabled)
Enables or disables the "Translations, Transliterations, Etc" command.

Parameters:
enabled - True to enable, false to disable.

enableShowHideAnnotationMarkersCmd

public void enableShowHideAnnotationMarkersCmd(boolean enabled)
Enables or disables the "Show/Hide Annotation Markers" command.

Parameters:
enabled - True to enable, false to disable.

setShowHideAnnotationMarkersCmdText

public void setShowHideAnnotationMarkersCmdText(boolean markersShown)
Sets the text of the "Show/Hide Annotation Markers" command.

Parameters:
markersShown - True if markers shown, in which case the command text is set to "Hide Annotation Markers". False if markers not shown, in which case the command text is set to "Show Annotation Markers".

enableShowHideAnnotationPanelCmd

public void enableShowHideAnnotationPanelCmd(boolean enabled)
Enables or disables the "Show/Hide Annotation Panel" command.

Parameters:
enabled - True to enable, false to disable.

setShowHideAnnotationPanelCmdText

public void setShowHideAnnotationPanelCmdText(boolean annotationsShown)
Sets the text of the "Show/Hide Annotation Panel" command.

Parameters:
annotationsShown - True if annotations shown, in which case the command text is set to "Hide Annotation Panel". False if annotations not shown, in which case the command text is set to "Show Annotation Panel".

setNumberStanzas

public void setNumberStanzas(boolean numberStanzas)
Sets the number stanzas option.

When the number stanzas option is set, the Views menu item reads "Number Stanzas". Otherwise, it reads "Number Every Fifth Line".

Parameters:
numberStanzas - True to number stanzas.

positionNextTo

public void positionNextTo(AbstractWindow parentWindow)
Positions this window next to a parent window.

Parameters:
parentWindow - Parent window.

clipboardHasPasteableData

protected boolean clipboardHasPasteableData()
Check if clipboard has pasteable data.

Returns:
true if clipboard has pasteable text.

setCutCopyPaste

public void setCutCopyPaste(CutCopyPaste copyable)
Set menu status from a CutCopyPaste object.

Parameters:
copyable - Object implementing the CutCopyPaste interface.

On output, sets the status of the Cut, Copy, and Paste menu items to reflect the status of the cutCopyPaste object.


setSelectAll

public void setSelectAll(SelectAll selectAll)
Set menu status from a SelectAll object.

Parameters:
selectAll - Object implementing the SelectAll interface.

On output, sets the status of the Select All and Unselect menu items to reflect the status of the SelectAll object.


isAnnotateAvailable

public boolean isAnnotateAvailable()
Determine is annotate menu item available.

Returns:
true if annotate menu item available.

Always returns false unless overridden in subclass.


setLoggedIn

public void setLoggedIn()
Adjust menu items and settings for successful login.


setLoggedOut

public void setLoggedOut()
Adjust menu items and settings for logout.


dispose

public void dispose()
Disposes the window.

If the last window open is a hidden Calculator window, call handleLastWindowClosed to exit WordHoard.

Overrides:
dispose in class WindowsMenuManager