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

Variable Index

 o logoImage

Constructor Index

 o TextEditor(String)
Constructor for the text editor.

Method Index

 o actionSettings()
Performs the management of the main ActionListeners settings.
 o changeSpokenLanguage(String)
Implements the LanguageSpeaker interface and listens to the changes of the spoken language.
 o changeTextFont(Font)
Changes the Text Font to the specified Font.
 o changeTextFontDialog()
Shows the Change Text Font Dialog.
 o changeWindowFont(Font)
Changes the Window and Dialogs Font to the specified Font.
 o changeWindowFontDialog()
Shows the Change Window Font Dialog.
 o confirmReplace(ConfirmDialog)
Confirms the text replacing operation.
 o copySelection()
Copies the selected text.
 o cutSelection()
Cuts the selected text.
 o exit()
Exits.
 o findText(String)
Finds the text specified.
 o findTextDialog()
Shows the Find Text Dialog.
 o getActionManager()
Gets the associated ActionManager.
 o getDefaultFileExtension()
Gets the default File extension.
 o getDocumentName()
Returns the document name (file name with path and default extension).
 o getDocumentPath()
Returns the document path.
 o getLanguageLearner()
Returns a LanguageLearner for the TextEditor (it's used to learn other languages).
 o getLanguageManager()
Returns the associated LanguageManager.
 o getPageDimensionMagnifyFactor()
Returns the magnify factor to fit the preview page in the physical page.
 o getPropertiesOwner()
Returns the associated PropertiesOwner.
 o getSpokenLanguages()
Gets the languages spoken by the TextEditor.
 o getTextArea()
Gets the associated TextArea.
 o initialize()
Initializes all the settings in the right order.
 o languageSettings()
Performs the management of the main LanguageManager settings.
 o lostOwnership(Clipboard, Transferable)
Implements the ClipboardOwner interface.
 o menuSettings()
Performs the management of the main MenuBar settings.
 o newDocument()
Opens a new document.
 o nextFindText()
Finds the next occurrence of the String.
 o openDocument()
Opens a document asking for the File name.
 o openDocument(String)
Opens the document with the specified File name.
 o pasteSelection()
Pastes the selected text.
 o previewDocument()
Shows a Print Preview of the document.
 o printDocument()
Prints the document (opens a Printer Settings Dialog before).
 o printerSettings()
Shows a Dialog for the Printer Settings.
 o propertiesSettings()
Performs the management of the main persistent Properties of the TextEditor.
 o replaceText(String, String)
Begins the replacing text procedure.
 o replaceTextDialog()
Shows the Replace Text Dialog.
 o saveDocument()
Saves the current document.
 o saveOptions()
Saves the current options.
 o setActionManager(ActionManager)
Sets the associated ActionManager.
 o setDefaultFileExtension(String)
Sets the default File extension.
 o setDocumentName(String)
Sets the document name.
 o setLanguage(String)
Sets the current spoken language.
 o setPageDimensionMagnifyFactor(double)
Workaroud for a strange behaviour in the Printing.
 o setTextArea(TextArea)
Sets the associated TextArea.
 o showInfo()
Shows the Dialog Information of the TextEditor.
 o toolbarSettings()
Performs the management of the main Toolbar settings.
 o undoSelection()
Undoes the last selection operation.
 o useDatatransferApi()
Determines if the Datatransfer Apis are used by this TextEditor.
 o useDatatransferApi(boolean)
Sets the useDatatransferApi flag to the specified value.

Variables

 o logoImage
 protected Image logoImage

Constructors

 o TextEditor
 public TextEditor(String title)
Constructor for the text editor. Defines the title.

Parameters:
title - the title.

Methods

 o getDefaultFileExtension
 public String getDefaultFileExtension()
Gets the default File extension.

Returns:
the default File extension.
 o setDefaultFileExtension
 public void setDefaultFileExtension(String ext)
Sets the default File extension.

Parameters:
ext - the extension.
 o useDatatransferApi
 public boolean useDatatransferApi()
Determines if the Datatransfer Apis are used by this TextEditor.

Returns:
the logical value.
 o 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.
 o getPageDimensionMagnifyFactor
 public double getPageDimensionMagnifyFactor()
Returns the magnify factor to fit the preview page in the physical page.

Returns:
the magnify factor.
 o useDatatransferApi
 public void useDatatransferApi(boolean v)
Sets the useDatatransferApi flag to the specified value.

Parameters:
v - use them or not?
 o setTextArea
 public void setTextArea(TextArea ta)
Sets the associated TextArea.

Returns:
the TextArea.
 o getTextArea
 public TextArea getTextArea()
Gets the associated TextArea.

Returns:
the TextArea.
 o getLanguageManager
 public LanguageManager getLanguageManager()
Returns the associated LanguageManager.

Returns:
the LanguageManager.
 o getPropertiesOwner
 public PropertiesOwner getPropertiesOwner()
Returns the associated PropertiesOwner.

Returns:
the PropertiesOwner.
 o setActionManager
 protected void setActionManager(ActionManager am)
Sets the associated ActionManager.

Parameters:
ac - the ActionManager.
 o getActionManager
 public ActionManager getActionManager()
Gets the associated ActionManager.

Returns:
the ActionManager.
 o propertiesSettings
 public void propertiesSettings()
Performs the management of the main persistent Properties of the TextEditor.

 o toolbarSettings
 public void toolbarSettings()
Performs the management of the main Toolbar settings.

 o menuSettings
 public void menuSettings()
Performs the management of the main MenuBar settings.

 o actionSettings
 public void actionSettings()
Performs the management of the main ActionListeners settings.

 o languageSettings
 public void languageSettings()
Performs the management of the main LanguageManager settings.

 o initialize
 public void initialize()
Initializes all the settings in the right order.

 o lostOwnership
 public void lostOwnership(Clipboard c,
                           Transferable t)
Implements the ClipboardOwner interface. No action is currently performed.

Parameters:
c - the Clipboard.
t - the Transferable.
 o setDocumentName
 public void setDocumentName(String name)
Sets the document name.

Parameters:
name - the document name.
 o getDocumentName
 public String getDocumentName()
Returns the document name (file name with path and default extension).

Returns:
the document name.
 o getDocumentPath
 public String getDocumentPath()
Returns the document path.

Returns:
the document path.
 o newDocument
 public void newDocument()
Opens a new document.

 o openDocument
 public void openDocument()
Opens a document asking for the File name.

 o openDocument
 public void openDocument(String fileName)
Opens the document with the specified File name.

Parameters:
fileName - the name of the File to be opened.
 o saveDocument
 public void saveDocument()
Saves the current document.

 o printerSettings
 public void printerSettings()
Shows a Dialog for the Printer Settings.

 o previewDocument
 public void previewDocument()
Shows a Print Preview of the document.

 o printDocument
 public void printDocument()
Prints the document (opens a Printer Settings Dialog before).

 o exit
 public void exit()
Exits.

 o undoSelection
 public void undoSelection()
Undoes the last selection operation.

 o cutSelection
 public void cutSelection()
Cuts the selected text.

 o copySelection
 public void copySelection()
Copies the selected text.

 o pasteSelection
 public void pasteSelection()
Pastes the selected text.

 o findTextDialog
 public void findTextDialog()
Shows the Find Text Dialog.

 o findText
 public void findText(String findString)
Finds the text specified.

Parameters:
findString - the String to be found.
 o nextFindText
 public void nextFindText()
Finds the next occurrence of the String.

 o replaceTextDialog
 public void replaceTextDialog()
Shows the Replace Text Dialog.

 o 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.
 o confirmReplace
 public void confirmReplace(ConfirmDialog confirmDialog)
Confirms the text replacing operation.

Parameters:
confirmDialog - the ConfirmDialog involved.
 o changeTextFontDialog
 public void changeTextFontDialog()
Shows the Change Text Font Dialog.

 o changeTextFont
 public void changeTextFont(Font font)
Changes the Text Font to the specified Font.

Parameters:
font - the new Font.
 o changeWindowFontDialog
 public void changeWindowFontDialog()
Shows the Change Window Font Dialog.

 o changeWindowFont
 public void changeWindowFont(Font font)
Changes the Window and Dialogs Font to the specified Font.

Parameters:
font - the new Font.
 o saveOptions
 public void saveOptions()
Saves the current options.

 o showInfo
 public void showInfo()
Shows the Dialog Information of the TextEditor.

 o setLanguage
 public void setLanguage(String l)
Sets the current spoken language.

Parameters:
l - the language.
 o 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.
 o getSpokenLanguages
 public Enumeration getSpokenLanguages()
Gets the languages spoken by the TextEditor.

Returns:
languages spoken.
 o 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