|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectyu.ac.bg.etf.javaqx.qswing.layouts.formlayout.Sizes
Consists only of static methods that create and convert sizes as required by
the FormLayout. The conversion of sizes that are not based on pixel is
delegated to an implementation of UnitConverter
.
The conversion methods require the layout container as parameter to read its
current font and resolution.
NOTE: This code is part of the JGoodies Forms port.
Field Summary | |
static yu.ac.bg.etf.javaqx.qswing.layouts.formlayout.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 |
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 |
DLUY3
|
static ConstantSize |
DLUY4
|
static ConstantSize |
DLUY5
|
static ConstantSize |
DLUY6
|
static ConstantSize |
DLUY7
|
static ConstantSize |
DLUY8
|
static ConstantSize |
DLUY9
|
static yu.ac.bg.etf.javaqx.qswing.layouts.formlayout.Sizes.ComponentSize |
MINIMUM
Use the maximum of all component minimum sizes as column or row size. |
static yu.ac.bg.etf.javaqx.qswing.layouts.formlayout.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,
JQComponent component)
Converts Centimeters and returns pixels using the resolution of the given component's graphics object. |
static ConstantSize |
constant(java.lang.String encodedValueAndUnit,
boolean horizontal)
Creates and returns an instance of ConstantSize from the
given encoded size and unit description. |
static int |
dialogUnitXAsPixel(int dluX,
JQComponent component)
Converts horizontal dialog units and returns pixels. |
static int |
dialogUnitYAsPixel(int dluY,
JQComponent 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 UnitConverter |
getUnitConverter()
Returns the current UnitConverter . |
static int |
inchAsPixel(double in,
JQComponent component)
Converts Inches and returns pixels using the specified resolution. |
static int |
millimeterAsPixel(double mm,
JQComponent 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,
JQComponent component)
Converts DTP Points and returns pixels using the resolution of the given component's graphics object. |
static void |
setUnitConverter(UnitConverter newUnitConverter)
Sets a new UnitConverter that will be used to convert font-dependent sizes to pixel sizes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final ConstantSize ZERO
public static final ConstantSize DLUX1
public static final ConstantSize DLUX2
public static final ConstantSize DLUX3
public static final ConstantSize DLUX4
public static final ConstantSize DLUX5
public static final ConstantSize DLUX6
public static final ConstantSize DLUX7
public static final ConstantSize DLUX8
public static final ConstantSize DLUX9
public static final ConstantSize DLUX11
public static final ConstantSize DLUX14
public static final ConstantSize DLUY1
public static final ConstantSize DLUY2
public static final ConstantSize DLUY3
public static final ConstantSize DLUY4
public static final ConstantSize DLUY5
public static final ConstantSize DLUY6
public static final ConstantSize DLUY7
public static final ConstantSize DLUY8
public static final ConstantSize DLUY9
public static final ConstantSize DLUY11
public static final ConstantSize DLUY14
public static final yu.ac.bg.etf.javaqx.qswing.layouts.formlayout.Sizes.ComponentSize MINIMUM
public static final yu.ac.bg.etf.javaqx.qswing.layouts.formlayout.Sizes.ComponentSize PREFERRED
public static final yu.ac.bg.etf.javaqx.qswing.layouts.formlayout.Sizes.ComponentSize DEFAULT
Method Detail |
public static ConstantSize constant(java.lang.String encodedValueAndUnit, boolean horizontal)
ConstantSize
from the
given encoded size and unit description.
encodedValueAndUnit
- value and unit in string representationhorizontal
- true for horizontal, false for vertical
ConstantSize
for the given value and unitpublic static ConstantSize dluX(int value)
value
- size value in horizontal dialog units
ConstantSize
public static ConstantSize dluY(int value)
value
- size value in vertical dialog units
ConstantSize
public static ConstantSize pixel(int value)
value
- value in pixel
ConstantSize
public static Size bounded(Size basis, Size lowerBound, Size upperBound)
basis
- the base sizelowerBound
- the lower bound sizeupperBound
- the upper bound size
BoundedSize
for the given basis and bounds
java.lang.NullPointerException
- if basis is nullpublic static int inchAsPixel(double in, JQComponent component)
in
- the Inchescomponent
- the component that provides the graphics object
public static int millimeterAsPixel(double mm, JQComponent component)
mm
- Millimeterscomponent
- the component that provides the graphics object
public static int centimeterAsPixel(double cm, JQComponent component)
cm
- Centimeterscomponent
- the component that provides the graphics object
public static int pointAsPixel(int pt, JQComponent component)
pt
- DTP Pointscomponent
- the component that provides the graphics object
public static int dialogUnitXAsPixel(int dluX, JQComponent component)
dluX
- the horizontal dialog unitscomponent
- the component that provides the graphics object
public static int dialogUnitYAsPixel(int dluY, JQComponent component)
dluY
- the vertical dialog unitscomponent
- the component that provides the graphics object
public static UnitConverter getUnitConverter()
UnitConverter
. If it has not been initialized
before it will get an instance of DefaultUnitConverter
.
UnitConverter
public static void setUnitConverter(UnitConverter newUnitConverter)
newUnitConverter
- the unit converter to be set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |