Holger's
Java API

com.antelmann.imagedb
Class TwainAdapter

java.lang.Object
  extended by com.antelmann.imagedb.TwainAdapter
All Implemented Interfaces:
NativeCode, ThirdParty

public class TwainAdapter
extends Object
implements ThirdParty, NativeCode

uses some free software from http://www.javajeff.mb.ca/; requires jtwain.dll in the path

Author:
Holger Antelmann

Method Summary
 Image[] acquire()
           
 ArrayList<Image> acquire(int count)
           
 Image[] acquire(String sourceName)
          acquires an image directly from the default source (the source gui is used)
 ArrayList<Image> acquire(String sourceName, int count)
          acquires images in succession directly from the default source
 Image acquireImage()
           
 Image acquireImage(String sourceName)
           
 String getDefaultSource()
           
static TwainAdapter getInstance()
           
static TwainAdapter getInstance(String libraryName)
           
 ArrayList<String> listSources()
           
 Image requestAndAcquire()
          acquires an image from the default source (the twain source gui is used for selection).
 void selectDefaultSource()
          shows a gui which lets you select the default source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static TwainAdapter getInstance()
                                throws ResourceNotFoundException
Throws:
ResourceNotFoundException - if the adapter cannot be initialized

getInstance

public static TwainAdapter getInstance(String libraryName)
                                throws ResourceNotFoundException
Throws:
ResourceNotFoundException - if the adapter cannot be initialized

selectDefaultSource

public void selectDefaultSource()
                         throws ImageTransferException
shows a gui which lets you select the default source

Throws:
ImageTransferException

requestAndAcquire

public Image requestAndAcquire()
                        throws ImageTransferException
acquires an image from the default source (the twain source gui is used for selection). Null may be returned if the user selects to cancel the operation.

Throws:
ImageTransferException

acquireImage

public Image acquireImage()
                   throws ImageTransferException
Throws:
ImageTransferException

acquireImage

public Image acquireImage(String sourceName)
                   throws ImageTransferException
Throws:
ImageTransferException

acquire

public Image[] acquire()
                throws ImageTransferException
Throws:
ImageTransferException

acquire

public ArrayList<Image> acquire(int count)
                         throws ImageTransferException
Throws:
ImageTransferException

acquire

public ArrayList<Image> acquire(String sourceName,
                                int count)
                         throws ImageTransferException
acquires images in succession directly from the default source

Throws:
ImageTransferException

acquire

public Image[] acquire(String sourceName)
                throws ImageTransferException
acquires an image directly from the default source (the source gui is used)

Throws:
ImageTransferException

getDefaultSource

public String getDefaultSource()
                        throws ImageTransferException
Throws:
ImageTransferException

listSources

public ArrayList<String> listSources()
                              throws ImageTransferException
Throws:
ImageTransferException


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads