Class DefaultUnitConverter

java.lang.Object
com.jgoodies.forms.util.AbstractUnitConverter
com.jgoodies.forms.util.DefaultUnitConverter
All Implemented Interfaces:
UnitConverter

public final class DefaultUnitConverter extends AbstractUnitConverter
This is the default implementation of the UnitConverter interface. It converts horizontal and vertical dialog base units to pixels.

The horizontal base unit is equal to the average width, in pixels, of the characters in the system font; the vertical base unit is equal to the height, in pixels, of the font. Each horizontal base unit is equal to 4 horizontal dialog units; each vertical base unit is equal to 8 vertical dialog units.

The DefaultUnitConverter computes dialog base units using a default font and a test string for the average character width. You can configure the font and the test string via the bound Bean properties defaultDialogFont and averageCharacterWidthTestString. See also Microsoft's suggestion for a custom computation custom computation. More information how to use dialog units in screen design can be found in Microsoft's Design Specifications and Guidelines.

Since the Forms 1.1 this converter logs font information at the CONFIG level.

Version:
$Revision: 1.17 $
Author:
Karsten Lentzsch
See Also: