public class JXCWindow
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private CrossfireAccountListener |
accountListener
The
CrossfireAccountListener attached to server . |
private CharacterModel |
characterModel
The
CharacterModel to update. |
private CommandQueue |
commandQueue
The command queue instance for this window.
|
private CrossfireQueryListener |
crossfireQueryListener
The
CrossfireQueryListener attached to server . |
private CrossfireUpdateItemListener |
crossfireUpdateItemListener
The
CrossfireUpdateItemListener to receive item updates. |
static boolean |
DISABLE_START_GUI
TODO: Remove when more options are implemented in the start screen gui.
|
private Exiter |
exiter
The
Exiter to use. |
private javax.swing.JFrame |
frame
The main window.
|
private GuiManager |
guiManager
The
GuiManager for controlling the main GUI state. |
private GuiStateListener |
guiStateListener
The
GuiStateListener for detecting established or dropped
connections. |
private KeyHandler |
keyHandler
The
KeyHandler for processing keyboard input. |
private java.awt.event.KeyListener |
keyListener
The
KeyListener attached to the main window. |
private OptionManager |
optionManager
The option manager for this window.
|
private SentReplyListener |
sentReplyListener
The
SentReplyListener for detecting "reply" commands sent to the
server. |
private CrossfireServerConnection |
server
The
CrossfireServerConnection to use. |
private java.awt.event.WindowFocusListener |
windowFocusListener
The
WindowFocusListener registered for this window. |
private java.awt.event.WindowListener |
windowListener
The window listener attached to this frame.
|
private JXCWindowRenderer |
windowRenderer
The
JXCWindowRenderer for this window. |
Constructor and Description |
---|
JXCWindow(Exiter exiter,
CrossfireServerConnection server,
OptionManager optionManager,
GuiStateManager guiStateManager,
JXCWindowRenderer windowRenderer,
CommandQueue commandQueue,
GuiManager guiManager,
KeyHandler keyHandler,
CharacterModel characterModel,
JXCConnection connection)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
init(Resolution resolution,
java.lang.String skinName,
boolean fullScreen,
SkinLoader skinLoader)
Initializes the instance: loads and displays the skin.
|
void |
term()
Frees all resources.
|
@NotNull private final CrossfireAccountListener accountListener
CrossfireAccountListener
attached to server
.@NotNull private final CharacterModel characterModel
CharacterModel
to update.@NotNull private final CommandQueue commandQueue
@NotNull private final CrossfireQueryListener crossfireQueryListener
CrossfireQueryListener
attached to server
. It parses
query messages to open/close dialogs.@NotNull private final CrossfireUpdateItemListener crossfireUpdateItemListener
CrossfireUpdateItemListener
to receive item updates.public static final boolean DISABLE_START_GUI
@NotNull private final javax.swing.JFrame frame
@NotNull private final GuiManager guiManager
GuiManager
for controlling the main GUI state.@NotNull private final GuiStateListener guiStateListener
GuiStateListener
for detecting established or dropped
connections.@NotNull private final KeyHandler keyHandler
KeyHandler
for processing keyboard input.@NotNull private final java.awt.event.KeyListener keyListener
KeyListener
attached to the main window.@NotNull private final OptionManager optionManager
@NotNull private final SentReplyListener sentReplyListener
SentReplyListener
for detecting "reply" commands sent to the
server.@NotNull private final CrossfireServerConnection server
CrossfireServerConnection
to use.@NotNull private final java.awt.event.WindowFocusListener windowFocusListener
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.@NotNull private final java.awt.event.WindowListener windowListener
@NotNull private final JXCWindowRenderer windowRenderer
JXCWindowRenderer
for this window.public JXCWindow(@NotNull Exiter exiter, @NotNull CrossfireServerConnection server, @NotNull OptionManager optionManager, @NotNull GuiStateManager guiStateManager, @NotNull JXCWindowRenderer windowRenderer, @NotNull CommandQueue commandQueue, @NotNull GuiManager guiManager, @NotNull KeyHandler keyHandler, @NotNull CharacterModel characterModel, @NotNull JXCConnection connection)
exiter
- the exiter to useserver
- the crossfire server connection to useoptionManager
- the option manager instance to useguiStateManager
- the gui state manager to usewindowRenderer
- the window renderer to usecommandQueue
- the command queue instanceguiManager
- the gui manager instancekeyHandler
- the key handler for keyboard inputcharacterModel
- the character model to updateconnection
- the connection to updatepublic void init(@Nullable Resolution resolution, @NotNull java.lang.String skinName, boolean fullScreen, @NotNull SkinLoader skinLoader)
resolution
- the size of the client area, null
for defaultskinName
- the skin to loadfullScreen
- whether full-screen mode should be enabledskinLoader
- the skin loader instancepublic void term()