Archive for the 'Nimbus' Category

Nimbus: Large, Small, Mini Components

Friday, December 7th, 2007

In the original design for Nimbus there were large,small and mini versions of components. Small and mini components are very useful when you are creating tool pallets or other UI where space is very tight. Apple recently added this to their new look and feel in the latest java versions see Technical Note TN2196. We are using the same client property key and values as Apple to be compatible but I have also added “large” as a option. Not sure “large” is as useful as “small” or “mini” but might look good in wizards or dialogs. Check out the screenshot to see how they look. Nimbus Small Mini 600

JavaOne 2008 Papers

Tuesday, October 30th, 2007

Its already that time of year again to start writing up all your great ideas for Java One Desktop talks for next year. Its only two and a half weeks till they close for submissions so hurry up. Click here for details for paper submission.

I am planning on submitting a talk on Nimbus and the new Nimbus Designer tool. Covering:

  • Using Nimbus L&F in your applications
  • Designing for cross-platform, how to design your application to look good on all platforms
  • Customizing Nimbus
  • Creating new look and feels using the designer tool based on Nimbus
  • Creating your own components with Nimbus L&F themeing support
  • Designing the look for your own components using the deisgner tool

Might have too much to cover in a hour, don’t want to scare you all off. Any thoughts on what topics you think are the most important/intresting in case I need to cut bits out or anything I didn’t mention here?

JavaOne 2008

Nimbus Early Access

Monday, October 1st, 2007

Finally a version you can all go and play with. Nimbus is coming out as part of “Java SE 6 update N” formerly known as the “Consumer Release” and “Project Hamburg”. Well whatever it is called it contains a decent version of the new Nimbus look and feel. You can go and download it from Java SE 6 Update N Early Access Program. Its is definately not 100% finished yet, there are a few areas that we are still working on:

  • Tabs
  • Focus handling is missing from Spinner,Slider, Tree, Table and List
  • FileChooser has a lot of issues
  • Right to Left for international language support
  • 3rd party component theming
  • Color theming
  • Lots of minor things like table gridlines or setContentAreaFilled() support on buttons
  • Exceptions are thrown if the window or some components get too small

Most of these will be fixed in the next EA release or the first beta release. A few of them have been fixed in the last couple weeks, I have just been working on color theming. All colors in Nimbus are derived from a set of UIDefault colors with Hue, Saturation and Brightness offsets. This gives you reasonable control over changing the colors of the Nimbus Look and Feel.

Dark NimbusDarker Themed Nimbus

Using Nimbus

There are 3 easy ways to use the Nimbus look and feel:

  1. If you query UIManager for a list of available look and feels then Nimbus will show up in the list
  2. Add UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); to your application before creating any Swing components
  3. To specify the L&F from command line, use the following when running your Java application: -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel

The reason Nimbus is in the sun.swing… package is it is not possible to add new API to the javax.swing… package in a update release. We hope that we can move Nimbus to javax.swing in Java 7 and if it turns out to be popular then we push to make it the default look and feel in 7. Before 6 update N is final we will work out some way for you to be able to use it now and when it is potentially moved without changing any code.

If you Find Bugs

You can search to see if there is an existing at Sun Bug Database or you can view a List of open Nimbus Bugs. You are welcome to post bugs here as comments and I will file them if they are not known bugs.

Other Cool Features of Update N

Improved performance

  • The Quick Starter feature will prefetch portions of the JRE into memory, substantially decreasing the average JRE cold start-up time (the time that it takes to launch a Java application for the first time after a fresh reboot of a PC).
  • Hardware acceleration support: Java SE 6 Update N introduces a fully hardware accelerated graphics pipeline based on the Microsoft Direct3D 9 API, translating into improved rendering of Swing applications which rely on translucency, gradients, arbitrary transformations, and other more advanced 2D operations.

Enhanced JRE installation experience 

  • The Deployment Toolkit takes the guess work out of determining what versions of the JRE end users have installed on their PC. It supplies Java based web applet/application deployers with a simple interface to accomplish Java detection and installation.
  • The Kernel installation mode lets first time Java users run applets and Web Start applications without waiting for the whole JRE download. While the default Kernel installation will work with existing Java applets, application developers have the ability to select libraries that should be installed with the kernel, before the rest of the JRE is installed on the end user’s system.
  • For current users of Java SE, the JRE update mechanism has also been improved, using a patch-in-place mechanism that translates in a faster and more reliable update process (the patch in place mechanism will take effect for end users who upgrade from this update release or later to a new update release). As an added benefit, follow-on update releases will no longer be listed as separate items in the Windows “Add or Remove Programs” dialog.
  • A new Java update download engine provides end users with the convenience of pausing and resuming the JRE download, and relies on a more reliable download mechanism.

Nimbus almost done

Saturday, September 8th, 2007

Finally we are almost done with Nimbus and I am very pleased with the way it looks. There are many small details that need to be pollished and a couple of big ones like tabs but they will all be done by the time it gets released. I thought it might be time to tease you with some screenshots and details to keep you hungry.

Nimbus Buttons Windows XP
Nimbus Buttons on Windows XP

Technology

I think we have also made some exciting technology behind nimbus it’s not just another standard hard coded swing look and feel

2D Vector

All of Nimbus is rendered with 2D vector graphics, there is not one image even for all the icons. This means that the whole of Nimbus is just 56k as a packed jar which is pretty impressive for a whole rich look and feel.

High DPI Ready hd ready

As the whole of Nimbus is drawn with shapes and gradients it can be scaled to any resolution. You will not be able to control this yet but watch for it in the near future.

Based on Painters

All painting for components is done with simple stateless implementations of the Painter interface. These painters are stored in the UIDefaults table so they can be replaced if you would like to change the look of components or can be used in your own components if you would like to create a custom table header for example that looks the same as the standard Nimbus one plus something extra.

Customizable

All colors, icons and fonts are derived off UIDefaults keys so the whole UI can be customized by changing values in the UiDefaults table.

Easy to skin 3rd party components to fit in

All of the colors, fonts, icons, borders and painters are exposed through the UIDefaults table which means they are available to your 3rd part components to help you skin them in a Nimbus style.

I saved the best for last….

Nimbus was drawn graphicaly in a new tool we have been building. Almost none of it was hand coded. We have built this tool that is like a mini Photoshop or Illustrator that lets you graphicaly draw all the 2D vector graphics for each of the states of the components. Those graphics are then compiled into Java2D painting code which is exposed as simple Painters to the LookAndFeel. It has support for advanced features like sub-pixel acuracy, complex gradients, layers and layer effects like drop shadow and glow. The tool is still something internal that we have hacked together but we are working on getting it opensourced and making it into something you will be able to use. Both for creating new look and feels and for drawing painters that you may want to use anywhere in your application. I am looking forward to being able to release it.

Well I hope you are as excited as I am about Nimbus and can’t wait to try it out in your own apps. You should not have to wait to long for the first public alpha build. :-)

Nimbus OptionPanes Solaris
Nimbus Option Pane Dialogs on Solaris

Nimbus L&F Update

Wednesday, June 6th, 2007

So it has been a while since I blogged about Nimbus, Java One has come and gone and I am sure you are all wondering whats happening to it. Well things have changed for Nimbus since it was announced at Desktop Matters conference in March. The initial plan was for Nimbus to be a open source project jointly run by Ben Galbraith and myself. In early prototype I hacked together thats available from nimbus.dev.java.net was very well accepted both inside Sun and in the swing community. As a result a decision was made to bring the Nimbus L&F into the JDK as part of the new Consumer JRE. What this means for is it will be available as part of the JDK 6 sometime early 2008. If you would like to read more about the Consumer JRE then read here.

Nimbus Coming Soon

I think this is amazing news for Nimbus L&F as it will hugely strengthen its adoptance. I am now working full time on getting Nimbus done with the tight deadlines to get it to you for early next year. The final version should be complete around August at which point I will try and get it released back to the open source project. Hopefully then we can get a good chunk of testing done on many different applications so we have a great version for the JDK. Ben has said that he will help with the effort to take it at that point and do a backport to run on JDK 5.

Here is my personal list of objectives for Nimbus L&F:

  • Create as high fidelity implementation of the SPEC as possible within the technical constraints.
  • Aim for 100% Java2D painted vector graphics, so no images other than icons. This is a ambitious aim as it is a lot more work than a image based L&F but will give us huge flexibility in the long run with things like high DPI monitors and resolution independence.
  • Be based on Synth so that there is finally a fully realized L&F from Sun for Synth that can be used to help other people create new Synth L&Fs.
  • Be as true feel wise to the native platform as possible within the tight deadlines. By this I mean using the native key combinations like Command C on Mac and Ctrl C on Windows for copy. Also to try and have the File Chooser for have a layout and functionalty as the native L&F one but with Nimbus skin.
  • Provide API or hooks so the Nimbus painting code can be used to aid skinning custom swing components.

These are what I would like to achieve with the Nimbus L&F, how much I can manage within the tight deadlines we will have to see. If features don’t get in then hopefully we can add them to the open source project and later back into the JDK. Animation is on the would really like to get it in pile but there as a lot to do before I get there.

I am very interested to hear any feedback you have on Nimbus, like feature X is crucial to my company using Nimbus or feature Y is not important to me. I will do my best to accommodate any good suggestions into Nimbus.