Crossfire JXClient, Trunk
Gui.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.gui.gui;
24 
31 import java.awt.Component;
32 import java.awt.Container;
33 import java.awt.Dimension;
34 import java.awt.event.KeyEvent;
35 import java.util.Collection;
36 import java.util.EnumSet;
37 import javax.swing.JComponent;
38 import javax.swing.JFrame;
39 import org.jetbrains.annotations.NotNull;
40 import org.jetbrains.annotations.Nullable;
41 
49 public class Gui {
50 
54  @NotNull
55  private final JComponent component = new JComponent() {
56 
60  private static final long serialVersionUID = 1L;
61 
62  };
63 
67  @NotNull
68  private final KeyBindings keyBindings;
69 
74  @Nullable
75  private Extent autoSize;
76 
80  private boolean saveDialog;
81 
85  private boolean modal;
86 
91  private boolean userResizable;
92 
96  @NotNull
97  private final Collection<RendererGuiState> hideInStates = EnumSet.noneOf(RendererGuiState.class);
98 
103  @Nullable
105 
110  @Nullable
112 
116  private boolean initialPositionSet;
117 
122  @Nullable
124 
129  @Nullable
131 
136  @Nullable
138 
143  @Nullable
144  private GUIPicture help;
145 
151  public Gui(@NotNull final String name, @NotNull final KeyBindings keyBindings) {
152  this.keyBindings = keyBindings;
153  component.setName(name);
154  }
155 
160  @NotNull
161  public JComponent getComponent() {
162  return component;
163  }
164 
170  public void setAutoSize(@Nullable final Extent autoSize) {
171  this.autoSize = autoSize;
172  }
173 
179  public boolean isAutoSize() {
180  return autoSize != null;
181  }
182 
187  public void setModal(final boolean modal) {
188  this.modal = modal;
189  }
190 
195  public boolean isModal() {
196  return modal;
197  }
198 
203  public void setUserResizable(final boolean userResizable) {
204  this.userResizable = userResizable;
205  }
206 
211  public boolean isUserResizable() {
212  return userResizable;
213  }
214 
219  @Nullable
221  final int count = component.getComponentCount();
222  for (int i = 0; i < count; i++) {
223  final Component component = this.component.getComponent(i);
224  if (component.isVisible() && component instanceof ActivatableGUIElement) {
226  if (element.isDefault()) {
227  return element;
228  }
229  }
230  }
231 
232  return null;
233  }
234 
238  public void activateDefaultElement() {
239  final ActivatableGUIElement defaultElement = getDefaultElement();
240  if (defaultElement != null) {
241  defaultElement.setActive(true);
242  }
243  }
244 
253  @Nullable
254  public <T extends GUIElement> T getFirstElementEndingWith(@NotNull final Class<T> class_, @NotNull final String ending) {
255  final int count = component.getComponentCount();
256  for (int i = 0; i < count; i++) {
257  final Component component = this.component.getComponent(i);
258  if (component.isVisible() && component instanceof GUIElement) {
259  final GUIElement element = (GUIElement)component;
260  if (class_.isAssignableFrom(element.getClass()) && element.getName().endsWith(ending)) {
261  return class_.cast(element);
262  }
263  }
264  }
265 
266  return null;
267  }
268 
277  @Nullable
278  public <T extends GUIElement> T getFirstElementNotEndingWith(@NotNull final Class<T> class_, @NotNull final String ending) {
279  final int count = component.getComponentCount();
280  for (int i = 0; i < count; i++) {
281  final Component component = this.component.getComponent(i);
282  if (component.isVisible() && component instanceof GUIElement) {
283  final GUIElement element = (GUIElement)component;
284  if (class_.isAssignableFrom(element.getClass()) && !element.getName().endsWith(ending)) {
285  return class_.cast(element);
286  }
287  }
288  }
289 
290  return null;
291  }
292 
299  @Nullable
300  public <T extends GUIElement> T getFirstElement(@NotNull final Class<T> class_) {
301  final int count = component.getComponentCount();
302  for (int i = 0; i < count; i++) {
303  final Component component = this.component.getComponent(i);
304  if (component.isVisible() && component instanceof GUIElement) {
305  final GUIElement element = (GUIElement)component;
306  if (class_.isAssignableFrom(element.getClass())) {
307  return class_.cast(element);
308  }
309  }
310  }
311 
312  return null;
313  }
314 
322  @Nullable
323  public AbstractGUIElement getElementFromPoint(final int x, final int y) {
324  Component component = this.component.findComponentAt(x, y);
325  while (component != null) {
326  if (component instanceof AbstractGUIElement) {
328  }
329  component = component.getParent();
330  }
331  return null;
332  }
333 
339  public void setActiveElement(@NotNull final ActivatableGUIElement activeElement, final boolean active) {
340  final ActivatableGUIElement previousActiveElement = this.activeElement;
341  if (active) {
342  if (forcedActive != null && forcedActive != activeElement) {
343  return;
344  }
345 
347  return;
348  }
349 
350  this.activeElement = activeElement;
351  if (previousActiveElement != null) {
352  previousActiveElement.activeChanged();
353  }
354  assert this.activeElement != null;
355  this.activeElement.activeChanged();
356 
357  guiAutoCloseListener = null;
358  } else {
360  return;
361  }
362 
363  this.activeElement = null;
364  assert previousActiveElement != null;
365  previousActiveElement.activeChanged();
366 
367  if (guiAutoCloseListener != null) {
369  guiAutoCloseListener = null;
370  listener.autoClosed();
371  }
372  }
373  }
374 
381  public boolean isActiveElement(@Nullable final ActivatableGUIElement activeElement) {
382  return this.activeElement != null && this.activeElement == activeElement;
383  }
384 
390  public void setActiveElementActive(final boolean active) {
391  if (activeElement != null) {
392  activeElement.setActive(active);
393  }
394  }
395 
401  public boolean handleKeyPress(@NotNull final KeyEvent2 e) {
402  if (activeElement instanceof KeyPressedHandler && ((KeyPressedHandler)activeElement).keyPressed(e)) {
403  return true;
404  }
405 
406  switch (e.getKeyCode()) {
407  case KeyEvent.VK_ENTER:
408  case KeyEvent.VK_SPACE:
409  final ActivatableGUIElement defaultElement = getDefaultElement();
410  if (defaultElement != null) {
411  defaultElement.execute();
412  return true;
413  }
414  break;
415 
416  case KeyEvent.VK_TAB:
417  if (activeElement != null) {
418  switch (e.getModifiers()&KeyEvent2.MASK) {
419  case KeyEvent2.NONE:
421  return true;
422 
423  case KeyEvent2.SHIFT:
425  return true;
426  }
427  }
428  break;
429  }
430 
431  return keyBindings.handleKeyPress(e);
432  }
433 
440  public boolean deactivateCommandInput() {
441  if (activeElement == null) {
442  return false;
443  }
444 
445  final GUIElement textArea = activeElement;
446  if (!textArea.getName().equals("command")) {
447  return false;
448  }
449 
450  assert activeElement != null;
451  activeElement.setActive(false);
452  return true;
453  }
454 
463  @Nullable
464  public <T extends GUIElement> T getFirstElement(@NotNull final Class<T> class_, @NotNull final String name) {
465  final int count = component.getComponentCount();
466  for (int i = 0; i < count; i++) {
467  final Component component = this.component.getComponent(i);
468  if (component.isVisible() && component instanceof GUIElement) {
469  final GUIElement element = (GUIElement)component;
470  if (class_.isAssignableFrom(element.getClass()) && element.getName().equals(name)) {
471  return class_.cast(element);
472  }
473  }
474  }
475  return null;
476  }
477 
482  @NotNull
484  return keyBindings;
485  }
486 
491  public void hideInState(@NotNull final RendererGuiState state) {
492  hideInStates.add(state);
493  }
494 
500  public boolean isHidden(@NotNull final RendererGuiState state) {
501  return hideInStates.contains(state);
502  }
503 
510  this.guiAutoCloseListener = guiAutoCloseListener;
511  }
512 
519  public boolean isWithinDrawingArea(final int x, final int y) {
520  return component.getX() <= x && x < component.getX()+component.getWidth() && component.getY() <= y && y < component.getY()+component.getHeight();
521  }
522 
528  public void setForcedActive(@Nullable final ActivatableGUIElement forcedActive) {
529  this.forcedActive = forcedActive;
530  }
531 
532  @NotNull
533  @Override
534  public String toString() {
535  final String name = component.getName();
536  return (name == null ? "" : name)+"["+component.getWidth()+"x"+component.getHeight()+"]";
537  }
538 
545  public void autoSize(final int screenWidth, final int screenHeight) {
547  final Extent extent = autoSize;
548  if (extent != null) {
549  final Dimension preferredSize = component.getPreferredSize();
550  final int x = extent.getX(screenWidth, screenHeight, preferredSize.width, preferredSize.height);
551  final int y = extent.getY(screenWidth, screenHeight, preferredSize.width, preferredSize.height);
552  final int w = extent.getW(screenWidth, screenHeight, preferredSize.width, preferredSize.height);
553  final int h = extent.getH(screenWidth, screenHeight, preferredSize.width, preferredSize.height);
554  component.setBounds(x, y, w, h);
555  validate();
556  return;
557  }
558 
559  final int x;
560  final int y;
561  final int w;
562  final int h;
563  if (initialPositionSet) {
564  x = component.getX();
565  y = component.getY();
566  w = component.getWidth();
567  h = component.getHeight();
568  } else {
569  final Dimension preferredSize = component.getPreferredSize();
570  //noinspection IfMayBeConditional
571  if (defaultX == null) {
572  x = screenWidth/2-preferredSize.width;
573  } else {
574  x = defaultX.evaluate(screenWidth, screenHeight, preferredSize.width, preferredSize.height)-preferredSize.width/2;
575  }
576  //noinspection IfMayBeConditional
577  if (defaultY == null) {
578  y = screenHeight/2-preferredSize.height;
579  } else {
580  y = defaultY.evaluate(screenWidth, screenHeight, preferredSize.width, preferredSize.height)-preferredSize.height/2;
581  }
582  w = preferredSize.width;
583  h = preferredSize.height;
584  }
585  setBounds(x, y, w, h, screenWidth, screenHeight);
586  });
587  }
588 
594  public void setDefaultPosition(@NotNull final Expression defaultX, @NotNull final Expression defaultY) {
595  this.defaultX = defaultX;
596  this.defaultY = defaultY;
597  }
598 
603  public boolean isSaveDialog() {
604  return saveDialog;
605  }
606 
610  public void setSaveDialog() {
611  saveDialog = true;
612  }
613 
617  public void notifyOpen() {
618  if (help != null) {
619  help.notifyOpen();
620  }
621 
622  final int count = component.getComponentCount();
623  for (int i = 0; i < count; i++) {
624  final Component component = this.component.getComponent(i);
625  if (component.isVisible() && component instanceof GUIElement) {
626  final GUIElement element = (GUIElement)component;
627  element.notifyOpen();
628  }
629  }
630  }
631 
637  @Nullable
638  public GUIPicture getHelp() {
639  return help;
640  }
641 
646  public void setHelp(@NotNull final GUIPicture help) {
647  this.help = help;
648  }
649 
662  public void setBounds(final int x, final int y, final int width, final int height, final int windowWidth, final int windowHeight) {
663  int newWidth = width;
664  int newHeight = height;
665  final Dimension maximumSize = component.getMaximumSize();
666  if (maximumSize != null) {
667  if (newWidth > maximumSize.width) {
668  newWidth = maximumSize.width;
669  }
670  if (newHeight > maximumSize.height) {
671  newHeight = maximumSize.height;
672  }
673  }
674  final Dimension minimumSize = component.getMinimumSize();
675  if (minimumSize != null) {
676  if (newWidth < minimumSize.width) {
677  newWidth = minimumSize.width;
678  }
679  if (newHeight < minimumSize.height) {
680  newHeight = minimumSize.height;
681  }
682  }
683  final int newX = Math.max(Math.min(x, windowWidth-newWidth), 0);
684  final int newY = Math.max(Math.min(y, windowHeight-newHeight), 0);
685  component.setBounds(newX, newY, newWidth, newHeight);
686  initialPositionSet = true;
687  validate();
688  }
689 
693  private void validate() {
694  Container c = component;
695  while (c != null) {
696  c = c.getParent();
697  if (c instanceof JFrame) {
698  c.validate();
699  break;
700  }
701  }
702  }
703 
707  public void repaint() {
708  SwingUtilities2.invokeLater(component::repaint);
709  }
710 
715  public void setOpaqueDialogBackground(final boolean opaque) {
716  final int count = component.getComponentCount();
717  for (int i = 0; i < count; i++) {
718  final Component component = this.component.getComponent(i);
719  if (component.isVisible() && component instanceof GUIDialogBackground) {
720  final GUIDialogBackground dialogBackground = (GUIDialogBackground)component;
721  dialogBackground.setOpaqueDialogBackground(opaque);
722  }
723  }
724  }
725 
731  public void setShowSentCommands(final boolean showSentCommands) {
732  final int count = component.getComponentCount();
733  for (int i = 0; i < count; i++) {
734  final Component component = this.component.getComponent(i);
735  if (component.isVisible() && component instanceof GUIElement) {
736  final GUIElement element = (GUIElement)component;
737  if (element instanceof GUIMessageLog) {
738  ((GUIMessageLog)element).setShowSentCommands(showSentCommands);
739  }
740  }
741  }
742  }
743 
748  public void setShowTimestamps(final boolean showTimestamps) {
749  final int count = component.getComponentCount();
750  for (int i = 0; i < count; i++) {
751  final Component component = this.component.getComponent(i);
752  if (component.isVisible() && component instanceof GUIElement) {
753  final GUIElement element = (GUIElement)component;
754  if (element instanceof GUIMessageLog) {
755  ((GUIMessageLog)element).setShowTimestamps(showTimestamps);
756  }
757  }
758  }
759  }
760 
761 }
com.realtime.crossfire.jxclient.gui.gui.Gui.isSaveDialog
boolean isSaveDialog()
Definition: Gui.java:603
com.realtime.crossfire.jxclient
com.realtime.crossfire.jxclient.gui.gui.Gui.isAutoSize
boolean isAutoSize()
Definition: Gui.java:179
com.realtime.crossfire.jxclient.gui.gui.Gui.isUserResizable
boolean isUserResizable()
Definition: Gui.java:211
com.realtime.crossfire.jxclient.gui.keybindings.KeyEvent2
Definition: KeyEvent2.java:34
com.realtime.crossfire.jxclient.gui.gui.Gui.setShowTimestamps
void setShowTimestamps(final boolean showTimestamps)
Definition: Gui.java:748
com.realtime.crossfire.jxclient.gui.keybindings.KeyBindings.handleKeyPress
boolean handleKeyPress(@NotNull final KeyEvent2 e)
Definition: KeyBindings.java:320
com.realtime.crossfire.jxclient.gui.gui.Gui.getFirstElement
public< T extends GUIElement > T getFirstElement(@NotNull final Class< T > class_, @NotNull final String name)
Definition: Gui.java:464
com.realtime.crossfire.jxclient.gui.keybindings.KeyEvent2.MASK
static final int MASK
Definition: KeyEvent2.java:69
com.realtime.crossfire.jxclient.gui.gui.Gui.forcedActive
ActivatableGUIElement forcedActive
Definition: Gui.java:104
com.realtime.crossfire.jxclient.gui.gui.Gui
Definition: Gui.java:49
com.realtime.crossfire.jxclient.gui.gui.Gui.hideInStates
final Collection< RendererGuiState > hideInStates
Definition: Gui.java:97
com.realtime.crossfire.jxclient.gui.gui.Gui.Gui
Gui(@NotNull final String name, @NotNull final KeyBindings keyBindings)
Definition: Gui.java:151
com.realtime.crossfire.jxclient.gui.gui.Gui.setUserResizable
void setUserResizable(final boolean userResizable)
Definition: Gui.java:203
com.realtime.crossfire.jxclient.gui.gui.Gui.modal
boolean modal
Definition: Gui.java:85
com.realtime.crossfire.jxclient.gui.gui.Gui.help
GUIPicture help
Definition: Gui.java:144
com.realtime.crossfire.jxclient.gui.gui.Gui.getFirstElementEndingWith
public< T extends GUIElement > T getFirstElementEndingWith(@NotNull final Class< T > class_, @NotNull final String ending)
Definition: Gui.java:254
com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement
Definition: ActivatableGUIElement.java:33
com.realtime.crossfire.jxclient.gui.gui.Gui.hideInState
void hideInState(@NotNull final RendererGuiState state)
Definition: Gui.java:491
com.realtime.crossfire.jxclient.gui.gui.Gui.getElementFromPoint
AbstractGUIElement getElementFromPoint(final int x, final int y)
Definition: Gui.java:323
com.realtime.crossfire.jxclient.gui.gui.Gui.saveDialog
boolean saveDialog
Definition: Gui.java:80
com.realtime.crossfire.jxclient.gui.misc.GUIDialogBackground
Definition: GUIDialogBackground.java:46
com.realtime.crossfire.jxclient.gui.gui.Gui.setBounds
void setBounds(final int x, final int y, final int width, final int height, final int windowWidth, final int windowHeight)
Definition: Gui.java:662
com.realtime.crossfire.jxclient.gui.gui.GUIElement.getName
String getName()
com.realtime.crossfire.jxclient.gui.gui.Gui.getDefaultElement
ActivatableGUIElement getDefaultElement()
Definition: Gui.java:220
com.realtime.crossfire.jxclient.gui.gui.Gui.getKeyBindings
KeyBindings getKeyBindings()
Definition: Gui.java:483
com.realtime.crossfire.jxclient.gui.gui.Gui.getHelp
GUIPicture getHelp()
Definition: Gui.java:638
com.realtime.crossfire.jxclient.gui.keybindings
Definition: InvalidKeyBindingException.java:23
com.realtime.crossfire.jxclient.gui.gui.Gui.setActiveElement
void setActiveElement(@NotNull final ActivatableGUIElement activeElement, final boolean active)
Definition: Gui.java:339
com.realtime.crossfire.jxclient.gui.gui.Gui.setModal
void setModal(final boolean modal)
Definition: Gui.java:187
com.realtime.crossfire.jxclient.gui.log
Definition: Buffer.java:23
com.realtime.crossfire.jxclient.gui.misc.GUIPicture.notifyOpen
void notifyOpen()
Definition: GUIPicture.java:114
com.realtime.crossfire.jxclient.gui.gui.Gui.initialPositionSet
boolean initialPositionSet
Definition: Gui.java:116
com.realtime.crossfire.jxclient.gui.gui.Gui.activateDefaultElement
void activateDefaultElement()
Definition: Gui.java:238
com.realtime.crossfire.jxclient.gui.gui.Gui.autoSize
Extent autoSize
Definition: Gui.java:75
com.realtime.crossfire.jxclient.gui.gui.Gui.setDefaultPosition
void setDefaultPosition(@NotNull final Expression defaultX, @NotNull final Expression defaultY)
Definition: Gui.java:594
com.realtime.crossfire.jxclient.gui.gui.GUIElement.notifyOpen
void notifyOpen()
com.realtime.crossfire.jxclient.gui.gui.Gui.setOpaqueDialogBackground
void setOpaqueDialogBackground(final boolean opaque)
Definition: Gui.java:715
com.realtime.crossfire.jxclient.gui.gui.GuiAutoCloseListener
Definition: GuiAutoCloseListener.java:30
com.realtime.crossfire.jxclient.gui.gui.Gui.setGuiAutoCloseListener
void setGuiAutoCloseListener(@Nullable final GuiAutoCloseListener guiAutoCloseListener)
Definition: Gui.java:509
com.realtime.crossfire.jxclient.gui.gui.Gui.setForcedActive
void setForcedActive(@Nullable final ActivatableGUIElement forcedActive)
Definition: Gui.java:528
com.realtime.crossfire.jxclient.gui.gui.Gui.setAutoSize
void setAutoSize(@Nullable final Extent autoSize)
Definition: Gui.java:170
com.realtime.crossfire.jxclient.gui.gui.Gui.repaint
void repaint()
Definition: Gui.java:707
com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.activeChanged
abstract void activeChanged()
com.realtime.crossfire.jxclient.gui.gui.KeyPressedHandler
Definition: KeyPressedHandler.java:32
com.realtime.crossfire.jxclient.gui.gui.Gui.setHelp
void setHelp(@NotNull final GUIPicture help)
Definition: Gui.java:646
com.realtime.crossfire.jxclient.gui.gui.Gui.isHidden
boolean isHidden(@NotNull final RendererGuiState state)
Definition: Gui.java:500
com.realtime.crossfire.jxclient.gui.gui.Gui.getComponent
JComponent getComponent()
Definition: Gui.java:161
com.realtime.crossfire.jxclient.gui.gui.Gui.notifyOpen
void notifyOpen()
Definition: Gui.java:617
com.realtime.crossfire.jxclient.gui
com.realtime.crossfire.jxclient.gui.gui.GuiAutoCloseListener.autoClosed
void autoClosed()
com.realtime.crossfire.jxclient.gui.gui.Extent.getW
int getW(final int width, final int height, final int prefWidth, final int prefHeight)
Definition: Extent.java:104
com.realtime.crossfire.jxclient.gui.gui.Gui.setShowSentCommands
void setShowSentCommands(final boolean showSentCommands)
Definition: Gui.java:731
com.realtime.crossfire.jxclient.gui.gui.Gui.setSaveDialog
void setSaveDialog()
Definition: Gui.java:610
com.realtime.crossfire.jxclient.gui.gui.Gui.activeElement
ActivatableGUIElement activeElement
Definition: Gui.java:111
com.realtime.crossfire.jxclient.gui.gui.Extent.getX
int getX(final int width, final int height, final int prefWidth, final int prefHeight)
Definition: Extent.java:80
com.realtime.crossfire.jxclient.gui.gui.Gui.getFirstElement
public< T extends GUIElement > T getFirstElement(@NotNull final Class< T > class_)
Definition: Gui.java:300
com.realtime.crossfire.jxclient.util
Definition: Codec.java:23
com.realtime.crossfire.jxclient.util.SwingUtilities2.invokeAndWait
static void invokeAndWait(@NotNull final Runnable runnable)
Definition: SwingUtilities2.java:47
com.realtime.crossfire.jxclient.gui.gui.Gui.getFirstElementNotEndingWith
public< T extends GUIElement > T getFirstElementNotEndingWith(@NotNull final Class< T > class_, @NotNull final String ending)
Definition: Gui.java:278
com.realtime.crossfire.jxclient.gui.gui.Gui.toString
String toString()
Definition: Gui.java:534
com.realtime.crossfire.jxclient.gui.gui.GUIElement
Definition: GUIElement.java:33
com.realtime.crossfire.jxclient.gui.gui.Extent.getY
int getY(final int width, final int height, final int prefWidth, final int prefHeight)
Definition: Extent.java:92
com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.activatePrevElement
void activatePrevElement()
Definition: ActivatableGUIElement.java:145
com.realtime.crossfire.jxclient.gui.gui.Gui.validate
void validate()
Definition: Gui.java:693
com.realtime.crossfire.jxclient.gui.keybindings.KeyEvent2.SHIFT
static final int SHIFT
Definition: KeyEvent2.java:64
com.realtime.crossfire.jxclient.util.SwingUtilities2.invokeLater
static void invokeLater(@NotNull final Runnable runnable)
Definition: SwingUtilities2.java:73
com.realtime.crossfire.jxclient.gui.gui.Gui.userResizable
boolean userResizable
Definition: Gui.java:91
com.realtime.crossfire.jxclient.gui.gui.Gui.autoSize
void autoSize(final int screenWidth, final int screenHeight)
Definition: Gui.java:545
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement.isDefault
boolean isDefault
Definition: AbstractGUIElement.java:61
com.realtime.crossfire
com.realtime
com
com.realtime.crossfire.jxclient.util.SwingUtilities2
Definition: SwingUtilities2.java:34
com.realtime.crossfire.jxclient.gui.gui.Gui.guiAutoCloseListener
GuiAutoCloseListener guiAutoCloseListener
Definition: Gui.java:123
com.realtime.crossfire.jxclient.gui.gui.Gui.keyBindings
final KeyBindings keyBindings
Definition: Gui.java:68
com.realtime.crossfire.jxclient.gui.misc.GUIDialogBackground.setOpaqueDialogBackground
void setOpaqueDialogBackground(final boolean opaque)
Definition: GUIDialogBackground.java:274
com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.activateNextElement
void activateNextElement()
Definition: ActivatableGUIElement.java:137
com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.setActive
void setActive(final boolean active)
Definition: ActivatableGUIElement.java:115
com.realtime.crossfire.jxclient.gui.gui.Gui.isActiveElement
boolean isActiveElement(@Nullable final ActivatableGUIElement activeElement)
Definition: Gui.java:381
com.realtime.crossfire.jxclient.gui.gui.Gui.defaultX
Expression defaultX
Definition: Gui.java:130
com.realtime.crossfire.jxclient.gui.keybindings.KeyBindings
Definition: KeyBindings.java:47
com.realtime.crossfire.jxclient.gui.gui.Gui.handleKeyPress
boolean handleKeyPress(@NotNull final KeyEvent2 e)
Definition: Gui.java:401
com.realtime.crossfire.jxclient.gui.gui.Gui.component
final JComponent component
Definition: Gui.java:55
com.realtime.crossfire.jxclient.gui.gui.ActivatableGUIElement.execute
abstract void execute()
com.realtime.crossfire.jxclient.gui.gui.RendererGuiState
Definition: RendererGuiState.java:31
com.realtime.crossfire.jxclient.gui.gui.Gui.defaultY
Expression defaultY
Definition: Gui.java:137
com.realtime.crossfire.jxclient.gui.gui.Expression
Definition: Expression.java:31
com.realtime.crossfire.jxclient.gui.gui.Gui.isWithinDrawingArea
boolean isWithinDrawingArea(final int x, final int y)
Definition: Gui.java:519
com.realtime.crossfire.jxclient.gui.gui.AbstractGUIElement
Definition: AbstractGUIElement.java:37
com.realtime.crossfire.jxclient.gui.keybindings.KeyEvent2.NONE
static final int NONE
Definition: KeyEvent2.java:39
com.realtime.crossfire.jxclient.gui.gui.Expression.evaluate
int evaluate(final int width, final int height, final int prefWidth, final int prefHeight)
Definition: Expression.java:98
com.realtime.crossfire.jxclient.gui.misc
Definition: GUICheckBox.java:23
com.realtime.crossfire.jxclient.gui.misc.GUIPicture
Definition: GUIPicture.java:42
com.realtime.crossfire.jxclient.gui.log.GUIMessageLog
Definition: GUIMessageLog.java:40
com.realtime.crossfire.jxclient.gui.gui.Gui.deactivateCommandInput
boolean deactivateCommandInput()
Definition: Gui.java:440
com.realtime.crossfire.jxclient.gui.gui.Gui.isModal
boolean isModal()
Definition: Gui.java:195
com.realtime.crossfire.jxclient.gui.gui.Extent
Definition: Extent.java:32
com.realtime.crossfire.jxclient.gui.gui.Gui.setActiveElementActive
void setActiveElementActive(final boolean active)
Definition: Gui.java:390
com.realtime.crossfire.jxclient.gui.gui.Extent.getH
int getH(final int width, final int height, final int prefWidth, final int prefHeight)
Definition: Extent.java:116