Crossfire JXClient, Trunk
GuiManager.java
Go to the documentation of this file.
1 /*
2  * This file is part of JXClient, the Fullscreen Java Crossfire Client.
3  *
4  * JXClient is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * JXClient is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with JXClient; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * Copyright (C) 2005-2008 Yann Chachkoff
19  * Copyright (C) 2006-2017,2019-2023 Andreas Kirschbaum
20  * Copyright (C) 2010-2012,2014-2018,2020-2023 Nicolas Weeger
21  */
22 
23 package com.realtime.crossfire.jxclient.window;
24 
51 import java.util.Collection;
52 import java.util.HashMap;
53 import java.util.Locale;
54 import java.util.Map;
55 import java.util.concurrent.atomic.AtomicBoolean;
56 import org.jetbrains.annotations.NotNull;
57 import org.jetbrains.annotations.Nullable;
58 
63 public class GuiManager {
64 
68  @Nullable
69  private JXCSkin skin;
70 
74  @NotNull
76 
80  @Nullable
81  private Gui queryDialog;
82 
86  @Nullable
87  private Gui keybindDialog;
88 
92  @NotNull
94 
99  @Nullable
100  private Gui dialogQuit;
101 
106  @Nullable
108 
113  @Nullable
115 
120  @Nullable
122 
127 
133  @NotNull
135 
139  @NotNull
140  private final Settings settings;
141 
145  @NotNull
146  private final JXCConnection connection;
147 
151  @NotNull
153 
157  @NotNull
158  private final Map<String, Gui> dialogs = new HashMap<>();
159 
163  @NotNull
165 
166  @Override
167  public void commandDrawextinfoReceived(final int color, final int type, final int subtype, @NotNull final String message) {
168  if (skin == null) {
169  throw new IllegalStateException("no skin set");
170  }
171 
172  @Nullable final Gui dialog;
173  String effectiveMessage = message;
174  switch (type) {
176  dialog = skin.getDialogBook(1);
177  final AbstractLabel title = dialog.getFirstElementEndingWith(AbstractLabel.class, "_title");
178  if (title != null) {
179  final String[] tmp = message.split("\n", 2);
180  title.setText(tmp[0]);
181  effectiveMessage = tmp.length >= 2 ? tmp[1] : "";
182  }
183  break;
184 
190  dialog = null;
191  break;
192 
194  /*
195  * We do not display a MOTD dialog, because it interferes with the
196  * query dialog that gets displayed just after it.
197  */
198  dialog = null;
199  break;
200 
214  dialog = null;
215  break;
216 
217  default:
218  dialog = null;
219  break;
220  }
221 
222  if (dialog == null) {
223  return;
224  }
225 
226  final AbstractLabel label = dialog.getFirstElementNotEndingWith(AbstractLabel.class, "_title");
227  if (label == null) {
228  final GUILabelLog log = dialog.getFirstElement(GUILabelLog.class);
229  if (log != null) {
230  log.updateText(effectiveMessage, type, subtype);
231  }
232  } else {
233  label.setText(effectiveMessage);
234  }
235  openDialog(dialog, false);
236  }
237 
238  @Override
239  public void setDebugMode(final boolean printMessageTypes) {
240  // ignore
241  }
242 
243  };
244 
249  @NotNull
251 
252  @Override
253  public void failure(@NotNull final String command, @NotNull final String arguments) {
254  if (command.equals("accountlogin") && skin != null) {
255  try {
256  final Gui dialog = skin.getDialog("account_login");
257  final GUIText passwordField = dialog.getFirstElement(GUIText.class, "account_password");
258  if (passwordField != null) {
259  passwordField.setText("");
260  passwordField.setActive(true);
261  }
262  } catch (final JXCSkinException ignored) {
263  // ignore if dialog doesn't exist
264  }
265  } else if (command.equals("accountaddplayer") && skin != null) {
266  try {
267  final Gui dialog = skin.getDialog("account_link");
268  final GUIText loginField = dialog.getFirstElement(GUIText.class, "character_login");
269  final GUIText passwordField = dialog.getFirstElement(GUIText.class, "character_password");
270  final String argumentsLower = arguments.toLowerCase(Locale.ENGLISH);
271  if (argumentsLower.contains("password")) {
272  if (passwordField != null) {
273  passwordField.setText("");
274  passwordField.setActive(true);
275  }
276  } else if (argumentsLower.contains("character")) {
277  if (loginField != null) {
278  loginField.setActive(true);
279  }
280  } else {
281  if (passwordField != null) {
282  passwordField.setActive(true);
283  }
284  }
285  } catch (final JXCSkinException ignored) {
286  // ignore if dialog doesn't exist
287  }
288  } else if (command.equals("accountnew") && skin != null) {
289  try {
290  final Gui dialog = skin.getDialog("account_create");
291  final GUIText loginField = dialog.getFirstElement(GUIText.class, "account_login");
292  final GUIText passwordField = dialog.getFirstElement(GUIText.class, "account_password");
293  final GUIText passwordConfirmField = dialog.getFirstElement(GUIText.class, "account_password_confirm");
294  final String argumentsLower = arguments.toLowerCase(Locale.ENGLISH);
295  if (argumentsLower.contains("password")) {
296  if (passwordField != null) {
297  passwordField.setText("");
298  passwordField.setActive(true);
299  }
300  if (passwordConfirmField != null) {
301  passwordConfirmField.setText("");
302  }
303  } else if (argumentsLower.contains("account")) {
304  if (loginField != null) {
305  loginField.setActive(true);
306  }
307  } else {
308  if (passwordField != null) {
309  passwordField.setActive(true);
310  }
311  }
312  } catch (final JXCSkinException ignored) {
313  // ignore if dialog doesn't exist
314  }
315  } else if (command.equals("createplayer") && skin != null) {
316  try {
317  final Gui dialog = skin.getDialog("account_character_new");
318  final GUIText loginField = dialog.getFirstElement(GUIText.class, "account_character_create");
319  if (loginField != null) {
320  loginField.setActive(true);
321  }
322  } catch (final JXCSkinException ignored) {
323  // ignore if dialog doesn't exist
324  }
325  }
326  }
327 
328  @Override
329  public void clearFailure() {
330  // ignore
331  }
332 
333  };
334 
339  @NotNull
340  @SuppressWarnings("FieldCanBeLocal")
342 
343  @Override
344  public void start() {
345  closeTransientDialogs(false);
349  showGUIStart();
350  }
351 
352  @Override
353  public void metaserver() {
354  closeTransientDialogs(false);
358  showGUIMeta();
360  }
361 
362  @Override
363  public void preConnecting(@NotNull final String serverInfo) {
364  // ignore
365  }
366 
367  @Override
368  public void connecting(@NotNull final String serverInfo) {
369  if (skin == null) {
370  throw new IllegalStateException("no skin set");
371  }
372 
373  closeTransientDialogs(false);
378  showGUIMain();
379  if (dialogConnect != null) {
380  openDialog(dialogConnect, false);
382  }
383  }
384 
385  @Override
386  public void connecting(@NotNull final ClientSocketState clientSocketState, @NotNull final String param) {
387  updateConnectLabel(clientSocketState, param);
388  }
389 
390  @Override
391  public void connected() {
392  closeTransientDialogs(true);
393  }
394 
395  @Override
396  public void connectFailed(@NotNull final String reason) {
397  closeTransientDialogs(false);
398  if (dialogConnect != null) {
399  openDialog(dialogConnect, false);
401  }
402  }
403 
404  };
405 
417  public GuiManager(@NotNull final GuiStateManager guiStateManager, @NotNull final TooltipManagerImpl tooltipManager, @NotNull final Settings settings, @NotNull final CrossfireServerConnection server, @NotNull final JXCWindowRenderer windowRenderer, @NotNull final GuiFactory guiFactory, @NotNull final KeybindingsManager keybindingsManager, @NotNull final JXCConnection connection) {
418  this.tooltipManager = tooltipManager;
419  this.settings = settings;
420  this.server = server;
421  this.windowRenderer = windowRenderer;
422  this.keybindingsManager = keybindingsManager;
423  this.connection = connection;
424  guiStateManager.addGuiStateListener(guiStateListener);
425  windowRenderer.setCurrentGui(guiFactory.newGui("empty"));
426  queryDialog = guiFactory.newGui("query");
427  keybindDialog = guiFactory.newGui("keybind");
428  }
429 
435  public void addDialog(@NotNull final String name, @NotNull final Gui dialog) {
436  dialogs.put(name, dialog);
437  }
438 
442  public void playerReceived() {
444  openDialogByName("messages"); // hack for race selection
445  }
447  }
448 
453  public void manageAccount() {
454  if (dialogConnect != null) {
456  }
459  openDialogByName("account_login");
460  }
461 
466  public void showCharacters(final int count) {
469  }
471  if (count == 0) {
472  openDialogByName("account_character_new");
473  } else {
474  openDialogByName("account_characters");
475  }
476  }
477 
481  public void hideAccountWindows() {
482  closeDialogByName("account_login");
483  closeDialogByName("account_create");
484  closeDialogByName("account_characters");
485  closeDialogByName("account_link");
486  closeDialogByName("account_character_new");
487  closeDialogByName("account_password");
488  }
489 
494  public boolean openQuitDialog() {
497  }
498 
499  if (dialogQuit == null) {
500  return false;
501  }
502 
503  if (dialogDisconnect != null) {
505  }
506  assert dialogQuit != null;
507  openDialog(dialogQuit, false);
508  return true;
509  }
510 
517  @SuppressWarnings("StatementWithEmptyBody")
518  public EscAction escPressed(final boolean connected) {
520  assert keybindDialog != null;
522  } else if (windowRenderer.deactivateCommandInput()) {
523  // ignore
524  } else if (skin != null && closeDialog(skin.getDialogBook(1))) {
525  // ignore
526  } else if (connected) {
527  if (dialogDisconnect == null) {
528  return EscAction.DISCONNECT;
529  }
530  if (openDialog(dialogDisconnect, false)) {
531  if (dialogQuit != null) {
533  }
534  } else {
535  assert dialogDisconnect != null;
537  }
538  } else {
539  if (dialogQuit == null) {
540  return EscAction.QUIT;
541  }
542  if (openDialog(dialogQuit, false)) {
543  if (dialogDisconnect != null) {
545  }
546  } else {
547  assert dialogQuit != null;
549  }
550  }
551  return EscAction.IGNORE;
552  }
553 
559  public void openQueryDialog(@NotNull final String prompt, final int queryType) {
560  if (queryDialog == null) {
561  throw new IllegalStateException("query dialog not set");
562  }
563 
564  openDialog(queryDialog, false);
566  currentQueryDialogIsNamePrompt = prompt.startsWith("What is your name?");
568  final String hostname = connection.getHostname();
569  if (hostname != null) {
570  final String playerName = settings.getString(SettingsEntries.getPlayerSettingsEntry(hostname));
571  if (!playerName.isEmpty()) {
572  assert queryDialog != null;
573  final GUIText textArea = queryDialog.getFirstElement(GUIText.class);
574  if (textArea != null) {
575  textArea.setText(playerName);
576  }
577  }
578  }
579  } else if (prompt.startsWith("[y] to roll new stats") || prompt.startsWith("Welcome, Brave New Warrior!")) {
581  if (openDialogByName("new_char")) {
582  closeDialogByName("messages");
583  closeDialogByName("status");
584  } else {
585  // fallback: open both message and status dialogs if this skin
586  // does not define a login dialog
587  openDialogByName("messages");
588  openDialogByName("status");
589  }
590  assert queryDialog != null;
591  openDialog(queryDialog, false); // raise dialog
592  }
593  }
594 
600  public void openDialog(@NotNull final String name) {
601  final Gui dialog = dialogs.get(name);
602  if (dialog != null) {
603  openDialog(dialog, false);
604  }
605  }
606 
615  private boolean openDialog(@NotNull final Gui dialog, final boolean autoCloseOnDeactivate) {
616  final AtomicBoolean result = new AtomicBoolean();
618  result.set(windowRenderer.openDialog(dialog, autoCloseOnDeactivate));
619  if (dialog == queryDialog) {
620  setHideInput(false);
621  } else {
622  final AbstractLabel labelFailure = dialog.getFirstElement(GUILabelFailure.class);
623  if (labelFailure != null) {
624  labelFailure.setText("");
625  }
626 
627  final String name = dialog.getComponent().getName();
628  if (name != null) {
629  switch (name) {
630  case "account_login":
631  final GUIText loginField = dialog.getFirstElement(GUIText.class, "account_login");
632  if (loginField == null) {
633  final GUIText passwordField = dialog.getFirstElement(GUIText.class, "account_password");
634  if (passwordField != null) {
635  passwordField.setText("");
636  }
637  } else {
638  final String hostname = connection.getHostname();
639  if (hostname != null) {
640  final String accountName = settings.getString(SettingsEntries.getLoginAccountSettingsEntry(hostname));
641  if (accountName.isEmpty()) {
642  loginField.setText("");
643  loginField.setActive(true);
644 
645  final GUIText passwordField = dialog.getFirstElement(GUIText.class, "account_password");
646  if (passwordField != null) {
647  passwordField.setText("");
648  }
649  } else {
650  loginField.setText(accountName);
651 
652  final GUIText passwordField = dialog.getFirstElement(GUIText.class, "account_password");
653  if (passwordField != null) {
654  passwordField.setText("");
655  passwordField.setActive(true);
656  }
657  }
658  }
659  }
660  break;
661 
662  case "account_characters":
663  final GUICharacterList characterList = dialog.getFirstElement(GUICharacterList.class);
664  if (characterList != null) {
665  final String accountName = server.getAccountName();
666  if (accountName != null) {
667  final String hostname = connection.getHostname();
668  if (hostname != null) {
669  final String characterName = settings.getString(SettingsEntries.getLoginAccountSettingsEntry(hostname, accountName));
670  if (!characterName.isEmpty()) {
671  characterList.setCharacter(characterName);
672  }
673  }
674  }
675  }
676  break;
677 
678  case "account_character_new":
679  final GUIText characterField = dialog.getFirstElement(GUIText.class, "account_character_create");
680  if (characterField != null) {
681  characterField.setText("");
682  characterField.setActive(true);
683  }
684  break;
685  }
686  }
687  }
688  });
689  return result.get();
690  }
691 
696  public void toggleDialog(@NotNull final String name) {
697  final Gui dialog = dialogs.get(name);
698  if (dialog != null && windowRenderer.toggleDialog(dialog) && dialog == queryDialog) {
699  setHideInput(false);
700  }
701  }
702 
706  public void closeQueryDialog() {
707  if (queryDialog == null) {
708  throw new IllegalStateException("query dialog not set");
709  }
710 
712  }
713 
719  private boolean openDialogByName(@NotNull final String name) {
720  if (skin == null) {
721  throw new IllegalStateException("skin not set");
722  }
723 
724  final Gui dialog;
725  try {
726  dialog = skin.getDialog(name);
727  } catch (final JXCSkinException ignored) {
728  //System.err.println(ex.getLocalizedMessage());
729  return false;
730  }
731 
732  openDialog(dialog, false);
733  return true;
734  }
735 
740  private void closeDialogByName(@NotNull final String name) {
741  if (skin == null) {
742  throw new IllegalStateException("skin not set");
743  }
744 
745  final Gui dialog;
746  try {
747  dialog = skin.getDialog(name);
748  } catch (final JXCSkinException ignored) {
749  // ignore
750  return;
751  }
752  closeDialog(dialog);
753  }
754 
760  private void closeTransientDialogs(final boolean ignoreQueryDialog) {
761  if (queryDialog == null) {
762  throw new IllegalStateException("query dialog not set");
763  }
764  if (skin == null) {
765  throw new IllegalStateException("skin not set");
766  }
767 
768  if (dialogDisconnect != null) {
770  }
771  if (dialogQuit != null) {
773  }
774  if (dialogConnect != null) {
776  }
777  if (!ignoreQueryDialog) {
778  assert queryDialog != null;
780  }
781  assert skin != null;
783  }
784 
789  private void activateMetaserverGui() {
790  final String serverName = settings.getString(SettingsEntries.SERVER);
791  if (!serverName.isEmpty()) {
793  }
794  }
795 
799  private void openKeybindDialog() {
800  if (keybindDialog == null) {
801  throw new IllegalStateException("keybinding dialog not set");
802  }
803 
804  openDialog(keybindDialog, false);
805  }
806 
810  public void closeKeybindDialog() {
811  if (keybindDialog == null) {
812  throw new IllegalStateException("keybinding dialog not set");
813  }
814 
816  }
817 
822  public void closeDialog(@NotNull final String name) {
823  final Gui dialog = dialogs.get(name);
824  if (dialog != null) {
825  windowRenderer.closeDialog(dialog);
826  }
827  }
828 
835  private boolean closeDialog(@NotNull final Gui dialog) {
836  return windowRenderer.closeDialog(dialog);
837  }
838 
844  public void updatePlayerName(@NotNull final String playerName) {
846  final String hostname = connection.getHostname();
847  if (hostname != null) {
849  }
850  }
851  }
852 
861  @Nullable
863  // check visible dialogs
864  final GUIText textArea1 = windowRenderer.activateCommandInput();
865  if (textArea1 != null) {
866  return textArea1;
867  }
868 
869  // check invisible dialogs
870  assert skin != null;
871  for (Gui dialog : skin) {
872  final GUIText textArea3 = JXCWindowRenderer.activateCommandInput(dialog);
873  if (textArea3 != null) {
874  openDialog(dialog, true);
875  return textArea3;
876  }
877  }
878 
879  return null;
880  }
881 
890  public void activateCommandInput(@Nullable final String newText) {
891  final GUIText textArea = activateCommandInput();
892  if (textArea != null && newText != null && !newText.isEmpty()) {
893  textArea.setText(newText);
894  }
895  }
896 
900  public void unsetSkin() {
901  if (skin != null) {
902  skin.detach();
904  skin = null;
905  }
906 
907  queryDialog = null;
908  keybindDialog = null;
909  dialogQuit = null;
910  dialogDisconnect = null;
911  }
912 
917  public void setSkin(@NotNull final JXCSkin skin) {
918  this.skin = skin;
926  dialogConnectLabel = dialogConnect == null ? null : dialogConnect.getFirstElement(AbstractLabel.class, "message");
927  }
928 
932  private void showGUIStart() {
933  assert skin != null;
936  }
937 
941  private void showGUIMeta() {
942  assert skin != null;
943  final Gui gui = skin.getMetaInterface();
947  }
948 
952  private void showGUIMain() {
953  assert skin != null;
956  }
957 
961  public void term() {
963  if (skin != null) {
965  }
967  }
968 
976  private void updateConnectLabel(@NotNull final ClientSocketState clientSocketState, @Nullable final CharSequence param) {
977  if (dialogConnectLabel != null) {
978  final String message = switch (clientSocketState) {
979  case CONNECTING -> "Connecting...";
980  case VERSION -> "Exchanging version...";
981  case SETUP -> "Exchanging configuration...";
982  case REQUESTINFO -> param == null || param.isEmpty() ? "Requesting information" : "Requesting information: "+param;
983  case ACCOUNT_INFO -> "Starting account session...";
984  case ADDME -> "Joining the game...";
985  case CONNECTED -> "Done.";
986  case CONNECT_FAILED -> "Cannot connect to Crossfire server:\n"+param;
987  };
988  dialogConnectLabel.setText(message);
989  }
990  }
991 
998  public boolean createKeyBinding(final boolean perCharacter, @NotNull final CommandList cmdList) {
999  final boolean result = keybindingsManager.createKeyBinding(perCharacter, cmdList);
1000  if (result) {
1002  }
1003  return result;
1004  }
1005 
1012  public boolean removeKeyBinding(final boolean perCharacter) {
1013  final boolean result = keybindingsManager.removeKeyBinding(perCharacter);
1014  if (result) {
1016  }
1017  return result;
1018  }
1019 
1025  public void updateWindowSize(final int width, final int height) {
1026  if (skin != null) {
1027  assert skin != null;
1029  for (Gui dialog : skin) {
1030  dialog.autoSize(width, height);
1031  }
1032  tooltipManager.setScreenSize(width, height);
1033  });
1034  }
1035  }
1036 
1043  @NotNull
1044  public CommandList getCommandList(@NotNull final String args) throws NoSuchCommandException {
1045  if (skin == null) {
1046  throw new IllegalStateException("skin not set");
1047  }
1048 
1049  try {
1050  return skin.getCommandList(args);
1051  } catch (final JXCSkinException ex) {
1052  throw new NoSuchCommandException(ex.getMessage(), ex);
1053  }
1054  }
1055 
1060  @NotNull
1061  public Collection<String> getCommandListNames() {
1062  if (skin == null) {
1063  throw new IllegalStateException("skin not set");
1064  }
1065 
1066  return skin.getCommandListNames();
1067  }
1068 
1073  public void setAccountName(@NotNull final String accountName) {
1074  final String hostname = connection.getHostname();
1075  if (hostname != null) {
1077  }
1078  }
1079 
1085  public void selectCharacter(@NotNull final String accountName, @NotNull final String characterName) {
1086  final String hostname = connection.getHostname();
1087  if (hostname != null) {
1088  settings.putString(SettingsEntries.getLoginAccountSettingsEntry(hostname, accountName), characterName);
1089  }
1090  }
1091 
1097  private void setHideInput(final boolean hideInput) {
1098  assert queryDialog != null;
1099  final GUIText textArea = queryDialog.getFirstElement(GUIText.class);
1100  if (textArea != null) {
1101  textArea.setHideInput(hideInput);
1102  }
1103  }
1104 
1109  public void setOpaqueDialogBackground(final boolean opaque) {
1110  for (final Gui dialog : dialogs.values()) {
1111  dialog.setOpaqueDialogBackground(opaque);
1112  }
1113  }
1114 
1120  public void setShowSentCommands(final boolean showSentCommands) {
1121  for (final Gui dialog : dialogs.values()) {
1122  dialog.setShowSentCommands(showSentCommands);
1123  }
1124  }
1125 
1130  public void setShowTimestamps(final boolean showTimestamps) {
1131  for (final Gui dialog : dialogs.values()) {
1132  dialog.setShowTimestamps(showTimestamps);
1133  }
1134  }
1135 
1136 }
com.realtime.crossfire.jxclient.gui.textinput.GUIText
Abstract base class for text input fields.
Definition: GUIText.java:61
com.realtime.crossfire.jxclient.server.crossfire.CrossfireFailureListener
Interface for listeners interested in the "failure" messages received from the Crossfire server.
Definition: CrossfireFailureListener.java:33
com.realtime.crossfire.jxclient.util.SwingUtilities2
Utility class for Swing related functions.
Definition: SwingUtilities2.java:34
com.realtime.crossfire.jxclient
com.realtime.crossfire.jxclient.window.GuiManager.activateMetaserverGui
void activateMetaserverGui()
Called when the server selection GUI becomes active.
Definition: GuiManager.java:789
com.realtime.crossfire.jxclient.skin.skin
Definition: DefaultJXCSkin.java:23
com.realtime.crossfire.jxclient.window.GuiManager.showCharacters
void showCharacters(final int count)
Displays the window with the characters for an account.
Definition: GuiManager.java:466
com.realtime.crossfire.jxclient.window.GuiManager.getCommandListNames
Collection< String > getCommandListNames()
Returns all names of command lists.
Definition: GuiManager.java:1061
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getCommandList
CommandList getCommandList(@NotNull String name)
Returns a named command list.
com.realtime.crossfire.jxclient.window.GuiManager.skin
JXCSkin skin
The currently active skin.
Definition: GuiManager.java:69
com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.removeCrossfireDrawextinfoListener
void removeCrossfireDrawextinfoListener(@NotNull CrossfireDrawextinfoListener listener)
Removes the given listener from the list of objects listening to the drawextinfo S->C messages.
com.realtime.crossfire.jxclient.gui.gui.Gui
Combines a list of GUIElements to for a gui.
Definition: Gui.java:49
com.realtime.crossfire.jxclient.window.GuiManager.selectCharacter
void selectCharacter(@NotNull final String accountName, @NotNull final String characterName)
Updates the selected character name in an account.
Definition: GuiManager.java:1085
com.realtime.crossfire.jxclient.window.GuiManager.keybindingsManager
final KeybindingsManager keybindingsManager
The key bindings manager for this window.
Definition: GuiManager.java:93
com.realtime.crossfire.jxclient.server.crossfire.CrossfireQueryListener.HIDE_INPUT
int HIDE_INPUT
Query type: hide input being entered.
Definition: CrossfireQueryListener.java:48
com.realtime.crossfire.jxclient.settings.SettingsEntries
All defined entries in the settings file.
Definition: SettingsEntries.java:32
com.realtime.crossfire.jxclient.server
com.realtime.crossfire.jxclient.window.GuiManager.toggleDialog
void toggleDialog(@NotNull final String name)
Toggles a dialog.
Definition: GuiManager.java:696
com.realtime.crossfire.jxclient.window.JXCConnection
Definition: JXCConnection.java:41
com.realtime.crossfire.jxclient.window.GuiManager.dialogDisconnect
Gui dialogDisconnect
The "really disconnect?" dialog.
Definition: GuiManager.java:107
com.realtime.crossfire.jxclient.window.GuiManager.setOpaqueDialogBackground
void setOpaqueDialogBackground(final boolean opaque)
Sets whether the dialog's background is opaque.
Definition: GuiManager.java:1109
com.realtime.crossfire.jxclient.gui.gui.RendererGuiState.START
START
The start screen is active.
Definition: RendererGuiState.java:36
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.endRendering
void endRendering()
Ends rendering and reverts the display settings.
Definition: JXCWindowRenderer.java:612
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_MONUMENT
static final int MSG_TYPE_MONUMENT
drawextinfo message type: character did read a monument.
Definition: MessageType.java:58
com.realtime.crossfire.jxclient.window.GuiManager.setShowSentCommands
void setShowSentCommands(final boolean showSentCommands)
Sets whether the commands sent to the server should be shown in the messages dialog.
Definition: GuiManager.java:1120
com.realtime.crossfire.jxclient.skin
com.realtime.crossfire.jxclient.window.GuiManager.hideAccountWindows
void hideAccountWindows()
Hides all account-related windows.
Definition: GuiManager.java:481
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getDialogKeyBind
Gui getDialogKeyBind()
Returns the key bindings dialog.
com.realtime.crossfire.jxclient.window.EscAction.IGNORE
IGNORE
Ignore the key press.
Definition: EscAction.java:11
com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
Definition: CrossfireServerConnection.java:37
com.realtime.crossfire.jxclient.window.GuiManager.server
final CrossfireServerConnection server
The CrossfireServerConnection instance to monitor.
Definition: GuiManager.java:152
com.realtime.crossfire.jxclient.gui.list.GUICharacterList.setCharacter
void setCharacter(@NotNull final String characterName)
Selects an entry by character name.
Definition: GUICharacterList.java:185
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_SKILL
static final int MSG_TYPE_SKILL
drawextinfo message type: message related to using skills.
Definition: MessageType.java:94
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getMainInterface
Gui getMainInterface()
Returns the main window.
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setCurrentGui
void setCurrentGui(@NotNull final Gui gui)
Sets the Gui to display.
Definition: JXCWindowRenderer.java:746
com.realtime.crossfire.jxclient.window.GuiManager.updatePlayerName
void updatePlayerName(@NotNull final String playerName)
Sets the current player name.
Definition: GuiManager.java:844
com.realtime.crossfire.jxclient.window.GuiManager
Maintains the application's main GUI state.
Definition: GuiManager.java:63
com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.addCrossfireDrawextinfoListener
void addCrossfireDrawextinfoListener(@NotNull CrossfireDrawextinfoListener listener)
Adds a new listener monitoring the drawextinfo S->C messages.
com.realtime.crossfire.jxclient.gui.label
Definition: AbstractLabel.java:23
com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.setScreenSize
void setScreenSize(final int windowWidth, final int windowHeight)
Updates the current window size.
Definition: TooltipManagerImpl.java:97
com.realtime.crossfire.jxclient.gui.label.AbstractLabel
Abstract base class for all label classes.
Definition: AbstractLabel.java:43
com.realtime.crossfire.jxclient.window.GuiManager.setSkin
void setSkin(@NotNull final JXCSkin skin)
Sets a new skin.
Definition: GuiManager.java:917
com.realtime.crossfire.jxclient.window.GuiManager.updateConnectLabel
void updateConnectLabel(@NotNull final ClientSocketState clientSocketState, @Nullable final CharSequence param)
Updates the "message" field of the connect dialog.
Definition: GuiManager.java:976
com.realtime.crossfire.jxclient.window.GuiManager.showGUIMain
void showGUIMain()
Displays the "main" GUI.
Definition: GuiManager.java:952
com.realtime.crossfire.jxclient.gui.textinput
Definition: ActivateCommandInputCommand.java:23
com.realtime.crossfire.jxclient.window.GuiManager.addDialog
void addDialog(@NotNull final String name, @NotNull final Gui dialog)
Adds a dialog for name based lookup.
Definition: GuiManager.java:435
com.realtime.crossfire.jxclient.window.GuiManager.openDialog
void openDialog(@NotNull final String name)
Opens a dialog by name.
Definition: GuiManager.java:600
com.realtime.crossfire.jxclient.gui.commandlist
Definition: CommandList.java:23
com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl
Manages the tooltip display.
Definition: TooltipManagerImpl.java:38
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getDialogConnect
Gui getDialogConnect()
Returns the "connection in progress" dialog.
com.realtime.crossfire.jxclient.window.GuiManager.createKeyBinding
boolean createKeyBinding(final boolean perCharacter, @NotNull final CommandList cmdList)
Adds a key binding.
Definition: GuiManager.java:998
com.realtime.crossfire.jxclient.gui.gui.RendererGuiState.META
META
The server selection screen is active.
Definition: RendererGuiState.java:41
com.realtime.crossfire.jxclient.window.GuiManager.openQueryDialog
void openQueryDialog(@NotNull final String prompt, final int queryType)
Opens the "query" dialog.
Definition: GuiManager.java:559
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getDialogQuit
Gui getDialogQuit()
Returns the "really quit?" dialog.
com.realtime.crossfire.jxclient.window.GuiManager.getCommandList
CommandList getCommandList(@NotNull final String args)
Returns a named command list.
Definition: GuiManager.java:1044
com.realtime.crossfire.jxclient.window.GuiManager.dialogQuit
Gui dialogQuit
The "really quit?" dialog.
Definition: GuiManager.java:100
com.realtime.crossfire.jxclient.guistate.GuiStateListener
Interface for listeners interested gui state changes.
Definition: GuiStateListener.java:32
com.realtime.crossfire.jxclient.window.GuiManager.openDialog
boolean openDialog(@NotNull final Gui dialog, final boolean autoCloseOnDeactivate)
Opens a dialog.
Definition: GuiManager.java:615
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_MOTD
static final int MSG_TYPE_MOTD
drawextinfo message type: motd text.
Definition: MessageType.java:68
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_BOOK
static final int MSG_TYPE_BOOK
drawextinfo message type: character did read a book.
Definition: MessageType.java:38
com.realtime.crossfire.jxclient.protocol.MessageType
Encapsulates the message type numbers for drawextinfo messages.
Definition: MessageType.java:33
com.realtime.crossfire.jxclient.guistate.ClientSocketState.CONNECTING
CONNECTING
The socket is being established.
Definition: ClientSocketState.java:35
com.realtime.crossfire.jxclient.gui.gui.RendererGuiState.LOGIN
LOGIN
The login screen is active.
Definition: RendererGuiState.java:46
com.realtime.crossfire.jxclient.window.GuiManager.escPressed
EscAction escPressed(final boolean connected)
The ESC key has been pressed.
Definition: GuiManager.java:518
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setSelectedHostname
void setSelectedHostname(@NotNull final String serverName)
Selects a server entry.
Definition: JXCWindowRenderer.java:1024
com.realtime.crossfire.jxclient.window.GuiManager.closeDialog
boolean closeDialog(@NotNull final Gui dialog)
Closes the given dialog.
Definition: GuiManager.java:835
com.realtime.crossfire.jxclient.window.GuiManager.windowRenderer
final JXCWindowRenderer windowRenderer
The JXCWindowRenderer used to paint the gui.
Definition: GuiManager.java:75
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setTooltip
void setTooltip(@Nullable final Component tooltip)
Sets the tooltip to use, or.
Definition: JXCWindowRenderer.java:811
com.realtime.crossfire.jxclient.gui.keybindings
Definition: InvalidKeyBindingException.java:23
com.realtime.crossfire.jxclient.window.GuiManager.connection
final JXCConnection connection
The JXCConnection to use.
Definition: GuiManager.java:146
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getStartInterface
Gui getStartInterface()
Returns the start window.
com.realtime.crossfire.jxclient.gui.textinput.GUIText.setHideInput
void setHideInput(final boolean hideInput)
Enables or disables hidden text.
Definition: GUIText.java:518
com.realtime.crossfire.jxclient.window.GuiManager.updateWindowSize
void updateWindowSize(final int width, final int height)
Sets a new window size.
Definition: GuiManager.java:1025
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_SIGN
static final int MSG_TYPE_SIGN
drawextinfo message type: character did read a sign.
Definition: MessageType.java:53
com.realtime.crossfire.jxclient.gui.gui.RendererGuiState.PLAYING
PLAYING
The playing screen is active.
Definition: RendererGuiState.java:61
com.realtime.crossfire.jxclient.window.GuiManager.setHideInput
void setHideInput(final boolean hideInput)
Enables or disables hidden text in the first input field of the queryDialog.
Definition: GuiManager.java:1097
com.realtime.crossfire.jxclient.skin.skin.JXCSkinException
Exception thrown if a skin related problem occurs.
Definition: JXCSkinException.java:31
com.realtime.crossfire.jxclient.window.GuiManager.activateCommandInput
GUIText activateCommandInput()
Activates the command input text field.
Definition: GuiManager.java:862
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_CARD
static final int MSG_TYPE_CARD
drawextinfo message type: character did read a card.
Definition: MessageType.java:43
com.realtime.crossfire.jxclient.window.EscAction
Action after ESC has been pressed.
Definition: EscAction.java:6
com.realtime.crossfire.jxclient.window.JXCConnection.getHostname
String getHostname()
Returns the currently connected server.
Definition: JXCConnection.java:206
com.realtime.crossfire.jxclient.settings
Definition: CommandHistory.java:23
com.realtime.crossfire.jxclient.gui.list.GUICharacterList
A GUIList display characters of an account.
Definition: GUICharacterList.java:41
com.realtime.crossfire.jxclient.settings.SettingsEntries.getLoginAccountSettingsEntry
static SettingsEntry< String > getLoginAccountSettingsEntry(@NotNull final String hostname)
Returns the SettingsEntry for the default account name on a server.
Definition: SettingsEntries.java:70
com.realtime.crossfire.jxclient.gui.log
Definition: Buffer.java:23
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getMetaInterface
Gui getMetaInterface()
Returns the server selection window.
com.realtime.crossfire.jxclient.window.DialogStateParser.save
static void save(@NotNull final JXCSkin skin, @NotNull final JXCWindowRenderer windowRenderer)
Saves the dialogs state to a file.
Definition: DialogStateParser.java:138
com.realtime.crossfire.jxclient.window.GuiManager.showGUIStart
void showGUIStart()
Displays the "start" GUI.
Definition: GuiManager.java:932
com.realtime.crossfire.jxclient.protocol
Definition: MagicMap.java:23
com.realtime.crossfire.jxclient.window.GuiManager.openQuitDialog
boolean openQuitDialog()
Opens the "quit" dialog.
Definition: GuiManager.java:494
com.realtime.crossfire.jxclient.window.GuiManager.crossfireFailureListener
final CrossfireFailureListener crossfireFailureListener
The CrossfireFailureListener registered to receive failure messages.
Definition: GuiManager.java:250
com.realtime.crossfire.jxclient.gui.gui.RendererGuiState.ACCOUNT
ACCOUNT
The account management screen is active.
Definition: RendererGuiState.java:56
com.realtime.crossfire.jxclient.window.EscAction.QUIT
QUIT
Quit the application.
Definition: EscAction.java:21
com.realtime.crossfire.jxclient.window.GuiManager.dialogConnectLabel
AbstractLabel dialogConnectLabel
The "message" field within dialogConnect.
Definition: GuiManager.java:121
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.detach
void detach()
Frees all allocated resources.
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.deactivateCommandInput
boolean deactivateCommandInput()
Deactivates the command input text field.
Definition: JXCWindowRenderer.java:971
com.realtime.crossfire.jxclient.guistate
Definition: ClientSocketState.java:23
com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.addCrossfireFailureListener
void addCrossfireFailureListener(@NotNull CrossfireFailureListener listener)
Adds a listener to be notified of failure messages.
com.realtime.crossfire.jxclient.settings.SettingsEntries.SERVER
static final SettingsEntry< String > SERVER
The server to which the previous connection was made.
Definition: SettingsEntries.java:38
com.realtime.crossfire.jxclient.window.GuiManager.removeKeyBinding
boolean removeKeyBinding(final boolean perCharacter)
Removes a key binding.
Definition: GuiManager.java:1012
com.realtime.crossfire.jxclient.gui.list
Definition: CharacterCellRenderer.java:23
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_APPLY
static final int MSG_TYPE_APPLY
drawextinfo message type: an object was applied.
Definition: MessageType.java:99
com.realtime.crossfire.jxclient.window.GuiManager.dialogConnect
Gui dialogConnect
The "connect in progress" dialog.
Definition: GuiManager.java:114
com.realtime.crossfire.jxclient.window.GuiManager.closeDialogByName
void closeDialogByName(@NotNull final String name)
Closes a dialog by name.
Definition: GuiManager.java:740
com.realtime.crossfire.jxclient.window.GuiManager.guiStateListener
final GuiStateListener guiStateListener
The GuiStateListener for detecting established or dropped connections.
Definition: GuiManager.java:341
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_COMMAND
static final int MSG_TYPE_COMMAND
drawextinfo message type: response to command processing.
Definition: MessageType.java:83
com.realtime.crossfire.jxclient.window.GuiManager.keybindDialog
Gui keybindDialog
The keybindings dialog.
Definition: GuiManager.java:87
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_MISC
static final int MSG_TYPE_MISC
drawextinfo message type: message that does not fit in any other category.
Definition: MessageType.java:125
com.realtime.crossfire.jxclient.window.GuiManager.tooltipManager
final TooltipManagerImpl tooltipManager
The TooltipManager for this window.
Definition: GuiManager.java:134
com.realtime.crossfire.jxclient.guistate.GuiStateManager
Maintains the current GuiState.
Definition: GuiStateManager.java:34
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getDialog
Gui getDialog(@NotNull final String name)
Returns a dialog by name.
com.realtime.crossfire.jxclient.window.GuiManager.queryDialog
Gui queryDialog
The query dialog.
Definition: GuiManager.java:81
com.realtime.crossfire.jxclient.gui.gui.Gui.activateDefaultElement
void activateDefaultElement()
Activates the first default gui element of this gui.
Definition: Gui.java:235
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_ADMIN
static final int MSG_TYPE_ADMIN
drawextinfo message type: general server message.
Definition: MessageType.java:73
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.setGuiState
void setGuiState(@NotNull final RendererGuiState rendererGuiState)
Sets the current gui state.
Definition: JXCWindowRenderer.java:825
com.realtime.crossfire.jxclient.window.GuiManager.showGUIMeta
void showGUIMeta()
Displays the "server selection" GUI.
Definition: GuiManager.java:941
com.realtime.crossfire.jxclient.window.DialogStateParser
Utility class to store or restore the dialog states to/from a file.
Definition: DialogStateParser.java:47
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_CLIENT
static final int MSG_TYPE_CLIENT
drawextinfo message type: client originated messages.
Definition: MessageType.java:141
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.openDialog
boolean openDialog(@NotNull final Gui dialog, final boolean autoCloseOnDeactivate)
Opens a dialog.
Definition: JXCWindowRenderer.java:675
com.realtime.crossfire.jxclient.gui.textinput.NoSuchCommandException
An Exception thrown if a command does not exist.
Definition: NoSuchCommandException.java:31
com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.getAccountName
String getAccountName()
Returns the current account name.
com.realtime.crossfire.jxclient.window.GuiManager.openDialogByName
boolean openDialogByName(@NotNull final String name)
Opens a dialog by name.
Definition: GuiManager.java:719
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_ATTRIBUTE
static final int MSG_TYPE_ATTRIBUTE
drawextinfo message type: attribute (stats, resistances, etc.) change message.
Definition: MessageType.java:89
com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.removeKeyBinding
boolean removeKeyBinding(final boolean perCharacter)
Starts to remove a key binding.
Definition: KeybindingsManager.java:118
com.realtime.crossfire.jxclient.gui.label.AbstractLabel.setText
void setText(@NotNull final String text)
Sets the label text.
Definition: AbstractLabel.java:120
com.realtime.crossfire.jxclient.gui
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer
Renders a Gui instance into a Frame.
Definition: JXCWindowRenderer.java:87
com.realtime.crossfire.jxclient.window.GuiManager.unsetSkin
void unsetSkin()
Unsets the current skin.
Definition: GuiManager.java:900
com.realtime.crossfire.jxclient.server.crossfire.CrossfireQueryListener
Interface for listeners interested in query messages received from the Crossfire server.
Definition: CrossfireQueryListener.java:33
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.attach
void attach(@NotNull TooltipManagerImpl tooltipManager)
Attaches this skin to a gui manager.
com.realtime.crossfire.jxclient.gui.gui.RendererGuiState.NEW_CHAR
NEW_CHAR
The new character creation screen is active.
Definition: RendererGuiState.java:51
com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager
Manages key bindings.
Definition: KeybindingsManager.java:40
com.realtime.crossfire.jxclient.settings.Settings
Maintains a set of key/value pairs.
Definition: Settings.java:45
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_DIALOG
static final int MSG_TYPE_DIALOG
drawextinfo message type: a NPC/magic mouth/altar/etc.
Definition: MessageType.java:63
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_PAPER
static final int MSG_TYPE_PAPER
drawextinfo message type: character did read a paper.
Definition: MessageType.java:48
com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.windowClosing
boolean windowClosing()
Should be called when the main window is closing.
Definition: KeybindingsManager.java:131
com.realtime.crossfire.jxclient.util
Definition: Codec.java:23
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getDialogQuery
Gui getDialogQuery()
Returns the dialog for query text input.
com.realtime.crossfire.jxclient.server.crossfire
Definition: AbstractCrossfireServerConnection.java:23
com.realtime.crossfire.jxclient.window.GuiManager.currentQueryDialogIsNamePrompt
boolean currentQueryDialogIsNamePrompt
Whether the currently shown query dialog is the character name prompt.
Definition: GuiManager.java:126
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getCommandListNames
Collection< String > getCommandListNames()
Returns the names of all named command lists.
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.updateServerSettings
void updateServerSettings()
Updates server based settings to current screen size.
Definition: JXCWindowRenderer.java:1332
com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.createKeyBinding
boolean createKeyBinding(final boolean perCharacter, @NotNull final CommandList cmdList)
Starts creating a new key binding.
Definition: KeybindingsManager.java:147
com.realtime.crossfire.jxclient.server.crossfire.CrossfireDrawextinfoListener
Interface for listeners interested in drawextinfo messages received from the Crossfire server.
Definition: CrossfireDrawextinfoListener.java:33
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getDialogBook
Gui getDialogBook(int bookNo)
Returns the popup dialog for readables.
com.realtime.crossfire.jxclient.window.GuiManager.closeQueryDialog
void closeQueryDialog()
Closes the "query" dialog.
Definition: GuiManager.java:706
com.realtime.crossfire.jxclient.window.GuiManager.GuiManager
GuiManager(@NotNull final GuiStateManager guiStateManager, @NotNull final TooltipManagerImpl tooltipManager, @NotNull final Settings settings, @NotNull final CrossfireServerConnection server, @NotNull final JXCWindowRenderer windowRenderer, @NotNull final GuiFactory guiFactory, @NotNull final KeybindingsManager keybindingsManager, @NotNull final JXCConnection connection)
Creates a new instance.
Definition: GuiManager.java:417
com.realtime.crossfire.jxclient.skin.skin.GuiFactory
Factory for creating Gui instances.
Definition: GuiFactory.java:41
com.realtime.crossfire.jxclient.gui.commandlist.CommandList
A list of GUICommand instances.
Definition: CommandList.java:34
com.realtime.crossfire.jxclient.gui.gui
Definition: AbstractGUIElement.java:23
com.realtime.crossfire.jxclient.window.GuiManager.closeDialog
void closeDialog(@NotNull final String name)
Closes the given dialog.
Definition: GuiManager.java:822
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_ATTACK
static final int MSG_TYPE_ATTACK
drawextinfo message type: attack related message.
Definition: MessageType.java:104
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.clearGUI
void clearGUI(@NotNull final Gui gui)
Sets a gui to display and clears the display.
Definition: JXCWindowRenderer.java:642
com.realtime.crossfire.jxclient.gui.label.TooltipManagerImpl.reset
void reset()
Removes the tooltip.
Definition: TooltipManagerImpl.java:117
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getDialogDisconnect
Gui getDialogDisconnect()
Returns the "disconnect from server?" dialog.
com.realtime.crossfire
com.realtime.crossfire.jxclient.window.GuiManager.settings
final Settings settings
The Settings to use.
Definition: GuiManager.java:140
com.realtime.crossfire.jxclient.gui.label.GUILabelFailure
A GUIHTMLLabel that displays the last received "failure" message.
Definition: GUILabelFailure.java:39
com.realtime.crossfire.jxclient.window.GuiManager.setShowTimestamps
void setShowTimestamps(final boolean showTimestamps)
Sets whether timestamps shown in the messages dialog.
Definition: GuiManager.java:1130
com.realtime.crossfire.jxclient.window.GuiManager.term
void term()
Terminates the GUI.
Definition: GuiManager.java:961
com.realtime.crossfire.jxclient.window.GuiManager.activateCommandInput
void activateCommandInput(@Nullable final String newText)
Activates the command input text field.
Definition: GuiManager.java:890
com.realtime.crossfire.jxclient.skin.skin.JXCSkin.getTooltipLabel
AbstractLabel getTooltipLabel()
Returns the AbstractLabel that is used to display tooltips.
com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.saveGlobalKeybindings
void saveGlobalKeybindings()
Saves the global key bindings to the backing file.
Definition: KeybindingsManager.java:201
com.realtime
com.realtime.crossfire.jxclient.window.GuiManager.playerReceived
void playerReceived()
A "player" protocol command has been received.
Definition: GuiManager.java:442
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.closeDialog
boolean closeDialog(@NotNull final Gui dialog)
Closes a dialog.
Definition: JXCWindowRenderer.java:774
com.realtime.crossfire.jxclient.window.GuiManager.manageAccount
void manageAccount()
Displays the main account dialog, to let the player login or create a new account.
Definition: GuiManager.java:453
com.realtime.crossfire.jxclient.skin.skin.JXCSkin
Defines a JXClient skin consisting of a main Gui and zero or more dialog Guis.
Definition: JXCSkin.java:42
com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection.removeCrossfireFailureListener
void removeCrossfireFailureListener(@NotNull CrossfireFailureListener listener)
Removes a listener to be notified of failure messages.
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.activateCommandInput
GUIText activateCommandInput()
Activates the command input text field.
Definition: JXCWindowRenderer.java:1039
com
com.realtime.crossfire.jxclient.gui.textinput.GUIText.setText
void setText(@NotNull final String text)
Sets the entered text.
Definition: GUIText.java:223
com.realtime.crossfire.jxclient.gui.gui.Gui.getFirstElement
public< T extends GUIElement > T getFirstElement(@NotNull final Class< T > class_)
Returns the first gui element of this gui belonging to the given class.
Definition: Gui.java:291
com.realtime.crossfire.jxclient.gui.log.GUILabelLog.updateText
void updateText(@NotNull final CharSequence string, final int type, final int subtype)
Sets the displayed text by parsing a string.
Definition: GUILabelLog.java:82
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.getGuiState
RendererGuiState getGuiState()
Returns the current gui state.
Definition: JXCWindowRenderer.java:857
com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.escPressed
boolean escPressed()
Processes a pressed ESC key.
Definition: KeybindingsManager.java:248
com.realtime.crossfire.jxclient.settings.SettingsEntries.getPlayerSettingsEntry
static SettingsEntry< String > getPlayerSettingsEntry(@NotNull final String hostname)
Returns the SettingsEntry for the default character name on a server.
Definition: SettingsEntries.java:59
com.realtime.crossfire.jxclient.guistate.ClientSocketState
Connection progress states of the Crossfire server connection.
Definition: ClientSocketState.java:30
com.realtime.crossfire.jxclient.settings.Settings.getString
String getString(@NotNull final SettingsEntry<?> key)
Returns the string associated with the specified key at a node, or.
Definition: Settings.java:81
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_ITEM
static final int MSG_TYPE_ITEM
drawextinfo message type: item related information.
Definition: MessageType.java:119
com.realtime.crossfire.jxclient.settings.Settings.putString
void putString(@NotNull final SettingsEntry<?> key, @NotNull final String value)
Stores a key/value pair.
Definition: Settings.java:129
com.realtime.crossfire.jxclient.gui.misc
Definition: GUICheckBox.java:23
com.realtime.crossfire.jxclient.window.GuiManager.closeTransientDialogs
void closeTransientDialogs(final boolean ignoreQueryDialog)
Closes all transient dialogs: disconnect, quit, connect, query, and book dialogs.
Definition: GuiManager.java:760
com.realtime.crossfire.jxclient.window.GuiManager.closeKeybindDialog
void closeKeybindDialog()
Closes the keybinding dialog.
Definition: GuiManager.java:810
com.realtime.crossfire.jxclient.window.GuiManager.crossfireDrawextinfoListener
final CrossfireDrawextinfoListener crossfireDrawextinfoListener
The CrossfireDrawextinfoListener attached to server.
Definition: GuiManager.java:164
com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.setActive
void setActive(final boolean active)
Sets the active state of a GUI element.
Definition: ActivatableGUIElement.java:115
com.realtime.crossfire.jxclient.util.SwingUtilities2.invokeAndWait
static void invokeAndWait(@NotNull final Runnable runnable)
Calls SwingUtilities#invokeAndWait(Runnable) if not on the EDT or calls the Runnable directly if on t...
Definition: SwingUtilities2.java:47
com.realtime.crossfire.jxclient.gui.log.GUILabelLog
A gui element implementing a static text field which may contain media tags.
Definition: GUILabelLog.java:38
com.realtime.crossfire.jxclient.gui.misc.JXCWindowRenderer.toggleDialog
boolean toggleDialog(@NotNull final Gui dialog)
Toggles a dialog: if the dialog is not shown, show it; else hide it.
Definition: JXCWindowRenderer.java:789
com.realtime.crossfire.jxclient.window.GuiManager.dialogs
final Map< String, Gui > dialogs
Maps dialog name to dialog instance.
Definition: GuiManager.java:158
com.realtime.crossfire.jxclient.window.GuiManager.setAccountName
void setAccountName(@NotNull final String accountName)
Updates the current account name.
Definition: GuiManager.java:1073
com.realtime.crossfire.jxclient.guistate.ClientSocketState.CONNECT_FAILED
CONNECT_FAILED
A connection could not be established.
Definition: ClientSocketState.java:70
com.realtime.crossfire.jxclient.window.EscAction.DISCONNECT
DISCONNECT
Disconnect from server.
Definition: EscAction.java:16
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_SHOP
static final int MSG_TYPE_SHOP
drawextinfo message type: shop related message.
Definition: MessageType.java:78
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_SPELL
static final int MSG_TYPE_SPELL
drawextinfo message type: spell related information.
Definition: MessageType.java:114
com.realtime.crossfire.jxclient.window.GuiManager.openKeybindDialog
void openKeybindDialog()
Opens the keybinding dialog.
Definition: GuiManager.java:799
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_COMMUNICATION
static final int MSG_TYPE_COMMUNICATION
drawextinfo message type: communication between players.
Definition: MessageType.java:109
com.realtime.crossfire.jxclient.protocol.MessageType.MSG_TYPE_VICTIM
static final int MSG_TYPE_VICTIM
drawextinfo message type: something bad is happening to the player.
Definition: MessageType.java:130
com.realtime.crossfire.jxclient.gui.gui.RendererGuiState
All gui states of JXCWindowRenderer.
Definition: RendererGuiState.java:31