com.jgoodies.looks
Class FontPolicies

java.lang.Object
  extended by com.jgoodies.looks.FontPolicies

public final class FontPolicies
extends Object

Provides predefined FontPolicy implementations.

Note: The available policies work well on Windows On other platforms the fonts specified by the runtime environmen are chosen. I plan to provide more logic or options for other platforms for example that a Linux system checks for a Tahoma or Segoe UI.

Since:
2.0
Version:
$Revision: 1.14 $
Author:
Karsten Lentzsch
See Also:
FontPolicy, FontSet, FontSets, Fonts

Method Summary
static FontPolicy createFixedPolicy(FontSet fontSet)
          Returns a font policy that in turn always returns the specified FontSet.
static FontPolicy customSettingsPolicy(FontPolicy defaultPolicy)
          Returns a font policy that checks for a custom FontPolic and a custom FontSet specified in the System settings or UIManager.
static FontPolicy getDefaultPlasticOnWindowsPolicy()
          Returns the default font policy for Plastic on the Windows platform.
static FontPolicy getDefaultPlasticPolicy()
          Returns the default Plastic FontPolicy that may var with the platform and environment.
static FontPolicy getDefaultWindowsPolicy()
          Returns the default font policy for the Windows platform.
static FontPolicy getLogicalFontsPolicy()
          Returns a font policy that returns the logical font as specified by the Java runtime environment.
static FontPolicy getLooks1xPlasticPolicy()
          Returns a font policy for getting a Plastic appearance that aims to b visual backward compatible with the JGoodies Looks version 1.x.
static FontPolicy getLooks1xWindowsPolicy()
          Returns a font policy for getting a Windows appearance that aims to b visual backward compatible with the JGoodies Looks version 1.x.
static FontPolicy getTransitionalPlasticPolicy()
          Returns a font policy intended for API users that want t move Plastic code from the Looks 1.x to the Looks 2.0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createFixedPolicy

public static FontPolicy createFixedPolicy(FontSet fontSet)
Returns a font policy that in turn always returns the specified FontSet The FontSet will be fixed, but the FontSet itself ma return different fonts in different environments.

Parameters:
fontSet - the FontSet to be return by this policy
Returns:
a font policy that returns the specified FontSet.

customSettingsPolicy

public static FontPolicy customSettingsPolicy(FontPolicy defaultPolicy)
Returns a font policy that checks for a custom FontPolic and a custom FontSet specified in the System settings or UIManager If no custom settings are available, the given default policy wil be used to look up the FontSet.

Parameters:
defaultPolicy - the policy used if there are no custom settings
Returns:
a FontPolicy that checks for custom setting before the default policy is returned.

getDefaultPlasticOnWindowsPolicy

public static FontPolicy getDefaultPlasticOnWindowsPolicy()
Returns the default font policy for Plastic on the Windows platform It differs from the default Windows policy in that it uses a bold fon for TitledBorders, titles, and titled separators.

Returns:
the default font policy for Plastic on the Windows platform.

getDefaultPlasticPolicy

public static FontPolicy getDefaultPlasticPolicy()
Returns the default Plastic FontPolicy that may var with the platform and environment On Windows, the PlasticOnWindowsPolicy is returned tha is much like the defualt WindowsPolicy but uses a bold title font On other Platforms, the logical fonts policy is returne that uses the logical fonts as specified by the Java runtime environment.

Returns:
a Windows-like policy on Windows, a logical fonts polic on all other platforms

getDefaultWindowsPolicy

public static FontPolicy getDefaultWindowsPolicy()
Returns the default font policy for the Windows platform It aims to return a FontSet that is close to the native guideline and useful for the current Java environment.

Returns:
the default font policy for the Windows platform.

getLogicalFontsPolicy

public static FontPolicy getLogicalFontsPolicy()
Returns a font policy that returns the logical font as specified by the Java runtime environment.

Returns:
a font policy that returns logical fonts.

getLooks1xPlasticPolicy

public static FontPolicy getLooks1xPlasticPolicy()
Returns a font policy for getting a Plastic appearance that aims to b visual backward compatible with the JGoodies Looks version 1.x It uses a font choice similar to the choice implemente by the Plastic L&fs in the JGoodies Looks version 1.x.

Returns:
a font policy that aims to reproduce the Plastic font choic in the JGoodies Looks 1.x.

getLooks1xWindowsPolicy

public static FontPolicy getLooks1xWindowsPolicy()
Returns a font policy for getting a Windows appearance that aims to b visual backward compatible with the JGoodies Looks version 1.x It uses a font choice similar to the choice implemente by the Windows L&f in the JGoodies Looks version 1.x.

Returns:
a font policy that aims to reproduce the Windows font choic in the JGoodies Looks 1.x.

getTransitionalPlasticPolicy

public static FontPolicy getTransitionalPlasticPolicy()
Returns a font policy intended for API users that want t move Plastic code from the Looks 1.x to the Looks 2.0 On Windows, it uses the Looks 2.0 Plastic fonts on other platforms it uses the Looks 1.x Plastic fonts.

Returns:
the recent Plastic font policy on Windows the JGoodies Looks 1.x on other Platforms.


Copyright © 2001-2013 JGoodies Software GmbH. All Rights Reserved.