|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | 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 | +--gui.PrgGramInputFrame
Okno pro zadavani programovane gramatiky. Umoznuje pridavat, menit a mazat pravidla a urcit pocatecni neterminal. Gramatiku je mozne ulozit do souboru i ze souboru nacist.
Inner Class Summary | |
protected class |
PrgGramInputFrame.ProdFieldKeyListener
Vnitrni trida slouzici jako posluchac udalosti z klavesnice. |
Inner classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
Inner classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Inner classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
Field Summary | |
private static int |
ABOUT_ITEM
Poradi polozky napoveda o programu |
private static int |
ADD_ITEM
Poradi polozky pridat pravidlo |
private javax.swing.JButton |
addButton
Tlacitko pro pridani pravidla |
private javax.swing.JLabel |
arrowLabel
Sipka oddelujici levou a pravou stranu pravidla |
private javax.swing.JPanel |
buttonPanel
Panel pro tlacitka |
private static int |
BUTTONS_HEIGHT
Vyska tlacitek |
private static int |
BUTTONS_WIDTH
Sirka tlacitek |
private static int |
BUTTONS_X
X souradnice tlacitek |
private java.awt.GridLayout |
buttonsLayout
Layout pro serazeni tlacitek do sloupce |
private javax.swing.JPanel |
contentPanel
Hlavni panel okna |
private static int |
DEL_ITEM
Poradi polozky smazat pravidlo |
private javax.swing.JButton |
deleteButton
Tlacitko pro smazani pravidla |
protected DerivationFrame |
derivationFrame
Okno derivace, ze ktereho bylo toto otevreno |
protected ErrorFrame |
errorFrame
Okno zobrazujici chybova hlaseni |
private static int |
FAIL_WIDTH
Sirka textoveho pole pro pole neuspechu pravidla |
private static int |
FAIL_X
X souradnice textoveho pole pro pole neuspechu pravidla |
private javax.swing.JTextField |
failField
Textove pole pro oznaceni pravidel pole neuspechu |
private javax.swing.JLabel |
failLabel
Nadpis k poli s polem uspechu |
private static int |
FIELD_HEIGHT
Vyska textovych poli pravidla |
private static int |
FIELD_Y
Y souradnice textovych poli pravidla |
private static int |
FILE_MENU
Poradi menu gramatika |
private static int |
GRAM_ITEM
Poradi polozky napoveda o editaci gramatiky |
protected ProgrammedGrammar |
grammar
Editovana gramatika |
private static int |
HELP_MENU
Poradi menu napoveda |
protected HelpFrame |
hf
Okno napovedy |
private static int |
CHANGE_ITEM
Poradi polozky zmenit pravidlo |
private static int |
LABEL_WIDTH
Sirka textoveho pole oznaceni pravidla |
private static int |
LABEL_X
X souradnice textoveho pole oznaceni pravidla |
private javax.swing.JTextField |
labelField
Textove pole pro oznaceni pravidla |
private javax.swing.JLabel |
labelLabel
Nadpis k poli pro oznaceni pravidla |
private static int |
LABS_HEIGHT
Vyska nadpisu textovych poli pravidla |
private static int |
LABS_Y
Y souradnice nadpisu textovych poli pravidla |
private static int |
LEFT_WIDTH
Sirka textoveho pole leve strany pravidla |
private static int |
LEFT_X
X souradnice textoveho pole leve strany pravidla |
private javax.swing.JTextField |
leftField
Textove pole pro levou stranu pravidla |
private static int |
LIST_HEIGHT
Vyska seznamu pravidel |
private static int |
LIST_WIDTH
Sirka seznamu pravidel |
private static int |
LIST_Y
Sirka seznamu pravidel |
private javax.swing.JScrollPane |
listScroll
Posuvne listy pro seznam pravidel |
private static java.lang.String[][] |
menuItemStrings
Nadpisy polozek jednotlivych polozek v menu |
private static java.lang.String[] |
menus
Nadpisu menu |
private static int |
NONTERM_Y
Y souradnice textoveho pole pro neterminaly |
private javax.swing.JTextField |
nontermField
Textove pole pro zobrazeni neterminalu |
private javax.swing.JLabel |
nontermLabel
Nadpis k poli s neterminaly |
private javax.swing.JScrollPane |
nontermScroll
Posuvne listy pro textove pole neterminalu |
private static int |
OK_ITEM
Poradi polozky ukonceni editace s ulozenim zmen |
private javax.swing.JButton |
okButton
Tlacitko pro ulozeni gramatiky a zavreni okna |
private static int |
OPEN_ITEM
Poradi polozky nacist ze souboru |
private static int |
PROD_MENU
Poradi menu pravidlo |
private PrgGramInputFrame.ProdFieldKeyListener |
prodKeyListener
Posluchac udalosti z klavesnice |
private javax.swing.JLabel |
prodLabel
Nadpis k polim pravidla |
private javax.swing.JList |
prodList
Seznam pravidel |
private static int |
RIGHT_WIDTH
Sirka textoveho pole prave strany pravidla |
private static int |
RIGHT_X
X souradnice textoveho pole prave strany pravidla |
private javax.swing.JTextField |
rightField
Textove pole pro pravou stranu pravidla |
private static int |
SAVE_ITEM
Poradi polozky ulozeni do souboru |
private javax.swing.JTextField |
startField
Textove pole pro pocatecni neterminal |
private javax.swing.JLabel |
startLabel
Nadpis k poli se startovacim neterminalem |
private static int |
STORNO_ITEM
Poradi polozky zavreni okna bez ulozeni zmen |
private javax.swing.JButton |
stornoButton
Tlacitko pro zavreni okna bez ulozeni zmen |
private static int |
SUCC_WIDTH
Sirka textoveho pole pro pole uspechu pravidla |
private static int |
SUCC_X
X souradnice textoveho pole pro pole uspechu pravidla |
private javax.swing.JTextField |
succField
Textove pole pro oznaceni pravidel pole uspechu |
private javax.swing.JLabel |
succLabel
Nadpis k poli s polem neuspechu |
private static int |
TERM_LAB_WIDTH
Sirka nadpisu k textovym polim s neterminaly a terminaly |
private static int |
TERM_X
X souradnice textoveho pole pro terminaly |
private static int |
TERM_Y
Y souradnice textoveho pole pro terminaly |
private javax.swing.JTextField |
termField
Textove pole pro zobrazeni terminalu |
private javax.swing.JLabel |
termLabel
Nadpis k poli s terminaly |
private javax.swing.JScrollPane |
termScroll
Posuvne listy pro textove pole terminalu |
private static int |
TEXTAREA_HIGHT
Vyska textoveho pole pro terminaly |
private javax.swing.JButton |
updateButton
Tlacitko pro zmenu pravidla |
static int |
WINDOW_HEIGHT
Vyska okna |
static int |
WINDOW_WIDTH
Sirka okna |
Fields inherited from class javax.swing.JFrame |
accessibleContext, defaultCloseOperation, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis |
Fields inherited from class java.awt.Window |
active, dbg, focusMgr, inputContext, inputContextLock, OPENED, ownedWindowList, showWithParent, warningString, windowListener, windowSerializedDataVersion |
Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads |
Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, changeSupport, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
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 | |
PrgGramInputFrame()
Pomocny konstruktor. |
|
PrgGramInputFrame(DerivationFrame df,
Grammar pg)
Vytvori okno pro editaci urcene gramatiky. |
Method Summary | |
protected void |
addButtonAction()
Slouzi pro pridani pravidla do gramatiky. |
protected void |
deleteButtonAction()
Slouzi pro odstraneni pravidla vybraneho v seznamu. |
private void |
error(int e)
Slouzi k zobrazeni chybove hlasky s urcenym cislem. |
private void |
error(java.text.ParseException e)
Zobrazi okno s chybovou hlaskou o spatnem formatu souboru. |
private void |
makeFrame()
Vytvori okno vcetne vsech jeho prvku. |
protected void |
makeMenu()
Vytvori kompletni menu vcetne polozek. |
protected void |
okButtonAction()
Akce pri potvrzeni gramatiky. |
void |
readFile()
Necha uzivatele vybrat soubor. |
protected PrgProduction |
readProduction()
Prekontroluje textova pole, do kterych se vyplnuje pravidlo. |
protected java.lang.String |
readStart()
Precte nazev neterminalu z textoveho pole. |
void |
refreshGrammar(Grammar g)
Zmeni gramatiku. |
private void |
removeFields()
Vymaze hodnoty z textovych poli pro editaci pravidla. |
protected void |
stornoButtonAction()
Zavre okno editace bez ulozeni zmen v gramatice. |
void |
takeControl(int message)
Slouzi ke zjisteni, ze bylo uzavreno okno s chybovym hlasenim. |
protected boolean |
testGrammar()
Zjisti, jestli gramatika splnuje zakladni pozadavky na ukonceni editace. |
protected void |
updateButtonAction()
Umozni editaci pravidla. |
protected void |
updateList()
Vytvori seznam pravidel podle aktualni gramatiky. |
protected void |
updateSymbols()
Zmeni obsah textovych poli s terminaly a neterminaly podle aktualni gramatiky. |
private void |
writeFile()
Zapise prave editovanou gramatiku do souboru. |
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, createRootPaneException, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
|
Methods inherited from class java.awt.Window |
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyOrientation, countComponents, createHierarchyEvents, createChildHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, checkGD, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, setFont, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, checkImage, checkImage, checkWindowClosingException, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, 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, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
protected ErrorFrame errorFrame
protected DerivationFrame derivationFrame
protected HelpFrame hf
protected ProgrammedGrammar grammar
private javax.swing.JPanel contentPanel
private javax.swing.JPanel buttonPanel
private javax.swing.JLabel labelLabel
private javax.swing.JLabel startLabel
private javax.swing.JLabel prodLabel
private javax.swing.JLabel termLabel
private javax.swing.JLabel nontermLabel
private javax.swing.JLabel failLabel
private javax.swing.JLabel succLabel
private javax.swing.JLabel arrowLabel
private javax.swing.JButton okButton
private javax.swing.JButton stornoButton
private javax.swing.JButton updateButton
private javax.swing.JButton addButton
private javax.swing.JButton deleteButton
private javax.swing.JTextField labelField
private javax.swing.JTextField leftField
private javax.swing.JTextField rightField
private javax.swing.JTextField succField
private javax.swing.JTextField failField
private javax.swing.JTextField startField
private javax.swing.JScrollPane termScroll
private javax.swing.JScrollPane nontermScroll
private javax.swing.JScrollPane listScroll
private javax.swing.JTextField termField
private javax.swing.JTextField nontermField
private java.awt.GridLayout buttonsLayout
private PrgGramInputFrame.ProdFieldKeyListener prodKeyListener
private javax.swing.JList prodList
public static final int WINDOW_HEIGHT
public static final int WINDOW_WIDTH
private static final int FIELD_Y
private static final int FIELD_HEIGHT
private static final int LABS_Y
private static final int LABS_HEIGHT
private static final int LIST_HEIGHT
private static final int LIST_WIDTH
private static final int BUTTONS_HEIGHT
private static final int BUTTONS_X
private static final int BUTTONS_WIDTH
private static final int LABEL_X
private static final int LABEL_WIDTH
private static final int LEFT_X
private static final int LEFT_WIDTH
private static final int RIGHT_X
private static final int RIGHT_WIDTH
private static final int SUCC_X
private static final int SUCC_WIDTH
private static final int FAIL_X
private static final int FAIL_WIDTH
private static final int TERM_Y
private static final int TERM_X
private static final int TEXTAREA_HIGHT
private static final int NONTERM_Y
private static final int LIST_Y
private static final int TERM_LAB_WIDTH
private static final java.lang.String[] menus
private static final java.lang.String[][] menuItemStrings
private static final int FILE_MENU
private static final int PROD_MENU
private static final int HELP_MENU
private static final int OPEN_ITEM
private static final int SAVE_ITEM
private static final int STORNO_ITEM
private static final int OK_ITEM
private static final int ADD_ITEM
private static final int CHANGE_ITEM
private static final int DEL_ITEM
private static final int GRAM_ITEM
private static final int ABOUT_ITEM
Constructor Detail |
public PrgGramInputFrame()
public PrgGramInputFrame(DerivationFrame df, Grammar pg)
df
- Okno derivace, ze ktereho byla editace gramatiky volanapg
- Editovana programovana gramatikaMethod Detail |
private void makeFrame()
protected void makeMenu()
public void readFile()
private void writeFile()
public void refreshGrammar(Grammar g)
g
- Nova gramatikapublic void takeControl(int message)
takeControl
in interface Errorable
message
- Cislo chybove hlasky, ktera byla zobrazena.private void error(java.text.ParseException e)
e
- Vyjimka generovana pri spatnem formatu souboru. Obsahuje
text chyby a radek, na kterem chyba nastala.private void error(int e)
e
- Cislo chybove hlasky, ktera se ma zobrazitprotected PrgProduction readProduction()
protected void updateList()
private void removeFields()
protected java.lang.String readStart()
protected void updateSymbols()
protected boolean testGrammar()
protected void okButtonAction()
protected void stornoButtonAction()
protected void addButtonAction()
protected void deleteButtonAction()
protected void updateButtonAction()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |