eu.gnome.morena.wia
Class WIAScanner

java.lang.Object
  extended by eu.gnome.morena.DeviceBase
      extended by eu.gnome.morena.wia.WIADevice
          extended by eu.gnome.morena.wia.WIAScanner
All Implemented Interfaces:
Device, Scanner, Version, WIAConstants, java.lang.Runnable

public class WIAScanner
extends WIADevice
implements Scanner, java.lang.Runnable


Field Summary
 
Fields inherited from interface eu.gnome.morena.Scanner
BLACK_AND_WHITE, DUPLEX_AVAIL, DUPLEX_AVAIL_BACK_ONLY, DUPLEX_AVAIL_FRONT_ONLY, DUPLEX_NOT_AVAIL, GRAY_16, GRAY_8, RGB_16, RGB_8
 
Fields inherited from interface eu.gnome.morena.Version
BUILD_DATE, BUILD_TIME, TMP_DIR, VERSION, VERSION_BUILD, VERSION_MAJOR, VERSION_MINOR
 
Fields inherited from interface eu.gnome.morena.wia.WIAConstants
WIA_CATEGORY_AUTO, WIA_CATEGORY_FEEDER, WIA_CATEGORY_FEEDER_BACK, WIA_CATEGORY_FEEDER_FRONT, WIA_CATEGORY_FILM, WIA_CATEGORY_FINISHED_FILE, WIA_CATEGORY_FLATBED, WIA_CATEGORY_FOLDER, WIA_CATEGORY_ROOT, WIA_ERROR_BUSY, WIA_ERROR_COVER_OPEN, WIA_ERROR_DESTINATION, WIA_ERROR_DEVICE_COMMUNICATION, WIA_ERROR_DEVICE_LOCKED, WIA_ERROR_EXCEPTION_IN_DRIVER, WIA_ERROR_GENERAL_ERROR, WIA_ERROR_INCORRECT_HARDWARE_SETTING, WIA_ERROR_INVALID_COMMAND, WIA_ERROR_INVALID_DRIVER_RESPONSE, WIA_ERROR_ITEM_DELETED, WIA_ERROR_LAMP_OFF, WIA_ERROR_NETWORK_RESERVATION_FAILED, WIA_ERROR_OFFLINE, WIA_ERROR_PAPER_EMPTY, WIA_ERROR_PAPER_JAM, WIA_ERROR_PAPER_PROBLEM, WIA_ERROR_USER_INTERVENTION, WIA_ERROR_WARMING_UP, WIA_FLAG_NOM, WIA_FLAG_NUM_ELEMS, WIA_FLAG_VALUES, WIA_HANDLING_CAPABILITY_DUP, WIA_HANDLING_CAPABILITY_FEED, WIA_HANDLING_CAPABILITY_FLAT, WIA_HANDLING_SELECT_AUTO_ADVANCE, WIA_HANDLING_SELECT_BACK_FIRST, WIA_HANDLING_SELECT_BACK_ONLY, WIA_HANDLING_SELECT_DUPLEX, WIA_HANDLING_SELECT_FEEDER, WIA_HANDLING_SELECT_FLATBED, WIA_HANDLING_SELECT_FRONT_FIRST, WIA_HANDLING_SELECT_FRONT_ONLY, WIA_HANDLING_SELECT_NEXT_PAGE, WIA_HANDLING_SELECT_PREFEED, WIA_IPA_DATATYPE, WIA_IPA_DEPTH, WIA_IPS_BRIGHTNESS, WIA_IPS_CONTRAST, WIA_IPS_PAGE_SIZE, WIA_IPS_XEXTENT, WIA_IPS_XPOS, WIA_IPS_XRES, WIA_IPS_YEXTENT, WIA_IPS_YPOS, WIA_IPS_YRES, WIA_LIST_COUNT, WIA_LIST_NOM, WIA_LIST_NUM_ELEMS, WIA_LIST_VALUES, WIA_PROP_CACHEABLE, WIA_PROP_FLAG, WIA_PROP_LIST, WIA_PROP_NONE, WIA_PROP_RANGE, WIA_PROP_READ, WIA_PROP_SYNC_REQUIRED, WIA_PROP_WRITE, WIA_RANGE_MAX, WIA_RANGE_MIN, WIA_RANGE_NOM, WIA_RANGE_NUM_ELEMS, WIA_RANGE_STEP, WIA_TRANSFER_MSG_DEVICE_STATUS, WIA_TRANSFER_MSG_END_OF_STREAM, WIA_TRANSFER_MSG_END_OF_TRANSFER, WIA_TRANSFER_MSG_NEW_PAGE, WIA_TRANSFER_MSG_STATUS, WIA1_IT_MSG_DATA, WIA1_IT_MSG_DATA_HEADER, WIA1_IT_MSG_FILE_PREVIEW_DATA, WIA1_IT_MSG_FILE_PREVIEW_DATA_HEADER, WIA1_IT_MSG_NEW_PAGE, WIA1_IT_MSG_STATUS, WIA1_IT_MSG_TERMINATION
 
Method Summary
 void cancelTransfer()
          Stop scanning in progress.
 int getBrightness()
           
 int getContrast()
           
 int getFeederFunctionalUnit()
          Get feeder functional unit.
 int getFlatbedFunctionalUnit()
          Get flatbed functional unit.
 int getHandlingCapab()
           
 int getHandlingSelect()
           
 int getMode()
          Gets a current color mode
 SupportedPropertyValues getPropertyValues(int propId)
           
 int getResolution()
          Gets current scanning resolution.
 java.util.List<java.lang.Integer> getSupportedModes()
          Gets supported color modes
 java.util.List<java.lang.Integer> getSupportedResolutions()
          Gets supported scanning resolutions.
 boolean isDuplexEnabled()
           
 boolean isDuplexSupported()
           
 void run()
           
 void setBrightness(int brightness)
           
 void setContrast(int contrast)
           
 void setDuplexEnabled(boolean enabled)
           
 void setFrame(int x, int y, int width, int height)
          Sets area of scanning in pixels.
 void setMode(int bitDepth)
          Sets a color mode
 void setResolution(int resolution)
          Sets scanning resolution.
 void startTransfer(TransferDoneListener transferDoneListener, int functionalUnit)
          Scanning from specified functional unit.
 
Methods inherited from class eu.gnome.morena.wia.WIADevice
displayProperties
 
Methods inherited from class eu.gnome.morena.DeviceBase
getFunctionalUnit, setFunctionalUnit, setupDevice, startTransfer, startTransfer, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eu.gnome.morena.Scanner
getFunctionalUnit, setFunctionalUnit
 
Methods inherited from interface eu.gnome.morena.Device
setupDevice, startTransfer, startTransfer, toString
 

Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

startTransfer

public void startTransfer(TransferDoneListener transferDoneListener,
                          int functionalUnit)
                   throws java.lang.Exception
Description copied from class: DeviceBase
Scanning from specified functional unit. This method initiates an image transfer from specified functional unit of this device. TransferDoneListener provided is a callback handler that handles a result of the transfer. Since the transfer process is asynchronous by nature it should be considered that this method call does not wait for the transfer is to be completed.

Specified by:
startTransfer in interface Scanner
Overrides:
startTransfer in class DeviceBase
Parameters:
transferDoneListener - - specifies the handler of the transferred image.
functionalUnit - - specifies the functional unit (typically 0 is flatbed and 1 is feeder).
Throws:
java.lang.Exception

setMode

public void setMode(int bitDepth)
Description copied from interface: Scanner
Sets a color mode

Specified by:
setMode in interface Scanner
Parameters:
bitDepth - - color mode
See Also:
Scanner.RGB_8, Scanner.RGB_16, Scanner.GRAY_8, Scanner.GRAY_16, Scanner.BLACK_AND_WHITE

getMode

public int getMode()
Description copied from interface: Scanner
Gets a current color mode

Specified by:
getMode in interface Scanner
Returns:
- color mode
See Also:
Scanner.RGB_8, Scanner.RGB_16, Scanner.GRAY_8, Scanner.GRAY_16, Scanner.BLACK_AND_WHITE

getSupportedModes

public java.util.List<java.lang.Integer> getSupportedModes()
Description copied from interface: Scanner
Gets supported color modes

Specified by:
getSupportedModes in interface Scanner
Returns:
- list of color modes
See Also:
Scanner.RGB_8, Scanner.RGB_16, Scanner.GRAY_8, Scanner.GRAY_16, Scanner.BLACK_AND_WHITE

setResolution

public void setResolution(int resolution)
Description copied from interface: Scanner
Sets scanning resolution.

Specified by:
setResolution in interface Scanner
Parameters:
resolution - - DPI

getResolution

public int getResolution()
Description copied from interface: Scanner
Gets current scanning resolution.

Specified by:
getResolution in interface Scanner
Returns:
resolution - DPI

getSupportedResolutions

public java.util.List<java.lang.Integer> getSupportedResolutions()
Description copied from interface: Scanner
Gets supported scanning resolutions.

Specified by:
getSupportedResolutions in interface Scanner
Returns:
list of supported resolutions - DPI

setFrame

public void setFrame(int x,
                     int y,
                     int width,
                     int height)
Description copied from interface: Scanner
Sets area of scanning in pixels.

Specified by:
setFrame in interface Scanner

cancelTransfer

public void cancelTransfer()
Description copied from interface: Scanner
Stop scanning in progress.

Specified by:
cancelTransfer in interface Scanner

getFlatbedFunctionalUnit

public int getFlatbedFunctionalUnit()
Description copied from interface: Scanner
Get flatbed functional unit. Implementation note: functional unit is not recognized in WIA1 interface (Windows XP).

Specified by:
getFlatbedFunctionalUnit in interface Scanner
Returns:
functional unit id or -1 if not present or recognized.

getFeederFunctionalUnit

public int getFeederFunctionalUnit()
Description copied from interface: Scanner
Get feeder functional unit. Implementation note: functional unit is not recognized in WIA1 interface (Windows XP).

Specified by:
getFeederFunctionalUnit in interface Scanner
Returns:
functional unit id or -1 if not present or recognized.

isDuplexSupported

public boolean isDuplexSupported()
Specified by:
isDuplexSupported in interface Scanner

isDuplexEnabled

public boolean isDuplexEnabled()
Specified by:
isDuplexEnabled in interface Scanner

setDuplexEnabled

public void setDuplexEnabled(boolean enabled)
Specified by:
setDuplexEnabled in interface Scanner

getBrightness

public int getBrightness()

setBrightness

public void setBrightness(int brightness)

getContrast

public int getContrast()

setContrast

public void setContrast(int contrast)

getHandlingCapab

public int getHandlingCapab()

getHandlingSelect

public int getHandlingSelect()

getPropertyValues

public SupportedPropertyValues getPropertyValues(int propId)