java.lang.Object com.realtime.crossfire.jxclient.main.DefaultKeyHandler
public class DefaultKeyHandler
A KeyHandlerListener
which updates the state of a GuiManager
.
Field Summary | |
---|---|
private ClientSocketListener |
clientSocketListener
The ClientSocketListener used to detect connection state
changes. |
private boolean |
connected
Whether a server connection is active. |
private Exiter |
exiter
The Exiter instance. |
private GuiManager |
guiManager
The GuiManager instance. |
private GuiStateManager |
guiStateManager
The GuiStateManager instance. |
private java.lang.Object |
semaphoreConnected
The synchronization object for accesses to connected . |
Constructor Summary | |
---|---|
DefaultKeyHandler(Exiter exiter,
GuiManager guiManager,
ServerConnection server,
GuiStateManager guiStateManager)
Creates a new instance. |
Method Summary | |
---|---|
void |
escPressed()
The ESC key has been pressed. |
private boolean |
isConnected()
Returns whether a server connection is active. |
void |
keyReleased()
A key (but not ESC) has been released. |
private void |
setConnected(boolean connected)
Records whether a server connection is active. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private final ClientSocketListener clientSocketListener
ClientSocketListener
used to detect connection state
changes.
private boolean connected
@NotNull private final Exiter exiter
Exiter
instance.
@NotNull private final GuiManager guiManager
GuiManager
instance.
@NotNull private final GuiStateManager guiStateManager
GuiStateManager
instance.
@NotNull private final java.lang.Object semaphoreConnected
connected
.
Constructor Detail |
---|
public DefaultKeyHandler(@NotNull Exiter exiter, @NotNull GuiManager guiManager, @NotNull ServerConnection server, @NotNull GuiStateManager guiStateManager)
exiter
- the exiter instanceguiManager
- the gui manager instanceserver
- the server connection to trackguiStateManager
- the gui state manager instanceMethod Detail |
---|
public void escPressed()
escPressed
in interface KeyHandlerListener
private boolean isConnected()
public void keyReleased()
keyReleased
in interface KeyHandlerListener
private void setConnected(boolean connected)
connected
- whether a server connection is active