Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.hartmath
Class MenuBar  view MenuBar download MenuBar.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JMenuBar
                  extended byorg.hartmath.MenuBar
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.MenuElement, java.io.Serializable

public class MenuBar
extends javax.swing.JMenuBar

Description of the Class


Nested Class Summary
private  class MenuBar.ActionChangedListener
          Description of the Class
(package private)  class MenuBar.ExitAction
          Really lame implementation of an exit command
(package private)  class MenuBar.FileLoader
          Thread to load a file into the text storage model
(package private)  class MenuBar.NewAction
          Description of the Class
(package private)  class MenuBar.OpenAction
          Description of the Class
(package private)  class MenuBar.SaveAction
          Trys to write the document as a serialization.
(package private)  class MenuBar.SyntaxMenuActionListener
          Description of the Class
 
Nested classes inherited from class javax.swing.JMenuBar
javax.swing.JMenuBar.AccessibleJMenuBar
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String actionSuffix
          Suffix applied to the key used in resource file lookups for an action.
private static java.lang.String[] calcSampleLabels
           
private static java.lang.String[] calculusLabels
           
private  java.util.Hashtable commands
           
private static java.lang.String[] constantsLabels
           
private  javax.swing.Action[] defaultActions
          Actions defined by the Notepad class
private  javax.swing.text.JTextComponent editor
           
static java.lang.String exitAction
          Description of the Field
protected  java.awt.FileDialog fileDialog
          Description of the Field
static java.lang.String imageSuffix
          Suffix applied to the key used in resource file lookups for an image.
static java.lang.String labelSuffix
          Suffix applied to the key used in resource file lookups for a label.
private static java.lang.String[] listFunctionLabels
           
private  javax.swing.JMenuBar menubar
           
private  java.util.Hashtable menuItems
           
static java.lang.String newAction
          Description of the Field
static java.lang.String openAction
          Description of the Field
private  HartMathPanel panel
           
private  javax.swing.JFrame parent
           
private static java.lang.String[] predicateLabels
           
private static java.lang.String[] sampleMenuLabels
           
private static java.lang.String[][] sampleMenus
           
static java.lang.String saveAction
          Description of the Field
static java.lang.String showElementTreeAction
          Description of the Field
private static java.lang.String[] subMenuLabels
           
private static java.lang.String[][] subMenus
           
static java.lang.String tipSuffix
          Suffix applied to the key used in resource file lookups for tooltip text.
private static java.lang.String[] trigLabels
           
 
Fields inherited from class javax.swing.JMenuBar
 
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.Container
 
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
MenuBar(javax.swing.JFrame parent, HartMathPanel panel)
          Constructor for the MenuBar object
 
Method Summary
protected  java.beans.PropertyChangeListener createActionChangeListener(javax.swing.JMenuItem b)
          Description of the Method
protected  javax.swing.JMenu createMenu(java.lang.String key)
          Create a menu for the app.
protected  javax.swing.JMenuItem createMenuItem(java.lang.String cmd)
          This is the hook through which all menu items are created.
protected  javax.swing.Action getAction(java.lang.String cmd)
          Gets the action attribute of the MenuBar object
 javax.swing.Action[] getActions()
          Fetch the list of actions supported by this editor.
protected  java.lang.String[] tokenize(java.lang.String input)
          Take the given string and chop it up into a series of strings on whitespace boundries.
 
Methods inherited from class javax.swing.JMenuBar
add, addNotify, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getHelpMenu, getMargin, getMenu, getMenuCount, getSelectionModel, getSubElements, getUI, getUIClassID, isBorderPainted, isSelected, menuSelectionChanged, paintBorder, paramString, processKeyBinding, processKeyEvent, processMouseEvent, removeNotify, setBorderPainted, setHelpMenu, setMargin, setSelected, setSelectionModel, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, 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, processMouseEvent, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fileDialog

protected java.awt.FileDialog fileDialog
Description of the Field


parent

private javax.swing.JFrame parent

panel

private HartMathPanel panel

editor

private javax.swing.text.JTextComponent editor

commands

private java.util.Hashtable commands

menuItems

private java.util.Hashtable menuItems

menubar

private javax.swing.JMenuBar menubar

defaultActions

private javax.swing.Action[] defaultActions
Actions defined by the Notepad class


imageSuffix

public static final java.lang.String imageSuffix
Suffix applied to the key used in resource file lookups for an image.

See Also:
Constant Field Values

labelSuffix

public static final java.lang.String labelSuffix
Suffix applied to the key used in resource file lookups for a label.

See Also:
Constant Field Values

actionSuffix

public static final java.lang.String actionSuffix
Suffix applied to the key used in resource file lookups for an action.

See Also:
Constant Field Values

tipSuffix

public static final java.lang.String tipSuffix
Suffix applied to the key used in resource file lookups for tooltip text.

See Also:
Constant Field Values

openAction

public static final java.lang.String openAction
Description of the Field

See Also:
Constant Field Values

newAction

public static final java.lang.String newAction
Description of the Field

See Also:
Constant Field Values

saveAction

public static final java.lang.String saveAction
Description of the Field

See Also:
Constant Field Values

exitAction

public static final java.lang.String exitAction
Description of the Field

See Also:
Constant Field Values

showElementTreeAction

public static final java.lang.String showElementTreeAction
Description of the Field

See Also:
Constant Field Values

trigLabels

private static java.lang.String[] trigLabels

calculusLabels

private static java.lang.String[] calculusLabels

constantsLabels

private static java.lang.String[] constantsLabels

subMenuLabels

private static java.lang.String[] subMenuLabels

subMenus

private static java.lang.String[][] subMenus

calcSampleLabels

private static java.lang.String[] calcSampleLabels

predicateLabels

private static java.lang.String[] predicateLabels

listFunctionLabels

private static java.lang.String[] listFunctionLabels

sampleMenuLabels

private static java.lang.String[] sampleMenuLabels

sampleMenus

private static java.lang.String[][] sampleMenus
Constructor Detail

MenuBar

public MenuBar(javax.swing.JFrame parent,
               HartMathPanel panel)
Constructor for the MenuBar object

Method Detail

getActions

public javax.swing.Action[] getActions()
Fetch the list of actions supported by this editor. It is implemented to return the list of actions supported by the embedded JTextComponent augmented with the actions defined locally.


getAction

protected javax.swing.Action getAction(java.lang.String cmd)
Gets the action attribute of the MenuBar object


createMenu

protected javax.swing.JMenu createMenu(java.lang.String key)
Create a menu for the app. By default this pulls the definition of the menu from the associated resource file.


createActionChangeListener

protected java.beans.PropertyChangeListener createActionChangeListener(javax.swing.JMenuItem b)
Description of the Method


createMenuItem

protected javax.swing.JMenuItem createMenuItem(java.lang.String cmd)
This is the hook through which all menu items are created. It registers the result with the menuitem hashtable so that it can be fetched with getMenuItem().


tokenize

protected java.lang.String[] tokenize(java.lang.String input)
Take the given string and chop it up into a series of strings on whitespace boundries. This is useful for trying to get an array of strings out of the resource file.