Crossfire JXClient, Trunk
R20561
|
Public Member Functions | |
String | getHostname () |
Returns the currently connected server. More... | |
int | getPort () |
Returns the currently connected port. More... | |
JXCConnection (@NotNull final KeybindingsManager keybindingsManager, @NotNull final Shortcuts shortcuts, @NotNull final Settings settings, @NotNull final Pickup characterPickup, @NotNull final CrossfireServerConnection server, @NotNull final GuiStateManager guiStateManager, @NotNull final Logger logger) | |
Creates a new instance. More... | |
void | setCharacter (@Nullable final String character) |
Updates the active character name. More... | |
void | setFrame (@Nullable final Frame frame) |
Sets the Frame for updating the title. More... | |
void | setHost (@Nullable final String serverInfo) |
Updates information about the connected host. More... | |
Private Member Functions | |
void | connect () |
Connects to the Crossfire server. More... | |
void | disconnect (@NotNull final String reason) |
Disconnects from the Crossfire server. More... | |
void | updateTitle () |
Updates the window title to reflect the current connection state. More... | |
Private Attributes | |
String | character |
The currently logged in character. More... | |
final Pickup | characterPickup |
The Pickup instance to update. More... | |
final CrossfirePickupListener | crossfirePickupListener |
The CrossfirePickupListener for tracking pickup mode changes. More... | |
Frame | frame |
The Frame for updating the title or. More... | |
final GuiStateListener | guiStateListener |
The GuiStateListener for detecting established or dropped connections. More... | |
String | hostname |
The currently connected server. More... | |
final KeybindingsManager | keybindingsManager |
The KeybindingsManager to update. More... | |
final Logger | logger |
The Logger that is notified about changed server names. More... | |
int | port |
The currently connected port. More... | |
final CrossfireServerConnection | server |
The CrossfireServerConnection instance used to connect to the Crossfire server. More... | |
final Settings | settings |
The settings instance to use. More... | |
final Shortcuts | shortcuts |
The Shortcuts to update. More... | |
Static Private Attributes | |
static final int | DEFAULT_CROSSFIRE_PORT = 13327 |
The default port number for Crossfire servers. More... | |
static final String | TITLE_PREFIX = "jxclient" |
The prefix for the window title. More... | |
Definition at line 39 of file JXCConnection.java.
com.realtime.crossfire.jxclient.window.JXCConnection.JXCConnection | ( | @NotNull final KeybindingsManager | keybindingsManager, |
@NotNull final Shortcuts | shortcuts, | ||
@NotNull final Settings | settings, | ||
@NotNull final Pickup | characterPickup, | ||
@NotNull final CrossfireServerConnection | server, | ||
@NotNull final GuiStateManager | guiStateManager, | ||
@NotNull final Logger | logger | ||
) |
Creates a new instance.
keybindingsManager | the keybindings manager to update |
shortcuts | the shortcuts to update |
settings | the settings instance to use |
characterPickup | the character pickup instance to update |
server | the crossfire server connection instance used to connect |
guiStateManager | the gui state manager to watch |
logger | the logger to notify about changed server names |
Definition at line 180 of file JXCConnection.java.
References com.realtime.crossfire.jxclient.window.JXCConnection.characterPickup, com.realtime.crossfire.jxclient.window.JXCConnection.guiStateListener, com.realtime.crossfire.jxclient.window.JXCConnection.keybindingsManager, com.realtime.crossfire.jxclient.window.JXCConnection.logger, com.realtime.crossfire.jxclient.window.JXCConnection.server, com.realtime.crossfire.jxclient.window.JXCConnection.settings, and com.realtime.crossfire.jxclient.window.JXCConnection.shortcuts.
|
private |
Connects to the Crossfire server.
Definition at line 309 of file JXCConnection.java.
References com.realtime.crossfire.jxclient.server.server.ServerConnection.connect(), com.realtime.crossfire.jxclient.window.JXCConnection.hostname, com.realtime.crossfire.jxclient.window.JXCConnection.port, and com.realtime.crossfire.jxclient.window.JXCConnection.server.
|
private |
Disconnects from the Crossfire server.
reason | the reason for the disconnect |
Definition at line 301 of file JXCConnection.java.
References com.realtime.crossfire.jxclient.server.server.ServerConnection.disconnect(), com.realtime.crossfire.jxclient.window.JXCConnection.server, and com.realtime.crossfire.jxclient.window.JXCConnection.setHost().
String com.realtime.crossfire.jxclient.window.JXCConnection.getHostname | ( | ) |
Returns the currently connected server.
Definition at line 204 of file JXCConnection.java.
References com.realtime.crossfire.jxclient.window.JXCConnection.hostname.
Referenced by com.realtime.crossfire.jxclient.window.GuiManager.openDialog(), com.realtime.crossfire.jxclient.window.GuiManager.openQueryDialog(), com.realtime.crossfire.jxclient.window.GuiManager.selectCharacter(), com.realtime.crossfire.jxclient.window.GuiManager.setAccountName(), and com.realtime.crossfire.jxclient.window.GuiManager.updatePlayerName().
int com.realtime.crossfire.jxclient.window.JXCConnection.getPort | ( | ) |
Returns the currently connected port.
Definition at line 212 of file JXCConnection.java.
References com.realtime.crossfire.jxclient.window.JXCConnection.port.
void com.realtime.crossfire.jxclient.window.JXCConnection.setCharacter | ( | @Nullable final String | character | ) |
Updates the active character name.
character | the active character; null |
Definition at line 220 of file JXCConnection.java.
References com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.addCrossfirePickupListener(), com.realtime.crossfire.jxclient.window.JXCConnection.character, com.realtime.crossfire.jxclient.settings.Settings.getLong(), com.realtime.crossfire.jxclient.settings.options.Pickup.getPickupMode(), com.realtime.crossfire.jxclient.settings.SettingsEntries.getPickupSettingsEntry(), com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.loadPerCharacterBindings(), com.realtime.crossfire.jxclient.window.ShortcutsLoader.loadShortcuts(), com.realtime.crossfire.jxclient.settings.options.Pickup.PU_NOTHING, com.realtime.crossfire.jxclient.settings.Settings.putLong(), com.realtime.crossfire.jxclient.settings.Settings.remove(), com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.removeCrossfirePickupListener(), com.realtime.crossfire.jxclient.window.ShortcutsLoader.saveShortcuts(), com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.unloadPerCharacterBindings(), com.realtime.crossfire.jxclient.settings.options.Pickup.updatePickupMode(), and com.realtime.crossfire.jxclient.window.JXCConnection.updateTitle().
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.setHost().
void com.realtime.crossfire.jxclient.window.JXCConnection.setFrame | ( | @Nullable final Frame | frame | ) |
Sets the Frame for updating the title.
frame | the frame or null |
Definition at line 194 of file JXCConnection.java.
References com.realtime.crossfire.jxclient.window.JXCConnection.frame, and com.realtime.crossfire.jxclient.window.JXCConnection.updateTitle().
void com.realtime.crossfire.jxclient.window.JXCConnection.setHost | ( | @Nullable final String | serverInfo | ) |
Updates information about the connected host.
serverInfo | the hostname; null |
Definition at line 273 of file JXCConnection.java.
References com.realtime.crossfire.jxclient.window.JXCConnection.DEFAULT_CROSSFIRE_PORT, com.realtime.crossfire.jxclient.window.JXCConnection.hostname, com.realtime.crossfire.jxclient.window.JXCConnection.logger, com.realtime.crossfire.jxclient.util.NumberParser.parseInt(), com.realtime.crossfire.jxclient.window.JXCConnection.port, com.realtime.crossfire.jxclient.settings.Settings.putString(), com.realtime.crossfire.jxclient.settings.SettingsEntries.SERVER, com.realtime.crossfire.jxclient.window.JXCConnection.setCharacter(), com.realtime.crossfire.jxclient.window.Logger.setHostname(), com.realtime.crossfire.jxclient.window.JXCConnection.settings, and com.realtime.crossfire.jxclient.window.JXCConnection.updateTitle().
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.disconnect().
|
private |
Updates the window title to reflect the current connection state.
Definition at line 254 of file JXCConnection.java.
References com.realtime.crossfire.jxclient.window.JXCConnection.character, com.realtime.crossfire.jxclient.window.JXCConnection.hostname, and com.realtime.crossfire.jxclient.window.JXCConnection.TITLE_PREFIX.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.setCharacter(), com.realtime.crossfire.jxclient.window.JXCConnection.setFrame(), and com.realtime.crossfire.jxclient.window.JXCConnection.setHost().
|
private |
The currently logged in character.
Set to
if not logged in.
Definition at line 110 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.setCharacter(), and com.realtime.crossfire.jxclient.window.JXCConnection.updateTitle().
|
private |
The Pickup instance to update.
Definition at line 80 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.JXCConnection().
|
private |
The CrossfirePickupListener for tracking pickup mode changes.
Definition at line 161 of file JXCConnection.java.
|
staticprivate |
The default port number for Crossfire servers.
Definition at line 44 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.setHost().
|
private |
The Frame for updating the title or.
.
Definition at line 74 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.setFrame().
|
private |
The GuiStateListener for detecting established or dropped connections.
Definition at line 118 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.JXCConnection().
|
private |
The currently connected server.
Set to
if unconnected.
Definition at line 99 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.connect(), com.realtime.crossfire.jxclient.window.JXCConnection.getHostname(), com.realtime.crossfire.jxclient.window.JXCConnection.setHost(), and com.realtime.crossfire.jxclient.window.JXCConnection.updateTitle().
|
private |
The KeybindingsManager to update.
Definition at line 56 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.JXCConnection().
|
private |
The Logger that is notified about changed server names.
Definition at line 93 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.JXCConnection(), and com.realtime.crossfire.jxclient.window.JXCConnection.setHost().
|
private |
The currently connected port.
Only valid if hostname is set.
Definition at line 104 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.connect(), com.realtime.crossfire.jxclient.window.JXCConnection.getPort(), and com.realtime.crossfire.jxclient.window.JXCConnection.setHost().
|
private |
The CrossfireServerConnection instance used to connect to the Crossfire server.
Definition at line 87 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.connect(), com.realtime.crossfire.jxclient.window.JXCConnection.disconnect(), and com.realtime.crossfire.jxclient.window.JXCConnection.JXCConnection().
|
private |
The settings instance to use.
Definition at line 68 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.JXCConnection(), and com.realtime.crossfire.jxclient.window.JXCConnection.setHost().
|
private |
The Shortcuts to update.
Definition at line 62 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.JXCConnection().
|
staticprivate |
The prefix for the window title.
Definition at line 50 of file JXCConnection.java.
Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.updateTitle().