% jfig/doc/CHANGES, 25.05.2005 This file contains jfig bug, status and change log information. For information on how to use or configure jfig, see the README and the FAQ documents. -------------------------------------------------------------------------- Status: (jfig 3.00+ / 2.20+ / 1.63). * all FIG 3.2 object types * all FIG object attributes (rendering requires Java2D) * all basic xfig editor commands * xfig library function * read FIG 3.2, FIG 3.1, FIG 2.1, write FIG 3.2, FIG 3.1, format conversion * Postscript export via Java/Java2D printing (still many Java bugs here) * Postscript, Latex, ... export via external fig2dev program * user interface to fig2dev, see /doc/export-fig2dev.txt * built-in export to PDF via Itext library * built-in export to JPEG, PNG, PPM via ImageIO * support for Manhattan and LaTeX style geometry * "TeX mode" for direct rendering of attributed strings including basic math * layer manager (Swing version only) * both Swing and "traditional" AWT versions available * both Java2D and "traditional" AWT 1.1 object rendering jfig features and bugs: * multiple-line text objects (strings with '\n' chars) are not supported * suboptimal rubberbanding for rotated ellipses * default installation uses Times/Helvetica/Courier fonts only * stacked object selection not fully implemented -------------------------------------------------------------------------- Notation: JB Java (but not jfig) bug K killer bug B bug I feature, low priority bug F fix N new feature/function -------------------------------------------------------------------------- I On several Linux systems, entering non-standard keys like German umlauts seems to work only when the correct "locale" is set, but does not work in the "C" or "Posix" locale settings. Beware. JB both the Sun and the IBM JDKs fail to render some rotated text objects (especially for angles of 45 degrees and high zoom factors) on my Linux machine. Reason unknown; no workaround yet. Enabling anti-aliasing seems to help. JB the Java2D rendering of rounded rectangles with Stroke=BEVEL seems to result in spurious sharp edges at the 3-o-clock position of the rectangle. JB PDF-mode export generates wrong output for some TeX-mode macros on Mac OS X; possibly a wrong font-encoding of the CM fonts? --------------- 25.05.05 F minor website fixes 23.05.05 N add case-insensitive font-name lookup to keep jfig+itext+MacOSX happy in jfig.utils.ItextFontMapper. This means that TeX-mode PDF export via iText should work again on OS X. (Bug reported by H.S.) For as yet unknown reasons, Java 1.4.x on Mac OS X 1.2.x .. 1.4.x expects an uppercase name for the Computer Modern fonts (e.g. Cmmi10 instead of cmmi10). 20.05.05 F add a try-catch in jfig.gui.PrintManager to catch the random ClassCastExceptions when re-initializing PrintRequestAttributeSet. F implement jfig.utils.LP2.__make_line for fontMode=1 19.05.05 F another fix for the 'precise' bounding-box calculation in jfig.object.FigArc. Hopefully this doesn't break anything else. 18.05.05 F enabled the 'preview' PDF and image export functions in the un-registered version of the jfig editor. These functions were already active in batch-mode export, but blocked in the GUI due to two interlocking bugs... N more website updates. 17.05.05 F some HTML+CSS2 experiments, website update pending F added REGISTRATION.TXT link to the webpages 13.05.05 N up-loaded the new web-pages and jfig3 12.05.05 F changed jfig.gui.ImageHelper.find to always load the images (if found at all) via a MediaTracker. This makes loading some figure files a little slower, but avoids the annoying repaint problems for partially loaded images. Also, batch-mode figure to image export via jfig.gui.JImageIOExportOptionsDialog.main() should now work. F another re-factoring in jfig.objects.FigText and FigTextRenderer. The measuring of the text is now done by the renderer, and the default implementation in jfig.java2d does this in world-coords always. This should fix the cursor-vs-string mismatch during edit-text operations. However, we need a Graphics and FontRenderContext for this to work. Correspondingly, jfig.commands.CreateTextCommand now supplies a Graphics object to setTextCursorFromPosition(). F experiments indicate that the Java2D-based getStringBounds() methods are completely unusable on JDK/JRE 1.4.2 on both Windows and Linux. The relative error between the reported string size and the actual string size rendered on-screen is on the order of 10 percent, which makes this completely unusable. The error is larger when anti-aliasing or fractional-metrics are enabled. Instead, we reverted to screen-coordinate rendering based on the original FontMetrics.stringWidth() rendering. This means that centered and right-aligned text objects should work again, as should the 'edit exisiting text' operation in CreateTextCommand. It is a really bad joke from Sun, that the only working method to calculate string size (namely FontMetrics.stringWidth()) is deprecated, while the newer methods return somewhat random values... F minor change to jfig.java2d.FigTools2D.showPoints() and showSelected() to make the result look better when anti-aliasing is on. Corresponding changes in jfig.objects.FigBaseobject and FigText. 11.05.05 N document embedded-image-export-problems in FAQ.TXT F re-added class jfig.gui.PresentationViewer as a simple wrapper around jfig.gui.JPresentationViewer.main to keep PresentationBuilder working with both the old (AWT Java 1.1) jfig-presentationviewer.zip and the new (Swing Java 1.4+) jfig-jpresentationviewer.zip. F fix jfig.gui.JPresentationBrowser to *ignore* spurios ItemEvents. F change registration reminder in itext and imageio export. 10.05.05 N upgraded the examples in JModularEditor (JEditorMenuBar). N new Swing-based presentation viewer, jfig.gui.JPresentationViewer including new JPresentationBrowser. Runs, but not really tested yet. 09.05.05 F fixed jfig.canvas.FigSwingCanvas to update the objectGR object from showRulers() when necessary. F shorted registration reminder dialog wait times (30 secs instead of 60 secs now). N update the 'internal' help documentation for jfig3. Also renamed FAQ/README/LICENSE/CHANGES to *.TXT for better Windows compatibility. F changes in jfig.gui.JLayerManager: renamed some methods; then changed isLayerVisible() to automagically call addLayer() for any as-yet-unknown layers. This fixes the surprising behaviour that doing a 'show all layers' would actually hide all objects on layers unknown to the JLayerManager. We still avoid to do a 'reload' from the JEditXXXDialogs, but that might be an even better fix. F added another try-catch block to jfig.utils.ItextPDFWriter. paintOneObject (FigImage path). By default, iText looks for the image relative to the current working directory. This fails, whenever the user changes the working directory during an editor session, because the system property 'user.dir' is never updated. Instead, we also try to construct the full filename from the image name and the filename of the image's parent figure file. This seems to work on Linux, but needs testing on Windows. F many classdoc changes to keep the JDK 1.4.2 javadoc happy. 08.05.05 F add setDefaultCloseOperation( HIDE_ON_CLOSE ) for those JDialogs and JFrame, where useful and still missing. Remaining windows without are: jfig.gui.JStringDialog (only used for UrlDialog now) and jfig.gui.JConfirmDialog... 04.05.05 N updates and many fixes (thanks, Lu!) in the jfig tutorial; also using American English now... F fix jfig.java2d.FigArcRenderer to handle the special case of singular (=straight line) arcs; we do this by creating the arrow- corrected path as we would for a FigPolyline. N don't require registration in jfig.gui.JFontConfigurationDialog. F fix jfig.gui.JImageIOExportOptionsDialog registration handling N preparations for the website update... 02.05.05 N rename "Cancel"-buttons to "Close" on the export options dialogs; also better tool-tip texts. F changed jfig.objects.FigText.setTextCursorFromPosition() to a new algorithm that also supports textCursorIndex=0 and textCursorIndex=text.length() (leftmost and rightmost positions). F started rewriting the built-in documentation. F fixed jfig.objects.FigText.move() to call update_bbox() after all, because the previous algorithm failed to update the 'border' polygon. F new SetupManager property "jfig.gui.Editor.DeleteKeyWorkaround"; the default value is false which fixes the 'DEL'-key deletes two chars on current Windows JVMs. 27.04.05 N show current (truncated) figure file name in window title instead of version number. N option to automatically add the ".fig" extension when saving new figures or using save-as: this is what Windows users expect. Activated via a valid value for the following SetupManager property: jfig.gui.Editor.FilenameExtension .fig jfig.gui.Editor.FilenameExtension .jfig 26.04.05 F found and fixed another bug in jfig.utils.ClearUnusedUserColors; we now keep track of and change fill-colors inside compound objects. N changed jfig.gui.PrintManager$Manager2D to use the JDK 1.4 API, including the PrintRequestAttributeSet stuff. While we still can't select custom paper sizes, the dialog now remembers the previous settings for paper size, paper orientation, and printer. Also testet that removing the JDK-supplied clipRect from the printer graphics works in print(). This is currently not used but will allow us to print beyond the JDK-supplied default borders of 1-inch. F changed jfig.java2d.FigPolylineRenderer and FigXSplineRenderer to use separate paths for filling and drawing when necessary: for drawing we want the arrow-correction, but filling should use the full (interpolated) outline. F changed jfig.java2d.FigSplineRenderer and FigBezierSplineRenderer to use arrow-correction. 25.04.05 F changed jfig.objects.FigParser to use LineNumberReader instead of BufferedReader; this means that the parser should report correct line numbers now... F jfig.objects.FigCompound.update_bbox now also updates (x,y) position. F fixes in jfig.gui.ColorCache and jfig.utils.ClearUnusedUserColors to make things (a little) more robust. N first code for new class jfig.utils.FindObject. F another few hours of playing with the several printing APIs; those attempts are documented as comments in jfig.utils.PrintServiceTest. While it seems that we can modify the clip-rect inside the print() method to avoid the annoying 1-inch insets, there is no way to actually specify a custom page format - even A4 is ignored. F new methods getScreenCoordsX, getScreenCoordsY, getScreenCoordsDX in jfig.canvas.FigTrafo2D; while the wc_to_screen(_x/_y) variants round their return values, the new methods return double precision values. Used in jfig.utils.ItextPDFWriter to avoid rouning errors and improve text positioning. 22.04.05 N implemented 'objectRubber' mode in jfig.canvas.FigCanvasRubberband: this draws the complete FigObject instead just its outline like 'bboxRubber' does. Acceptly fast on my system for up to a few hundred objects. Zooming while 'objectRubber' is active will not work, because the visibility-bounding-box-calculation is not updated, but this happens for the other rubberband modes, too. Test implementation in jfig.commands.CopyObjectCommand, but not yet active by default. F changed jfig.utils.ComposeCharacterConverter to keep a backslash if no known unicode or compose control sequence follows. F just tested jfig3 with Kaffe-1.1.5 on Linux. While the editor starts, all menu callbacks and all object drawing is broken... F changed jfig.objects.FigEllipse.supportsPointOps() to return true only if fig_angle=0. Due to the difficulties in finding a useful behaviour for the rotated-ellipse-case, this is the least painful solution for now. The problem is that we can't really set both the selected new position of the ellipse control point while keeping the rotation angle constant. N new method jfig.objects.FigEllipse.getRotatedPoints() that correctly calculates the four corner points of the bounding box rectangle for the ellipse. Used for the viewport-visibility tests, showPoints- rendering, and object selection. This greatly improves handling and user-friendlyness of rotated ellipse objects. However, move-points remains suboptimal, because the getPoints() and setPoints() method don't respect the rotation angle. As this operation is only used rarely, a fix is not planned. F also change the rotation angle jfig.objects.FigEllipse.mirrorX() and mirrorY() to actually mirror the ellipse... 21.04.05 F partially fix ellipse selection in jfig.objects.FigEllipse via new selectionBbox in addition to our standard bbox variable. Also change minDistance(Point) to minDistance(Point,gridSpacing). N added jfig.java2d.FigTools2D.createPath( Point[], start, end, closed ), first used in FigArcRenderer. Also handles stick-type arrows and back-type (indented) arrows on arc correctly now. N implement PPM export (via jfig.utils.PPMWriter instead of ImageIO) as the fallback format in jfig.gui.JImageIOExportOptionsDialog. Added updateOutFilenameExtension() method to update the extension when the user selects a different file format. N add JPG export option to jfig.gui.JEditorMenuBar and corresponding callbacks in jfig.gui.JModularEditor. F remove offending methodnames from several classes; also removed some outdated debug messages. 20.04.05 N added new constant DOTS_PER_SCREEN_DOTS to jfig.canvas.FigTrafo2D; corresonding changes throughout the jfig class hierarchy. This removes all dependencies on the fixed scale factor of 32 that resulted from the assumption of a constant 75dpi screen resolution. Most importantly, we can now switch to 72dpi as assumed by the AWT font rendering and the iText PDF rendering. N first implementation of jfig.utils.MHG.colorbar(). Also several minor fixes in jfig.utils.MHG. N another change to jfig.java2d.FigArcRenderer. We now position the arrowheads as fig2dev does, with both point and end of the arrow aligned on the arrow circle. Looks pretty good now (except for a slight glitch when using 'round' arrows on very thick lines). F refactoring: new constants FigAttribs.DOTS_PER_MM and FigAttribs. FIG_LINEWIDTH with current values of 96.0 (instead of 2400/2.54 = 94.488...) and 30. Replaced all corresponding numerical constants throughout jfig3 with these constants; this allows us to change the scaling later if necessary. 19.04.05 N added new command-line options '-fig2pdf', '-fig2png', and '-fig2jpg' to jfig.gui.JModularEditor. This means that you can now use jfig3.jar as a replacement for fig2dev for PDF, PNG, and JPG output formats: java -jar jfig3.jar -fig2pdf -mag 1.0 -border 5.0 file.fig file.pdf etc. F added a command-line mode to jfig.utils.ItextPDFWriter; corresponding changes to jfig.gui.JPdfExportOptionsDialog to use the new function fig2pdf(). Support -mag and -border options now. (FIXME: -mag doesn't work for center-right-aligned text yet.) N added a command-line mode to jfig.gui.JImageIOExportOptionsDialog. Supports -png -jpg -aa (antialias) -rq (renderquality) -mag and -border . Unfortunately, embedded images are broken in this mode, because each object is only paint()ed once, and this only starts image loading in AWT. We really need a solution here. For most cases, however, this should be a workable replacement for fig2dev -L jpg and fig2dev -L png modes. N use RenderingHints.VALUE_FRACTIONALMETRICS_ON when anti-aliasing is requested in jfig.canvas.FigSwingCanvas and JImageIOExportOptionsDialog. F minor fixes in jfig.gui.JEditorMenuBar. 18.04.05 N use RenderingHints.VALUE_STROKE_PURE when anti-aliasing is requested in jfig.canvas.FigSwingCanvas and JImageIOExportOptionsDialog. This greatly improves the rendering of arcs and splines when the operation is supported by the underlying Graphics device and JVM. N new class jfig.gui.JImageIOExportOptionsDialog with ImageIO-interface for PNG and JPEG format image export. We support adding an extra border around the image, user-specified magnification factor, anti-aliasing, and render-quality (bilinear image interpolation). Unfortunately, encoding the images via ImageIO.write() is pretty slow on my system (several seconds per image). N changed jfig.gui.JExportOptionsDialog to add a 'tmpFilename' including corresponding textfield. The filename is created via File.createTempFile() if available (JDK 1.2+) or as a new file in the current directory if not (JDK 1.1). The current figure is saved to that temporary file before exporting, thus avoiding the exported-figure-is-based-on-last-saved-figure-but- not-the-current-figure-bug reported recently. Not extensively tested yet, please provide feedback if bugs occur. N changed jfig.java2d.FigArcRenderer to calculate arrow orientation based on arrow length. This makes arcs with unusually large arrowheads looking better (and fixes the gap between arrowhead and arc for very long arrowheads when using the new clipped arcs). The orientation calculation is based on experiments but seems to work for most cases. There is really nothing we can do when you try to add very slender arrowheads on a very thick line. F fixed jfig.java2d.FigImageRenderer to suppress the 'drawing failed' message for invalid/non-existing images after MAX_REPAINT_ATTEMPTS attempts have failed. 15.04.05 N implement createArrowCorrectedLine() and createArrowCorrectedPath() to be used for polylines and arcs/splines in jfig.java2d.FigTools2D. Used in jfig.java2d.FigPolylineRenderer, FigArcRenderer, and FigXSplineRenderer now; not yet used by FigSplineRenderer and FigBezierSplineRenderer. The behaviour can be switched on or off via the new SetupManager property "jfig.java2d.clipLinesUnderArrows"; the default value is "true". 11.04.05 N new arrow-rendering strategy for better-looking arrows in Java2D: for 'simple' (stick-type) arrows, we keep the arrow linewidth the same as the underlying polyline/arc/spline linewidth. These arrows are renderered using JOIN_MITER with MITER_LIMIT=5.0f. This results in sharp arrows, that may extend a little beyond their target point (for thick lines). For all other arrow types, we use JOIN_ROUND and clip the arrow linewidth to the value of jfig.java2d.FigArrow2D.MAX_LINEWIDTH (currently 50 units at 2400dpi). F fixes in jfig.objects.FigArc.getPreciseBoundingBox() and createRenderer(). 10.04.05 N implement several variants of image() in jfig.utils.MHG. To avoid excessive memory consumption, we don't create individual patch()es or fill()s but use a BufferedImage to hold the pixel data and write the data to a PNG-format image file using ImageIO. At the moment, a unique file name is created via concatenating 'jfig-mhg-' with System.currentTimeMillis and '.png'. N changed jfig.objects.FigAttribs to initialize fig_line_color and fig_fill_color with value 0 (black) instead of -1 (black, used by xfig). This avoids warning messages from FigWriter. N SetupManager property 'jfig.commands.CreateTextCommand.altDownUmlauts' to control the + umlauts hack in CreateTextCommand; You can now use +a, ++A, ... +s to type äÄöÖüÜß again. No similar workarounds for other languages/special chars planned, however. Use the 'parse unicode and compose chars' function in EditTextDialog, if necessary. 08.04.05 F refactoring in jfig.commands.RotateObjectCommand. Introduced new subclasses RotateObjectCWCommand and RotateObjectCCWCommand to handle clockwise and counter-clockwise rotation, which gets rid of the 'static' rotation mode mess. Also fixed undo and redo. N implement undo in jfig.commands.CutToClipboardCommand. Note that there is still no need to undo a CopyToClipboardCommand; neither is it possible to recover previous clipboard contents. N implement undo in jfig.commands.PasteFromClipboardCommand, covering both the paste-as-compound and paste-as-individual-objects variants. N 'parse unicode and compose-chars' button on jfig.gui.JEditTextDialog. 07.04.05 F changed jfig.objects.FigPolyline and jfig.objects.FigParser to suppress arrows on closed polylines (polygons) and rectangles. N initial (incomplete) colormap support in jfig.utils.MHG: new inner class Colormap, default initialization, 'jet' and 'autumn' maps, caxis(), etc. 05.04.05 N added class jfig.canvas.DelayedRepaintHandler to try fixing the image loading problems on Linux; jfig.java2d.FigImageRenderer now checks whether image painting succeeded and tries additional repaints after 200 msecs and again after 2000 msecs if the first painting failed. Despite all this, the AWT *STILL MANAGES* to not load or paint broken images from time to time. Unfortunately, I fear that Sun Microsystems will not fix the drawImage() functions anytime soon. N new class jfig.utils.ClearUnusedUserColors. This traverses the object tree, creates a histogram of all used line and fill colors, then clears all unused colors. Used by JModularEditor.clearUserColors() now. F changed jfig.gui.ColorCache.putUserColor( index, rgb ) to check and ensure that all lower color indices are assigned. This removes a couple of difficult-to-fix-bugs at the cost of slightly-crowded JColorButtons... F changed jfig.objects.FigCompount.paint( Graphics, FigTrafo2D ) to handle a null clip-region. This happens when exporting to PNG etc. 04.04.05 N changed jfig.objects.FigArc.getBbox() to use getPreciseBoundingBox() instead of FigPolyline.getBbox(). This fixes the corner cases of filled arcs and nearly singular arcs, but incurs some performance hit. F removed class jfig.objects.FigArrow; might be re-introduced later for AWT-based rendering. F removed the one-parameter paint(Graphics g) methods from jfig.objects. FigBaseobject, FigImage, FigRectangle, and FigText. We now require that the FigTrafo2D coordinate transformation is always passed to the paint() methods. N changed jfig.utils.BoundingBoxCalculator to include or ignore invisible objects (e.g., layer switched off) during the bounding box calculation. Changed jfig.canvas.FigSwingCanvas.doZoomFit() to use the new option to ignore invisible objects! N changed jfig.objects.FigObject.minDistance() and minDistanceEuclid() to take a second parameter. Pass in a non-zero value measured in 2400dpi to influence the distance calculated for off-grid points. This is intended as a replacement for the previously used magnetic-grid spacing (we cannot use this anymore because the objects don't keep references to a coordinate transformation any longer). Corresponding changes in JModularEditor.findObjectAt(). F fix unnecessary Java2D dependency in jfig.objects.FigCompound.paint(); we now call the re-instated paintMarkers() method in FigBaseobject. 30.03.05 N added the TeX-mode support macros to the jfig3.jar class archive and the help menu. F changed jfig.gui.JModularEditor.mousePressed() to not deliver events to command subclasses when the mouse event was inside the object canvas rulers via objectCanvas.isInsideRulers(). This fixes the 'spurious- anchor-point-set-in-rotate-command-when-clicking-the-rulers-bug'. Note that this extra check was unnecessary when relying on FigCanvasEvent, because FigCanvas would check this. F changed jfig.gui.JModularEditor.doExportPDF() to first call doCancel() to avoid exporting the object markers... (the other export functions already had this). F changed jfig.gui.JEditorMenuBar to also try loading a few Java2D-classes before enabling the PDF-export menu item; required for backwards- compatibility with JDK 1.1 generation VMs. 27.03.05 F call update_bbox() from jfig.objects.FigEllipse.move() F changed jfig.java2d.FigXSplineRenderer to request ROUND join-style for spline rendering. F changed jfig.java2d.FigRectangleRenderer to use the new FigTools2D. createStroke() overload to specify ROUND join and cap style for rounded rectangles, while using MITER and SQUARE join and cap styles for normal rectangles. F new overlead of jfig.java2d.FigTools2D.createStroke() that allows to specify the join and cap styles explicitly. Added corresponding utility methods getStrokeJoinStyle() and getStrokeCapStyle(). 25.03.05 F change jfig.gui.JColorButton.selectColor( Color unknownColor ) to use a linear search through the existing FIG and user colors. This is slightly slower but ensures that the mapping works for FIG files with non-contiguous user color ranges. F respect object visibility for the handle-region-variants of jfig.commands.DeleteObjectCommand, CutToClipboardCommand, CopyToClipboardCommand, and CreateCompoundCommand. That is, objects on hidden layers are no selected any longer during the select-region operations of the above commands. F changed jfig.objects.FigWriter to write all objects including invisible ones. This avoids to destroy your figure file by saving the file while one or more layers were hidden via LayerManager... F added jfig.objects.FigRectangle.setRoundedCorners() method; however, it is unclear whether the setAttributes() and update() methods should call this when attribs.cornerRadius=0.0. F changed jfig.java2d.FigRectangleRenderer to only draw rounded rectangle when isRounded() returns true. 24.03.05 F re-enable creation of next text lines in jfig.commands.CreateTextCommand. Also call doFullRedraw() when creating a new text object in order to show the text cursor at the new object's position. N add SetupManager property "jfig.objects.FigText.leading" to control the inter-line spacing when creating multiple text objects. Default value is "1.2", compatible with the behaviour of older versions. Use larger values in your configuration file to increase the spacing. N utility method jfig.gui.FontCache.getZoomedFontMetrics. 23.03.05 F remove the default paint(Graphics) methods from FigDrawable, FigObject, and FigRenderer. You always have to pass-in a FigTrafo2D now. F changed jfig.objects.FigParser.parse_fig_file_private() to maintain the global attributes with the file header information, but to pass cloned attributes to the individual parse_fig_xxx methods. This means that parsing normal splines and x-splines should work again for all supported file formats (FIG 2.1, 3.1, 3.2). Also checked that FigAttribs are used correctly in jfig.objects.*; F fixed jfig.objects.FigWriter.write_fig31_cpointline(); we need to call buildSpline() instead of update_bbox() after the recent refactoring. N added jfig.commands.AddRemoveArrowCommand. 22.03.05 JB changed the behaviour of JImageButton and JStateButton to use mouseReleased instead of mousePressed for their selection action; this makes the buttons behave like standard JButtons and helps avoiding the annoying beeps generated by the modal select dialogs. (Previously, the select dialog would be shown in reaction to a mousePressed, and the following mouseReleased would trigger the beep because the new dialog already had the focus...) The alternative would be to (1) fix Swing, (2) to make all select-value dialogs non-modal. F make jfig.commands.EditCommentCommand behave like other edit modes, that is, you can now edit multiple comments without have to re-select the command via the menu. N new SetupManager properties to control spline and x-spline quality: jfig.objects.FigSpline.stepsize 30 jfig.objects.FigBezier.stepsize 30 jfig.objects.FigArc.nlines 100 F actually implement fixes for most FIXMEs in jfig.objects.* F fix jfig.objects.FigArc to avoid re-calculation of the interpolated arc points unless really necessary. Use default (circle) bounding-box in getBbox(), but added getPreciseBoundingBox() method. F fix calculation of required number of interpolated arc segments in jfig.objects.FigArc. The value is proportional to a new property, "jfig.objects.FigArc.nlines", the arc radius, and the arc radians by the following formula, but at least 10 and at most 500 segments are used: N = (int) (nlines*radius/2400.0 * radians/(2*pi)) F fix jfig.java2d.FigArcRenderer for better orientation of arrowheads; also disable arrowheads on filled arc objects (pie wedge style). F fix jfig.objects.FigSpline to re-allocate the internal points buffer when necessary; also respect the "jfig.objects.FigSpline.stepsize" property. Useful values are in the range 50..500; smaller values mean better precision but more interpolated points. N new mode buttons for "join split lines" and "add or remove arrow" commands. N new icon for "arrow mode none" (transparent gif now created via xbmtopbm buttons.xbm | ppmtogif -transparent white > buttons.gif) 15.03.05 N first updates to the tutorial 12.03.05 N first code for the planned jfig3 11.03.05 F JDK-1.1 compatibility fix in jfig.utils.JRecentFileManager.saveToFile() 10.03.05 N changed version to 2.23 (10.03.2005) F fix undo/redo in jfig.commands.CreateRectangleCommand: we re-use the created rectangle instead of creating new ones for redo(). F same as above for CreateArcCommand, CreateCircleCommand, CreateEllipseCommand, CreateRoundRectangleCommand. B undo/redo is still broken (in special cases) for RotateObjectCommand, ScaleObjectCommand, and AlignObjectCommand. Also, ResizeTextCommand should be cleaned up. F fix undo/redo/execute in jfig.commands.CopyObjectCommand. N change jfig.commands.ConvertObjectCommand to three-mouse-button style: L: convert object type, M: toggle open/closed, R: toggle fill Also fixed undo/redo for this command. F fix jfig.gui.JModularEditor to load the local .jfigrc config file before checking the registration key. N changed the scale() method in jfig.objects.FigBaseobject to check for and respect the 'jfig.scaleLineWidth' property. N changed the scale() method in jfig.objects.FigPolyline to check for and respect the 'jfig.scaleLineWidth' property. N changed the scale() method in jfig.objects.FigText to check for and respect the 'jfig.scaleFontSize' property N add two new JCheckBoxMenuItems to jfig.gui.JEditorMenuBar: 'scale line width' and 'scale font size'. N added the 'jfig.scaleLineWidth' and 'jfig.scaleFontSize' properties to the global configuration file, default values are 'false'. N added jfig.utils.SetupManager.setBoolean( key, value ) method. 04.03.05 F added jfig.objects.FigParser.clipRotationAngle() method to clip and rotation angle to the range [0..2PI]. Use this method when parsing ellipse and text angles to ensure positive ranges. Previously, negative angles would be clipped to zero when trying to use the edit-object dialogs. F fix jfig.gui.JAttribsControlsFactor.showRotationAngle to round the angle (internally managed in radians) before showing it in degrees. This avoid the annoying rounding problems like 30 degrees shown as 29 degrees, etc. F fix jfig.java2d.FigTextrenderer to show the object markers for TeX-mode objects. 03.03.05 F fixed jfig.commands.JEditObjectCommand.createShowEditVertexDialog to not show the dialog for vertex index -1 (which indicated no vertex selected). 01.03.05 N great progress with the new tutorial and user-guide: 120+ pages. 25.02.05 F changed jfig.utils.PresentationBuilder to create a new ZipEntry instead of cloning the existing ZipEntry when copying a JAR archive to the presentation JAR. See Java bugs section, above. 17.02.05 N new class jfig.gui.JUserEditor to demonstrate custom Swing-based editors. F changed jfig.java2d.FigTextRenderer and jfig.utils.ItextPDFWriter to support a new SetupManager option, jfig.utils.SimpleLaterParser. fontMode 1=Lucida fonts 2=Computer Modern fonts 16.02.05 F changed jfig.gui.JFigViewerBean to use "noRubber" as its default rubberband. Also changed the default popup menu to include an "exit" menu item when running standalone. 15.02.05 N the new tutorial is coming along nicely... 03.02.05 N changed all jfig.gui.*Button classes to use explicit qualification to the outer class in the *Select*Dialog inner classes. This was necessary to keep gcj happy and also improves consistency a bit. 10.01.05 N added new methods getStringWidthPoints() and setPDFMapper() to jfig.utils.LP2. The default implementation of getStringWidthPoints() uses the AWT font metrics and behaves like previous versions. When setPDFMapper() is called, the corresponding object is expected to provide its own implementation of getStringWidthPoints(), which is then called (via reflection). Reflection is used to avoid explicit extra dependencies in LP2. ItextPDFWriter now uses its own PDF font metrics, resulting in much better appearance of attributed strings in PDF output. 03.01.05 N changed jfig.utils.LP2 (the LaTeX parser) to support automagic concatenation of CharBox'es with matching font attributes to a single CharBox with a larger string. The behaviour can be changed via the SetupManager property jfig.utils.SimpleLatexParser.useWords 07.12.04 F changed jfig.gui.ColorCache and jfig.gui.JColorButton to handle non-contiguous user color indices. Caveat: Not fully tested yet, may result in broken FIG files. Also, debug messages are still on. 06.12.04 N improved jfig.commands.ConvertObjectCommand: toggle rectangle-> round rectangle->ellipse (or square->rounded square->circle). Use shift-click to toggle no fill -> solid fill -> 180% fill F fix jfig.commands.CreateBulletCommand to actually create filled bullets (wrong fig_area_fill style used before this fix). 03.12.04 B addUserColor/registerUserColor in ColorCache are broken, when a FIG file has non-consecutive user color assignments. No workaround, yet. 17.08.04 F removed all invalid Graphics.dispose() calls; they seemed to work with JDK 1.4.2 but resulted in Gcj/Gtk crashes. 13.08.04 F fix incorrect mouse-wheel panning initialization 01.08.04 N many new functions for MHG plotting. 23.06.04 F fix integer overflow in jfig.commands.CreateDimensioningCommand for very large lines. 21.06.04 F fix integer overflow in jfig.commands.CreateArcCommand for large arc radius. 17.06.04 N changed jfig.commands.CreateArcCommand to support creating arcs via first specifying their center, then three points on the diameter. 09.06.04 F changed jfig.gui.JPdfExportOptionsDialog to call pdf2D.dispose() after drawing all FIG objects. This seems to fix the pdflatex scaled-PDF-figures-also-scale-the-text-bug reported by M.van Eeten. 07.06.04 F disable warning-message in jfig.commands.CreateTextCommand when the uses types aouAOUs with the right-mouse-button pressed (or, rather, with control-key pressed and that MouseMapper setting). 02.06.04 F fix makefile to include jfig.utils.ItextPDFWriter in jfig2.jar 05.05.04 N new GUI option (menu->view->enable mouse wheel scrolling) to enable or disable mouse-wheel scrolling. 30.04.04 F fix annoying typo jfig.objects.FigAttribs.setFillColor() to actually use fill_color instead of line_color... 22.04.04 F new option "jfig.utils.MouseMapper.ControlClickIsRightClick" to keep Mac-users happy. Note that OS-X 10.3.3 sometimes loses the ALT and META keyboard masks in InputEvent... 21.04.04 N new class jfig.utils.TeXtoPNGConverter, basically a tool to create PNG-formatted screen shots from TeX-formatted strings. F changed jfig.utils.LP2 to improve the handling of "display-math" symbols: _Sum, _Prod, _Int now change the font-sizes for the subscripts and automatically use a bigger font-size for the symbol itself. Also added the y_offset parameter to LP2.CharBox, allowing to vertically offset chars with respect to their boxes baseline (e.g. used to move the _Sum and _Prod symbols slightly below the baseline). For example: $hH(f) = \Int{-\inftyr}{+\infty} h(t)e^{2\pi ift} dt$ 16.04.04 N experimental feature "mouse wheel panning and zooming": mouse-wheel-up/down: pan up/down shift+mouse-wheel-up/down: pan left/right cntl +mouse-wheel-up/down: zoom out/in Implemented via reflection to avoid problems on older JDKs, new class jfig.gui.MouseWheelZoomPanHandler. Disable via "jfig.gui.Editor.MouseWheelPannning"=false in your configuration file. F enable the mouse-wheel listener on state-buttons even in the unregistered version. (jfig.gui.JStateButtonMouseWheelHandler) 07.04.04 F fixed jfig.utils.LP2 to handle "\{" and "\}" commands in math mode with CM fonts enabled. F changed jfig.utils.ItextPDFWriter and ItextPresentationPDFWriter to allow "four-up" export of FIG-files with FigImages: the new method setPageOffsets() allows to offset the raw images depending on the page number. 05.04.04 N added option for built-in PNG export via javax.imageio.ImageIO. 01.04.04 N refactoring: collected the common PDF writing methods in class jfig.utils.ItextPDFWriter, corresponding changes and cleanups in jfig.utils.ItextPresentationPDFWrite and jfig.gui.JPdfExport- OptionsDialog. Note: the page-numbering hack has not been re-tested, yet. N changed jfig.utils.ItextPresentationPDFWriter to embed images via the iText Image.getInstance() path instead of loading and rendering them via Graphics2D. This means that the images are included into the PDF output file "as is" without unpacking and re-compression, resulting in much faster operation and much smaller output file size. Seems to work fine, but not tested extensively yet. 10.03.04 F disable ruler panning and dragging when rulers are hidden. This also means you can disable dragging in the jfig-bean. F changed JPdfExportOptionsDialog to use 72dpi (instead of 75dpi) for drawing. This ensures that printing at 100% magnification actually results in the correct size. 09.03.04 F changed JPdfExportOptionsDialog to check for "symbol font" text objects (font index 32) and to use the built-in BaseFont.SYMBOL font for rendering. This means that drawings with greek and math symbol are exported correctly. If you need finer control you should use TeX-mode objects. 04.03.04 F changed jfig.utils.ItextPresentationPDFWriter to also use the new rendering code from JPdfExportOptionsDialog to handle center- or right-aligned text objects. F JPdfExportOptionsDialog now correctly handles compound objects and left/center/right-aligned or rotated text objects, including TeX-mode text objects. Still needs to handle the character-remapping for symbol-font. F changed the default value of "verbose" to false in ItextFontMapper. This means that the PDF export now is silent. 03.03.04 N initial support for the xfig "join/split lines" command, new dummy class jfig.commands.JoinSplitLinesCommand F changes in jfig.gui.JPdfExportOptionsDialog to correctly position left/center/right-aligned strings even when using Graphics2D rendering... 23.02.04 F \mathrm{} fixes for Latex when using CM fonts. This currently changes fontIndex to CMR without further ado. Haven't tested whether this also works for CMSS/CMTT instead of CMR... might also need \mathss{} and \mathtt{}. Note that you have to put \mathrm{} inside an additional group to restore to math fonts after the group. That is: "times $cmmi {\mathrm{times}} cmmi again$ times again" N get correct object bounding boxes for TeX-mode text objects. 19.02.04 N Latex-parser refactoring complete. New features include support for commands with arguments, stacked boxes, char-boxes now use the individual height of their actual contents instead of the Font's maximum ascent and descent values, accents, sqrt, ... Newly supported commands: * \frac{group1}{group2} * \sqrt{group} * __stack{top}{center}{bottom} l=left,c=center,r=right aligned: * \lstack{}{}{} \cstack{}{}{} \rstack{}{}{} * \underline{group} \overline{group} * \Sum{subgroup}{topgroup} e.g. \Sum{\xpt i=0}{\xpt N} * \Prod{subgroup}{topgroup} * \Int{subgroup}{topgroup} * accents: \hat{group} \tilde{group} \vec{group} ... 13.02.04 N started a complete overhaul of the Latex-parser... 05.02.04 F added jfig/fonts/*.ttf to make srczip B need to update FigText.update_bbox() to calculate the correct bounding-box for TeX-mode texts. N updated jfig.java2d.FigTextRenderer to support rotated and aligned (left/center/right) TeX-mode texts. While the rendering seems to work without problems, the bounding-box calculation inside FigText hasn't yet been updated. N update jfig.canvas.FigSwingCanvas to use 90-degrees rotated labels on the right ruler. Also use jfig.utils.Format for the label formatting. 08.01.04 F fixed classdoc comments throughout jfig.*.* F added get/setObjectList() methods to JFigViewerBean, allowing to modify the object list of the bean. N new class jfig.utils.TextLatexParser, used as a testbed to check embedding into our HTML parser. F added missing FigCanvasRubberband.getMode() method and corresponding check for noRubber in FigSwingCanvas.paintNoChanges(). NOTE: this changes the behaviour of FigSwingCanvas when noRubber is selected to hide the jfig-internal tiny-cross cursor. Previously, noRubber behaved like pointRubber (i.e., showing the tiny-cross cursor). 05.01.04 F fixed wrong-IEEE-format-mantissa in TeXdemo.fig 03.01.04 N new class jfig.gui.JFigViewerBean that implements a simple FIG file viewer as a Java Bean component. JFigViewerBean allows to embed FIG drawings into your own applications very easily. F changed JModularEditor to set JFrame.DO_NOTHING_ON_CLOSE to inhibit exiting the editor when the user first closes jfig via the window manager but then selects "Cancel" in the confirmation dialog. F added clearAllEntries() method to JRecentFileManager. N added new sort() method to jfig.objects.FigObjectList, meant to improve updating the object list after changing the layer attribute on several objects. Beware: never tested yet. 29.12.04 N updated jfig.commands.CreateDimensioningCommand to actually respect the specified SetupManager properties for the attributes (font, fontsize, linewidth, arrow size, units, etc.) of the created dimensioning compound. Also fixed the text label formatting (rounded to 2 decimal places) and orientation. Finally, the default attribute settings now conform to the rules (German DIN standards) for technical drawings, taken from the book 'Hoischen, Technisches Zeichnen, 23rd. edition'. 28.12.04 F several API cleanups throughout the jfig class hierarchy, e.g. added FigTrafo2D.setUnits(),getUnits() methods, etc. F added utility attribute setter methods to all jfig.objects.* classes. For example, FigPolyline now has methods setLineColor(), setLineWidth(), setLineStyle(), setFillColor(), setFillStyle(), setArrowMode(), etc. Note that each of these methods may result in a call to rebuild(), which may incur a preformance penalty when compared to directly settting several attributes and then calling rebuild only once. 18.12.03 F added utility method FigAttribs.setRotationAngle( String ). 15.12.03 F some refactoring in jfig.java2d.FigTools2D and FigArrow2D to use the "thin lines" hack for arrows, too. The resulting PDF export via Itext should now match the fig2dev -L pdf output. N new option in jfig.utils.ItextPresentationPDFWriter to include pagenumbers in the written PDF. Currently, the following hack is used: the FIG files in question may include a magic text object with text "#pagenumber#". If such text object is found, its text is substituted with the value of the 'pagenumber' variable, whose value is then incremented, and the object is painted in black. You may want to add one such text object to each of your slides, preferably in white (or your background) color, so that the text doesn't show up when viewing the slides one by one... Added corresponding command line argument "-page " to allow page numbering starting with the given integer. 12.12.03 N new class jfig.commands.CreateDimensioningCommand for easy creation of "dimensioning" annotations to your figures. The appearance of the dimensioning arrows and label is not yet perfect; however, not knowing the rules of technical drawings, I cannot obey those rules... Please feel free suggest improvements... See the source code for the createDimensioning() method for details; NOTE: the line-lengths shown in millimeters are useful only when using the "mm" setting for the jfig rulers. When using the "xmm" or "inch" settings, the line-lengths will be shown correclty, but will not be nice, even numbers... N new class jfig.utils.MatlabHandleGraphics and corresponding test class TestMatlabHandleGraphics. It provides a "handle graphics" interface to object creation via text(), patch(), line() etc. and object searching via findObject(). N implemented jfig.objects.FigAttribs.setFont( String ) and fixed some issues with the string-based initialization methods. 11.12.03 F changed jfig.objects.FigAttribs.SOLID_LINE .. DASH_DOT3_LINE to match the corresponding values in the FIG specification. This means that fig_line_style is no longer needed. 10.12.03 N new utility methods in jfig.objects.FigAttribs to initialize object attributes from strings ("red dashed layer=10" "black fillcolor=yellow fillstyle=150% <->" etc.) 04.12.03 N support for "extra border" in jfig.gui.JPdfExportOptionsDialog 28.11.03 N A comparison of fig2dev- and iText-produced PDF files shows that fig2dev seems to use different line widths than the FIG specification: Whereas the FIG format spec stores an integer n to specify the line width as n*(1/80th) inch, fig2dev renders (1/160th) inch for n=0 and (n-1)*(1/80th) inch for n>1. I think that this actually looks better. After an experimental hack in jfig.java2d.FigTools2D.createStroke(), jfig now uses the reduced line width, too. Note that Java2D always uses at least one-pixel wide lines, so that the on-screen display should also be ok. Don't hesitate to complain if you do not agree with the new behaviour. It would always be possible to make this a configuration option. 25.11.03 N changed jfig.gui.JModularEditor.doQuit() to check the value of the "jfig.exitOnClose" property. If this is set to "false" we just hide the editor's Frame, but don't really exit(). This is useful when the editor is embedded into another application, e.g. our interactive Matlab scripts. 19.11.03 B for (as-yet) unknown but possibly transformation related reasons, the iText-based PDF export still has some minor glitches: 1) image embedding always uses FlateCompression, resulting in large files when the source images was JPG 2) rendering of compound objects misbehaves, probably due to re-setting of the coordinate transformation in FigCompound As a workaround, just break compound objects before PDF export. N first working version of jfig.gui.JPdfExportOptionsDialog including the full iText interface. N updates to FontCache to load several Computer Modern fonts from the classpath automagically. In order to keep this JDK 1.1 compatible, the CM stuff is handled by an inner class, ComputerModernFontsManager. Currently, it loads (cmr10, cmti10, cmss10, cmsy10, cmmi10, cmex10). N makefile updates to get the cmXX10.ttf fonts packed into the jfig2 archive. This increases the archive file size by roughly 150 KBytes, which seems acceptable given that the end users are spared the font-installation process. 18.11.03 N updates in jfig.utils.ItextFontMapper and ItextPresentationPDFWriter that allow to render TeX-mode strings using the Computer Modern fonts including font embedding. Many thanks for lots of help from Paulo Soares (one of the main developers of itext). 16.11.03 N updates to jfig.utils.LP2 to handle a lot more math commands using the Computer Modern fonts. With very few exceptions, all simple math mode commands are now supported, including greek, calligraphic letters, arrows, relations and symbols. 14.11.03 N changes to jfig.utils.LP2 (LatexParser2) to support either of three rendering modes: (1) mapping to Unicode, relying on the Unicode Lucida fonts, (2) recoding math symbols to Symbol font (FIG compatible), (3) using Computer Modern fonts (TrueType variants). Note that option (3) will allow us to get pure-Java PDF-export and also (possibly) EPS-export working via the Itext and FreeHEP libraries - but it also requires that the CM-fonts are installed. N added basic support for Computer Modern fonts to FontCache. We expect that the following TrueType fonts are installed: cmr10, cmit10, cmbx10, cmss10, cmsl10, cmtt10, cmitt10, cmmi10, cmmib10, cmsy10, cmbsy10, msam10, msbm10. FontCache uses the hardcoded font indices 35..47 for these. If those fonts are not found, requests for them are silently changed to Courier/Monospaced. N added symbolic constants jfig.objects.FigAttribs.FONT_CMR .. FONT_MSBM with values 35 .. 47 for the computer modern fonts. F changed jfig.objects.FigParser to generate a better warning message when TeX/Computer Modern fonts are encountered in the input file. 31.10.03 N added jfig.utils.ItextFontMapper to check for (and allow) old JDK 1.1-style font names, including "TimesRoman" and "Courier"... ItextPresentationPDFWriter should now work with a vanilla itext-1.01 release, without requiring code changes. Also added a "four slides per page" ("-4" command line switch) option to ItextPresentationPDFWRiter and removed several debug messages from the jfig itext interface classes. 24.10.03 N added PDF export options to jfig.gui.JEditorMenuBar, initial implementation of jfig.gui.JPdfExportOptionsDialog. 23.10.03 F disable the tooltips in jfig.gui.JStateButton and subclasses while showing the embedded selection dialog. This should get rid of the annoying tooltips when opening the selection dialog. F fixed jfig.gui.JNumericStateButton to use paintComponent() instead of paint() and to set the font used for rendering the state value. Also new SetupManager properties, "jfig.gui.JNumericStateButton." "FontName" and "FontSize" with defaults "SansSerif" and "11". 10.10.03 F close the nested value dialog from JNumericStateButton when the user presses VK_ENTER in the TextField. 08.10.03 F added a (small) constant penalty value to FigPolyline.minDistanceEuclid to fix the "lines-with-perpendicular-distance-zero-are-found-instead- of-really-distance-zero-vertices" in findObjectAt. This is experimental as has not been tested thoroughly. F two additional workarounds to get (the AWT version of) jfig running with Kaffe 1.1.2: check for kaffe as "java.vendor" in FigAttribs to disable Java2D-support and in ModularEditor. to disable Swing-support. Due to a different class initialization strategy Kaffe still seems to need swingall.jar in the classpath... 18.09.03 F changed jfig.cnf to include the correct PS/EPS format options for fig2dev 3.2.3 (the older 3.2.1 settings are still there, but commented out). 21.07.03 F fixed jfig.commands.CreatePolylineCommand to correctly cancel() a create freehand line operation (remove the MouseMotionListener). 16.07.03 F fixed undo/redo in jfig.commands.CutPointCommand, see note below. F finally found the annoying bug in jfig.commands.MovePointCommand that broke undo/redo for move points on polylines. Caveat: the new implementation uses more memory, because it requires to store a backup copy of the original target object's points array. This might become a bottleneck when doing a lot of move point commands on polylines with very many vertices. 09.07.03 N changed jfig.gui.JExportOptionsDialog to guess a useful default location for the fig2dev executable (c:\windows\fig2dev.exe or /usr/X11/bin/fig2dev on Windows or Unix/Linux systems), even if no jfig.gui.ExportOptionsDialog.fig2devPath property is set. Also added jfig.gui.ExportOptionsDialog.showColorOptions SetupManager property to control whether or not to show the color options GUI. (Still no functional callbacks, however.) F added getFilename() method to jfig.commands.FigBasicEditor in order to clean up the interface to (J)ExportOptionsDialog. Also, this allows to interface Hades to (J)ExportOptionsDialog much easier. F fixed jfig.utils.RegistrationKeyManager to handle truncated registration key strings. 26.06.03 F imported newer version of Format.java (from the CoreJava website), which fixes some errors. For example, conversion of 99.99999..9 with "%8.4f" now yields 100.0000 instead of 99.0000 :-) 24.06.03 N jfig-based SRAM cell demonstration, tams-www/applets/sram/index.html Note that the applet size is just 143 KByte despite using (most) jfig objects and the Java2D renderer classes. 19.05.03 N several minor changes in jfig.gui.PrintManager, namely: * new SetupManager property jfig.gui.PrintManager.border to specify custom page borders (default 1.0 inch), unfortunately even JDK 1.4.2 simply ignores user-defined page formats, arrgh. * don't enforce A4 size paper * new utility methods like dumpPageFormat() N changed jfig.utils.PresentationPDFWriter to the FreeHEP 1.2 API. 18.05.03 N added new method paintSave( Graphics, FigTrafo2D ) to all FigObject* classes in order to better support FreeHEP PDF rendering. The idea of the method is to call Graphics.create() before rendering and Graphics.dispose() after rendering, in order to maintain a clean state of the original (PDF) Graphics object. 05.05.03 F changed the rendering of arrows on closed polygons to match the xfig/fig2dev behaviour, where the front arrow is drawn on the closing line segment. F fix jfig.gui.JPropertiesViewer to actually respect the jfig.gui.EditDialog.FontName/FontStyle/FontSize settings from the configuration files. Also changed the default to 14pt instead of (unreadable) 12pt. 04.05.03 F fix undo/redo for jfig.commands.UpdateCommand - repeated undo/redo should now work. N slightly improved object selection; JModularEditor.findObjectAt() now calls minDistanceEuclid for all polylines that fall into the 2*snapGrid selection region. Still not optimal for abutting rectangles and lines, but somewhat better than before. F fixed jfig.utils.PresentationPDFWriter to actually parse and include all slides from the index (.jpt) file, including the first and last slide :-) 30.04.03 N updated jfig.utils.PresentationPDFWriter to work with the new FreeHep 1.1 API; due to problems/features in PDFGraphics2D we cannot recycle the Graphics object but must create a new clone for each individual drawing operation. This is currently broken for compound objects. 14.04.03 F fix inconsistent mouse-button handling (click vs. middle click vs. shift left click) in PasteFromClipboardCommand. Also added missing repaint after cancel(). 11.04.03 F changed jfig.objects.FigParser.collect_object_comment() to avoid a trailing newline on comments. This is especially useful for one-line comments, and should not harm multiline comments. (Note that FigWriter already includes a check to add a missing newline after a FIG object comment). N first Jython support code for easy jfig scripting (MMKH stuff) 08.04.03 F small fix in jfig.commands.PasteFromClipboardCommand.undo() 07.04.03 N new class jfig.commands.EditCommentCommand and corresponding GUI (menu entry and callbacks) to edit FIG object comments. N added option to break the pasted clipboard selection to jfig.commands.PasteFromClipBoardCommand (use middle-click). F fixed FigWriter to enforce a trailing newline when writing per-object comments. 28.03.03 F added missing calls to close() input and output streams after using them to avoid file locking on Windows (but reported by A.Siebert). 11.03.03 F changed JExportOptionsDialog to supply "-eps" option to fig2dev for fig2devEPS export. This should work with all recent versions of fig2dev. 09.03.03 F check for non-null but zero-length strings in jfig.java2d.Fig- TextRenderer, because JDK 1.4.1 throws an IllegalArgumentException in this situation. F minor change in jfig.gui.JLayerManager.isSelectedLayer() to avoid a NPE when accessing the layer hashtable. F changed jfig.gui.JModularEditor.findObjectAt() to respect the JLayerManager, so that only selected layers are checked for objects. F always use solid lines (instead of dotted, dashed, etc) for arrow- heads in jfig.java2d.FigArrow2D. 23.02.03 N added FigObject.getComment() and setComment() method, corresponding implementation in FigBaseObject and FigPolyline. N added jfig.objects.FigWriter.write_fig31_object_comment(), as well as FigParser.collect_object_comment() and check_add_object_comment(). NOTE: the latter methods are possibly high-risk, as they may break the FIG parser. Also, the global (per file) comment inside the FIG header is not yet supported. 21.02.03 N new class jfig.gui.JEditVertexDialog to specify x-spline control parameters. Not integrated into the editor yet, though. 23.01.03 F removed the erroneos "static" modifier for the RULER_XX variables in jfig.canvas.FigBasicCanvas and FigSwingCanvas. F changed jfig.objects.FigParser.parse_fig_file() to tolerate empty input lines - which seem to be generated by libwmf. Otherwise, this change should not hurt legal FIG files. 10.01.03 F replaced some calls to Java2 convenience methods from java.io.File and java.util.Random with their Java 1.1 compatible predecessors, which restores JDK 1.1.8 and MS jview compatibility for jfig and jfig2... (Note that JFontConfigurationDialog is still not Java 1.1 compatible. This will not be fixed.) 07.01.03 F some new wordings in /jfig/doc/FAQ F removed a lot of unnecessary "synchronized" modifiers from jfig. canvas.FigSwingCanvas. After all, jfig now adhers to the Swing single-thread rule, which means that all operations in FigSwingCanvas are executed by the event handler thread. The only exception is the use of drawAllObjects() for printing, but that also is called by the event handler thread. 06.01.03 F fix undo and redo in jfig.commands.RotateObjectCommand N added GeometryManager support to CreatePolygonCommand N Many improvements to JFontConfigurationDialog, including callbacks, interface to FontCache, tooltips, ... Also, integrated JFontConfigurationDialog into JModularEditor N better tool tip texts for JLayerManager N use RegistrationKeyManager to enable layer management and mouse wheel listerener... 03.01.03 F changed some menu accelerator keys for better Windows compatibility; even using CTRL-O for open now... (jfig2 only) F special case to handle zero line width in all Java2D FigRenderer classes. The extra check is necessary because Java2D BasicStroke interprets a zero line width as the smallest line possible for the given rendering context. 02.01.03 N more infrastructure for checkRegistrationReminder N new class jfig.gui.JTextViewerDialog 01.01.03 I the editor does not yet inform JLayerManager when objects are created or deleted; if necessary you will have to use the "reload" button in JLayerManager to update it. The place to integrate an automatic update is probably handleCommandCallback, but it is not clear that this function is worth the additional complexity required to implement it... F finally fix push and pop in jfig.gui.JStatusCanvas. N first infrastructure for jfig.utils.RegistrationKeyManager. N added menu items and callbacks to show or hide the JLayerManager to jfig.gui.JModularEditor and JEditorMenuBar. The default value is taken from the SetupManager property "jfig.showLayerManager". Note that this controls only whether the JLayerManager is visible; it will only be enabled in a registered copy of jfig. N experimental support for MouseWheelEvent in JStateButton, allowing to increase or decrease the button's state via the mouse wheel when using JDK 1.4+. The implementation uses an inner class for compatibility with older JDKs. Set "jfig.gui.Editor.EnableMouseWheelSupport" to false in .jfigrc if you don't want to enable mouse wheel events. 28.12.02 N new class jfig.gui.JLayerManager. N added new method jfig.utils.ShellSort.shellSort( int[] ). F call repaint() from jfig.gui.JNumericStateButton.setState(), in order to reflect the changed value on the GUI. 23.12.02 F (finally) fixed the silly "suppressing future messages" bug in jfig.objects.FigParser. F added some more pre-defined rotation angles to the rotationAngle button in both jfig.gui.AttribsControls (AWT) and JAttribsControls- Factory (Swing). Also added the 360 degrees value, so that rotation angles between 270 and 360 degrees can be used. N rotation-aware implementation of jfig.commands.CreateTextCommand. executeAndStartNewText(). The new code examines the rotation angle of the previous text object to calculate the correct base line and position of the next line of text. The spacing of the two text objects is (1.2*font height), which seems necessary as the FontMetrics returned by the JDKs use a zero value for the leading. N new, rotation-aware implementation of FigText.minDistance(). The current algorithm calculates the Manhattan distance of the given target point to the text object base point, the text object axis-parallel bounding box. If the target lies inside the bounding box, it next checks whether the target also lies inside the rotated bounding box. If so, it uses a fixed distance of 0.9*magnetic grid. It then returns the minimum of those distances, which allows to easily select the text object, but does not hide other objects. N use lazy initialization for the "JExportOptionsDialog". This saves some resources and startup time for users that do not use this dialog (like myself), and also enforces the Swing single-thread rule for window initialization. N new SetupManager option "jfig.gui.Editor.EnableToolTipManager" to enable (default) or disable all Swing tooltips on the jfig editor and its dialog windows. Unfortunately, it may be necessary to disable the tooltips due to problems (=Java bugs) in the interaction of Swing tooltips and the native window system. For example, some versions of the JDK on Windows and MacOS X lose the keyboard focus if a Swing tooltip appears that extends beyond its parent window... 22.12.02 N changed jfig.objects.FigText to always use the full calculation (including rotation) for update_bbox() and setCursor(). This change implies that including text objects in a compound will now result in the correct size for that compound, and it means that right-clicking a text in CreateTextCommand should position the text cursor at the correct character. However, it also means that selection of nested rotated text objects may be a little bit more difficult that before. N changed JConsole.println(), message(), consoleMessage(), and setText() to comply with the Swing "single-thread" rule. N changed JExportOptionsDialog to use the editor JConsole to print warning and error messages. N new SetupManger property "jfig.gui.Editor.ModalEditDialogs" to select whether to use modal dialogs for the "edit object" command. Non-modal dialogs improve compatibility with MacOS and several X11 window-managers, but should be used with caution. For example, command sequences like opening an edit-dialog, delete object, edit dialog apply, can lead to unexpected behaviour, especially when combined with undo/redo :-) F some new try-catch blocks in jfig.canvas.FigSwingCanvas to avoid problems due to NullPointerExceptions in drawTmpObjects(), clippedDrawTmpObject(), and paint(). 20.12.02 F cleanups and more comments in jfig.utils.SimpleLatexParser. Changed the makefile to include SimpleLatexParser.java in the jfig2.jar class archive. Updated the jfig/doc/TeX-support.txt file to list and document most of the currenly supported macros. Added a few macros, e.g. \mathrm. F disable TeX mode when using the AWT renderers; also indicate this by disabling the corresponding menu items when using AWT. 19.12.02 N new class jfig.gui.JEditXSplineDialog with support to specify the control factors for FigGeneralXSpline objects; note that the control factors for FigBezierXSpline and FigNormalXSpline are shown in the GUI, too, but edits are ignored. N new class jfig.objects.GeneralXSpline.java; this new subclass is required to allow us to override the FigPolyline implementation of insertPoint() and deletePoint(), while BezierXSpline (cubic) and NormalXSpline (quadratic) should retain the FigPolyline methods. Corresponding changes in jfig.objects.FigParser and jfig.objects.FigWriter. jfig should now be *fully* compatible with xfig X-splines. F improved accuracy for arrowheads on polylines and splines N use "ALT-T" as menu accelerator key to toggle the "TeX" display mode in jfig.gui.JModularEditor F changed jfig.gui.ModularEditor initialization so that disabling Java2D via "jfig.allowJava2D false" actually works. Also added new command line option "-awt" to jfig.gui.Editor. N added "Show TeX strings" GUI control and callback to jfig.gui. ModularEditor. 18.12.02 N changed jfig.gui.JAttribsControlsFactory and JAttribsButtonPanel to create and use a JStateButton instead of a JComboBox to select normal/special (TeX) text object support. Also added such JStateButton to JEditTextDialog. N added support to display the individual boxes around the characters in jfig.utils.SimpleLatexParser; activate via the "-boxes" command line flag. N changed jfig.utils.SimpleLatexParser to create one Box per character; this avoids problems with the (very) inaccurate measurements returned by FontMetrics.stringWidth(), because the measurement errors do not add up to large values. Several of my test strings look quite acceptable now on Linux JDK 1.3.x and JDK 1.4.x. 17.12.02 N lots of new code in jfig.utils.SimpleLatexParser, which now handles basic text formatting, FIG colors like \darkgreen, simple TeX macros like \$ or \ , German umlauts ("a"o"u"A"O"U"s), supports many math symbols, nested superscripts and subscripts. This already allows to render all of my (simple) test formulae. The optical appearance is not optimal, however, because the math symbols and greek letters are only available in upright Dialog and SansSerif fonts, but not in the better suited Serif italic fonts (not to mention the CM or AMS math fonts). N new classes jfig.java2d.FigEllipseRenderer and jfig.objects. AWTEllipseRenderer; corresponding cleanups in FigEllipse. The AWT renderer now supports rotated ellipses, too, at the price of slightly lower performance. Rendering of the "control points" is still not optimal for rotated ellipses. The latter, however, will not be fixed unless someone complains about it. F minor fixes in jfig.java2d.FigTextRenderer I looked at a few example FIG files generated by ps2edit, in order to decide whether X-Spline (object types 3.4 and 3.5) support would be worthwile. It seems that ps2edit generates these objects to avoid the "ugly-notches" problem with pure interpolated X-splines. Perhaps we should switch back to the old FIG 3.1 style splines :-) 15.12.02 N added some code and lots of macros to support mathematical symbols via the corresponding Unicode chars in jfig.utils.SimpleLatexParser. 14.12.02 N new class jfig.utils.SimpleLatexParser; intended to support attributed strings and TeX/LaTeX compatible rendering of text objects. 11.12.02 N new separate renderer classes for FigImage. F added missing callbacks to handle the line "dash length" attribute in jfig.gui.JEditImageDialog 10.12.02 I Just to put the information somewhere... On JDK 1.3 Linux, the Java VM seems to use an overhead of 12 bytes per object and 16 bytes per array. For example, an array of 1000 double values takes 8016 bytes, an array of 1000 Point[]s takes 20016 bytes, a FigAttribs[] takes about 220 bytes, a FigText around 600 (depending on the String, naturally), and a FigPolyline with 10 vertices about 900 bytes. Splines are more expensive, for example, a 10 vertex 100 interpolated points Xspline requires around 3 KB for storage. Note that the memory requirements inside Java2D for rendering are not included in these figures. On my Athlon-based system, loading files with 10.000 objects takes about one second, which is fast enough for most of my applications. N changed JSelectFromLibraryDialog to use BorderLayout for the JTree panel. Should look better when maximised. N changed jfig.objects.FigRectangle and FigImage to use the new class hierarchy. However, support in FigImage is incomplete, as filled rectangles may be visible below transparent images. (solutions: either override setAttributes() in FigImage, or change the rendering to not use the rectangle's fill and rounded corners...) N changed jfig.objects.FigArc to use the new class hierarchy; corresponding new classes jfig.java2d.FigArcRenderer and jfig.objects.AWTArcRender. All polyline objects are now using the new architecture. F minor bug fixes in the new FigRenderer subclasses. 09.12.02 N next attempt to clean up the jfig class hierarchy, and to avoid the ugly mixing and inner-class handling of AWT and Java2D rendering. The new architecture encapsulates most of the structural editing functions (constructors, move, copy, addPoint, insertPoint, etc.) in the "old" classes like jfig.objects. FigPolyline, FigBezier, FigXSpline. Actual rendering, however, is deferred to new classes, which come in two flavors, AWT and Java2D. Currently, the AWT rendering classes are in package jfig.objects, while the new Java2D renderers have their own, new package, jfig.java2d. The decision which renderer is to be used is made by the new class jfig.objects.FigObjectFactory which currently has two independent (inner) subclasses, AWTObjectFactory and Java2D- ObjectFactory. Note that the required render classes for FigArc and FigSpline are not ready, yet. I Unfortunately, the memory-savings due to the above changes are less than expected. Most importantly, Xsplines still require too much memory, partly due to the data representation as Point[] instead of int[]. Also, Java2D GeneralPath objects seem too use quite substantial amounts of memory. transit.fig still scrolls slower than in xfig. N new command line options "-awt" and "-old" for jfig.gui. JModularEditor, which switch back to AWT1.1 (vs Java2D) rendering and old-style splines (vs XSplines). 08.12.02 F fixed a bug in the Q(s) function in jfig.utils.Xspline; standard approximated and interpolated splines should now look *exactly* the same in xfig, jfig, and fig2dev generated outputs. 06.12.02 I the bounding box for filled arc objects is not calculated from the full arc (as would be necessary), but only from the control points. This may result in "disappearing" objects at certain zoom factors, if the control points fall outside the currently visible screen coordinates, but the whole arc would not... It is not clear that this should be fixed, because the current behaviour seems more intuitive for non-filled arc objects. F changed jfig.gui.JFontConfigurationDialog to use the actual font screenshots already available via JFontButton. N some code for RegistrationKeyManager. F change jfig.gui.JSelectFromLibraryDialog to print a warning when the specified library base directory cannot be found. Also changed the default library directory to ".", that is the current working directory. This should allow Windows users to play with the select library object command. N improvements to jfig.utils.Gremlins; more tests, some fixes. Somehow, the selftest runs very slowly under JDK 1.4.1 on Linux. 05.12.02 F fix jfig.commands.CreateArcCommand to handle p1=p2 correctly. 04.12.02 N another attempt to use java.awt.Robot for quality testing. Still not satisfying, because of (1) WindowManager problems, resulting in random events delivered to the wrong components, (2) problems to fine-tune the ratio between mouse clicks, mouse moves, and key events for the different jfig commands. 03.12.02 N new implementation of findObjectAt() in JModularEditor, which improves the selection of abutted objects, especially rectangles. It also slightly changes the radius used to search for objects. N changed jfig.objects.FigText.minDistance() to use the minimum of bbox.minDistance() or the current magnetic snap grid if the target point is inside the text. N changed jfig.objects.FigRectangle.minDistance() to dispatch to the revised FigBBox.minDistanceInside(). N new implementation of jfig.objects.FigBbox.minDistanceInside() and minDistanceInsideZero(). As this changes a final method, it might be necessary to re-compile dependent classes. N changed jfig.gui.JModularEditor to accept both "-v" and "-vv" command line options, where the latter is new and set the editor's debug flag (lots of diagnostic output). 29.11.02 new implementation of jfig.objects.FigBbox.minDistanceInside() and minDistanceInsideZero(). F add measured font "string with" data (from 12pt 100% magnification) to jfig.gui.FontCache, and use this in JFontConfigurationDialog to estimate whether the selected locally available TrueType fonts match the size of their FIG Postscript counterparts. Still needs more work to (a) understand how the JDKs actually implement Font.derive(), (b) add corresponding GUI controls to access bold and italic variants of base fonts, (c) might add a "font size scale factor" to improve jfig vs. xfig layout compatibility. F new findObjectAt() algorithm in JModularEditor which tries to improve selection of stacked and abutted objects. F fix jfig.gui.JPropertiesViewer to handle backslash characters correctly and to use the JConsole for information/error messages. 28.11.02 N first code for jfig.gui.JFontConfigurationDialog. N new SetupManager property "jfig.LookAndFeelClassName", which can be used to select the look and feel to be used with jfig2. If the property is not set, the default LNF (Metal) will be used. On Windows, you may want to uncomment the Windows LnF. F how to calculate the bounding box for "restrictedBboxRubber": if the magnetic grid is on, the original object will be some distance (offset_x, offset_y) from the initial mouse click world coordinates position (base_x, base_y). The object position corresponding to a given mouse position (cur_x, cur_y) is then: (delta) = (cur) - (base). if (Math.abs(delta_x) > Math.abs(delta_y)) pos = (cur_x, click_y) else pos = (click_x, cur_y) Therefore, the current clip rectangle is (x,y,w,h): pos_x+offset_x, pos_y+offset_y, pos_x+offset_x+bbox.width, pos_y+offset_y+bbox.height The total clip region is the union of the object bounding box at the current (cur) and previous (old) mouse positions and the current and old cursor positions. Seems to work now :-) F made "manhattan.gif" transparent 27.11.02 N complete re-write of the background color initialization in all jfig.gui.J* (Swing) classes. Buttons should now be transparent, and all GUI component use the platform default background, unless overridden by specifying the "jfig.gui.Editor.BackgroundColor" SetupManager property. (Note that the JStateButton$SelectDialog classes currently don't set their background. Should probably be fixed, too.) N added new methods jfig.commands.Command.getModifiedObjects() to allow external programs to query a command object about what objects have been modified by the command. Corresponding implementation of this method in all command subclasses. F changed PasteFromClipboardCommand to set the message console for the FigParser; the command should now work in jfig2. 25.11.02 F update status information, indicating experimental nature of jfig2 F removed unnecessary reference to FigStatusCanvas from jfig.commands. PasteFromClipboardCommand 22.11.02 F second attempt to fix the too-small clip rectangle returned by FigCanvasRubberband.getRubberBoundingBox() in bboxRubber mode. It turned out that the offset from mouse position to magnetic grid position needs to be included into the clip rectangle calculation... B similar to above, FigCanvasRubberband.getRubberBoundingBox() returns a wrong (too small) bounding box for restrictedBboxRubber. This is especially noticable when playing with large x/y offsets near to the x=y diagonal, because the object then changes its place radically. 21.11.02 F in JModularEditor.main() and Editor.main(), update the editor's directory name when an initial file is specified on the command line, in order to get the "open next" and "open previous" file shortcuts working. This currently calls java.io.File.getCanonicalFile(), which might introduce new, platform dependent, bugs... F fix too-small rubberband clip region when moving objects in jfig.canvas.FigSwingCanvas. 11.11.02 F changed jfig.gui.JStateButton.mousePressed() to check isMiddleClick() before isRightClick(), to get consistent behaviour across all AWT and Swing "state buttons" in jfig. Using +click should now decrement the button state in the default MouseMapper settings. 06.11.02 F improve jfig.gui.JAboutDialog to support subclasses. 04.11.02 F fix jfig.canvas.FigSwingCanvas to correctly handle mouse clicks when top/left rulers are selected. 31.10.02 F some more debugging to get the Swing based editor ("jfig2") running under JDK1.1+Swing1.1. It seems that the Swing-internal NullPointerExceptions were related to Graphics.dispose() calls in FigSwingCanvas. After removing those calls, the Swing-based jfig now works with the swingall.jar from Swing-1.1.1. However, the JTextViewer seems to be missing the scrollbars, until the text viewer window is resized manually. 30.10.02 F support top-left rulers in jfig.gui.FigSwingCanvas. 29.10.02 N documented "open next file" in the FAQ. F fixed calculation of bounding box for geometryManagedRubber in jfig.canvas.FigCanvasRubberband. Manhattan and Latex style restricted geometry should now work in create polyline. N GeometryManager support in jfig.commands.CreatePolylineCommand. Note that the geometry mode can not be changed during creation of one polyline object. 28.10.02 N new class jfig.utils.Gremlins using java.awt.Robot to experiment with pseudo-random stress-test of jfig. Robot works, but a meaningful test of dialog windows seems difficult. It appears that a useful test strategy would have to enumerate all GUI components of the topmost currently visible window, and then generate events based on the component types. Also, Robot has no support to "leave the WindowManager alone", which incurs significant risk of damanging files due to random mouse clicks outside of the Java application under test. N working version of jfig.utils.ManhattanGeometryManager, which supports Latex line, Latex vector, Manhattan, Mountain, and MountHattan geometries. However, not enabled in JModularEditor yet. N GUI support for constrained (e.g. Manhattan or LaTeX arrow) geometry, but only in the Swing version. This affects classes jfig.gui.JAttribsControlsFactory and JAttribsButtonPanel. 27.10.02 JB some debugging to find out where in Swing the FigSwingCanvas loses the keyboard focus after ExportOptionsDialog was visible. Seems to be some kind of bad interaction with the ctwm window- manager, again. JDK 1.4.1 seems to work reliably, though. N updates to all documentation files in the /jfig/doc directory. N several makefile updates, added "make swingzip" target which created a Swing-only "jfig2.jar" archive. N triple buffering option is jfig.canvas.FigSwingCanvas. This allows to trade-off reduced flickering vs. render performance. 26.10.02 F removed now unused AWT-only methods from jfig.canvas.FigSwingCanvas. F removed several anonymous inner classes from jfig.gui classes, to avoid the excessive code size bloat implied by inner classes. 25.10.02 N experimental class jfig.utils.PresentationPDFWriter based on PDFWriter, which parser a JPT presentation index file and generates a multi-page PDF script from it. Works astonishingly well. N experiments to access the PDFWriter and PDFGraphics2D classes from the org.freehep class library, in order to provide pure Java export to PDF. Mostly works, but no integration yet. However, printing fill patterns seems to be broken; also, printing graphics that are larger than one DIN-A4 / letter page seems to result in curious overflows. 24.10.02 F minor fixes in jfig.canvas.FigBasicCanvas, TopLeftRulerCanvas, and FigSwingCanvas to behave correctly when showRulers(boolean) is called: o remove redundant variables from subclasses, o call setRulersOffsets() from showRulers(), o implement the correct values for the RULER_OFFSETS, o disable drawRulers() when showRulers is false. N new class jfig.utils.FileTreeNode to represent (FIG) files in a Swing JTree. Also implemented the traverseFileSystem() method to recursively find all FIG files below the given root directory. This will be used for the SelectObjectFromLibrary command. Note: searching through a file system can take a while; this should probably print a warning if the number of files is very large... F removed "without a visible AWT parent" warning from jfig.gui. ImageHelper if a JDK of version 1.3+ is detected. N added new method setCaretPosition() to jfig.gui.JTextViewer. This allows to scroll a loaded file/resource text to any position. N full implementation of jfig.commands.JEditObjectCommand and the jfig.gui.JEditBaseobjectDialog, JEditRectangleDialog, JEditImageDialog, JEditEllipseDialog, JEditTextDialog, JEditCompoundDialog, and JEditPolylineDialog windows. Note that JEditTriggerDialog is not yet implemented. N use RenderingHints.KEY_INTERPOLATION besides RENDERING_QUALITY 23.10.02 F added unused colors to buttons.gif, because JDK 1.3+ on Windows seems to think that 2-color GIFs are always black and white. F avoid StackOverflowError due to Swing calling CheckBoxMenuItem setState -> fireItemEvent -> Editor.itemStateChanged -> setFigVersion -> CheckBoxMenuItem.setState... This seems to be fixed in JDK 1.4, but in JDK 1.3.x the only workaround seems to be removing the ItemListeners from the MenuItems, updating the MenuItems, then adding back the ItemListeners. F call setIconImage() on all instances of JPropertiesViewer, JConsole, and JTextViewer F implement missing functionality in JEditRectangleDialog and JEditImageDialog F fix wrong callback name (doUpdateObject) in KeyHandler/ModularEditor F use slightly shorter tooltip texts in JAttribsControlsFactory, to avoid window manager problems on MS Windows: a modal dialog may lose focus if a tooltip text appears that doesn't fit into the parent frame window... (JDK1.3.1/Windows) 22.10.02 N new Swing GUI classes jfig.gui.JEditBaseobjectDialog, JEditRectangleDialog, JEditEllipseDialog, JEditPolylineDialog, JEditImageDialog, JEditTextDialog N started new class jfig.commands.JEditObjectCommand, but not finished yet. N new classes jfig.utils.FigFileFilter (*.fig, *.txt) and jfig.utils.ImageFileFilter (*.gif, *.jpg, *.png, *.ppm, *.xbm). Changed JModularEditor and JCreateImageCommand to use these filters. N new class jfig.gui.JExportOptionsDialog - this is just a 1:1 Swing copy of ExportOptionsDialog. The rewrite does not yet fix the "command line quoting problem". N major cleanups in jfig.canvas.FigSwingRubberband. Now again using the naive drawing algorithm for drawGrid(), checking canvas size changes in paintComponent(), etc. F added missing support for Rubberband "noRubber" mode to jfig.canvas.FigCanvasRubberband.getRubberBoundingBox() 21.10.02 N use reflection in jfig.commands.AlignObjectsCommand to avoid strict dependence on ModularEditor. N use JFileChooser instead of java.awt.FileDialog throughout jfig.gui.JModularEditor. Try to consistently use the new API of javax.swing.JFileChooser. F changed jfig.gui.JModularEditor.doSaveToConsole() to use the Swing JConsole instead of AWT jfig.gui.Console. N new class jfig.gui.JStringDialog, use in JModularEditor. doSelectURL() and doMergeURL(). N new classes jfig.gui.JCreateImageDialog and jfig.commands. JCreateImageCommand, support for JFileChooser. N first attempt at jfig.gui.JSelectFromLibraryDialog. However, it seems that using a JTree presentation of the FIG libraries would result in a much better implementation that just copying the old FIG 3.2 style AWT dialog window. I should fix the remaining call to Console.getConsole() in FigParser, which needs to check whether to create the AWT or Swing based console window. The current solution is to call FigParser.setConsole() from JModularEditor, which also works (if less robust). F made jfig.gui.(J)NumericStateButton.selectDialog a modal dialog. This seems to fix the "nested dialog" window focus problem. Ooops. N new class jfig.gui.JEditGlobalAttributesDialog F created jfig.commands.JOpenCompoundCommand N changed jfig.gui.JModularEditor to use a JColorChooser instead of jfig.gui.AddUserColorDialog. F removed unused class jfig.gui.AboutImageCanvas F changed jfig.commands.MoveObjectCommand to retrieve the status of "smart links mode" via reflection, to support both the AWT and Swing (J)ModularEditor. This in turn uncovered a missing initialization and missing getSmartLinksMode() method in (J)AttribsControls(Factory) and (J)AttribsButtonPanel. 20.10.02 N changed jfig.gui.JModularEditor to use the (modified) KeyHandler, JConfirmDialog, JPropertiesViewer, and JConsole classes. Also fixed all "help" callbacks to call the new utility function showTextViewer(), which now creates a JTextViewer instead of a SimpleTextViewer. N changed jfig.gui.KeyHandler to expect a FigBasicEditor instead of ModularEditor - this allows to use KeyHandler for the Swing based JModularEditor, too. Note that this is only a short-term solution. Using the call() method from FigBasicEditor, a much better and extensible string->command hashtable based solution is possible. KeyHandler would construct a mapping from strings like "CNTL-ALT-x" to the corresponding editor function, and construct the key used for lookup from the KeyEvent modifiers and keyCode/keyChar. 19.10.02 N added method call( String, Object) to jfig.commands.FigBasicEditor, which should make the AWT->Swing conversion much easier, as it is possible to directly use the existing callback mechanism in (J)ModularEditor. N changed jfig.commands.OpenCompoundCommand to support both the AWT and Swing (J)CloseCompoundDialog windows, made possible via reflection. B WARNING: JConsole is not currently thread-safe, because the println() etc. methods directly call JTextArea.setText(). This needs to be fixed via (1) adding separate methods like printlnThreadSafe(), or (2) (better and more complicated) by changing println() to check for the calling Thread and using SwingUtililities.invokeLater() automatically. N new Swing classes jfig.gui.JConsole, JPropertiesViewer, JConfirmDialog, JCloseCompoundDialog 17.10.02 N changed jfig.commands.UndoStack for Swing compatibility. The class now gets Objects instead of MenuItems and accesses them via reflection. N Swing re-implemantation of AttribsControls using the newly created Jxxx components. Name change to JAttribsControlsFactory. N more Swing updates: jfig.gui.JStateButton, JColorButton, JUpdateModeButton, JFontButton, JFillPatternButton, JNumericStateButton, JAboutDialog, JTextViewer. 16.10.02 N new classes jfig.gui.JModeButtonPanel and JAttribsButtonPanel, using pure Swing (JComponent) subclasses. N new class jfig.gui.JEditorMenuBar, a Swing-based re-implementation of EditorMenuBar. This in turn required JRecentFileManager, as MenuItem and JMenuItem only share the Component base class... N some more experiments to improve FigSwingCanvas rendering - the current implementation leads to a lot of flickering under JDK 1.3+ on Windows. Unfortunately, this behaviour is the same as that of the original Sun demos (like BezierAnim), and may be unavoidable. There really should be documentation about those issues. Also fixed inconsistent initialization for very small canvas size in FigBasicCanvas.initializeOffscreenBuffers. 15.10.02 N xfig 3.2.3d compatible implementation of the "draw freehand line" command. The new implementation does not use the existing class CreateFreehandCommand, but integrates the MouseMotionListener stuff from CreateFreehandCommand right into CreatePolylineCommand. The resulting class fully implements the xfig user interface with left click: polyline, middle click: freehand line, right click: cancel functions. Note that CreatePolygonCommand does not (yet) include the freehand option, because the straight-lined-closed freehand polygons from xfig seem kind of funny to me. Please don't hesitate to complain if you should actually require the freehand polygons. N first infrastructure to collect editor usage statistics - to be used with a registration / shareware fee reminder, soon. B Note that FigSwingCanvas.setShowRulers( false ) does not work perfectly: the rulers are correctly hidden, but the grid does not fill the freed space. Needs to be fixed soon. F renamed FigDemo (created yesterday) to jfig.gui.EmbeddedFigDemo; the file now relies on Swing instead of AWT components only, uses the new doZoomFit() method in FigCanvas, and has a new method to create (random) rectangles. F the multitude of doZoomRegion() and doZoomFit() behaviours found across the different subclasses of FigCanvas still needs to be cleaned up. However, the new doZoomFit() method should help in many cases. N added the doZoomFit() method to jfig.canvas.FigCanvas, as this method is useful im most editors and viewers. Added (working) implementations to both FigBasicCanvas and FigSwingCanvas. The behaviour of subclasses that already implemented doZoomFit() previously (PresentationViewerCanvas and hades.gui.ObjectCanvas) should be unchanged, because of method overriding. I looked at the "transit.fig" example again, it seems that most of the Xsplines used in that file require about 200..1000 points for rendering. Obviously, recalculation of all points after a simple viewport panning is not very efficient. Also note that the current implementation of FigCompound.paint() still does not do visibiliy checks for its children - because it doesn't have the viewport bounding box coordinates. Calculating the viewport bounding box would be possible via getObjectPainter().getViewportBoundingBox(), but as many compound objects hold only a few children, it is not clear that this overhead is really worth it. F extra try-catch in RecentFileManager to workaround JDK118/linux MenuItem.setLabel problems... F restructured the editor menus for better xfig compatibility; the "window" menu is now called "view" and also includes the Java2D rendering options. F better bounding-box calculation in FigCanvasRubberband for lineRubber and rectRubber with "show line lengths" enabled; required to get artefact-free rendering in FigSwingCanvas. F after the FigCanvas cleanups, FigBasicCanvas and FigSwingCanvas can both be used as the main editor canvas. For performance reasons and (future) Swing compatibility, we use a FigSwingCanvas for JDK 1.3+ and a FigBasicCanvas von JDK 1.1x and JDK 1.2x 14.10.02 F changed the default arrow size to 3mm width and 5mm length, which better suits my preferences (at A4 paper size, zoom 1:1). F improved and updated the information in jfig/doc/FAQ. N added jfig.gui.ModularEditor.writeFigObjects( OutputStream ) method to complete the API required to embed jfig into other applications. N fully implemented the "line length" rubberbanding for both polyline and rectangle operations. As in xfig 3.2.3d, the line length is shown in the currently selected units (inches, mm, xmm). By the way fixed the rectangle rubberbanding bug for zero-height or zero-width rectangles. N new jfig-menu-window-"show line length" control to switch on/off the line length rubberbanding. N added menu item and callback to jfig.gui.ModularEditor to include the new "embedding.txt" documentation into the jfig editor help menu. N wrote some documentation on how to integrate jfig as a viewer or editor component into other applications. Also added the new class jfig.gui.FigDemo to demonstrate how to load and display a FIG file. F added the doZoomFactor() method from hades.gui.Editor to jfig.gui.ModularEditor to cleanup the mess of different zoom methods. This also means the the FigCanvas interface can now be stripped of some unnecessary methods. N added a few methods to the FigCanvas interface to improve the API: requestRenderQuality(), requestAntiAliasing(), setRubberbandShowLineLengths(). 11.10.02 N experiments to improve rendering (especially rubberbanding) perormance on JDK 1.3 and JDK 1.4 on Linux. Seems that using the FigSwingCanvas based redraw algorithm is much faster on Linux that the FigBasicCanvas method - probably due to internal double buffering in the JDK. N first tests to implement the "line length" rubberbanding available in xfig 3.2.3d. Basically works, but text rendering is broken in XORMode on JDK 1.3+ on both Windows and Linux (while PaintMode works. This means that the FigBasicCanvas rubberbanding does not work in this situation.) 30.08.02 F fixed writing the wrong (inverted) arc subtype field in FigWrite.write_fig31_arc(). This means that saving open-ended arc objects with arrows should now be compatible with xfig and fig2dev. I set DoubleClickIsMiddleClick false in .jfigrc, as this seems to conflict with some JDKs. Enable this function in your private .jfigrc if you want it. 21.07.02 F fixed MouseMapper.checkDoubleClickIsMiddleClick to also check for a left-button (BUTTON1_MASK) click, in order to avoid detecting middle- or right-button double-clicks. 19.06.02 N integration of RecentFileManager into ModularEditor and EditorMenuBar. N added class jfig.utils.RecentFileManager; API based on org.freehep.swing.RecentFileList 17.06.02 N changed MouseMapper to allow a double-left-button click as a substitute for a middle-button click. This might help Windows users and jfig newcomers... Set "jfig.utils.MouseMapper.DoubleClickIsMiddleClick" in the .jfigrc configuration file to disable/enable this feature. 14.06.02 F changed jfig.utils.SetupManager.<> to check for a SecurityManager and for checkPropertiesAccess, to improve the applet compatibility. 31.05.02 F new class jfig.objects.FigGlobalAttributes as a first step towards the reorganization of the jfig object attributes management. Code refactored from jfig.commands.SelectObjectFromLibraryCommand and reused for ModularEditor.doMergeFile. This fixes the bug that would overwrite the previous global attributes (e.g. paper size) when merging a file. 26.04.02 N Changed jfig.gui.StateButton.mousePressed() to interpret the + button combination to decrement the current state, while still increments. This improves the usability on Windows or other two-button mouse systems. Similar changes to jfig.gui.ColorStateButton and NumericStateButton. 26.03.02 F Fixed jfig.commands.CreatePolylineCommand, CreateSplineCommand, etc. to call editor.deleteTmpObject() when the command is canceled. This removes the unfinished polyline objects from the canvas which otherwise can stay around for a long time (and only vanish when saving the file). Detailed bug report by M.D.Gore. 27.02.02 N Better support for "smart links" in jfig.commands.MoveObjectCommand, which now handles polylines pointing to compound objects, too. This fix was contributed by Matt Quail. Thanks! 25.02.02 I One user reports that Symantec Norton Antivirus detects the "Backdoor.EggHead" trojan horse in the cygz.dll used for our Windows fig2dev3.2.3d. As far as we know, this is a false alarm, but be careful. B User feedback reports a printing regression for the jfig applet under MSIE 5.5 on Win2000. There are also problems with applet printing under JDK 1.3.1. 21.01.02 N added epic/eepic support to jfig.gui.ExportOptionsDialog, patch submitted by Tomas Palma. F changed jfig.utils.SetupManager.loadGlobalProperties to check for a leading slash in the filename. The method should now work with both "jfig/jfig.cnf" and "/jfig/jfig.cnf" style arguments. 16.01.02 N added jfig.objects.FigAttribs.setLineColor and setFillColor. These utility methods take a java.awt.Color argument and create a new FIG user color if the requested color was not registered previously. 15.01.02 N implemented jfig.gui.PropertiesViewer.doApply and changed the doSaveXXX method to really read the current values from the viewer text area. This allows the user to edit the property keys and values before saving them to the user- or local- property files. F fixed method access to allow subclasses in external packages for jfig.gui.PropertiesViewer. 09.01.02 N preliminary support for grid and magnetic grid with decimal subdivision (actually 1:5 for the grid) in FigBasicCanvas and FigTrafo2D. This means that objects edited with the default xfig grid settings should not be off-grid anymore. 04.01.02 N new key-bindings in jfig.gui.ModularEditor for the VK_PAGE_UP and VK_PAGE_DOWN keys. Those keys open the previous/next FIG file (sorted alphabetically) in the current working directory. This allows to browse through many files and is as fast as a preview function in the file dialog would be :-) F new class jfig.utils.ShellSort (taken from hades.utils). Replaced all local shellSort() methods used in jfig by calls to ShellSort.shellSort() 02.01.02 N version 1.55: includes all recent fixes, "Create freehand line" and "Add user color" commands, new "biohazard" example. F several minor makefile fixes and cleanups. F changed FigBaseobject.scale() and all derived methods to use the absolute (positive) scalefactor values when updating object attributes. This avoids the "negative line thickness" bug turned up by Java2D. 30.12.01 F added WindowListeners to most dialog windows, allowing to close them via the window-manager decorations (e.g. the Windows "x" button). Note that the "edit object" dialogs call doCancel() when closing the dialog window via the window-manager. F fixed the rotate command in jfig.objects.FigEllipse, allowing to rotate a circle/ellipse object around arbitrary anchor points. Added the biohazard example file, which was created by rotate- and-copy of FigEllipse objects. F added jfig.gui.AddUserColorDialog. The dialog expects a string with RGB color specification (e.g. "0xff0000" for red) and creates the corresponding user color. 29.12.01 N added the "create freehand line" command callback to UserEditor (run java jfig.gui.UserEditor). N hacked a first version of jfig.commands.CreateFreehandCommand. 23.12.01 F fixed jfig.utils.PresentationBuilder to mangle the pathnames used in the presentation index file. The new version converts backslashes (Windows style separator) to slashes always. This was necessary, because the jfig.utils.PresentationParser parser uses StreamTokenizer, which would incorrectly interpret backslashes as escape symbols... Creating jfig presentations on Windows should now work (tested on Windows XP only). 19.12.01 B some more debugging for the Windows redraw problems. I am now fairly convinced that JDK 1.3.1 is broken both on Windows (tried WinXP, DirectX 8.1, nVidia and Win98, DX8, ATI) and Linux (same hardware configurations). The AWT is correctly calling Graphics.drawImage to bitblt the background buffer, but the drawing operation is never performed :-( Workaround: Use JDK 1.3.0 which works well. F changed jfig.objects.FigWriter.getLineThickness() to support linewidth 0 lines. The previous version would incorrectly substitute linewidth 1 in this case (off-by-one bug). N added support to jfig.commands.CreateImageCommand to "remember" the directory last used to search for image files. This greatly improves the usability of jfig in cases where the FIG-files and the image files used for Image-Objects are not in the same directory. As a new CreateImageCommand instance is created for every new object, we save the directory name in a SetupManager property called "jfig.gui.CurrentCreateImageDirectory". N began work to implement a "file history" for jfig. This will include the automatic parsing and saving of a $user/.jfig-history file which contains the corresponding key/filename properties. A separate file is used, because this makes it easier to leave hand-written .jfigrc files intact. An example of the properties is saved in .jfig-history: jfig.gui.CurrentCreateImageDirectory c:\users\hendrich\images jfig.gui.CurrentFigFileDirectory c:\users\hendrich\figs jfig.gui.LastFigFile1 c:\users\hendrich\figs\welcome.fig jfig.gui.LastFigFile2 jfig.gui.LastFigFile3 jfig.gui.LastFigFile4 N lastFile1MenuItem..lastFile4MenuItem in jfig.gui.EditorMenuBar F some changes in jfig.commands.CreateImageCommand to really show() and toFront() the image options dialog. The resulting behaviour works on Linux/JDK 1.3.0 and Windows/JDK 1.3.0, but still has problems on my Windows-XP/JDK 1.3.1 test install... 17.12.01 N added new methods to jfig.gui.PropertiesViewer and made the TextArea editable. After this changes it is possible to edit jfig properties directly and in the PropertiesViewer and to save them to the user- or local properties file. Note that jfig will ignore the changes until it is restarted. The new methods are writeProperties() and checkShouldWriteProperty(). Together they will write an alphabetically sorted list of all "jfig" properties without the "global" and "Java" properties. This is achieved via checking for the property name in checkShould- WriteProperty. Overriding this method will allow tricks like using PropertiesViewer in Hades, too. 16.12.01 N added SetupManager variable jfig.gui.Canvas.RequestFocusOnMouseEnter and corresponding test in jfig.canvas.FigBasicCanvas.mouseEntered(). You may want to set this variable to true on X11/Unix systems. F some more tweaking of the Windows-JDK131 redrawing... Unfortunately, there is still a flickering when showing the file selection dialog window. This seems due to a (known) JDK bug. Depending on your Windows, DirectX, and graphics card driver versions, you may be able to get rid of the flicker via the following command line option: java -Dsun.java2d.noddraw=true jfig.gui.Editor 13.12.01 F finally found the Windows-JDK131-dialog-redraw-problem. Aaarrrggghhh! Except for an unneccessary refresh when showing the open-file dialog, redrawing should now again work in Windows. As it turned out, the bug was a real bug in jfig.canvas.FigBasicCanvas, and not a race condition in the JDK, as I suspected for so long. This means that I was also able to remove all of the Thread.sleep() stuff inserted for debugging purposes, resulting in much faster canvas scrolling. N added the "crop filename" options to jfig.gui.CreateImageDialog, in order to ease the creation of relative filenames from the names returned by the FileDialog. 12.12.01 F another attempt to fix the (annoying) redraw problem when opening a new file on Windows... 03.12.01 F added some class documentation comments in ModularEditor. 16.10.01 N some documentation (FAQ, mouse-buttons, jvm-compatibility) updates and cleanups. 15.10.01 B user feedback pointed out that jfig is no longer compatible with the (updated FIG 3.2) specification: with xfig 3.2.3d the specs for arc objects changed. 28.09.01 F some more nullpointer checks in jfig.canvas.FigBasicCanvas for better compatibility with JDK 1.3.1 and JDK 1.4 beta (Linux). 31.07.01 F changed jfig.objects.FigWriter to appand a trailing space character after writing the paper size specification in the FIG 3.2 header: fig2dev seems to expect this. Therefore, jfig created files should now also work in fig2dev (Windows) when "Letter" size paper is selected. 23.07.01 F made jfig.gui.ColorCache.getColorCache() synchronized to avoid race conditions with multiple FIG-applets on a single web page. 17.07.01 N complete website overhaul on tech-www/applets/jfig, with separate pages for: overview, editor, applet, presentations, download 16.07.01 N complete documentation overhaul (README, FAQ, ...) 13.07.01 N added a new (rather, restored the ancient) algorithm for drawing the grid in jfig.canvas.FigBasicCanvas, as the current implementation via calls to Graphics.copyArea has major problems with JDK 1.4 beta and Swing. This is due to the fact the copyArea() is implemented asynchronously, resulting in additional races for the drawing calls... The new algorithm just draws all individual grid points by so many calls to Graphics.drawLine. While this was very slow in JDK 1.0 and early JDK 1.1 times, it doesn't do so bad now. Timing tests on my Linux box show that drawing all the points is at most a few milliseconds slower than the copyArea trick. Therefore, the drawGrid method was renamed to drawGridViaCopyArea, the new (=ancient) algorithm to drawGridByHand, and drawGrid now merely selects which variant really to call... 10.07.01 N another attempt to get fully xfig-compatible bindkeys. The KeyHander class now includes a hack which allows to specify bindkeys via "e" (ellipse) "CTRL-e" (edit object) or "META-f" in the jfig.cnf/.jfigrc. Unfortunately, the AWT still does its own mangling of keys once the CONTROL modifier is pressed, and so the "CTRL" key combinations still don't work. Most bindkeys, however, are now xfig compatible. If you want to keep the oder jfig settings, just edit your .jfigrc. 27.06.01 N changed the parsing of embedded image (GIF/JPG/...) objects in jfig.objects.FigParser.parse_fig_polyline to allow image filenames with spaces in them, e.g. "c:\Eigene Dateien\titanic.jpg". This was done with a quick hack and is not fully tested yet. 19.06.01 N first GUI support for line width 0 in jfig.gui.AttribsControls, also updated jfig/images/buttons.gif. However, no support in the jfig.objects.* classes (yet). N added initialization to the jfig.gui.EditorMenuBar menu items for the Java2D antialias and rendering quality hints. Also added corresponding attributes to the jfig.cnf (jfig.Java2D.AntiAlias, jfig.Java2D.RenderingQuality). After these changes, it is now possible to start jfig in "high-quality" mode. F fixed an annoying problem in jfig.utils.SetupManager.getBoolean() which would not correctly report true/false values due to spurios trailing spaces. 18.06.01 N some more AWT and jfig related bugs listed and documented here... 15.06.01 N in jfig.gui.PropertiesViewer (menu->options->show properties), added the option to save the current jfig properties as .jfigrc startup files in the user's home directory or the current working directory. This makes it much easier to create user defined settings. However, the current implementation relies on java.util.Properties. store() which results in "unsorted" properties files. 06.06.01 N added jfig.objects.FigObject.rebuild() method stub and a first implementation to all FigBaseObject subclasses. This method allows to re-initialize any given object. The first use is to switch between Java2D and AWT11 (e.g. for printing from JDK 1.3 appletviewer). 05.06.01 F some more fixes and changes in jfig.canvas.FigBasicCanvas to get applets to print in MSIE. 02.06.01 N added getAppletInfo() and getParameterInfo() to SimpleFigApplet. Also cleaned up the popup menu initialization and added a help menu item together with a (very basic) help viewer. 01.06.01 F fixes in jfig.canvas.FigBasicCanvas to detect and handle when paint() is called with a PrintGraphics object. This allows to print the SimpleFigApplet from appletviewer and Netscape 6. Applet printing from MSIE seems still broken, however. F fixed the statusMessage() method in jfig.objects.FigParser to suppress useless messages during SimpleFigApplet initialization on non-Java2D browsers. 15.05.01 N added minDistanceEuclid to jfig.objects.FigObject, corresponding dummy implementation in FigBaseObject, and real implementations useful for better object selection in FigPolyline, FigRectangle, and FigCompound. No update to FigSpline yet. F Complete rewrite of getMinPerpendicularDistance in FigPolyline, which should now work (though it is currently not used in jfig). 14.05.01 N xfig-compatible handling of stacked-object selection in jfig.command.EditObjectCommand (shift+click to select, normal click to execute). 08.05.01 F renamed the "cursor snapping" (a false friend...) menu to "magnetic grid" F fixed the middle/right mouse button compatibility stuff (like +left click) in jfig.gui.StateButton F workaround in jfig.objects.FigWriter to write X-splines in FIG 3.1 format by creating temporary FigBezier objects: this is slow but should work... 07.05.01 N allow to specify (ASCII) chars as keyboard shortcuts via jfig.cnf properties, e.g. "jfig.gui.KeyHandler.CreatePolyline p" 04.05.01 F fixed detection of operating system from "os.name" property. Several workarounds should now be enabled... F cleaned up the MouseMapper handling in all command.xxx classes. Also changed the default setting in jfig.utils.MouseMapper to use ShiftDownLeftClickIsMiddleClick. 03.05.01 F some documentation (FAQ, mouse buttons, CHANGES) updates. 25.04.01 N webpage update, added links to the simple FIG applet demo page. F fixed a bug in jfig.objects.FigXSpline which resulted in wrong arrowhead setup on (open) splines. F fixed jfig.utils.Xspline.addPoint() to check for and ignore doubly added points. 24.04.01 N made jfig.gui.SimpleFigApplet useable: added zoom and panning functions, popup-menu, key- and mouse-listeners. Also wrote a simple HTML demo (/applets/jfig/applet-demos/simple-applet.html). Unfortunately, Netscape 4.x still has problems with the applet. F makefile update: building jfig.jar now includes only the necessary classes. Also, we don't include xfig.ps.gz. Together with using javac -g:none this reduced the jfig.jar file size from 882905 to 609258 bytes... 20.04.01 N New classes jfig.objects.FigNormalXSpline and FigBezierXSpline to implement xfig 3.2.x compatible spline behaviour. There are realized as simple subclasses of FigXSpline which just set the scalefactors to [0,1,1,...,1,0] and [0,-1,-1,...-1,0] N Added property jfig.enableXSplines to jfig.cnf: set this to "true" if you want to use Xsplines instead of the FIG 3.1 splines. Added support for X-splines to all classes used to create or work with spline objects: jfig.commands.Create(Closed)SplineCommand, Create(Closed)BezierCommand, ConvertObjectCommand, FigParser, FigWriter. At the moment, jfig and fig2dev 3.2.3 seem to interpret X-splines identical, while xfig draws Bezier-style X-Splines wrong... This seems to be due to xfig using an inadequate value for the "precision" parameter during creation of the Bezier-splines. Warning: writing Bezier-type X-Splines in FIG 3.1 format is not supported. 16.04.01 N new class jfig.utils.Xspline to experiment with FIG 3.2 X-Splines. Building both open and closed splines seems to work already... To my surprise, it took just 2 hours to translate u_draw.c :-) 12.03.01 F fixed Swing 1.1.1 NullPointerExceptions under JDK 1.1.8 / jview in FigSwingCanvas. This requires a "hacked" version of swingall.jar, because the problem is in Swing (SwingGraphics.paintImmediately) itself. 11.03.01 N many changes to the jfig.objects.Fig.Painter2D inner classes to support the Swing redraw mechanism. Basically, all paint() operations now check for the AffineTransform preset by Swing in the current Graphics2D context, and preConcatenate this transformation to the current jfig transformation. This also works to support the PrinterGraphics transformation for Java2D printing, allowing us to remove most of the printer specific code in the Painter2D inner classes. N display a text cursor for all text operations. This should now work (in principle) also for rotated texts unter Java2D, and it does with IBM JDK 1.3 on Linux. However, Sun JDK 1.3 has problems and displays the correct cursor location only for normal text objects, while rotated objects show an offset between the correct and the Sun JDK 1.3 position. N reworked the tmp-text-object redraw strategy for jfig.canvas. FigSwingCanvas, which should now work flickerfree and with the correct (and minimal) text bounding box. 09.03.01 F a few (and so far unsuccessful) experiments to make FigSwingCanvas compatible with Swing 1.1.1. This currently works after some initial NullPointerExceptions, as long as double buffering is disabled for Swing components. Enabling double buffering causes Swing-internal NPExceptions on all of MS jview, JDK 1.1.8 Windows, and JDK 1.1.8 Linux. F changed SetupManager to suppress the useless exception traces when setup files are not found. 08.03.01 N some more performance tuning for FigSwingCanvas redrawing. 07.03.01 N added the getRubberBoundingBox() and getBase() methods to jfig.canvas.FigCanvasRubberband needed to implement efficient rubberbanding for Swing based GUIs. Performance is more or less acceptable on 400+ MHz systems under JDK 1.3, with the exception of diagonal lines across the canvas (which requires repainting the full canvas). 04.03.01 N new attempt to get a Swing based object canvas working - which needs a completely new redrawing strategy, due to the internal buffering of the Swing paint architecture. The current implementation of jfig.canvas.FigSwingCanvas uses many paintImmediately() calls to repaint the rulers, rubberband, and tmp objects. 02.01.01 F fix to make jfig.gui.EditCompoundDialog compatible with Java 1.1 again. 28.12.00 N new option to automagically change the depth (layer+=10) and color (white) of embedded image objects to jfig.gui.CreateImageDialog and jfig.commands.CreateImageCommand. Can be preset by setting jfig.gui.CreateImageDialog.LayerCorrection true/false in jfig.cnf. 17.12.00 N implemented a 'direct text editing' function similar to xfig3.2.3c in EditCompoundDialog.java. 04.12.00 F more complex initialization: jfig now looks for property settings in five places: 1. global: resource:/jfig/jfig.cnf (inside the jfig.jar archive) 2. user: ~/jfig.cnf (user home directory) 3. user: ~/.jfigrc (user home directory, hidden) 4. local: ./jfig.cnf (local working dir.) 5. local: ./.jfigrc (local working dir., hidden) As before, local settings override user, and user override global settings. F actually use the jfig.gui.SelectFromLibraryDialog.BaseDir property promised in the documenation, and avoid NullPointerExceptions for non-existent or empty library directories. Also added a simple hack to allow to set the library search directory interactively from the SelectFromLibraryDialog window: Simply add a new path and press to search for libraries at the new location. 03.12.00 N Implemented EditCompoundDialog, added FigCompound.setLayer... function to change a compound object's layer. Might result in negative object layers when used with illegal parameters. 27.11.00 N Integrated jfig.command.SelectLibraryObjectCommand into the editor. 24.11.00 N First implementation of the xfig 'library' command, new classes jfig.gui.SelectFromLibraryDialog for the GUI and jfig.command.SelectLibraryObjectCommand for the command itself. 19.11.00 N Complete rewrite of the jfig<->fig2dev interface. All functions are now integrated in jfig.gui.ExportOptionsDialog. New GUI with TextFields for the actual fig2dev command line, allowing to interactively change parameters and to submit them to fig2dev. Added several SetupManager properties to specify the pathname of the fig2dev executable and several fig2dev language specific options. See the classdoc or the system /jfig/jfig.cnf file for details. Still no support for the mixed PS/Latex export, however. 12.10.00 N PrintManager.Manager2D checks the "jfig.gui.PrintManager.magnification" property in the configuration file to set a fixed zoom-factor to use for printing. The value should be given as an percent value (e.g. "95"). Should probably add some GUI to set the magnification. When the property is not set (the default), PrintManager tries to fit the drawing to the page. 10.10.00 N major improvements in jfig.objects.* and jfig.gui.PrintManager (Manager2D). Printing via JDK/JRE 1.3 with Java2D should now work: all objects use the Java2D geometry stuff to paint() themselves in the correct orientation and scaling to the PrinterGraphics context. Default paper is now A4 size with 5mm margins. PrintManager reads the FigAttribs.fig_orientation variable to decide on Landscape or Portrait mode page orientation. You can change this variable via the Options->Edit global attributes dialog, if necessary. The only exception are fillpatterns, which still crash the virtual machine. Also, drawing of circles/ellipses and splines is inefficient, because jfig draws those objects using its own interpolation instead of using the corresponding Path2D methods. 09.10.00 N no more "write once". jfig.gui.ModularEditor now checks System.getProperty( "os.name" ) to detect the OS / JVM environment and sets the corresponding enable[Windows/Solaris/Linux/Netscape]Workarounds variable, which is then used later on... 08.10.00 B the "DEL" key workaround for Windows seems to break by Linux version :-( F print an useful error message if PresentationViewer cannot find the specified presentation index (.jpt) file. F added some workaround code to print useful error messages if jfig.gui.ModularEditor and other jfig.gui. classes cannot find the required resource images. This is especially helpful, as some versions of Linux unzip fail to set the correct permission bits on the jfig/images directory when unpacking from jfig.jar, so that the image files are indeed not readable... 06.10.00 N added (another) workaround to ModularEditor and CreateTextCommand, to get the DEL-key working on Windows platforms. The current solution seems to work for jview and the JDK 1.3 on Windows 95/98, so perhaps it is finally right... N documentation updates. Rewrote parts of the README, and added information about jfig.utils.PresentationBuilder to the FAQ. 05.10.00 N added zoomRegion functionality to jfig.gui.PresentationViewer. Also cleaned up the popup menu and added the "zoom region" and "popup console" items. Use 'r' as the bindkey for zoom region. F added the is/setPopupConsoleOnWEF() pattern methods to jfig.gui.Console, to allow a "silent" Console window even for warning/error/fatal messages. This may sometimes be helpful, e.g. on Windows, to get rid of repeated and therefore useless console messages. F fixed (I hope) the off-screen dialog window placement for the XXXStateButton internal SelectDialog windows. This should allow to select colors/fillpatterns/etc. without having to move the parent window first... 03.10.00 B used jfig on Windows again, after a long time. Found annoying and trivial bugs, like the off-screen placement of attribute-select dialog windows. Those will be fixed ASAP. B Tried image printing on JDK 1.3 (Java2D) and found a curious scaling problem. Hope to fix that soon... 22.09.00 F minor fixes in jfig.utils.PresentationBuilder: catch exceptions from copyAllFilesFromZipArchive, set presentation viewer MainClass attribute before copying the jfig class archive (with its possibly conflicting MainClass manifest entry). 19.09.00 F fixes in jfig.objects.FigAttribs and jfig.gui.AttribsButtonPanel to get the correct update mask values for text object updates (font style, font size, text rotation). 08.09.00 N new GUI and thread concept for ExportOptionsDialog and Exporter: we always save the current FIG file before exporting, we create a new worker thread to do the Runtime.exec() stuff, and we allow the user to specify the command line directly. N version 1.42, some renaming (special menu is now options menu, prepared "plugin" menu) F fixed jfig.commands.MoveObjectCommand to support "smart links move" undo F makefile improvements, make jfig-classes.jar instead of .zip per default, and include only the necessary classes, demos, and icons. 16.08.00 N new version of jfig.utils.MakePieChart to demonstrate the extension of jfig with user code. Also commented that example file. 15.08.00 F corrected the increment value function in jfig.gui.NumericStateButton. F (unsuccessful) attempt to replace Point[] data structures by Polygon, to conserve memory. However, the savings were not worthwhile, even for the transit.fig example. 14.08.00 N implemented SmartLinks Move mode. This currently handles polylines (arcs, beziers, splines) connected to rectangles, and text objects fully inside the rectangle. F minor fixes to FontCache for JDK 1.1 compatibility. Corrected the font layout in the FontStateButton selection dialog. 13.08.00 N completed the redesign of jfig.gui.FontCache. The data structures and GUI components of jfig now support all FIG (Postscript) fonts. Try the Help->Demos->Fonts example and compare the output with the (prerendered) font selection menu. Unfortunately, the Java virtual machines available at the moment, like Suns or IBMs JDK 1.2.2 or JDK 1.3, still do not support all the required fonts. You may have to edit the properties in jfig.cnf to map FIG font names to the fonts available on your system and JVM. Note that older Java 1.1 virtual machines only support the predefined Times, Helvetica, Courier set of fonts. Full support for LaTeX fonts is not planned at the moment - but don't hesitate to tell me that you really need this... N first stub and a little code for "smart links" support in jfig.commands.MoveObjectCommand 12.08.00 F removed fontName, fontStyle, currentFont attributes from FigText, ResizeTextCommand, FigParser, FigWriter, etc. All hardcore Font handling is in FontCache now. is in FontCache now, and all FIG Postscript fonts are supported (if your JVM has them). F major cleanup of jfig.objects.FigAttribs with corresponding changes to two dozen classes... removed redundant attributes, made the update masks static, new Postscript font index constants, removed the fontName, fontStyle, currentFont attributes, ... N new class jfig.gui.NumericStateButton for xfig-compatible numeric value (integer) selection. Used for depth (layer), rounded rectangle corner radius, font size, etc. N major update to the GUI attribute controls, which now use the FontStateButton, ColorStateButton, and NumericStateButton classes. Changed the initialization for AttribsControls, which is no longer a Singleton class - a first and necessary step to support multiple jfig editor/viewer windows inside one virtual machine. Also, most commands should now display only the attribute controls valid for that command. N GUI stuff to select all FIG Postscript fonts is now in place, but FontCache still needs a complete overhaul. N first GUI stuff for "move with smart links" added to AttribsControls and AttribsButtonPanel. F found (and corrected) lots of unused deprecated code and several bugs in StateButton and its subclasses, AttribsButtonPanel, AttribsControls, and ModularEditor. 11.08.00 N new class jfig.gui.ColorStateButton for xfig-compatible color selection. The new button allows to select the next/previous color with right/middle clicks, and presents a dialog window for direct selection on a left button click. Still no GUI support to add user colors, however. N new class jfig.gui.FontStateButton for xfig-compatible font selection. Prepared resource images /jfig/images/font-menu.gif (gray) and the original /jfig/images/font-menu-442x361.gif (white background) from downscaled 300dpi ghostscript rendering. F better placement strategy for the SelectDialog windows (inner class) from jfig.gui.StateButton and jfig.gui.FillPatternsButton. The dialog windows should now appear directly above the StateButton and inside the visible screen area. 10.08.00 N first tests and initial code to support all xfig Postscript fonts. As most Java VMs currently don't support the Postscript fonts directly, this will use some user properties to map xfig fonts to Java fonts for screen rendering. Note that fig2dev will automatically use the Postscript fonts, whether the JVM has them or not. 09.08.00 N new class jfig.gui.PropertiesViewer to display the contents of a java.util.Properties object in a dialog window. Integrated into jfig to show all global/user/local property settings. (Menu->Special->Show Properties). 13.07.00 N changes and improvements in PresentationViewer and ImageHelper which allow to use the PresentationViewerApplet to read from JAR-archives instead from individual files on the http-server. This improves performance and interaction time greatly for all situations, where the whole presentation (.fig and .gif/.jpg/...) fits into a JAR archive. While the current solution seems to work with JDK 1.1.8 up to JDK 1.3 (checked Linux, Solaris, Windows and jview), it does *not* work with Netscape 4.7, as the Netscape VM won't allow applets to read classpath resources. Use appletviewer instead. 06.07.00 N the new version of jfig.utils.PresentationBuilder is ready. Still no error handling, but building a JAR archive with all .fig slides, .gif ... images, the .jpt index file, and the required presentation viewer jfig.*.* classes should work. The resulting JAR can be run on Java2 JVMs easily, using java -jar F some minor F don't use JAX to generate the presentation viewer archive anymore, as neither jax33 nor jax41 nor jax61 seemed to work reliably for jikes compiled classes. Also, adding th