fr.emn.win32input.jwintab
Class PhysicalRange

java.lang.Object
  extended byfr.emn.win32input.jwintab.Range
      extended byfr.emn.win32input.jwintab.PhysicalRange

public class PhysicalRange
extends Range

This is a class that represents a physical range. A physical range is a logical range with information about its associated physical dimension. This information includes the physical unit, resolution, and whether the dimension is relative or absolute. Physical extent can be deduced from logical range and dimension's resolution and unit.


Field Summary
 boolean absolute
           
 float resolution
           
 int unit
           
static int UNIT_CENTIMETERS
           
static int UNIT_CIRCLE
           
static int UNIT_INCHES
           
static int UNIT_NONE
           
 
Fields inherited from class fr.emn.win32input.jwintab.Range
max, min
 
Method Summary
 float getPhysicalExtent()
          Returns the dimension's physical extent.
 float getResolution()
          Returns the dimension's resolution.
 int getUnit()
          Returns the unit in which the resolution is expressed.
 boolean isAbsolute()
          Returns whether this dimension is physically absolute.
 void setAbsolute(boolean absolute)
           
 void setResolution(float resolution)
           
 void setUnit(int unit)
           
static java.lang.String unitToString(int unit)
           
 
Methods inherited from class fr.emn.win32input.jwintab.Range
getExtent, getMax, getMin, setMax, setMin, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNIT_NONE

public static final int UNIT_NONE
See Also:
Constant Field Values

UNIT_INCHES

public static final int UNIT_INCHES
See Also:
Constant Field Values

UNIT_CENTIMETERS

public static final int UNIT_CENTIMETERS
See Also:
Constant Field Values

UNIT_CIRCLE

public static final int UNIT_CIRCLE
See Also:
Constant Field Values

unit

public int unit

resolution

public float resolution

absolute

public boolean absolute
Method Detail

getPhysicalExtent

public float getPhysicalExtent()
Returns the dimension's physical extent. If the unit is known, returns the dimension's physical extent, returns 0 otherwise. The physical extent is given by the following formula: getPhysicalExtent() = getExtent() / getResolution().


getResolution

public float getResolution()
Returns the dimension's resolution. If the unit is known, returns the dimension's resolution, i.e. the number of items (states) by unit.


getUnit

public int getUnit()
Returns the unit in which the resolution is expressed. Returns UNIT_NONE if the unit, the resolution and the physical extent are unknown.


isAbsolute

public boolean isAbsolute()
Returns whether this dimension is physically absolute.

Returns:
true if this dimension is physically absolute ; false if this dimension is physically relative, i.e. if the hardware can only report change, not absolute measurement.

setAbsolute

public void setAbsolute(boolean absolute)

setResolution

public void setResolution(float resolution)

setUnit

public void setUnit(int unit)

unitToString

public static java.lang.String unitToString(int unit)