# Releases Notes 3.4 and older

## 3.4 Release

Allow user to clip a J/Carnac layer. The clip region can be defined very flexibly, and the area inside or outside the clip region will not be rendered.

- **com.interactive.jcarnac2d.model.layers.cgShapeListLayer**
Added the following public functions:
  - `setClippingPolygon(cgPolygon)`: Defines clipping mask in model coordinates
  - `addShapeToClip(cgShape)`: Specified shape will be clipped by mask
  - `removeShapeToClip(cgShape)`
  - `clipEntireLayer(boolean)`: If enabled, all shapes in layer will be clipped using the same mask regardless of the shapes added using `#addShapeToClip(cgShape)`
  - `clipOutside(boolean)`: Define the clipping orientation. Clipping outside will only allow rendering outside of the clipping mask.
*Changes only affecting OpenGL:*
Updated `#getNode()` to inform nodes if they were marked for clipping and to add the clipping (stencil) node to the front or back of the parent node depending on rendering direction.
*Changes only affecting Java2D:*
Update `#render(cgModelRenderer, cgRect)`, `#render(cgModelRenderer, cgRect, boolean)`. Much like the changes to `cgJOGLRenderingVisitor`, clipping is enabled and disabled before and after the rendering of each shape.
- **com.interactive.jcarnac2d.model.scenegraph.cg2DNodeFactory**
Added `#createStencilNode()` to interface.
- **com.interactive.jcarnac2d.model.scenegraph.cgNode**
Added `#isClipped()` and `#setClip(boolean)` to interface.
- **com.interactive.jcarnac2d.model.scenegraph.cgStencilNode**
New class. Base interface for the stencil node.


Added new tutorial `jcarnacpro.simple.ClipRegion` which illustrates how to use the clipping features added to `cgShapeListLayer`. Shows user how to specify which shapes in the layer should be clipped, how to clip the entire layer, and how to toggle the clipping direction. Tutorial works in both Java2D and OpenGL.

Added `cgAxisZoomManipulator` which can be added to a `cgAxisView` allowing the user to click and drag a rectangular section on the specified axis. When released, the plot will zoom to the highlighted area.

Some changes to view delegates to allow support of other rendering technologies.

Added method `setVisible(boolean)` to interfaces `cgViewDelegate` and `cgPlotDelegate` and to classes `cgJava2DPlotViewDelegate` and `cgJava2DPlotDelegate`.

## 3.3 Release

We added shape-based gradients. Users can now have gradients that are defined in shape or model coordinates. Previously, gradients could only be defined in view coordinates.

Added the new classes:

- JCarnacGradientPaint
- JCarnacShapeLinearGradientPaint
- JCarnacShapeRadialGradientPaint


Added these protected methods to cgAbstractShape:

- setGradientPaintShapeTransformation(cgRect currentBounds)
- setGradientPaintShapeTransformation(cgRect currentBounds, Point2D rotationCenter, float rotationAngle)
- setGradientPaintShapeTransformation(Point2D pointO, Point2D pointU, Point2D pointR)


The shape-based gradient tutorials are:

- CompositeShapeUniformGradientTutorial.html
- SingleShapeGradientTutorial.html


We added the ability to have the axis displayed internally to the plot. It allows the axes for a `cgPlot` or a chart to be displayed inside the central component. This feature is useful to save space when the user has only a small screen area for the display.

On cgPlot, we added enums AxesType `{INTERNAL, EXTERNAL}` and AxesEndClip `{BOTH, HORIZONTAL, NONE, VERTICAL}` and new methods:

- cgPlot(JComponent view, AxesEndClip axesEndClip)
- setAxesType(AxesType axesType)
- AxesType getAxesType()
- setInternalAxesClip(AxesEndClip axesEndClip)
- AxesEndClip getInternalAxesClip()


The internal axis tutorial is [InternalAxesPlotDemo.java](/solutions/geotoolkit/geotoolkit_java/api/apidocs).

We changed the implementation of `cgGeneralPath` to internally use `Path2D.Double`; it was using `GeneralPath`. This change was very important to improve accuracy of our rendering — this new implementation class uses doubles while the old one used floats. We deprecated three methods: `cgGeneralPath.getGeneralPath`, `getGeneralPathJava`, and `setGeneralPathJava`. Both these methods have now slightly different semantics than in the 3.2 release. These methods now must copy the `GeneralPath` argument/return value because the internal implementation class is now a `Path2D.Double`.

For example, if you have any code that sets a `GeneralPath` and then modifies the `GeneralPath` after calling the set method, you will need to change your code. You will similarly have to change your code if it expects that the return object reference is the same as the internal implementation.

Fixed handling of rotated or transformed text in a SVG file.

Small changes in `cgTransformation`: removed Logging when an exception was being thrown, inited the root cause exception when wrapping a `NonInvertibleTransformationException` in an `ArithmeticException`, and improved javadocs.

Corrected problem where part of a view in a `cgStackedPlotView` sometimes was not redrawn. This was sporadically observable when the views overlapped each other. This fix means that `cgViewDelegate.paintViewsToCache` will sometimes be called with its first argument, `Graphics g`, as null. If you have an implementation of this method, you should change your code to allow for this possibility.

Added new method `cgColorBar.setColorBarBorderAttribute` that allows users to control the graphic attribute of the border drawn around the color bar.

Fixed crash in printing when printing to PDF.

Added new layouts for the colorbar labels. The labels on the seismic color bar were poorly positioned with obvious gaps. We changed the implementation to allow for (a) beautifully symmetric labels or (b) complete user control over labels.

This required significant changes; the old mechanism placed labels in a model space and forced the view to filter colliding labels. The new approach has a distinct layout engine class that has total control of label positioning in view coordinates.

- New interface: cgLabelLayout.
- New classes: cgAbsoluteLabelLayout and cgDefaultLabelLayout.


Removed deprecated SVG parser and associated classes. You must use SVGShapeBuilderFactory and SVGShapeBuilder.

## 3.2 Release Notes

Changed the workflow for printing, the user is now always guided to select a printer before going to our `cgPrintDialog`. Also no other dialogs are presented after `cgPrintDialog`. This change was important to improve the reliability of printing. Users now cannot change the printer after our pagination is computed. Also now that `cgPrintDialog` knows what printer it has, the dialog can be tuned to the specific printer. For example, now the paper sizes that are supported by the specific printer are displayed to the user. Also `cgPrintDialog` attempts to detect if continuous printing will work. If the dialog determines that continuous printing will not work, that option is removed from the dialog.

- Fixed picking bug that occurred when the model to view transformation had very different x and y scales.
- Fixed bug in the location of axis labels in a few cases.
- Made all tick generators internally use `long`s in their calculations instead of `int`s. This improves their behavior when the user zooms a lot.
- Improved ergonomics in thumb view controller: set the minimum size for the controller width to 3 pixels.
- Added line style `CG_LS_SHORT_DASH`. Changed dash patterns in `cgGraphicAttribute` to be more pleasing.
- Added region list for JContour.
- Added methods to axis renderers so that user can get their state.
- Added lots of documentation for manipulators: user guide, and javadocs.
- Added `CombinedManipulators` tutorial.
- Added `CustomShape` tutorial.
- Fixed some small bugs that prevented user control of rendering. Changes:
  - `cgPlotView setViewPositionWithoutRepaint` was not respecting the `_cachefrozen` flag.
  - `cgStackedPlotView newCache` was not respecting the `_cachefrozen` flag.
  - `cgStackedPlotView setViewPosition` was not respecting the `_cachefrozen` or `_paintfilter` flags.
