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, setWidth
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, isBound, isEnabled, layoutCallback, setEnabled, setFocus, setFocusable, setHeight, setId, setStyle, setWidth
public final void bind(Nifty niftyParam, Screen screenParam, Element newElement, Properties properties, Attributes controlDefinitionAttributes)
bind
in interface Controller
public void onFocus(boolean arg0)
onFocus
in interface Controller
onFocus
in class AbstractController
public final void onStartScreen()
onStartScreen
in interface Controller
public final void receivedChatLine(String text, NiftyImage icon)
receivedChatLine
in interface Chat
text
- 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 Chat
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.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 Chat
playerName
- The player name to remove.public List<ChatEntryModelClass> getPlayers()
getPlayers
in interface Chat
public List<ChatEntryModelClass> getLines()
public void update()
public final void sendText()
public boolean keyEvent(NiftyInputEvent inputEvent)
keyEvent
in interface KeyInputHandler
public boolean inputEvent(NiftyInputEvent inputEvent)
inputEvent
in interface Controller
Copyright © 2013. All Rights Reserved.