|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.twainconnect.core.TwainConnect
public class TwainConnect
JNI Bridge class. Java methods act as thin wrappers over native calls to JNI. Class also responsible for loading the DLL.
| Field Summary | |
|---|---|
(package private) static java.lang.String |
tc_loader
|
| Fields inherited from interface com.jimageconnect.core.JImageconnect |
|---|
error_image_not_captured |
| Constructor Summary | |
|---|---|
TwainConnect()
Once the source manager has been loaded, it is not normally unloaded until your application is destroyed. |
|
| Method Summary | |
|---|---|
void |
acquire(java.lang.String sourcename)
Opens and enables the named source. |
void |
acquireImagesFileIo(java.lang.String sourcename)
Opens and enables the named source. |
void |
acquireImagesMemory(java.lang.String sourcename)
Opens and enables the named source. |
static java.awt.Image |
acquireNativeMemory(java.lang.String pSourceName)
|
void |
addTwainListener(TwainEventListener l)
Add a TwainEventListener instance and inform all the
listeners of the Image acquisition event |
boolean |
closeSource(java.lang.String sourcename)
Used internally to close the source |
protected void |
fireTwainCapabilityNotSet(Capability c)
Notify all listeners that have registered interest for notification on not being able to set the particular capability for this device. |
protected void |
fireTwainCapabilitySet(Capability c)
Notify all listeners that have registered interest for notification on being able to set the particular capability for this device. |
protected void |
fireTwainImageCaptured()
Notify all listeners that have registered interest for notification on this event type. |
protected void |
fireTwainImageFailed(java.lang.Exception e)
Notify all listeners that have registered interest for notification on a failed image acquisition. |
java.lang.String[] |
getAvailableSources()
Returns the names of all the available TAWAIN devices. |
java.lang.String |
getClassLoaderName()
The name of the class to use for reading the images. |
protected ImageLoader |
getLoader()
Load the default image io class as defined by either the property file or set at run-time. |
boolean |
isCancelScanning()
|
boolean |
isEngineAvailble()
|
boolean |
isTwainAvailble()
true if the TWAIN DataSource Manager is available and can
be loaded. |
boolean |
isUseMemoryForAcquisition()
|
boolean |
moreImagesAvailable()
|
boolean |
openSource(java.lang.String sourcename)
Used internally to explicitly open source |
void |
removeTwainListener(TwainEventListener l)
Remove a TwainEventListener instance from the list |
void |
setBitDepth(BitDepth bitDepth)
Set the requested Bit Depth. |
void |
setCancelScanning(boolean cancelScanning)
cancel scanning is a multi document environment Does not stop the device. |
void |
setClassLoaderName(java.lang.String classLoaderName)
Set the name of the class to use for reading the images |
boolean |
setDeviceXResolution(Dpi resolution)
Set the DPI for the scan. |
boolean |
setDeviceXResolution(int resolution)
allows the developer more explicit control |
boolean |
setDeviceXScale(short percent)
All the X-axis scaling values available. |
boolean |
setDeviceYResolution(Dpi resolution)
Set the DPI for the scan. |
boolean |
setDeviceYResolution(int resolution)
allows the developer more explicit control |
boolean |
setDeviceYScale(short percent)
All the Y-axis scaling values available. |
boolean |
setRegionOfInterest(RegionOfInterest roi)
Not all device honor this setting. |
void |
setUseMemoryForAcquisition(boolean useMemoryForAcquisition)
|
void |
showUi(boolean show)
Should the Vendor's UI be display. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final java.lang.String tc_loader
| Constructor Detail |
|---|
public TwainConnect()
throws TwainConnectException
TwainConnectException| Method Detail |
|---|
public void addTwainListener(TwainEventListener l)
TwainEventListener instance and inform all the
listeners of the Image acquisition event
l - - listener for Twain Eventspublic void removeTwainListener(TwainEventListener l)
TwainEventListener instance from the list
l - protected void fireTwainImageCaptured()
protected void fireTwainImageFailed(java.lang.Exception e)
protected void fireTwainCapabilityNotSet(Capability c)
protected void fireTwainCapabilitySet(Capability c)
public java.lang.String getClassLoaderName()
public void setClassLoaderName(java.lang.String classLoaderName)
classLoaderName - public boolean isTwainAvailble()
true if the TWAIN DataSource Manager is available and can
be loaded. Does not actually load the devices's datasources.
But normally, the presence of the DSM means that at least one
datasource has been installed. isTwainAvailble()
is fast after the first call
It can be used to enable or disable menu items in UI code.
truepublic boolean isUseMemoryForAcquisition()
public void setUseMemoryForAcquisition(boolean useMemoryForAcquisition)
useMemoryForAcquisition - the useMemoryForAcquisition to setpublic boolean isCancelScanning()
public void setCancelScanning(boolean cancelScanning)
cancelScanning - to stop the UI from polling for more imagespublic java.lang.String[] getAvailableSources()
getAvailableSources in interface com.jimageconnect.core.JImageconnect
protected ImageLoader getLoader()
throws TwainConnectException
TwainConnectException
public void acquire(java.lang.String sourcename)
throws TwainConnectException
acquire in interface com.jimageconnect.core.JImageconnectsourcename - The name of the source. Preferably this name is a
value derived from the getAvailbleSources method.
TwainConnectException
public void acquireImagesMemory(java.lang.String sourcename)
throws TwainConnectException
acquireImagesMemory in interface com.jimageconnect.core.JImageconnectsourcename - The name of the source. Preferably this name is a
value derived from the getAvailbleSources method.
TwainConnectException
public void acquireImagesFileIo(java.lang.String sourcename)
throws TwainConnectException
sourcename - The name of the source. Preferably this name is a
value derived from the getAvailbleSources method.
TwainConnectExceptionpublic void showUi(boolean show)
show - true to showpublic boolean openSource(java.lang.String sourcename)
sourcename -
public boolean setDeviceXResolution(Dpi resolution)
resolution -
public boolean setDeviceYResolution(Dpi resolution)
resolution -
public boolean setDeviceXResolution(int resolution)
resolution -
public boolean setDeviceYResolution(int resolution)
resolution -
public boolean setDeviceXScale(short percent)
throws java.lang.UnsupportedOperationException
percent - value must 0 to 100
java.lang.UnsupportedOperationException - if you pass a value = 0 or greater than 100public boolean setDeviceYScale(short percent)
percent - value must 0 to 100
java.lang.UnsupportedOperationException - if you pass a value = 0 or greater than 100public boolean closeSource(java.lang.String sourcename)
sourcename -
public void setBitDepth(BitDepth bitDepth)
bitDepth - color, b/w or gray scale imagepublic boolean setRegionOfInterest(RegionOfInterest roi)
roi - public boolean isEngineAvailble()
isEngineAvailble in interface com.jimageconnect.core.JImageconnect
public static java.awt.Image acquireNativeMemory(java.lang.String pSourceName)
throws TwainConnectException
TwainConnectExceptionpublic boolean moreImagesAvailable()
moreImagesAvailable in interface com.jimageconnect.core.JImageconnect
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||