chrriis.uihierarchy.unit
Class DluY

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

public class DluY
extends Object

A handler to manipulate a default unit representing a dialog unit on the vertical axis.

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

Nested Class Summary
static class DluY.DluYUnit
          A unit representing a dialog unit on the vertical axis.
 
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 DluY.DluYUnit 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 DluY.DluYUnit newInstance(Font referenceFont)
          Create a new instance of this unit, based on the given font.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getUnit

public static DluY.DluYUnit getUnit()
Get the default unit.

Returns:
The default unit.

newInstance

public static DluY.DluYUnit newInstance(Font referenceFont)
Create a new instance of this unit, based on the given font.

Parameters:
referenceFont - The font to use as a reference.
Returns:
The newly created instance.

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.