JSANE v2.1 - Lab Asprise! All Rights Reserved.

com.asprise.util.jsane
Class JSaneDevice

java.lang.Object
  |
  +--com.asprise.util.jsane.JSaneDevice

public final class JSaneDevice
extends java.lang.Object

Represents a SANE device. You can use this SANE device to acquire images.


Method Summary
 java.awt.Image acquireImage()
          Acquires image with IO blocking mode - i.e., the method will not not return until the image is acquired or error occurs.
 void acquireImage(java.awt.image.ImageObserver observer)
          Acquires image with IO non-blocking mode.
 void canelAcquisition()
          Cancels the current acqisition if any.
 void close()
          Closes the device.
 java.lang.String getModel()
          Returns the model info.
 java.lang.String getName()
           
 java.lang.String getOptionValue(java.lang.String optionName)
          Returns the current value for the specified option as a string.
 java.lang.String getType()
          Returns the type of the device.
 java.lang.String getVendor()
          Returns the vendor info.
 void setOptionValue(java.lang.String optionName, java.lang.String value)
          Sets the specified option with the given value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

canelAcquisition

public void canelAcquisition()
                      throws java.io.IOException,
                             com.asprise.util.jsane.SaneException
Cancels the current acqisition if any.

Throws:
java.io.IOException
SaneException

acquireImage

public java.awt.Image acquireImage()
                            throws com.asprise.util.jsane.SaneException,
                                   java.io.IOException
Acquires image with IO blocking mode - i.e., the method will not not return until the image is acquired or error occurs.

Returns:
the acquired image.
com.asprise.util.jsane.SaneException
java.io.IOException

acquireImage

public void acquireImage(java.awt.image.ImageObserver observer)
                  throws com.asprise.util.jsane.SaneException,
                         java.io.IOException
Acquires image with IO non-blocking mode. this method returns immediatelly. The image is acquired through a new thread. Once the image is fully acquired, the specified image observer will be notified.

Parameters:
observer -
com.asprise.util.jsane.SaneException
java.io.IOException

close

public void close()
           throws java.io.IOException,
                  com.asprise.util.jsane.SaneException
Closes the device. Note: you do not have to manually open the device. JSane handles it automatically. however, you need explicitly close it after use.

Throws:
java.io.IOException
SaneException

getOptionValue

public java.lang.String getOptionValue(java.lang.String optionName)
                                throws java.io.IOException,
                                       com.asprise.util.jsane.SaneException
Returns the current value for the specified option as a string.

Parameters:
optionName -
Returns:
Throws:
java.io.IOException
SaneException

setOptionValue

public void setOptionValue(java.lang.String optionName,
                           java.lang.String value)
                    throws java.io.IOException,
                           com.asprise.util.jsane.SaneException
Sets the specified option with the given value.

Parameters:
optionName -
value -
Throws:
java.io.IOException
SaneException

getName

public java.lang.String getName()
Returns:

getVendor

public java.lang.String getVendor()
Returns the vendor info.

Returns:

getModel

public java.lang.String getModel()
Returns the model info.

Returns:

getType

public java.lang.String getType()
Returns the type of the device.

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

JSANE v2.1 - Lab Asprise! All Rights Reserved.