chrriis.uihierarchy.unit
Class Pixel

java.lang.Object
  extended bychrriis.uihierarchy.unit.Pixel

public class Pixel
extends Object

A handler to manipulate a default unit representing a pixel.

Version:
1.0 2005.02.01
Author:
Christopher Deckers (chrriis@brainlex.com)

Nested Class Summary
static class Pixel.PixelUnit
          A unit representing a pixel.
 
Method Summary
static double doubleValue(String unitValue)
          Parse a value along with its unit from a String representation, and convert it to this unit.
static double doubleValue(String unitName, double value)
          Get the double value resulting from the conversion of the value from the specified unit.
static double doubleValue(Unit unit, double value)
          Get the double value resulting from the conversion of the value from the specified unit.
static Pixel.PixelUnit getUnit()
          Get the default unit.
static int intValue(String unitValue)
          Parse a value along with its unit from a String representation, and convert it to this unit.
static int intValue(String unitName, double value)
          Get the int value resulting from the conversion of the value from the specified unit.
static int intValue(Unit unit, double value)
          Get the int value resulting from the conversion of the value from the specified unit.
static Pixel.PixelUnit newInstance()
          Create a new instance of this unit.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getUnit

public static Pixel.PixelUnit getUnit()
Get the default unit.

Returns:
The default unit.

newInstance

public static Pixel.PixelUnit newInstance()
Create a new instance of this unit.

Returns:
The newly created instance.

intValue

public static int intValue(String unitName,
                           double value)
Get the int value resulting from the conversion of the value from the specified unit.

Parameters:
unitName - A name identifying the unit from which to convert.
value - The value to convert.
Returns:
The result of the conversion.

intValue

public static int intValue(Unit unit,
                           double value)
Get the int value resulting from the conversion of the value from the specified unit.

Parameters:
unit - The unit from which to convert.
value - The value to convert.
Returns:
The result of the conversion.

doubleValue

public static double doubleValue(String unitName,
                                 double value)
Get the double value resulting from the conversion of the value from the specified unit.

Parameters:
unitName - A name identifying the unit from which to convert.
value - The value to convert.
Returns:
The result of the conversion.

doubleValue

public static double doubleValue(Unit unit,
                                 double value)
Get the double value resulting from the conversion of the value from the specified unit.

Parameters:
unit - The unit from which to convert.
value - The value to convert.
Returns:
The result of the conversion.

intValue

public static int intValue(String unitValue)
Parse a value along with its unit from a String representation, and convert it to this unit.

Parameters:
unitValue - The value with a unit in its String representation. If the unit is not specified, then assume it is Pixel.
Returns:
The int value resulting from the conversion.

doubleValue

public static double doubleValue(String unitValue)
Parse a value along with its unit from a String representation, and convert it to this unit.

Parameters:
unitValue - The value with a unit in its String representation. If the unit is not specified, then assume it is Pixel.
Returns:
The double value resulting from the conversion.