|
||||||||||
| 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
de.enough.polish.ui.Canvas
de.enough.polish.ui.Screen
de.enough.polish.ui.SnapshotScreen
public class SnapshotScreen
A convenience screen for taking snapshots. This screen requires support of the MMAPI by the current target device!
//#if polish.api.mmapi
import de.enough.polish.ui.SnapshotScreen;
//#endif
...
//#if polish.api.mmapi
//#style snapshotScreen
SnapshotScreen screen = new SnapshotScreen("Snapshot");
//#endif
Copyright Enough Software 2006 - 2009
history
Sep 8, 2006 - rob creation
| Field Summary |
|---|
| Fields inherited from class de.enough.polish.ui.Canvas |
|---|
_commands, 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 | |
|---|---|
SnapshotScreen(String title)
Creates a new screen for taking screenshots. |
|
SnapshotScreen(String title,
Style style)
Creates a new screen for taking screenshots. |
|
| Method Summary | |
|---|---|
protected String |
createCssSelector()
Retrieves the CSS selector for this screen. |
Command |
getCaptureCommand()
Retrieves the command that has been set previously with setCaptureCommand |
Player |
getPlayer()
Retrieves the player used for taking the snapshot. |
byte[] |
getSnapshot()
Takes a snapshot in the default encoding. |
byte[] |
getSnapshot(String encoding)
Takes a snapshot in the desired encoding/settings. |
Image |
getSnapshotImage()
Takes a snapshot in the default encoding. |
Image |
getSnapshotImage(String encoding)
Takes a snapshot in the desired encoding/settings. |
boolean |
handleKeyReleased(int keyCode,
int gameAction)
Handles the key-released event. |
void |
hideNotify()
Unregisters this screen and notifies all items that they will not be shown anymore. |
boolean |
isAutofocus()
Checks if the autofocus mode is enabled. |
boolean |
isBusy()
Determines whether this snapshot screen is currently busy and should not be interrupted. |
boolean |
isSnapshotInProgress()
Determines whether a snapshot is currently made |
protected void |
paintScreen(Graphics g)
Paints the screen. |
void |
setAutofocus(boolean autofocus)
Enables or disables the autofocus mode. |
void |
setCaptureCommand(Command cmdCapture)
Sets the command that is used for capturing. |
void |
setCaptureCommand(Command cmdCapture)
Sets the command that is used for capturing. |
void |
showNotify()
Initialises this screen and informs all items about being painted soon. |
void |
stopSnapshot()
Stops the snapshot and closes the snapshot player. |
void |
stopSnapshot(boolean removeInstanceVariables)
Stops the snapshot and closes the snapshot player. |
| Methods inherited from class de.enough.polish.ui.Canvas |
|---|
_hideNotify, _hideNotifyExternal, _showNotify, getGameAction, getHeight, getKeyCode, getKeyName, getWidth, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotifyExternal, isDoubleBuffered, isShown, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, setTicker |
| Methods inherited from class javax.microedition.lcdui.Canvas |
|---|
repaint, repaint, serviceRepaints |
| Methods inherited from class javax.microedition.lcdui.Displayable |
|---|
getTicker, removeCommand, setTicker |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SnapshotScreen(String title)
title - the title of the screen
public SnapshotScreen(String title,
Style style)
title - the title of the screenstyle - the style| Method Detail |
|---|
public boolean isSnapshotInProgress()
public void hideNotify()
Screen
hideNotify in class Screenpublic void showNotify()
Screen
showNotify in class Screen
public Image getSnapshotImage()
throws MediaException
MediaException - when taking the snapshot fails
SecurityException - when the user does not allow the snapshotAsynchronousCommandListener,
ThreadedCommandListener
public Image getSnapshotImage(String encoding)
throws MediaException
encoding - the encoding and optionally size
MediaException - when taking the snapshot fails
SecurityException - when the user does not allow the snapshotAsynchronousCommandListener,
ThreadedCommandListener
public byte[] getSnapshot()
throws MediaException
MediaException - when taking the snapshot fails
SecurityException - when the user does not allow the snapshotAsynchronousCommandListener,
ThreadedCommandListener
public byte[] getSnapshot(String encoding)
throws MediaException
encoding - the encoding and optionally size
MediaException - when taking the snapshot fails
SecurityException - when the user does not allow the snapshotAsynchronousCommandListener,
ThreadedCommandListenerpublic void setAutofocus(boolean autofocus)
autofocus - true when the autofocus mode should be enabledpublic boolean isAutofocus()
protected void paintScreen(Graphics g)
Screen
paintScreen in class Screeng - the graphics on which the screen should be paintedScreen.contentX,
Screen.contentY,
Screen.contentWidth,
Screen.contentHeight,
Screen.paintScrollIndicator,
Screen.paintScrollIndicatorUp,
Screen.paintScrollIndicatorDownprotected String createCssSelector()
Screen
createCssSelector in class Screenpublic void stopSnapshot()
public void stopSnapshot(boolean removeInstanceVariables)
removeInstanceVariables - true when instance variables of VideoControl and player should be removedpublic Player getPlayer()
public boolean handleKeyReleased(int keyCode,
int gameAction)
Screen
handleKeyReleased in class ScreenkeyCode - the code of the released key, e.g. Canvas.KEY_NUM2gameAction - the corresponding game-action, e.g. Canvas.UP
public Command getCaptureCommand()
public void setCaptureCommand(Command cmdCapture)
cmdCapture - the capture command to set, use null to remove itpublic void setCaptureCommand(Command cmdCapture)
cmdCapture - the capture command to set, use null to remove itpublic boolean isBusy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||