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