|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.livescribe.penlet.PenletPlugin
com.livescribe.penlet.AbstractPenletPlugin
com.livescribe.buttons.DrawnButtonController
public class DrawnButtonController
A plugin that manages the display, presentation, and processing of new prompt and believe buttons.
Events passed to the application and not processed by this plugin:
All other events are consumed, but nothing is actually done with them until this receives a pen-down or menu event.
| Field Summary | |
|---|---|
static long |
DEFAULT_INPUT_TIMEOUT
The default input timeout, the timeout once a user starts drawing. |
protected MediaPlayer |
mediaPlayer
|
| Fields inherited from class com.livescribe.penlet.AbstractPenletPlugin |
|---|
active, listeners |
| Constructor Summary | |
|---|---|
DrawnButtonController(Penlet penlet)
Creates a new setup button plugin. |
|
| Method Summary | |
|---|---|
void |
activate()
Activates the plugin. |
protected void |
allButtonsDone()
This is called when all the buttons have been set up. |
protected void |
buttonDone(Bookmarkable button)
Called when a button was setup successfully. |
protected Region |
createRegionFor(Bookmarkable b)
Subclasses can override this to change how regions are created for a bookmarkable item. |
void |
deactivate()
Deactivates the plugin. |
boolean |
onDocumentEvent(DocumentEvent ev)
Processes a document event. |
boolean |
onMenuEvent(MenuEvent ev)
Processes a menu event. |
boolean |
onPenTipEvent(PenTipEvent ev)
Processes a pen tip event. |
boolean |
onStrokeEvent(StrokeEvent ev)
Processes a stroke event. |
void |
setButton(Bookmarkable button)
Sets the button to set up. |
void |
setButtons(Bookmarkable[] buttons)
Sets the buttons to set up. |
void |
setInputTimeout(long time)
Sets the input timeout. |
| Methods inherited from class com.livescribe.penlet.AbstractPenletPlugin |
|---|
addPluginListener, fireActivated, fireDeactivated, isActive, onCoordinateEvent, onRegionEvent, removePluginListener, scheduleDeactivation, setConsumeAllEvents |
| Methods inherited from class com.livescribe.penlet.PenletPlugin |
|---|
getDisplay, getPenlet, restoreDisplay, saveDisplay |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long DEFAULT_INPUT_TIMEOUT
setInputTimeout(long),
Constant Field Valuesprotected MediaPlayer mediaPlayer
| Constructor Detail |
|---|
public DrawnButtonController(Penlet penlet)
penlet - the penlet| Method Detail |
|---|
public boolean onStrokeEvent(StrokeEvent ev)
onStrokeEvent in class AbstractPenletPluginev - the stroke event
true, indicating the event is handled here.AbstractPenletPlugin.setConsumeAllEvents(boolean)protected Region createRegionFor(Bookmarkable b)
This creates a new region with the bookmarkable's area ID and Z-order, and with the occlusive bit set.
b - the bookmarkable item
public boolean onPenTipEvent(PenTipEvent ev)
onPenTipEvent in class AbstractPenletPluginev - the pen tip event
true, indicating the event is handled here.AbstractPenletPlugin.setConsumeAllEvents(boolean)public boolean onMenuEvent(MenuEvent ev)
onMenuEvent in class AbstractPenletPluginev - the menu event
AbstractPenletPlugin.setConsumeAllEvents(boolean)public boolean onDocumentEvent(DocumentEvent ev)
onDocumentEvent in class AbstractPenletPluginev - the document event
AbstractPenletPlugin.setConsumeAllEvents(boolean)
public void activate()
throws PenletStateChangeException
The plugin is automatically deactivated when it is finished.
activate in class AbstractPenletPluginPenletStateChangeException - if the buttons were not set.setButton(Bookmarkable),
setButtons(Bookmarkable[]),
Display.setTransition(Transition)public void deactivate()
deactivate in class AbstractPenletPluginAbstractPenletPlugin.active,
AbstractPenletPlugin.fireDeactivated()public final void setButton(Bookmarkable button)
IllegalStateException.
If the parameter is null then the plugin will not be
activatable.
If the button's
displayable user prompt
returns null then then a default one will be used.
Additionally, if the
display name is
null then the localized version of the word "BUTTON" wlil
be used.
button - the parameters for a single button
java.lang.IllegalStateException - if the plugin is currently active.setButtons(Bookmarkable[])public final void setButtons(Bookmarkable[] buttons)
IllegalStateException.
Each button will be set up, one after the other. Note that the array is used as-is internally and is not copied.
If the buttons parameter is null or of zero
length then the plugin will not be activatable.
If any button's
displayable user prompt
returns null then then a default one will be used.
Additionally, if the
display name is
null then the localized version of the word "BUTTON" wlil
be used.
buttons - the list of Bookmarkable button parameters
IllegalArgumentException - if the arrays are not the same length.
java.lang.IllegalStateException - if the plugin is currently active.protected void buttonDone(Bookmarkable button)
This implementation just plays the acknowledge sound.
button - the button that was just completedprotected void allButtonsDone()
This implementation simply calls deactivate().
public final void setInputTimeout(long time)
The timeout is disabled if the time is ≤ zero. The default is for the timeout is one second.
time - the input timeout, in millisecondsDEFAULT_INPUT_TIMEOUT
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||