Crossfire JXClient, Trunk
Public Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin Class Reference
Inheritance diagram for com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin:
Collaboration graph

Public Member Functions

void addCommandList (@NotNull final String commandListName, @NotNull final CommandListType commandListType) throws JXCSkinException
 
void addDialog (@NotNull final String dialogName)
 
void addInitEvent (@NotNull final CommandList commandList)
 
void addOption (@NotNull final String optionName, @NotNull final String documentation, @NotNull final Option commandCheckBoxOption) throws JXCSkinException
 
void addSkinEvent (@NotNull final SkinEvent skinEvent)
 
void attach (@NotNull final TooltipManagerImpl tooltipManager)
 
 DefaultJXCSkin (@NotNull final KeyBindings defaultKeyBindings, @NotNull final OptionManager optionManager, @NotNull final Dialogs dialogs)
 
void detach ()
 
CommandList getCommandList (@NotNull final String name) throws JXCSkinException
 
Collection< String > getCommandListNames ()
 
KeyBindings getDefaultKeyBindings ()
 
Gui getDialog (@NotNull final String name) throws JXCSkinException
 
Gui getDialogBook (final int bookNo)
 
Gui getDialogConnect ()
 
Gui getDialogDisconnect ()
 
Gui getDialogKeyBind ()
 
Gui getDialogQuery ()
 
Gui getDialogQuit ()
 
String getDialogToLoad ()
 
Gui getMainInterface ()
 
Resolution getMaxResolution ()
 
Gui getMetaInterface ()
 
Resolution getMinResolution ()
 
String getSkinName ()
 
Gui getStartInterface ()
 
AbstractLabel getTooltipLabel ()
 
void insertGuiElement (@NotNull final GUIElement guiElement)
 
Iterator< Guiiterator ()
 
void setScreenSize (final int screenWidth, final int screenHeight)
 
void setSkinName (@NotNull final String skinName, @NotNull final Resolution minResolution, @NotNull final Resolution maxResolution)
 
void setTooltipLabel (@Nullable final AbstractLabel tooltipLabel)
 

Private Attributes

int currentScreenHeight
 
int currentScreenWidth
 
final KeyBindings defaultKeyBindings
 
final JXCSkinCache< CommandListdefinedCommandLists = new JXCSkinCache<>("command list")
 
final Dialogs dialogs
 
final Collection< GUIElementguiElements = new HashSet<>()
 
final Collection< CommandListinitEvents = new ArrayList<>()
 
Resolution maxResolution = new Resolution(1, 1)
 
Resolution minResolution = new Resolution(1, 1)
 
final OptionManager optionManager
 
final Collection< String > optionNames = new HashSet<>()
 
final Collection< SkinEventskinEvents = new HashSet<>()
 
String skinName = "unknown"
 
AbstractLabel tooltipLabel
 
TooltipManagerImpl tooltipManager
 

Detailed Description

Default JXCSkin implementation.

Author
Andreas Kirschbaum

Definition at line 48 of file DefaultJXCSkin.java.

Constructor & Destructor Documentation

◆ DefaultJXCSkin()

com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.DefaultJXCSkin ( @NotNull final KeyBindings  defaultKeyBindings,
@NotNull final OptionManager  optionManager,
@NotNull final Dialogs  dialogs 
)

Creates a new instance.

Parameters
defaultKeyBindingsthe default key bindings
optionManagerthe option manager to use
dialogsthe dialogs to use

Definition at line 145 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.defaultKeyBindings, com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.dialogs, and com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.optionManager.

Member Function Documentation

◆ addCommandList()

void com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.addCommandList ( @NotNull final String  commandListName,
@NotNull final CommandListType  commandListType 
) throws JXCSkinException

Defines a new command list.

Parameters
commandListNamethe command list's name
commandListTypethe command list's type
Exceptions
JXCSkinExceptionif the command list cannot be created

Definition at line 390 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.definedCommandLists.

Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseCommandList().

Here is the caller graph for this function:

◆ addDialog()

void com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.addDialog ( @NotNull final String  dialogName)

Defines a new dialog.

Parameters
dialogNamethe dialog's name

