|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame edu.northwestern.at.utils.swing.WindowsMenuManager edu.northwestern.at.utils.swing.XFrame edu.northwestern.at.wordhoard.swing.AbstractWindow edu.northwestern.at.wordhoard.swing.calculator.WordHoardCalculatorWindow
public class WordHoardCalculatorWindow
Main WordHoard calculator window.
The WordHoard calculator window is a singleton. Only one may be open at any time.
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 AnalysisMenu |
analysisMenu
The analysis menu. |
protected javax.swing.JMenu |
authorMenu
The author menu. |
static WordHoardCalculatorWindow |
calculatorWindow
The singleton WordHoard Calculator window. |
protected static bsh.util.JConsole |
console
The console input/output area for the interpreter. |
protected CalculatorEditMenu |
editMenu
The edit menu. |
protected FileMenu |
fileMenu
The file menu. |
protected FindMenu |
findMenu
The find menu. |
protected HelpMenu |
helpMenu
The help menu. |
protected static javax.swing.JTextPane |
inputTextPane
The hidden text pane in the console. |
protected static bsh.Interpreter |
interpreter
The script interpreter. |
protected boolean |
loginSucceeded
True if login succeeded. |
protected WordHoardTabbedPane |
mainTabbedPane
The main tabbed panel |
protected javax.swing.JMenuBar |
menuBar
The menu bar. |
protected int |
outputResultsNumber
Last output panel number. |
protected java.lang.String |
programBanner
Program banner. |
protected java.lang.String |
programPrompt
Program prompt. |
protected java.lang.String |
programVersion
Program version. |
protected SetsMenu |
setsMenu
The sets menu. |
protected ViewsMenu |
viewsMenu
The views menu. |
protected WindowsMenu |
windowsMenu
The windows menu. |
Fields inherited from class edu.northwestern.at.wordhoard.swing.AbstractWindow |
---|
annotateCmd, clearCmd, copyCmd, cutCmd, newWorkSetCmd, openWorkSetCmd, parentWindow, pasteCmd, saveAsCmd, saveWordSetCmd, saveWorkSetCmd, selectAllCmd, unselectCmd, 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 | |
---|---|
protected |
WordHoardCalculatorWindow(AbstractWindow parentWindow)
Create WordHoard Calculator window. |
Method Summary | |
---|---|
void |
about()
About box. |
javax.swing.JButton |
addACancelButton(DialogPanel panel,
ProgressPanel progressPanel)
Add a cancel button to a progress panel. |
javax.swing.JButton |
addACloseButton(DialogPanel panel,
java.lang.String outputTitle)
Add a close button to a dialog panel. |
void |
addResults(java.lang.String title,
javax.swing.JComponent results)
Insert a component into the main tabbed pane. |
void |
addResults(java.lang.String title,
java.lang.String results)
Insert contents of a string into the main tabbed pane. |
void |
addResults(java.lang.String title,
java.lang.StringBuffer results)
Insert contents of a string buffer into the main tabbed pane. |
void |
addResults(java.lang.String title,
java.lang.String header,
javax.swing.JComponent results)
Insert a component into the main tabbed pane. |
void |
addResults(java.lang.String title,
java.lang.String header,
java.lang.String results)
Insert a string into the main tabbed pane. |
void |
addResults(java.lang.String title,
java.lang.String header,
java.lang.StringBuffer results)
Insert contents of a string buffer into the main tabbed pane. |
void |
addResults(java.lang.String title,
java.lang.String header,
java.io.StringWriter results)
Insert contents of a string writer into the main tabbed pane. |
void |
addResults(java.lang.String title,
java.io.StringWriter results)
Insert contents of a string writer into the main tabbed pane. |
void |
adjustAccountCommands()
Adjusts menu items to reflect logged-in status. |
void |
cancelToClose(javax.swing.JButton button,
java.awt.Component component)
Change cancel button to a close button. |
void |
closePersistenceManager()
Close the current thread's persistence manager. |
protected javax.swing.JMenuBar |
createMenuBar()
Create menu bar and menu items. |
protected void |
createWindowData()
Create the actual window data. |
void |
dispose()
Handles calculator window dispose events. |
protected void |
doAddResults(java.lang.String title,
java.lang.String header,
javax.swing.JComponent results)
Insert a component into the main tabbed pane. |
protected void |
doCancelToClose(javax.swing.JButton button,
java.awt.Component component)
Change cancel button to a close button. |
void |
doPrint()
Print currently selected tabbed panel. |
void |
doPrintPreview()
Perform print preview. |
static WordHoardCalculatorWindow |
getCalculatorWindow()
Return the singleton calculator window. |
bsh.util.JConsole |
getConsole()
Get the interpreter console. |
EditMenu |
getEditMenu()
Get the edit menu. |
javax.swing.JTextPane |
getInputTextPane()
Get the interpreter's input text pane. |
bsh.Interpreter |
getInterpreter()
Get the interpreter. |
WordHoardTabbedPane |
getMainTabbedPane()
Get the main tabbed pane. |
java.lang.String |
getNextOutputWindowTitle()
Get next output panel title. |
java.lang.String |
getNextOutputWindowTitle(boolean show)
Get next output panel title. |
protected XScrollPane |
getResultsScrollPane(javax.swing.JComponent component)
Create a scroll pane around a results component. |
void |
handlePrintCmd()
Handles "Print" command. |
void |
handlePrintPreviewCmd()
Handles "Print Preview" command. |
void |
handleSaveAsCmd()
Handle save as. |
void |
makeVisible()
Ensure the calculator window is visible. |
static void |
open(boolean show)
Opens and/or displays the Calculator window. |
void |
quit()
Quit. |
void |
runScript()
Run a script. |
void |
setBusyCursor()
Set the busy cursor. |
void |
setDefaultCursor()
Set the default cursor. |
void |
setLoggedIn()
Adjust menu items and settings for successful login. |
void |
setLoggedOut()
Adjust menu items and settings for logout. |
void |
setVisible(boolean show)
Show or hide the Calculator window. |
void |
simpleEditor()
Run a simple script-aware text editor. |
void |
startScriptInterpreter()
Start the script interpreter thread. |
Methods inherited from class edu.northwestern.at.utils.swing.XFrame |
---|
common, doPageSetup, doPrint, doPrint, doPrintPreview, doPrintPreview, pack, pack, setAboutBox, setDefaultImage, setPrefsWindow |
Methods inherited from class edu.northwestern.at.utils.swing.WindowsMenuManager |
---|
getActiveWindow, getAllOpenWindows, getWindowsMenu, setJMenuBar, setTitle, 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 |
---|
public static WordHoardCalculatorWindow calculatorWindow
protected WordHoardTabbedPane mainTabbedPane
protected javax.swing.JMenuBar menuBar
protected FileMenu fileMenu
protected CalculatorEditMenu editMenu
protected javax.swing.JMenu authorMenu
protected SetsMenu setsMenu
protected FindMenu findMenu
protected ViewsMenu viewsMenu
protected AnalysisMenu analysisMenu
protected WindowsMenu windowsMenu
protected HelpMenu helpMenu
protected static bsh.Interpreter interpreter
protected static bsh.util.JConsole console
protected static javax.swing.JTextPane inputTextPane
protected int outputResultsNumber
protected boolean loginSucceeded
protected java.lang.String programVersion
protected java.lang.String programBanner
protected java.lang.String programPrompt
Constructor Detail |
---|
protected WordHoardCalculatorWindow(AbstractWindow parentWindow) throws PersistenceException
PersistenceException
Method Detail |
---|
public static void open(boolean show)
show
- true to show calculator window,
false to leave display status as is. protected void createWindowData() throws PersistenceException
createWindowData
in class AbstractWindow
PersistenceException
public void about()
about
in class AbstractWindow
public javax.swing.JButton addACancelButton(DialogPanel panel, ProgressPanel progressPanel)
panel
- Dialog panel to which to add close button.progressPanel
- Progress panel to which to tie cancel action. public javax.swing.JButton addACloseButton(DialogPanel panel, java.lang.String outputTitle)
panel
- Dialog panel to which to add close button.outputTitle
- Title of tabbed panel holding dialog panel. protected void doCancelToClose(javax.swing.JButton button, java.awt.Component component)
button
- The cancel button to change to a close button.component
- Component in tabbed panel holding button. public void cancelToClose(javax.swing.JButton button, java.awt.Component component)
button
- The cancel button to change to a close button.component
- Component in tabbed panel holding button. protected XScrollPane getResultsScrollPane(javax.swing.JComponent component)
component
- Component to wrap with a scroll pane.
protected void doAddResults(java.lang.String title, java.lang.String header, javax.swing.JComponent results)
title
- Title for the component.header
- Header text for the component.results
- The component holding the results.
The title is used for printing only. The header, if not null or empty, is inserted into the output pane, followed by the results component.
This method should only be run on the AWT event thread.
public void addResults(java.lang.String title, java.lang.String header, javax.swing.JComponent results)
title
- Title for the component.header
- Header text for the component.results
- The component holding the results.
The title is used for printing only. The header, if not null or empty, is inserted into the output pane, followed by the results component.
public void addResults(java.lang.String title, javax.swing.JComponent results)
title
- Title for the component.results
- The component holding the results.
The title is used for printing only. The results component is inserted into a tabbed output pane.
public void addResults(java.lang.String title, java.lang.String header, java.lang.String results)
title
- Title for the component.header
- Header text.results
- The string holding the results. public void addResults(java.lang.String title, java.lang.String header, java.lang.StringBuffer results)
title
- Title for the component.header
- Header text.results
- The string buffer holding the results. public void addResults(java.lang.String title, java.lang.String header, java.io.StringWriter results)
title
- Title for the component.header
- Header text.results
- The string writer holding the results. public void addResults(java.lang.String title, java.lang.String results)
title
- Title for the component.results
- The string holding the results. public void addResults(java.lang.String title, java.lang.StringBuffer results)
title
- Title for the component.results
- The string buffer holding the results. public void addResults(java.lang.String title, java.io.StringWriter results)
title
- Title for the component.results
- The string writer holding the results. public void closePersistenceManager()
public void adjustAccountCommands()
Enables/disables the "Logout" and "Manage Account" 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.
adjustAccountCommands
in interface AdjustAccountCommands
adjustAccountCommands
in class AbstractWindow
protected javax.swing.JMenuBar createMenuBar()
public bsh.util.JConsole getConsole()
public EditMenu getEditMenu()
public javax.swing.JTextPane getInputTextPane()
public bsh.Interpreter getInterpreter()
public WordHoardTabbedPane getMainTabbedPane()
public java.lang.String getNextOutputWindowTitle(boolean show)
show
- True to ensure calculator window is visible.
public java.lang.String getNextOutputWindowTitle()
Also ensures calculator window is made visible.
public void quit()
quit
in class AbstractWindow
public void setBusyCursor()
public void setDefaultCursor()
public void setLoggedIn()
setLoggedIn
in class AbstractWindow
public void setLoggedOut()
setLoggedOut
in class AbstractWindow
public void doPrintPreview()
doPrintPreview
in interface PrintableContainer
doPrintPreview
in class XFrame
public void doPrint()
doPrint
in interface PrintableContainer
doPrint
in class XFrame
public void handlePrintPreviewCmd()
handlePrintPreviewCmd
in class AbstractWindow
public void handlePrintCmd()
handlePrintCmd
in class AbstractWindow
public void handleSaveAsCmd()
handleSaveAsCmd
in class AbstractWindow
public void runScript()
public void startScriptInterpreter()
public void simpleEditor()
public static WordHoardCalculatorWindow getCalculatorWindow()
public void makeVisible()
public void setVisible(boolean show)
setVisible
in class WindowsMenuManager
show
- true to show window, false to hide it. public void dispose()
dispose
in class AbstractWindow
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |