fr.emn.win32input.jwintab
Class Domain

java.lang.Object
  extended byfr.emn.win32input.jwintab.Domain

public class Domain
extends java.lang.Object

A class representing a multi-dimensional domain. A Domain contains information about the range (i.e. logical domain) of one or several dimensions. These dimensions are the tablet dimensions defined in the TabletDevice class. This object can be used in Contexts to define mapping functions between the tablet and the application. Constructors are provided to define (X,Y) and (X,Y,Z) domains used by mapping functions. To define other domains, use setRange.

See Also:
Range, TabletContext, TabletDevice

Constructor Summary
Domain()
          Contructs an empty domain with no dimension.
Domain(int Xmin, int Ymin, int Xmax, int Ymax)
          Constructs a two-dimensional domain on the dimensions X and Y.
Domain(int Xmin, int Ymin, int Zmin, int Xmax, int Ymax, int Zmax)
          Constructs a three-dimensional domain on the dimensions X, Y and Z.
 
Method Summary
 boolean containsDimension(int dimension)
          Returns whether this object contains the given dimension(s).
 int getDimensions()
          Returns a bit mask describing all the dimensions represented in this Domain.
 Range getRange(int dimension)
          Returns the range of a given dimension.
 void removeDimension(int dimension)
          Removes the given dimension(s) and their associated range.
 void setRange(int dimension, int min, int max)
          Sets the range of a dimension.
 void setRange(int dimension, Range range)
          Sets the range of a dimension.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Domain

public Domain()
Contructs an empty domain with no dimension.


Domain

public Domain(int Xmin,
              int Ymin,
              int Xmax,
              int Ymax)
Constructs a two-dimensional domain on the dimensions X and Y.


Domain

public Domain(int Xmin,
              int Ymin,
              int Zmin,
              int Xmax,
              int Ymax,
              int Zmax)
Constructs a three-dimensional domain on the dimensions X, Y and Z.

Method Detail

containsDimension

public boolean containsDimension(int dimension)
Returns whether this object contains the given dimension(s).

Parameters:
dimension - a bit mask describing one or more dimension(s).

getDimensions

public int getDimensions()
Returns a bit mask describing all the dimensions represented in this Domain.


getRange

public Range getRange(int dimension)
Returns the range of a given dimension. Returns 0 if the dimension's domain is not described.

Parameters:
dimension - a single dimension.
See Also:
containsDimension(int)

removeDimension

public void removeDimension(int dimension)
Removes the given dimension(s) and their associated range.

Parameters:
dimension - a bit mask describing one or more dimension(s).

setRange

public void setRange(int dimension,
                     int min,
                     int max)
Sets the range of a dimension. If the dimension does not already exist, it is added to this object. If the dimension exists, its new range is updated.

Parameters:
dimension - a bit mask describing one or more dimension(s).

setRange

public void setRange(int dimension,
                     Range range)
Sets the range of a dimension. If the dimension does not already exist, it is added to this object. If the dimension exists, its new range is updated.

Parameters:
dimension - a bit mask describing one or more dimension(s).

toString

public java.lang.String toString()