All Packages Class Hierarchy This Package Previous Next Index
Class tea.awt.frame.editor.TextEditor
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Window
|
+----java.awt.Frame
|
+----tea.awt.frame.SingleDocker
|
+----tea.awt.frame.MainFrame
|
+----tea.awt.frame.editor.TextEditor
- public class TextEditor
- extends MainFrame
- implements ClipboardOwner, LanguageSpeaker
This class implements a simple text editor. Its features are: International
Languages support, persistent properties support, Clipboard Api support,
Printing capabilities, Toolbar support and extended use of Dialogs.
- Version:
- 1.0 beta - 31 May 1997
- Author:
- Leonardo Boselli
- See Also:
- LanguageSpeaker, PropertiesManager, Toolbar
-
logoImage
-
-
TextEditor(String)
- Constructor for the text editor.
-
actionSettings()
- Performs the management of the main ActionListeners settings.
-
changeSpokenLanguage(String)
- Implements the LanguageSpeaker interface and listens to the changes of
the spoken language.
-
changeTextFont(Font)
- Changes the Text Font to the specified Font.
-
changeTextFontDialog()
- Shows the Change Text Font Dialog.
-
changeWindowFont(Font)
- Changes the Window and Dialogs Font to the specified Font.
-
changeWindowFontDialog()
- Shows the Change Window Font Dialog.
-
confirmReplace(ConfirmDialog)
- Confirms the text replacing operation.
-
copySelection()
- Copies the selected text.
-
cutSelection()
- Cuts the selected text.
-
exit()
- Exits.
-
findText(String)
- Finds the text specified.
-
findTextDialog()
- Shows the Find Text Dialog.
-
getActionManager()
- Gets the associated ActionManager.
-
getDefaultFileExtension()
- Gets the default File extension.
-
getDocumentName()
- Returns the document name (file name with path and default extension).
-
getDocumentPath()
- Returns the document path.
-
getLanguageLearner()
- Returns a LanguageLearner for the TextEditor (it's used to learn other
languages).
-
getLanguageManager()
- Returns the associated LanguageManager.
-
getPageDimensionMagnifyFactor()
- Returns the magnify factor to fit the preview
page in the physical page.
-
getPropertiesOwner()
- Returns the associated PropertiesOwner.
-
getSpokenLanguages()
- Gets the languages spoken by the TextEditor.
-
getTextArea()
- Gets the associated TextArea.
-
initialize()
- Initializes all the settings in the right order.
-
languageSettings()
- Performs the management of the main LanguageManager settings.
-
lostOwnership(Clipboard, Transferable)
- Implements the ClipboardOwner interface.
-
menuSettings()
- Performs the management of the main MenuBar settings.
-
newDocument()
- Opens a new document.
-
nextFindText()
- Finds the next occurrence of the String.
-
openDocument()
- Opens a document asking for the File name.
-
openDocument(String)
- Opens the document with the specified File name.
-
pasteSelection()
- Pastes the selected text.
-
previewDocument()
- Shows a Print Preview of the document.
-
printDocument()
- Prints the document (opens a Printer Settings Dialog before).
-
printerSettings()
- Shows a Dialog for the Printer Settings.
-
propertiesSettings()
- Performs the management of the main persistent Properties of the
TextEditor.
-
replaceText(String, String)
- Begins the replacing text procedure.
-
replaceTextDialog()
- Shows the Replace Text Dialog.
-
saveDocument()
- Saves the current document.
-
saveOptions()
- Saves the current options.
-
setActionManager(ActionManager)
- Sets the associated ActionManager.
-
setDefaultFileExtension(String)
- Sets the default File extension.
-
setDocumentName(String)
- Sets the document name.
-
setLanguage(String)
- Sets the current spoken language.
-
setPageDimensionMagnifyFactor(double)
- Workaroud for a strange behaviour in the Printing.
-
setTextArea(TextArea)
- Sets the associated TextArea.
-
showInfo()
- Shows the Dialog Information of the TextEditor.
-
toolbarSettings()
- Performs the management of the main Toolbar settings.
-
undoSelection()
- Undoes the last selection operation.
-
useDatatransferApi()
- Determines if the Datatransfer Apis are used by this TextEditor.
-
useDatatransferApi(boolean)
- Sets the useDatatransferApi flag to the specified value.
logoImage
protected Image logoImage
TextEditor
public TextEditor(String title)
- Constructor for the text editor. Defines the title.
- Parameters:
- title - the title.
getDefaultFileExtension
public String getDefaultFileExtension()
- Gets the default File extension.
- Returns:
- the default File extension.
setDefaultFileExtension
public void setDefaultFileExtension(String ext)
- Sets the default File extension.
- Parameters:
- ext - the extension.
useDatatransferApi
public boolean useDatatransferApi()
- Determines if the Datatransfer Apis are used by this TextEditor.
- Returns:
- the logical value.
setPageDimensionMagnifyFactor
public void setPageDimensionMagnifyFactor(double f)
- Workaroud for a strange behaviour in the Printing.
This function sets the magnify factor to fit the preview
page in the physical page (default 1.0 - workaround:
set it to 4/3)
- Parameters:
- f - the scale factor.
getPageDimensionMagnifyFactor
public double getPageDimensionMagnifyFactor()
- Returns the magnify factor to fit the preview
page in the physical page.
- Returns:
- the magnify factor.
useDatatransferApi
public void useDatatransferApi(boolean v)
- Sets the useDatatransferApi flag to the specified value.
- Parameters:
- v - use them or not?
setTextArea
public void setTextArea(TextArea ta)
- Sets the associated TextArea.
- Returns:
- the TextArea.
getTextArea
public TextArea getTextArea()
- Gets the associated TextArea.
- Returns:
- the TextArea.
getLanguageManager
public LanguageManager getLanguageManager()
- Returns the associated LanguageManager.
- Returns:
- the LanguageManager.
getPropertiesOwner
public PropertiesOwner getPropertiesOwner()
- Returns the associated PropertiesOwner.
- Returns:
- the PropertiesOwner.
setActionManager
protected void setActionManager(ActionManager am)
- Sets the associated ActionManager.
- Parameters:
- ac - the ActionManager.
getActionManager
public ActionManager getActionManager()
- Gets the associated ActionManager.
- Returns:
- the ActionManager.
propertiesSettings
public void propertiesSettings()
- Performs the management of the main persistent Properties of the
TextEditor.
toolbarSettings
public void toolbarSettings()
- Performs the management of the main Toolbar settings.
menuSettings
public void menuSettings()
- Performs the management of the main MenuBar settings.
actionSettings
public void actionSettings()
- Performs the management of the main ActionListeners settings.
languageSettings
public void languageSettings()
- Performs the management of the main LanguageManager settings.
initialize
public void initialize()
- Initializes all the settings in the right order.
lostOwnership
public void lostOwnership(Clipboard c,
Transferable t)
- Implements the ClipboardOwner interface. No action is currently performed.
- Parameters:
- c - the Clipboard.
- t - the Transferable.
setDocumentName
public void setDocumentName(String name)
- Sets the document name.
- Parameters:
- name - the document name.
getDocumentName
public String getDocumentName()
- Returns the document name (file name with path and default extension).
- Returns:
- the document name.
getDocumentPath
public String getDocumentPath()
- Returns the document path.
- Returns:
- the document path.
newDocument
public void newDocument()
- Opens a new document.
openDocument
public void openDocument()
- Opens a document asking for the File name.
openDocument
public void openDocument(String fileName)
- Opens the document with the specified File name.
- Parameters:
- fileName - the name of the File to be opened.
saveDocument
public void saveDocument()
- Saves the current document.
printerSettings
public void printerSettings()
- Shows a Dialog for the Printer Settings.
previewDocument
public void previewDocument()
- Shows a Print Preview of the document.
printDocument
public void printDocument()
- Prints the document (opens a Printer Settings Dialog before).
exit
public void exit()
- Exits.
undoSelection
public void undoSelection()
- Undoes the last selection operation.
cutSelection
public void cutSelection()
- Cuts the selected text.
copySelection
public void copySelection()
- Copies the selected text.
pasteSelection
public void pasteSelection()
- Pastes the selected text.
findTextDialog
public void findTextDialog()
- Shows the Find Text Dialog.
findText
public void findText(String findString)
- Finds the text specified.
- Parameters:
- findString - the String to be found.
nextFindText
public void nextFindText()
- Finds the next occurrence of the String.
replaceTextDialog
public void replaceTextDialog()
- Shows the Replace Text Dialog.
replaceText
public void replaceText(String findString,
String replaceString)
- Begins the replacing text procedure.
- Parameters:
- findString - the String to be found.
- replaceString - the String to be replaced.
confirmReplace
public void confirmReplace(ConfirmDialog confirmDialog)
- Confirms the text replacing operation.
- Parameters:
- confirmDialog - the ConfirmDialog involved.
changeTextFontDialog
public void changeTextFontDialog()
- Shows the Change Text Font Dialog.
changeTextFont
public void changeTextFont(Font font)
- Changes the Text Font to the specified Font.
- Parameters:
- font - the new Font.
changeWindowFontDialog
public void changeWindowFontDialog()
- Shows the Change Window Font Dialog.
changeWindowFont
public void changeWindowFont(Font font)
- Changes the Window and Dialogs Font to the specified Font.
- Parameters:
- font - the new Font.
saveOptions
public void saveOptions()
- Saves the current options.
showInfo
public void showInfo()
- Shows the Dialog Information of the TextEditor.
setLanguage
public void setLanguage(String l)
- Sets the current spoken language.
- Parameters:
- l - the language.
changeSpokenLanguage
public boolean changeSpokenLanguage(String l)
- Implements the LanguageSpeaker interface and listens to the changes of
the spoken language.
- Parameters:
- l - the spoken language.
- Returns:
- if the language is supported or not.
getSpokenLanguages
public Enumeration getSpokenLanguages()
- Gets the languages spoken by the TextEditor.
- Returns:
- languages spoken.
getLanguageLearner
public LanguageLearner getLanguageLearner()
- Returns a LanguageLearner for the TextEditor (it's used to learn other
languages).
- Returns:
- the LanguageLearner.
All Packages Class Hierarchy This Package Previous Next Index