|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.livescribe.display.Displayable
com.livescribe.display.BrowseList
public class BrowseList
BrowseList is a UI component that enables a penlet to display
a list of items and provide user navigation within the list. Only one item is
visible at a time in the pen display, and the user can move up or down
through the items. A BrowseList is constructed with a vector
of String or BrowseList.Item objects. The vector serves as the
data model for the browse list.
A BrowseList can optionally have a BrowseList.Title, which is
visible the first time the component is displayed. The title indicates what
kind of items the browse list contains. The user selects the title in order
to access the items in the browse list.
The methods focusToNext() and focusToPrevious() move the
focus to the next or the previous item, respectively.
Display| Nested Class Summary | |
|---|---|
protected static class |
BrowseList.Insets
Insets defines the decoration region for a menu item and
the title for the BrowseList. |
static interface |
BrowseList.Item
The Item interface describes an item in a
BrowseList. |
static class |
BrowseList.Title
Title encapsulates the title for a browse list. |
| Field Summary | |
|---|---|
protected int |
focusIndex
|
protected BrowseList.Insets |
insets
Represents the borders for the item content. |
protected Vector |
itemModel
|
| Constructor Summary | |
|---|---|
BrowseList()
Deprecated. |
|
BrowseList(Vector itemModel)
Constructs a BrowseList with item model and no title. |
|
BrowseList(Vector itemModel,
BrowseList.Title title)
Constructs a BrowseList with item model and and a title. |
|
BrowseList(Vector itemModel,
BrowseList.Title title,
MediaPlayer player)
Constructs a BrowseList with an item model, a title, and a
media player. |
|
| Method Summary | |
|---|---|
protected void |
drawDecorations(Graphics g,
BrowseList.Item item)
Draws the decoration for the Item passed on to the
Graphics. |
protected void |
drawItem(Graphics g,
BrowseList.Item item,
Image icon,
Object text,
int x,
int y)
Renders the item contents on the graphics. |
void |
enableFlickScrub(boolean enable)
Flick n Scrub should be disabled if you want to process hand writting recognition while this controll is visible |
void |
flickHorizontally(int deltaX)
|
void |
flickVertically(int deltaY)
|
int |
focusToNext()
Scrolls this BrowseList to display the item after the
current one |
int |
focusToPrevious()
Scrolls this BrowseList to display the item before the
current one. |
int |
getFocusIndex()
Gets the index of the item that currently has focus. |
Object |
getFocusItem()
Gets the item that currently has focus. |
protected BrowseList.Item |
getItemAt(int index,
com.livescribe.display.BrowseList.ItemHolder textItem)
|
int |
getItemCount()
Gets the number of items in this browse list. |
boolean |
isHorizontalFlickScrubEnabled()
|
boolean |
isVerticalFlickScrubEnabled()
|
boolean |
isWrapAroundEnabled()
Indicates if wrap-around is enabled or not. |
protected void |
notifyHidden(Display d)
This is invoked by the system to notify this Displayable
when it is not current. |
protected void |
notifyShown(Display d)
This is invoked by the system to notify this Displayable
when it has become current. |
protected void |
notifySystemTrayHidden()
This is invoked by the system to notify the Displayable when
the system tray has been hidden. |
protected void |
notifySystemTrayShown()
This is invoked by the system to notify the Displayable when
the system tray has been displayed. |
protected void |
paint(Graphics g)
Invoked by the system to allow the Displayable to render
contents using the graphics context. |
protected void |
paintList(Graphics g)
|
protected void |
renderInitialView()
|
protected void |
scrollItem(Graphics graphics,
ScrollLabel scroller,
BrowseList.Item item,
int x,
int y)
Renders the item contents on the graphics and use the
scroller to scroll the textual content of the
item. |
void |
scrubHorizontally(int deltaX)
|
void |
scrubVertically(int deltaY)
|
void |
setFocusItem(int index)
Sets the focus to the item specified by the index. |
protected void |
setInsets(BrowseList.Insets insets)
Set the Insets for the decoration. |
protected void |
setScrollerClipRegion(ScrollLabel scroller,
short x,
short y,
short width,
short height)
Sets the clip region for the scroller. |
protected void |
showScroller()
|
| Methods inherited from class com.livescribe.display.Displayable |
|---|
getSurface, isCurrent |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Vector itemModel
protected int focusIndex
protected BrowseList.Insets insets
| Constructor Detail |
|---|
public BrowseList()
public BrowseList(Vector itemModel)
BrowseList with item model and no title.
itemModel - a Vector of String or
BrowseList.Item objects.
public BrowseList(Vector itemModel,
BrowseList.Title title)
BrowseList with item model and and a title.
itemModel - a Vector of String or
BrowseList.Item objects.title - a BrowseList.Title that provides a title for the
BrowseList.
public BrowseList(Vector itemModel,
BrowseList.Title title,
MediaPlayer player)
BrowseList with an item model, a title, and a
media player. The specified media player should be used instead of a new
player.
itemModel - a Vector of String or
BrowseList.Item objects.title - a player - a MediaPlayer object to use for playing audio
associated with the browse list items.| Method Detail |
|---|
protected final void setInsets(BrowseList.Insets insets)
Insets for the decoration. The default value for
the insets is BrowseList.Insets.DEFAULT
insets - the insets to set. If this value is null then
the current insets is not changed.public Object getFocusItem()
BrowseList.Item.public void setFocusItem(int index)
index - index of the item within the item model of this
BrowseList. This should be
>= 0 && < itemModel.size().public int getItemCount()
setFocusItem(int).
setFocusItem(int)public int getFocusIndex()
BrowseList is not set on the Display
object.)public int focusToPrevious()
BrowseList to display the item before the
current one.
public int focusToNext()
BrowseList to display the item after the
current one
protected void notifyHidden(Display d)
DisplayableDisplayable
when it is not current. Overriding methods should call
super.notifyHidden(d) before its own implementation.
Failure to do this could result in unknown behavior.
notifyHidden in class Displayabled - The Display on which this Displayale was
currentprotected void notifyShown(Display d)
DisplayableDisplayable
when it has become current. Overriding methods should call
super.notifyShown(d) before its own implementation.
Failure to do this could result in unknown behavior.
notifyShown in class Displayabled - The Display on which this Displayale is
currentprotected void paintList(Graphics g)
protected void renderInitialView()
protected BrowseList.Item getItemAt(int index,
com.livescribe.display.BrowseList.ItemHolder textItem)
protected void showScroller()
protected void drawItem(Graphics g,
BrowseList.Item item,
Image icon,
Object text,
int x,
int y)
graphics.
This is invoked to render the menu item during the up/down transition. The implementation draws the item's icon at the left and the textual content following the icon to the right.
This method can be overriden to provide alternate rendering of the item's
content. If this is overriden then the companion method
scrollItem(Graphics, ScrollLabel, Item, int, int) must also be
overriden.
g - graphics to render the item contentsitem - item to rendericon - item's icontext - item's textx - x coordinate to drawy - y coordinate to drawscrollItem(Graphics, ScrollLabel, Item, int, int)
protected void scrollItem(Graphics graphics,
ScrollLabel scroller,
BrowseList.Item item,
int x,
int y)
graphics and use the
scroller to scroll the textual content of the
item.
This is invoked to render the menu item after the up/down transition is completed. The implementation draws the item's icon at the left and scrolls the textual content following the icon to the right.
This method can be overriden to provide alternate rendering of the item's
content. If this is overriden then the companion method
drawItem(Graphics, Item, Image, Object, int, int) must also be
overriden.
graphics - scroller - UI component that allows for text scrolling. The graphics
associated with the scroller points to the same drawing surface
as the graphics parameter.item - x - y - drawItem(Graphics, Item, Image, Object, int, int)
protected final void setScrollerClipRegion(ScrollLabel scroller,
short x,
short y,
short width,
short height)
scrollItem(Graphics, ScrollLabel, Item, int, int) implementation
to set a region within the viewport for text scrolling.
scroller - scoller UI component.x - clip x coordinatey - clip y coordinatewidth - clip widthheight - clip heightpublic boolean isWrapAroundEnabled()
BrowseList(Vector, Title, boolean).
true if wrap-around is enabled; false
if wrap-around is disabled.protected void notifySystemTrayHidden()
DisplayableDisplayable when
the system tray has been hidden.
The default implementation would schedule a paint call that allows the
Displayable to render to the full screen.
notifySystemTrayHidden in class Displayableprotected void notifySystemTrayShown()
DisplayableDisplayable when
the system tray has been displayed.
notifySystemTrayShown in class Displayable
protected void drawDecorations(Graphics g,
BrowseList.Item item)
Item passed on to the
Graphics. The implementation is as follows
if ( there are no insets ) {
return;
}
if ( the item is selectable ) {
draw right decoration (arrow)
}
if ( wrap around is set ) {
draw top and bottom decoration (arrows)
}
else {
if ( item is the last one ) {
draw decoration for last item marker
}
else {
draw bottom decoration (arrow)
}
if ( item is the first one ) {
draw decoration for first item marker
}
else {
draw top decoration (arrow)
}
}
Subclasses should override this method if they want to provide alternate decorations.
g - graphics to draw the decorationsitem - item that is in focusprotected void paint(Graphics g)
DisplayableDisplayable to render
contents using the graphics context.
paint in class Displayableg - the Graphics context to be used to render on the Displayable.public void scrubVertically(int deltaY)
scrubVertically in interface VerticalFlickScrubpublic void flickVertically(int deltaY)
flickVertically in interface VerticalFlickScrubpublic void enableFlickScrub(boolean enable)
enable - public boolean isVerticalFlickScrubEnabled()
isVerticalFlickScrubEnabled in interface VerticalFlickScrubpublic void scrubHorizontally(int deltaX)
scrubHorizontally in interface HorizontalFlickScrubpublic void flickHorizontally(int deltaX)
flickHorizontally in interface HorizontalFlickScrubpublic boolean isHorizontalFlickScrubEnabled()
isHorizontalFlickScrubEnabled in interface HorizontalFlickScrub
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||