public enum GraphicsUnit extends java.lang.Enum<GraphicsUnit>
Enum Constant and Description |
---|
Centimeter
Specifies centimeters as the unit of measure.
|
Display
Specifies 1/100 inch as the unit of measure.
|
Document
Specifies the document unit (1/300 inch) as the unit of measure.
|
Inch
Specifies the inch as the unit of measure.
|
Millimeter
Specifies the millimeter as the unit of measure.
|
Percent
Specifies percents as the unit of measure.
|
Pixel
Specifies a device pixel as the unit of measure.
|
Point
Specifies a printer's point (1/72 inch) as the unit of measure.
|
World |
WpfPoint
Specifies device-independent pixels (1/96 inch) as the unit of measure.
|
Modifier and Type | Method and Description |
---|---|
float |
convert(double value,
GraphicsUnit targetUnit) |
static double |
convert(double value,
GraphicsUnit valueMeasureUnit,
GraphicsUnit targetMeasureUnit)
Convert value from valueMeasureUnit to targetMeasureUnit
|
static float |
convertF(float value,
GraphicsUnit valueMeasureUnit,
GraphicsUnit targetMeasureUnit) |
static GraphicsUnit |
fromInt(int intVal) |
int |
getValue() |
abstract double |
unitsPerInch() |
static GraphicsUnit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static GraphicsUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final GraphicsUnit World
public static final GraphicsUnit Display
public static final GraphicsUnit Pixel
public static final GraphicsUnit Point
public static final GraphicsUnit Inch
public static final GraphicsUnit Document
public static final GraphicsUnit Millimeter
public static final GraphicsUnit WpfPoint
public static final GraphicsUnit Percent
public static final GraphicsUnit Centimeter
public static GraphicsUnit[] values()
for (GraphicsUnit c : GraphicsUnit.values()) System.out.println(c);
public static GraphicsUnit valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static GraphicsUnit fromInt(int intVal)
public int getValue()
public float convert(double value, GraphicsUnit targetUnit)
public abstract double unitsPerInch()
public static float convertF(float value, GraphicsUnit valueMeasureUnit, GraphicsUnit targetMeasureUnit)
public static double convert(double value, GraphicsUnit valueMeasureUnit, GraphicsUnit targetMeasureUnit)
value
- A double value that should be converted.valueMeasureUnit
- The source GraphicsUnit
.targetMeasureUnit
- The target GraphicsUnit
.