eu.gnome.morena
Class DeviceBase

java.lang.Object
  extended by eu.gnome.morena.DeviceBase
All Implemented Interfaces:
Device, Version
Direct Known Subclasses:
ICADevice, WIADevice

public class DeviceBase
extends java.lang.Object
implements Device

A base class corresponding to the generic image acquisition device like scanner or camera. Scanning (scanner) or image transfer (camera) is initiated via startTransfer(TransferDoneListener) method call.


Field Summary
 
Fields inherited from interface eu.gnome.morena.Version
BUILD_DATE, BUILD_TIME, TMP_DIR, VERSION, VERSION_BUILD, VERSION_MAJOR, VERSION_MINOR
 
Method Summary
 int getFunctionalUnit()
           
 void setFunctionalUnit(int unit)
           
 boolean setupDevice(java.lang.Object parentComponent)
          Setup device for image transfer initiation
 void startTransfer()
          Scanning (scanner) or image transfer initiation (camera).
 void startTransfer(TransferDoneListener transferDoneListener)
          Scanning (scanner) or image transfer initiation (camera).
 void startTransfer(TransferDoneListener transferDoneListener, int functionalUnit)
          Scanning from specified functional unit.
 java.lang.String toString()
          Returns a string representation of this Device containing a description.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setupDevice

public boolean setupDevice(java.lang.Object parentComponent)
Setup device for image transfer initiation

Specified by:
setupDevice in interface Device
Parameters:
parentComponent - - Parent window component for displaying the dialogs.
Returns:
true, if image transfer was canceled or dialog display failed

startTransfer

public void startTransfer(TransferDoneListener transferDoneListener)
                   throws java.lang.Exception
Scanning (scanner) or image transfer initiation (camera). This method initiates an image transfer from 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 Device
Parameters:
transferDoneListener - - specifies the handler of the transferred image.
Throws:
java.lang.Exception

startTransfer

public void startTransfer()
                   throws java.lang.Exception
Scanning (scanner) or image transfer initiation (camera). This method initiates an image transfer from this device with the same parameters as used during last startTransfer() call. 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 Device
Throws:
java.lang.Exception

startTransfer

public void startTransfer(TransferDoneListener transferDoneListener,
                          int functionalUnit)
                   throws java.lang.Exception
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.

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

getFunctionalUnit

public int getFunctionalUnit()
Returns:
currently selected functional unit

setFunctionalUnit

public void setFunctionalUnit(int unit)
Parameters:
unit - - functional unit to be selected

toString

public java.lang.String toString()
Returns a string representation of this Device containing a description.

Specified by:
toString in interface Device
Overrides:
toString in class java.lang.Object