Package games.stendhal.client.gui.map
Class MapPanelController
java.lang.Object
games.stendhal.client.gui.map.MapPanelController
- All Implemented Interfaces:
GameObjects.GameObjectListener
,PositionChangeListener
,StendhalClient.ZoneChangeListener
public class MapPanelController
extends Object
implements GameObjects.GameObjectListener, PositionChangeListener, StendhalClient.ZoneChangeListener
Controller object for the map panel.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add an entity to the map, if it should be displayed to the user.Get the map panel component.void
onZoneChange(Zone zone)
Called when the user is changing zone.void
onZoneChangeCompleted(Zone zone)
Called when the user has changed zone.void
onZoneUpdate(Zone zone)
Called when the zone is updated, such as when the coloring changes.void
positionChanged(double x, double y)
The player's position changed.void
refresh()
Request redrawing the map screen if the needed.void
removeEntity(IEntity entity)
Remove an entity from the map entity list.
-
Constructor Details
-
MapPanelController
Create a MapPanelController.- Parameters:
client
- client object
-
-
Method Details
-
getComponent
Get the map panel component.- Returns:
- component
-
addEntity
Add an entity to the map, if it should be displayed to the user. This method is thread safe.- Specified by:
addEntity
in interfaceGameObjects.GameObjectListener
- Parameters:
entity
- the added entity
-
removeEntity
Remove an entity from the map entity list.- Specified by:
removeEntity
in interfaceGameObjects.GameObjectListener
- Parameters:
entity
- the entity to be removed
-
refresh
public void refresh()Request redrawing the map screen if the needed. -
positionChanged
public void positionChanged(double x, double y)The player's position changed.- Specified by:
positionChanged
in interfacePositionChangeListener
- Parameters:
x
- The X coordinate (in world units).y
- The Y coordinate (in world units).
-
onZoneChange
Description copied from interface:StendhalClient.ZoneChangeListener
Called when the user is changing zone.- Specified by:
onZoneChange
in interfaceStendhalClient.ZoneChangeListener
- Parameters:
zone
- the new zone to be changed to. This is not guaranteed to have complete zone data at this stage.
-
onZoneChangeCompleted
Description copied from interface:StendhalClient.ZoneChangeListener
Called when the user has changed zone.- Specified by:
onZoneChangeCompleted
in interfaceStendhalClient.ZoneChangeListener
- Parameters:
zone
- the new zone
-
onZoneUpdate
Description copied from interface:StendhalClient.ZoneChangeListener
Called when the zone is updated, such as when the coloring changes.- Specified by:
onZoneUpdate
in interfaceStendhalClient.ZoneChangeListener
- Parameters:
zone
- the updated zone
-