- Added page sizes to print dialog pulldown.
- Added progress bar when printing. Printing now happens on a background thread, and the user sees the progress and can cancel the print job if desired. The print dialogs (`cgPrintDialog` and `cgPrintPreview`) now use the `ExceptionObserverMap` to give printing errors to the application. See the tutorial `PrintPlot` for a code example.
- Fixed bug in `cgPlotView` and `cgStackedPlotView setViewPosition` when the x and y position was changed simultaneously.
- Improved precision issues in some of the classes that use the JDK path object.
- Fixed bug in svg shape: was incorrectly rendering stroke/fill with translucent paint. Consequently 'halo' effect in batik was broken.
- Corrected SVG pattern parsing. Previously, `PatternPaint` did not respond to transformations (and was documented as such). Now, the default behavior is to respond to transformations. You can recover the old behavior by passing the `(ACCURATE_STROKE_OVER_FILL, false)` element to options in the svg shape builder. See the javadocs for `SVGShapeBuilder` and `SVGShapeBuilderFactory` for further details.
- Renamed `AbstractCarnacGradientPaint` to `AbstractCarnacPaint`. Added `CarnacPatternPaint` for functionality above.
- Fixed bug in trying to select a rotated `cgText`.
- Fixed bug in `cgLine` and `cgArrow` when rotating shape with non-standard rotation center.
- Fixed bug in `cgRectangularImage` where images did not display correctly under some transformations. Also fixed nullpointer error when exporting image to CGM.
- Fixed bug where user needed to click on handle a second time to rotate shape.


## 3.1 Release Notes

For the 3.1 release, J/CarnacPro moved up to JDK 5, and all collections were generified. Additionally, the new print to scale feature was completed in this release. This necessitated a change in the requirements that applications must follow in order for printing to work properly.

### New Printing Requirements

1. The model must have a bounds. Use the existing methods `cgPlotView.setBoundingBox`, or `cgCommonModel.setBoundingBox` to establish the bounds.
2. All the shapes must fit inside these bounds. Any shapes outside the bounds won't print.
3. If you use a `cgStackedPlotView` or a `cgSeismicView`, for all the models in the view, the model bounds in device space must match.


Many improvements were made to the printing as seen in the following list:

