example.mmademo
Class SimplePlayerCanvas

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Canvas
          extended by example.mmademo.SimplePlayerCanvas
All Implemented Interfaces:
SimplePlayerGUI.Parent, Utils.BreadCrumbTrail, Utils.ContentHandler, Utils.Interruptable, java.lang.Runnable

public class SimplePlayerCanvas
extends javax.microedition.lcdui.Canvas
implements SimplePlayerGUI.Parent, Utils.Interruptable, Utils.ContentHandler, java.lang.Runnable

MMAPI player main window for media files, implemented as a Canvas


Field Summary
(package private)  int displayHeight
           
(package private)  int displayWidth
           
(package private)  int feedbackTop
           
(package private)  int karaokeHeight
           
(package private)  int[] karaokeParams
           
(package private)  int karaokeTop
           
(package private)  int logoTop
           
(package private)  int maxKaraokeLines
           
(package private)  int songTitleTop
           
(package private)  int statusTop
           
(package private)  int textHeight
           
(package private)  int timeRateTop
           
(package private)  int timeWidth
           
 
Fields inherited from class javax.microedition.lcdui.Canvas
DOWN, FIRE, GAME_A, GAME_B, GAME_C, GAME_D, KEY_NUM0, KEY_NUM1, KEY_NUM2, KEY_NUM3, KEY_NUM4, KEY_NUM5, KEY_NUM6, KEY_NUM7, KEY_NUM8, KEY_NUM9, KEY_POUND, KEY_STAR, LEFT, RIGHT, UP
 
Constructor Summary
SimplePlayerCanvas(java.lang.String title, Utils.BreadCrumbTrail parent)
           
 
Method Summary
 boolean canHandle(java.lang.String url)
           
 void close()
           
 void fullScreen(boolean value)
           
 javax.microedition.lcdui.Displayable getCurrentDisplayable()
           
 Utils.BreadCrumbTrail getParent()
           
 java.lang.String getTitle()
           
 javax.microedition.lcdui.Displayable go(javax.microedition.lcdui.Displayable d)
           
 javax.microedition.lcdui.Displayable goBack()
           
 void handle(java.lang.String name, java.io.InputStream is, java.lang.String contentType)
           
 void handle(java.lang.String name, javax.microedition.media.Player player)
           
 void handle(java.lang.String name, java.lang.String url)
           
protected  void keyPressed(int keycode)
           
 void paint(javax.microedition.lcdui.Graphics g)
           
 void pauseApp()
          Called in response to a request to pause the MIDlet.
 javax.microedition.lcdui.Displayable replaceCurrent(javax.microedition.lcdui.Displayable d)
           
 void resumeApp()
          Called when a MIDlet is asked to resume operations after a call to pauseApp().
 void run()
           
 void setFeedback(java.lang.String s)
           
 void setFileTitle(java.lang.String s)
           
 void setStatus(java.lang.String s)
           
 void setupDisplay()
           
 void showHelp()
          Show a page which explains the keys.
 java.lang.String toString()
           
 void updateDisplay()
           
 void updateKaraoke()
           
 void updateRate()
           
 void updateTime()
           
 
Methods inherited from class javax.microedition.lcdui.Canvas
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode, showNotify, sizeChanged
 
Methods inherited from class javax.microedition.lcdui.Displayable
addCommand, getHeight, getTicker, getWidth, isShown, removeCommand, setCommandListener, setTicker, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

displayWidth

int displayWidth

displayHeight

int displayHeight

textHeight

int textHeight

logoTop

int logoTop

songTitleTop

int songTitleTop

timeRateTop

int timeRateTop

timeWidth

int timeWidth

karaokeTop

int karaokeTop

karaokeHeight

int karaokeHeight

maxKaraokeLines

int maxKaraokeLines

feedbackTop

int feedbackTop

statusTop

int statusTop

karaokeParams

int[] karaokeParams
Constructor Detail

SimplePlayerCanvas

public SimplePlayerCanvas(java.lang.String title,
                          Utils.BreadCrumbTrail parent)
Method Detail

go

public javax.microedition.lcdui.Displayable go(javax.microedition.lcdui.Displayable d)
Specified by:
go in interface Utils.BreadCrumbTrail

goBack

public javax.microedition.lcdui.Displayable goBack()
Specified by:
goBack in interface Utils.BreadCrumbTrail

replaceCurrent

public javax.microedition.lcdui.Displayable replaceCurrent(javax.microedition.lcdui.Displayable d)
Specified by:
replaceCurrent in interface Utils.BreadCrumbTrail

getCurrentDisplayable

public javax.microedition.lcdui.Displayable getCurrentDisplayable()
Specified by:
getCurrentDisplayable in interface Utils.BreadCrumbTrail

getParent

public Utils.BreadCrumbTrail getParent()
Specified by:
getParent in interface SimplePlayerGUI.Parent

setupDisplay

public void setupDisplay()
Specified by:
setupDisplay in interface SimplePlayerGUI.Parent

getTitle

public java.lang.String getTitle()
Specified by:
getTitle in interface SimplePlayerGUI.Parent
Overrides:
getTitle in class javax.microedition.lcdui.Displayable

setStatus

public void setStatus(java.lang.String s)
Specified by:
setStatus in interface SimplePlayerGUI.Parent

setFeedback

public void setFeedback(java.lang.String s)
Specified by:
setFeedback in interface SimplePlayerGUI.Parent

setFileTitle

public void setFileTitle(java.lang.String s)
Specified by:
setFileTitle in interface SimplePlayerGUI.Parent

updateKaraoke

public void updateKaraoke()
Specified by:
updateKaraoke in interface SimplePlayerGUI.Parent

updateTime

public void updateTime()
Specified by:
updateTime in interface SimplePlayerGUI.Parent

updateRate

public void updateRate()
Specified by:
updateRate in interface SimplePlayerGUI.Parent

updateDisplay

public void updateDisplay()
Specified by:
updateDisplay in interface SimplePlayerGUI.Parent

fullScreen

public void fullScreen(boolean value)
Specified by:
fullScreen in interface SimplePlayerGUI.Parent

close

public void close()
Specified by:
close in interface Utils.ContentHandler

canHandle

public boolean canHandle(java.lang.String url)
Specified by:
canHandle in interface Utils.ContentHandler

handle

public void handle(java.lang.String name,
                   java.lang.String url)
Specified by:
handle in interface Utils.BreadCrumbTrail
Specified by:
handle in interface Utils.ContentHandler

handle

public void handle(java.lang.String name,
                   java.io.InputStream is,
                   java.lang.String contentType)

handle

public void handle(java.lang.String name,
                   javax.microedition.media.Player player)

run

public void run()
Specified by:
run in interface java.lang.Runnable

keyPressed

protected void keyPressed(int keycode)
Overrides:
keyPressed in class javax.microedition.lcdui.Canvas

paint

public void paint(javax.microedition.lcdui.Graphics g)
Specified by:
paint in class javax.microedition.lcdui.Canvas

showHelp

public void showHelp()
Show a page which explains the keys. For simplicity, the page is implemented as a list...


pauseApp

public void pauseApp()
Called in response to a request to pause the MIDlet. This implementation will just call the same method in the GUI implementation.

Specified by:
pauseApp in interface Utils.Interruptable

resumeApp

public void resumeApp()
Called when a MIDlet is asked to resume operations after a call to pauseApp(). This method is only called after pauseApp(), so it is different from MIDlet's startApp(). This implementation will just call the same method in the GUI implementation.

Specified by:
resumeApp in interface Utils.Interruptable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object