com.sun.perseus.demo.picturedecorator
Class PictureDecorator

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by com.sun.perseus.demo.picturedecorator.PictureDecorator
All Implemented Interfaces:
javax.microedition.lcdui.CommandListener

public class PictureDecorator
extends javax.microedition.midlet.MIDlet
implements javax.microedition.lcdui.CommandListener

The PictureDecorator application is a small example of how SVG images can be layered on top of photo images (i.e., images taken with a camera). The image and the SVG overlays could be bundled and sent to another phone, given the proper messaging capabilities of a phone.

Note that this example creates a single photo frame. If the user interface were enhanced, the user could be maintaining several photoframes in a small library.


Field Summary
(package private)  javax.microedition.lcdui.Display display
          The current display.
protected  SplashCanvas splashCanvas
          The splash Canvas.
 
Constructor Summary
PictureDecorator()
          Constructs a new PictureDecorator application.
 
Method Summary
 void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
          Handle the soft-button menu commands.
protected  void destroyApp(boolean unconditional)
          Destroy the photoframe and do some clean-up.
 javax.microedition.lcdui.Image getImage(java.lang.String property)
          Returns the image associated with name.
 java.lang.String getImageName(java.lang.String property)
          Returns the name of the image associated with name.
 javax.microedition.m2g.SVGImage getSVGImage(java.lang.String path)
          Returns the SVG image from the given resource name.
protected  void pauseApp()
          Pause the demo.
protected  void startApp()
          Start the demo!
 
Methods inherited from class javax.microedition.midlet.MIDlet
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

display

javax.microedition.lcdui.Display display
The current display.


splashCanvas

protected SplashCanvas splashCanvas
The splash Canvas. May be null.

Constructor Detail

PictureDecorator

public PictureDecorator()
Constructs a new PictureDecorator application.

Method Detail

startApp

protected void startApp()
Start the demo!

Specified by:
startApp in class javax.microedition.midlet.MIDlet

pauseApp

protected void pauseApp()
Pause the demo. Nothing needs to be paused in this application.

Specified by:
pauseApp in class javax.microedition.midlet.MIDlet

destroyApp

protected void destroyApp(boolean unconditional)
Destroy the photoframe and do some clean-up.

Specified by:
destroyApp in class javax.microedition.midlet.MIDlet

getImageName

public java.lang.String getImageName(java.lang.String property)
Returns the name of the image associated with name.

Returns:
The name of the image or null if a match for name could not be found.

getImage

public javax.microedition.lcdui.Image getImage(java.lang.String property)
Returns the image associated with name.

Returns:
The image.

getSVGImage

public javax.microedition.m2g.SVGImage getSVGImage(java.lang.String path)
Returns the SVG image from the given resource name.

Returns:
The SVG image.

commandAction

public void commandAction(javax.microedition.lcdui.Command c,
                          javax.microedition.lcdui.Displayable d)
Handle the soft-button menu commands.

Specified by:
commandAction in interface javax.microedition.lcdui.CommandListener
Parameters:
c - The command that as issued.
d - The displayable associated with the command.