- Reworked the print dialog to make it look better and to support the new printing options. We have quite a few new printing options.
- The new print dialog uses the JGoodies Forms layout manager which is in `forms.jar`. You will need to distribute this jar with your application if you want to use our print dialog.
- We are now distributing the source code to our print dialog. Look in the `docs/JCarnacPro/print_dialog` directory to see the source.
- We have a new tutorial, `CustomPrinterDialog`, that shows how to use your own print dialog.
- Can now get/set the page format and print adapter properties in `cgCarnacComponent` which will make it easier to create a custom print dialog.
- Added print to scale. You can specify the output size for your plot (`cgPrinter.setOutputSize` and `setOutputSizeUnit`).
- Added Keep Annotation Height `cgPrinter.PRN_WYSIWYG_EXPORT` as a printing option (`cgPrinter.setExportMode`). This option keeps the size of the text in the axis annotation the same size as displayed on the screen. The older mode (now named Keep Proportion `cgPrinter.PRN_PROPORTIONAL_EXPORT`) scaled the text proportionally to the data plot frequently causing the text to be too small to read.
- We have a new tutorial `PrintServiceDemo` that shows how you can validate page sizes before showing them to the user. This is key if you want to print on page sizes that are uncommon. This tutorial uses the new print methods in `cgCarnacComponent` that specify a validate flag and the `PrintService` (the printer). The new method is `cgCarnacComponent.print(PrintService ps, boolean validate)`.
- We have a new tutorial `ExportLayout` that shows how to use the new export calculators (interface `cgExportSizeCalculator`). The export calculators give you programmable control over how the components are sized during printing.
- We have a new tutorial `ContinuousPrinterTest` that is a pure Java application with no dependencies on J/GeoToolkit that will allow you to test if a printer will properly support continuous roll printing. Many printers that have roll paper do not print all the way to the top and bottom of the page. Being able to print to the entire page is crucial for successful continuous printing given that Java always breaks print jobs into pages. See the [J/[J/CarnacPro User Guide Section 10.6](/solutions/geotoolkit/geotoolkit_java/jgeotoolkit/jcarnacpro/runtime#printing) for more info.
- We now support a document header and footer that only appears when you print. See the new tutorial `DocumentHeaderandFooter`. This functionality is implemented with the new `cgPrintDecorator` interface and the new method `cgCarnacComponent.setPrintDecorator`.
- You can now programmatically set what paper and roll sizes are used in our print dialog (`cgPrintDialog.setPrinterMediaPages` and `setPrinterMediaRolls`).
- Printing on linux/JDK 6 was fixed. All Java applications on linux and JDK 6 were getting `NullPointerException`s due to a JDK bug. See [Bug Database](http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6633656).
- Can now use the print preview dialog without the INT print dialog.


The API changes from 3.0 to 3.1 are low impact. We removed deprecated classes that had been deprecated for two releases. We also refactored the hooks in JGeoToolkit for rendering using a scenegraph library. We are preparing for a new toolkit option to render using GLSL shaders entirely on the video card. `cgNodeDecorator` has been renamed into `cgNodeProxy` and does not inherit from `cgNode` anymore. Thus all `render(cgNodeRenderer, cgRect)` methods have been removed. Also a few concrete classes in `com.interactive.jcarnac2d.model.scenegraph` which did not need to be referenced inside JCarnacPro have been removed.

Other changes are the following:

- Moved up to Batik 1.7. We were using 1.7beta.
- If you use PDF printing extensively, you might want to bundle your own fonts, some popular ones can be found at (please read their license agreements):
  - http://www.alkalay.net/software/webcore-fonts/
  - https://www.redhat.com/promo/fonts/
  - http://corefonts.sourceforge.net/
- We now do a better job of finding system fonts while PDF printing. You can also set directories to find fonts (`cgPDFProperties.setAvailableFontDirectories`).
- New tutorial added that shows how to specify a custom shape for the shape edit handles (`CustomShapeEditHandles`).
- You can now display embedded images in SVG. See [com.interactive.jcarnac2d.util.svg Javadocs](/solutions/geotoolkit/geotoolkit_java/api/apidocs)
- Added logging to the tutorial `simple.PrintPlot` so that users can see the precise PageFormat used to print the plot. The `PrintPlot` tutorial also now loads custom paper formats from a `paper.properties` file.
- Fixed `cgSymbol` behavior when the transform in the shape renderer has rotations (nominally the model to view transformation).
- You can now use a grid without having an axis.
- Added new tutorial, `LargeDataSet`, that shows how to handle large data sets efficiently.
- Image buffer types in `cgImageBuffer` were changed from `int` constants to a Java enumeration `BufferType`. The buffer types that we support were changed from signed types to unsigned types to better align with hardware capabilities exposed by OpenGL. This allows us to achieve much better performance.


## 3.0.2 Release Notes

This release added new svg parsing abilities based on the Apache Batik library. The new parsing ability is found in the package `com.interactive.jcarnac2d.util.svg`. The old parser in `com.interactive.jcarnac2d.model.svg` is now deprecated and will be removed.

We also added more control to the way that the plot is scaled when it is printed. This functionality can be found in the package `com.interactive.jcarnac2d.util.export` and in changes to the class `cgPrinter` (e.g. `PRN_PROPORTIONAL_EXPORT` and `PRN_WYSIWYG_EXPORT`). This new functionality is exposed in the JSeismic tutorial `jseismic/plot/Printing.java` and the JWellLog tutorial `jwelllog/PrintLog.java`. This new functionality is not yet available through the standard INT print dialog.

This release also upgraded the itext library (used for PDF printing) from version 1.4.8 to 1.5.2.

## 3.0.0 Release Notes

The API changes from 2.7.1 to 3.0.0 are mostly additional methods and classes to support rendering using a 3D accelerated scene graph engine. These additions are only usable if the scenegraph rendering extension is also installed (contact sales@int.com for availability).

A key addition was to add support so that any component in the view can print to a PDF file. We also added a rich text shape, cgRichText, that can apply multiple styles to a single text object using xhtml markup.
JCarnacPro now supports JDK 6. You should be aware of an issue that sometimes causes axis baselines to disappear. Our current information indicates that this issue only impacts J/Seismic. This issue is more likely to appear in JDK 6. If you are interested, you can read more about this issue in the JSeismic release notes where we present three known work-arounds.

If you upgrade to Java 6 from a previous Java release, you should be aware of a change in the Java class hierarchy that may impact you. Sun has added a new class `java.awt.geom.Path2D`; `AffineTransformation.createTransformedShape(Shape)` now returns `Path2D.Double` object. In previous Java releases, this method returned a `GeneralPath` object. The API of this method only specifies that it returns a `Shape`. Shape is an interface that is implemented by both `GeneralPath` and `Path2D`. Any code that you may have that looks like the following will now throw a class cast error.