Gillius's Programming

Latest News

View the full Gillius's Programming Blog

JFXUtils 0.3: Mousewheel Zooming -- March 15, 2013 10:13 PM

Version 0.3 of JFXUtils is released now, with only two real changes:

  1. Support for zooming with mousewheel. The location of the cursor is used as the "focal point" of zooming in or out. If cursor is on X or Y axis, only that axis is zoomed. ChartZoomManager allows drag zoom and wheel zoom to be enabled independently, by default both are on.
  2. Fix/workaround for auto-zooming in the charting example.

You can get it at the GitHub project page, or directly from the Gillius.org Maven Repository. You can also view documentation online.

I released version 0.2 of theĀ JFXUtils project I started recently, and now there is code for chart panning, and zooms are now animated. With panning and zooming working, I noticed that the default NumberAxis was not working at all how I would like. The tick positions remain in the same place no matter what the graph's bounds, and the values of the ticks then change to reflect the value. Well, with zooming and panning you will get for example a lower bound of "1432.34234", and this is exactly what NumberAxis will display. So, I created a replacement axis type called StableTicksAxis that keeps the ticks at the same data location for the given zoom level, which has a drastically better UI feel when the graph is changing rapidly during panning and zooming operations. It automatically computes the number and distance between tick marks based on the size of the graph, the graph label font, and the range of data displayed to maximize the number of tick marks without having the labels run into each other. When auto-ranging, it can force zero in the view like NumberAxis, and also like NumberAxis it can add some padding around the data, but unlike NumberAxis the amount of padding (as a percentage of graph size) is configurable.

JFXUtils 0.1 Released -- February 22, 2013 10:43 PM

I wrapped up some of the JavaFX code I've been working with into a library org.gillius:jfxutils, which is hosted at github (project page). The artifact is also published in my Maven repository. It offers the following now:

  1. Ability to add zooming capabilities to a JavaFX XYChart in both plot area and axes.
  2. The scaling-on-resize effect described in my previous post.
  3. An experimental way to replace a Node in the scene graph with a different one (it's not as easy as you think)
  4. A way to get X and Y offsets of a Node from an arbitrary ancestor in a way that handles translation/padding/layout, etc., but does not yet handle scale and rotations (this might be possible if transforms can be combined as rumored for JavaFX 8)

I plan on adding panning compatibility in a future release.

Allegro's Webring

Previous Site :: Ring's Home :: Next Site

Random Site :: Skip Next Site :: List Next 5

DJGPP's Webring

Previous Site :: Ring's Home :: Next Site

Random Site :: Skip Next Site :: List Next 5