|
||||||
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
examples.cityguide.MapCanvas
public class MapCanvas
This class represents a "view" of a city map. It shows a visitor and landmarks.
Field Summary |
---|
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 | |
---|---|
MapCanvas(CityMap cityMap)
Creates a new instance of MapCanvas. |
Method Summary | |
---|---|
void |
cleanup()
The final unregistration. |
protected void |
hideNotify()
Stops the animation timer when the canvas gets invisible and unregisters itself from receiving the notifications from the CityMap instance. |
void |
landmarksChanged(CityMap sender)
A method which is called by the city map, when the whole set of landmarks changes. |
void |
landmarkStateChanged(CityMap sender,
MapLandmark mapLandmark)
A method which is called by the city map, when a landmark gets activated or deactivated. |
void |
paint(javax.microedition.lcdui.Graphics g)
|
protected void |
showNotify()
Starts an animation timer when the canvas gets visible and registers the canvas instance to get the notifications from the CityMap instance. |
(package private) void |
updateActivatedLandmarks()
Updates the animation of active landmarks. |
void |
visitorPositionChanged(CityMap sender)
A method which is called by the city map, when the visitor changes his position. |
void |
visitorStateChanged(CityMap sender)
A method which is called by the city map, when the visitor changes his state. |
Methods inherited from class javax.microedition.lcdui.Canvas |
---|
getGameAction, getKeyCode, getKeyName, hasPointerEvents, hasPointerMotionEvents, hasRepeatEvents, isDoubleBuffered, keyPressed, keyReleased, keyRepeated, pointerDragged, pointerPressed, pointerReleased, repaint, repaint, serviceRepaints, setFullScreenMode, 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 |
Constructor Detail |
---|
public MapCanvas(CityMap cityMap)
Method Detail |
---|
void updateActivatedLandmarks()
public void paint(javax.microedition.lcdui.Graphics g)
paint
in class javax.microedition.lcdui.Canvas
public void visitorPositionChanged(CityMap sender)
visitorPositionChanged
in interface MapListener
public void visitorStateChanged(CityMap sender)
visitorStateChanged
in interface MapListener
public void landmarkStateChanged(CityMap sender, MapLandmark mapLandmark)
landmarkStateChanged
in interface MapListener
public void landmarksChanged(CityMap sender)
landmarksChanged
in interface MapListener
protected void showNotify()
showNotify
in class javax.microedition.lcdui.Canvas
protected void hideNotify()
hideNotify
in class javax.microedition.lcdui.Canvas
public void cleanup()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |