com.realtime.crossfire.jxclient.skin.skin
Interface JXCSkin

All Superinterfaces:
java.lang.Iterable<Gui>
All Known Implementing Classes:
DefaultJXCSkin

public interface JXCSkin
extends java.lang.Iterable<Gui>

Defines a JXClient skin consisting of a main Gui and zero or more dialog Guis.


Method Summary
 void attach(TooltipManager 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.
 Gui getMainInterface()
          Returns the main window.
 java.awt.Dimension getMapSize()
          Returns the map size in squares.
 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.
 int getNumLookObjects()
          The number of ground view objects to request from the server.
 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.
 boolean hasChangedDialog()
          Returns whether the dialog state should be saved.
 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.
 

Method Detail

attach

void attach(@NotNull
            TooltipManager tooltipManager)
Attaches this skin to a gui manager.

Parameters:
tooltipManager - the tooltip manager to attach to

detach

void detach()
Frees all allocated resources.


getCommandList

@NotNull
CommandList getCommandList(@NotNull
                                   java.lang.String name)
                           throws JXCSkinException
Returns a named command list.

Parameters:
name - the name of the command list
Returns:
the command list
Throws:
JXCSkinException - if the command list does not exist

getDefaultKeyBindings

@NotNull
KeyBindings getDefaultKeyBindings()
Returns the default key bindings for this skin.

Returns:
the default key bindings

getDialog

@NotNull
Gui getDialog(@NotNull
                      java.lang.String name)
              throws JXCSkinException
Returns a dialog by name.

Parameters:
name - the dialog's name
Returns:
the dialog
Throws:
JXCSkinException - if the dialog does not exist

getDialogBook

@NotNull
Gui getDialogBook(int bookNo)
Returns the popup dialog for readables.

Parameters:
bookNo - the book ID
Returns:
the dialog

getDialogConnect

@Nullable
Gui 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

getDialogDisconnect

@Nullable
Gui 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

getDialogKeyBind

@NotNull
Gui getDialogKeyBind()
Returns the key bindings dialog.

Returns:
the dialog

getDialogQuery

@NotNull
Gui getDialogQuery()
Returns the dialog for query text input.

Returns:
the dialog

getDialogQuit

@Nullable
Gui 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

getMainInterface

@NotNull
Gui getMainInterface()
Returns the main window.

Returns:
the dialog

getMapSize

@NotNull
java.awt.Dimension getMapSize()
Returns the map size in squares.

Returns:
the map size

getMaxResolution

@NotNull
Resolution getMaxResolution()
Returns the maximal resolution of this skin.

Returns:
the maximal resolution

getMetaInterface

@NotNull
Gui getMetaInterface()
Returns the server selection window.

Returns:
the dialog

getMinResolution

@NotNull
Resolution getMinResolution()
Returns the minimal resolution of this skin.

Returns:
the minimal resolution

getNumLookObjects

int getNumLookObjects()
The number of ground view objects to request from the server.

Returns:
the number of ground view objects

getSkinName

@NotNull
java.lang.String getSkinName()
Returns a short name for the skin. It is used to construct path or file names.

Returns:
the skin name

getStartInterface

@NotNull
Gui getStartInterface()
Returns the start window.

Returns:
the dialog

getTooltipLabel

@Nullable
AbstractLabel getTooltipLabel()
Returns the AbstractLabel that is used to display tooltips.

Returns:
the label or null if tooltips are disabled

hasChangedDialog

boolean hasChangedDialog()
Returns whether the dialog state should be saved.

Returns:
whether the dialog state should be saved

iterator

@NotNull
java.util.Iterator<Gui> iterator()
Returns all gui instances of this skin. The instances has no defined order.

Specified by:
iterator in interface java.lang.Iterable<Gui>
Returns:
an iterator returning all gui instances

setScreenSize

void setScreenSize(int screenWidth,
                   int screenHeight)
Updates the skin's gui elements to a screen size.

Parameters:
screenWidth - the new screen width
screenHeight - the new screen height