|
|||||||
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 | +--javax.swing.JComponent | +--javax.swing.JPanel | +--UserInterface
This class builds the user interface of the application and manages the events occuring when opening or closing a document.
UserOptions
, Serialized FormInner Class Summary | |
(package private) class |
UserInterface.FileLoader
this inner class starts a thread for loading a document |
(package private) class |
UserInterface.FileSaver
this inner class starts a thread and saves a document to the disk |
private static class |
UserInterface.ModelToCurrentTurnPanelAdaptor
this adaptor is for CurrentTurnPanel controls |
private static class |
UserInterface.ModelToDialogActPanelAdaptor
this adaptor id for the DialogActPanel |
private static class |
UserInterface.ModelToInformationsElementPanelAdaptor
this adaptor is for InformationElementsPanel controls |
private static class |
UserInterface.ModelToNextTurnPanelAdaptor
this adaptor is for NextTurnPanel controls |
private static class |
UserInterface.ModelToRecognizerPanelAdaptor
this adaptor is for showing the recognition |
private static class |
UserInterface.ModelToTranslationPanelAdaptor
this adaptor is for showing the translations |
private static class |
UserInterface.ModelToTurnCorectnessPanelAdaptor
This adaptor is TurnCorrectnessPanel controls |
(package private) class |
UserInterface.Progress
this inner class builts a frame which shows the progress of the loading |
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent,
javax.swing.JComponent.IntVector,
javax.swing.JComponent.KeyboardBinding,
javax.swing.JComponent.KeyboardState |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AWTTreeLock |
Field Summary | |
(package private) boolean |
autom_compar
indicated the way to perform the comparison in the Recognizer Panel window |
(package private) ChangeFrequency |
change_freq
reference to the window "Save every...", popped-up from the options sub-menu, from Settings menu |
(package private) CurrentTurnPanel |
ct
reference to the panel containing the current analysed turn |
private Document |
curr_doc
holds a reference to the current showed document |
(package private) DialogActPanel |
dialog_dialog
reference to the "Dialog act" panel |
(package private) DialogStatistics |
dialog_judgements
reference to the "Judgements Statististics" panel |
(package private) DialogPattern |
dialog_pattern
reference to the "Patterns" panel |
(package private) TranslationStatistics |
dialog_stat_trans
reference to the "Translations Statistics" panel |
(package private) java.util.Vector |
docs
contains the current opened docs |
(package private) java.util.Vector |
docs_names
contains the names of the current opened docs |
(package private) InformationElementsPanel |
ie
reference to the panel Information elements, which shows also the number of the current turn dispayed |
(package private) UserInterface.FileLoader |
loader
this object loads a document |
(package private) javax.swing.JFrame |
mainframe
holds a reference to the frame of the application. |
(package private) MyMenu |
menu
holds a reference to the main menu of the application |
(package private) boolean |
new_document
indicates if the current opened document is a new one, or it was opened earlier |
(package private) NextTurnPanel |
nt
reference to the panel containing the next turn in the dialogue |
(package private) OptionsString |
Options
reference to the object which performs the changes of the characters to be replaced |
(package private) RecognizerPanel |
recognizer_dialog
reference to the "Recognizer Input" panel |
(package private) ReplaceCharacters |
repl_char
reference to the window "Replace characters", accessed from the options sub-menu, from Settings menu |
(package private) UserInterface.FileSaver |
saver
this object saves a document |
(package private) TurnCorrectnessPanel |
tc
reference to the panel containing informations about the current turn panel |
(package private) javax.swing.Timer |
timer
used for starting the progress monitor |
(package private) TranslationPanel |
translation_dialog
reference to the "Translations Window" panel |
Fields inherited from class javax.swing.JPanel |
defaultLayout,
uiClassID |
Fields inherited from class javax.swing.JComponent |
_bounds,
accessibleContext,
alignmentX,
alignmentY,
ANCESTOR_USING_BUFFER,
ancestorNotifier,
autoscroller,
border,
changeSupport,
clientProperties,
flags,
HAS_FOCUS,
IS_DOUBLE_BUFFERED,
IS_OPAQUE,
IS_PAINTING_TILE,
KEYBOARD_BINDINGS_KEY,
listenerList,
maximumSize,
minimumSize,
NEXT_FOCUS,
paintImmediatelyClip,
paintingChild,
preferredSize,
readObjectCallbacks,
REQUEST_FOCUS_DISABLED,
tmpRect,
TOOL_TIP_TEXT_KEY,
ui,
uiClassID,
UNDEFINED_CONDITION,
vetoableChangeSupport,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Container |
component,
containerListener,
containerSerializedDataVersion,
dispatcher,
layoutMgr,
maxSize,
ncomponents,
serialVersionUID |
Fields inherited from class java.awt.Component |
actionListenerK,
adjustmentListenerK,
appContext,
assert,
background,
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
changeSupport,
componentListener,
componentListenerK,
componentOrientation,
componentSerializedDataVersion,
containerListenerK,
cursor,
dropTarget,
enabled,
eventMask,
focusListener,
focusListenerK,
font,
foreground,
hasFocus,
height,
incRate,
inputMethodListener,
inputMethodListenerK,
isInc,
isPacked,
itemListenerK,
keyListener,
keyListenerK,
LEFT_ALIGNMENT,
locale,
LOCK,
minSize,
mouseListener,
mouseListenerK,
mouseMotionListener,
mouseMotionListenerK,
name,
nameExplicitlySet,
newEventsOnly,
ownedWindowK,
parent,
peer,
peerFont,
popups,
prefSize,
RIGHT_ALIGNMENT,
serialVersionUID,
textListenerK,
TOP_ALIGNMENT,
valid,
visible,
width,
windowListenerK,
x,
y |
Fields inherited from interface UserOptions |
DEFAULTSFILENAME,
FREQUENCY_SAVE_TURNS,
MAXIMUM_WORDS_STRING,
NO_TURNS,
REPLACEMASKSIZE,
TRANSLATION_SEGMENTS |
Constructor Summary | |
UserInterface(javax.swing.JFrame mainframe,
MyMenu menu)
Constructor of the user interface |
Method Summary | |
void |
BrowseData(boolean browse)
enables or disables the browsing of the turns in the current document |
void |
changed()
this method is called when the user changes the replace characters model in the Settings --> Options menu |
void |
Close()
close the file being in use |
private void |
create_adaptors()
created the adaptors for a new document |
private void |
deleteDocument(java.lang.String name)
|
void |
DeleteOldDoc(java.lang.String filename)
erases all references to the old document (which will not exist anymore as another file overwrites it) |
void |
DisplayCurrentTurn()
displays the current turn of the document |
private void |
DisplayNull()
displays information when no document is opened |
void |
EditData(boolean edit)
enables changes of different components of the user interface |
boolean |
getAutomaticCompare()
|
Document |
getCurrentDocument()
|
InformationElementsPanel |
getInformationElementsPanel()
|
UserInterface |
getUI()
|
void |
Open(javax.swing.JComponent parent)
opens a file if it is a new one or redisplays an existent one |
private void |
openExistentFile(java.io.File file)
retrieves an already opened file |
private void |
openNewFile(java.io.File file)
created a new Document based on the current selected file |
void |
Quit()
exits the application and saves the non-saved information |
void |
Redisplay()
dispalys from memory the current document |
void |
Reload()
reloads from the disk the current document |
void |
Save()
starts a thread for saving if the current document is not saved |
void |
SaveAs(javax.swing.JComponent parent)
saves the document under another name |
void |
SaveAsNewDoc(java.io.File file)
saves a new document to disk |
void |
SaveAsOldDoc(java.io.File file)
saves the document over an already opened one |
private java.io.File |
SelectFile(javax.swing.JComponent parent,
char type)
Pops up a dialog window in order to select a file for opening or for saving under another name |
void |
setAutomaticComparison(boolean compar)
|
void |
setAutosave(boolean auto)
assigns the autosave property to the current document |
private Document |
setCurrentDocument(java.lang.String name)
|
void |
setDocument(java.lang.String name)
sets the current opened document |
void |
setOutput(int output)
sets the type of module that produced the translation |
private void |
updateDocsNames(java.lang.String name)
deletes the name of a document from the docs_names vector |
void |
UpdateMenusAndVariables(java.io.File file)
updates the menu and the docs_names vector |
private java.io.File |
verifyExtension(java.io.File file)
checks if the selected file has the correct extension (eval) if not this extention is added to the name of the file |
Methods inherited from class javax.swing.JPanel |
|
Methods inherited from class javax.swing.JComponent |
_paintImmediately,
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
adjustPaintFlags,
alwaysOnTop,
bindingForKeyStroke,
checkIfChildObscuredBySibling,
computeVisibleRect,
computeVisibleRect,
contains,
createToolTip,
enableSerialization,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperties,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getFlag,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
keyboardBindings,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
paintWithBuffer,
processComponentKeyEvent,
processFocusEvent,
processKeyBinding,
processKeyBindings,
processKeyBindingsForAllComponents,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
readObject,
rectangleIsObscured,
rectangleIsObscuredBySibling,
registerKeyboardAction,
registerKeyboardAction,
registerWithKeyboardManager,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFlag,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPaintingChild,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
shouldDebugGraphics,
superProcessMouseMotionEvent,
unregisterKeyboardAction,
unregisterWithKeyboardManager,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
applyOrientation,
countComponents,
deliverEvent,
dispatchEventImpl,
dispatchEventToSelf,
doLayout,
eventEnabled,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents_NoClientCode,
getComponents,
getCursorTarget,
getLayout,
getMouseEventTarget,
getWindow,
initIDs,
insets,
invalidate,
invalidateTree,
isAncestorOf,
layout,
lightweightPrint,
list,
list,
locate,
minimumSize,
nextFocus,
paintComponents,
postProcessKeyEvent,
postsOldMouseEvents,
preferredSize,
preProcessKeyEvent,
print,
printComponents,
printOneComponent,
processContainerEvent,
processEvent,
proxyEnableEvents,
proxyRequestFocus,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setFocusOwner,
setLayout,
transferFocus,
updateCursor,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
areInputMethodsEnabled,
bounds,
checkImage,
checkImage,
coalesceEvents,
constructComponentName,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont_NoClientCode,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getIntrinsicCursor,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getNativeContainer,
getParent_NoClientCode,
getParent,
getPeer,
getSize,
getToolkit,
getToolkitImpl,
getTreeLock,
getWindowForObject,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isEnabledImpl,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
Field Detail |
private Document curr_doc
javax.swing.JFrame mainframe
UserInterface(JFrame,MyMenu)
MyMenu menu
TranslationPanel translation_dialog
RecognizerPanel recognizer_dialog
DialogActPanel dialog_dialog
DialogStatistics dialog_judgements
TranslationStatistics dialog_stat_trans
DialogPattern dialog_pattern
CurrentTurnPanel ct
TurnCorrectnessPanel tc
NextTurnPanel nt
InformationElementsPanel ie
ReplaceCharacters repl_char
ChangeFrequency change_freq
OptionsString Options
java.util.Vector docs
java.util.Vector docs_names
boolean new_document
boolean autom_compar
UserInterface.FileLoader loader
UserInterface.FileSaver saver
javax.swing.Timer timer
Constructor Detail |
public UserInterface(javax.swing.JFrame mainframe, MyMenu menu)
Method Detail |
public UserInterface getUI()
public Document getCurrentDocument()
private Document setCurrentDocument(java.lang.String name)
name
- the name of the document to be retievedDocument
private void updateDocsNames(java.lang.String name)
name
- the string to be removedpublic void setDocument(java.lang.String name)
name
- the name of the document to be setsetCurrentDocument(String)
public InformationElementsPanel getInformationElementsPanel()
DisplayCurrentTurn()
public void setOutput(int output)
output
- indicates the module (each module has a number assigned)public void setAutomaticComparison(boolean compar)
compar
- determines if in the Recognizer panel the comparison is done automaticallypublic boolean getAutomaticCompare()
public void setAutosave(boolean auto)
auto
- is true if the "autosave" option in the Settings menu is selectedMyMenu.actionPerformed(ActionEvent)
public void EditData(boolean edit)
edit
- is true if the option "Edit Data" in the Settings menu is selectedMyMenu.actionPerformed(ActionEvent)
public void BrowseData(boolean browse)
browse
- is true when at least one document is opened and false otherwiseClose()
,
Open(JComponent)
public void Reload()
public void Open(javax.swing.JComponent parent)
parent
- the parent frame for the dialog window which allows the selection of the fileSelectFile(JComponent,char)
,
MyMenu.EnableMenu(boolean)
,
MyMenu.update()
,
MyMenu.setSavable(boolean)
,
BrowseData(boolean)
,
UserInterface.FileLoader
private java.io.File SelectFile(javax.swing.JComponent parent, char type)
parent
- the parent frame of the windowtype
- is 'o' if the window is popped-up for opening and 's' if it is for savingverifyExtension(File)
,
openNewFile(File)
private java.io.File verifyExtension(java.io.File file)
file
- the name of the file for which te test is performedprivate void openNewFile(java.io.File file)
Document
,
create_adaptors()
private void create_adaptors()
UserInterface.ModelToCurrentTurnPanelAdaptor
,
UserInterface.ModelToInformationsElementPanelAdaptor
,
UserInterface.ModelToTurnCorectnessPanelAdaptor
,
UserInterface.ModelToNextTurnPanelAdaptor
,
UserInterface.ModelToTranslationPanelAdaptor
,
UserInterface.ModelToRecognizerPanelAdaptor
,
UserInterface.ModelToDialogActPanelAdaptor
private void openExistentFile(java.io.File file)
public void Redisplay()
InformationElementsPanel
,
DisplayCurrentTurn()
public void Quit()
UserInterface.FileSaver
,
Document
private void deleteDocument(java.lang.String name)
public void Close()
UserInterface.FileSaver
,
MyMenu.removeFile(String)
,
MyMenu.updateInClose(String)
,
MyMenu.addFile(String)
,
MyMenu.EnableMenu(boolean)
,
Document.fireChange()
,
Document.ResetValues()
,
BrowseData(boolean)
,
setCurrentDocument(String)
,
InformationElementsPanel
public void SaveAs(javax.swing.JComponent parent)
parent
- the parent of the pop-up window for chosing the name of the fileSelectFile(JComponent,char)
,
SaveAsNewDoc(File)
,
SaveAsOldDoc(File)
public void SaveAsNewDoc(java.io.File file)
file
- the full name of the document to be savedUpdateMenusAndVariables(File)
,
UserInterface.FileSaver
,
DisplayCurrentTurn()
public void SaveAsOldDoc(java.io.File file)
file
- the name of the file on which the save is doneUpdateMenusAndVariables(File)
,
UserInterface.FileSaver
,
DisplayCurrentTurn()
public void UpdateMenusAndVariables(java.io.File file)
file
- the name of the documentDocument
,
MyMenu.removeFile(String)
,
MyMenu.addFile(String)
public void DeleteOldDoc(java.lang.String filename)
MyMenu.removeFile(String)
public void Save()
Document
,
UserInterface.FileSaver
public void DisplayCurrentTurn()
Document.findTurn(int)
private void DisplayNull()
public void changed()
ReplaceCharacters.actionPerformed(ActionEvent)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |