Anyone tried to add nodes and check for collisions ?

A discussion forum for FXGraphics2D (adds a Java2D API to the JavaFX Canvas).
Locked
bruehlicke
Posts: 25
Joined: Thu Apr 03, 2008 5:51 pm
Location: Houston, TX, USA

Anyone tried to add nodes and check for collisions ?

Post by bruehlicke » Fri Sep 11, 2015 3:33 pm

I am pretty excited about this bridge allowing exciting JFreeCharts to be rendered in a FX Scene - brilliant by the way. Now, I wonder if anyone has tried to add a fx shape (example a Circle) and giving this circle a DragListener and check for Shape Intersections (aka collisions) with objects from the original JFreeChart ?

bruehlicke
Posts: 25
Joined: Thu Apr 03, 2008 5:51 pm
Location: Houston, TX, USA

Re: Anyone tried to add nodes and check for collisions ?

Post by bruehlicke » Tue Sep 15, 2015 2:27 am

To answer myself. Just converted a JFreeChart to a nice FX graph showing the entire canvas as node. On top in a StackPane I have added FX Circle shapes which can detect collisions between themselves. The Chart stays in the background while the Shapes are dynamic movable on top. This shows: FXGraphics2D is extreme simple to use to render your existing code with no or super little changes in FX while giving the option to add new nodes to the same scene. If more complex interactivity between objects (data points) inside the original graph and newly added FX shapes is needed, it does not look like this is the way to go and a native FX implementation of your graph is more preferred (at least in my humble mind). Still - for converting existing graphs it works great. Thanx to The JFreeChart Team.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Anyone tried to add nodes and check for collisions ?

Post by david.gilbert » Mon Sep 21, 2015 8:14 pm

Hi,
I agree with your assessment. FXGraphics2D is designed to allow existing Java2D-based code (JFreeChart and Orson Charts in particular) to be used directly in JavaFX with very minimal changes. If you need node-based charts, then you'll probably want to look at the chart package provided in JavaFX or another alternative (not sure if there are any, you might need to roll your own).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked