com.nokia.mid.ui
Class FullCanvas

java.lang.Object
  extended by javax.microedition.lcdui.Displayable
      extended by javax.microedition.lcdui.Canvas
          extended by com.nokia.mid.ui.FullCanvas

public abstract class FullCanvas
extends javax.microedition.lcdui.Canvas

FullCanvas provides totally full screen painting area.

Implementation need to draw any status indicators overlaid on the FullCanvas. Implementations should draw these indicators on top left corner, but there may be reasons to deviate from this rule. Applications must take care that the display doens't become cluttered even if overlaid indicators appear.

Commands can't be added to FullCanvas. Pressing the keys normally tied to Commands (e.g. softbuttons, or other command buttons) will result direct keystroke events (see documentation on key events on javax.microedition.Canvas). FullCanvas defines new constants that are used for these key codes.

Callback methods of FullCanvas have same semantics as in standard Canvas. However, the DirectGraphics will be passed to the paint method of com.nokia.mid.ui.FullCanvas.

Generally in FullCanvas all key presses are reported as normal key press events through keyPressed(), keyRepeated() and keyReleased() methods. There are some additional constant key code definitions in FullCanvas. All the normal key codes reported in Canvas are also reported.

Since:
1.0

Field Summary
static int KEY_DOWN_ARROW
          Key code constant for Down arrow key.
static int KEY_END
          Key code constant for End key.
static int KEY_LEFT_ARROW
          Key code constant for Left arrow key.
static int KEY_RIGHT_ARROW
          Key code constant for Right arrow key.
static int KEY_SEND
          Key code constant for Send key.
static int KEY_SOFTKEY1
          Key code constant for left softkey or first command button key.
static int KEY_SOFTKEY2
          Key code constant for right softkey or last command button key.
static int KEY_SOFTKEY3
          Key code constant for select key, middle softkey or second command button key.
static int KEY_UP_ARROW
          Key code constant for Up arrow key.
 
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
protected FullCanvas()
          Constructs a new FullCanvas object.
protected FullCanvas(boolean transparency)
          Constructs a new FullCanvas object with opaque or transparent canvas.
 
Method Summary
 void addCommand(javax.microedition.lcdui.Command cmd)
          Throws IllegalStateException.
 boolean getTransparency()
          Returns canvas transparency.
 void setCommandListener(javax.microedition.lcdui.CommandListener l)
          Throws IllegalStateException.
 
Methods inherited from class javax.microedition.lcdui.Canvas
getGameAction, getHeight, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, hideNotify, isDoubleBuffered, keyPressed, keyReleased, keyRepeated, paint, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode, showNotify, sizeChanged
 
Methods inherited from class javax.microedition.lcdui.Displayable
getTicker, getTitle, getWidth, isShown, removeCommand, setTicker, setTitle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_SOFTKEY1

public static final int KEY_SOFTKEY1
Key code constant for left softkey or first command button key. The value is -6.

Since:
1.0
See Also:
Constant Field Values

KEY_SOFTKEY2

public static final int KEY_SOFTKEY2
Key code constant for right softkey or last command button key. The value is -7.

Since:
1.0
See Also:
Constant Field Values

KEY_SEND

public static final int KEY_SEND
Key code constant for Send key. The value is -10.

Since:
1.0
See Also:
Constant Field Values

KEY_END

public static final int KEY_END
Key code constant for End key. Note: Pressing end may have some other effect depending on the system, for example, device UI may return to device's idle state or may close down the application. The key event nevertheless is sent to the application before this happens. The value is -11.

Since:
1.0
See Also:
Constant Field Values

KEY_SOFTKEY3

public static final int KEY_SOFTKEY3
Key code constant for select key, middle softkey or second command button key. This key is not in all devices. The value is -5.

Since:
1.0
See Also:
Constant Field Values

KEY_UP_ARROW

public static final int KEY_UP_ARROW
Key code constant for Up arrow key. The value is -1.

Since:
1.0
See Also:
Constant Field Values

KEY_DOWN_ARROW

public static final int KEY_DOWN_ARROW
Key code constant for Down arrow key. The value is -2.

Since:
1.0
See Also:
Constant Field Values

KEY_LEFT_ARROW

public static final int KEY_LEFT_ARROW
Key code constant for Left arrow key. This key is not in all devices. The value is -3.

Since:
1.0
See Also:
Constant Field Values

KEY_RIGHT_ARROW

public static final int KEY_RIGHT_ARROW
Key code constant for Right arrow key. This key is not in all devices. The value is -4.

Since:
1.0
See Also:
Constant Field Values
Constructor Detail

FullCanvas

protected FullCanvas()
Constructs a new FullCanvas object. Applications can't call this constructor directly, they need to subclass FullCanvas.


FullCanvas

protected FullCanvas(boolean transparency)
Constructs a new FullCanvas object with opaque or transparent canvas. Applications can't call this constructor directly, they need to subclass FullCanvas.

Parameters:
transparency - true if transparent canvas is needed, false if opaque canvas is needed
Method Detail

getTransparency

public boolean getTransparency()
Returns canvas transparency.

Returns:
true if FullCanvas has transparent canvas, false if canvas is opaque.

addCommand

public void addCommand(javax.microedition.lcdui.Command cmd)
Throws IllegalStateException. Commands are not possible in FullCanvas.

Overrides:
addCommand in class javax.microedition.lcdui.Displayable
Throws:
java.lang.IllegalStateException - thrown always

setCommandListener

public void setCommandListener(javax.microedition.lcdui.CommandListener l)
Throws IllegalStateException. Commands are not possible in FullCanvas.

Overrides:
setCommandListener in class javax.microedition.lcdui.Displayable
Throws:
java.lang.IllegalStateException - thrown always


Copyright © 2012 Nokia Corporation. All rights reserved.

Nokia is registered trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Oracle Corporation. Other product and company names mentioned herein may be trademarks or trade names of their respective owners. This document is confidential information of Nokia Corporation.

Disclaimer
The information in this document is provided "as is," with no warranties whatsoever, including any warranty of merchantability, fitness for any particular purpose, or any warranty otherwise arising out of any proposal, specification, or sample. Furthermore, information provided in this document is preliminary, and may be changed substantially prior to final release.

Nokia Corporation disclaims all liability, including liability for infringement of any proprietary rights, relating to this document and implementation of any information presented in this document.

Nokia Corporation retains the right to make changes to this document at any time, without notice.

License
Subject to above disclaimer, a license is hereby granted to use this documentation solely under existing Limited License Agreement and non-disclosure agreement between the companies for the agreed application development for Series 40 Nokia phones. No other licenses e.g. to any intellectual property rights are granted herein. Any use of the screen shots of this documentation, including any icons thereof, is subject to Nokia's prior written approval.