public final class SpenShapeRecognitionManager extends SpenRecognitionManager
| Modifier and Type | Field and Description |
|---|---|
static String |
SPEN_SHAPE
The full class name of the preloaded ShapeRecognitionPlugin.
|
| Constructor and Description |
|---|
SpenShapeRecognitionManager(Context context)
Creates an SpenShapeRecognitionManager instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes an SpenShapeRecognitionManager instance.
|
SpenShapeRecognition |
createRecognition(SpenRecognitionInfo info)
Create an SpenShapeRecognition instance with the specified recognition information from the candidate information
list.
You can get the information by calling getInfoList(int, int). |
SpenShapeRecognition |
createRecognition(SpenRecognitionInfo info,
String key)
Create an SpenShapeRecognition instance with the specified recognition information from the candidate information
list and the specified key.
You can get the information by calling getInfoList(int, int) |
SpenShapeRecognition |
createRecognition(String className)
Create an SpenShapeRecognition instance with the specified full class name.
If you know the name of the package and class, you can call this method directly without making a candidate list. |
SpenShapeRecognition |
createRecognition(String className,
String key)
Create an SpenShapeRecognition instance directly with the specified full class name and key.
If you already know the name of the package and class, you can call this method directly without make a candidate list. |
void |
destroyRecognition(SpenShapeRecognition recognition)
Destroy the currently loaded shape recognition instance.
|
List<SpenRecognitionInfo> |
getInfoList(int inputType,
int outputType)
Get the information list with the specified input type and output type.
The list includes all available ShapeRecognition Plug-ins with the given inputType and outputType
. |
String |
getPrivateKeyHint(SpenRecognitionInfo info)
Get a private key hint for the recognition plug-in.
|
public static final String SPEN_SHAPE
public SpenShapeRecognitionManager(Context context)
context - The Context for your applicationIllegalArgumentException - Thrown if context is null.close()public List<SpenRecognitionInfo> getInfoList(int inputType, int outputType)
inputType and outputType
.inputType - The input object type for the recognition plug-in.outputType - The output object type of the recognition plug-in.SpenObjectBase.TYPE_NONE,
SpenObjectBase.TYPE_STROKE,
SpenObjectBase.TYPE_TEXT_BOX,
SpenObjectBase.TYPE_IMAGE,
SpenObjectBase.TYPE_CONTAINERpublic String getPrivateKeyHint(SpenRecognitionInfo info) throws ClassNotFoundException, InstantiationException, IllegalAccessException
info - The recognition information object.ClassNotFoundException - Thrown when the class loader is unable to find the specified class.InstantiationException - Thrown when the constructor is not accessible during instantiation.IllegalAccessException - Thrown when the class methods are not accessible.IllegalArgumentException - Thrown if info is null.public SpenShapeRecognition createRecognition(SpenRecognitionInfo info) throws ClassNotFoundException, SpenCreationFailureException, Exception
getInfoList(int, int).info - The recognition information object.IllegalArgumentException - Thrown when the information passed is null.ClassNotFoundException - Thrown when the class loader is unable to find the specified classSpenCreationFailureException - Thrown when the recognition instance cannot be created.Exception - Thrown if the recognition engine returns an error.destroyRecognition(SpenShapeRecognition)public SpenShapeRecognition createRecognition(SpenRecognitionInfo info, String key) throws ClassNotFoundException, SpenCreationFailureException, Exception
getInfoList(int, int)info - The recognition information object.key - The private key for the recognition instance.IllegalArgumentException - Thrown when the information passed is null.ClassNotFoundException - Thrown when the class loader is unable to find the specified class.SpenCreationFailureException - Thrown when the recognition instance cannot be created.Exception - Thrown if the recognition engine returns an error.getPrivateKeyHint(SpenRecognitionInfo),
destroyRecognition(SpenShapeRecognition)public SpenShapeRecognition createRecognition(String className) throws ClassNotFoundException, SpenCreationFailureException, Exception
className - The full class name of the recognition plug-in.IllegalArgumentException - Thrown when the className passed is null.ClassNotFoundException - Thrown when the class loader is unable to find the specified class.SpenCreationFailureException - Thrown when the recognition instance cannot be created.Exception - Thrown if the recognition engine returns an error.destroyRecognition(SpenShapeRecognition)public SpenShapeRecognition createRecognition(String className, String key) throws ClassNotFoundException, SpenCreationFailureException, Exception
className - The full class name of the recognition plug-in.key - The private key for the recognition plug-in.IllegalArgumentException - Thrown when the className passed is null.ClassNotFoundException - Thrown when the class loader is unable to find the specified class.SpenCreationFailureException - Thrown when the recognition instance cannot be created.Exception - Thrown if the recognition engine returns an error.getPrivateKeyHint(SpenRecognitionInfo),
destroyRecognition(SpenShapeRecognition)public void destroyRecognition(SpenShapeRecognition recognition)
recognition - The SpenShapeRecognition instance to destroy.IllegalArgumentException - Thrown when the recognition plug-in passed is not a loaded plug-in.createRecognition(SpenRecognitionInfo),
createRecognition(SpenRecognitionInfo, String),
createRecognition(String),
createRecognition(String, String)public void close()