com.jgoodies.forms.util
public abstract class AbstractUnitConverter extends Object implements UnitConverter
Version: $Revision: 1.2 $
See Also: DefaultUnitConverter Size Sizes
Method Summary | |
---|---|
int | centimeterAsPixel(double cm, Component component)
Converts Centimeters and returns pixels using the resolution of the
given component's graphics object.
|
protected int | centimeterAsPixel(double cm, int dpi)
Converts Centimeters and returns pixels using the specified resolution.
|
protected double | computeAverageCharWidth(FontMetrics metrics, String testString)
Computes and returns the average character width
of the specified test string using the given FontMetrics.
|
int | dialogUnitXAsPixel(int dluX, Component c)
Converts horizontal dialog units and returns pixels.
|
protected int | dialogUnitXAsPixel(int dluX, double dialogBaseUnitsX)
Converts horizontal dialog units and returns pixels.
|
int | dialogUnitYAsPixel(int dluY, Component c)
Converts vertical dialog units and returns pixels.
|
protected int | dialogUnitYAsPixel(int dluY, double dialogBaseUnitsY)
Converts vertical dialog units and returns pixels.
|
protected int | getDefaultScreenResolution()
Computes and returns the default resolution.
|
protected abstract double | getDialogBaseUnitsX(Component component)
Gets and returns the horizontal dialog base units.
|
protected abstract double | getDialogBaseUnitsY(Component component)
Gets and returns the vertical dialog base units.
|
protected int | getScreenResolution(Component c)
Returns the components screen resolution or the default screen
resolution if the component is null or has no toolkit assigned yet.
|
int | inchAsPixel(double in, Component component)
Converts Inches and returns pixels using the specified resolution.
|
protected int | inchAsPixel(double in, int dpi)
Converts Inches and returns pixels using the specified resolution.
|
int | millimeterAsPixel(double mm, Component component)
Converts Millimeters and returns pixels using the resolution of the
given component's graphics object.
|
protected int | millimeterAsPixel(double mm, int dpi)
Converts Millimeters and returns pixels using the specified resolution.
|
int | pointAsPixel(int pt, Component component)
Converts DTP Points and returns pixels using the resolution of the
given component's graphics object.
|
protected int | pointAsPixel(int pt, int dpi)
Converts DTP Points and returns pixels using the specified resolution.
|
Parameters: cm Centimeters component the component that provides the graphics object
Returns: the given Centimeters as pixels
Parameters: cm Centimeters dpi the resolution
Returns: the given Centimeters as pixels
Parameters: metrics used to compute the test string's width testString the string that shall represent an "average" text
Returns: the test string's average character width.
Parameters: dluX the horizontal dialog units c a Component that provides the font and graphics
Returns: the given horizontal dialog units as pixels
Parameters: dluX the horizontal dialog units dialogBaseUnitsX the horizontal dialog base units
Returns: the given dialog base units as pixels
Parameters: dluY the vertical dialog units c a Component that provides the font and graphics
Returns: the given vertical dialog units as pixels
Parameters: dluY the vertical dialog units dialogBaseUnitsY the vertical dialog base units
Returns: the given dialog base units as pixels
Returns: the default screen resolution
Parameters: component a Component that provides the font and graphics
Returns: the horizontal dialog base units
Parameters: component a Component that provides the font and graphics
Returns: the vertical dialog base units
Parameters: c the component to ask for a toolkit
Returns: the component's screen resolution
Parameters: in the Inches component the component that provides the graphics object
Returns: the given Inches as pixels
Parameters: in the Inches dpi the resolution
Returns: the given Inches as pixels
Parameters: mm Millimeters component the component that provides the graphics object
Returns: the given Millimeters as pixels
Parameters: mm Millimeters dpi the resolution
Returns: the given Millimeters as pixels
Parameters: pt DTP Points component the component that provides the graphics object
Returns: the given Points as pixels
Parameters: pt DTP Points dpi the resolution in dpi
Returns: the given Points as pixels