Canvas

If Canvas is in the full screen mode and it has no CommandListener, the MIDlet triggers low-level key events from the softkeys and is thus in full control of them. If there are one or more Commands, pressing any softkey shows the Options menu even though there is no control pane visible and thus there are no softkey labels visible.

The title and the Ticker are not displayed for a Canvas in full-screen mode.

A full screen mode Canvas is changed to a normal mode Canvas when an Alert is called and displayed on top of the Canvas. After the Alert is dismissed, the Canvas is changed back to full screen mode.

From Java 1.3 for S60 onwards, a full screen mode Canvas is not changed to normal mode Canvas when an Alert is called.

Table 39: Softkey behavior in different situations with full screen mode Canvas

Situation

Behavior of softkey or Selection key press

There are Commands and a CommandListener defined

The Options menu is presented.

Note: The Commands are not directly associated with the softkeys but shown in the Options menu.

There is no CommandListener set for Canvas in full screen mode.

Selection key (and other softkeys) triggers low-level key events to the MIDlet.

There is a CommandListener but no Commands set for Canvas in full screen mode.

Selection key (and other softkeys) triggers low-level key events to the MIDlet.

Note: Canvas in normal mode does not get the low-level key events even if there is no CommandListener.

Since there is no universal indicator pane to show the network activity indicator, the full screen mode Canvas renders a connection indicator on top of the main pane. Indicator differs depending on the network bearer.

From S60 3rd Edition Feature Pack onwards, in full screen Canvas, the network indicator is not shown for manufacturer domain applications, and in the operator domain it can be suppressed with a Central Repository setting.

Graphics buffering

Canvas in S60 is always double buffered (isDoubleBuffered returns true), which means that each Canvas instance creates a new back buffer for the display. Therefore using multiple Canvas instances results in high memory consumption. For more information, see paint() method description.

From S60 3rd Edition FP 2 onwards, Canvas instances share a common back buffer. Therefore creating many Canvas instances consumes considerably less memory.

The Canvas back buffer is currently bitmap based so the memory consumption from the buffer is relative to the device display size.

Note: GameCanvas instances operate with a dedicated back buffer, so the above memory performance improvement applies only for Canvas.

Note: LCDUI Canvas graphics scaling with MMAPI VideoControl is not implemented because the MMAPI Video content is not present on the frame buffer. Therefore, using Canvas scaling feature together with video content via MMAPI is not recommended. Other MMAPI functionality can be used properly (audio etc.).

For an example on double buffering, see article Using double buffering in Java ME in Forum Nokia wiki.

Softkey behavior

When the Canvas is in full screen mode and it has a CommandListener and one or more Commands, then pressing of any softkey opens the options menu. The options menu contains all Commands that are added to the Canvas.

When the Canvas is in full screen mode but CommandListener has not been set to it or CommandListener has been set but there are no Commands added to the Canvas, then pressing of a softkey posts a key event to Java Canvas.

Canvas extensions

The following JAD attributes have an effect on Canvas behavior:

  • Resolution changes

    • Nokia-MIDlet-Target-Display-Size - for target device screen resolution

    • Nokia-MIDlet-Original-Display-Size - for original MIDlet screen resolution

    • Nokia-MIDlet-Canvas-Scaling-Orientation-Switch - for supporting orientation changes between portrait and landscape modes. For more information, see Scaling

The following system properties have an effect on Canvas behavior:

  • Softkey label locations -

    • com.nokia.softkey<n>.label.location

    • com.nokia.softkey<n>.label.anchor

  • Network indicator position

    • com.nokia.canvas.net.indicator.location

    Note: For backwards compatibility to S60 releases prior to S60 3rd Edition FP 2, it is possible to enable low-level key event triggering from Selection key both in normal mode Canvas and in full screen Canvas with Commands and CommandListener defined. If this feature is enabled, no Commands are mapped to Selection key. Instead the relevant low-level key event will be triggered. Note that in a full screen mode Canvas without any Commands and CommandListener defined this feature does not have any effect as low level key events are triggered from all softkeys in any case.

    To enable this feature the following attribute should be added to the JAD or manifest file of the Java application with value true: Nokia-MIDlet-S60-Selection-Key-Compatibility. For more information, see section JAD and JAR manifest attributes.