Skip to end of metadata
Go to start of metadata

Description

Provides a pluggable mechanism to set the Look & Feel of a Griffon application, even once the application is running.

Installation

The current version of griffon-lookandfeel-plugin is 0.5
To install just issue the following command

Usage

This plugin operates under the notion that Look & Feel settings can be manipulated by griffon.lookandfeel.LookAndFeelManager using a pair of helper classes: LookAndFeelProvider (lookAndFeel) and LookAndFeelInfo (theme). LookAndFeelProviders are responsible for grouping together a set of LookAndFeelInfos. For example the 'System' lookAndFeel contains the basic themes available in all platforms. The mechanism for discovering lookAndFeels and themes is pluggable. There are several plugins that provide additional Look & Feel settings in this way.

LookAndFeelManager is a singleton. It provides several useful methods to query and set a Look & Feel. The most interesting one is showLafDialog(GriffonApplication). It's responsibility is to display dialog on which the user can pick and choose a provider/info combination.

Configuration

LookAndFeelManager will attempt to set a lookAndFeel/theme combination at boot time if the following flags are set in Config.groovy:

  • lookandfeel.lookAndFeel - defaults to 'System'.
  • lookandfeel.theme - defaults to 'System' on MacOSX, 'Nimbus' otherwise.

Additional L&F properties can be set at app startup if lookandfeel.props is set.
It is also possible to define a hot key for launching the L&F selection window, just specify a String value for lookandfeel.keystroke that can be parsed by Swing's KeyStroke class, for example

The following events are triggered by LookAndFeelManager

  • LookAndFeelPreview[currentLookAndFeelProvider, currentLookAndFeelInfo, previewLookAndFeelInfo] - when the 'Preview' button of the L&F window is clicked
  • LookAndFeelApply[currentLookAndFeelProvider, currentLookAndFeelInfo, newLookAndFeelInfo] - when the 'OK' button of the L&F window is clicked
  • LookAndFeelChanged[newLookAndFeelProvider, newLookAndFeelInfo, newLookAndFeel] - when the L&F has been changed successfully

LookAndFeel and Themes

LookAndFeel

Theme

System

CrossPlatform

 

Metal

 

Motif

 

Nimbus

 

System

History

Version

Date

Notes

0.5

06-27-10

Release sync with Griffon 0.9.3-beta-2

0.4

02-22-11

Release sync with Griffon 0.9.2

0.3

 10-27-10

Fixes GRIFFON-259

0.2

08-18-10

Added keystroke property to launch L&F window

0.1

07-22-10

First release

  • No labels