jdbreport.model
Enum Units

java.lang.Object
  extended by java.lang.Enum<Units>
      extended by jdbreport.model.Units
All Implemented Interfaces:
Serializable, Comparable<Units>

public enum Units
extends Enum<Units>

Version:
1.1 03/09/08
Author:
Andrey Kholmanskih

Enum Constant Summary
CM
           
INCH
           
MM
           
MMx10
           
PT
           
 
Method Summary
static Units findUnits(String name)
           
static Units getDefaultUnit()
           
 double getValue(double value)
           
 int getXPixels(double value)
           
 int getYPixels(double value)
           
static void setDefaultUnit(Units unit)
           
 double setValue(double value)
           
 double setXPixels(int value)
           
 double setYPixels(int value)
           
static Units valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Units[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

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
Method Detail

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