 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.skin.skin;
37 import java.util.ArrayList;
38 import java.util.Collection;
39 import java.util.HashSet;
40 import java.util.Iterator;
41 import org.jetbrains.annotations.NotNull;
42 import org.jetbrains.annotations.Nullable;
72 private final Collection<CommandList>
initEvents =
new ArrayList<>();
84 private final Collection<GUIElement>
guiElements =
new HashSet<>();
90 private final Collection<SkinEvent>
skinEvents =
new HashSet<>();
155 throw new IllegalArgumentException(
"minimum width must not exceed maximum width");
158 throw new IllegalArgumentException(
"minimum height must not exceed maximum height");
214 final AssertionError error =
new AssertionError(
"keybind dialog does not exist");
226 final AssertionError error =
new AssertionError(
"query dialog does not exist");
238 final AssertionError error =
new AssertionError(
"book dialog does not exist");
250 final AssertionError error =
new AssertionError(
"main dialog does not exist");
262 final AssertionError error =
new AssertionError(
"meta dialog does not exist");
274 final AssertionError error =
new AssertionError(
"start dialog does not exist");
313 if (this.tooltipManager !=
null) {
314 throw new IllegalStateException(
"skin is already attached");
327 if (tmpTooltipManager !=
null) {
350 public void addDialog(@NotNull
final String dialogName) {
Interface for events attached to skins.
Gui getDialog(@NotNull final String name)
Returns a dialog by name.
Gui getDialogConnect()
Returns the "connection in progress" dialog.
void addOption(@NotNull final String optionName, @NotNull final String documentation, @NotNull final Option commandCheckBoxOption)
Add a new option.
Resolution minResolution
The minimal resolution.
Combines a list of GUIElements to for a gui.
String skinName
The skin name.
AbstractLabel getTooltipLabel()
Returns the AbstractLabel that is used to display tooltips.
Gui getDialogKeyBind()
Returns the key bindings dialog.
final Collection< String > optionNames
The defined option names.
final KeyBindings defaultKeyBindings
The default key bindings.
void addOption(@NotNull final String optionName, @NotNull final String documentation, @NotNull final Option option)
Adds a new option.
final JXCSkinCache< CommandList > definedCommandLists
All defined command lists.
AbstractLabel tooltipLabel
The tooltip label or.
Iterator< Gui > iterator()
final OptionManager optionManager
The OptionManager to use.
String getSkinName()
Returns a short name for the skin.
Abstract base class for all label classes.
CommandList getCommandList(@NotNull final String name)
Returns a named command list.
Gui getDialogBook(final int bookNo)
Returns the popup dialog for readables.
void dispose()
Releases all allocated resources.
void insertGuiElement(@NotNull final GUIElement guiElement)
Adds a new GUIElement to this skin.
Implements a cache for elements identified by name.
void setTooltipLabel(@Nullable final AbstractLabel tooltipLabel)
Sets the AbstractLabel that is used to display tooltips.
void addDialog(@NotNull final String name)
Creates a new dialog instance.
Exception thrown if a skin related problem occurs.
void detach()
Frees all allocated resources.
void addDialog(@NotNull final String dialogName)
Defines a new dialog.
Manages a set of key bindings.
Default JXCSkin implementation.
void attach(@NotNull final TooltipManagerImpl tooltipManager)
Attaches this skin to a gui manager.
Interface defining an abstract GUI element.
int getHeight()
Returns the height in pixels.
TooltipManagerImpl tooltipManager
The TooltipManagerImpl currently attached to or.
final Collection< GUIElement > guiElements
All GUI elements.
Gui getDialogQuery()
Returns the dialog for query text input.
Gui getDialogQuit()
Returns the "really quit?" dialog.
Maintains a set of named options.
final Collection< SkinEvent > skinEvents
All SkinEvents attached to this instance.
void addCommandList(@NotNull final String commandListName, @NotNull final CommandListType commandListType)
Defines a new command list.
Iterator< Gui > iterator()
Returns all gui instances of this skin.
Gui lookup(@NotNull final String name)
Returns a dialog instance by dialog name.
Information about JXClient's screen/window resolution.
Collection< String > getCommandListNames()
Returns the names of all named command lists.
Gui getDialogDisconnect()
Returns the "disconnect from server?" dialog.
The base class for all options.
Resolution maxResolution
The maximal resolution.
void addSkinEvent(@NotNull final SkinEvent skinEvent)
Records a SkinEvent attached to this instance.
void addInitEvent(@NotNull final CommandList commandList)
Adds a command list to be executed on "init" events.
void execute()
Execute the command list by calling GUICommand#execute() for each command in order.
A list of GUICommand instances.
Gui getMetaInterface()
Returns the server selection window.
Maintains a set of Gui instances representing dialog windows.
final Collection< CommandList > initEvents
All "event init" commands in execution order.
Defines a JXClient skin consisting of a main Gui and zero or more dialog Guis.
void dispose()
Will be called when the skin is disposed.
Resolution getMaxResolution()
Returns the maximal resolution of this skin.
Resolution getMinResolution()
Returns the minimal resolution of this skin.
Gui getMainInterface()
Returns the main window.
String getDialogToLoad()
Returns one dialog pending loading.
String getDialogToLoad()
Returns one dialog pending loading.
final Dialogs dialogs
All defined dialogs.
Gui getStartInterface()
Returns the start window.
void setSkinName(@NotNull final String skinName, @NotNull final Resolution minResolution, @NotNull final Resolution maxResolution)
Sets the skin name.
DefaultJXCSkin(@NotNull final KeyBindings defaultKeyBindings, @NotNull final OptionManager optionManager, @NotNull final Dialogs dialogs)
Creates a new instance.
int getWidth()
Returns the width in pixels.
Indicates about an incorrect option.
KeyBindings getDefaultKeyBindings()
Returns the default key bindings for this skin.