 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.guistate;
26 import org.jetbrains.annotations.NotNull;
27 import org.jetbrains.annotations.Nullable;
46 private final Object
sync =
new Object();
83 listener.metaserver();
88 throw new IllegalArgumentException(
"changeGUI() called in state CONNECTING");
97 throw new IllegalArgumentException(
"changeGUI() called in state CONNECT_FAILED");
106 protected abstract void doChangeGUI(@NotNull
final Runnable runnable);
114 synchronized (
sync) {
123 throw new IllegalArgumentException(
"changeGUI() called in state START");
126 throw new IllegalArgumentException(
"changeGUI() called in state METASERVER");
130 listener.preConnecting(param);
133 listener.connecting(param);
138 throw new IllegalArgumentException(
"changeGUI() called in state CONNECTED");
142 listener.connectFailed(param);
155 synchronized (
sync) {
180 public void connect(@NotNull
final String serverInfo) {
199 listener.connecting(clientSocketState, param);
211 public void disconnecting(@NotNull
final String reason,
final boolean isError) {
212 synchronized (
sync) {
223 synchronized (
sync) {
void connect(@NotNull final String serverInfo)
Connects to a Crossfire server.
GuiState guiState
The current GUI state.
GuiStateManager()
Creates a new instance.
void disconnecting(@NotNull final String reason, final boolean isError)
Called when the connection is being torn down.
void removeGuiStateListener(@NotNull final GuiStateListener listener)
Removes a gui state listener.
METASERVER
Display the server selection screen.
CONNECTED
Display the main playing screen.
Interface for listeners interested gui state changes.
CONNECTING
Display the screen while a server connection is established.
A list of event listeners.
void setClientSocketState(@NotNull final ClientSocketState clientSocketState, @NotNull final String param)
Sets the new ClientSocketState.
Maintains the current GuiState.
void changeGUI(@NotNull final GuiState guiState)
Sets a new GuiState.
GuiState getGuiState()
Returns the current GuiState.
void addGuiStateListener(@NotNull final GuiStateListener listener)
Adds a gui state listener.
final EventListenerList2< GuiStateListener > guiStateListeners
The connection state listeners to notify.
void disconnected()
Called after the connection has been closed.
CONNECT_FAILED
Display a failed connection attempt.
Connection progress states of the Crossfire server connection.
void disconnect()
Disconnects from the Crossfire server.
final Object sync
The synchronization object for accessing guiState.
abstract void doChangeGUI(@NotNull final Runnable runnable)
Calls the Runnable.
CONNECTED
Connection is fully established.
void changeGUI(@NotNull final GuiState guiState, @NotNull final String param)
Sets a new GuiState.