public class ChatControl extends de.lessvoid.nifty.controls.AbstractController implements Chat, de.lessvoid.nifty.screen.KeyInputHandler
Constructor and Description |
---|
ChatControl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addPlayer(String playerName,
de.lessvoid.nifty.render.NiftyImage playerIcon)
{@inheritDoc
|
void |
addPlayer(String playerName,
de.lessvoid.nifty.render.NiftyImage playerIcon,
String style)
{@inheritDoc
|
void |
bind(de.lessvoid.nifty.Nifty niftyParam,
de.lessvoid.nifty.screen.Screen screenParam,
de.lessvoid.nifty.elements.Element newElement,
Properties properties,
de.lessvoid.xml.xpp3.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(de.lessvoid.nifty.input.NiftyInputEvent inputEvent) |
boolean |
keyEvent(de.lessvoid.nifty.input.NiftyInputEvent inputEvent) |
void |
onFocus(boolean arg0) |
void |
onStartScreen() |
void |
receivedChatLine(String text,
de.lessvoid.nifty.render.NiftyImage icon)
{@inheritDoc
|
void |
receivedChatLine(String text,
de.lessvoid.nifty.render.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
public final void bind(de.lessvoid.nifty.Nifty niftyParam, de.lessvoid.nifty.screen.Screen screenParam, de.lessvoid.nifty.elements.Element newElement, Properties properties, de.lessvoid.xml.xpp3.Attributes controlDefinitionAttributes)
bind
in interface de.lessvoid.nifty.controls.Controller
public void onFocus(boolean arg0)
onFocus
in interface de.lessvoid.nifty.controls.Controller
onFocus
in class de.lessvoid.nifty.controls.AbstractController
public final void onStartScreen()
onStartScreen
in interface de.lessvoid.nifty.controls.Controller
public final void receivedChatLine(String text, de.lessvoid.nifty.render.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, de.lessvoid.nifty.render.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, de.lessvoid.nifty.render.NiftyImage playerIcon)
public void addPlayer(String playerName, de.lessvoid.nifty.render.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(de.lessvoid.nifty.input.NiftyInputEvent inputEvent)
keyEvent
in interface de.lessvoid.nifty.screen.KeyInputHandler
public boolean inputEvent(de.lessvoid.nifty.input.NiftyInputEvent inputEvent)
inputEvent
in interface de.lessvoid.nifty.controls.Controller
Copyright © 2013. All Rights Reserved.