de.lessvoid.nifty.controls
Interface Chat

All Superinterfaces:
NiftyControl
All Known Implementing Classes:
ChatControl

public interface Chat
extends NiftyControl

Author:
ractoc

Method Summary
 void addPlayer(String playerName, NiftyImage playerIcon)
          This method is called when a new player enters the room.
 void addPlayer(String playerName, NiftyImage playerIcon, String style)
          This method is called when a new player enters the room.
 List<ChatEntryModelClass> getLines()
          This method returns all the chatlines in the chat.
 List<ChatEntryModelClass> getPlayers()
          This method returns the current list of players in the chat.
 void receivedChatLine(String text, NiftyImage icon)
          This method is called when a chat line is received which should be displayed in the chat control.
 void receivedChatLine(String text, NiftyImage icon, String style)
          This method is called when a chat line is received which should be displayed in the chat control.
 void removePlayer(String playerName)
          This method is called when a player leaves the rome and needs to be removed from the list.
 void update()
          Updates the lists to reflecct any changes made to them, outside of the addPlayer, removePlayer and
 
Methods inherited from interface de.lessvoid.nifty.controls.NiftyControl
disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, isBound, isEnabled, layoutCallback, setEnabled, setFocus, setFocusable, setHeight, setId, setStyle, setWidth
 

Method Detail

receivedChatLine

void receivedChatLine(String text,
                      NiftyImage icon)
This method is called when a chat line is received which should be displayed in the chat control.

Parameters:
text - The text to display.
icon - Optionally, an icon can be supplied which is then displayed at the start of the chat line.

receivedChatLine

void receivedChatLine(String text,
                      NiftyImage icon,
                      String style)
This method is called when a chat line is received which should be displayed in the chat control. This method has one extra parameter. This parameter allows for a custom style to be set per chat line.

Parameters:
text - The text to display.
icon - Optionally, an icon can be supplied which is then displayed at the start of the chat line.
style - The custom style for this particular chatline.

addPlayer

void addPlayer(String playerName,
               NiftyImage playerIcon)
This method is called when a new player enters the room. This adds that player to the list of players already in the room. If more then one player needs to be added, this method will have to be called multiple times.

Parameters:
playerName - The player to add.
playerIcon - Optionally, an icon can be supplied which is then displayed in front of the player name.

addPlayer

void addPlayer(String playerName,
               NiftyImage playerIcon,
               String style)
This method is called when a new player enters the room. This adds that player to the list of players already in the room. If more then one player needs to be added, this method will have to be called multiple times. This method has an additional parameter which allows for the setting of a custom style per entry.

Parameters:
playerName - The player to add.
playerIcon - Optionally, an icon can be supplied which is then displayed in front of the player name.
style - The custom style for this player. This style is depicted in the player list.

removePlayer

void removePlayer(String playerName)
This method is called when a player leaves the rome and needs to be removed from the list.

Parameters:
playerName - The player name to remove.

getPlayers

List<ChatEntryModelClass> getPlayers()
This method returns the current list of players in the chat.

Returns:
The current list of players.

getLines

List<ChatEntryModelClass> getLines()
This method returns all the chatlines in the chat.

Returns:
The current list of chatlines.

update

void update()
Updates the lists to reflecct any changes made to them, outside of the addPlayer, removePlayer and



Copyright © 2011. All Rights Reserved.