The latest addition in the Flamingo component suite is support for key tips. This has been one of the items on the roadmap for version 4.0 (code named Fainnear), and is now available in the latest 4.0dev drop of Flamingo core and 5.1dev drop of Substance Flamingo plugin.

Key tips is one of the four supported ways to operate the Office 2007 ribbon with keyboard. Unlike the traditional menus-and-toolbars system, every command and control in ribbon can have associated key tip. This allows efficient access and activation of application menu items, task toggle buttons, task bar buttons, task expand buttons and other ribbon sub-components. As specified in the keyboard documentation, the key tip mode is initiated with either Alt or F10 key. Subsequent interaction will be illustrated in the screenshots below taken under the latest 4.0dev drop of Flamingo core and Synthetica Mauve Metallic skin.

Key tips are shown in groups (internally called chains). A key tip group is associated with the specific ribbon entity. When the key tip mode is initiated, the key tip group for the entire ribbon is displayed. It contains key tips for the application menu button, taskbar components and task toggle buttons:

Pressing the letter for taksbar button activates that button. Key tips for disabled buttons are painted with partial translucency. Pressing the letter for task toggle button selects the matching ribbon task. Pressing the letter for the application menu button shows the application menu:

Once the next key tip group is shown, the previously shown key tip group is hidden (no key tips on the application menu button and taskbar buttons in this screenshot). Pressing Esc dismisses the currently shown key tip group and shows the previous key tip group. When the initial key tip group is dismissed, the key tip mode is exited.

This screenshot also shows that the menu buttons can have two key tips associated with them – one for the action, and one for the popup. Pressing ‘D‘ (associated with the popup “Send” button) shows the second level menu, switching off the key tips for the first level and showing them for the second level:

Pressing keys ‘E‘, ‘H‘ or ‘W‘ will activate the relevant second level menu buttons. Pressing key ‘X‘ activates the popup menu associated with the “Wireless” menu button:

Going back to the first screenshot (that shows the top level key tip group). Pressing key ‘P‘ shows the key tip group for the first (and currently selected) ribbon task:

The key tips are shown for ribbon buttons, task expand buttons (look for ‘FO‘ and ‘FN‘), ribbon gallery expand buttons (look for ‘L‘) and buttons in button strips (in the “Font” ribbon band). As you can see, some key tips have two letters. This can be useful not only when there are not enough letters for the contents of the current task. It can also help in grouping key tips of related functionality (such as alignment and indentation command buttons in the “Font” ribbon band that start with A). In the present situation, when letter ‘F‘ is pressed, only key tips that start with that letter are shown:

As before, pressing Esc will show the previous key tip group – in this case, it would be key tips for the entire “Page Layout” ribbon task.

Key tips are also shown in popup menus. Pressing ‘V‘ when the key tips for the entire first ribbon task are shown activates the popup menu of the “Paste” button:

Pressing one of the relevant keys will activate the matching menu button, dismissing the key tip mode as well. Key tips are also shown for the menu buttons in rich popup panels:

Here, in order to activate the “Save Selection”, you would have to press the following sequence of keys:

  • Alt or F10 to activate the key tip mode
  • P to select the first ribbon task
  • F, P to show the popup of the “Format” button in the “Clipboard” ribbon task
  • S, S to activate the “Save Selection” menu button

As you can see, the sequence to activate a specific command can be quite long. As such, commands that are used often need to be identified and associated with shorter (and perhaps more memorable) sequences.

The APIs to associate key tips with different ribbon components are:

  • AbstractCommandButton.setActionKeyTip
  • JCommandButton.setPopupKeyTip
  • JRibbonBand.setExpandKeyTip
  • JRibbonBand.setRibbonGalleryExpandKeyTip
  • RibbonApplicationMenuEntry.setActionKeyTip
  • RibbonApplicationMenuEntry.setPopupKeyTip
  • JRibbon.setApplicationMenuKeyTip
  • RibbonTask.setKeyTip

If you want to see the scrolling in action under the core look-and-feels, run the following WebStart demo:

If you want to see this functionality under Substance, run the following WebStart demo:

If you want to test the new functionality in your applications, you would need the following (the last two only for applications running under Substance look-and-feel):

Your feedback is, as always, greatly appreciated.

A03 is a third-party Swing look-and-feel developed by Davide Raccagni and available under BSD license. Today Davide has announced release 4.0 of A03, with the main emphasis on performance. One of the tools he used during the development cycle is the LightBeam testbed that aims to assist in performance analysis of look-and-feels, as well as rendering pipelines.

Here are the results for the different core and third-party look-and-feels, as measured on my machine (without hardware acceleration that makes some of the scenarios run by up to 40% faster) – lower numbers mean faster performance:

  • 3039 Metal
  • 3721 Windows
  • 4004 Looks PlasticXP
  • 4332 Nimbus
  • 4665 Substance 5.1
  • 4902 A03
  • 4908 Synthetica Base

In addition to performance improvements, Davide has also worked with me over the last few weeks to provide support for Flamingo components. Not only does the A03 Flamingo plugin provide fine-tuned visuals to some of Flamingo’s components, it also allows A03-powered JRibbonFrames to host the application menu button, taskbar panel and contextual task groups on the title pane under decorated mode. In doing so, A03 has joined Substance in providing streamlined visuals for the interested applications.

