com.realtime.crossfire.jxclient.gui.gui.Gui Class Reference
Inherits javax::swing::JComponent.
List of all members.
Public Member Functions |
| | Gui (@NotNull final KeyBindings keyBindings) |
| void | setPosition (final int x, final int y) |
| void | setAutoSize (@Nullable final Extent autoSize) |
| boolean | isAutoSize () |
| void | setModal (final boolean modal) |
| boolean | isModal () |
| void | activateDefaultElement () |
| AbstractGUIElement | getElementFromPoint (final int x, final int y) |
| void | setActiveElement (@NotNull final ActivatableGUIElement activeElement, final boolean active) |
| boolean | isActiveElement (@Nullable final ActivatableGUIElement activeElement) |
| void | setActiveElementActive (final boolean active) |
| boolean | handleKeyPress (@NotNull final KeyEvent e) |
| boolean | deactivateCommandInput () |
| KeyBindings | getKeyBindings () |
| void | hideInState (@NotNull final RendererGuiState state) |
| boolean | isHidden (@NotNull final RendererGuiState state) |
| void | setGuiAutoCloseListener (@Nullable final GuiAutoCloseListener guiAutoCloseListener) |
| boolean | isWithinDrawingArea (final int x, final int y) |
| void | setForcedActive (@Nullable final ActivatableGUIElement forcedActive) |
| String | toString () |
| void | autoSize (final int screenWidth, final int screenHeight) |
| void | setDefaultPosition (@NotNull final Expression defaultX,@NotNull final Expression defaultY) |
| boolean | isSaveDialog () |
| void | setSaveDialog () |
| void | showDialog (final int x, final int y, final int windowWidth, final int windowHeight) |
Package Functions |
| public< T extends GUIElement > T | getFirstElementEndingWith (@NotNull final Class< T > class_,@NotNull final String ending) |
| public< T extends GUIElement > T | getFirstElementNotEndingWith (@NotNull final Class< T > class_,@NotNull final String ending) |
| public< T extends GUIElement > T | getFirstElement (@NotNull final Class< T > class_) |
| public< T extends GUIElement > T | getFirstElement (@NotNull final Class< T > class_,@NotNull final String name) |
Detailed Description
Combines a list of GUIElements to for a gui.
A dialog can be modal. Such dialogs do not propagate key or mouse events to lower dialogs.
- Author:
- Andreas Kirschbaum
Definition at line 41 of file Gui.java.
Constructor & Destructor Documentation
| com.realtime.crossfire.jxclient.gui.gui.Gui.Gui |
( |
@NotNull final KeyBindings |
keyBindings |
) |
|
Creates a new instance.
- Parameters:
-
| keyBindings | the keybindings to use |
Definition at line 121 of file Gui.java.
Member Function Documentation
| void com.realtime.crossfire.jxclient.gui.gui.Gui.activateDefaultElement |
( |
|
) |
|
Activates the first default gui element of this gui.
Definition at line 200 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.autoSize |
( |
final int |
screenWidth, |
|
|
final int |
screenHeight | |
|
) |
| | |
Auto-resizes the dialog. Does nothing if this dialog is not auto-sizing.
- Parameters:
-
| screenWidth | the screen width |
| screenHeight | the screen height |
Definition at line 500 of file Gui.java.
| boolean com.realtime.crossfire.jxclient.gui.gui.Gui.deactivateCommandInput |
( |
|
) |
|
Deactivates the command text input field of this dialog. Does nothing if the command text input field is not active or if this dialog has no command text input field.
- Returns:
- whether the command text input field has been deactivated
Definition at line 393 of file Gui.java.
| AbstractGUIElement com.realtime.crossfire.jxclient.gui.gui.Gui.getElementFromPoint |
( |
final int |
x, |
|
|
final int |
y | |
|
) |
| | |
Determines the GUIElement for a given coordinate.
- Parameters:
-
| x | the x-coordinate to check |
| y | the y-coordinate to check |
- Returns:
- the
GUIElement at the given coordinate or null if none was found
Definition at line 283 of file Gui.java.
| public<T extends GUIElement> T com.realtime.crossfire.jxclient.gui.gui.Gui.getFirstElement |
( |
@NotNull final Class< T > |
class_, |
|
|
@NotNull final String |
name | |
|
) |
| | [package] |
Returns the first gui element of this gui belonging to the given class and having the given name.
- Parameters:
-
| class_ | the class to search for |
| name | the button's name |
- Returns:
- the button or
null if no button matches
Definition at line 416 of file Gui.java.
| public<T extends GUIElement> T com.realtime.crossfire.jxclient.gui.gui.Gui.getFirstElement |
( |
@NotNull final Class< T > |
class_ |
) |
[package] |
Returns the first gui element of this gui belonging to the given class.
- Parameters:
-
| class_ | the class to search for |
- Returns:
- the gui element or
null if not found
Definition at line 260 of file Gui.java.
| public<T extends GUIElement> T com.realtime.crossfire.jxclient.gui.gui.Gui.getFirstElementEndingWith |
( |
@NotNull final Class< T > |
class_, |
|
|
@NotNull final String |
ending | |
|
) |
| | [package] |
Returns the first gui element of this gui which belongs to the given class and that's name ends with the given ending.
- Parameters:
-
| class_ | the class to search for |
| ending | the ending to search for |
- Returns:
- the gui element or
null if not found
Definition at line 216 of file Gui.java.
| public<T extends GUIElement> T com.realtime.crossfire.jxclient.gui.gui.Gui.getFirstElementNotEndingWith |
( |
@NotNull final Class< T > |
class_, |
|
|
@NotNull final String |
ending | |
|
) |
| | [package] |
Returns the first gui element of this gui which belongs to the given class and that's name does not end with the given ending.
- Parameters:
-
| class_ | the class to search for |
| ending | the ending to search for |
- Returns:
- the gui element or
null if not found
Definition at line 239 of file Gui.java.
| KeyBindings com.realtime.crossfire.jxclient.gui.gui.Gui.getKeyBindings |
( |
|
) |
|
Returns the key bindings instance for this gui.
- Returns:
- the key bindings
Definition at line 435 of file Gui.java.
| boolean com.realtime.crossfire.jxclient.gui.gui.Gui.handleKeyPress |
( |
@NotNull final KeyEvent |
e |
) |
|
Dispatches a key press KeyEvent.
- Parameters:
-
- Returns:
- whether a gui element did handle the event
Definition at line 361 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.hideInState |
( |
@NotNull final RendererGuiState |
state |
) |
|
Hides the dialog in a state.
- Parameters:
-
Definition at line 443 of file Gui.java.
| boolean com.realtime.crossfire.jxclient.gui.gui.Gui.isActiveElement |
( |
@Nullable final ActivatableGUIElement |
activeElement |
) |
|
Returns whether a given gui element is the active element of this dialog.
- Parameters:
-
| activeElement | the gui element |
- Returns:
- whether the given gui element is active
Definition at line 341 of file Gui.java.
| boolean com.realtime.crossfire.jxclient.gui.gui.Gui.isAutoSize |
( |
|
) |
|
Returns whether this dialog is an auto-size dialog. Auto-size dialogs cannot be moved or resized manually.
- Returns:
- whether this dialog is auto-size
Definition at line 157 of file Gui.java.
| boolean com.realtime.crossfire.jxclient.gui.gui.Gui.isHidden |
( |
@NotNull final RendererGuiState |
state |
) |
|
Returns whether this gui is visible in a state.
- Parameters:
-
- Returns:
- whether this gui is hidden
Definition at line 452 of file Gui.java.
| boolean com.realtime.crossfire.jxclient.gui.gui.Gui.isModal |
( |
|
) |
|
Returns the modal state.
- Returns:
- the modal state
Definition at line 173 of file Gui.java.
| boolean com.realtime.crossfire.jxclient.gui.gui.Gui.isSaveDialog |
( |
|
) |
|
Returns whether this dialog retains its position across restarts.
- Returns:
- whether this dialog retains its position across restarts
Definition at line 542 of file Gui.java.
| boolean com.realtime.crossfire.jxclient.gui.gui.Gui.isWithinDrawingArea |
( |
final int |
x, |
|
|
final int |
y | |
|
) |
| | |
Returns whether a given point is within this dialog's drawing area.
- Parameters:
-
| x | the x-coordinate of the the point |
| y | the y-coordinate of the the point |
- Returns:
- whether the coordinate is within the drawing area
Definition at line 472 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.setActiveElement |
( |
@NotNull final ActivatableGUIElement |
activeElement, |
|
|
final boolean |
active | |
|
) |
| | |
Sets the gui element owning the focus.
- Parameters:
-
| activeElement | the gui element |
| active | the new active state |
Definition at line 299 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.setActiveElementActive |
( |
final boolean |
active |
) |
|
Activates or deactivates the GUI element owning the focus. Does nothing if no focus owner exists.
- Parameters:
-
| active | whether to activate the GUI element |
Definition at line 350 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.setAutoSize |
( |
@Nullable final Extent |
autoSize |
) |
|
Sets the auto-size state. Auto-size dialogs cannot be moved or resized manually.
- Parameters:
-
| autoSize | the new auto-size or null |
Definition at line 148 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.setDefaultPosition |
( |
@NotNull final Expression |
defaultX, |
|
|
@NotNull final Expression |
defaultY | |
|
) |
| | |
Sets the default position for this dialog.
- Parameters:
-
| defaultX | the default x-coordinate |
| defaultY | the default y-coordinate |
Definition at line 533 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.setForcedActive |
( |
@Nullable final ActivatableGUIElement |
forcedActive |
) |
|
Sets an ActivatableGUIElement that is always active. It prevents any other element from getting active.
- Parameters:
-
| forcedActive | the element to set or null to unset |
Definition at line 481 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.setGuiAutoCloseListener |
( |
@Nullable final GuiAutoCloseListener |
guiAutoCloseListener |
) |
|
Sets the GuiAutoCloseListener to be notified when this dialog becomes inactive.
- Parameters:
-
| guiAutoCloseListener | the listener to be notified or null |
Definition at line 462 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.setModal |
( |
final boolean |
modal |
) |
|
Sets the modal state.
- Parameters:
-
| modal | the new modal state |
Definition at line 165 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.setPosition |
( |
final int |
x, |
|
|
final int |
y | |
|
) |
| | |
Sets the position of this dialog.
- Parameters:
-
| x | the x-coordinate |
| y | the y-coordinate |
Definition at line 130 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.setSaveDialog |
( |
|
) |
|
Makes this dialog retain its position across restarts.
Definition at line 549 of file Gui.java.
| void com.realtime.crossfire.jxclient.gui.gui.Gui.showDialog |
( |
final int |
x, |
|
|
final int |
y, |
|
|
final int |
windowWidth, |
|
|
final int |
windowHeight | |
|
) |
| | |
Sets the position of a dialog but makes sure the dialog is fully visible.
- Parameters:
-
| x | the dialog's x coordinate |
| y | the dialog's y coordinate |
| windowWidth | the main window's width |
| windowHeight | the main window's height |
Definition at line 561 of file Gui.java.
| String com.realtime.crossfire.jxclient.gui.gui.Gui.toString |
( |
|
) |
|
The documentation for this class was generated from the following file:
- /home/leaf/crossfire/jxclient/trunk/gui/src/main/java/com/realtime/crossfire/jxclient/gui/gui/Gui.java