|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lessvoid.nifty.controls.AbstractController
de.lessvoid.nifty.controls.chatcontrol.ChatControl
public class ChatControl
This is the main controller for the chat control.
Constructor Summary | |
---|---|
ChatControl()
Default constructor. |
Method Summary | |
---|---|
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 |
Methods inherited from class de.lessvoid.nifty.controls.AbstractController |
---|
bind, disable, enable, getElement, getHeight, getId, getStyle, getWidth, hasFocus, init, isBound, isEnabled, layoutCallback, setEnabled, setFocus, setFocusable, setHeight, setId, setStyle, setWidth |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 |
Constructor Detail |
---|
public ChatControl()
Method Detail |
---|
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)
addPlayer
in interface Chat
playerName
- The player to add.playerIcon
- Optionally, an icon can be supplied which is then displayed in
front of the player name.public void addPlayer(String playerName, NiftyImage playerIcon, String style)
addPlayer
in interface Chat
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.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()
getLines
in interface Chat
public void update()
update
in interface Chat
public final void sendText()
public boolean keyEvent(NiftyInputEvent inputEvent)
keyEvent
in interface KeyInputHandler
public boolean inputEvent(NiftyInputEvent inputEvent)
inputEvent
in interface Controller
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |