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
Modifier and TypeFieldDescriptionprotected ChatServerControls
protected Icon
protected String
protected String
protected ChatServerConnection
protected PropertyChangeSupport
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, CONNECTION_LOST
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(String propertyName, PropertyChangeListener l) Register a PropertyChangeListener.protected void
fireStatus
(String msg) Room[]
Return an array of all rooms on the servergetRoom()
Return the room currently occupied by the playerReturn a Player instance representing the current playervoid
initializeControls
(ChatServerControls controls) Register all event listenersboolean
void
Send a Command to a particular playervoid
Send a command to other players on the servervoid
setConnected
(boolean connect) void
setDelegate
(ChatServerConnection newDelegate) void
Join the given roomvoid
Set the Player instance representing this playervoid
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
-