Metro style spinner for java (JMetro)

It’s been a while since I’ve worked on JMetro.

This time a control that’s not part of the windows framework: the spinner.
I opted to style the control in its STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL style, that is horizontal arrows split between left and right sides. To style the control you need to add the style you want to the StyleClass observable list:

spinner.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL);

the other possible styles are:

STYLE_CLASS_ARROWS_ON_LEFT_HORIZONTAL
STYLE_CLASS_ARROWS_ON_LEFT_VERTICAL
STYLE_CLASS_ARROWS_ON_RIGHT_HORIZONTAL
STYLE_CLASS_SPLIT_ARROWS_VERTICAL

And here are the controls in their light and dark theme:

spinner - light theme 2

Spinner – light theme

spinner - dark theme 2

Spinner – dark theme

 
 
As always you can get this at jfxtras.

Contextual Ribbon Tabs for the Ribbon

A small update to the Ribbon control: Contextual Ribbon Tabs.

Some controls should only appear when a particular object is selected because they only affect the configuration of that object. This is why Contextual Ribbon Tabs exist. They only appear when a particular object is selected and disappear when it looses its selection.

To differentiate themselves from regular Ribbon Tabs they appear with a different color, they can also be composed of more than one Tab. In the picture below the Contextual Ribbon Tab appears in blue.

contextualTab2

What’s new in Java 8u40

Java 8u40 is a small release but never the less has some interesting improvements:

  • Formatted textfield

Text entry control that displays formatted text such as phone number, date etc. Restricts input to a certain format and can also be used for validation of user input to a certain format. Kind of like JFormattedTextfield in Swing.

  • Dialogs

This as seen much debate from the community regarding its API. For more details on the final API read this blog post: http://code.makery.ch/blog/javafx-dialogs-official/

  • Spinner control

More details can be viewed here: https://wiki.openjdk.java.net/pages/viewpage.action?pageId=15368236

  • Accessibility support
  • Java Packager improvements

Another news is that since 8u33 ARM will no longer be officially supported. This happened because:

“This is a resource trade off within Oracle. Included in that difficult
trade off decision was the ongoing investment needed to properly support
FX in a world where so much the hardware is not standardized — it
really is difficult to have enough hardware and testing resources
committed to support FX on ARM”

Hopefully this support will unofficially continue in JavaFX Ports.

Java8u40 is scheduled to hit G.A. by early March.

Gallery control for the Ribbon

This time an update to the ribbon control. I’ve done some tweaks to the UI as well as to the API and added a new control called a Gallery.

Below you can see an image of the updated Ribbon.

ribbon2

In the next picture you’ll see the new control which is called Gallery. Although you can use it by itself, I’ve never seen it being used outside the ribbon.

gallery

The up and down arrows allow you to navigate through the list of choices. The other button will open up a popup (picture below) which gives you a full view of the choices with each choice belonging to a category.

galleryPopup

All of this is CSS and FXML friendly meaning you can declare an instance of the ribbon using FXML and you can style the ribbon to your liking by overriding the existing CSS.