Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.main.JXCWindow Class Reference

The main window. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.main.JXCWindow:

Public Member Functions

void init (@Nullable final Resolution resolution, @NotNull final String skinName, final boolean fullScreen, @NotNull final SkinLoader skinLoader)
 Initializes the instance: loads and displays the skin. More...
 
 JXCWindow (@NotNull final Exiter exiter, @NotNull final CrossfireServerConnection server, @NotNull final OptionManager optionManager, @NotNull final GuiStateManager guiStateManager, @NotNull final JXCWindowRenderer windowRenderer, @NotNull final CommandQueue commandQueue, @NotNull final GuiManager guiManager, @NotNull final KeyHandler keyHandler, @NotNull final CharacterModel characterModel, @NotNull final JXCConnection connection)
 Creates a new instance. More...
 
void term ()
 Frees all resources. More...
 

Static Public Attributes

static final boolean DISABLE_START_GUI = true
 TODO: Remove when more options are implemented in the start screen gui. More...
 

Private Attributes

final CrossfireAccountListener accountListener
 The CrossfireAccountListener attached to server. More...
 
final CharacterModel characterModel
 The CharacterModel to update. More...
 
final CommandQueue commandQueue
 The command queue instance for this window. More...
 
final CrossfireQueryListener crossfireQueryListener
 The CrossfireQueryListener attached to server. More...
 
final CrossfireUpdateItemListener crossfireUpdateItemListener
 The CrossfireUpdateItemListener to receive item updates. More...
 
final Exiter exiter
 The Exiter to use. More...
 
final JFrame frame = new JFrame("")
 The main window. More...
 
final GuiManager guiManager
 The GuiManager for controlling the main GUI state. More...
 
final GuiStateListener guiStateListener
 The GuiStateListener for detecting established or dropped connections. More...
 
final KeyHandler keyHandler
 The KeyHandler for processing keyboard input. More...
 
final KeyListener keyListener
 The KeyListener attached to the main window. More...
 
final OptionManager optionManager
 The option manager for this window. More...
 
final SentReplyListener sentReplyListener
 The SentReplyListener for detecting "reply" commands sent to the server. More...
 
final CrossfireServerConnection server
 The CrossfireServerConnection to use. More...
 
final WindowFocusListener windowFocusListener
 The WindowFocusListener registered for this window. More...
 
final WindowListener windowListener
 The window listener attached to this frame. More...
 
final JXCWindowRenderer windowRenderer
 The JXCWindowRenderer for this window. More...
 

Detailed Description

The main window.

Author
Lauwenmark
Andreas Kirschbaum

Definition at line 67 of file JXCWindow.java.

Constructor & Destructor Documentation

◆ JXCWindow()

com.realtime.crossfire.jxclient.main.JXCWindow.JXCWindow ( @NotNull final Exiter  exiter,
@NotNull final CrossfireServerConnection  server,
@NotNull final OptionManager  optionManager,
@NotNull final GuiStateManager  guiStateManager,
@NotNull final JXCWindowRenderer  windowRenderer,
@NotNull final CommandQueue  commandQueue,
@NotNull final GuiManager  guiManager,
@NotNull final KeyHandler  keyHandler,
@NotNull final CharacterModel  characterModel,
@NotNull final JXCConnection  connection 
)

Creates a new instance.

Parameters
exiterthe exiter to use
serverthe crossfire server connection to use
optionManagerthe option manager instance to use
guiStateManagerthe gui state manager to use
windowRendererthe window renderer to use
commandQueuethe command queue instance
guiManagerthe gui manager instance
keyHandlerthe key handler for keyboard input
characterModelthe character model to update
connectionthe connection to update

Definition at line 424 of file JXCWindow.java.

