public class ChatControl extends AbstractController implements Chat, KeyInputHandler
| Constructor and Description |
|---|
ChatControl()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPlayer(String playerName,
NiftyImage playerIcon)
{@inheritDoc
|
void |
addPlayer(String playerName,
NiftyImage playerIcon,
String style)
{@inheritDoc
|
void |
bind(Nifty niftyParam,
Screen screenParam,
Element newElement,
Properties properties,
Attributes controlDefinitionAttributes) |
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.
|
boolean |
inputEvent(NiftyInputEvent inputEvent) |
boolean |
keyEvent(NiftyInputEvent inputEvent) |
void |
onFocus(boolean arg0) |
void |
onStartScreen() |
void |
receivedChatLine(String text,
NiftyImage icon)
{@inheritDoc
|
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)
{@inheritDoc
|
void |
sendText()
This method is called when the player either presses the send button or
the Return key.
|
void |
update()
Updates the lists to reflecct any changes made to them,
outside of the addPlayer, removePlayer and
|
bind, disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, init, isBound, isEnabled, layoutCallback, setEnabled, setFocus, setFocusable, setHeight, setId, setStyle, setWidthclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, isBound, isEnabled, layoutCallback, setEnabled, setFocus, setFocusable, setHeight, setId, setStyle, setWidthpublic final void bind(Nifty niftyParam, Screen screenParam, Element newElement, Properties properties, Attributes controlDefinitionAttributes)
bind in interface Controllerpublic void onFocus(boolean arg0)
onFocus in interface ControlleronFocus in class AbstractControllerpublic final void onStartScreen()
onStartScreen in interface Controllerpublic final void receivedChatLine(String text, NiftyImage icon)
receivedChatLine in interface Chattext - The text to display.icon - Optionally, an icon can be supplied which is then displayed at
the start of the chat line.public void receivedChatLine(String text, NiftyImage icon, String style)
receivedChatLine in interface Chattext - 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.public final void addPlayer(String playerName, NiftyImage playerIcon)
public void addPlayer(String playerName, NiftyImage playerIcon, String style)
public final void removePlayer(String playerName)
removePlayer in interface ChatplayerName - The player name to remove.public List<ChatEntryModelClass> getPlayers()
getPlayers in interface Chatpublic List<ChatEntryModelClass> getLines()
public void update()
public final void sendText()
public boolean keyEvent(NiftyInputEvent inputEvent)
keyEvent in interface KeyInputHandlerpublic boolean inputEvent(NiftyInputEvent inputEvent)
inputEvent in interface ControllerCopyright © 2013. All Rights Reserved.