Genuts ME API

com.genuts.gameui
Interface DisplayManager

All Known Implementing Classes:
SpriteDisplayManager

public interface DisplayManager

Defines an interface for classes that know how to paint sprites.

A display manager can manage only one playfield.

See Also:
PlayField

Method Summary
 void addSprite(Sprite sprite)
          Adds a sprite in the display list of this display manager.
 void drawDebug(Graphics g)
          Draws debug informations for this display manager.
 PlayField getPlayfield()
          Returns the playfield associated with this display manager.
 void invalidateSprite(Sprite sprite)
          Performs actions when a sprite is invalidate.
 void paint(Graphics g)
          Displays all visible elements of the playfield.
 void playfieldSizeChanged()
          Informs that the size of the playfield has changed.
 void removeSprite(Sprite sprite)
          Removes a sprite from the display list of this display manager.
 void reset()
          Resets cache datas for this CollisionManager.
 void setPlayfield(PlayField playfield)
          Sets the playfield associated with this display manager.
 void validateSprite(Sprite sprite)
          Performs actions when a sprite is validate.
 

Method Detail

getPlayfield

public PlayField getPlayfield()
Returns the playfield associated with this display manager.

Returns:
The playfield associated with this display manager.

setPlayfield

public void setPlayfield(PlayField playfield)
Sets the playfield associated with this display manager.

Parameters:
playfield - The playfield associated with this display manager.

playfieldSizeChanged

public void playfieldSizeChanged()
Informs that the size of the playfield has changed.


reset

public void reset()
Resets cache datas for this CollisionManager.


addSprite

public void addSprite(Sprite sprite)
Adds a sprite in the display list of this display manager.

Generally, this is called by the playfield when a new sprite is added.

Parameters:
sprite - Sprite to add

removeSprite

public void removeSprite(Sprite sprite)
Removes a sprite from the display list of this display manager.

Generally, this is called by the playfield when a sprite is removed.

Parameters:
sprite - Sprite to remove

invalidateSprite

public void invalidateSprite(Sprite sprite)
Performs actions when a sprite is invalidate.

Generally, this is called by a sprite when Sprite.invalidate() is called.

Parameters:
sprite - Sprite to invalidate.
See Also:
Sprite.invalidate()

validateSprite

public void validateSprite(Sprite sprite)
Performs actions when a sprite is validate.

Generally, this is called by a sprite when Sprite.validate() is called.

Parameters:
sprite - Sprite to validate.
See Also:
Sprite.validate()

paint

public void paint(Graphics g)
Displays all visible elements of the playfield.

For the playfield, calls the method paintPlayField(Graphics).
For each sprite, calls the method paint(Graphics).

Parameters:
g - The graphics context to use for painting.
See Also:
PlayField.paintPlayField(Graphics), Sprite.paint(Graphics)

drawDebug

public void drawDebug(Graphics g)
Draws debug informations for this display manager.

Parameters:
g - The graphics context to use for painting.

Genuts ME API

Genuts ME API