New Parallax control for Java (JavaFX)

Introduction

Parallax is a visual effect where you combine at least two layered images moving at different speeds to achieve a sense of depth.

Think about when you’re driving on the road and you see the trees close to you moving fast whereas the trees that are further away will move in the same direction but slower, the result is that you perceive the trees that are moving faster to be closer to you and the others to be further.

If you are a fan of video games you’ve certainly seen this effect before: two or more images are placed one over the other, the background moves slower, and the foreground, which could be the player’s avatar or the foreground where he stands moves faster.

This is an often used trick in the video games world. It started to be used quite long ago, an example is the Super Mario video game series.

Super Mario game using a parallax effect

Continue reading

Update to FXRibbon (Ribbon for Java)

I’ve updated the Ribbon control and its documentation.

Here’s some of the relevant code changes (you can check the git log history for more details):

  • Cleaned up API
  • Cleaned up code into standard conventional packages
  • Fixed and cleaned up test apps (that also serve as documentation examples)
  • Added gradle build and configuration
  • Other refactors

Here’s the new page for the FXRibbon documentation: here.

Future developments for this library:

  • Add button controls: current javafx buttons don’t provide the best API for the ribbon use case, there’s also an issue where if you have a button with a multi line label, the label won’t be vertically aligned with the rest of the buttons.
  • Add other specialized controls, e.g. Ribbon gallery
  • Fix other issues in the issue tracker.

Update to JMetro implementation and documentation

It’s been too long since my last post! I plan on posting more regularly in the coming future.

Meanwhile, I took the opportunity to re-design this site which was looking pretty bad. Also thought my free open source libraries needed more attention, namely documentation so I’ve started working on that. The first one is going to be JMetro, you can check out the documentation here.

While I was looking over JMetro to write the documentation, I noticed some bugs and also a few aesthetic issues that I fixed:

  • Spinner: remove white background glitch with some style classes
  • List Box: added border around control
  • Slider: Somehow the fix to the slider when in vertical orientation, that fixed the fact that the fill started from the top instead of the bottom got lost. I re-implemented this fix.

Still haven’t had time with the font rendering issue. You can notice poor font rendering in JMetro on Windows with text in big font sizes. This is probably a JavaFX bug/problem because I’ve seen this elsewhere on images in other people’s blog posts and also other applications I’ve worked on.

Javafx on mobile first impressions

I decided to give it a go at testing javafx in an android device. My android device might be considered a low end device, it’s a nexus 4 from LG. The result can be seen below in a video. The quality of the video isn’t the best, I had to scale down the quality because the video was occupying 2GB.

My conclusion is that java/javafx runs with a very good performance in a low end android device with a pretty decent start up time. There were just 2 problems with this test, the first was with a demo which tested multi touch but didn’t run with top notch responsiveness but that might be the demos fault and not an issue with javafx itself. The second problem were dialogs: they aren’t showing up well.

The demo took about 6 seconds to start which is more than the standard android app but not too much.