Package com.scriptel.proscript

## Class Device

- java.lang.Object
- - com.scriptel.proscript.Device

-     public final class Device
      extends java.lang.Object

  This class represents a physical ScripTouch device.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `DEVICE_DISCARD_CHANGES` | Constant for discard changes made to regions and screens on the device.
    `static int` | `DEVICE_FACTORY_RESET` | Constant for restore factory defaults to regions and screens on the device.
    `static int` | `DEVICE_SAVE_CHANGES` | Constant for save changes made to regions and screens on the device.
    `static int` | `POWER_STATE_NORMAL` | Constant for the normal power state.
    `static int` | `POWER_STATE_POWERDOWN` | Constant for the power down power state.
    `static int` | `POWER_STATE_STANDBY` | Constant for the standby power state.
    `static int` | `RUNMODE_AUTOTOUCH` | Constant for the auto touch run mode (not supported by all devices).
    `static int` | `RUNMODE_COMMAND` | Constant for the command run mode.
    `static int` | `RUNMODE_PEN` | Constant for the pen run mode.
    `static int` | `RUNMODE_PENCONTINUOUS` | Constant for the pen continuous run mode (reserved for later use).
    `static int` | `RUNMODE_PENSINGLE` | Constant for the pen single run mode (reserved for later use).
    `static int` | `RUNMODE_PENSTREAM` | Constant for the pen stream run mode (reserved for later use).
    `static int` | `RUNMODE_TOUCH` | Constant for the touch run mode (not supported by all devices).
    `static int` | `RUNMODE_TOUCHSINGLE` | Constant for the touch single run mode (reserved for later use).
    `static int` | `RUNMODE_TOUCHSTREAM` | Constant for the touch stream run mode (reserved for later use).
    `static int` | `SIMULATE_COORD_DEVICE_SPACE` | Constant for use with simulatePenInput() that tells the device that x and y are in coordinate space (0-499 for EasyScript 1.0, 0-2999 for EasyScript 3.0, or 0-65535 for ProScript).
    `static int` | `SIMULATE_COORD_DISPLAY_SPACE` | Constant for use with simulatePenInput() that tells the device that x and y are in display pixels.
    `static int` | `TEXTALIGN_CENTER` | Constant for aligning text anchors to the center of the text body.
    `static int` | `TEXTALIGN_LEFT` | Constant for aligning text anchors to the left of the text body.
    `static int` | `TEXTALIGN_RIGHT` | Constant for aligning text anchors to the right of the text body.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `asicReset​(boolean hardwareReset)` | This method performs either a hard or soft reset of the ASIC.
    `void` | `calibrate()` | This method puts the device into calibration mode.
    `void` | `cancelCalibration()` | This method cancels calibration.
    `void` | `clearLastError()` | This method clears the last error message from the device.
    `void` | `clearScreen()` | This method clears the device's screen.
    `void` | `close()` | This method attempts to close the device with the operating system.
    `void` | `deleteDeviceRegion​(int index)` | This method deletes the values of a region at the given index (153).
    `void` | `deleteRegion​(int region)` | Deprecated. This method is deprecated in firmware versions greater than 4.0.0 use deleteDeviceRegion() instead.
    `void` | `deleteResource​(int index)` | This method deletes a Resource from the device
    `void` | `deleteScreen​(int screenNumber)` | This method will delete the screen information at the given index.
    `void` | `drawText​(java.lang.String text, int x, int y, int align, boolean invert)` | This method draws text on the screen (if equipped).
    `void` | `GENIIAbortTune()` | Abort the pen tuning process for GENII devices.
    `void` | `GENIITune()` | Initiate the pen tuning process for GENII devices.
    `int` | `getActiveScreen()` | This Method gets the index value of the current Screen.
    `byte[]` | `getAsicRegister()` | This method attempts to get the current ASIC register values.
    `CalibrationData` | `getCalibrationData()` | This method gets the calibration data.
    `CalibrationState` | `getCalibrationState()` | This method attempts to get the current calibration state from the device.
    `Capabilities` | `getCapabilities()` | Gets the capabilities of this device.
    `Configuration` | `getConfiguration()` | This method attempts to get the configuration from a ScripTouch mouse device.
    `int` | `getContactCountMaximum()` | This method attempts to get the maximum number of contacts a ScripTouch multi-touch device supports.
    `CoordinateRange` | `getCoordinateRange()` | Gets the logical coordinate range for this device.
    `Region[]` | `getDefaultRegions()` | Deprecated. This method is deprecated in firmware versions greater than 4.0.0 since default regions no longer exist.
    `Region` | `getDeviceRegion()` | This method gets a region based off the index and report 152.
    `Region[]` | `getDeviceRegions()` | This method returns regions based on report 152.
    `DeviceStatus` | `getDeviceStatus()` | This method gets the current status or mode of the device
    `java.awt.image.BufferedImage` | `getDisplayContents()` | This method will read the screen of a display info a buffered image.
    `Display` | `getDisplayInfo()` | Gets the static display information from the device.
    `DisplaySettings` | `getDisplaySettings()` | Gets the dynamic display settings from the device.
    `java.lang.String` | `getDriverName()` | Gets the name of the driver attached to this device.
    `byte[]` | `getErrorCorrectionTable()` | This method attempts to get the error correction table from the device.
    `FrequencyAmplitude` | `getFrequencyAmplitude()` | This method attempts to get the frequency and amplitude settings from the device.
    `GeneralParameters` | `getGeneralParameters()` | This method attempts to get the general operating parameters from the device.
    `int` | `getGENIIConfiguration()` | Gets the hardware configuration from a GENII device
    `byte[]` | `getGENIIGuid()` | This method retrieves the globally unique identifier for this device from the device.
    `TuningStatus` | `getGENIITuningStatus()` | This method attempts to get the frequency and amplitude settings from the device.
    `java.lang.String` | `getManufacturer()` | Gets the manufacturer of the device.
    `java.lang.String` | `getModel()` | Gets the model of the device.
    `OperatingModes` | `getOperatingModes()` | This method attempts to get the supported operating modes from the device.
    `OutputConfiguration` | `getOutputConfiguration()` | This method gets the output configuration from the device.
    `java.lang.String` | `getPath()` | Gets the path of the device.
    `PenParameters` | `getPenParameters()` | This method attempts to get the current pen parameters from the device.
    `PeripheralConfiguration` | `getPeripheralConfiguration()` | This method gets the peripheral configuration from the device.
    `int` | `getPowerState()` | This method attempts to get the power state from the device.
    `int` | `getProductId()` | Gets the product id associated with this device.
    `int` | `getRegionIndex()` | This method gets the current region index.
    `Region[]` | `getRegions()` | Deprecated. This method is deprecated in favor of getDeviceRegions() with firmware versions greater than 4.0.0.
    `Resource` | `getResource()` | This method gets the Resource from the device based off the Resource index.
    `ResourceAvailability` | `getResourceAvailability()` | This method gets the available space for resources on the device.
    `int` | `getResourceIndex()` | This method gets the current Resource index.
    `ResourceInfo` | `getResourceInfo()` | This method gets the Resource information at the current Resource index.
    `Screen` | `getScreen()` | This method gets the screen based off the screen index.
    `int` | `getScreenIndex()` | This method gets the current screen index.
    `ScreenRegionInfo` | `getScreenRegionInfo()` | This method fetches the information about screens and regions on the device.
    `java.lang.String` | `getSerialNumber()` | This method attempts to get the serial number from the device.
    `int` | `getTextHeight​(java.lang.String text)` | Gets the height of a string using the built-in font.
    `int` | `getTextWidth​(java.lang.String text)` | Gets the width of a string using the built-in font.
    `TouchParameters` | `getTouchParameters()` | This method attempts to get the current touch parameters from the device.
    `byte[]` | `getUuid()` | This method retrieves the universally unique identifier for this device from the device.
    `java.lang.String` | `getUuidString()` | Gets the UUID from the device as a string.
    `int` | `getVendorId()` | Gets the vendor id associated with this device.
    `Version` | `getVersionInfo()` | Gets the version information about the firmware for this device.
    `boolean` | `isButtonDown()` | Returns whether or not a button is currently being pressed.
    `boolean` | `isOpen()` | Returns whether or not this device is currently open.
    `void` | `modifyScreen​(ScreenModify screenModify)` | This method is an alternative way to set variables on a screen.
    `void` | `open()` | This method attempts to open the device with the operating system.
    `void` | `read()` | This method attempts to read from the device.
    `void` | `registerInputListener​(InputListener l)` | This method registers an input listener for this device that will be notified of any new input.
    `void` | `restoreDefaultRegions()` | This method attempts to restore the default regions in the device.
    `void` | `saveRegions​(boolean commit)` | Deprecated. This method is deprecated in favor of saveScreensRegions() with firmware versions greater than 4.0.0.
    `void` | `saveScreensRegions​(int commitStatus)` | This method will either discard or save screen and region edits Alternatively, it can be used to restore factory defaults.
    `void` | `setActiveScreen​(int screenIndex)` | This Method sets the index value of the current Screen.
    `void` | `setAsicRegister​(byte registerId, byte value)` | This method sets an ASIC register.
    `void` | `setCalibrationData​(CalibrationData calibrationData)` | Sets the data associated with calibration
    `void` | `setDeviceConfiguration​(Configuration c)` | This method sets the ScripTouch mouse configuration if supported.
    `void` | `setDeviceRegion​(Region region)` | This method sets a region on the device using the given values.
    `void` | `setDisplaySettings​(DisplaySettings s)` | This method sets the dynamic display settings if supported.
    `void` | `setEasyscriptMode​(boolean commitChanges)` | Sets the device to EasyScript mode.
    `void` | `setErrorCorrectionTable​(byte[] ect)` | This method sets the error correction table in the device.
    `void` | `setFrequencyAmplitude​(FrequencyAmplitude f)` | This method sets the frequency and amplitude of the ASIC.
    `void` | `setGeneralParameters​(GeneralParameters params)` | This method sets the general parameters of the device.
    `void` | `setGENIIGuid​(byte[] guid)` | This method sets the globally unique identifier for this device from the device.
    `void` | `setGENIIPID​(int pid)` | Sets the PID of the attached device.
    `void` | `setOutputConfiguration​(OutputConfiguration ouputConfiguration)` | This method sends the output configuration to the device.
    `void` | `setPenParameters​(PenParameters p)` | This method sets the pen parameters in the device.
    `void` | `setPeripheralConfiguration​(PeripheralConfiguration peripheralConfiguration)` | This method sends the peripheral configuration to the device.
    `void` | `setPowerState​(int powerState)` | This method sets the power state of the device.
    `void` | `setPrimaryRegion​(int regionId)` | This method sets the primary region of the device.
    `void` | `setProscriptMode​(boolean commitChanges)` | Sets the device to ProScript mode.
    `void` | `setRegion​(Region r)` | Deprecated. This method is deprecated in favor of setDeviceRegion() with firmware versions greater than 4.0.0.
    `void` | `setRegionIndex​(int index)` | This method sets the current region index.
    `void` | `setResource​(Resource resource)` | This method sets the Resource on the device.
    `void` | `setResourceIndex​(int index)` | This method sets the current Resource index.
    `void` | `setRunMode​(int runMode)` | This method sets the device's current run mode.
    `void` | `setScreen​(Screen screen)` | This method sends screen information to the device.
    `void` | `setScreenIndex​(int index)` | This method sets the screen index for the device.
    `void` | `setSerialNumber​(java.lang.String serialNumber)` | This method sets the device's serial number if supported.
    `void` | `setStartupMode​(int acqMode)` | This method sets the startup mode of the device.
    `void` | `setTouchParameters​(TouchParameters t)` | This method sets the touch parameters in the device.
    `void` | `simulatePenInput​(int coordType, int x, int y, boolean penDown)` | Simulates pen input, useful for unit testing with a real device.
    `java.lang.String` | `toString()` | Prints this object as a human readable string.
    `void` | `unregisterInputListener​(InputListener l)` | This method unregisters an input listener from this device.
    `void` | `updateFirmwareFromFw​(java.io.InputStream stream)` | This method attempts to update firmware on the device from a Scriptel firmware stream.
    `void` | `updateFirmwareFromFw​(java.io.InputStream stream, FirmwareListener callback)` | This method attempts to update firmware on the device from a Scriptel firmware stream.
    `void` | `updateFirmwareFromMot​(java.io.InputStream stream)` | This method attempts to update firmware on the device from a Motorola SRECord stream.
    `void` | `updateFirmwareFromMot​(java.io.InputStream stream, FirmwareListener callback)` | This method attempts to update firmware on the device from a Motorola SRECord file.
    `void` | `updateFirmwareFromPackage​(FirmwarePackage pkg, java.io.InputStream stream, FirmwareListener callback)` | This method updates the firmware on the device using the abstract firmware package interface.
    `void` | `updateRegion​(Region r)` | Deprecated. This method is deprecated in favor of setDeviceRegion() with firmware versions greater than 4.0.0.
    `void` | `writeDisplayChunk​(DisplayChunk d)` | This method writes a raw raster to the display of the device.
    `void` | `writeImage​(int x, int y, java.awt.image.BufferedImage image)` | This function allows you to draw a buffered image on to the screen of the device (if supported).
    `void` | `writeImage​(int x, int y, java.awt.image.BufferedImage image, int targetDepth)` | This function allows you to draw a buffered image on to the screen of the device (if supported).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### POWER_STATE_NORMAL

          public static final int POWER_STATE_NORMAL

      Constant for the normal power state.
      See Also:
        Constant Field Values

    - #### POWER_STATE_POWERDOWN

          public static final int POWER_STATE_POWERDOWN

      Constant for the power down power state.
      See Also:
        Constant Field Values

    - #### POWER_STATE_STANDBY

          public static final int POWER_STATE_STANDBY

      Constant for the standby power state.
      See Also:
        Constant Field Values

    - #### RUNMODE_COMMAND

          public static final int RUNMODE_COMMAND

      Constant for the command run mode.
      See Also:
        Constant Field Values

    - #### RUNMODE_TOUCH

          public static final int RUNMODE_TOUCH

      Constant for the touch run mode (not supported by all devices).
      See Also:
        Constant Field Values

    - #### RUNMODE_PEN

          public static final int RUNMODE_PEN

      Constant for the pen run mode.
      See Also:
        Constant Field Values

    - #### RUNMODE_AUTOTOUCH

          public static final int RUNMODE_AUTOTOUCH

      Constant for the auto touch run mode (not supported by all devices).
      See Also:
        Constant Field Values

    - #### RUNMODE_TOUCHSINGLE

          public static final int RUNMODE_TOUCHSINGLE

      Constant for the touch single run mode (reserved for later use).
      See Also:
        Constant Field Values

    - #### RUNMODE_TOUCHSTREAM

          public static final int RUNMODE_TOUCHSTREAM

      Constant for the touch stream run mode (reserved for later use).
      See Also:
        Constant Field Values

    - #### RUNMODE_PENSINGLE

          public static final int RUNMODE_PENSINGLE

      Constant for the pen single run mode (reserved for later use).
      See Also:
        Constant Field Values

    - #### RUNMODE_PENSTREAM

          public static final int RUNMODE_PENSTREAM

      Constant for the pen stream run mode (reserved for later use).
      See Also:
        Constant Field Values

    - #### RUNMODE_PENCONTINUOUS

          public static final int RUNMODE_PENCONTINUOUS

      Constant for the pen continuous run mode (reserved for later use).
      See Also:
        Constant Field Values

    - #### TEXTALIGN_LEFT

          public static final int TEXTALIGN_LEFT

      Constant for aligning text anchors to the left of the text body.
      See Also:
        Constant Field Values

    - #### TEXTALIGN_RIGHT

          public static final int TEXTALIGN_RIGHT

      Constant for aligning text anchors to the right of the text body.
      See Also:
        Constant Field Values

    - #### TEXTALIGN_CENTER

          public static final int TEXTALIGN_CENTER

      Constant for aligning text anchors to the center of the text body.
      See Also:
        Constant Field Values

    - #### DEVICE_DISCARD_CHANGES

          public static final int DEVICE_DISCARD_CHANGES

      Constant for discard changes made to regions and screens on the device.
      See Also:
        Constant Field Values

    - #### DEVICE_SAVE_CHANGES

          public static final int DEVICE_SAVE_CHANGES

      Constant for save changes made to regions and screens on the device.
      See Also:
        Constant Field Values

    - #### DEVICE_FACTORY_RESET

          public static final int DEVICE_FACTORY_RESET

      Constant for restore factory defaults to regions and screens on the device.
      See Also:
        Constant Field Values

    - #### SIMULATE_COORD_DISPLAY_SPACE

          public static final int SIMULATE_COORD_DISPLAY_SPACE

      Constant for use with simulatePenInput() that tells the device that x and y are in display pixels.
      See Also:
        Constant Field Values

    - #### SIMULATE_COORD_DEVICE_SPACE

          public static final int SIMULATE_COORD_DEVICE_SPACE

      Constant for use with simulatePenInput() that tells the device that x and y are in coordinate space (0-499 for EasyScript 1.0, 0-2999 for EasyScript 3.0, or 0-65535 for ProScript).
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### toString

          public java.lang.String toString()

      Prints this object as a human readable string.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        Human readable string.

    - #### open

          public void open()
                    throws java.io.IOException

      This method attempts to open the device with the operating system.
      Throws:
        `java.io.IOException` - thrown in the event of a problem opening the device.

    - #### getUuid

          public byte[] getUuid()
                         throws java.io.IOException

      This method retrieves the universally unique identifier for this device from the device. This requires that the device be open.
      Returns:
        The UUID of the device.
      Throws:
        `java.io.IOException` - thrown in the event the device isn't open

    - #### getGENIIGuid

          public byte[] getGENIIGuid()
                              throws java.io.IOException

      This method retrieves the globally unique identifier for this device from the device. This requires that the device be open. This is different than the UUID as it is not based on the glass error correction table, which can change the PCB is connected to a new/different piece of glass.
      Returns:
        The GUID of the device.
      Throws:
        `java.io.IOException` - thrown in the event the device isn't open

    - #### setGENIIGuid

          public void setGENIIGuid​(byte[] guid)
                            throws java.io.IOException

      This method sets the globally unique identifier for this device from the device. This requires that the device be open.
      Throws:
        `java.io.IOException` - thrown in the event the device isn't open

    - #### isOpen

          public boolean isOpen()

      Returns whether or not this device is currently open.
      Returns:
        Whether or not the device is currently open.

    - #### isButtonDown

          public boolean isButtonDown()

      Returns whether or not a button is currently being pressed.
      Returns:
        open state

    - #### getCapabilities

          public Capabilities getCapabilities()
                                       throws java.io.IOException

      Gets the capabilities of this device.
      Returns:
        Capabilities of the device.
      Throws:
        `java.io.IOException` - thrown in the event of a problem or if not supported.

    - #### getDisplayInfo

          public Display getDisplayInfo()
                                 throws java.io.IOException

      Gets the static display information from the device.
      Returns:
        Static display information.
      Throws:
        `java.io.IOException` - thrown in the event of a problem communicating with the device.

    - #### getDisplaySettings

          public DisplaySettings getDisplaySettings()
                                             throws java.io.IOException

      Gets the dynamic display settings from the device. Not supported on devices without displays.
      Returns:
        Dynamic display information.
      Throws:
        `java.io.IOException` - Thrown in the event of a problem communicating or if the call is not supported on this device.

    - #### getCoordinateRange

          public CoordinateRange getCoordinateRange()
                                             throws java.io.IOException

      Gets the logical coordinate range for this device.
      Returns:
        Coordinate range for this device.
      Throws:
        `java.io.IOException` - thrown in the event of a problem communicating with the device.

    - #### getVersionInfo

          public Version getVersionInfo()
                                 throws java.io.IOException

      Gets the version information about the firmware for this device.
      Returns:
        Firmware version of this device.
      Throws:
        `java.io.IOException` - thrown in the event of a problem communicating.

    - #### getRegions

          @Deprecated
          public Region[] getRegions()
                              throws java.io.IOException

      Deprecated.
      This method is deprecated in favor of getDeviceRegions() with firmware versions greater than 4.0.0.
      Gets the currently configured regions stored in the device.
      Returns:
        Regions from the device.
      Throws:
        `java.io.IOException` - thrown in the event of a problem communicating.

    - #### read

          public void read()
                    throws java.io.IOException

      This method attempts to read from the device. The method will block until data is read or it is interrupted. Read data will be passed into the callbacks registered with registerInputListener().
      Throws:
        `java.io.IOException` - thrown in the event of a reading problem.

    - #### close

          public void close()
                     throws java.io.IOException

      This method attempts to close the device with the operating system.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getErrorCorrectionTable

          public byte[] getErrorCorrectionTable()
                                         throws java.io.IOException

      This method attempts to get the error correction table from the device.
      Returns:
        Byte array containing the raw error correction table.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getSerialNumber

          public java.lang.String getSerialNumber()
                                           throws java.io.IOException

      This method attempts to get the serial number from the device. This may not be supported on all devices, it may also return empty on some devices.
      Returns:
        Serial number of the device.
      Throws:
        `java.io.IOException` - Thrown in the event of a problem or if this call isn't supported.

    - #### getPowerState

          public int getPowerState()
                            throws java.io.IOException

      This method attempts to get the power state from the device.
      Returns:
        Power state of the device.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getOperatingModes

          public OperatingModes getOperatingModes()
                                           throws java.io.IOException

      This method attempts to get the supported operating modes from the device.
      Returns:
        Supported operating modes.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getGeneralParameters

          public GeneralParameters getGeneralParameters()
                                                 throws java.io.IOException

      This method attempts to get the general operating parameters from the device.
      Returns:
        General parameters.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getFrequencyAmplitude

          public FrequencyAmplitude getFrequencyAmplitude()
                                                   throws java.io.IOException

      This method attempts to get the frequency and amplitude settings from the device.
      Returns:
        Frequency and amplitude settings.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getAsicRegister

          public byte[] getAsicRegister()
                                 throws java.io.IOException

      This method attempts to get the current ASIC register values.
      Returns:
        ASIC register values.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getPenParameters

          public PenParameters getPenParameters()
                                         throws java.io.IOException

      This method attempts to get the current pen parameters from the device.
      Returns:
        Pen parameters
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getOutputConfiguration

          public OutputConfiguration getOutputConfiguration()
                                                     throws java.io.IOException

      This method gets the output configuration from the device.
      Returns:
        output parameters
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### setOutputConfiguration

          public void setOutputConfiguration​(OutputConfiguration ouputConfiguration)
                                      throws java.io.IOException

      This method sends the output configuration to the device.
      Parameters:
        `ouputConfiguration` - the settings for output configuration
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getPeripheralConfiguration

          public PeripheralConfiguration getPeripheralConfiguration()
                                                             throws java.io.IOException

      This method gets the peripheral configuration from the device.
      Returns:
        peripheral configurations
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### setPeripheralConfiguration

          public void setPeripheralConfiguration​(PeripheralConfiguration peripheralConfiguration)
                                          throws java.io.IOException

      This method sends the peripheral configuration to the device.
      Parameters:
        `peripheralConfiguration` - the settings for peripheral configuration
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getResourceIndex

          public int getResourceIndex()
                               throws java.io.IOException

      This method gets the current Resource index.
      Returns:
        integer of the Resource index
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### setResourceIndex

          public void setResourceIndex​(int index)
                                throws java.io.IOException

      This method sets the current Resource index.
      Parameters:
        `index` - the value of the new Resource index
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getResourceInfo

          public ResourceInfo getResourceInfo()
                                       throws java.io.IOException

      This method gets the Resource information at the current Resource index.
      Returns:
        ResourceInfo of the resource information
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getResourceAvailability

          public ResourceAvailability getResourceAvailability()
                                                       throws java.io.IOException

      This method gets the available space for resources on the device.
      Returns:
        ResourceAvailability on the Device
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getResource

          public Resource getResource()
                               throws java.io.IOException

      This method gets the Resource from the device based off the Resource index.
      Returns:
        Resource from the device
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### deleteResource

          public void deleteResource​(int index)
                              throws java.io.IOException

      This method deletes a Resource from the device
      Parameters:
        `index` - the number of the Resource to be deleted
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getRegionIndex

          public int getRegionIndex()
                             throws java.io.IOException

      This method gets the current region index.
      Returns:
        integer of the region index
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### setRegionIndex

          public void setRegionIndex​(int index)
                              throws java.io.IOException

      This method sets the current region index.
      Parameters:
        `index` - the value of the new region index
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getDeviceRegion

          public Region getDeviceRegion()
                                 throws java.io.IOException

      This method gets a region based off the index and report 152.
      Returns:
        a Region from the device at the current index
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getDeviceRegions

          public Region[] getDeviceRegions()
                                    throws java.io.IOException

      This method returns regions based on report 152.
      Returns:
        an Array full of all the regions on the device
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### setDeviceRegion

          public void setDeviceRegion​(Region region)
                               throws java.io.IOException

      This method sets a region on the device using the given values.
      Parameters:
        `region` - the region and its values
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### deleteDeviceRegion

          public void deleteDeviceRegion​(int index)
                                  throws java.io.IOException

      This method deletes the values of a region at the given index (153).
      Parameters:
        `index` - the region number to be deleted
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getScreenIndex

          public int getScreenIndex()
                             throws java.io.IOException

      This method gets the current screen index.
      Returns:
        integer of the screen index
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### setScreenIndex

          public void setScreenIndex​(int index)
                              throws java.io.IOException

      This method sets the screen index for the device.
      Parameters:
        `index` - the screen to retrieve later
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getScreen

          public Screen getScreen()
                           throws java.io.IOException

      This method gets the screen based off the screen index.
      Returns:
        Screen the information about a screen on the device
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### setScreen

          public void setScreen​(Screen screen)
                         throws java.io.IOException

      This method sends screen information to the device.
      Parameters:
        `screen` - Screen information for a specific screen
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### deleteScreen

          public void deleteScreen​(int screenNumber)
                            throws java.io.IOException

      This method will delete the screen information at the given index.
      Parameters:
        `screenNumber` - the screen index to be deleted
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### modifyScreen

          public void modifyScreen​(ScreenModify screenModify)
                            throws java.io.IOException

      This method is an alternative way to set variables on a screen.
      Parameters:
        `screenModify` - the type of modification and its new values
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getScreenRegionInfo

          public ScreenRegionInfo getScreenRegionInfo()
                                               throws java.io.IOException

      This method fetches the information about screens and regions on the device.
      Returns:
        Screen and Region information
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getActiveScreen

          public int getActiveScreen()
                              throws java.io.IOException

      This Method gets the index value of the current Screen.
      Returns:
        integer value of the current screen
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### setActiveScreen

          public void setActiveScreen​(int screenIndex)
                               throws java.io.IOException

      This Method sets the index value of the current Screen.
      Parameters:
        `screenIndex` - integer value of the new screen index
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getCalibrationData

          public CalibrationData getCalibrationData()
                                             throws java.io.IOException

      This method gets the calibration data.
      Returns:
        calibration data
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### setCalibrationData

          public void setCalibrationData​(CalibrationData calibrationData)
                                  throws java.io.IOException

      Sets the data associated with calibration
      Parameters:
        `calibrationData` - the calibration data to be set
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getDeviceStatus

          public DeviceStatus getDeviceStatus()
                                       throws java.io.IOException

      This method gets the current status or mode of the device
      Returns:
        device status
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### clearLastError

          public void clearLastError()
                              throws java.io.IOException

      This method clears the last error message from the device.
      Throws:
        `java.io.IOException` - IOException thrown in the event of a problem

    - #### getTouchParameters

          public TouchParameters getTouchParameters()
                                             throws java.io.IOException

      This method attempts to get the current touch parameters from the device.
      Returns:
        Touch parameters.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getCalibrationState

          public CalibrationState getCalibrationState()
                                               throws java.io.IOException

      This method attempts to get the current calibration state from the device.
      Returns:
        Current calibration state.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getContactCountMaximum

          public int getContactCountMaximum()
                                     throws java.io.IOException

      This method attempts to get the maximum number of contacts a ScripTouch multi-touch device supports. This is not supported on all ScripTouch devices.
      Returns:
        Maximum number of contacts.
      Throws:
        `java.io.IOException` - Thrown in the event of a problem or if the call is not supported.

    - #### getConfiguration

          public Configuration getConfiguration()
                                         throws java.io.IOException

      This method attempts to get the configuration from a ScripTouch mouse device. This is not supported on all ScripTouch devices.
      Returns:
        ScripTouch mouse configuration.
      Throws:
        `java.io.IOException` - Thrown in the event of a problem or if the call is not supported.

    - #### getDefaultRegions

          @Deprecated
          public Region[] getDefaultRegions()
                                     throws java.io.IOException

      Deprecated.
      This method is deprecated in firmware versions greater than 4.0.0 since default regions no longer exist. Use saveScreensRegions() to restore factory defaults.
      This method attempts to get the default regions stored in a device that will be restored on a power cycle or reset.
      Returns:
        Default region set.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### restoreDefaultRegions

          public void restoreDefaultRegions()
                                     throws java.io.IOException

      This method attempts to restore the default regions in the device.
      Throws:
        `java.io.IOException` - Thrown in the event of a problem.

    - #### setRunMode

          public void setRunMode​(int runMode)
                          throws java.io.IOException

      This method sets the device's current run mode.
      Parameters:
        `runMode` - Run mode to set.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### setSerialNumber

          public void setSerialNumber​(java.lang.String serialNumber)
                               throws java.io.IOException

      This method sets the device's serial number if supported.
      Parameters:
        `serialNumber` - Serial number to set.
      Throws:
        `java.io.IOException` - thrown in the event of a problem or if the call is unsupported.

    - #### clearScreen

          public void clearScreen()
                           throws java.io.IOException

      This method clears the device's screen.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### deleteRegion

          @Deprecated
          public void deleteRegion​(int region)
                            throws java.io.IOException

      Deprecated.
      This method is deprecated in firmware versions greater than 4.0.0 use deleteDeviceRegion() instead.
      This method deletes a region.
      Parameters:
        `region` - Region number to delete.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### setDisplaySettings

          public void setDisplaySettings​(DisplaySettings s)
                                  throws java.io.IOException

      This method sets the dynamic display settings if supported.
      Parameters:
        `s` - Settings to set.
      Throws:
        `java.io.IOException` - thrown in the event of a problem or if the call is not supported.

    - #### setDeviceConfiguration

          public void setDeviceConfiguration​(Configuration c)
                                      throws java.io.IOException

      This method sets the ScripTouch mouse configuration if supported.
      Parameters:
        `c` - Configuration to set.
      Throws:
        `java.io.IOException` - thrown in the event of a problem or if unsupported.

    - #### setFrequencyAmplitude

          public void setFrequencyAmplitude​(FrequencyAmplitude f)
                                     throws java.io.IOException

      This method sets the frequency and amplitude of the ASIC.
      Parameters:
        `f` - Frequency and amplitude to set.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### setPowerState

          public void setPowerState​(int powerState)
                             throws java.io.IOException

      This method sets the power state of the device.
      Parameters:
        `powerState` - Power state to set.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### setErrorCorrectionTable

          public void setErrorCorrectionTable​(byte[] ect)
                                       throws java.io.IOException

      This method sets the error correction table in the device.
      Parameters:
        `ect` - Error correction table to write.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### setStartupMode

          public void setStartupMode​(int acqMode)
                              throws java.io.IOException

      This method sets the startup mode of the device.
      Parameters:
        `acqMode` - Acquisition mode to start up with.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### setGeneralParameters

          public void setGeneralParameters​(GeneralParameters params)
                                    throws java.io.IOException

      This method sets the general parameters of the device.
      Parameters:
        `params` - General parameters to set.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### asicReset

          public void asicReset​(boolean hardwareReset)
                         throws java.io.IOException

      This method performs either a hard or soft reset of the ASIC.
      Parameters:
        `hardwareReset` - Whether or not to do a hardware reset.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### setAsicRegister

          public void setAsicRegister​(byte registerId,
                                      byte value)
                               throws java.io.IOException

      This method sets an ASIC register.
      Parameters:
        `registerId` - Register to set.
        `value` - Value to set.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### setPenParameters

          public void setPenParameters​(PenParameters p)
                                throws java.io.IOException

      This method sets the pen parameters in the device.
      Parameters:
        `p` - Pen parameters to set.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### setTouchParameters

          public void setTouchParameters​(TouchParameters t)
                                  throws java.io.IOException

      This method sets the touch parameters in the device.
      Parameters:
        `t` - Touch parameters to set.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### setPrimaryRegion

          public void setPrimaryRegion​(int regionId)
                                throws java.io.IOException

      This method sets the primary region of the device.
      Parameters:
        `regionId` - Primary region to use.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### writeDisplayChunk

          public void writeDisplayChunk​(DisplayChunk d)
                                 throws java.io.IOException

      This method writes a raw raster to the display of the device.
      Parameters:
        `d` - Raw raster to update the display with.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### setRegion

          @Deprecated
          public void setRegion​(Region r)
                         throws java.io.IOException

      Deprecated.
      This method is deprecated in favor of setDeviceRegion() with firmware versions greater than 4.0.0.
      This method writes a region back to the device.
      Parameters:
        `r` - Region to update.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### updateRegion

          @Deprecated
          public void updateRegion​(Region r)
                            throws java.io.IOException

      Deprecated.
      This method is deprecated in favor of setDeviceRegion() with firmware versions greater than 4.0.0.
      This method updates specific region information.
      Parameters:
        `r` - Region to update.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### saveRegions

          @Deprecated
          public void saveRegions​(boolean commit)
                           throws java.io.IOException

      Deprecated.
      This method is deprecated in favor of saveScreensRegions() with firmware versions greater than 4.0.0.
      This method will either discard region edits or save region edits persistently.
      Parameters:
        `commit` - Whether or not to save the changes.
      Throws:
        `java.io.IOException` - Thrown in the event of a problem.

    - #### saveScreensRegions

          public void saveScreensRegions​(int commitStatus)
                                  throws java.io.IOException

      This method will either discard or save screen and region edits Alternatively, it can be used to restore factory defaults.
      Parameters:
        `commitStatus` - Either DEVICE_DISCARD_CHANGES, DEVICE_SAVE_CHANGES, or DEVICE_FACTORY_RESET.
      Throws:
        `java.io.IOException` - Thrown in the event of a problem.

    - #### calibrate

          public void calibrate()
                         throws java.io.IOException

      This method puts the device into calibration mode.
      Throws:
        `java.io.IOException` - in event of a problem

    - #### cancelCalibration

          public void cancelCalibration()
                                 throws java.io.IOException

      This method cancels calibration.
      Throws:
        `java.io.IOException` - in event of a problem

    - #### drawText

          public void drawText​(java.lang.String text,
                               int x,
                               int y,
                               int align,
                               boolean invert)

      This method draws text on the screen (if equipped).
      Parameters:
        `text` - Text to draw.
        `x` - Horizontal location of the text anchor on the screen.
        `y` - Vertical location of the text anchor on the screen.
        `align` - Position of the text anchor relative to the text.
        `invert` - Whether or not to invert the colors of the text.

    - #### getTextWidth

          public int getTextWidth​(java.lang.String text)

      Gets the width of a string using the built-in font.
      Parameters:
        `text` - String to measure.
      Returns:
        Width of the string in pixels.

    - #### getTextHeight

          public int getTextHeight​(java.lang.String text)

      Gets the height of a string using the built-in font.
      Parameters:
        `text` - String to measure.
      Returns:
        Height of the string in pixels.

    - #### getGENIIConfiguration

          public int getGENIIConfiguration()
                                    throws java.io.IOException

      Gets the hardware configuration from a GENII device
      Returns:
        the hardware configuration the STGENII device detects
      Throws:
        `java.io.IOException`

    - #### setGENIIPID

          public void setGENIIPID​(int pid)
                           throws java.io.IOException

      Sets the PID of the attached device.
      Parameters:
        `pid` - the desired product id of the device
      Throws:
        `java.io.IOException`

    - #### GENIITune

          public void GENIITune()

      Initiate the pen tuning process for GENII devices.

    - #### GENIIAbortTune

          public void GENIIAbortTune()

      Abort the pen tuning process for GENII devices.

    - #### getGENIITuningStatus

          public TuningStatus getGENIITuningStatus()
                                            throws java.io.IOException

      This method attempts to get the frequency and amplitude settings from the device.
      Returns:
        Frequency and amplitude settings.
      Throws:
        `java.io.IOException` - thrown in the event of a problem

    - #### getDriverName

          public java.lang.String getDriverName()
                                         throws java.io.IOException

      Gets the name of the driver attached to this device.
      Returns:
        Driver attached to this device.
      Throws:
        `java.io.IOException` - in event of a problem

    - #### setProscriptMode

          public void setProscriptMode​(boolean commitChanges)
                                throws java.io.IOException

      Sets the device to ProScript mode.
      Parameters:
        `commitChanges` - states whether the changes will last after a power cycle.
      Throws:
        `java.io.IOException` - in the event of a problem

    - #### setEasyscriptMode

          public void setEasyscriptMode​(boolean commitChanges)
                                 throws java.io.IOException

      Sets the device to EasyScript mode.
      Parameters:
        `commitChanges` - states whether the changes will last after a power cycle.
      Throws:
        `java.io.IOException` - in the event of a problem

    - #### registerInputListener

          public void registerInputListener​(InputListener l)

      This method registers an input listener for this device that will be notified of any new input.
      Parameters:
        `l` - Listener to register.

    - #### unregisterInputListener

          public void unregisterInputListener​(InputListener l)

      This method unregisters an input listener from this device.
      Parameters:
        `l` - Listener to unregister.

    - #### getUuidString

          public java.lang.String getUuidString()
                                         throws java.io.IOException

      Gets the UUID from the device as a string.
      Returns:
        String representation of the UUID.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### getPath

          public java.lang.String getPath()

      Gets the path of the device. Different per operating system. May change if the device is unplugged and plugged back in.
      Returns:
        The device path.

    - #### getProductId

          public int getProductId()

      Gets the product id associated with this device.
      Returns:
        Product ID associated with this device.

    - #### getVendorId

          public int getVendorId()

      Gets the vendor id associated with this device.
      Returns:
        The Vendor ID associated with this device.

    - #### getModel

          public java.lang.String getModel()

      Gets the model of the device.
      Returns:
        Model of the device.

    - #### getManufacturer

          public java.lang.String getManufacturer()

      Gets the manufacturer of the device.
      Returns:
        The manufacturer of the device.

    - #### writeImage

          public void writeImage​(int x,
                                 int y,
                                 java.awt.image.BufferedImage image)
                          throws java.io.IOException

      This function allows you to draw a buffered image on to the screen of the device (if supported). The image must fit within the device's display boundaries. Images will be automatically converted to the displays color depth.
      Parameters:
        `x` - The horizontal component of the location the image should be drawn.
        `y` - The vertical component of the location the image should be drawn.
        `image` - The buffered image to draw.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### writeImage

          public void writeImage​(int x,
                                 int y,
                                 java.awt.image.BufferedImage image,
                                 int targetDepth)
                          throws java.io.IOException

      This function allows you to draw a buffered image on to the screen of the device (if supported). The image must fit within the device's display boundaries. Images will be automatically converted to the displays color depth.
      Parameters:
        `x` - The horizontal component of the location the image should be drawn.
        `y` - The vertical component of the location the image should be drawn.
        `image` - The buffered image to draw.
        `targetDepth` - Target bit depth of the image.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### setResource

          public void setResource​(Resource resource)
                           throws java.io.IOException

      This method sets the Resource on the device.
      Parameters:
        `resource` - Resource being sent to the device
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### updateFirmwareFromMot

          public void updateFirmwareFromMot​(java.io.InputStream stream)
                                     throws java.io.IOException

      This method attempts to update firmware on the device from a Motorola SRECord stream. Legacy firmware is provided as MOT's. This should absolutely be avoided for new development as the MOT format has no protections in place to avoid writing the wrong firmware to a device which would render your device inoperable. Use this with extreme caution.
      Parameters:
        `stream` - Stream to read firmware from.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### updateFirmwareFromMot

          public void updateFirmwareFromMot​(java.io.InputStream stream,
                                            FirmwareListener callback)
                                     throws java.io.IOException

      This method attempts to update firmware on the device from a Motorola SRECord file. Legacy firmware is provided as MOT's. This should absolutely be avoided for new development as the MOT format has no protections in place to avoid writing the wrong firmware to a device which would render your device inoperable. Use this with extreme caution.
      Parameters:
        `stream` - Stream to read firmware from.
        `callback` - Callback to call after a piece of the firmware has been downloaded.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### updateFirmwareFromFw

          public void updateFirmwareFromFw​(java.io.InputStream stream)
                                    throws java.io.IOException

      This method attempts to update firmware on the device from a Scriptel firmware stream. All new firmware is provided in this format which provides a certain amount of protection against using the wrong firmware.
      Parameters:
        `stream` - Stream to read firmware from.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### updateFirmwareFromFw

          public void updateFirmwareFromFw​(java.io.InputStream stream,
                                           FirmwareListener callback)
                                    throws java.io.IOException

      This method attempts to update firmware on the device from a Scriptel firmware stream. All new firmware is provided in this format which provides a certain amount of protection against using the wrong firmware.
      Parameters:
        `stream` - Stream to read firmware from.
        `callback` - Callback to call after a piece of the firmware has been downloaded.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.

    - #### simulatePenInput

          public void simulatePenInput​(int coordType,
                                       int x,
                                       int y,
                                       boolean penDown)
                                throws java.io.IOException

      Simulates pen input, useful for unit testing with a real device.
      Parameters:
        `coordType` - Either SIMULATE_COORD_DISPLAY_SPACE or SIMULATE_COORD_DEVICE_SPACE.
        `x` - The horizontal component of the synthetic pen event.
        `y` - The vertical component of the synthetic pen event.
        `penDown` - Whether or not the pen tip is depressed.
      Throws:
        `java.io.IOException` - Thrown in the event of a problem.

    - #### getDisplayContents

          public java.awt.image.BufferedImage getDisplayContents()
                                                          throws java.io.IOException

      This method will read the screen of a display info a buffered image. This only works with devices with newer firmware.
      Returns:
        BufferedImage containing what's on the screen of the signature pad.
      Throws:
        `java.io.IOException` - Thrown in the event of a problem.

    - #### updateFirmwareFromPackage

          public void updateFirmwareFromPackage​(FirmwarePackage pkg,
                                                java.io.InputStream stream,
                                                FirmwareListener callback)
                                         throws java.io.IOException

      This method updates the firmware on the device using the abstract firmware package interface. Do not use this directly. Use updateFirmwareFromFw() or updateFirmwareFromMot() instead.
      Parameters:
        `pkg` - Package to use to load the firmware from the stream.
        `stream` - Stream to read from.
        `callback` - Callback to call after a piece of the firmware has been downloaded.
      Throws:
        `java.io.IOException` - thrown in the event of a problem.