Package VASSAL.chat
Class HybridClient
java.lang.Object
VASSAL.chat.HybridClient
- All Implemented Interfaces:
ServerConnection
,ChatServerConnection
,PlayerEncoder
,ChatControlsInitializer
- Direct Known Subclasses:
DynamicClient
public class HybridClient extends Object implements ChatServerConnection, PlayerEncoder, ChatControlsInitializer
Delegates calls to another SvrConnection instance, which can be changed programmatically
- Author:
- rkinney
-
Field Summary
Fields Modifier and Type Field Description protected ChatServerControls
controls
protected Icon
currentIcon
protected String
currentText
protected String
defaultRoom
protected ChatServerConnection
delegate
protected PropertyChangeSupport
propSupport
Fields inherited from interface VASSAL.chat.ChatServerConnection
AVAILABLE_ROOMS, DEFAULT_ROOM_NAME, INCOMING_MSG, PLAYER_INFO, ROOM, STATUS, STATUS_SERVER
Fields inherited from interface VASSAL.build.module.ServerConnection
CONNECTED
-
Constructor Summary
Constructors Constructor Description HybridClient()
-
Method Summary
Modifier and Type Method Description void
addPropertyChangeListener(String propertyName, PropertyChangeListener l)
Register a PropertyChangeListener.protected void
fireStatus(String msg)
Room[]
getAvailableRooms()
Return an array of all rooms on the serverChatServerConnection
getDelegate()
Room
getRoom()
Return the room currently occupied by the playerPlayer
getUserInfo()
Return a Player instance representing the current playervoid
initializeControls(ChatServerControls controls)
Register all event listenersboolean
isConnected()
String
playerToString(Player p)
void
sendTo(Player recipient, Command c)
Send a Command to a particular playervoid
sendToOthers(Command c)
Send a command to other players on the servervoid
setConnected(boolean connect)
void
setDelegate(ChatServerConnection newDelegate)
void
setRoom(Room r)
Join the given roomvoid
setUserInfo(Player p)
Set the Player instance representing this playerPlayer
stringToPlayer(String s)
void
uninitializeControls(ChatServerControls controls)
Remove all previously-registered event listenersvoid
updateDisplayControls(Icon icon, String text)
-
Field Details
-
delegate
-
defaultRoom
-
propSupport
-
controls
-
currentIcon
-
currentText
-
-
Constructor Details
-
HybridClient
public HybridClient()
-
-
Method Details
-
addPropertyChangeListener
Description copied from interface:ServerConnection
Register a PropertyChangeListener. Changes to connection status triggers a PropertyChangeEvent, and concrete implementations may define other properties- Specified by:
addPropertyChangeListener
in interfaceServerConnection
-
getAvailableRooms
Description copied from interface:ChatServerConnection
Return an array of all rooms on the server- Specified by:
getAvailableRooms
in interfaceChatServerConnection
-
getRoom
Description copied from interface:ChatServerConnection
Return the room currently occupied by the player- Specified by:
getRoom
in interfaceChatServerConnection
-
getUserInfo
Description copied from interface:ChatServerConnection
Return a Player instance representing the current player- Specified by:
getUserInfo
in interfaceChatServerConnection
-
isConnected
public boolean isConnected()- Specified by:
isConnected
in interfaceServerConnection
-
sendTo
Description copied from interface:ChatServerConnection
Send a Command to a particular player- Specified by:
sendTo
in interfaceChatServerConnection
-
sendToOthers
Description copied from interface:ServerConnection
Send a command to other players on the server- Specified by:
sendToOthers
in interfaceServerConnection
-
setConnected
public void setConnected(boolean connect)- Specified by:
setConnected
in interfaceServerConnection
-
getDelegate
-
setRoom
Description copied from interface:ChatServerConnection
Join the given room- Specified by:
setRoom
in interfaceChatServerConnection
-
setUserInfo
Description copied from interface:ChatServerConnection
Set the Player instance representing this player- Specified by:
setUserInfo
in interfaceChatServerConnection
-
stringToPlayer
- Specified by:
stringToPlayer
in interfacePlayerEncoder
-
playerToString
- Specified by:
playerToString
in interfacePlayerEncoder
-
fireStatus
-
setDelegate
-
initializeControls
Description copied from interface:ChatControlsInitializer
Register all event listeners- Specified by:
initializeControls
in interfaceChatControlsInitializer
-
uninitializeControls
Description copied from interface:ChatControlsInitializer
Remove all previously-registered event listeners- Specified by:
uninitializeControls
in interfaceChatControlsInitializer
-
updateDisplayControls
-