JavaFX Widgets
Custom widgets for JavaFX 2.0
Saturday, February 11, 2012
The DoubleSlider Control
It can be downloaded from : javafx-widgets
I haven’t implemented the keyboard bindings expect “Home” and “End”, because I couldn’t find an efficient way to handle them. The problem is that I couldn’t manage a thumb focused at a time.
Monday, January 30, 2012
A Complex Widget : Waterfall Display
The waterfall display is refreshed at intervals between 200 and 3200 ms. The intensity data is stored in a byte array. At each refresh time the last line is added to the array, and the image is regenerated in the memory with the timestamps and the overlay texts if exist.
In this process, first the waterfall part and the timestamp part of the image are created as buffered images. The waterfall part contains the byte array which has the intensity data normalized to 0 – 127. The data are colored with an indexed color model spanned between a first color and a second color. Then both parts are combined into a full buffered image on which the texts are drawn. Last operation is the conversion of the buffered image to an PNG format so it can be handled by JavaFX Image class. Whole generation process runs in the background so the mouse movements are not affected. I implemented JavaFX Task class for threading and think it is easy to implement.
An extended cross hairs is added to get the intensity value at desired points. It is also used to add overlay texts on the image. They can be entered by right click.
Saturday, January 21, 2012
Simple Calendar for JavaFX 2.0
The SimpleCalendar is a combination of two components: A popup container for date picking and a button to display the hidden popup container. The container consist of three blocks. The top block displays the month and the year and hosts two arrows to navigate back and forth between months. The center block only displays first letters of the names of the days. The bottom block displays the days of previous, present and next months. The names are retrieved based on default locale. Since the first day of the week is Monday in some locales it is taken into account.
A string bean property (changed to ObjectProperty
Shock the senses
I read an article in Java Magazine about JavaFX 2.0. The title was pretentious : Shock the senses. I downloaded the latest version along with JDK 7 and the examples as well. After some small programming trials and playing with examples I have to admit that it is hard to deny that it would be a compelling rival to Silverlight and Flash. Even the kingdom of Qt could be shattered by what JavaFX will offer in the near future. For now the latest version is solely available for Windows platforms. Nevertheless it will be an integrated part of the JDK 8 platform.
According to long-term roadmap for JavaFX the important dates are as follows:
- First half of 2012 : JavaFX 2.1 (Mac OS X GA, Linux Development Preview)
- Second half of 2012 : JavaFX 2.2 (Linux GA)
- 2013 : JavaFX 3.0 (Included in JDK 8)