VectorGraphics

2D Vector and Image Graphics Library
VectorGraphics FreeHEP
Member of FreeHEP Printable Page

NOT YET RELEASED

Vector Graphics 1.2.3 Release Notes

Release Notes Version: : 1.17 $.

The most recent version of this file is available here.
Release notes for all versions of the VectorGraphics package are available here.

The VectorGraphics package of FreeHEP Java Library enables any Java program to export to a variety of vector graphics formats as well as bitmap image formats. Among the vector formats are PostScript, PDF, EMF, SVF, SWF and CGM, while the image formats include GIF, PNG, JPG and PPM.

The package uses the standard java.awt.Graphics2D class as its interface to the user program. Coupling this package to a standard Java program is therefore quite easy. It also comes with a dialog box which allows you to choose between all the formats mentioned above and set specific parameters for them.

Contents

Major changes in VectorGraphics 1.2.3

  • FREEHEP-496: EMF: Add option to write gzipped EMF as EMZ file.
  • FREEHEP-487: DrawString("", ...) creates an unreadable SWF file.
  • FREEHEP-475: EMF writeImage no longer destroys previous pen/brush context.
  • FREEHEP-64: GIF: images will now be auto-limited to 255 colors using a Quantizer.
  • fillSymbol and drawSymbol now uses Math.ceil for size, when blitting symbols.
  • FREEHEP-448: BufferedPanel will now limit clipped copy to bounds of panel, avoiding a RasterException.
  • FREEHEP-447: Change PathConstructor method closePath to have coordinates.
  • FREEHEP-442: Autoscale problem fixed in PDFGraphics2D where width was used instead of height.
  • FREEHEP-388: ImageFormats PNG, JPG, GIF and RAW are also added in secure mode (WebStart), if available.
  • FREEHEP-411: Added uppercase extensions to all formats, so that format selection is still case sensitive but all uppercase and all lowercase will work the same way.
  • FREEHEP-435: PixelGraphics2D will now use a transient ArrayPath to avoid memory consumption. Unfortunately Sun in its drawing implementation still copies these arrays.
  • FREEHEP-437: The methods createShape (with both ints and doubles) in AbstractVectorGraphics and its descendents now return a Shape rather than a GeneralPath.
  • FREEHEP-438: Multiple calls to getDefaultInstance(ClassLoader loader) in ExportFileTypeRegistry are now allowed if you use the same loader.
  • SymbolShape had VLINE and HLINE symbols mixed up, and it now returns proper bounds.
  • FREEHEP-456: CGM Clipping (rectangle) is implemented.
  • FREEHEP-429: EMF fixed NPE in setting fontSet without having a non-null value for parentGraphics.
  • FREEHEP-444: EMF now writes out transform for writeImage without changing internal transform.
  • FREEHEP-428: All graphics drivers now have a simplified implementation of drawGlyphVector and drawString with an AttrributeCharIterator. Attributes are ignored.
  • Added fillAndDrawSymbol(...) method.

Documentation

The following documentation is currently available:

License

The VectorGraphics package is part of the FreeHEP Java Library, an "Open Source" library distributed under the terms of the LGPL. If you have questions about the licensing please send a mail to: developers@freehep.org.

Installing the VectorGraphics package

Download the PS Viewer and unpack. The distribution creates the following directory structure:

VectorGraphics-version            containing license and release notes
VectorGraphics-version/examples   containing examples
VectorGraphics-version/lib        containing jar files

Compiling the VectorGraphics package

The current distribution does not contain source files.

To (re-)build the VectorGraphics package you need to get VectorGraphics-1.2.2-src.zip or .tar.gz file from the ftp://ftp.slac.stanford.edu/software/freehep/VectorGraphics/v1.2.3/ directory.

To compile it, follow the general instructions for Building the Java FreeHEP Library and compile only the VectorGraphics jar files using the commands:

ant -Djar=graphics2d
ant -Djar=graphicsio
ant -Djar=graphicsio-cgm
ant -Djar=graphicsio-emf
ant -Djar=graphicsio-gif
ant -Djar=graphicsio-java
ant -Djar=graphicsio-pdf
ant -Djar=graphicsio-ppm
ant -Djar=graphicsio-ps
ant -Djar=graphicsio-svg
ant -Djar=graphicsio-swf

To build the distribution kit:

cd org/freehep/graphicsio
gmake dist

Building an Application with the VectorGraphics package

Add the following libraries to your CLASSPATH:

freehep-graphics2d.jar
freehep-base.jar

Running an Application with the VectorGraphics package

Set the environment variable PSVIEWER_HOME to your unpacked PSViewer distribution.

Add the following libraries to your CLASSPATH:

freehep-graphicsio.jar
freehep-graphics2d.jar
freehep-base.jar

Then add any of the following jar files to your CLASSPATH to enable that format for output:

freehep-graphicsio-cgm.jar
freehep-graphicsio-emf.jar
freehep-graphicsio-gif.jar
freehep-graphicsio-java.jar
freehep-graphicsio-pdf.jar
freehep-graphicsio-ppm.jar
freehep-graphicsio-ps.jar
freehep-graphicsio-svg.jar
freehep-graphicsio-swf.jar

Features/Limitations of the Current Release

The following limitations exist:

  • All outstanding issues in the Bug Database.
  • The distribution kits contain some CVS directories and files, please ignore.
  • The freehep-base.jar file (and especially its sources) are dependent on some external jar files which are not strictly needed for the VectorGraphics package. Please ignore for now. In a later release we will shrink freehep-base.jar and get rid of these dependencies.

Reporting Bugs

To report bugs or request enhancements you may use the FreeHEP bug database, component VectorGraphics.

Examples

The VectorGraphics/examples directory contains:

  • ExportDialogExample.java to show how to use the default ExportDialog that comes with the VectorGraphics package.