Below you can find a few screenshots of JRibbon and JRibbonFrame under A03 – click to see the full-sized versions.

The first screenshot shows the default content of the test ribbon shipped with Flamingo:

The next screenshot shows the activated application menu button:

The next screenshot shows the rich popup panel associated with a command button:

The next screenshot shows the extended tooltip associated with a command button in the taskbar panel:

The last screenshot shows the contextual task group headers:

Davide – congratulations on the release, and thanks for providing feedback on the extensibility points of the core Flamingo UI delegates.

There’s nothing like the right link at the right time. Remy Rakic (Twitter alias lqd) has left a link to the apparent release jars of JavaFX Desktop 1.0 in the comments on the previous entry. So i’ve decided to see whether there is anything new in the JMC department since the last time i’ve looked at it.

In the JavaFX preview, the native code was shipped directly in the jmc.dll. The download folder has the native libraries available in three platform-specific jar files (one for Windows, Mac OS X and Linux each). For Windows, the jar contains four DLLs:

  • jmc.dll as before
  • on2_decoder.dll which would be presumably responsible for the new licensed decoders
  • msvcp71.dll and msvcr71.dll which are parts of Visual C++ 7.1

Assuming that this download folder is going to be used as a centralized WebStart repository, i would venture to say that there is going to be some kind of built-in mechanism for extracting these DLLs at runtime and updating the java library path. However, in my experiments i had to extract them manually and point the -Djava.library.path to the folder that contains those DLLs. We’ll wait and see whether the final (and official) release will follow in the footsteps of SWT 3.3 that handles the locally run extraction automatically.

Apart from the new JMediaView class that is a lightweight Swing component I haven’t seen any new classes. However, this JMC drop can play all QuickTime content from the sample page, including H.264, MPEG-4, 3GPP and MPEG-2, as well as the full scale trailers from the Apple site (in H.264 format). The playback support goes a long way towards my number one wish for desktop Java in 2008, and it will be hopefully followed by the recording capabilities as well.

I’ve decided to dive a little bit deeper into the JMC internals and updated the JMCFrame class to show a skeleton implementation of a “home-grown” player. Instead of using ready-made classes such as JMediaPlayer, JMediaPane or JMediaView, i’m creating a MediaProvider from the specific URI and attaching a VideoRendererListener to its VideoRenderControl (i would guess that the JMedia* classes follow the same route, but without the source code it’s hard to tell). This certainly makes the code a little bit more complicated, but allows much greater flexibility as far as compositing and overlaying go. Here is a screenshot of the player in action:

What do you see in the screenshot? There is a JPanel with a JButton control in it. The JPanel overrides the paintComponent and paints the following three layers:

  • Gradient checkered background.
  • The contents of the current video frame with 80% opacity.
  • Information on the current media location, total duration and rate.

Using a MediaProvider with a VideoRendererListener allows some interesting things – overlaying translucent controls and HUDs, cross fading between multiple video streams and rendering video streams on arbitrary Swing components.

The new implementation supports dropping two kinds of video content:

  • Local file
  • URL

If you run the sample code locally, drag a local video file on the panel and press the play button. The content should start playing. You can also drag a URL from your favourite browser. If that URL points to a video stream, the stream will be played – tested on streaming H.264 movie trailers from the Apple site :)

If i had to choose a particularly nifty API, that would be the MediaControl in the com.sun.media.jmc.control package. To get the specific control, call MediaProvider.getControl passing the class instance of the required control (such as VideoRenderControl). The MediaProvider.getControls API will enumerate the supported controls. Here is what i see on my machine when playing video files: play, audio, video, subtitle, video render and track. Hopefully we are going to see the record control joining this group soon.

Here are some Swing links that you might have missed during the last week:

In three days, JavaFX Desktop 1.0 will be officially released. I have been skeptical about JavaFX over the last few months, and while this may be attributed to general inclination of programmers towards being “entrenched” in the technologies that they know, there are other reasons as well. Aside from a few unnamed technology partners that were participating in shaping the capabilities of this release, the community has been effectively shut from lending its hand in commenting, testing and evolving the platform. We have long heard about “being blown away” by the new functionality being brought by JavaFX to the RIA market, and this week we will finally see if it is going to live up to the marketing hype.

Personally, i will be very glad to see at least one out of the following ten items being available for JavaFX, as well as cross-platform Swing applications come December 4:

  1. 6u10 / 6u11 for Apple – [update] see bug 6761033 for some interesting news.
  2. Full java lightweight rendering of SWF files even without installed Flash engine
  3. Full java lightweight rendering of H.264 files even without installed codecs
  4. Adaptive video streaming based on the client CPU and network utilization
  5. Video capture and creation
  6. Fully skinnable lightweight browser component based on WebKit or Mozilla / Gecko
  7. Inclusion of form-oriented layout manager
  8. Support for high level shader language (HLSL) for hardware accelerated custom effects
  9. Nimbus designer
  10. JavaFX.com with JavaFX-only applet driven content

And is it me, or are we going to see Sun ditching its own module initiative and move towards restructuring JDK as a collection of OSGI bundles?