% jfig (2.00a) README, 26.10.2002


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 2D-graphics or diagram editor written in pure Java. 
It offers all standard 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", 
a very popular 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, e.g. a notebook PC.  Some Windows utility files 
and a precompiled fig2dev.exe 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/

LICENSE:  Please read the information in /jfig/doc/LICENSE
for information about jfig licensing. The editor is shareware
and you should consider to pay the shareware fee if you use
jfig regularly. 

RELEASE NOTES:  There are currently two versions of the jfig
editor, the old and fairly tested AWT only version (jfig 1.55),
and the completely rewritten, Swing based version (jfig 2.00a).
The latter version is brand new and may contain new "features".
Please don't hesitate to report all bugs you find in the Swing
version, in order to help getting them fixed soon.



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

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.3.x         JRE/JDK 1.3.1 or later 

Note that it is also possible to run jfig with older versions
of the Java virtual machine, e.g. JDK 1.1.8 or the Microsoft VM
(jview). See the instructions below.

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
at least 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 or later:

  Assuming that JDK/JRE 1.3.x or 1.4.x 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]



- JDK/JRE 1.3 or later:

  On Windows, you can also start the editor by double-clicking 
  the jfig.jar icon.  If you downloaded the "jfig.zip" archive, 
  you must first rename this file to "jfig.jar" instead.  You
  might also want to drop a link from jfig.jar to your desktop
  or the start menu for easier access.

  NOTE: unfortunately, the default installation of the JDK/JRE 
  does not correctly handle filenames with spaces in them. For
  example, trying to double click a jfig.jar installed into
  "c:\my files\jfig.jar" or "c:\program files\jfig\jfig.jar"
  will not work, because of the space characters.

  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

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 Java virtual machine that supports
at least the Java 1.1 API specification. This includes the
Microsoft VM (jview build 3.181 or later) and all versions of the 
JDK/JRE 1.18 or later.

Note that many 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. 

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





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

6. Printing and fig2dev

jfig native printing should be possible on all operating systems, 
but the output quality is limited due to a variety of problems.
For example, Java 1.1 virtual machines only use a resolution of 
72dpi for printing. 

Java 2 (JDK/JRE 1.3 or later) should provide good printing quality 
on all printers on your system. However, you may still encounter 
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, or Postscript.
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, so that double-clicking a ".fig" file directly
starts the jfig editor and opens the ".fig" file.

Unfortunately, the details on how to enable this behaviour 
depend on all of the Java version used, the Windows version,
and the installation paths used for the jfig.jar archive and your
FIG files.  It is therefore almost impossible to give fail-save
instructinos on how to enable the correct behaviour. 

The basic idea, however, is to create a mapping from the ".fig"
file extension to the Windows internal "open" command for that
type of file - which should be a command line like the following

"C:\j2sre-1.4.0\bin\javaw.exe" -jar "c:\my files\jfig.jar" "%1"

where the first path specifies the Java virtual machine executable,
the second specifies the path to the jfig.jar archive, and the
third part ("%1") the actual FIG file name. The quotes are needed
to support file names with spaces or special chars in them.

In most versions of Windows, you can access and edit the "open"
command for a file type from an Explorer window. Try to find the
dialog via "explorer->options->display->file types". 
Next, search for a ".fig" file type and edit the type. 
Otherwise, add a ".fig" type and enter the "open" command.
Please ask your local Windows guru on help about the details
required for your version of Windows.








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

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