References com.realtime.crossfire.jxclient.main.JXCWindow.accountListener, com.realtime.crossfire.jxclient.util.ResourceUtils.APPLICATION_ICON, com.realtime.crossfire.jxclient.main.JXCWindow.characterModel, com.realtime.crossfire.jxclient.main.JXCWindow.commandQueue, com.realtime.crossfire.jxclient.main.JXCWindow.exiter, com.realtime.crossfire.jxclient.main.JXCWindow.frame, com.realtime.crossfire.jxclient.main.JXCWindow.guiManager, com.realtime.crossfire.jxclient.main.JXCWindow.guiStateListener, com.realtime.crossfire.jxclient.main.JXCWindow.keyHandler, com.realtime.crossfire.jxclient.main.JXCWindow.keyListener, com.realtime.crossfire.jxclient.util.ResourceUtils.loadImage(), com.realtime.crossfire.jxclient.main.JXCWindow.optionManager, com.realtime.crossfire.jxclient.main.JXCWindow.sentReplyListener, com.realtime.crossfire.jxclient.main.JXCWindow.server, com.realtime.crossfire.jxclient.main.JXCWindow.windowFocusListener, com.realtime.crossfire.jxclient.main.JXCWindow.windowListener, and com.realtime.crossfire.jxclient.main.JXCWindow.windowRenderer.

+ Here is the call graph for this function:

Member Function Documentation

◆ init()

void com.realtime.crossfire.jxclient.main.JXCWindow.init ( @Nullable final Resolution  resolution,
@NotNull final String  skinName,
final boolean  fullScreen,
@NotNull final SkinLoader  skinLoader 
)

Initializes the instance: loads and displays the skin.

Parameters
resolutionthe size of the client area,
null
for default
skinNamethe skin to load
fullScreenwhether full-screen mode should be enabled
skinLoaderthe skin loader instance

Definition at line 481 of file JXCWindow.java.

References com.realtime.crossfire.jxclient.util.Resolution.asDimension(), com.realtime.crossfire.jxclient.main.Options.DEFAULT_SKIN, com.realtime.crossfire.jxclient.util.Resolution.equals(), com.realtime.crossfire.jxclient.main.JXCWindow.frame, com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getDefaultKeyBindings(), com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getMaxResolution(), com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getMinResolution(), com.realtime.crossfire.jxclient.main.JXCWindow.guiManager, com.realtime.crossfire.jxclient.main.JXCWindow.keyHandler, com.realtime.crossfire.jxclient.window.DialogStateParser.load(), com.realtime.crossfire.jxclient.settings.options.OptionManager.loadOptions(), com.realtime.crossfire.jxclient.main.JXCWindow.optionManager, com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setFullScreenMode(), com.realtime.crossfire.jxclient.window.KeyHandler.setKeyBindings(), com.realtime.crossfire.jxclient.window.GuiManager.setSkin(), com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setWindowMode(), com.realtime.crossfire.jxclient.window.GuiManager.unsetSkin(), com.realtime.crossfire.jxclient.window.GuiManager.updateWindowSize(), and com.realtime.crossfire.jxclient.main.JXCWindow.windowRenderer.

Referenced by com.realtime.crossfire.jxclient.main.JXClient.JXClient().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ term()

void com.realtime.crossfire.jxclient.main.JXCWindow.term ( )

Member Data Documentation

◆ accountListener

final CrossfireAccountListener com.realtime.crossfire.jxclient.main.JXCWindow.accountListener
private

◆ characterModel

final CharacterModel com.realtime.crossfire.jxclient.main.JXCWindow.characterModel
private

The CharacterModel to update.

Definition at line 120 of file JXCWindow.java.

Referenced by com.realtime.crossfire.jxclient.main.JXCWindow.JXCWindow().

◆ commandQueue

final CommandQueue com.realtime.crossfire.jxclient.main.JXCWindow.commandQueue
private

The command queue instance for this window.

Definition at line 96 of file JXCWindow.java.

Referenced by com.realtime.crossfire.jxclient.main.JXCWindow.JXCWindow().

◆ crossfireQueryListener

final CrossfireQueryListener com.realtime.crossfire.jxclient.main.JXCWindow.crossfireQueryListener
private
Initial value:
= new CrossfireQueryListener() {
@Override
public void commandQueryReceived(@NotNull final String prompt, final int queryType) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
guiManager.openQueryDialog(prompt, queryType);
}
});
}
}

The CrossfireQueryListener attached to server.

It parses query messages to open/close dialogs.

Definition at line 243 of file JXCWindow.java.

◆ crossfireUpdateItemListener

final CrossfireUpdateItemListener com.realtime.crossfire.jxclient.main.JXCWindow.crossfireUpdateItemListener
private

