public class SpenPenManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SpenPenManager.InstallListener
This listener interface provides callback methods for receiving Pen plug-in installation and uninstallation events.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
SPEN_BRUSH
Pen brush.
|
static String |
SPEN_CHINESE_BRUSH
Chinese brush.
|
static String |
SPEN_FOUNTAIN_PEN
Fountain Pen.
|
static String |
SPEN_INK_PEN
Ink pen.
|
static String |
SPEN_MAGIC_PEN
Magic Pen.
|
static String |
SPEN_MARKER
Marker pen.
|
static String |
SPEN_OBLIQUE_PEN
Oblique Pen.
|
static String |
SPEN_PENCIL
Pencil.
|
| Constructor and Description |
|---|
SpenPenManager(Context context)
Create an SpenPenManager instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close Pen manager.
|
SpenPen |
createPen(SpenPenInfo info)
Create an SpenPen instance with the specified information.
|
SpenPen |
createPen(SpenPenInfo info,
String key)
Create an SpenPen instance with the specified information and key.
|
SpenPen |
createPen(String className)
Create an SpenPen instance with the specified class name.
|
SpenPen |
createPen(String className,
String key)
Create an SpenPen instance with the specified class name and key.
|
void |
destroyPen(SpenPen pen)
Unload the specified Pen plug-in instance.
|
List<SpenPenInfo> |
getPenInfoList()
Get the list of available Pen plug-ins.
|
String |
getPrivateKeyHint(SpenPenInfo info)
Get a private key hint for the specified Pen.
|
void |
setListener(SpenPenManager.InstallListener listener)
Set the specified InstallListener instance to receive plug-in installation and uninstallation events.
|
public static final String SPEN_INK_PEN
public static final String SPEN_PENCIL
public static final String SPEN_MARKER
public static final String SPEN_BRUSH
public static final String SPEN_CHINESE_BRUSH
public static final String SPEN_MAGIC_PEN
public static final String SPEN_FOUNTAIN_PEN
public static final String SPEN_OBLIQUE_PEN
public SpenPenManager(Context context)
context - The context for your application.IllegalArgumentException - Thrown if context is null.public void setListener(SpenPenManager.InstallListener listener)
listener - The InstallListener instance to receive pen plug-in installation and uninstallation events.public String getPrivateKeyHint(SpenPenInfo info) throws ClassNotFoundException, InstantiationException, IllegalAccessException
info - The Pen plug-in information object.ClassNotFoundException - Thrown if the class loader cannot find the specified Pen class.IllegalAccessException - Thrown if the Pen class methods are not accessible.InstantiationException - Thrown if Pen plug-in instantiation failed.IllegalArgumentException - Thrown if info is null.public List<SpenPenInfo> getPenInfoList()
public SpenPen createPen(SpenPenInfo info) throws ClassNotFoundException, InstantiationException, IllegalAccessException, Exception
info - The Pen plug-in information object.ClassNotFoundException - Thrown if the class loader cannot fine the specified Pen class.IllegalAccessException - Thrown if the Pen class methods are not accessible.InstantiationException - Thrown if Pen plug-in instantiation failed.IllegalArgumentException - Thrown if info is null.Exception - Thrown if other cases.public SpenPen createPen(SpenPenInfo info, String key) throws ClassNotFoundException, InstantiationException, IllegalAccessException, Exception
info - The Pen plug-in information object.key - The key for the Pen plug-in.ClassNotFoundException - Thrown if the class loader cannot fine the specified Pen class.IllegalAccessException - Thrown if the Pen class methods are not accessible.InstantiationException - Thrown if Pen plug-in instantiation failed.IllegalArgumentException - Thrown if info is null.Exception - Thrown if other cases.public SpenPen createPen(String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException, Exception
className - The Pen plug-in class name.ClassNotFoundException - Thrown if the class loader cannot fine the specified Pen class.IllegalAccessException - Thrown if the Pen class methods are not accessible.InstantiationException - Thrown if Pen plug-in instantiation failed.IllegalArgumentException - Thrown if className is null.Exception - Thrown if other cases.public SpenPen createPen(String className, String key) throws ClassNotFoundException, InstantiationException, IllegalAccessException, Exception
className - The Pen plug-in class name.key - The key for the Pen plug-in.ClassNotFoundException - Thrown if the class loader cannot fine the specified Pen class.IllegalAccessException - Thrown if the Pen class methods are not accessible.InstantiationException - Thrown if Pen plug-in instantiation failed.IllegalArgumentException - Thrown if className is null.Exception - Thrown if other cases.public void destroyPen(SpenPen pen)
pen - The Pen plug-in instance.IllegalStateException - Thrown if pen is null.IllegalArgumentException - Thrown if pen manager is closed.public void close()