com.sun.perseus.demo.picturedecorator
Class ItemPicker

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Canvas
          extended by com.sun.perseus.demo.picturedecorator.ItemPicker

public class ItemPicker
extends javax.microedition.lcdui.Canvas

The ItemPicker canvas creates thumbnails of the various props from its associated props images and displays them in a grid. The user can use the arrow keys to select a thumbnail (which gets highlighted) and use the fire button to select the desired item or the '*' key to cancel the picker.


Field Summary
static java.lang.String SVG_NAMESPACE_URI
          The SVG Namespace URI.
static int THUMBNAIL_HEIGHT
          Desired thumbnail height
static int THUMBNAIL_PADDING
          The desired padding for each thumbnail
static int THUMBNAIL_WIDTH
          Desired thumbnail width
static java.lang.String XLINK_NAMESPACE_URI
          The XLink Namespace URI.
 
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
ItemPicker(PhotoFrame frame, javax.microedition.m2g.SVGImage svgImage, javax.microedition.lcdui.Display display)
           
 
Method Summary
 void keyPressed(int keyCode)
           
(package private) static org.w3c.dom.svg.SVGRect pad(org.w3c.dom.svg.SVGRect bbox)
          Helper method.
 void paint(javax.microedition.lcdui.Graphics g)
          Repaints this canvas with the current item selected.
 
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, getTitle, getWidth, isShown, removeCommand, setCommandListener, setTicker, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SVG_NAMESPACE_URI

public static final java.lang.String SVG_NAMESPACE_URI
The SVG Namespace URI.

See Also:
Constant Field Values

XLINK_NAMESPACE_URI

public static final java.lang.String XLINK_NAMESPACE_URI
The XLink Namespace URI.

See Also:
Constant Field Values

THUMBNAIL_WIDTH

public static final int THUMBNAIL_WIDTH
Desired thumbnail width

See Also:
Constant Field Values

THUMBNAIL_HEIGHT

public static final int THUMBNAIL_HEIGHT
Desired thumbnail height

See Also:
Constant Field Values

THUMBNAIL_PADDING

public static final int THUMBNAIL_PADDING
The desired padding for each thumbnail

See Also:
Constant Field Values
Constructor Detail

ItemPicker

public ItemPicker(PhotoFrame frame,
                  javax.microedition.m2g.SVGImage svgImage,
                  javax.microedition.lcdui.Display display)
Parameters:
frame - the associated PhotoFrame instance.
svgImage - the svgImage where items are defined.
display - the SVGImage containing all the props definitions.
Method Detail

keyPressed

public void keyPressed(int keyCode)
Overrides:
keyPressed in class javax.microedition.lcdui.Canvas

paint

public void paint(javax.microedition.lcdui.Graphics g)
Repaints this canvas with the current item selected.

Specified by:
paint in class javax.microedition.lcdui.Canvas
Parameters:
g - the Graphics to paint into.

pad

static org.w3c.dom.svg.SVGRect pad(org.w3c.dom.svg.SVGRect bbox)
Helper method. Pads the input bounding box.

Parameters:
bbox - the box to pad.