|
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.Canvas
com.livescribe.ui.ScrollLabel
public class ScrollLabel
ScrollLabel allows both text and images to be displayed on the
screen. It also supports scrolling of the content horizontally.
| Field Summary | |
|---|---|
static long |
DEFAULT_ANIMATION_DELAY
Default animation delay : Set to 50L |
static int |
DEFAULT_SHIFT_WIDTH
Default Shift Width in pixels : Set to 1 Number of pixels to shift while scrolling |
static int |
DEFAULT_SPACE_WIDTH
Default Space Width in pixels : Set to 10 Space between the end of the content and the start of the content while scrolling. |
protected int |
displayableWidth
|
protected Font |
font
|
static int |
SCROLL_UNIT_MILLIS
|
protected int |
shiftWidth
Number of pixels to shift while scrolling |
protected int |
spaceWidth
Space between the end of the content and the start of the content while scrolling. |
protected Timer |
timer
|
| Constructor Summary | |
|---|---|
ScrollLabel()
Construct ScrollLable
This constructs a ScrollLabel with the following defaults
Animation delay : Repaint delay is set at 50L
Space Width : width in terms of pixels that is used to space
the end of the content and the beginning of the content while
scrolling is set to 10
Shift Width : This is the width in terms of pixels that is used to
shift the contents of the label is set to 1 |
|
ScrollLabel(long animDelay,
int spaceWidth,
int shiftWidth)
Construct TextOutput |
|
| Method Summary | |
|---|---|
protected void |
cancelFlickRepaintTask()
|
protected void |
cancelRepaintTask()
|
void |
draw(AttributedText attrText,
boolean scroll)
Draws the attributed text on the label. |
void |
draw(AttributedText attrText,
Image image,
int x,
int y,
int width,
int height,
boolean scroll)
|
void |
draw(DisplayableResource res)
Draw a DisplayableResource on the Scroll Label |
void |
draw(DisplayableResource res,
boolean scroll)
Draw a DisplayableResource on the Scroll Label and specify if it needs to be scrolled |
void |
draw(DisplayableResource res,
int x,
int y,
boolean scroll)
|
void |
draw(DisplayableResource res,
int x,
int y,
int width,
int height,
boolean scroll)
|
void |
draw(Image image,
String text,
boolean scroll)
Draws the image followed by the text. |
void |
draw(Image image,
String text,
int x,
int y,
int width,
int height,
boolean scroll)
Draws the image and the text at the specified x,y, width and height |
void |
draw(String text)
Draw the text without scrolling. |
void |
draw(String text,
boolean scroll)
Draw the text. |
void |
draw(String text,
Image image,
boolean scroll)
Draws the text followed by the image. |
void |
draw(String text,
Image image,
int x,
int y,
int width,
int height,
boolean scroll)
Draws the text and the image at the specified x,y, width and height |
void |
draw(String text,
int x,
int y,
boolean scroll)
|
void |
draw(String text,
int x,
int y,
int width,
int height,
boolean scroll)
|
void |
drawRightJustified(AttributedText attrText)
|
void |
drawRightJustified(String text)
Draws the text with the alignment at the right |
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)
|
protected int |
getContentWidth()
|
protected int |
getOffset()
|
protected int |
getShiftWidth()
|
protected int |
getViewportWidth()
|
boolean |
hasScrollableContent()
Indicates if the content that is supposed to be rendered by the label is scrollable or not. |
boolean |
isHorizontalFlickScrubEnabled()
|
protected boolean |
isPauseEnabled()
|
protected boolean |
isWrapEnabled()
|
protected void |
notifyHidden(Display d)
When called indicates that this Displayable is no longer
shown on the display device due to another Displayable being
set to current. |
protected boolean |
notifyScrollingPausedAtEnd()
If the label scrolls content, this method would be called when the content is paused at the end. |
protected boolean |
notifyScrollingPausedAtStart()
If the label scrolls content, this method would be called when the content is paused at the start. |
protected void |
notifyShown(Display d)
When called by the system indicates that this Canvas is
current. |
protected boolean |
onResize(int w)
|
protected void |
paint(Graphics g)
Invoked by the system to allow the Displayable to render
contents using the graphics context. |
protected void |
scheduleFlickRepaintTask()
|
protected void |
scheduleRepaintTask()
|
void |
scrubHorizontally(int deltaX)
|
protected void |
setContent(AttributedText attrText,
Image image,
int x,
int y,
int width,
int height,
boolean scroll,
boolean renderTextFirst)
Creates scrolling data or fixed data or both with the following params |
void |
setFont(Font font)
|
protected void |
setViewportWidth(int width)
Sets the width of the viewport which is the entire scrollable region of data that is viewed through a window. |
void |
stopScrolling()
Stops the scrolling of content if the label is currently scrolling. |
| Methods inherited from class com.livescribe.display.Canvas |
|---|
repaint |
| Methods inherited from class com.livescribe.display.Displayable |
|---|
getSurface, isCurrent, notifySystemTrayHidden, notifySystemTrayShown |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long DEFAULT_ANIMATION_DELAY
public static final int DEFAULT_SPACE_WIDTH
public static final int DEFAULT_SHIFT_WIDTH
public static final int SCROLL_UNIT_MILLIS
protected Timer timer
protected int spaceWidth
protected int shiftWidth
protected Font font
protected int displayableWidth
| Constructor Detail |
|---|
public ScrollLabel()
ScrollLable
This constructs a ScrollLabel with the following defaults
Animation delay : Repaint delay is set at 50L
Space Width : width in terms of pixels that is used to space
the end of the content and the beginning of the content while
scrolling is set to 10
Shift Width : This is the width in terms of pixels that is used to
shift the contents of the label is set to 1
public ScrollLabel(long animDelay,
int spaceWidth,
int shiftWidth)
TextOutput
animDelay - animation delay in milliseconds. This is used when the
text is scrolled.spaceWidth - this is width in terms of pixels that is used to space
the end of the content and the beginning of the content while
scrollingshiftWidth - this is the width in terms of pixels that is used to
shift the contents of the label.| Method Detail |
|---|
protected int getOffset()
protected int getContentWidth()
protected int getViewportWidth()
protected boolean isPauseEnabled()
protected boolean isWrapEnabled()
protected 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.protected void setViewportWidth(int width)
width - this is width of the viewportpublic void drawRightJustified(AttributedText attrText)
public void drawRightJustified(String text)
text - text that needs to be displayed on the scroll label
public void draw(AttributedText attrText,
boolean scroll)
attrText - attributed text to drawscroll - true scroll the attributed text if it spans
out of the viewport and false not to scroll.public void draw(DisplayableResource res)
DisplayableResource on the Scroll Label
res - - The DisplayableResource that needs to be renderedpublic void draw(String text)
draw(text, false).
text - text to render
public void draw(DisplayableResource res,
boolean scroll)
DisplayableResource on the Scroll Label and specify if it needs to be scrolled
res - - The DisplayableResource that needs to be renderedscroll - indicates if the text has to be scrolled or not. It does
not have any effect of the text fits within the display size.
true if it needs to scroll and false otherwise
public void draw(String text,
boolean scroll)
text - text to renderscroll - indicates if the text has to be scrolled or not. It does
not have any effect of the text fits within the display size.
true if it needs to scroll and false otherwise
public void draw(DisplayableResource res,
int x,
int y,
boolean scroll)
res - - The DisplaybleResource that needs to be renderedx - - The 'x' coordinatey - - The 'y' coordinatescroll - true if it needs to scroll and false otherwise
public void draw(String text,
int x,
int y,
boolean scroll)
text - - The text that needs to be renderedx - - The 'x' coordinatey - - The 'y' coordinatescroll - true if it needs to scroll and false otherwise
public void draw(DisplayableResource res,
int x,
int y,
int width,
int height,
boolean scroll)
res - - The DisplaybleResource that needs to be renderedx - - The 'x' coordinatey - - The 'y' coordinatewidth - - draw with the specified widthheight - - draw with the specified heightscroll - true if it needs to scroll and false otherwise
public void draw(String text,
int x,
int y,
int width,
int height,
boolean scroll)
text - the text that needs to be renderedx - the 'x' coordinatey - the 'y' coordinatewidth - draw with the specified widthheight - draw with the specified heightscroll - true if it needs to scroll and false otherwise
public void draw(String text,
Image image,
boolean scroll)
text - text to renderimage - image to renderscroll - indicates if the text and image has to be scrolled or not.
It does not have any effect of the text and image fits within the
display size.
public void draw(Image image,
String text,
boolean scroll)
text - text to renderimage - image to renderscroll - indicates if the text and image has to be scrolled or not.
It does not have any effect of the text and image fits within the
display size.
public void draw(String text,
Image image,
int x,
int y,
int width,
int height,
boolean scroll)
text - to renderimage - to renderx - draw at the specified x valuey - draw at the specified y valuewidth - draw with the specified widthheight - draw with the specified heightscroll - indicates if the text and image has to be scrolled or not.
public void draw(AttributedText attrText,
Image image,
int x,
int y,
int width,
int height,
boolean scroll)
public void draw(Image image,
String text,
int x,
int y,
int width,
int height,
boolean scroll)
image - to rendertext - to renderx - draw at the specified x valuey - draw at the specified y valuewidth - draw with the specified widthheight - draw with the specified heightscroll - indicates if the text and image has to be scrolled or not.public void setFont(Font font)
public final boolean hasScrollableContent()
notifyScrollingPausedAtStart() and
notifyScrollingPausedAtEnd() are delivered only if this returns
true
true if the content is scrollable and
false if the content is static and not scrollablepublic void stopScrolling()
protected void setContent(AttributedText attrText,
Image image,
int x,
int y,
int width,
int height,
boolean scroll,
boolean renderTextFirst)
attrText - text to renderimage - image to renderx - draw at the specified x valuey - draw at the specified y valuewidth - draw with the specified widthheight - draw with the specified heightscroll - indicates if the text and image has to be scrolled or not.renderTextFirst - if the text shall be rendered firstprotected boolean onResize(int w)
protected void notifyShown(Display d)
Canvas is
current.
notifyShown in class Displayabled - The Display on which this Canvas is
current.protected void notifyHidden(Display d)
Displayable is no longer
shown on the display device due to another Displayable being
set to current.
notifyHidden in class Displayabled - The Display on which this Canvas is
current.protected void cancelRepaintTask()
protected void scheduleRepaintTask()
protected boolean notifyScrollingPausedAtStart()
true if scrolling should terminate and
false (the default) if scrolling should continue
after pausing.protected boolean notifyScrollingPausedAtEnd()
true if scrolling should terminate and
false (the default) if scrolling should continue
after pausing.public void scrubHorizontally(int deltaX)
scrubHorizontally in interface HorizontalFlickScrubpublic void flickHorizontally(int deltaX)
flickHorizontally in interface HorizontalFlickScrubpublic void enableFlickScrub(boolean enable)
enable - public boolean isHorizontalFlickScrubEnabled()
isHorizontalFlickScrubEnabled in interface HorizontalFlickScrubprotected int getShiftWidth()
protected void scheduleFlickRepaintTask()
protected void cancelFlickRepaintTask()
|
PenProfile 2.x | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||