Home

Awesome

FXGraphics2D

Version 2.1.4, 12 February 2023.

Maven Central

Overview

FXGraphics2D is an implementation of Java's Graphics2D API that targets the JavaFX Canvas. It makes it possible to reuse existing Java2D code in a JavaFX application. The following example is generated by JFreeChart-FX:

FXGraphics2D sample

Background

The code has been developed for the use of Orson Charts (https://github.com/jfree/orson-charts/) and JFreeChart (http://www.jfree.org/jfreechart). Numerous demos can be found in the JFree-FXDemos project page at GitHub.

You can also read about FXGraphics2D in this Java Magazine article:

Temporary: link above is broken, please use this in the meantime:

FXGraphics2D requires JDK 11 or later and is licensed under the terms of a (three clause) BSD-style license.

Include

To include FXGraphics2D in your own project, add the following Maven dependency:

<dependency>
    <groupId>org.jfree</groupId>
    <artifactId>org.jfree.fxgraphics2d</artifactId>
    <version>2.1.4</version>
</dependency>

Build

You can build FXGraphics2D from sources using Maven:

mvn clean install

Testing

FXGraphics2D is being tested using Graphics2D Tester and produces the output shown below. There are several areas that still need work:

fxgraphics2d

Feedback

If you have feedback about the FXGraphics2D library, please use the discussion area.

License

FXGraphics2D is licensed under a BSD-style license:

Copyright (c) 2014-present, David Gilbert.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, 
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, 
this list of conditions and the following disclaimer in the documentation 
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors 
may be used to endorse or promote products derived from this software without 
specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

History

12-Feb-2023 : Version 2.1.4
23-Jan-2022 : Version 2.1.3
5-Aug-2021 : Version 2.1.2
24-May-2021 : Version 2.1.1
3-Oct-2020 : Version 2.1
27-Feb-2020 : Version 2.0
7-Feb-2019 : Version 1.8
5-Jul-2018 : Version 1.7
5-Nov-2017 : Version 1.6
15-Oct-2016 : Version 1.5
27-Apr-2016 : Version 1.4
28-Jan-2016 : Version 1.3
23-Jan-2016 : Version 1.2.1

Note that version 1.2.1 corrects a Maven dependency problem that sneaked into the 1.2 release.

30-Jul-2014 : Version 1.1
19-May-2014 : Version 1.0