Constructor and Description |
---|
DefaultJXCSkin(@NotNull KeyBindings defaultKeyBindings,
@NotNull OptionManager optionManager,
@NotNull Dialogs dialogs)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addCommandList(@NotNull java.lang.String commandListName,
@NotNull CommandListType commandListType)
Defines a new command list.
|
void |
addDialog(@NotNull java.lang.String dialogName)
Defines a new dialog.
|
void |
addInitEvent(@NotNull CommandList commandList)
Adds a command list to be executed on "init" events.
|
void |
addOption(@NotNull java.lang.String optionName,
@NotNull java.lang.String documentation,
@NotNull Option commandCheckBoxOption)
Add a new option.
|
void |
addSkinEvent(@NotNull SkinEvent skinEvent)
Records a
SkinEvent attached to this instance. |
void |
attach(@NotNull TooltipManagerImpl tooltipManager)
Attaches this skin to a gui manager.
|
void |
detach()
Frees all allocated resources.
|
@NotNull CommandList |
getCommandList(@NotNull java.lang.String name)
Returns a named command list.
|
@NotNull java.util.Collection<java.lang.String> |
getCommandListNames()
Returns the names of all named command lists.
|
@NotNull KeyBindings |
getDefaultKeyBindings()
Returns the default key bindings for this skin.
|
@NotNull Gui |
getDialog(@NotNull java.lang.String name)
Returns a dialog by name.
|
@NotNull Gui |
getDialogBook(int bookNo)
Returns the popup dialog for readables.
|
@Nullable Gui |
getDialogConnect()
Returns the "connection in progress" dialog.
|
@Nullable Gui |
getDialogDisconnect()
Returns the "disconnect from server?" dialog.
|
@NotNull Gui |
getDialogKeyBind()
Returns the key bindings dialog.
|
@NotNull Gui |
getDialogQuery()
Returns the dialog for query text input.
|
@Nullable Gui |
getDialogQuit()
Returns the "really quit?" dialog.
|
@Nullable java.lang.String |
getDialogToLoad()
Returns one dialog pending loading.
|
@NotNull Gui |
getMainInterface()
Returns the main window.
|
@NotNull Resolution |
getMaxResolution()
Returns the maximal resolution of this skin.
|
@NotNull Gui |
getMetaInterface()
Returns the server selection window.
|
@NotNull Resolution |
getMinResolution()
Returns the minimal resolution of this skin.
|
@NotNull java.lang.String |
getSkinName()
Returns a short name for the skin.
|
@NotNull Gui |
getStartInterface()
Returns the start window.
|
@Nullable AbstractLabel |
getTooltipLabel()
Returns the
AbstractLabel that is used to display tooltips. |
void |
insertGuiElement(@NotNull GUIElement guiElement)
Adds a new
GUIElement to this skin. |
@NotNull java.util.Iterator<Gui> |
iterator()
Returns all gui instances of this skin.
|
void |
setScreenSize(int screenWidth,
int screenHeight)
Updates the skin's gui elements to a screen size.
|
void |
setSkinName(@NotNull java.lang.String skinName,
@NotNull Resolution minResolution,
@NotNull Resolution maxResolution)
Sets the skin name.
|
void |
setTooltipLabel(@Nullable AbstractLabel tooltipLabel)
Sets the
AbstractLabel that is used to display tooltips. |
public DefaultJXCSkin(@NotNull @NotNull KeyBindings defaultKeyBindings, @NotNull @NotNull OptionManager optionManager, @NotNull @NotNull Dialogs dialogs)
defaultKeyBindings
- the default key bindingsoptionManager
- the option manager to usedialogs
- the dialogs to use@NotNull public @NotNull java.lang.String getSkinName()
JXCSkin
getSkinName
in interface JXCSkin
public void setSkinName(@NotNull @NotNull java.lang.String skinName, @NotNull @NotNull Resolution minResolution, @NotNull @NotNull Resolution maxResolution)
skinName
- the skin nameminResolution
- the minimal supported resolutionmaxResolution
- the maximal supported resolution@NotNull public @NotNull Resolution getMinResolution()
JXCSkin
getMinResolution
in interface JXCSkin
@NotNull public @NotNull Resolution getMaxResolution()
JXCSkin
getMaxResolution
in interface JXCSkin
@Nullable public @Nullable Gui getDialogQuit()
JXCSkin
getDialogQuit
in interface JXCSkin
null
if the dialog does not exist@Nullable public @Nullable Gui getDialogDisconnect()
JXCSkin
getDialogDisconnect
in interface JXCSkin
null
if the dialog does not exist@Nullable public @Nullable Gui getDialogConnect()
JXCSkin
getDialogConnect
in interface JXCSkin
null
if the dialog does not exist@NotNull public @NotNull Gui getDialogKeyBind()
JXCSkin
getDialogKeyBind
in interface JXCSkin
@NotNull public @NotNull Gui getDialogQuery()
JXCSkin
getDialogQuery
in interface JXCSkin
@NotNull public @NotNull Gui getDialogBook(int bookNo)
JXCSkin
getDialogBook
in interface JXCSkin
bookNo
- the book ID@NotNull public @NotNull Gui getMainInterface()
JXCSkin
getMainInterface
in interface JXCSkin
@NotNull public @NotNull Gui getMetaInterface()
JXCSkin
getMetaInterface
in interface JXCSkin
@NotNull public @NotNull Gui getStartInterface()
JXCSkin
getStartInterface
in interface JXCSkin
@NotNull public @NotNull Gui getDialog(@NotNull @NotNull java.lang.String name) throws JXCSkinException
JXCSkin
getDialog
in interface JXCSkin
name
- the dialog's nameJXCSkinException
- if the dialog does not exist@NotNull public @NotNull java.util.Iterator<Gui> iterator()
JXCSkin
@NotNull public @NotNull CommandList getCommandList(@NotNull @NotNull java.lang.String name) throws JXCSkinException
JXCSkin
getCommandList
in interface JXCSkin
name
- the name of the command listJXCSkinException
- if the command list does not exist@NotNull public @NotNull java.util.Collection<java.lang.String> getCommandListNames()
JXCSkin
getCommandListNames
in interface JXCSkin
@NotNull public @NotNull KeyBindings getDefaultKeyBindings()
JXCSkin
getDefaultKeyBindings
in interface JXCSkin
public void attach(@NotNull @NotNull TooltipManagerImpl tooltipManager)
JXCSkin
public void detach()
JXCSkin
public void setScreenSize(int screenWidth, int screenHeight)
JXCSkin
setScreenSize
in interface JXCSkin
screenWidth
- the new screen widthscreenHeight
- the new screen heightpublic void insertGuiElement(@NotNull @NotNull GUIElement guiElement)
GUIElement
to this skin.guiElement
- the GUI elementpublic void addDialog(@NotNull @NotNull java.lang.String dialogName)
dialogName
- the dialog's name@Nullable public @Nullable java.lang.String getDialogToLoad()
null
public void addCommandList(@NotNull @NotNull java.lang.String commandListName, @NotNull @NotNull CommandListType commandListType) throws JXCSkinException
commandListName
- the command list's namecommandListType
- the command list's typeJXCSkinException
- if the command list cannot be createdpublic void addInitEvent(@NotNull @NotNull CommandList commandList)
commandList
- the command listpublic void addOption(@NotNull @NotNull java.lang.String optionName, @NotNull @NotNull java.lang.String documentation, @NotNull @NotNull Option commandCheckBoxOption) throws JXCSkinException
optionName
- the option name to adddocumentation
- the documentation string for the settingscommandCheckBoxOption
- the option instance to forward toJXCSkinException
- if the option cannot be createdpublic void setTooltipLabel(@Nullable @Nullable AbstractLabel tooltipLabel)
AbstractLabel
that is used to display tooltips.tooltipLabel
- the label or null
to disable tooltips@Nullable public @Nullable AbstractLabel getTooltipLabel()
JXCSkin
AbstractLabel
that is used to display tooltips.getTooltipLabel
in interface JXCSkin
null
if tooltips are disabled