public final class UnitConv
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CM
Describes the unit centimeter.
|
static float |
IN2CM
conversion factory from centimeters to inches.
|
static float |
IN2MM
conversion factory from millimeters to inches.
|
static int |
IN2PT
conversion factory from inches to points.
|
static java.lang.String |
INCH
Describes the unit inch.
|
static java.lang.String |
MM
Describes the unit millimeter.
|
static java.lang.String |
MPT
Describes the unit millipoint.
|
static java.lang.String |
PICA
Describes the unit pica.
|
static java.lang.String |
POINT
Describes the unit point.
|
static java.lang.String |
PX
Describes the unit pixel.
|
Modifier and Type | Method and Description |
---|---|
static int |
convert(java.lang.String value)
Convert the given unit length to a dimensionless integer representing
a whole number of base units (milli-points).
|
static double |
in2mm(double in)
Converts inches (in) to millimeters (mm)
|
static double |
in2mpt(double in)
Converts inches (in) to millipoints (mpt)
|
static double |
in2pt(double in)
Converts inches (in) to points (pt)
|
static double |
mm2in(double mm)
Converts millimeters (mm) to inches (in)
|
static double |
mm2mpt(double mm)
Converts millimeters (mm) to millipoints (mpt)
|
static double |
mm2pt(double mm)
Converts millimeters (mm) to points (pt)
|
static double |
mm2px(double mm,
int resolution)
Converts millimeters (mm) to pixels (px)
|
static double |
mpt2in(double mpt)
Converts millipoints (mpt) to inches (in)
|
static double |
mpt2px(double mpt,
int resolution)
Converts millipoints (mpt) to pixels (px)
|
static java.awt.geom.AffineTransform |
mptToPt(java.awt.geom.AffineTransform at)
Converts a millipoint-based transformation matrix to points.
|
static double |
pt2mm(double pt)
Converts points (pt) to millimeters (mm)
|
static java.awt.geom.AffineTransform |
ptToMpt(java.awt.geom.AffineTransform at)
Converts a point-based transformation matrix to millipoints.
|
public static final float IN2MM
public static final float IN2CM
public static final int IN2PT
public static final java.lang.String PICA
public static final java.lang.String POINT
public static final java.lang.String MM
public static final java.lang.String CM
public static final java.lang.String INCH
public static final java.lang.String MPT
public static final java.lang.String PX
public static double mm2pt(double mm)
mm
- the value in mmpublic static double mm2mpt(double mm)
mm
- the value in mmpublic static double pt2mm(double pt)
pt
- the value in ptpublic static double mm2in(double mm)
mm
- the value in mmpublic static double in2mm(double in)
in
- the value in inchespublic static double in2mpt(double in)
in
- the value in inchespublic static double in2pt(double in)
in
- the value in inchespublic static double mpt2in(double mpt)
mpt
- the value in mptpublic static double mm2px(double mm, int resolution)
mm
- the value in mmresolution
- the resolution in dpi (dots per inch)public static double mpt2px(double mpt, int resolution)
mpt
- the value in mptresolution
- the resolution in dpi (dots per inch)public static java.awt.geom.AffineTransform mptToPt(java.awt.geom.AffineTransform at)
at
- a millipoint-based transformation matrixpublic static java.awt.geom.AffineTransform ptToMpt(java.awt.geom.AffineTransform at)
at
- a point-based transformation matrixpublic static int convert(java.lang.String value)
value
- input unit valueCopyright 1999-2012 The Apache Software Foundation. All Rights Reserved.