|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.microedition.lcdui.Displayable
javax.microedition.lcdui.Canvas
com.sun.perseus.demo.picturedecorator.PhotoFrame
public class PhotoFrame
The photo frame represents a single photo with SVG overlays.
Field Summary | |
---|---|
(package private) javax.microedition.lcdui.Image |
currentImage
The current background image. |
(package private) int |
cursorX
The crosshair cursor's horizontal position. |
(package private) int |
cursorY
The crosshair cursor's vertical position. |
(package private) org.w3c.dom.Document |
doc
The SVG document. |
(package private) ItemPicker |
itemPicker
The ItemPicker canvas. |
(package private) int |
photoNumber
The current photo number. |
(package private) org.w3c.dom.svg.SVGLocatableElement |
prop
The current prop. |
protected javax.microedition.m2g.ScalableGraphics |
sg
The scalable graphics instance used for rendering. |
(package private) javax.microedition.lcdui.Command |
showItemPicker
The ItemPicker command. |
(package private) org.w3c.dom.svg.SVGSVGElement |
svg
The |
java.lang.String |
SVG_NAMESPACE_URI
The namespace for the svg document. |
(package private) javax.microedition.m2g.SVGImage |
svgImage
The current SVG image. |
(package private) java.util.Vector |
visibleProps
The list of props that have been placed and can be picked up. |
static java.lang.String |
XLINK_NAMESPACE_URI
The namespace for xlink:href |
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 | |
---|---|
PhotoFrame(PictureDecorator main)
Constructs a new photo frame. |
Method Summary | |
---|---|
void |
addProp(java.lang.String id)
Adds the prop referenced by id in the library. |
void |
addProp(org.w3c.dom.svg.SVGLocatableElement newProp)
Adds the prop to the SVG document. |
void |
keyPressed(int keyCode)
Handle a keypress. |
void |
keyRepeated(int keyCode)
Repeat a keypress. |
(package private) static void |
locateProps(org.w3c.dom.svg.SVGElement parent,
int level,
int defs,
java.util.Vector hiddens,
java.util.Vector visibles)
Walk the current parent node downward to find all "hiddens" (The SVG elements within a |
void |
mirrorProp(org.w3c.dom.svg.SVGLocatableElement prop,
boolean flipHorizontal)
Mirrors the prop about the horizontal or vertical axis. |
void |
paint(javax.microedition.lcdui.Graphics g)
Paint the photo in the back, then layer all SVG images on top. |
void |
removeProp()
Removes the current prop if it is displayed. |
void |
rotateProp(org.w3c.dom.svg.SVGLocatableElement prop,
float angle)
Rotates the prop by the given angle. |
void |
scaleProp(org.w3c.dom.svg.SVGLocatableElement prop,
float scale)
Scales the prop by the given scale. |
void |
setPhoto(int number)
Establishes the current background photo. |
void |
setPropsLibrary(javax.microedition.m2g.SVGImage image)
Establishes the current prop library, which holds definitions of props in its |
void |
translateProp(org.w3c.dom.svg.SVGLocatableElement prop,
float dx,
float dy)
Translate the prop by the given horizontal and vertical distances. |
Methods inherited from class javax.microedition.lcdui.Canvas |
---|
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyReleased, 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 |
---|
public static final java.lang.String XLINK_NAMESPACE_URI
public final java.lang.String SVG_NAMESPACE_URI
protected javax.microedition.m2g.ScalableGraphics sg
int photoNumber
javax.microedition.lcdui.Image currentImage
javax.microedition.m2g.SVGImage svgImage
org.w3c.dom.Document doc
org.w3c.dom.svg.SVGSVGElement svg
org.w3c.dom.svg.SVGLocatableElement prop
java.util.Vector visibleProps
int cursorX
int cursorY
ItemPicker itemPicker
javax.microedition.lcdui.Command showItemPicker
Constructor Detail |
---|
public PhotoFrame(PictureDecorator main)
Method Detail |
---|
public void setPhoto(int number)
number
- The number of the photo in the JAD file.public void setPropsLibrary(javax.microedition.m2g.SVGImage image)
When a prop is used on the display, a <use>
element is
inserted into the library, effectively making the prop available for
display.
image
- The SVG image containing the prop definitions. The image may
also contain elements that are statically positioned.static void locateProps(org.w3c.dom.svg.SVGElement parent, int level, int defs, java.util.Vector hiddens, java.util.Vector visibles)
parent
- The relative parent node.level
- The nesting level (0..n).defs
- The hiddens
- The list of elements with IDs within a visibles
- The list of elements outside a public void addProp(java.lang.String id)
id
in the library.
id
- The identifier of the prop within a <defs>
section of the library.public void addProp(org.w3c.dom.svg.SVGLocatableElement newProp)
newProp
- The prop to be added.public void removeProp()
public void translateProp(org.w3c.dom.svg.SVGLocatableElement prop, float dx, float dy)
dx
- The horizontal distance to move the prop.dy
- The vertical distance to move the prop.public void scaleProp(org.w3c.dom.svg.SVGLocatableElement prop, float scale)
scale
- The scaling factor to be applied to the prop.public void rotateProp(org.w3c.dom.svg.SVGLocatableElement prop, float angle)
angle
- The angle by which the prop will be rotated.public void mirrorProp(org.w3c.dom.svg.SVGLocatableElement prop, boolean flipHorizontal)
prop
- The angle by which the image will be rotated.flipHorizontal
- true
if mirroring will be about the
vertical axis; false
if mirroring will be about the
horizontal axis.public void keyPressed(int keyCode)
keyPressed
in class javax.microedition.lcdui.Canvas
keyCode
- The code for the key that was pressed.public void keyRepeated(int keyCode)
keyRepeated
in class javax.microedition.lcdui.Canvas
keyCode
- The code for the key that was pressed.public void paint(javax.microedition.lcdui.Graphics g)
paint
in class javax.microedition.lcdui.Canvas
g
- The graphics context for this canvas.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |