|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.asprise.util.jtwain.lowlevel.Control
Utility class to control TWAIN operations.
Field Summary | |
static int |
ACTION_CLOSE_DS
|
static int |
ACTION_CLOSE_SM
|
static int |
ACTION_LOAD_SM
|
static int |
ACTION_OPEN_DS
|
static int |
ACTION_OPEN_SM
|
static int |
ACTION_SELECT_DS
|
static int |
ACTION_UNLOAD_SM
|
static int |
STATE_DS_ENABLED
|
static int |
STATE_DS_NOT_IN_USE
|
static int |
STATE_DS_OPEN
|
static int |
STATE_SM_LOADED
|
static int |
STATE_SM_NOT_LOADED
|
static int |
STATE_SM_OPEN
|
static int |
STATE_TRANSFER_READY
|
static int |
STATE_TRANSFERING
|
static int |
STATE_UNKNOWN
|
Constructor Summary | |
Control()
|
Method Summary | |
static boolean |
abortAllPendingImages()
Instructs the Source to abort all pending images. |
static String |
acquireOneImage(Source source)
Acquires an image from a Source. |
static void |
assertState(Source source,
int requiredState)
Asserts the current state is the required one. |
static void |
assertStateAtLeast(Source source,
int requiredStateAtLeast)
Asserts the current state is the required state or above it. |
static boolean |
assertStateNoException(Source source,
int requiredState)
Asserts the current state is the required one. |
static OperationResult |
CapabilityMsg(int messageType,
Capability capability)
Performs capability operations - MSG_GET, MSG_GETCURRENT, MSG_GETDEFAULT, MSG_RESET, MSG_SET. |
static OperationResult |
CapabilityMsgReset(Capability capability)
|
static OperationResult |
CapabilityMsgSet(Capability capability)
|
static void |
closeSource()
Closes the current active source. |
static void |
closeSourceManager()
Closes the source manager. |
static int |
getConditionCode()
Gets the condition code of an operation. |
static Source |
getCurrentSource()
Gets the current active source. |
static String |
getLastScannedFile()
|
static int |
getNumberOfPendingImages()
Gets number of pending images of the current active source. |
static int |
getReturnCode()
Gets the return code of an operation. |
static int |
getState(Source source)
Gets the status of a Source. |
static String |
getStateRepresentation(int code)
Gets a String representation of a TWAIN state. |
static OperationResult |
ImageLayoutGet()
Added on Jan 05, 2006 to provide partial scanning. |
static OperationResult |
ImageLayoutSet(DataTypeImageLayout layout)
|
static void |
loadLibrary()
Loads JTWAIN library. |
static void |
loadSourceManager()
Loads source manager. |
static void |
openDataSource(Source source)
Opens the specified data source. |
static void |
openSourceManager()
Opens the source manager. |
static void |
selectDataSource(String sourceName)
Selects the data source for this session. |
static boolean |
skipNextImage()
Instructs the Source to skip next pending image. |
static void |
unloadSourceManager()
Unloads source manager. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int STATE_UNKNOWN
public static final int STATE_SM_NOT_LOADED
public static final int STATE_SM_LOADED
public static final int STATE_SM_OPEN
public static final int STATE_DS_OPEN
public static final int STATE_DS_ENABLED
public static final int STATE_TRANSFER_READY
public static final int STATE_TRANSFERING
public static final int STATE_DS_NOT_IN_USE
public static final int ACTION_LOAD_SM
public static final int ACTION_OPEN_SM
public static final int ACTION_SELECT_DS
public static final int ACTION_OPEN_DS
public static final int ACTION_CLOSE_DS
public static final int ACTION_CLOSE_SM
public static final int ACTION_UNLOAD_SM
Constructor Detail |
public Control()
Method Detail |
public static OperationResult CapabilityMsg(int messageType, Capability capability)
messageType
- type of the message: MSG_GET, MSG_GETCURRENT, MSG_GETDEFAULT, MSG_RESET or MSG_SET.capability
- the target capability represented by a Capability
object
public static OperationResult CapabilityMsgReset(Capability capability)
public static OperationResult CapabilityMsgSet(Capability capability)
public static OperationResult ImageLayoutGet()
public static OperationResult ImageLayoutSet(DataTypeImageLayout layout)
public static String getLastScannedFile()
public static void unloadSourceManager() throws JTwainException
JTwainException
public static void loadSourceManager() throws JTwainException
JTwainException
public static void openSourceManager() throws JTwainException
JTwainException
public static void selectDataSource(String sourceName) throws JTwainException
sourceName
- the name of the source to be opened
JTwainException
public static void openDataSource(Source source) throws JTwainException
source
- the source to be opened
JTwainException
public static void closeSource() throws JTwainException
JTwainException
public static void closeSourceManager()
public static int getState(Source source)
source
- the specific Source
public static Source getCurrentSource()
null
if there is no source opened, otherwised, the
opened Source will be returned.public static String acquireOneImage(Source source)
source
- the source from which the image is going to be acquired.
public static int getConditionCode()
public static int getReturnCode()
public static int getNumberOfPendingImages()
public static boolean skipNextImage()
public static boolean abortAllPendingImages()
public static void loadLibrary()
public static void assertState(Source source, int requiredState) throws InvalidStateException
source
- the target data source
InvalidStateException
- if current state is not the desired onepublic static void assertStateAtLeast(Source source, int requiredStateAtLeast) throws InvalidStateException
source
- the target data source
InvalidStateException
- if current state is not appropriate.public static boolean assertStateNoException(Source source, int requiredState)
source
- the target data sourcerequiredState
- the required state
public static String getStateRepresentation(int code)
code
- state code
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |