|
||||||||||
| 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
edu.neu.ccs.gui.DisplayPanel
edu.neu.ccs.gui.BasePane
edu.neu.ccs.gui.SimpleFunctionPane
Class SimpleFunctionPane
provides a pane that permits
the interactive definition of simple functions,
that is, objects of class
SimpleFunction.
As part of the definition of a simple function,
the function is installed into the default parser.
Here is a description of the GUI.
A dropdown list provides the names of all currently installed simple functions and clicking on a name will bring up its current definition.
A simple function definition may be viewed, edited, or created from scratch using three text fields for:
There are three actions attached to buttons:
The GUI prevents the user from replacing or
removing an built-in function whose class is not
equal to or derived from SimpleFunction.
For convenience, the names of the built-in functions
are provided in a dropdown. In addition, the names
of the special forms are also provided in a separate
dropdown.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
protected Annotation |
bodyLabel
The label for the function body text field. |
protected TextFieldView |
bodyTFV
The function body text field. |
protected SimpleAction |
clear
The clear fields action. |
protected JButton |
clearButton
The clear fields button. |
protected Object[] |
defButtons
The array with the 3 buttons. |
protected HTable |
defButtonsTable
The table with the 3 buttons. |
protected SimpleAction |
defFun
The define function action. |
protected JButton |
defFunButton
The define function button. |
protected VTable |
definitionPanel
The full definition panel. |
protected Object[] |
definitionStuff
The entities for the full definition panel. |
protected Annotation |
fcnsLabel
The label for the functions dropdown list. |
protected Dropdown |
fcnsList
The functions dropdown list. |
protected TablePanel |
innerPanel
The inner panel. |
protected Object[][] |
innerStuff
The entities for the inner panel with the various dropdowns and the function name text field. |
protected Object[] |
mainStuff
The array with the fields and the buttons. |
protected VTable |
mainTable
The table with the fields and the buttons. |
protected Annotation |
nameLabel
The label for the function name text field. |
protected TextFieldView |
nameTFV
The function name text field. |
protected Annotation |
ordinaryFcnsLabel
The label for the ordinary functions dropdown list. |
protected Dropdown |
ordinaryFcnsList
The ordinary functions dropdown list. |
protected Annotation |
paramsLabel
The label for the function parameters text field. |
protected TextFieldView |
paramsTFV
The function parameters text field. |
protected BaseParser |
parser
Reference to the default JPT parser. |
protected SimpleAction |
remFun
The remove function action. |
protected JButton |
remFunButton
The remove function button. |
protected Annotation |
reservedLabel
The label for the reserved IDs dropdown list. |
protected Dropdown |
reservedList
The reserved IDs dropdown list. |
protected SimpleAction |
revertOrdinaryAction
The action to revert the ordinary functions list to a blank string. |
protected SimpleAction |
revertReservedAction
The action to revert the reserved list to a blank string. |
protected SimpleAction |
selectFcn
The action to select a function from the functions dropdown list and show its definition. |
| Fields inherited from class edu.neu.ccs.gui.BasePane |
baseFontSize, buttonFont, DEFAULT_BASE_FONT_SIZE, fieldFont, fontSize, gap, labelFont, largeFieldWidth, mediumFieldWidth, MINIMUM_FONT_SIZE, monospacedFontName, sansserifFontName, serifFontName, smallFieldWidth |
| Fields inherited from class edu.neu.ccs.gui.DisplayPanel |
background, codec, CODEC |
| Fields inherited from class javax.swing.JPanel |
|
| 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 edu.neu.ccs.gui.Displayable |
DEFAULT_VIEW_STATE, VIEW_STATE |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
SimpleFunctionPane()
The constructor for a simple function definition pane. |
|
| Method Summary | |
protected void |
clearFields()
Clears the 3 text fields. |
protected void |
defineFunction()
Defines a function using the data in the 3 text fields. |
static void |
main(String[] args)
The main method launches a simple function definition pane in its own GUI frame. |
protected void |
populateFcnsList()
Populate the simple functions dropdown list with the names of all simple functions currently installed in the default parser. |
protected void |
populateOrdinaryFcnsList()
Populate the ordinary functions dropdown list with the names of all ordinary functions currently installed in the default parser. |
protected void |
populateReservedList()
Populate the reserved dropdown list with the reserved names currently installed in the default parser. |
protected void |
removeFunction()
Removes a function using the name in the function name text field. |
protected void |
revertOrdinaryFcnsList()
Revert the ordinary functions list to showing the blank string. |
protected void |
revertReservedList()
Revert the ordinary functions list to showing the blank string. |
protected void |
selectFunction()
The method to select a function from the functions dropdown list and show its definition. |
| Methods inherited from class edu.neu.ccs.gui.BasePane |
getButtonFont, getFieldFont, getFontSize, getGap, getLabelFont, getLargeFieldWidth, getMediumFieldWidth, getSmallFieldWidth, initializeBasePane |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected BaseParser parser
protected Annotation fcnsLabel
protected Dropdown fcnsList
protected SimpleAction selectFcn
The action to select a function from the functions dropdown list and show its definition.
Utilizes the method selectFunction().
protected Annotation ordinaryFcnsLabel
protected Dropdown ordinaryFcnsList
protected SimpleAction revertOrdinaryAction
protected Annotation reservedLabel
protected Dropdown reservedList
protected SimpleAction revertReservedAction
protected Annotation nameLabel
protected TextFieldView nameTFV
protected Annotation paramsLabel
protected TextFieldView paramsTFV
protected Annotation bodyLabel
protected TextFieldView bodyTFV
protected Object[][] innerStuff
protected TablePanel innerPanel
protected Object[] definitionStuff
protected VTable definitionPanel
protected SimpleAction defFun
The define function action.
Utilizes the method defineFunction().
protected SimpleAction remFun
The remove function action.
Utilizes the method removeFunction().
protected SimpleAction clear
The clear fields action.
Utilizes the method clearFields().
protected JButton defFunButton
protected JButton remFunButton
protected JButton clearButton
protected Object[] defButtons
protected HTable defButtonsTable
protected Object[] mainStuff
protected VTable mainTable
| Constructor Detail |
public SimpleFunctionPane()
| Method Detail |
protected void populateFcnsList()
Populate the simple functions dropdown list with the names of all simple functions currently installed in the default parser.
The names are sorted alphabetically and an empty string is added to the front of the list so that after the selection of a name the list can revert to showing no name.
protected void populateOrdinaryFcnsList()
Populate the ordinary functions dropdown list with the names of all ordinary functions currently installed in the default parser.
The names are sorted alphabetically and an empty string is added to the front of the list so that after the selection of a name the list can revert to showing no name.
protected void revertOrdinaryFcnsList()
protected void populateReservedList()
Populate the reserved dropdown list with the reserved names currently installed in the default parser.
The names are sorted alphabetically and an empty string is added to the front of the list so that after the selection of a name the list can revert to showing no name.
protected void revertReservedList()
protected void selectFunction()
The method to select a function from the functions dropdown list and show its definition.
After the function definition is shown, reverts the function list to showing the empty string.
protected void defineFunction()
Defines a function using the data in the 3 text fields.
Checks for as many errors as possible and provides an informative dialog box when errors occur.
Cannot replace an existing function that is not a simple function.
protected void removeFunction()
Removes a function using the name in the function name text field. Ignores the other two text fields.
Cannot remove an existing function that is not a simple function.
protected void clearFields()
public static void main(String[] args)
The main method launches a simple function definition pane in its own GUI frame.
Use the call:
SimpleFunctionPane.main(null)
args - ignored and may be null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||