| examples.cityguide.MapCanvas
MapCanvas | public class MapCanvas extends Canvas implements MapListener(Code) | | This class represents a "view" of a city map. It shows a visitor and
landmarks.
version: 1.3 |
Constructor Summary | |
public | MapCanvas(CityMap cityMap) Creates a new instance of MapCanvas. |
Method Summary | |
public 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. | public synchronized void | landmarkStateChanged(CityMap sender, MapLandmark mapLandmark) A method which is called by the city map, when a landmark gets activated
or deactivated. | public synchronized void | landmarksChanged(CityMap sender) A method which is called by the city map, when the whole set of landmarks
changes. | public void | paint(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. | synchronized void | updateActivatedLandmarks() Updates the animation of active landmarks. | public synchronized void | visitorPositionChanged(CityMap sender) A method which is called by the city map, when the visitor changes his
position. | public void | visitorStateChanged(CityMap sender) A method which is called by the city map, when the visitor changes his
state. |
MapCanvas | public MapCanvas(CityMap cityMap)(Code) | | Creates a new instance of MapCanvas. Register itself as a map listener
to the given instance of the CityMap class.
|
cleanup | public void cleanup()(Code) | | The final unregistration.
|
hideNotify | protected void hideNotify()(Code) | | Stops the animation timer when the canvas gets invisible and unregisters
itself from receiving the notifications from the CityMap instance.
|
landmarkStateChanged | public synchronized void landmarkStateChanged(CityMap sender, MapLandmark mapLandmark)(Code) | | A method which is called by the city map, when a landmark gets activated
or deactivated.
|
landmarksChanged | public synchronized void landmarksChanged(CityMap sender)(Code) | | A method which is called by the city map, when the whole set of landmarks
changes.
|
paint | public void paint(Graphics g)(Code) | | |
showNotify | protected void showNotify()(Code) | | Starts an animation timer when the canvas gets visible and registers the
canvas instance to get the notifications from the CityMap instance.
|
updateActivatedLandmarks | synchronized void updateActivatedLandmarks()(Code) | | Updates the animation of active landmarks.
|
visitorPositionChanged | public synchronized void visitorPositionChanged(CityMap sender)(Code) | | A method which is called by the city map, when the visitor changes his
position.
|
visitorStateChanged | public void visitorStateChanged(CityMap sender)(Code) | | A method which is called by the city map, when the visitor changes his
state.
|
|
|