jdbreport.model
Enum Units
java.lang.Object
java.lang.Enum<Units>
jdbreport.model.Units
- All Implemented Interfaces:
- Serializable, Comparable<Units>
public enum Units
- extends Enum<Units>
- Version:
- 1.1 03/09/08
- Author:
- Andrey Kholmanskih
PT
public static final Units PT
INCH
public static final Units INCH
MM
public static final Units MM
CM
public static final Units CM
MMx10
public static final Units MMx10
values
public static Units[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (Units c : Units.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static Units valueOf(String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name
- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is null
findUnits
public static Units findUnits(String name)
getDefaultUnit
public static Units getDefaultUnit()
setDefaultUnit
public static void setDefaultUnit(Units unit)
getValue
public double getValue(double value)
- Parameters:
value
- in 1/72 of an inch
- Returns:
- Returns result in selected units
setValue
public double setValue(double value)
- Parameters:
value
- in selected units
- Returns:
- result in 1/72 of an inch
getXPixels
public int getXPixels(double value)
- Parameters:
value
- in selected units
- Returns:
- result in pixels
setXPixels
public double setXPixels(int value)
- Parameters:
value
- in pixels
- Returns:
- result in selected units
getYPixels
public int getYPixels(double value)
- Parameters:
value
- in selected units
- Returns:
- Returns result in pixels
setYPixels
public double setYPixels(int value)
- Parameters:
value
- in pixels
- Returns:
- Returns result in selected units