TEA Editor: a Simple Editor
Description and Installation

Download
TEA Editor

(1 Kb)
TEA APIs page
TEA APIs

See also TEA Editor and Java 1.1 Tutorials

TEA Editor is a simple text editor that uses the TETRACTYS ENHANCED APIs. It has Toolbar support, International Languages support, persistent Properties support, Printing capabilities and other features. It was developed for the Java 1.1 Tutorial Service. Here you can find the installation procedure and a description of the application.

Installation

Download Shortcuts for TEAEditor
Classes
Batch file for Win95 (1 KB)
TETRACTYS Enhanced Apis (55 KB)
Docs
Source Code (76 KB)
Javadoc generated docs (115 KB)
To use this application simply download TEAeditor.zip, unzip it in a directory of your choice and open the TEAeditor.bat file. Change the variables in the bat file according to your directory tree. You need also to download the Tetractys Enhanced Apis (follow the instruction in the TEA APIs page). Finally, execute TEAeditor.bat.

If something goes wrong, it's important that you check the correct directories: in PATH you must add the directory where java.exe is stored, while in CLASSPATH you must put the directory you have created for TEAeditor.class and tea.jar (it's not a bad idea to add the path for the classes.zip of Java 1.1, too). Remember that the icons (GIF images) must be in a directory called /icons.

If the problem persists, write directly to TETRACTYS Freeware with a description of what goes wrong. For any comment or suggestion, please use the comments form

Description

TEA Editor is a simple Editor with a Toolbar and some other useful feature. Its performances are limited by the functionalities of the TextArea component, but its simple to substitute the basic TextArea with another component, derived from TextArea, which enhances the capabilities of the editor (less simple is to write such a component). An example of these limitations is the reduced size of the text that a TextArea can manage (at least in the Windows 95 environment).

When you start TEA Editor a frame that fits the entire screen appears. This frame contains a MenuBar, a Statusbar and a Toolbar. The MenuBar is the usual one we can add to every frame window, the Statusbar is a simple Label component, while the Toolbar is a more complex component. In fact, it contains some IconButtons that write a self-description in the Statusbar when the pointer of the mouse enters them.

The Toolbar can be moved. The move operation is performed through a Popup Menu (the Popup is shown with the usual Popup trigger of your platform - right click for Windows 95). I have chosen such a move mechanism because of the poor performances I have experimented implementing the Toolbar dragging machanism.

Another inportant thing is that TEA Editor doesn't use the Datatransfer Api to execute cut and paste tasks because of a bug (I think of the JDK 1.1.1) that I haven't understand yet. However, in the methods of TextEditor you can find useDatatransferApis() that makes possible the access to those Apis.

The MenuBar contains the following items

Known Problems

The following are some bugs of this release of TEA Editor. These bugs are derived directly from the bugs of the JDK 1.1.1. I've found a workaround for some of them, but not for all. The work was too hard, so I'm waiting for the next release of JDK (It's already available at JavaSoft but my Internet connection is quite slow).

  1. TextArea Select This bug involves the methods getSelectionXXX() of TextComponent. It seems that (in Windows95) the methods don't count the length of the line separator (that is "\r\n"). The workaround is to create a new TextArea (WATextArea in TEA APIs) class that is aware of this.
  2. TextArea Line Separator Sometimes (in Windows95) the line separator in TextAreas is "\r\n" (when you load a text from a file), sometimes "\n" (when you type it). The graphic preview of the text (such as PrintPreview from TEA APIs) must be aware of this.
  3. Clipboard Timeout There is a strange behaviour using the DataTransfer Apis: the application waits for some seconds during the access to the Clipboard. I use an alternative method, but you cannot copy text to and from other applications (however the DataTransfer Apis can still be used through useDataTransferApis() method).
  4. Adding Menus There is a strange behaviour removing and then adding menus form the MenuBar. Solution: I don't remove any menu .
  5. Modal Dialogs Hide When a modal dialog hides, the parent window is hidden by another window (casually). There is a workaround for this (the dialog requests the focus for its parent before hiding), but sometimes the effect isn't fair to see (flickering).
  6. Parent of Modal Dialogs Hangs When a modal dialog opened by another modal dialog hides, the parent window hangs. I haven't fixed this.
  7. Printing Page is 25% smaller When I try to print with the values given by a PrintJob object the result is always 25% smaller than the format chosen. I don't know if this is a problem of all platforms and configurations. I have chosen to add the method setPageDimensionMagnifyFactor() with a value of 1 + 1/3, but the problem is that the Font is scaled too.
  8. Persistent Printing Properties Printing properties aren't persistent (they aren't used at all). Every time that you want to print to a page format other than the default you must set it in the Printer Settings dialog (annoying).

The Development Tutorial

I think that these few notes are sufficient for a correct use of TEA Editor. This simple application was born to illustrate some mechanisms of the new AWT of Java 1.1. If you are interested go to the Development Tutorials .


TETRACTYS Freeware Main Page

In the next Issue Weekly Applet will be

Spill The Beans! for Java 1.1

GeoCities