public final class UnitConv extends Object
Modifier and Type | Field | Description |
---|---|---|
static 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 String |
INCH |
Describes the unit inch.
|
static String |
MM |
Describes the unit millimeter.
|
static String |
MPT |
Describes the unit millipoint.
|
static String |
PICA |
Describes the unit pica.
|
static String |
POINT |
Describes the unit point.
|
static String |
PX |
Describes the unit pixel.
|
Modifier and Type | Method | Description |
---|---|---|
static int |
convert(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 AffineTransform |
mptToPt(AffineTransform at) |
Converts a millipoint-based transformation matrix to points.
|
static double |
pt2mm(double pt) |
Converts points (pt) to millimeters (mm)
|
static AffineTransform |
ptToMpt(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 String PICA
public static final String POINT
public static final String MM
public static final String CM
public static final String INCH
public static final String MPT
public static final 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 AffineTransform mptToPt(AffineTransform at)
at
- a millipoint-based transformation matrixpublic static AffineTransform ptToMpt(AffineTransform at)
at
- a point-based transformation matrixpublic static int convert(String value)
value
- input unit valueCopyright © 2018 Apache Software Foundation. All rights reserved.