|
|
||||||||||||||||||
| Uni-HH / CS. / TAMS / Java / jfig | |||||||||||||||||||
|
Introduction and motivationBesides the editor and the bean (viewer and applet), the presentation viewer is another application built upon the jfig class library. It allows presenting a slide show consisting of individual FIG files, with direct access to all slides and the standard navigation functions (previous and next slide, previous and next chapter, goto slide, etc.). The typical use of the viewer is to present FIG based classroom material via a beamer. Two simple examples:
Naturally, the viewer is no substitute for "presentation graphics" programs like Microsoft Powerpoint or Suns StarOffice Presenter, which manage a presentation as a single document with multiple pages. The jfig presentation viewer, on the other hand, just accesses and displays individual FIG files, which have to be edited separately. Therefore, creating a simple text-only FIG presentation is more work than using PowerPoint with it's "click here for the title" assistants. However, the process of combining the slides into a presentation can be automated, and jfig already includes a corresponding presentation builder utility (see below). Also, ordering or re-ordering the slides is usual a minor task compared to the time needed to prepare the slides in the first place. When your slides include lots of complex drawings, especially with lots of grid-aligned objects on multiple layers, using jfig as the editor might well be faster than using the crippled PowerPoint editor or embedding figures from other drawing programs like Visio. Note that browsing through your presentation is quite easy in the jfig editor via the quick-open function (page-up/page-down keys). Also, the rendering quality of jfig (under JDK 1.4+ with Java2D) is quite good by now and does not suffer when rescaling the figures. Finally, the stability of the presentation viewer is good, too, easily handling 30 MByte archive files with hundreds of slides and embedded images. The extra class ItextPresentationPDFWriter can be used to create a PDF-format file from your presentation.To keep the viewer applet as small as possible for use in WWW-based presentation (minimize applet startup time), the viewer has a very simple user interface and supports navigation (first slide, next slide, next chapter) and the standard panning/zooming operations only. Most functions can be selected either via the popup-menu or via keystrokes. However, the viewer does not include any editor functions at all. The presentation index fileA slide-show for the jfig presentation viewer consists of the set of individual FIG files, optional external files (e.g. bitmap images), and an index file that defines the ordering and titles or the figure files. On startup, the viewer loads this file and accesses the FIG files as needed. The default extension for the index file is.jpt
for "jfig presentation".
The syntax of the index file is very simple. A single example
should be enough to demonstrate the concept:
# JavaFIG presentation # # comment lines start with # # chapter title="introduction" slide title="cover" href="figs/00-cover.fig" slide title="contents" href="figs/01-overview.fig" slide title="Java 2 platform" href="figs/03-java2-house.fig" ... # chapter title="de facto standards" slide title="Java products" href="figs/07-java-products.fig" slide title="Java vs. Windows" href="figs/08-java-vs-windows.fig" slide title="JVM and bytecode" href="figs/12-bytecode-portable.fig" slide title="JVM status quo" href="figs/12-jvm-status-quo.fig" ...The viewer expects the file to start with the # JavaFIG presentation line, which is then followed
by any number of comment lines, chapter definitions, and slide
definitions. The above example also shows a simple filename convention
to allow automatic sorting of the slides.
The file structure for the above example might look like this:
/home/users/hugo/
oopsla-01/
index.jpt -- index file
figs/ -- FIG files
00-cover.fig
01-overview.fig
...
images/ -- embedded images
java-platform.jpg
...
When using embedded images (FIG image objects), you should not use
absolute pathnames to specify the image file
("/home/users/.../images/logo.gif")
but rather relative pathnames ("images/logo.gif")
in order to make the presentation portable.
If necessary, change and update the image object's pathnames
via the "edit image object" dialog in jfig.
Running a presentationWhile the viewer can access the index file and the FIG files from the local file system or a remote webserver, the typical use is to pack all required FIG and image files together with all required presentation viewer classes into a single Java JAR archive. Afterwards, the presentation can be run on any Java2 compatible system simply by double-clicking the file, or by running it from a command line with:
jview /cp c:\path\to\oopsla-2001.jar jfig.gui.PresentationViewerTo start the presentation viewer as a standalone application, just start the main class and specify the location of the index file:
Together, these options imply that the presentation can be shown on all major client platforms, including Windows, Unix/Linux, and Mac.
PresentationBuilderAs explained above, all individual figures to be used as slides, all embedded GIF/JPEG/... images, the .jpt index file, and all the jfig presentation viewer code should be packed into a single JAR archive. The utility class jfig.utils.PresentationBuilder, included in the jfig editor "jfig3.jar" (or "jfig3-itext.jar") class archive, can be used to automate this process. For example, run:
set CLASSPATH=c:\path\to\jfig3.jar
java jfig.utils.PresentationBuilder
-jar c:\oopsla-2001.jar c:\slides\oopsla-2001
c:\java\jfig-presentationviewer.zip
(where the java command should go on a single rather long command line)
to build a presentation archive called c:\oopsla-2001.jar
which collects all .fig files and .gif/.jpg images from the
directory c:\slides\oopsla-2001
and the presentation viewer software from the
c:\java\jfig-presentationviewer.zip archive.
Run java jfig.utils.PresentationBuilder without arguments
in a shell to print a short usage-message explaining all available options.
Note that the presentation builder collects all files in the order
given by your system's file system, which typically depends on
the filenames.
The above trick with using numbers for the filenames
("00-cover.fig", "01-overview.fig", ...)
allows to use the presentation builder without having to edit
the autogenerated index.jpt file.
Creating PDF handoutsTo create a PDF handout from your presentation, open a command shell, put jfig3-itext.jar into your CLASSPATH, and run class ItextPresentationPDFWriter on the .jpt index file of your presentation. Run the command without arguments to see a list of the supported options. (At the moment, the output filename is hardcoded to 'hugo.pdf'; just rename the file.)set CLASSPATH=c:\path\to\jfig3-itext.jar java jfig.utils.ItextPresentationPDFWriter index.jpt acroread hugo.pdfPlease check the links at the top of this page for two examples of the resulting PDF files. Note that embedded images are embedded using their native compression, retaining small image size at optimum quality. Also, math symbols and formulae are supported (within the limits of the jfig TeX-mode parser). |
||||||||||||||||||
| 18.05.2005 | Impressum |