org.odftoolkit.odfdom.dom.util
Class OdfUnitConverter

java.lang.Object
  extended by org.odftoolkit.odfdom.dom.util.OdfUnitConverter

public class OdfUnitConverter
extends Object


Field Summary
static double CENTIMETER_IN_MM
           
static double DIDOT_POINT_IN_MM
           
static double DPI
           
static double INCH_IN_MM
           
static double PICA_IN_MM
           
static double PIXEL_IN_MM
           
static double POINT_IN_MM
           
static double TWIP_IN_MM
           
 
Constructor Summary
OdfUnitConverter()
           
 
Method Summary
static String getMeasureString(int measure)
          returns the xml value string for the given measure (position,distance,length)
static int getMeasureValue(String measure)
          Get a 1/100th millimeter value from the measure string
static String mapColorFromRgbToHex(String colorValue)
          Value have to be trimmed (no spaces around) and lower caser
static String mapUnitToCm(String length)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DPI

public static final double DPI
See Also:
Constant Field Values

CENTIMETER_IN_MM

public static final double CENTIMETER_IN_MM
See Also:
Constant Field Values

INCH_IN_MM

public static final double INCH_IN_MM
See Also:
Constant Field Values

DIDOT_POINT_IN_MM

public static final double DIDOT_POINT_IN_MM
See Also:
Constant Field Values

PICA_IN_MM

public static final double PICA_IN_MM
See Also:
Constant Field Values

POINT_IN_MM

public static final double POINT_IN_MM
See Also:
Constant Field Values

TWIP_IN_MM

public static final double TWIP_IN_MM
See Also:
Constant Field Values

PIXEL_IN_MM

public static final double PIXEL_IN_MM
See Also:
Constant Field Values
Constructor Detail

OdfUnitConverter

public OdfUnitConverter()
Method Detail

mapUnitToCm

public static String mapUnitToCm(String length)
Parameters:
length - The value to be mapped
Returns:
The converted value

mapColorFromRgbToHex

public static String mapColorFromRgbToHex(String colorValue)
Value have to be trimmed (no spaces around) and lower caser

Parameters:
colorValue - The color to be converted
Returns:
the converted color

getMeasureValue

public static final int getMeasureValue(String measure)
Get a 1/100th millimeter value from the measure string


getMeasureString

public static final String getMeasureString(int measure)
returns the xml value string for the given measure (position,distance,length)

Parameters:
measure - in 1/100th mm
Returns:
odf convorm measure string using cm as unit


Copyright © 2009. All Rights Reserved.