|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.livescribe.penlet.Penlet
public abstract class Penlet
Penlet provides the lifecycle methods for a pen application.
The services of the platform is exposed using the PenletContext class
that is provided to the application as part of the initialization.
| Field Summary | |
|---|---|
static int |
ACTIVATED_BY_EVENT
Indicates that the activation occurred due a event like tapping on an area. |
static int |
ACTIVATED_BY_MENU
Indicates that the activation occurred due to launching of the app from a menu |
static int |
ACTIVATED_BY_QCAPP
Indicates that the Quick Commands application has delegated a command to this app. |
static int |
ACTIVATED_BY_SELF
Indicates that the activation occurred due to the penlet making a state change using PenletInstance.notifyStateChange() |
static int |
ACTIVATED_BY_SYNCEVENT
Indicates that the system wants this penlet to sync its data. |
static int |
ACTIVATED_BY_SYSEVENT
Indicates that the activation occurred due a system event. |
protected PenletContext |
context
|
protected long |
dataModifiedTime
Holds the last modified time when the application data. |
static int |
DEACTIVATED_BY_APPSWITCH
Indicates that the deactivation occurred because the system switched to another app. |
static int |
DEACTIVATED_BY_MENU
Indicates that the deactivation occurred because the system switched back to main menu |
static int |
DEACTIVATED_BY_NOTES_MODE
Indicates that the deactivation occurred due to switching to notes mode. |
static int |
DEACTIVATED_BY_SELF
Indicates that the deactivation occurred due to the Penlet
making a state change using
PenletInstance.notifyStateChange() |
static int |
DEACTIVATED_BY_SHUTDOWN
Indicates that the deactivation occurred because the system is shutdown |
static int |
DEACTIVATED_BY_SYCNEVENT
|
static int |
DEACTIVATED_BY_SYSEVENT
Indicates that the deactivation occurred due to some system event |
protected static String |
LOG_MASK_PROPERTY
Property that specified the logging mask. |
Logger |
logger
|
| Constructor Summary | |
|---|---|
protected |
Penlet()
|
| Method Summary | |
|---|---|
abstract void |
activateApp(int reason,
Object[] params)
Activates the application. |
boolean |
canProcessOpenPaperEvents()
Indicates if the application can process strokes and taps created on open paper, any unclaimed paper space. |
abstract void |
deactivateApp(int reason)
Deactivates the application. |
abstract void |
destroyApp()
Destroys the application. |
PenletContext |
getContext()
Gets the penlet context. |
long |
getDataLastModifiedTime()
Gets the time when the application last modified its data. |
abstract void |
initApp()
Initializes the application. |
void |
setContext(PenletContext context)
Initializes context information. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String LOG_MASK_PROPERTY
protected PenletContext context
public final Logger logger
protected long dataModifiedTime
public static final int ACTIVATED_BY_EVENT
public static final int ACTIVATED_BY_MENU
public static final int ACTIVATED_BY_SELF
PenletInstance.notifyStateChange()
public static final int ACTIVATED_BY_SYSEVENT
public static final int ACTIVATED_BY_SYNCEVENT
public static final int ACTIVATED_BY_QCAPP
args in
activateApp(int, Object[]) will contain the command.
NOTE: This is currently not passed to Penlets;
ACTIVATED_BY_MENU is passed instead.
public static final int DEACTIVATED_BY_APPSWITCH
public static final int DEACTIVATED_BY_SHUTDOWN
public static final int DEACTIVATED_BY_SELF
Penlet
making a state change using
PenletInstance.notifyStateChange()
public static final int DEACTIVATED_BY_SYSEVENT
public static final int DEACTIVATED_BY_NOTES_MODE
public static final int DEACTIVATED_BY_MENU
public static final int DEACTIVATED_BY_SYCNEVENT
| Constructor Detail |
|---|
protected Penlet()
| Method Detail |
|---|
public final void setContext(PenletContext context)
context - the new penlet contextpublic PenletContext getContext()
null if called before the
initApp() method is invoked and after
destroyApp() is invoked.
public abstract void initApp()
throws PenletStateChangeException
PenletStateChangeException - if it cannot initialize itself.
public abstract void activateApp(int reason,
Object[] params)
reason - indicates the reason for activation. This is one of the
following constants ACTIVATED_BY_MENU,
ACTIVATED_BY_EVENT, ACTIVATED_BY_SELF
ACTIVATED_BY_SYSEVENTparams - arguments to use as part of the activation. This can be
nullpublic abstract void deactivateApp(int reason)
reason - indicates the reason for de-activation. This is one of the
following constants DEACTIVATED_BY_APPSWITCH,
DEACTIVATED_BY_SELF, DEACTIVATED_BY_SHUTDOWN
DEACTIVATED_BY_SYSEVENT
public abstract void destroyApp()
throws PenletStateChangeException
initApp() must be deallocated at this point.
PenletStateChangeException - if there was an error while
destroying the penlet and moving into the destroyed
state.public boolean canProcessOpenPaperEvents()
false then the pen will exit into notes mode just
before taps and a stroke event would be delivered. If this returns
true then the application will receive all events.
The name for this method is misleading because all events up to, but
not including, taps and stroke events are given to the application even
if this returns false. For example, pen-down, pen-up, and
region events are still delivered to the application.
This default implementation returns false.
Please see the com.livescribe.event package for more details on
events and event ordering.
com.livescribe.eventpublic long getDataLastModifiedTime()
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||