Metro style Check Box for Java (JMetro) – Revisited

Last post I made about JMetro – my metro inspired skin (or look and feel) for Java, was about skinnng the calendar picker control. I was going to use Tom Eugelink nice calendar picker but I learned at that time that one was being created by Oracle and shipping with Java 8, so in the interest of time (have little spare time to waste) I thought it would be better to wait till Java 8 was more mature and continue my work on JMetro than, and skin Oracle’s official date picker instead.

So recently I restarted my work on JMetro by re-evaluating it and re-tweaking things where I think they need to be improved. Also I want to make sure that everything is working fine with Java 8.

Today I present a retweaked version of the checkbox control:

jmetro checkbox (before)

Before

jmetro checkbox (after)

After

The differences are on the checkbox mark (very slight difference) and on the focus ring, that is the dotted square you can see on the first checkbox indicating that it has focus.

I’m still not happy with how the fonts are being rendered, I’ll be investigating the reasons why fonts are being rendered poorly in the time I’ve left.

As usual, you can grab the code in the jfxtras repository .

What’s new in Java 8 (Part II – What might come)

Disclaimer: I do not work for Oracle or represent Oracle in any way. This list of features is not official. This is just part of my research as an “outsider”.

This is part II of a three part series of posts. In the first part, I talked about what Oracle has officially let developers know what should come out in JavaFX 8 (JavaFX is the new UI library for Java), I have been updating that article with new information that I come across.

In this second part I’ll talk about what might be coming in this Java8 release or a release some time after.

What might come

Support for ios and android

Official support for ios and android might be on its way. There is already a non Oracle effort to bring ios and android support to JavaFX called RoboVM, however it is still in its alpha stage and has a long way to become a fully formed commercially viable solution.

Oracle has not yet made any statement that it will officially support this platforms, yet there are some indications that this is already happening. Just look at these sessions on this years JavaOne from Oracle staff members, that @tobibertoni (twitter user name) has mentioned:

Build and Debug Your JavaFX Application for the iPad [BOF5517]

* David Pulkrábek – Senior Software Developer, Oracle
* Oldřich Matička, Oracle

JavaFX for iOS has begun to move to open source. In this session, you will see how to turn your JavaFX NetBeans project into a real iPad application. You will also be shown how to debug a JavaFX application on your device by using the Java Platform Debugger Architecture (JPDA) and step-by-step instructions for adding custom Java Native Interface (JNI) code to an iOS application.

https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=5517

JavaFX on Android: First Insight [BOF7791]

* Tomáš Brandalík, Oracle

The gap between desktop and embedded has been filled with JavaFX on Android and iOS. JavaFX running on Android enables you to connect with tens of million of devices. This session gives you everything you need in order to successfully develop JavaFX applications on Android. First, it walks you through the complete development process, from project setup to debugging. Second, it explains the main building blocks: packaging, installation, the application lifecycle, fonts, interaction with device and operation system services, media, and WebView. Finally, it wraps up with the build structure and how developers can control and customize their own builds.

https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=7791

High-Performance Java Applications Without Dynamic Code: Ahead-of-Time Code Generators for iOS [BOF4099]

* Robert Vandette – Consulting Engineer, Oracle

The Apple iOS and Android operating systems used in popular mobile devices are high-volume platforms that until now have lacked compliant Java support. This session describes Oracle’s plans to bring the latest Java language and API features from Java SE 8 to the Oracle ADF Mobile feature of Oracle Application Development System (Oracle ADF) for iOS and Android application development. It also discusses the features contained in the JDK 8 for Oracle ADF Mobile implementation and how to develop Java applications that target iOS and Android.

https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=3783

JavaFX on the Web

Oracle is working on making it possible to run JavaFX on the web without any need for plug-ins (which are now being prohibited from use on several platforms). You can already check Bck2Brwsr, now on its 0.7.2 version.

Another idea is WebFX a specialized browser which can consume FXML directly.

Spice Up Your Browser with JavaFX [BOF7830]

* David Pulkrábek – Senior Software Developer, Oracle
* Oldřich Matička, Oracle

JavaFX is a powerful multiplatform graphics technology, but is it possible to run your JavaFX application in a browser without a plug-in? Directly from class files? Of course, it is! This session demonstrates a plug-in-free solution that brings JavaFX to your browser.

https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=7830

The Chuck Norris Experiment: Running Java in Any Browser Without a Plug-in [CON4044]

* Jaroslav Tulach – NetBeans Platform Architect, Oracle
* Anton Epple – Trainer and Consultant, Eppleton
“Chuck Norris can run Java in any browser—without a plugin”. Find out what you need in order to reproduce Chuck’s roundhouse kick. In this session, you’ll learn everything you need in order to get started with “bck2brwsr”, a new open source project. Besides in GWT, the bytecode isn’t compiled to JavaScript but runs in a JavaScript-based JVM. The session shows you how simple it is to extend the capabilities of this project by creating your own APIs, which enables you to create maintainable applications by using, instead of JavaScript, a statically typed language with excellent tool support that runs in any modern browser. You’ll see a demo of building a Space Invaders–type game that runs on the iPad as well as Android devices. This is not a preview; you can use it today.

https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=4044

WebFX: Running JavaFX Like HTML5 Apps [BOF3132]

* Bruno Borges – Principal Product Manager, Oracle

JavaFX for desktop applications is becoming a common case. But what if JavaFX could really replace HTML (or the new HTML5)? You’d simply go to a URL and load a Website built entirely with JavaFX. Support for CSS and JavaScript would already be included, and integration with servers using WebSocket or JAX-RS RESTful services would also be supported. Pressing refresh would be an easy way to reload the application (or should we say page?) and test the new version. Could FXPs, or FX Pages, really replace HTML5? This session takes a look and considers a new approach for Web 3.0.

https://oracleus.activeevents.com/2013/connect/sessionDetail.ww?SESSION_ID=3132

XYBarChart for javafx

One new addition to the FXCharts repo that I’ve created on github. This time it’s a XYBarChart, that is a bar chart that doesn’t have the limitation of the SDK BarChart which only allows you to have a CategoryAxis/ValueAxis pair of axes.So in other words, for example,  you can’t set a pair of axes if their of type DateAxis/ValueAxis. And as another consequence of these you can’t easily add zoom capabilities to a BarChart.

These type of chart wasn’t so easy to create was one might initially expect. Copy pasting the code from BarChart and altering the significant bits is not enough since BarChart relies on several package private methods from XYChart.

You can grab it from: https://github.com/dukke/FXCharts. If you have patches, features, fixes for this library please participate. Let’s create a better charts API.

 

DateAxis for javafx

A somewhat common request for people working with the charts API in JavaFX is a DateAxis. Essentially that would be an Axis that would be able to show dates.

I’ve hacked up a quick implementation of one, you can get it from github: https://github.com/dukke/FXCharts

It takes the time value of dates and displays them using the format given defined by “TICK_UNIT_FORMATTER_DEFAULTS”.

It’s not really a very elegant solution but it works. I’ll try to give a hand to Diego Cirujano-Cuesta and Christian Schudt who are working in a more evolved DateAxis that takes up Dates instead of their time value.

This implementation was done under Java8. It might work with JavaFX 2.2, I don’t know.