Class DefaultJXCSkin
java.lang.Object
com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin
Default
JXCSkin implementation.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultJXCSkin(@NotNull KeyBindings defaultKeyBindings, @NotNull OptionManager optionManager, @NotNull Dialogs dialogs) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommandList(@NotNull String commandListName, @NotNull CommandListType commandListType) Defines a new command list.voidDefines a new dialog.voidaddInitEvent(@NotNull CommandList commandList) Adds a command list to be executed on "init" events.voidaddOption(@NotNull String optionName, @NotNull String documentation, @NotNull Option commandCheckBoxOption) Add a new option.voidaddSkinEvent(@NotNull SkinEvent skinEvent) Records aSkinEventattached to this instance.voidattach(@NotNull TooltipManagerImpl tooltipManager) Attaches this skin to a gui manager.voiddetach()Frees all allocated resources.@NotNull CommandListgetCommandList(@NotNull String name) Returns a named command list.@NotNull Collection<String>Returns the names of all named command lists.@NotNull KeyBindingsReturns the default key bindings for this skin.@NotNull GuiReturns a dialog by name.@NotNull GuigetDialogBook(int bookNo) Returns the popup dialog for readables.@Nullable GuiReturns the "connection in progress" dialog.@Nullable GuiReturns the "disconnect from server?" dialog.@NotNull GuiReturns the key bindings dialog.@NotNull GuiReturns the dialog for query text input.@Nullable GuiReturns the "really quit?" dialog.@Nullable StringReturns one dialog pending loading.@NotNull GuiReturns the main window.@NotNull ResolutionReturns the maximal resolution of this skin.@NotNull GuiReturns the server selection window.@NotNull ResolutionReturns the minimal resolution of this skin.@NotNull StringReturns a short name for the skin.@NotNull GuiReturns the start window.@Nullable AbstractLabelReturns theAbstractLabelthat is used to display tooltips.voidinsertGuiElement(@NotNull GUIElement guiElement) Adds a newGUIElementto this skin.iterator()Returns all gui instances of this skin.voidsetSkinName(@NotNull String skinName, @NotNull Resolution minResolution, @NotNull Resolution maxResolution) Sets the skin name.voidsetTooltipLabel(@Nullable AbstractLabel tooltipLabel) Sets theAbstractLabelthat is used to display tooltips.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DefaultJXCSkin
public DefaultJXCSkin(@NotNull @NotNull KeyBindings defaultKeyBindings, @NotNull @NotNull OptionManager optionManager, @NotNull @NotNull Dialogs dialogs) Creates a new instance.- Parameters:
defaultKeyBindings- the default key bindingsoptionManager- the option manager to usedialogs- the dialogs to use
-
-
Method Details
-
getSkinName
Description copied from interface:JXCSkinReturns a short name for the skin. It is used to construct path or file names.- Specified by:
getSkinNamein interfaceJXCSkin- Returns:
- the skin name
-
setSkinName
public void setSkinName(@NotNull @NotNull String skinName, @NotNull @NotNull Resolution minResolution, @NotNull @NotNull Resolution maxResolution) Sets the skin name.- Parameters:
skinName- the skin nameminResolution- the minimal supported resolutionmaxResolution- the maximal supported resolution
-
getMinResolution
Description copied from interface:JXCSkinReturns the minimal resolution of this skin.- Specified by:
getMinResolutionin interfaceJXCSkin- Returns:
- the minimal resolution
-
getMaxResolution
Description copied from interface:JXCSkinReturns the maximal resolution of this skin.- Specified by:
getMaxResolutionin interfaceJXCSkin- Returns:
- the maximal resolution
-
getDialogQuit
Description copied from interface:JXCSkinReturns the "really quit?" dialog. It is opened when the user presses ESCAPE.- Specified by:
getDialogQuitin interfaceJXCSkin- Returns:
- the dialog or
nullif the dialog does not exist
-
getDialogDisconnect
Description copied from interface:JXCSkinReturns the "disconnect from server?" dialog. It is opened when the user presses ESCAPE.- Specified by:
getDialogDisconnectin interfaceJXCSkin- Returns:
- the dialog or
nullif the dialog does not exist
-
getDialogConnect
Description copied from interface:JXCSkinReturns the "connection in progress" dialog. It is opened while the connection establishment is in progress.- Specified by:
getDialogConnectin interfaceJXCSkin- Returns:
- the dialog or
nullif the dialog does not exist
-
getDialogKeyBind
Description copied from interface:JXCSkinReturns the key bindings dialog.- Specified by:
getDialogKeyBindin interfaceJXCSkin- Returns:
- the dialog
-
getDialogQuery
Description copied from interface:JXCSkinReturns the dialog for query text input.- Specified by:
getDialogQueryin interfaceJXCSkin- Returns:
- the dialog
-
getDialogBook
Description copied from interface:JXCSkinReturns the popup dialog for readables.- Specified by:
getDialogBookin interfaceJXCSkin- Parameters:
bookNo- the book ID- Returns:
- the dialog
-
getMainInterface
Description copied from interface:JXCSkinReturns the main window.- Specified by:
getMainInterfacein interfaceJXCSkin- Returns:
- the dialog
-
getMetaInterface
Description copied from interface:JXCSkinReturns the server selection window.- Specified by:
getMetaInterfacein interfaceJXCSkin- Returns:
- the dialog
-
getStartInterface
Description copied from interface:JXCSkinReturns the start window.- Specified by:
getStartInterfacein interfaceJXCSkin- Returns:
- the dialog
-
getDialog
Description copied from interface:JXCSkinReturns a dialog by name.- Specified by:
getDialogin interfaceJXCSkin- Parameters:
name- the dialog's name- Returns:
- the dialog
- Throws:
JXCSkinException- if the dialog does not exist
-
iterator
Description copied from interface:JXCSkinReturns all gui instances of this skin. The instances have no defined order. -
getCommandList
@NotNull public @NotNull CommandList getCommandList(@NotNull @NotNull String name) throws JXCSkinException Description copied from interface:JXCSkinReturns a named command list.- Specified by:
getCommandListin interfaceJXCSkin- Parameters:
name- the name of the command list- Returns:
- the command list
- Throws:
JXCSkinException- if the command list does not exist
-
getCommandListNames
Description copied from interface:JXCSkinReturns the names of all named command lists.- Specified by:
getCommandListNamesin interfaceJXCSkin- Returns:
- the names in alphabetical order
-
getDefaultKeyBindings
Description copied from interface:JXCSkinReturns the default key bindings for this skin.- Specified by:
getDefaultKeyBindingsin interfaceJXCSkin- Returns:
- the default key bindings
-
attach
Description copied from interface:JXCSkinAttaches this skin to a gui manager. -
detach
public void detach()Description copied from interface:JXCSkinFrees all allocated resources. -
insertGuiElement
Adds a newGUIElementto this skin.- Parameters:
guiElement- the GUI element
-
addDialog
Defines a new dialog.- Parameters:
dialogName- the dialog's name
-
getDialogToLoad
Returns one dialog pending loading. Each dialog is returned only once.- Returns:
- a dialog pending loading or
null
-
addCommandList
public void addCommandList(@NotNull @NotNull String commandListName, @NotNull @NotNull CommandListType commandListType) throws JXCSkinException Defines a new command list.- Parameters:
commandListName- the command list's namecommandListType- the command list's type- Throws:
JXCSkinException- if the command list cannot be created
-
addInitEvent
Adds a command list to be executed on "init" events.- Parameters:
commandList- the command list
-
addOption
public void addOption(@NotNull @NotNull String optionName, @NotNull @NotNull String documentation, @NotNull @NotNull Option commandCheckBoxOption) throws JXCSkinException Add a new option.- Parameters:
optionName- the option name to adddocumentation- the documentation string for the settingscommandCheckBoxOption- the option instance to forward to- Throws:
JXCSkinException- if the option cannot be created
-
setTooltipLabel
Sets theAbstractLabelthat is used to display tooltips.- Parameters:
tooltipLabel- the label ornullto disable tooltips
-
getTooltipLabel
Description copied from interface:JXCSkinReturns theAbstractLabelthat is used to display tooltips.- Specified by:
getTooltipLabelin interfaceJXCSkin- Returns:
- the label or
nullif tooltips are disabled
-
addSkinEvent
Records aSkinEventattached to this instance.- Parameters:
skinEvent- the skin event to add
-