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.
-
myDataTextFields
-
-
myRowSize
-
-
myTextFieldSize
-
-
GrammarWindow(GrammarChecker, String)
- creates a grammar window
-
addOR(int)
- when '|' is typed (the equivalence of "or"), the focus
shifts to a new textfield and
prompts the user with the production
-
clear()
- clears the data
-
clearData()
-
clear the data field
-
close()
- function called when the user clicks close - will prompt the user
with the "are you sure" dialog.
-
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
-
getData()
- gets the data field
-
highlightField(int)
- highlights a certain row in yellow
-
isModified()
-
-
newGrammar()
- checks to see if buffer as been saved before clearing it &
resetting the title & resetting the Saving mode
-
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
-
reallyClose()
- the actual action of closing the grammarwindow (the user has
already been prompted for "are you sure?")
-
save()
- saves a grammar
-
saveas()
- saves a grammar that is either named with 'untitled' or a user
that clicks SaveAs on the menu
-
setClosingInfo(MainMenu, Grammar)
- sets the MainMenu and Grammar (needed for telling the MainMenu
that this window is closing itself)
-
setData(String[])
- Sets the data field
-
setModified(boolean)
- sets the the grammar that is entered to be modified or not
-
setShowing(boolean)
- overrides the super's setShowing so that the first textfield is
in focus and the caret position is correct
-
showAbout()
- shows the about picture
-
unhighlightAllFields()
- unhighlights all textfields
myRowSize
protected int myRowSize
myDataTextFields
protected TextField myDataTextFields[]
myTextFieldSize
protected int myTextFieldSize
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"
getData
public String[] getData()
- gets the data field
setData
public void setData(String data[])
- Sets the data field
clearData
public void clearData()
- clear the data field
highlightField
public void highlightField(int row)
- highlights a certain row in yellow
unhighlightAllFields
public void unhighlightAllFields()
- unhighlights all textfields
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
saveas
public boolean saveas()
- saves a grammar that is either named with 'untitled' or a user
that clicks SaveAs on the menu
save
public boolean save()
- saves a grammar
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
reallyClose
public void reallyClose()
- the actual action of closing the grammarwindow (the user has
already been prompted for "are you sure?")
newGrammar
public void newGrammar()
- checks to see if buffer as been saved before clearing it &
resetting the title & resetting the Saving mode
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
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
showAbout
public void showAbout()
- shows the about picture
clear
public void clear()
- clears the data
- Overrides:
- clear in class WindowItem
setModified
public void setModified(boolean b)
- sets the the grammar that is entered to be modified or not
isModified
public boolean isModified()
- Returns:
- whether the grammar has been modified since last saving
setClosingInfo
public void setClosingInfo(MainMenu m,
Grammar grammar)
- sets the MainMenu and Grammar (needed for telling the MainMenu
that this window is closing itself)
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