PenProfile 2.x

com.livescribe.buttons
Class ButtonPABDisplay

java.lang.Object
  extended by com.livescribe.display.Displayable
      extended by com.livescribe.display.Canvas
          extended by com.livescribe.buttons.ButtonPABDisplay

public class ButtonPABDisplay
extends Canvas

This can display a configurable text button. The configurable options include:

Since:
2.3
See Also:
DrawnButtonController.setButton(Bookmarkable)

Constructor Summary
ButtonPABDisplay(AttributedText text)
          Creates a new Prompt and Believe display having the specified attributed text.
ButtonPABDisplay(AttributedText text, Image icon)
          Creates a new Prompt and Believe display having the specified attributed text and icon.
ButtonPABDisplay(String text)
          Creates a new Prompt and Believe display having the specified text.
ButtonPABDisplay(String text, Image icon)
          Creates a new Prompt and Believe display having the specified text and icon.
 
Method Summary
protected  void notifyHidden(Display d)
          Stops the animation when this hidden.
protected  void notifyShown(Display d)
          This is called when this object has become the current thing on the display.
protected  void paint(Graphics g)
          Paints the component.
 void setAudio(String audio, MediaPlayer player)
          Sets the audio and media player to use for playing the audio.
 void setBoxLineStyle(int style)
          Sets the style of the box drawn around the button.
 void setFont(Font font)
          Sets the text's font.
 void stopAnimation()
          Stop the animation
 
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
 

Constructor Detail

ButtonPABDisplay

public ButtonPABDisplay(String text)
Creates a new Prompt and Believe display having the specified text.

Parameters:
text - the button text

ButtonPABDisplay

public ButtonPABDisplay(String text,
                        Image icon)
Creates a new Prompt and Believe display having the specified text and icon.

Parameters:
text - the button text
icon - the button icon

ButtonPABDisplay

public ButtonPABDisplay(AttributedText text)
Creates a new Prompt and Believe display having the specified attributed text.

Parameters:
text - the button text
See Also:
AttributedText.parseEnriched(String, Font)

ButtonPABDisplay

public ButtonPABDisplay(AttributedText text,
                        Image icon)
Creates a new Prompt and Believe display having the specified attributed text and icon.

Parameters:
text - the button text
icon - the button icon
See Also:
AttributedText.parseEnriched(String, Font)
Method Detail

setAudio

public void setAudio(String audio,
                     MediaPlayer player)
Sets the audio and media player to use for playing the audio. If either are set to null then no audio will be played.

Parameters:
audio - the audio to play when the button is shown
player - use this MediaPlayer

setFont

public void setFont(Font font)
Sets the text's font. If it is not set or set to null then a default font will be used.

The default is "Verdana", bold, and medium size.

Parameters:
font - the new font
See Also:
Font

setBoxLineStyle

public void setBoxLineStyle(int style)
Sets the style of the box drawn around the button. This should be set to one of the Graphics.LINE_STYLE_XXX constants.

The default is solid.

Parameters:
style - the new text style
See Also:
Graphics.LINE_STYLE_SOLID, Graphics.LINE_STYLE_DOTTED, Graphics.LINE_STYLE_INVISIBLE

notifyShown

protected void notifyShown(Display d)
This is called when this object has become the current thing on the display. Any audio is played and the box animation is started.

Overrides:
notifyShown in class Displayable
Parameters:
d - the Display

notifyHidden

protected void notifyHidden(Display d)
Stops the animation when this hidden.

Overrides:
notifyHidden in class Displayable
Parameters:
d - hidden from this display

stopAnimation

public void stopAnimation()
Stop the animation


paint

protected void paint(Graphics g)
Paints the component.

Specified by:
paint in class Displayable
Parameters:
g - the graphics context

PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.