All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javaParse.GrammarWindow

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Window
                           |
                           +----java.awt.Frame
                                   |
                                   +----javaParse.WindowItem
                                           |
                                           +----javaParse.GrammarWindow

public class GrammarWindow
extends WindowItem
GrammarWindow - the base window for the all types of grammars window.


Variable Index

 o myDataTextFields
 o myRowSize
 o myTextFieldSize

Constructor Index

 o GrammarWindow(GrammarChecker, String)
creates a grammar window

Method Index

 o addOR(int)
when '|' is typed (the equivalence of "or"), the focus shifts to a new textfield and prompts the user with the production
 o clear()
clears the data
 o clearData()
clear the data field
 o close()
function called when the user clicks close - will prompt the user with the "are you sure" dialog.
 o done()
called when the user clicks the done button if the grammar is legal, the checker will tell the Grammar class to make the remaining windows
 o getData()
gets the data field
 o highlightField(int)
highlights a certain row in yellow
 o isModified()
 o newGrammar()
checks to see if buffer as been saved before clearing it & resetting the title & resetting the Saving mode
 o open()
checks to see if buffer has been modified before it opens a grammar file, and if the file is readable, sets the grammar into the window
 o reallyClose()
the actual action of closing the grammarwindow (the user has already been prompted for "are you sure?")
 o save()
saves a grammar
 o saveas()
saves a grammar that is either named with 'untitled' or a user that clicks SaveAs on the menu
 o setClosingInfo(MainMenu, Grammar)
sets the MainMenu and Grammar (needed for telling the MainMenu that this window is closing itself)
 o setData(String[])
Sets the data field
 o setModified(boolean)
sets the the grammar that is entered to be modified or not
 o setShowing(boolean)
overrides the super's setShowing so that the first textfield is in focus and the caret position is correct
 o showAbout()
shows the about picture
 o unhighlightAllFields()
unhighlights all textfields

Variables

 o myRowSize
 protected int myRowSize
 o myDataTextFields
 protected TextField myDataTextFields[]
 o myTextFieldSize
 protected int myTextFieldSize

Constructors

 o GrammarWindow
 public GrammarWindow(GrammarChecker checker,
                      String mode)
creates a grammar window

Parameters:
checker - the checker that makes sure that the entered grammar is legal
mode: - "LL1", "LL2", "LR1"

Methods

 o getData
 public String[] getData()
gets the data field

 o setData
 public void setData(String data[])
Sets the data field

 o clearData
 public void clearData()
clear the data field

 o highlightField
 public void highlightField(int row)
highlights a certain row in yellow

 o unhighlightAllFields
 public void unhighlightAllFields()
unhighlights all textfields

 o addOR
 public void addOR(int num)
when '|' is typed (the equivalence of "or"), the focus shifts to a new textfield and prompts the user with the production

 o saveas
 public boolean saveas()
saves a grammar that is either named with 'untitled' or a user that clicks SaveAs on the menu

 o save
 public boolean save()
saves a grammar

 o close
 public boolean close()
function called when the user clicks close - will prompt the user with the "are you sure" dialog. returns true if the grammar window actually does close, otherwise false

 o reallyClose
 public void reallyClose()
the actual action of closing the grammarwindow (the user has already been prompted for "are you sure?")

 o newGrammar
 public void newGrammar()
checks to see if buffer as been saved before clearing it & resetting the title & resetting the Saving mode

 o open
 public void open()
checks to see if buffer has been modified before it opens a grammar file, and if the file is readable, sets the grammar into the window

 o done
 public void done()
called when the user clicks the done button if the grammar is legal, the checker will tell the Grammar class to make the remaining windows

Overrides:
done in class WindowItem
 o showAbout
 public void showAbout()
shows the about picture

 o clear
 public void clear()
clears the data

Overrides:
clear in class WindowItem
 o setModified
 public void setModified(boolean b)
sets the the grammar that is entered to be modified or not

 o isModified
 public boolean isModified()
Returns:
whether the grammar has been modified since last saving
 o setClosingInfo
 public void setClosingInfo(MainMenu m,
                            Grammar grammar)
sets the MainMenu and Grammar (needed for telling the MainMenu that this window is closing itself)

 o setShowing
 public void setShowing(boolean b)
overrides the super's setShowing so that the first textfield is in focus and the caret position is correct

Overrides:
setShowing in class WindowItem

All Packages  Class Hierarchy  This Package  Previous  Next  Index