com.jgoodies.forms.layout
public final class ConstantSize extends Object implements Size, Serializable
ConstantSize
using
the factory methods and constants in the Sizes class.
Logical constant sizes that vary with the current layout style
are delivered by the LayoutStyle class.This class supports different size units:
Unit | Abbreviation | Size |
Millimeter | mm | 0.1 cm |
Centimeter | cm | 10.0 mm |
Inch | in | 25.4 mm |
DTP Point | pt | 1/72 in |
Pixel | px | 1/(resolution in dpi) in |
Dialog Unit | dlu | honors l&f, resolution, and dialog font size |
Examples:
Sizes.ZERO; Sizes.DLUX9; Sizes.dluX(42); Sizes.pixel(99);
Version: $Revision: 1.7 $
Nested Class Summary | |
---|---|
static class | ConstantSize.Unit
An ordinal-based serializable typesafe enumeration for units
as used in instances of ConstantSize. |
Field Summary | |
---|---|
static ConstantSize.Unit | CENTIMETER |
static ConstantSize.Unit | CM |
static ConstantSize.Unit | DIALOG_UNITS_X |
static ConstantSize.Unit | DIALOG_UNITS_Y |
static ConstantSize.Unit | DLUX |
static ConstantSize.Unit | DLUY |
static ConstantSize.Unit | IN |
static ConstantSize.Unit | INCH |
static ConstantSize.Unit | MILLIMETER |
static ConstantSize.Unit | MM |
static ConstantSize.Unit | PIXEL |
static ConstantSize.Unit | POINT |
Constructor Summary | |
---|---|
ConstantSize(int value, ConstantSize.Unit unit)
Constructs a ConstantSize for the given size and unit.
| |
ConstantSize(double value, ConstantSize.Unit unit)
Constructs a ConstantSize for the given size and unit.
|
Method Summary | |
---|---|
boolean | compressible()
Describes if this Size can be compressed, if container space gets scarce.
|
boolean | equals(Object o)
Indicates whether some other ConstantSize is "equal to" this one.
|
int | getPixelSize(Component component)
Converts the size if necessary and returns the value in pixels.
|
ConstantSize.Unit | getUnit()
Returns this size's unit.
|
double | getValue()
Returns this size's value.
|
int | hashCode()
Returns a hash code value for the object. |
int | maximumSize(Container container, List components, FormLayout.Measure minMeasure, FormLayout.Measure prefMeasure, FormLayout.Measure defaultMeasure)
Returns this size as pixel size. |
String | toString()
Returns a string representation of this size object.
|
Parameters: value the size value interpreted in the given units unit the size's unit
Since: 1.1
Parameters: value the size value interpreted in the given units unit the size's unit
Since: 1.1
#compressedSizes
to check whether a column or row can be compressed or not.ConstantSizes are incompressible.
Returns: false
Since: 1.1
Parameters: o the Object with which to compare
Returns: true
if this object is the same as the obj
argument; false
otherwise.
See Also: java.lang.Object#hashCode() java.util.Hashtable
Parameters: component the associated component
Returns: the size in pixels
Returns: the size unit
Since: 1.1
Returns: the size value
Since: 1.1
java.util.Hashtable
.
Returns: a hash code value for this object.
See Also: java.lang.Object#equals(java.lang.Object) java.util.Hashtable
Invoked by FormSpec to determine the size of a column or row.
Parameters: container the layout container components the list of components used to compute the size minMeasure the measure that determines the minimum sizes prefMeasure the measure that determines the preferred sizes defaultMeasure the measure that determines the default sizes
Returns: the computed maximum size in pixel
Returns: a string representation of the constant size