fr.emn.win32input.jwintab
Class TabletContext

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

public class TabletContext
extends java.lang.Object


Constructor Summary
TabletContext(java.lang.String name)
          Creates a new context for the first tablet device in Wintab query order.
TabletContext(java.lang.String name, TabletDevice device)
          Creates a new context for a given tablet device.
 
Method Summary
 boolean areEventsEnabled()
          Returns whether this context sends tablet events (window messages) to its owner.
 void close()
          Closes the context.
 int getAbsoluteDimensions()
          Returns the logically absolute dimensions in this context.
 int getActiveDimensions()
          Returns the dimensions which are active in this context.
 java.lang.String getContextName()
          Returns the name of the context.
 TabletDevice getDevice()
          Returns the device whose input the context processes.
 Domain getInputDomain()
          Returns the domain of the context's input area in the tablet's native coordinates.
 Domain getOutputDomain()
          Returns the domain of the context's output area in context's output coordinates.
 PacketQueue getPacketQueue()
           
 int getReportRate()
          Returns the actual packet report rate in Hertz.
 Domain getSystemDomain()
          Returns the domain of the screen mapping area for system cursor tracking, in screen coordinates.
 boolean isDimensionAbsolute(int dimension)
          Returns whether a given dimension is logically absolute in this context, disregarding the device.
 boolean isDimensionActive(int dimension)
          Returns whether a given dimension is active in this context, disregarding the device.
 boolean isEnabled()
          Returns true if the context is enabled.
 boolean isInputARLocked()
           
 boolean isInputSizeLocked()
           
 boolean isMarginEnabled()
          Returns whether the input context on the tablet will have a margin.
 boolean isMarginInside()
          Returns whether the margin will be inside the context.
 boolean isMarginLocked()
           
 boolean isObscured()
          Returns true if the context is at least partially obscured by an overlapping context that is higher in the context overlap order.
 boolean isOnTop()
          Returns true if the context is the topmost context in the context overlap order.
 boolean isOpen()
          Returns whether the context is open.
 boolean isPenWindows()
          Returns whether this context is a Pen Windows context, if Pen Windows is installed.
static boolean isPenWindowsSupported()
          Returns true if Pen Windows is implemented.
 boolean isSensitivityLocked()
           
 boolean isSystemCursor()
          Returns whether this context is a system cursor context.
 boolean isSystemOutLocked()
           
 boolean open(int hwnd, boolean enable)
          Opens the context.
 void setContextName(java.lang.String name)
          Sets the name of the context.
 void setDevice(TabletDevice device)
          Specifies the device whose input the context processes.
 void setDimensionAbsolute(int dimension, boolean absolute)
          Sets the "logically absolute" state of one ore more dimensions in this context.
 void setDimensionActive(int dimension, boolean active)
          Sets the "active" state of one ore more dimensions in this context.
 void setDomainsToDefault()
          Sets input & output domains to device domains, and system domain to screen domain.
 void setEnabled(boolean enable)
          Specify whether to enable or disable the context.
 void setEventsEnabled(boolean val)
          Specifies whether this context must return tablet events (window messages) to its owner.
 void setInputARLocked(boolean val)
           
 void setInputDomain(Domain domain)
          Sets the domain of the context's input area in the tablet's native coordinates.
 void setInputSizeLocked(boolean val)
           
 void setMarginEnabled(boolean val)
          Specifies whether the input context must have a margin.
 void setMarginInside(boolean val)
          Specifies whether the margin must be inside the context.
 void setMarginLocked(boolean val)
           
 void setObscured(boolean obscured)
           
 void setOnTop(boolean top)
          Sends this tablet context to the top or bottom of the order of overlapping tablet contexts.
 void setOutputDomain(Domain domain)
          Sets the domain of the context's output area in the context's output coordinates.
 void setPenWindows(boolean val)
          Specifies whether this context must be a Pen Windows context.
 void setReportRate(int value)
          Specifies the desired packet report rate in Hertz.
 void setReportRateToMaximum()
           
 void setSensitivityLocked(boolean val)
           
 void setSystemCursor(boolean val)
          Specifies whether this context must be a system cursor context.
 void setSystemDomain(Domain domain)
          Sets the domain of the screen mapping area for system cursor tracking, in screen coordinates.
 void setSystemOutLocked(boolean val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabletContext

public TabletContext(java.lang.String name)
Creates a new context for the first tablet device in Wintab query order. Use this constructor if you know that there is only one tablet device available.


TabletContext

public TabletContext(java.lang.String name,
                     TabletDevice device)
Creates a new context for a given tablet device.

Parameters:
name - the name of the context
device - the (n+1)th tablet device in Wintab query order.
See Also:
setContextName(java.lang.String), JWintab#getDevice
Method Detail

areEventsEnabled

public boolean areEventsEnabled()
Returns whether this context sends tablet events (window messages) to its owner.


close

public void close()
Closes the context.

See Also:
open(int, boolean)

getAbsoluteDimensions

public int getAbsoluteDimensions()
Returns the logically absolute dimensions in this context. The return value must be ANDed with the device's physically absolute dimensions to obtain the effective set of logically absolute dimensions.

Returns:
a bit mask describing one or more dimension(s).
See Also:
Device#getPhysAbsoluteDimensions

getActiveDimensions

public int getActiveDimensions()
Returns the dimensions which are active in this context. The return value must be ANDed with the device's dimensions to obtain the effective set of active dimensions.

Returns:
a bit mask describing one or more dimension(s).
See Also:
isDimensionActive(int)

getContextName

public java.lang.String getContextName()
Returns the name of the context.

See Also:
setContextName(java.lang.String)

getDevice

public TabletDevice getDevice()
Returns the device whose input the context processes.


getInputDomain

public Domain getInputDomain()
Returns the domain of the context's input area in the tablet's native coordinates.

See Also:
setInputDomain(fr.emn.win32input.jwintab.Domain)

getOutputDomain

public Domain getOutputDomain()
Returns the domain of the context's output area in context's output coordinates.

See Also:
setOutputDomain(fr.emn.win32input.jwintab.Domain)

getPacketQueue

public PacketQueue getPacketQueue()

getReportRate

public int getReportRate()
Returns the actual packet report rate in Hertz.


getSystemDomain

public Domain getSystemDomain()
Returns the domain of the screen mapping area for system cursor tracking, in screen coordinates.

See Also:
setSystemDomain(fr.emn.win32input.jwintab.Domain)

isDimensionAbsolute

public boolean isDimensionAbsolute(int dimension)
Returns whether a given dimension is logically absolute in this context, disregarding the device. A dimension is logically absolute when it reports absolute values in events (otherwise, it reports relative values). The default value is TabletDevice.ALL.

Parameters:
dimension - a bit mask describing one or more dimension(s).
Returns:
true if all of the dimensions in the bit mask are absolute.
See Also:
getAbsoluteDimensions()

isDimensionActive

public boolean isDimensionActive(int dimension)
Returns whether a given dimension is active in this context, disregarding the device. A dimension is active when it generates move events. The default value is TabletDevice.XYZ.

Parameters:
dimension - a bit mask describing one or more dimension(s).
Returns:
true if all of the dimensions in the bit mask are active.
See Also:
getActiveDimensions()

isEnabled

public boolean isEnabled()
Returns true if the context is enabled.


isInputARLocked

public boolean isInputARLocked()

isInputSizeLocked

public boolean isInputSizeLocked()

isMarginEnabled

public boolean isMarginEnabled()
Returns whether the input context on the tablet will have a margin. The margin is an area outside the specified input area where events will be mapped to the edge of input area. This feature makes it easier to input points at the edge of the context.


isMarginInside

public boolean isMarginInside()
Returns whether the margin will be inside the context. Thus, scaling will occur from a context slightly smaller than the specified input context to the output coordinate space.


isMarginLocked

public boolean isMarginLocked()

isObscured

public boolean isObscured()
Returns true if the context is at least partially obscured by an overlapping context that is higher in the context overlap order. (CHANGE)


isOnTop

public boolean isOnTop()
Returns true if the context is the topmost context in the context overlap order. (CHANGE)


isOpen

public boolean isOpen()
Returns whether the context is open.

See Also:
open(int, boolean)

isPenWindows

public boolean isPenWindows()
Returns whether this context is a Pen Windows context, if Pen Windows is installed. The context is also a system cursor context.

See Also:
setPenWindows(boolean)

isPenWindowsSupported

public static boolean isPenWindowsSupported()
Returns true if Pen Windows is implemented.


isSensitivityLocked

public boolean isSensitivityLocked()

isSystemCursor

public boolean isSystemCursor()
Returns whether this context is a system cursor context.

See Also:
setSystemCursor(boolean)

isSystemOutLocked

public boolean isSystemOutLocked()

open

public boolean open(int hwnd,
                    boolean enable)
Opens the context. This function establishes an active context on the tablet. On successful completion of this function, the application may begin receiving tablet events (if they were requested), and may poll the context, or perform other context-related functions.

Parameters:
enable - specifies whether the new context will immediately begin to process data.
Returns:
true if the context has been successfully opened.
See Also:
close(), isOpen(), setEnabled(boolean)

setContextName

public void setContextName(java.lang.String name)
Sets the name of the context.

See Also:
getContextName()

setDevice

public void setDevice(TabletDevice device)
Specifies the device whose input the context processes. The default device is the first device in the wintab query order.

Parameters:
device - the TabletDevice object

setDimensionAbsolute

public void setDimensionAbsolute(int dimension,
                                 boolean absolute)
Sets the "logically absolute" state of one ore more dimensions in this context. Logically absolute dimensions which are supported by the device and which are physically absolute will report absolute values in events.

Parameters:
dimension - a bit mask describing one or more dimension(s).
absolute - true for absolute, false for relative.
See Also:
isDimensionAbsolute(int), Device#getPhysAbsoluteDimensions

setDimensionActive

public void setDimensionActive(int dimension,
                               boolean active)
Sets the "active" state of one ore more dimensions in this context. Active dimensions which are supported by the device will generate move events.

Parameters:
dimension - a bit mask describing one or more dimension(s).
See Also:
isDimensionActive(int)

setDomainsToDefault

public void setDomainsToDefault()
Sets input & output domains to device domains, and system domain to screen domain.


setEnabled

public void setEnabled(boolean enable)
Specify whether to enable or disable the context. When the context is open, this function turns on or off the processing of the events. Disabling an open context also flushes its event queue.

The default value is true.


setEventsEnabled

public void setEventsEnabled(boolean val)
Specifies whether this context must return tablet events (window messages) to its owner.

The default value is false.

See Also:
isDimensionActive(int), isDimensionAbsolute(int), setDimensionActive(int, boolean), setDimensionAbsolute(int, boolean)

setInputARLocked

public void setInputARLocked(boolean val)

setInputDomain

public void setInputDomain(Domain domain)
Sets the domain of the context's input area in the tablet's native coordinates. Each coordinate will be clipped to the tablet native coordinate space when the context is opened or modified. The Domain object allows to describe the domains of any subset of the tablet's dimensions. At now, Wintab only supports X, Y, and Z dimensions as input and output domains. All other dimensions will be ignored. The default value for output area is the domain of the tablet device returned by TabletDevice.getDomain().

See Also:
setOutputDomain(fr.emn.win32input.jwintab.Domain), setSystemDomain(fr.emn.win32input.jwintab.Domain), TabletDevice.getDomain(), Domain

setInputSizeLocked

public void setInputSizeLocked(boolean val)

setMarginEnabled

public void setMarginEnabled(boolean val)
Specifies whether the input context must have a margin.

The default value is false.

See Also:
isMarginEnabled()

setMarginInside

public void setMarginInside(boolean val)
Specifies whether the margin must be inside the context. Setting MarginInside to true automatically enables Margin.

The default value is false.

See Also:
isMarginInside(), setMarginEnabled(boolean)

setMarginLocked

public void setMarginLocked(boolean val)

setObscured

public void setObscured(boolean obscured)

setOnTop

public void setOnTop(boolean top)
Sends this tablet context to the top or bottom of the order of overlapping tablet contexts.

The default value is true.


setOutputDomain

public void setOutputDomain(Domain domain)
Sets the domain of the context's output area in the context's output coordinates. Each coordinate is used in coordinate scaling for absolute mode only. The Domain object allows to describe the domains of any subset of the tablet's dimensions. At now, Wintab only supports X, Y, and Z dimensions as input and output domains. All other dimensions will be ignored. The default value for output area is the domain of the tablet device returned by TabletDevice.getDomain();

See Also:
setInputDomain(fr.emn.win32input.jwintab.Domain), setSystemDomain(fr.emn.win32input.jwintab.Domain), Domain, TabletDevice.getDomain()

setPenWindows

public void setPenWindows(boolean val)
Specifies whether this context must be a Pen Windows context. Setting PenWindows to true automatically sets SystemCursor to true. Enabling pen windows when Pen Windows is not supported has no effect.

The default value is false.

See Also:
isPenWindows(), isPenWindowsSupported()

setReportRate

public void setReportRate(int value)
Specifies the desired packet report rate in Hertz. The default value is the maximum packet report rate for the first device. Warning ! Don't forget to change this value when setting another device. NOTE: Some tablets (Wacom Artpad II) do not support this feature.


setReportRateToMaximum

public void setReportRateToMaximum()

setSensitivityLocked

public void setSensitivityLocked(boolean val)

setSystemCursor

public void setSystemCursor(boolean val)
Specifies whether this context must be a system cursor context. Setting system cursor to false automatically sets pen windows to false.

The default value is true.

See Also:
isSystemCursor()

setSystemDomain

public void setSystemDomain(Domain domain)
Sets the domain of the screen mapping area for system cursor tracking, in screen coordinates. Only X and Y dimensions are supported, all other dimensions will be ignored. The default value for system area is the screen domain returned by JWintab.getScreenDomain().

See Also:
setOutputDomain(fr.emn.win32input.jwintab.Domain), setSystemDomain(fr.emn.win32input.jwintab.Domain), Domain, JWintab.getScreenDomain(int)

setSystemOutLocked

public void setSystemOutLocked(boolean val)