jfig (1.53) README, last update 03.12.2001


A.  About
0.  System requirements
1.  Installation
2.  Running jfig 
3.  Configuration via jfig.cnf
4.  Running jfig as an applet
5.  JVM Compatibility
6.  Printing and fig2dev
7.  Windows installation 
8. Contact



-----------------------------------------------------------------------------

A. About

jfig is a graphics or diagram editor written in pure Java. 
It offers all typical drawing primitives including bezier splines,
each with attributes like colors, line and fill styles, etc.
When available on your system, jfig will use the Java2D graphics 
library for high-quality rendering.

The user interface of jfig aims to be compatible with "xfig", the 
de-facto standard graphics editor on Unix and Linux workstations.
While jfig runs fine on Unix and Linux, the most common reason
to use jfig is to have an xfig-compatible graphics editor on
Windows systems. Some Windows utility files and a precompiled fig2dev 
executable for Windows are available for separate download from 
the jfig homepage.

For information and details about jfig visit the jfig homepage, 
http://tech-www.informatik.uni-hamburg.de/applets/jfig/




-----------------------------------------------------------------------------

0. System requirements

In theory, jfig should run on all machines with a Java 1.1 
or Java 2 compatible Java virtual machine and enough memory. 
In practice, you will need the following:

   minimum           recommended        optimal
   Pentium/100       PII-300            PIII/Athlon-500
   32 MByte          64 MByte           128 MByte
   800x600           1024x768           1280x1024
   JRE 1.1.7         JRE/JDK 1.3 or Microsoft jview

Therefore, jfig should run on most current notebook PCs. However, 
don't try to use jfig unless you have at least 32 MB RAM.
Also, the performance difference between 32 and 64 MBytes or 
between Pentium and Pentium-II systems can be astonishing...

For other platforms, the system requirements are similar. For
example, jfig will run fine on an UltraSPARC with JDK 1.3 and
64 MByte RAM. 

See the JVM compatibility and the CHANGES files for information 
and details about known problems with several Java virtual machines 
on different platforms.





-----------------------------------------------------------------------------

1. Download and Installation 

The jfig editor consists of about 250 individual Java classes
(parts of the program), bundled together in an archive file. 
Currently, we offer two archives with the same contents but 
different names: "jfig.jar" and "jfig.zip".

The jfig.zip variant is provided for compatibility with broken
web-browsers which don't understand the .jar extension and 
therefore fail to download .jar files correctly. After downloading
"jfig.zip", you should rename the file to "jfig.jar".

Both archives are in standard ZIP file format. However, don't
unpack the archive file, but simply put it into the directory
where you keep your Java JAR files.
If necessary, create such directory, e.g.:

   mkdir /users/yourname/java/lib/ (Unix)
   mkdir c:\java\lib\              (Windows)

   /users/yourname/java/lib/jfig.jar

There are two main application classes in the archive file:

  'jfig.gui.Editor' is the editor main class, 
  'jfig.gui.PresentationViewer' is a minimal 'Powerpoint-style' 
                    viewer.

Additionally, there are also several utility classes in the
archive. For example, running jfig.utils.PresentationBuilder
allows you to combine individual .fig files into a JAR-archive
suiteable for the presentation viewer.

DOWNLOAD PROBLEMS: As noted above, many (older) browsers don't
understand the ".jar" extension, and will download such files
in text-mode, thereby destroying the archive. If you suspect
that the archive may be broken, try to list the archive contents
with unzip/WinZip/jar. This should display or list several hundred
files in subdirectories like jfig/gui or jfig/commands.
If listing the archive contents fails, the archive is broken,
and you have to download it again. In this case, try do download
the "jfig.zip" file and rename to "jfig.jar" after downloading.





-----------------------------------------------------------------------------

2. Running jfig

To start the editor as an application use the following commands:

- JDK/JRE 1.3 and JDK/JRE 1.2.2 

  Assuming that JDK/JRE 1.3 or 1.2.2 is your default Java 
  executable, you can run jfig directly from the jfig.jar archive, 
  without having to bother with CLASSPATH settings:

  java -jar jfig.jar [filename.fig]

  On Windows, you can also start the editor by double-clicking on the
  jfig.jar icon on your desktop: 

  If you downloaded the "jfig.zip" archive, you must first
  rename this file to "jfig.jar" instead. Next, drop a link from
  jfig.jar to your desktop.

  See section 7) below for further information on Windows installation.


- JDK 1.1.x (and JDK 1.3.x or 1.2.x traditional)
  
  set PATH=%PATH%;c:\path\to\your\JDK\bin
  set CLASSPATH=%CLASSPATH%;c:\path\to\jfig.jar

  java jfig.gui.Editor [filename.fig]

- JRE 1.1.x and JRE 1.2.x 

  set PATH=%PATH%;c:\path\to\your\JDK\bin
  set CLASSPATH=%CLASSPATH%;c:\path\to\jfig.jar

  java jfig.gui.Editor [filename.fig]

- Microsoft VM

  jview /cp c:\path\to\jfig.jar jfig.gui.Editor [filename.fig]
  



-----------------------------------------------------------------------------

3. Configuration via jfig.cnf

Many properties and attribute settings in jfig can be preset from
a configuration file. The default values are read on program startup
from the "master" configuration file in the jfig.jar archive,
called "/jfig/jfig.cnf". To adapt jfig to your preferences, just
extract the configuration file 'jfig.cnf' from the class archive
and edit the attribute values.

At the very least, you should edit the command lines for Postscript 
export and printing, if you have fig2dev available (see below).
Also, set "jfig.FIG.Version 32" or "jfig.FIG.Version 31"
to set the default output format to FIG 3.2 or FIG 3.1.

jfig will load and merge all configuration files from three different
directories, so you can have global jfig options, per-user options,
and per-directory options:

  1. the global 'jfig.cnf' file from the CLASSPATH
  2. a 'jfig.cnf' file in your home directory 
  3. a '.jfigrc' file in your home directory
  4. a 'jfig.cnf' file in your current working directory
  5. a '.jfigrc' file in your current working directory

Note that global properties may be overwritten by the home-directory
properties, which in turn may be overwritten by current-directory
settings. 

On Windows, the location of your home directory depends on the
Java virtual machine and the Windows version. For example:
Windows 95, Microsoft jview:   C:\windows\Java
Windows 95, Sun JDK 1.3:       C:\windows\system

To check the home directory location on your system, start jfig,
select menu->options->show properties and look for the user.home
property.

The current version of jfig also allows you to write the user.home
and working.directory configuration files directly from the
show properties dialog window. Just select the corresponding "save
.jfigrc" button and afterwards edit the file.

Note: On Windows systems, the extension ".cnf" is also used for 
modem script stuff, but opening the jfig.cnf in your favorite editor 
or even the DOS-mode text editor should still work.








-----------------------------------------------------------------------------

4. Running jfig as an applet

To start the editor as an applet use the 'applet.html' page or write
a similar page yourself. Note the applet tag parameters. Unless you 
change the security settings of your browser, jfig won't be able to 
access files or to print when running as an applet, however.

There is also a variant of jfig called "simple FIG applet" which is 
optimized for program size, in order to minimize applet download time. 
The FIG applet can be used to embed FIG drawings directly into HTML
pages. For an example, see http://tech-www.informatik.uni-hamburg.de/
applets/jfig/applet-demos/simple-applet.html






-----------------------------------------------------------------------------

5. JVM compatibility

jfig should run with any recent JVM. The following combinations
are known to work:

Solaris 2.5x.. 2.7, 8.x:  Sun JDK 1.1.7 and later,
                          Sun JDK 1.2.2 
                          Sun JDK 1.3.0 
                          Sun JDK 1.3.1 
        

