|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MyMenu
This class constructs the menu of the menu of the main window of the application. It implements the ActionListener interface in order to make the application able to respond to the actions from the menu
Inner Class Summary | |
(package private) class |
MyMenu.MenuAction
class necessary for those actions which are retrieved also on the toolbars. |
Field Summary | |
(package private) MainFrame |
application
holds a referrence to the MainFrame class |
(package private) javax.swing.JCheckBoxMenuItem |
automaticCompar
holds a referrence to the "Selective Save" option in the Settings menu |
(package private) javax.swing.JMenuItem |
change_char
holds the reference to the "Replace characters" item in the Options sub-menu of the Settings menu |
(package private) javax.swing.JMenuItem |
change_frequency
holds the referrence to the "Save every..." option in the Options sub-menu in the Settings menu |
(package private) javax.swing.JCheckBoxMenuItem |
checkali
holds a referrence to the "Case-based translation" option in the Translations sub-menu from the View menu |
(package private) javax.swing.JCheckBoxMenuItem |
checkdeep
holds a referrence to the "Deep Analysis" option in the Translations sub-menu from the View menu |
(package private) javax.swing.JCheckBoxMenuItem |
checkedit
holds a referrence to the "Edit data" option in the Settings menu |
(package private) javax.swing.JCheckBoxMenuItem |
checkoriginal
holds a referrence to the "Original translation" option in the Translations sub-menu from the View menu |
(package private) javax.swing.JCheckBoxMenuItem |
checkpre
holds a referrence to the "Preselection" option in the Translations sub-menu from the View menu |
(package private) javax.swing.JCheckBoxMenuItem |
checksave
holds a referrence to the "Autosave" option in the Settings menu |
(package private) javax.swing.JCheckBoxMenuItem |
checkstat
holds a referrence to the "Statistical translation" option in the Translations sub-menu from the View menu |
(package private) javax.swing.JCheckBoxMenuItem |
checksyn
holds a referrence to the "Dialog-based translation" option in the Translations sub-menu from the View menu |
(package private) MyMenu.MenuAction |
closeAction
holds the reference to the close action related to the menu but also the toobarActions |
(package private) java.lang.String |
command
used for identifying the command for the menu |
(package private) MyMenu.MenuAction |
dialogAct
holds the reference to the action dealing with opening the Dialog Act, done from the menu and also from the toolbarWindows |
(package private) java.util.Vector |
doc_items
contains the name of the opened documents. |
(package private) javax.swing.JMenuItem |
item_spec
used for constructing the "no files" item in the Documents menu |
(package private) MyMenu.MenuAction |
judgements
holds the reference to the action dealing with opening the Judgements Statistics Window, done from the menu and also from the toolbarWindows |
(package private) javax.swing.JMenu |
menu
used for constructing the main menu components |
(package private) javax.swing.JMenuBar |
menubar
holds the menubar |
(package private) MyMenu.MenuAction |
openAction
holds the reference to the "open" action related to the menu but also the toobarActions |
(package private) javax.swing.JMenu |
options
used for constructing the sub-menu "Options" |
(package private) MyMenu.MenuAction |
pattern
holds the reference to the action dealing with opening the Pattern Window, done from the menu and also from the toolbarWindows |
(package private) MyMenu.MenuAction |
quitAction
holds the reference to the quit action related to the menu but also the toobarActions |
(package private) MyMenu.MenuAction |
recognizedInput
holds the reference to the action dealing with opening the Recognizer Panel, done from the menu and also from the toolbarWindows |
(package private) MyMenu.MenuAction |
reloadAction
holds the reference to the reload action related to the menu but also the toobarActions |
(package private) MyMenu.MenuAction |
saveAction
holds the reference to the "save" action related to the menu but also the toobarActions |
(package private) MyMenu.MenuAction |
saveAsAction
holds the refference to the "save as" action related to the menu but also the toobarActions |
(package private) javax.swing.JToolBar |
toolbarActions
holds the toolbar for the actions in the "File" menu, like Save, close, Open, etc as well as for the other windows related to the main appication: Translation Panel, Recognized Panel etc; |
(package private) MyMenu.MenuAction |
translations
holds the reference to the action dealing with opening the Translation Statistics Window, done from the menu and also from the toolbarWindows |
(package private) MyMenu.MenuAction |
translationWindow
holds the referrence to the action dealing with opening the Translation Window, done from the menu and also from the toolbarWindows |
(package private) UserInterface |
ui
holds a reference to the UserInterface. |
Constructor Summary | |
MyMenu(MainFrame application)
The parameter is an instance of the MainFrame class, needed for getting access to the User interface |
Method Summary | |
private void |
ActionFromMenu()
passes to the UserInterface the commands from the menu |
void |
actionPerformed(java.awt.event.ActionEvent e)
starts a thread for the actions in the menu |
void |
addFile(java.lang.String s)
adds a new menu item to the menu Documents whenever a new file is opened shows that this is the current document by seting the state of the current item to true and of the others to false if a new JCheckBoxMenuItem is created the name of this item is added to the Vector doc_items if the document is only reloaded it sets only the states to the corresponding values ui.newdocument is true if a new document is opened and false otherwise |
void |
componentHidden(java.awt.event.ComponentEvent e)
|
void |
componentMoved(java.awt.event.ComponentEvent e)
|
void |
componentResized(java.awt.event.ComponentEvent e)
|
void |
componentShown(java.awt.event.ComponentEvent e)
|
void |
EnableMenu(boolean enable)
Depending on the value of the boolean parameter the method enables or disables the operations to be done on a document as opening, closing, saving etc. |
javax.swing.JMenuBar |
getMenuBar()
Returns the menubar field |
javax.swing.JToolBar |
getToolBarActions()
Returns the first toolbar, concerning the actions in the File menu |
void |
removeFile(java.lang.String s)
removes an item from the Document menu, whenever a document is close It also removes the name of the item from the doc_items Vector |
void |
setSavable(boolean save)
|
void |
update()
sets the items in the Document menu as not selected |
void |
updateInClose(java.lang.String s)
updates the Document Menu by setting by opened the document opened before the one closed |
Methods inherited from class java.lang.Object |
|
Field Detail |
javax.swing.JMenuBar menubar
getMenuBar()
javax.swing.JToolBar toolbarActions
getToolBarActions()
javax.swing.JMenu menu
MyMenu(MainFrame)
javax.swing.JMenu options
MyMenu(MainFrame)
javax.swing.JMenuItem change_char
javax.swing.JMenuItem change_frequency
javax.swing.JMenuItem item_spec
MyMenu.MenuAction saveAction
MyMenu.MenuAction openAction
MyMenu.MenuAction saveAsAction
MyMenu.MenuAction reloadAction
MyMenu.MenuAction closeAction
MyMenu.MenuAction quitAction
MyMenu.MenuAction translationWindow
MyMenu.MenuAction recognizedInput
MyMenu.MenuAction dialogAct
MyMenu.MenuAction pattern
MyMenu.MenuAction judgements
MyMenu.MenuAction translations
javax.swing.JCheckBoxMenuItem checkedit
javax.swing.JCheckBoxMenuItem automaticCompar
javax.swing.JCheckBoxMenuItem checksave
javax.swing.JCheckBoxMenuItem checkoriginal
javax.swing.JCheckBoxMenuItem checkali
javax.swing.JCheckBoxMenuItem checkstat
javax.swing.JCheckBoxMenuItem checksyn
javax.swing.JCheckBoxMenuItem checkdeep
javax.swing.JCheckBoxMenuItem checkpre
UserInterface ui
actionPerformed(ActionEvent)
,
MyMenu.MenuAction.actionPerformed(ActionEvent)
MainFrame application
MainFrame
java.util.Vector doc_items
addFile(String)
,
updateInClose(String)
,
removeFile(String)
java.lang.String command
MyMenu.MenuAction.actionPerformed(ActionEvent)
,
actionPerformed(ActionEvent)
Constructor Detail |
public MyMenu(MainFrame application)
MainFrame
Method Detail |
public javax.swing.JMenuBar getMenuBar()
MainFrame.MainFrame()
public javax.swing.JToolBar getToolBarActions()
MainFrame.MainFrame()
public void EnableMenu(boolean enable)
enable
- is false if no document is openedenable
- is true if at least one document is openedUserInterface.Close()
public void addFile(java.lang.String s)
s
- the name of the file to be addedUserInterface.Open(JComponent)
public void update()
public void updateInClose(java.lang.String s)
s
- the name of the previous opened documentUserInterface.Close()
public void removeFile(java.lang.String s)
UserInterface.Save()
public void setSavable(boolean save)
save
- gives information about the current status of the document (if it was saved or not)
Depending on this it enables the Save option in the File menuDocument
,
UserInterface
public void actionPerformed(java.awt.event.ActionEvent e)
public void componentHidden(java.awt.event.ComponentEvent e)
public void componentMoved(java.awt.event.ComponentEvent e)
public void componentResized(java.awt.event.ComponentEvent e)
public void componentShown(java.awt.event.ComponentEvent e)
private void ActionFromMenu()
UserInterface.EditData(boolean)
,
UserInterface.setAutosave(boolean)
,
UserInterface.setOutput(int)
,
Document.fireChange()
,
TranslationPanel.ShowDialog()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |