First signs of Nimbus designer in JDK 7

April 8th, 2009 | 5 Comments »

A few hours ago an interesting changelist has made its way into the JDK 7 Swing branch. It definitely looks like the Nimbus designer will be available as part of JDK 7.

Unfortunately, it does look like this changelist does not contain all the files that are part of Nimbus designer (see below for the walkthrough), but hopefully this will be amended in the following days. In the meanwhile, here is what i’ve been able to do:

  • Click on the zip link on the changelist page and extract the contents of the zip file. I’ve saved it in the C:\JTools\jdk7-src folder.
  • Create a new Eclipse project. Point to C:\JTools\jdk7-src\jdk-c5cd40f1f596\make\tools\swing-nimbus\classes as source, and add all the jars in C:\JTools\jdk7-src\jdk-c5cd40f1f596\make\tools\swing-nimbus\libs as external jars.

As i said before, it looks like the changelist is not complete, and i haven’t been able to find the main class to run the designer itself. However, you can run the partial generation of Nimbus painters to get the feel of how that phase is working. Here are the steps:

Run the org.jibx.binding.Compile class passing the following two program arguments:

  • C:\JTools\jdk7-src\jdk-c5cd40f1f596\make\tools\swing-nimbus\classes\org\jdesktop\swingx\designer\Designer.jibx.xml
  • C:\JTools\jdk7-src\jdk-c5cd40f1f596\make\tools\swing-nimbus\classes\org\jdesktop\synthdesigner\synthmodel\SynthModel.jibx.xml

Copy the three .template files from C:\JTools\jdk7-src\jdk-c5cd40f1f596\src\share\classes\javax\swing\plaf\nimbus to C:\JTools\jdk7-src\jdk-c5cd40f1f596\make\tools\swing-nimbus\classes\org\jdesktop\synthdesigner\generator\resources

Run the org.jdesktop.synthdesigner.generator.Generator class passing the following arguments:

  • -full false
  • -skinFile C:\JTools\jdk7-src\jdk-c5cd40f1f596\src\share\classes\javax\swing\plaf\nimbus\skin.laf
  • -srcDir c:\temp\nimbus
  • -buildDir c:\temp\nimbus
  • -packagePrefix org.nimbus
  • -lafName Nimbus

At this point, the c:\temp\nimbus should have the generated painter classes. Note that if you pass the -full true, the generation will fail since some of the template files (such as LookAndFeel.template) are not part of this changelist.


    Related posts:

    1. First look at Nimbus and “Java SE 6 Update N” A mildly unexpected announcement on Jasper’s blog (a little earlier than hinted previously) that leads...
    2. Nimbus is getting a new home I’ve already mentioned that the upcoming Nimbus look-and-feel is not being hosted in a usual...


    5 Comments on “First signs of Nimbus designer in JDK 7”

    1. 1 Pedro Duque Vieira said at 6:22 am on April 9th, 2009:

      nice :)

    2. 2 Java desktop links of the week, April 13 | Jonathan Giles said at 2:40 pm on April 12th, 2009:

      [...] Grochnikov (@kirillcool ) notes that recently the Nimbus designer was moved into the OpenJDK trunk . However, following this there was discussion around the inclusion of some binary jar files that [...]

    3. 3 Jasper Potts said at 1:42 am on April 14th, 2009:

      Kirill you are right that part of the Nimbus designer has gone into JDK 7 its the same part that is the the source for Java6. What it does is load the xml file from the designer and generate all the source code for Nimbus. It is quite useable if you want to create or edit the xml file and generate a new Nimbus style look and feel though you could do a better job by adapting it to generate code that works with the existing Nimbus code in the JDK rather than a complete new independent LAF that runs on Synth. I really want to at lest get part of the designer tool out to the public the part that lets you draw the graphics xml that generates a painter. The part that handles the complete model for a LAF is too broken for now and I don’t have time to fix it up. After about 80% though the Nimbus project we did not have time to keep the tool in sync with the xml that is in the JDK 6 & 7 so we did most of the edits by hand on the xml file.

    4. 4 Kirill Grouchnikov said at 8:02 am on April 14th, 2009:

      Jasper,

      I’ve only been able to generate the painter classes for Nimbus. Looks like some .template files are missing – especially the one needed for creating the NimbusLookAndFeel class.

      Thanks
      Kirill

    5. 5 Dalibor Topić: Commit of the day: Nimbus - Technology said at 8:48 am on April 16th, 2009:

      [...] Technology 16 Apr 2009 As tweeted by Kirill Grouchnikov, Nimbus has been pushed into the swing forest. Nimbus is cool, and porting such features from the [...]