displaying a canvas?

3 views
Skip to first unread message

KoffieSchaap

unread,
Aug 11, 2009, 9:33:19 AM8/11/09
to J4ME
Hello everybody.

Using an GPS map api i have managed to create a canvas with a map.
this map normally is to be displayed by invoking:

Display.getDisplay(this).setCurrent(oMyMap.getCanvas());

i would like to do this as an component. how do i display a canvas
inside J4ME?
(as the Dusplay.getDisplay(this) then does not apply: you are working
with a component)

Kind regards,

Koffie

Dean

unread,
Aug 11, 2009, 12:35:30 PM8/11/09
to J4ME
There are a few options. The first is to change your map class to
derive from DeviceScreen instead of Canvas. They are analogous
(although slightly different so there is a chance you may need to
tweak something).

Alternatively you can call:
UIManager.getDisplay().setCurrent(oMyMap.getCanvas());

And then from your Canvas class you'll need to give control back to
J4ME you'll need to call:
deviceScreen.show();
deviceScreen.repaint();

KoffieSchaap

unread,
Aug 12, 2009, 2:50:32 AM8/12/09
to J4ME
Very well, but the map api that i am using is (as far as i know) only
available in packaged form and so not available in sourcecode to edit.
(we are speaking of http://j2memap.8motions.com/)

So far i have not been able to get the canvas to work in J4ME by
creating a new class deriving from devicescreen which calls the
methods mentioned below.

in the most optimal situation i wish to use the object created by the
object just as an image would be used so i can use the menu of the
J4ME framework together with a possible textbox.
Reply all
Reply to author
Forward
0 new messages