The CrossfireUpdateItemListener to receive item updates.

Definition at line 154 of file JXCWindow.java.

◆ DISABLE_START_GUI

final boolean com.realtime.crossfire.jxclient.main.JXCWindow.DISABLE_START_GUI = true
static

TODO: Remove when more options are implemented in the start screen gui.

Definition at line 72 of file JXCWindow.java.

Referenced by com.realtime.crossfire.jxclient.main.JXClient.JXClient().

◆ exiter

final Exiter com.realtime.crossfire.jxclient.main.JXCWindow.exiter
private

The Exiter to use.

Definition at line 78 of file JXCWindow.java.

Referenced by com.realtime.crossfire.jxclient.main.JXCWindow.JXCWindow().

◆ frame

final JFrame com.realtime.crossfire.jxclient.main.JXCWindow.frame = new JFrame("")
private

◆ guiManager

final GuiManager com.realtime.crossfire.jxclient.main.JXCWindow.guiManager
private

◆ guiStateListener

final GuiStateListener com.realtime.crossfire.jxclient.main.JXCWindow.guiStateListener
private

The GuiStateListener for detecting established or dropped connections.

Definition at line 265 of file JXCWindow.java.

Referenced by com.realtime.crossfire.jxclient.main.JXCWindow.JXCWindow().

◆ keyHandler

final KeyHandler com.realtime.crossfire.jxclient.main.JXCWindow.keyHandler
private

◆ keyListener

final KeyListener com.realtime.crossfire.jxclient.main.JXCWindow.keyListener
private
Initial value:
= new KeyListener() {
@Override
public void keyTyped(@NotNull final KeyEvent e) {
}
@Override
public void keyPressed(@NotNull final KeyEvent e) {
}
@Override
public void keyReleased(@NotNull final KeyEvent e) {
}
}

The KeyListener attached to the main window.

Definition at line 219 of file JXCWindow.java.

Referenced by com.realtime.crossfire.jxclient.main.JXCWindow.JXCWindow().

◆ optionManager

final OptionManager com.realtime.crossfire.jxclient.main.JXCWindow.optionManager
private

◆ sentReplyListener

final SentReplyListener com.realtime.crossfire.jxclient.main.JXCWindow.sentReplyListener
private
Initial value:
= new SentReplyListener() {
@Override
public void replySent() {
}
}

The SentReplyListener for detecting "reply" commands sent to the server.

Definition at line 316 of file JXCWindow.java.

Referenced by com.realtime.crossfire.jxclient.main.JXCWindow.JXCWindow().

◆ server

final CrossfireServerConnection com.realtime.crossfire.jxclient.main.JXCWindow.server
private

◆ windowFocusListener

final WindowFocusListener com.realtime.crossfire.jxclient.main.JXCWindow.windowFocusListener
private
Initial value:
= new WindowAdapter() {
@Override
public void windowLostFocus(final WindowEvent e) {
}
}

The WindowFocusListener registered for this window.

It resets the keyboard modifier state when the window loses the focus. The idea is to prevent the following: user switches from JXClient to another window with CTRL+ALT+direction key. This makes JXClient enter RUN mode since CTRL was pressed. The following key release event is not received by JXClient because it does not own the focus. Therefore JXClient's CTRL state is still active when the user switches back to JXClient. A following direction key then causes the character to run which is not what the player wants.

Definition at line 141 of file JXCWindow.java.

Referenced by com.realtime.crossfire.jxclient.main.JXCWindow.JXCWindow().

◆ windowListener

final WindowListener com.realtime.crossfire.jxclient.main.JXCWindow.windowListener
private
Initial value:
= new WindowAdapter() {
@Override
public void windowClosing(@NotNull final WindowEvent e) {
}
}
@Override
public void windowClosed(@NotNull final WindowEvent e) {
if (!frame.isVisible()) {
}
}
}

The window listener attached to this frame.

Definition at line 196 of file JXCWindow.java.

Referenced by com.realtime.crossfire.jxclient.main.JXCWindow.JXCWindow().

◆ windowRenderer

final JXCWindowRenderer com.realtime.crossfire.jxclient.main.JXCWindow.windowRenderer
private

The documentation for this class was generated from the following file: