gillius / jfxutils

JavaFX Utilities - Zoom and Pan Charts and Pane Scaling
Apache License 2.0
68 stars 22 forks source link

jfxutils

JavaFX Utilities - Zoom and Pan Charts and Pane Scaling for JDK 7+ (including JDK 8)

License: Apache 2
Latest Release: 1.0
Development version: No work past 1.0 done yet.

Bug Fixes in 1.0 since 0.3

Getting

Latest Release

Starting with jfxutils 0.3.1, all releases are available in the Maven Central Repository. All builds also have javadoc and source variants available. The 0.3.1 release is the same as 0.3, except the POMs have been updated for deployment to the Central Repository.

<dependency>
  <groupId>org.gillius</groupId>
  <artifactId>jfxutils</artifactId>
  <version>1.0</version>
</dependency>

Latest Snapshot

Currently there is no development snapshot version, since no development has occurred since 1.0. However, settings when there is a snapshot are configured as below:

<repositories>
  <repository>
    <id>ossrh</id>
    <name>OSSRH Snapshots</name>
    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
  </repository>
</repositories>

Then you can add dependency on the snapshot:

<dependency>
  <groupId>org.gillius</groupId>
  <artifactId>jfxutils</artifactId>
  <version>1.0-SNAPSHOT</version>
</dependency>

Old Releases

jfxutils 0.3 and earlier were never published at Maven Central Repository and only at the gillius.org repository. Note for 0.3, I made a release 0.3.1 with the same code that is published at Maven Central.

<repositories>
  <repository>
    <id>gillius-org</id>
    <name>Gillius.org Maven Repository</name>
    <url>https://www.gillius.org/maven2</url>
  </repository>
</repositories>

Then add the following to your dependencies section:

<dependency>
  <groupId>org.gillius</groupId>
  <artifactId>jfxutils</artifactId>
  <version>0.3</version>
</dependency>

Documentation

Screenshot

Here is a screenshot showing the example application in the jfxutils-example artifact. The first image shows the example using the new StableTicksAxis, which has better performance than the JavaFX NumberAxis when zooming and panning as the tick marks are fixed relative to the data values:

JFXUtils charting example using StableTicksAxis

Here is the charting application using the NumberAxis after zooming and panning, showing the awkward tick labels that result, as NumberAxis tick labels are fixed with the graph's graphical layout and not fixed relative to the data:

JFXUtils charting example using StableTicksAxis

Building under JDK 7

Since JavaFX is not included in the default classpath of JDK 7 applications, even if you have installed JavaFX SDK or are using a recent Java 7 with it bundled, compiling is awkward. When you compile if you get reference errors to javafx packages, copy the jfxrt.jar from your JDK's jre/lib directory to jre/lib/ext. This solution was proposed at https://github.com/zonski/javafx-maven-plugin/wiki/Fixing-the-JRE-classpath. You can also run the Maven command on that page to do the copy for you, but you must run as a user with permissions to copy files in the JDK (i.e. run as admin). Once this is done you can use Maven to build the library. Using the library as a dependency does not require this particular solution, as long as your own project is already building fine with JavaFX.