Linux 2.2.x (glibc2.1):   Blackdown JDK 1.1.7 and JDK 1.1.8
                          IBM JDK 1.1.8
                          Blackdown JDK 1.2.2 rc4 and later
                          Sun JDK 1.3.0
                          IBM JDK 1.3.0
                          Sun JDK 1.3.1 

                          Kaffe 1.0.6 (with some problems)
                   

Windows 95/98/NT      :   Sun JDK 1.1.6 and later
                          Sun JDK 1.2.2 
                          Sun JDK 1.3.0 
                          IBM JDK 1.3.0 
                          Sun JDK 1.3.1
                          Microsoft VM build 3181 and later

Microsoft IE 4.0      :   Microsoft VM build 3181 and later

Netscape 4.7          :   viewer applet and presentation viewer only,
                          problems with resource access (icons etc.)

Netscape 6            :   with the builtin Java2 VM (once enabled)



For further information, see the file "jvm-compatibility.txt".

All of the above virtual machines still have some problems with
font rendering, which are also dependent on your OS and font 
installation.  For example, the symbol/greek font may not display 
correctly, or not at all. 




-----------------------------------------------------------------------------

6. Printing and fig2dev

jfig native printing should be possible on all operating systems, 
but the output quality is limited, because Java 1.1 uses an internal
resolution of 72dpi for printing. 

Java 2 (JDK/JRE 1.2 or 1.3) should provide good printing quality 
on all printers on your system. However, you may encounter some
problems. For example, printing of fill-patterns does not yet work 
under JDK 1.3 on neither of Windows/Linux/Solaris...

jfig also supports PPM image format export of the current diagram 
- a sort of screen-dump (without the editor grid). Use your favorite
image editor (Photoshop, PaintShop, Gimp, etc). to convert PPM 
format to other formats like GIF, JPEG, PNG. 
More image formats will be supported soon, as the next version of
the JDK (1.4) is annouced to include the image I/O framework.

Postscript export and Postscript printing are available via the 
transfig package and fig2dev drivers from the xfig distribution. 
Fig2dev is available in the Public Domain but protected under the 
X11 Copyright terms. On most Unix and Linux platforms, the fig2dev
program is installed by default. For Windows, you can download a
precompiled binary of fig2dev.3.2.3 (fig2dev-windows.zip) from the 
jfig homepage.





-----------------------------------------------------------------------

7. Windows installation

On Windows systems, you may want to make jfig your default editor
for FIG files, and you may want a desktop icon for jfig:

a) Download and unpack the archive 'jfig-windows-install.zip' from
   the jfig homepage. This archive contains a Windows 95/98 
   batch-file and desktop icon for jfig.

b) Edit the file c:\windows\jfig.bat to select either the Sun or
   the Microsoft VM, and specify the correct class search path.

   Note that the file contains a bug, because the jfig program
   archive is now called jfig.jar instead of jfig-classes.zip.

   Also note that you don't need the bat file when using JDK 1.3,
   which directly allows to run JAR files (e.g. jfig.jar).

c) If you want to start jfig when double-clicking on your FIG files, 
   open the Windows explorer, mark any .fig file (click once), 
   open the context menu (right click), select "Open".
   In the dialog that follows, select "other", then browse to
   "c:\windows" and select "jfig.bat" or "jfig.pif".
   After the next reboot, all ".fig" files should be shown with the
   jfig icon, and a double-click will open the editor.

   The files in jfig-windows-install.zip are for a German Window95/98
   configuration. You may have to edit the jfig.bat and jfig.pif
   files to get them working with other language versions or with
   Windows NT/2000.





-----------------------------------------------------------------------

8. Contact

Dr. Norman Hendrich                               Tel. +49 40 5494 2399
Universitaet Hamburg, FB Informatik               Fax. +49 40 5494 2397 
Vogt-Koelln-Str. 30
D-22527 Hamburg              e-mail: hendrich@informatik.uni-hamburg.de
