com.jgoodies.forms.layout
public final class Sizes extends Object
Version: $Revision: 1.14 $
See Also: Size UnitConverter DefaultUnitConverter
Field Summary | |
---|---|
static Sizes.ComponentSize | DEFAULT
Use the maximum of all component sizes as column or row size;
measures preferred sizes when asked for the preferred size
and minimum sizes when asked for the minimum size. |
static ConstantSize | DLUX1 |
static ConstantSize | DLUX11 |
static ConstantSize | DLUX14 |
static ConstantSize | DLUX2 |
static ConstantSize | DLUX21
21 horizontal dialog units. |
static ConstantSize | DLUX3 |
static ConstantSize | DLUX4 |
static ConstantSize | DLUX5 |
static ConstantSize | DLUX6 |
static ConstantSize | DLUX7 |
static ConstantSize | DLUX8 |
static ConstantSize | DLUX9 |
static ConstantSize | DLUY1 |
static ConstantSize | DLUY11 |
static ConstantSize | DLUY14 |
static ConstantSize | DLUY2 |
static ConstantSize | DLUY21
21 vertical dialog units. |
static ConstantSize | DLUY3 |
static ConstantSize | DLUY4 |
static ConstantSize | DLUY5 |
static ConstantSize | DLUY6 |
static ConstantSize | DLUY7 |
static ConstantSize | DLUY8 |
static ConstantSize | DLUY9 |
static Sizes.ComponentSize | MINIMUM
Use the maximum of all component minimum sizes as column or row size. |
static Sizes.ComponentSize | PREFERRED
Use the maximum of all component preferred sizes as column or row size. |
static ConstantSize | ZERO |
Method Summary | |
---|---|
static Size | bounded(Size basis, Size lowerBound, Size upperBound)
Creates and returns a BoundedSize for the given basis
using the specified lower and upper bounds.
|
static int | centimeterAsPixel(double cm, Component component)
Converts Centimeters and returns pixels using the resolution of the
given component's graphics object.
|
static ConstantSize | constant(String encodedValueAndUnit, boolean horizontal)
Creates and returns an instance of ConstantSize from the
given encoded size and unit description.
|
static int | dialogUnitXAsPixel(int dluX, Component component)
Converts horizontal dialog units and returns pixels.
|
static int | dialogUnitYAsPixel(int dluY, Component component)
Converts vertical dialog units and returns pixels.
|
static ConstantSize | dluX(int value)
Creates and returns a ConstantSize for the specified value
in horizontal dialog units.
|
static ConstantSize | dluY(int value)
Creates and returns a ConstantSize for the specified value
in vertical dialog units.
|
static ConstantSize.Unit | getDefaultUnit()
Returns the Unit that is used if an encoded ConstantSize contains
no unit string.
|
static UnitConverter | getUnitConverter()
Returns the current UnitConverter. |
static int | inchAsPixel(double in, Component component)
Converts Inches and returns pixels using the specified resolution.
|
static int | millimeterAsPixel(double mm, Component component)
Converts Millimeters and returns pixels using the resolution of the
given component's graphics object.
|
static ConstantSize | pixel(int value)
Creates and returns a ConstantSize
for the specified pixel value.
|
static int | pointAsPixel(int pt, Component component)
Converts DTP Points and returns pixels using the resolution of the
given component's graphics object.
|
static void | setDefaultUnit(ConstantSize.Unit unit)
Sets the Unit that shall be used if an encoded ConstantSize
provides no unit string.
|
static void | setUnitConverter(UnitConverter newUnitConverter)
Sets a new UnitConverter that will be used to convert
font-dependent sizes to pixel sizes.
|
Since: 1.2
Since: 1.2
Parameters: basis the base size lowerBound the lower bound size upperBound the upper bound size
Returns: a BoundedSize
for the given basis and bounds
Throws: NullPointerException if {@code basis} is {@code null}, or if both {@code lowerBound} and {@code upperBound} are {@code null}.
Parameters: cm Centimeters component the component that provides the graphics object
Returns: the given Centimeters as pixels
ConstantSize
from the
given encoded size and unit description.
Parameters: encodedValueAndUnit value and unit in string representation horizontal true for horizontal, false for vertical
Returns: a ConstantSize
for the given value and unit
Parameters: dluX the horizontal dialog units component the component that provides the graphics object
Returns: the given horizontal dialog units as pixels
Parameters: dluY the vertical dialog units component the component that provides the graphics object
Returns: the given vertical dialog units as pixels
Parameters: value size value in horizontal dialog units
Returns: the associated ConstantSize
Parameters: value size value in vertical dialog units
Returns: the associated ConstantSize
Returns: the Unit if no unit string is provided
Since: 1.2
Returns: the current UnitConverter
Parameters: in the Inches component the component that provides the graphics object
Returns: the given Inches as pixels
Parameters: mm Millimeters component the component that provides the graphics object
Returns: the given Millimeters as pixels
Parameters: value value in pixel
Returns: the associated ConstantSize
Parameters: pt DTP Points component the component that provides the graphics object
Returns: the given Points as pixels
Parameters: unit the new default Unit, {@code null} for dialog units
Throws: IllegalArgumentException if {@code unit} is DLUX or DLUY.
Since: 1.2
Parameters: newUnitConverter the unit converter to be set