Definition at line 371 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.Dialogs.addDialog(), and com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.dialogs.

Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addInitEvent()

void com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.addInitEvent ( @NotNull final CommandList  commandList)

Adds a command list to be executed on "init" events.

Parameters
commandListthe command list

Definition at line 399 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.initEvents.

Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseEvent().

Here is the caller graph for this function:

◆ addOption()

void com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.addOption ( @NotNull final String  optionName,
@NotNull final String  documentation,
@NotNull final Option  commandCheckBoxOption 
) throws JXCSkinException

Add a new option.

Parameters
optionNamethe option name to add
documentationthe documentation string for the settings
commandCheckBoxOptionthe option instance to forward to
Exceptions
JXCSkinExceptionif the option cannot be created

Definition at line 410 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.settings.options.OptionManager.addOption(), com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.optionManager, and com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.optionNames.

Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseDef().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addSkinEvent()

void com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.addSkinEvent ( @NotNull final SkinEvent  skinEvent)

Records a SkinEvent attached to this instance.

Parameters
skinEventthe skin event to add

Definition at line 437 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.skinEvents.

Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseEvent().

Here is the caller graph for this function:

◆ attach()

void com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.attach ( @NotNull final TooltipManagerImpl  tooltipManager)

◆ detach()

void com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.detach ( )

◆ getCommandList()

CommandList com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getCommandList ( @NotNull final String  name) throws JXCSkinException

◆ getCommandListNames()

Collection<String> com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getCommandListNames ( )

Returns the names of all named command lists.

Returns
the names in alphabetical order

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 310 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.definedCommandLists.

◆ getDefaultKeyBindings()

KeyBindings com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDefaultKeyBindings ( )

Returns the default key bindings for this skin.

Returns
the default key bindings

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 316 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.defaultKeyBindings.

Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseKey().

Here is the caller graph for this function:

◆ getDialog()

Gui com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialog ( @NotNull final String  name) throws JXCSkinException

◆ getDialogBook()

Gui com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialogBook ( final int  bookNo)

Returns the popup dialog for readables.

Parameters
bookNothe book ID
Returns
the dialog

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 244 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialog().

Here is the call graph for this function:

◆ getDialogConnect()

Gui com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialogConnect ( )

Returns the "connection in progress" dialog. It is opened while the connection establishment is in progress.

Returns
the dialog or
null
if the dialog does not exist

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 210 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialog().

Here is the call graph for this function:

◆ getDialogDisconnect()

Gui com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialogDisconnect ( )

Returns the "disconnect from server?" dialog. It is opened when the user presses ESCAPE.

Returns
the dialog or
null
if the dialog does not exist

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 200 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialog().

Here is the call graph for this function:

◆ getDialogKeyBind()

Gui com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialogKeyBind ( )

Returns the key bindings dialog.

Returns
the dialog

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 220 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialog().

Here is the call graph for this function:

◆ getDialogQuery()

Gui com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialogQuery ( )

Returns the dialog for query text input.

Returns
the dialog

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 232 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialog().

Here is the call graph for this function:

◆ getDialogQuit()

Gui com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialogQuit ( )

Returns the "really quit?" dialog. It is opened when the user presses ESCAPE.

Returns
the dialog or
null
if the dialog does not exist

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 190 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialog().

Here is the call graph for this function:

◆ getDialogToLoad()

String com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialogToLoad ( )

Returns one dialog pending loading. Each dialog is returned only once.

Returns
a dialog pending loading or
null

Definition at line 380 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.dialogs, and com.realtime.crossfire.jxclient.skin.skin.Dialogs.getDialogToLoad().

Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMainInterface()

Gui com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getMainInterface ( )

Returns the main window.

Returns
the dialog

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 256 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialog().

Here is the call graph for this function:

◆ getMaxResolution()

Resolution com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getMaxResolution ( )

Returns the maximal resolution of this skin.

Returns
the maximal resolution

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 184 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.maxResolution.

◆ getMetaInterface()

Gui com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getMetaInterface ( )

Returns the server selection window.

Returns
the dialog

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 268 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialog().

Here is the call graph for this function:

◆ getMinResolution()

Resolution com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getMinResolution ( )

Returns the minimal resolution of this skin.

Returns
the minimal resolution

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 178 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.minResolution.

◆ getSkinName()

String com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getSkinName ( )

Returns a short name for the skin. It is used to construct path or file names.

Returns
the skin name

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 153 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.skinName.

◆ getStartInterface()

Gui com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getStartInterface ( )

Returns the start window.

Returns
the dialog

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 280 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getDialog().

Here is the call graph for this function:

◆ getTooltipLabel()

AbstractLabel com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.getTooltipLabel ( )

Returns the AbstractLabel that is used to display tooltips.

Returns
the label or
null
if tooltips are disabled

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 429 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.tooltipLabel.

◆ insertGuiElement()

void com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.insertGuiElement ( @NotNull final GUIElement  guiElement)

Adds a new GUIElement to this skin.

Parameters
guiElementthe GUI element

Definition at line 363 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.guiElements.

Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.insertGuiElement().

Here is the caller graph for this function:

◆ iterator()

Iterator<Gui> com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.iterator ( )

Returns all gui instances of this skin. The instances have no defined order.

Returns
an iterator returning all gui instances

Implements com.realtime.crossfire.jxclient.skin.skin.JXCSkin.

Definition at line 298 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.dialogs, and com.realtime.crossfire.jxclient.skin.skin.Dialogs.iterator().

Here is the call graph for this function:

◆ setScreenSize()

void com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.setScreenSize ( final int  screenWidth,
final int  screenHeight 
)

◆ setSkinName()

void com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.setSkinName ( @NotNull final String  skinName,
@NotNull final Resolution  minResolution,
@NotNull final Resolution  maxResolution 
)

Sets the skin name.

Parameters
skinNamethe skin name
minResolutionthe minimal supported resolution
maxResolutionthe maximal supported resolution

Definition at line 163 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.util.Resolution.getHeight(), com.realtime.crossfire.jxclient.util.Resolution.getWidth(), com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.maxResolution, com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.minResolution, and com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.skinName.

Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseSkinName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTooltipLabel()

void com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.setTooltipLabel ( @Nullable final AbstractLabel  tooltipLabel)

Sets the AbstractLabel that is used to display tooltips.

Parameters
tooltipLabelthe label or
null
to disable tooltips

Definition at line 423 of file DefaultJXCSkin.java.

References com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.tooltipLabel.

Referenced by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader.parseTooltip().

Here is the caller graph for this function:

Member Data Documentation

◆ currentScreenHeight

int com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.currentScreenHeight
private

The current screen height.

Definition at line 76 of file DefaultJXCSkin.java.

Referenced by com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.setScreenSize().

◆ currentScreenWidth

int com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.currentScreenWidth
private

The current screen width.

Definition at line 71 of file DefaultJXCSkin.java.

Referenced by com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.setScreenSize().

◆ defaultKeyBindings

final KeyBindings com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.defaultKeyBindings
private

◆ definedCommandLists

final JXCSkinCache<CommandList> com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.definedCommandLists = new JXCSkinCache<>("command list")
private

◆ dialogs

final Dialogs com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.dialogs
private

◆ guiElements

final Collection<GUIElement> com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.guiElements = new HashSet<>()
private

◆ initEvents

final Collection<CommandList> com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.initEvents = new ArrayList<>()
private

◆ maxResolution

Resolution com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.maxResolution = new Resolution(1, 1)
private

◆ minResolution

Resolution com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.minResolution = new Resolution(1, 1)
private

◆ optionManager

final OptionManager com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.optionManager
private

◆ optionNames

final Collection<String> com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.optionNames = new HashSet<>()
private

◆ skinEvents

final Collection<SkinEvent> com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.skinEvents = new HashSet<>()
private

◆ skinName

String com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.skinName = "unknown"
private

◆ tooltipLabel

AbstractLabel com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.tooltipLabel
private

◆ tooltipManager

TooltipManagerImpl com.realtime.crossfire.jxclient.skin.skin.DefaultJXCSkin.tooltipManager
private

The documentation for this class was generated from the following file: