com.realtime.crossfire.jxclient.skin.io
Class JXCSkinLoader

java.lang.Object
  extended by com.realtime.crossfire.jxclient.skin.io.JXCSkinLoader

public class JXCSkinLoader
extends java.lang.Object

Parser for loading JXCSkin instances from JXCSkinSources.


Field Summary
private  CheckBoxFactory checkBoxFactory
          The checkbox factory.
private  CommandParser commandParser
          The CommandParser for parsing commands.
private  ItemPainter defaultItemPainter
          The ItemPainter for default item parameters.
private  KeyBindings defaultKeyBindings
          The default key bindings.
private  int defaultTileSize
          The default tile size for the map view.
private  JXCSkinCache<java.awt.Font> definedFonts
          All defined fonts.
private  JXCSkinCache<GUIElement> definedGUIElements
          The defined GUIElements.
private  DialogFactory dialogFactory
          The dialog factory.
private  ExperienceTable experienceTable
          The ExperienceTable to use.
private  FacesManager facesManager
          The FacesManager instance to use.
private  FacesProviderFactory facesProviderFactory
          The FacesProviderFactory instance for creating faces provider instances.
private  FloorView floorView
          The FloorView to use.
private  FontParser fontParser
          The FontParser for parsing font specifications.
private  GaugeUpdaterParser gaugeUpdaterParser
          The GaugeUpdaterParser for parsing gauge specifications.
private  GuiElementParser guiElementParser
          The GuiElementParser for parsing gui element specifications.
private  ImageParser imageParser
          The ImageParser for parsing image specifications.
private  ItemView inventoryView
          The inventory ItemView to use.
private  ItemSet itemSet
          The ItemSet instance to use.
private  CfMapUpdater mapUpdater
          The CfMapUpdater instance to use.
private  OptionManager optionManager
          The OptionManager instance to use.
private  SkillSet skillSet
          The SkillSet instance to use.
private  DefaultJXCSkin skin
          The JXCSkin being loaded.
private  SpellsManager spellsManager
          The SpellsManager instance to use.
private  Stats stats
          The Stats instance to use.
private  TextButtonFactory textButtonFactory
          The text button factory.
 
Constructor Summary
JXCSkinLoader(ItemSet itemSet, ItemView inventoryView, FloorView floorView, SpellsManager spellsManager, FacesManager facesManager, Stats stats, CfMapUpdater mapUpdater, KeyBindings defaultKeyBindings, OptionManager optionManager, ExperienceTable experienceTable, SkillSet skillSet, int defaultTileSize)
          Creates a new instance.
 
Method Summary
private  void addCommand(java.lang.String listName, Args args, GUIElement element, java.lang.String command, GuiStateManager guiStateManager, Commands commands, java.io.LineNumberReader lnr, CommandQueue commandQueue, CrossfireServerConnection crossfireServerConnection, CommandCallback commandCallback, Macros macros)
          Parses and builds command arguments.
private  void insertGuiElement(GUIElement guiElement)
          Adds a new GUIElement to this skin.
 JXCSkin load(JXCSkinSource skinSource, CrossfireServerConnection crossfireServerConnection, GuiStateManager guiStateManager, TooltipManager tooltipManager, JXCWindowRenderer windowRenderer, GUIElementListener elementListener, MetaserverModel metaserverModel, CharacterModel characterModel, CommandQueue commandQueue, Shortcuts shortcuts, Commands commands, CurrentSpellManager currentSpellManager, CommandCallback commandCallback, Macros macros, GuiFactory guiFactory)
          Loads the skin from its external representation.
private  void load(JXCSkinSource skinSource, java.lang.String dialogName, CrossfireServerConnection server, GuiStateManager guiStateManager, TooltipManager tooltipManager, JXCWindowRenderer windowRenderer, GUIElementListener elementListener, MetaserverModel metaserverModel, CharacterModel characterModel, CommandQueue commandQueue, Gui gui, Shortcuts shortcuts, Commands commands, CurrentSpellManager currentSpellManager, CommandCallback commandCallback, Macros macros, java.awt.Image nextGroupFace, java.awt.Image prevGroupFace)
          Loads a skin file and add the entries to a Gui instance.
private  void load(JXCSkinSource skinSource, java.lang.String dialogName, java.lang.String resourceName, java.io.InputStream inputStream, CrossfireServerConnection server, GuiStateManager guiStateManager, TooltipManager tooltipManager, JXCWindowRenderer windowRenderer, GUIElementListener elementListener, MetaserverModel metaserverModel, CharacterModel characterModel, CommandQueue commandQueue, Gui gui, Shortcuts shortcuts, Commands commands, CurrentSpellManager currentSpellManager, CommandCallback commandCallback, Macros macros, java.awt.Image nextGroupFace, java.awt.Image prevGroupFace)
          Loads a skin file and add the entries to a Gui instance.
private  GaugeUpdater newGaugeUpdater(java.lang.String name)
          Creates a new GaugeUpdater instance from a string representation.
private  void parseButton(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, java.io.LineNumberReader lnr)
          Parses a "button" command.
private  void parseCharacterList(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, CharacterModel characterModel)
          Parses a "character_list" command.
private  void parseCheckbox(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, java.io.LineNumberReader lnr)
          Parses a "checkbox" command.
private  void parseCommandList(Args args, GuiStateManager guiStateManager, java.io.LineNumberReader lnr, Commands commands, CommandQueue commandQueue, CrossfireServerConnection server, CommandCallback commandCallback, Macros macros)
          Parses a "commandlist" command.
private  void parseCommandListAdd(Args args, GuiStateManager guiStateManager, java.io.LineNumberReader lnr, Commands commands, CommandQueue commandQueue, CrossfireServerConnection server, CommandCallback commandCallback, Macros macros)
          Parses a "commandlist_add" command.
private  void parseCommandText(Args args, CommandCallback commandCallback, TooltipManager tooltipManager, GUIElementListener elementListener, Commands commands)
          Parses a "command_text" command.
private  void parseDef(Args args, java.io.LineNumberReader lnr)
          Parses a "def" command.
private  void parseDialog(Args args, TooltipManager tooltipManager, JXCWindowRenderer windowRenderer, GUIElementListener elementListener, java.io.LineNumberReader lnr, Gui gui, java.lang.String dialogName)
          Parses a "dialog" command.
private static void parseDialogHide(Args args, Gui gui)
          Parses a "dialog_hide" command.
private  void parseDupGauge(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, java.io.LineNumberReader lnr)
          Parses a "dupgauge" command.
private  void parseDupTextGauge(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, java.io.LineNumberReader lnr)
          Parses a "duptextgauge" command.
private  void parseEvent(Args args, GuiStateManager guiStateManager, CrossfireServerConnection server)
          Parses an "event" command.
private static Extent parseExtent(Args args)
          Creates an Extent from four parameters.
private  void parseFill(Args args, TooltipManager tooltipManager, GUIElementListener elementListener)
          Parses a "fill" command.
private  void parseFont(Args args)
          Parses a "font" command.
private  void parseGauge(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, java.io.LineNumberReader lnr)
          Parses a "gauge" command.
private  void parseHideInput(Args args)
          Parses a "hide_input" command.
private  void parseIgnore(Args args)
          Parses an "ignore" command.
private  void parseItem(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, CommandQueue commandQueue, CrossfireServerConnection server, Shortcuts shortcuts, CurrentSpellManager currentSpellManager, java.awt.Image nextGroupFace, java.awt.Image prevGroupFace)
          Parses an "item" command.
private  void parseKey(Args args, Gui gui, java.lang.String line)
          Parses a "key" command.
private  void parseLabelFailure(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, CrossfireServerConnection server)
          Parses a "label_failure" command.
private  void parseLabelHtml(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, java.io.LineNumberReader lnr)
          Parses a "label_html" command.
private  void parseLabelMessage(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, CrossfireServerConnection server, JXCWindowRenderer windowRenderer)
          Parses a "label_message" command.
private  void parseLabelMulti(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, java.io.LineNumberReader lnr)
          Parses a "label_multi" command.
private  void parseLabelQuery(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, CrossfireServerConnection server)
          Parses a "label_query" command.
private  void parseLabelSpell(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, CurrentSpellManager currentSpellManager)
          Parses a "label_spell" command.
private  void parseLabelStat(Args args, TooltipManager tooltipManager, GUIElementListener elementListener)
          Parses a "label_stat" command.
private  void parseLabelStat2(Args args, TooltipManager tooltipManager, GUIElementListener elementListener)
          Parses a "label_stat2" command.
private  void parseLabelText(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, java.io.LineNumberReader lnr)
          Parses a "label_text" command.
private  void parseList(Args args, boolean inventoryList, TooltipManager tooltipManager, GUIElementListener elementListener, CommandQueue commandQueue, CrossfireServerConnection server, java.awt.Image nextGroupFace, java.awt.Image prevGroupFace)
          Parses an "inventory_list" or a "floor_list" command.
private  void parseLogColor(Args args)
          Parses a "log_color" command.
private  void parseLogFilter(Args args)
          Parses a "log_filter" command.
private  void parseLogLabel(Args args, TooltipManager tooltipManager, GUIElementListener elementListener)
          Parses a "log_label" command.
private  void parseLogMessage(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, CrossfireServerConnection server)
          Parses a "log_message" command.
private  void parseMap(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, CrossfireServerConnection server)
          Parses a "map" command.
private  void parseMetaList(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, MetaserverModel metaserverModel)
          Parses a "meta_list" command.
private  void parseMinimap(Args args, TooltipManager tooltipManager, GUIElementListener elementListener)
          Parses a "minimap" command.
private  void parsePicture(Args args, TooltipManager tooltipManager, GUIElementListener elementListener)
          Parses a "picture" command.
private  void parseQueryText(Args args, CrossfireServerConnection server, CommandCallback commandCallback, TooltipManager tooltipManager, GUIElementListener elementListener)
          Parses a "query_text" command.
private static Resolution parseResolution(java.lang.String text)
          Parses a resolution specification.
private  void parseScrollbar(Args args, TooltipManager tooltipManager, GUIElementListener elementListener)
          Parses a "scrollbar" command.
private static void parseSetAutoSize(Gui gui)
          Parses a "set_auto_size" command.
private  void parseSetDefault(Args args)
          Parses a "set_default" command.
private  void parseSetForcedActive(Args args, Gui gui)
          Parses a "set_forced_active" command.
private  void parseSetInvisible(Args args)
          Parses a "set_invisible" command.
private static void parseSetModal(Gui gui)
          Parses a "set_modal" command.
private  void parseSetNumLookObjects(Args args)
          Parses a "set_num_look_objects" command.
private  void parseSkinName(Args args)
          Parses a "skin_name" command.
private  void parseText(Args args, CommandCallback commandCallback, TooltipManager tooltipManager, GUIElementListener elementListener)
          Parses a "text" command.
private  void parseTextButton(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, java.io.LineNumberReader lnr)
          Parses a "textbutton" command.
private  void parseTextGauge(Args args, TooltipManager tooltipManager, GUIElementListener elementListener, java.io.LineNumberReader lnr)
          Parses a "textgauge" command.
private  void parseTooltip(Args args, TooltipManager tooltipManager, GUIElementListener elementListener)
          Parses a "tooltip" command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

checkBoxFactory

@Nullable
private CheckBoxFactory checkBoxFactory
The checkbox factory. Set to null until defined.


commandParser

@NotNull
private CommandParser commandParser
The CommandParser for parsing commands.


defaultItemPainter

@Nullable
private ItemPainter defaultItemPainter
The ItemPainter for default item parameters. Set to null until defined.


defaultKeyBindings

@NotNull
private final KeyBindings defaultKeyBindings
The default key bindings.


defaultTileSize

private final int defaultTileSize
The default tile size for the map view.


definedFonts

@NotNull
private final JXCSkinCache<java.awt.Font> definedFonts
All defined fonts.


definedGUIElements

@NotNull
private final JXCSkinCache<GUIElement> definedGUIElements
The defined GUIElements.


dialogFactory

@Nullable
private DialogFactory dialogFactory
The dialog factory. Set to null until defined.


experienceTable

@NotNull
private final ExperienceTable experienceTable
The ExperienceTable to use.


facesManager

@NotNull
private final FacesManager facesManager
The FacesManager instance to use.


facesProviderFactory

@NotNull
private final FacesProviderFactory facesProviderFactory
The FacesProviderFactory instance for creating faces provider instances.


floorView

@NotNull
private final FloorView floorView
The FloorView to use.


fontParser

@NotNull
private FontParser fontParser
The FontParser for parsing font specifications.


gaugeUpdaterParser

@NotNull
private GaugeUpdaterParser gaugeUpdaterParser
The GaugeUpdaterParser for parsing gauge specifications.


guiElementParser

@NotNull
private GuiElementParser guiElementParser
The GuiElementParser for parsing gui element specifications.


imageParser

@NotNull
private ImageParser imageParser
The ImageParser for parsing image specifications.


inventoryView

@NotNull
private final ItemView inventoryView
The inventory ItemView to use.


itemSet

@NotNull
private final ItemSet itemSet
The ItemSet instance to use.


mapUpdater

@NotNull
private final CfMapUpdater mapUpdater
The CfMapUpdater instance to use.


optionManager

@NotNull
private final OptionManager optionManager
The OptionManager instance to use.


skillSet

@NotNull
private final SkillSet skillSet
The SkillSet instance to use.


skin

@NotNull
private DefaultJXCSkin skin
The JXCSkin being loaded.


spellsManager

@NotNull
private final SpellsManager spellsManager
The SpellsManager instance to use.


stats

@NotNull
private final Stats stats
The Stats instance to use.


textButtonFactory

@Nullable
private TextButtonFactory textButtonFactory
The text button factory. Set to null until defined.

Constructor Detail

JXCSkinLoader

public JXCSkinLoader(@NotNull
                     ItemSet itemSet,
                     @NotNull
                     ItemView inventoryView,
                     @NotNull
                     FloorView floorView,
                     @NotNull
                     SpellsManager spellsManager,
                     @NotNull
                     FacesManager facesManager,
                     @NotNull
                     Stats stats,
                     @NotNull
                     CfMapUpdater mapUpdater,
                     @NotNull
                     KeyBindings defaultKeyBindings,
                     @NotNull
                     OptionManager optionManager,
                     @NotNull
                     ExperienceTable experienceTable,
                     @NotNull
                     SkillSet skillSet,
                     int defaultTileSize)
Creates a new instance.

Parameters:
itemSet - the item set instance to use
inventoryView - the inventory item view to use
floorView - the floor view to use
spellsManager - the spells manager instance to use
facesManager - the faces manager instance to use
stats - the stats instance to use
mapUpdater - the map updater instance to use
defaultKeyBindings - the default key bindings
optionManager - the option manager to use
experienceTable - the experience table to use
skillSet - the skill set to use
defaultTileSize - the default tile size for the map view
Method Detail

addCommand

private void addCommand(@NotNull
                        java.lang.String listName,
                        @NotNull
                        Args args,
                        @Nullable
                        GUIElement element,
                        @NotNull
                        java.lang.String command,
                        @NotNull
                        GuiStateManager guiStateManager,
                        @NotNull
                        Commands commands,
                        @NotNull
                        java.io.LineNumberReader lnr,
                        @NotNull
                        CommandQueue commandQueue,
                        @NotNull
                        CrossfireServerConnection crossfireServerConnection,
                        @NotNull
                        CommandCallback commandCallback,
                        @NotNull
                        Macros macros)
                 throws java.io.IOException,
                        JXCSkinException
Parses and builds command arguments.

Parameters:
listName - the command list name to add to
args - the list of arguments
element - the target element
command - the command to parse the arguments of
guiStateManager - the gui state manager instance
commands - the commands instance for executing commands
lnr - the source to read more parameters from
commandQueue - the command queue for executing commands
crossfireServerConnection - the server connection to use
commandCallback - the command callback to use
macros - the macros instance to use
Throws:
java.io.IOException - if a syntax error occurs
JXCSkinException - if an element cannot be found

insertGuiElement

private void insertGuiElement(@NotNull
                              GUIElement guiElement)
                       throws JXCSkinException
Adds a new GUIElement to this skin.

Parameters:
guiElement - the GUI element
Throws:
JXCSkinException - if the name is not unique

load

@NotNull
public JXCSkin load(@NotNull
                            JXCSkinSource skinSource,
                            @NotNull
                            CrossfireServerConnection crossfireServerConnection,
                            @NotNull
                            GuiStateManager guiStateManager,
                            @NotNull
                            TooltipManager tooltipManager,
                            @NotNull
                            JXCWindowRenderer windowRenderer,
                            @NotNull
                            GUIElementListener elementListener,
                            @NotNull
                            MetaserverModel metaserverModel,
                            @NotNull
                            CharacterModel characterModel,
                            @NotNull
                            CommandQueue commandQueue,
                            @NotNull
                            Shortcuts shortcuts,
                            @NotNull
                            Commands commands,
                            @NotNull
                            CurrentSpellManager currentSpellManager,
                            @NotNull
                            CommandCallback commandCallback,
                            @NotNull
                            Macros macros,
                            @NotNull
                            GuiFactory guiFactory)
             throws JXCSkinException
Loads the skin from its external representation.

Parameters:
skinSource - the source to load from
crossfireServerConnection - the server connection to attach to
guiStateManager - the gui state manager instance
tooltipManager - the tooltip manager to update
windowRenderer - the window renderer to add to
elementListener - the element listener to notify
metaserverModel - the metaserver mode to use
characterModel - the character model to use
commandQueue - the command queue to use
shortcuts - the shortcuts to use
commands - the commands instance to use
currentSpellManager - the current spell manager to use
commandCallback - the command callback to use
macros - the macros instance to use
guiFactory - the gui factory for creating gui elements
Returns:
the loaded skin
Throws:
JXCSkinException - if the skin cannot be loaded

load

private void load(@NotNull
                  JXCSkinSource skinSource,
                  @NotNull
                  java.lang.String dialogName,
                  @NotNull
                  CrossfireServerConnection server,
                  @NotNull
                  GuiStateManager guiStateManager,
                  @NotNull
                  TooltipManager tooltipManager,
                  @NotNull
                  JXCWindowRenderer windowRenderer,
                  @NotNull
                  GUIElementListener elementListener,
                  @NotNull
                  MetaserverModel metaserverModel,
                  @NotNull
                  CharacterModel characterModel,
                  @NotNull
                  CommandQueue commandQueue,
                  @Nullable
                  Gui gui,
                  @NotNull
                  Shortcuts shortcuts,
                  @NotNull
                  Commands commands,
                  @NotNull
                  CurrentSpellManager currentSpellManager,
                  @NotNull
                  CommandCallback commandCallback,
                  @NotNull
                  Macros macros,
                  @NotNull
                  java.awt.Image nextGroupFace,
                  @NotNull
                  java.awt.Image prevGroupFace)
           throws JXCSkinException
Loads a skin file and add the entries to a Gui instance.

Parameters:
skinSource - th source to load from
dialogName - the key to identify this dialog
server - the server connection to monitor
guiStateManager - the gui state manager instance
tooltipManager - the tooltip manager to update
windowRenderer - the window renderer to add to
elementListener - the element listener to notify
metaserverModel - the metaserver model to use
characterModel - the character model to use
commandQueue - the command queue for sending commands
gui - the Gui representing the skin file
shortcuts - the shortcuts instance
commands - the commands instance for executing commands
currentSpellManager - the current spell manager to use
commandCallback - the command callback to use
macros - the macros instance to use
nextGroupFace - the image for "next group of items"
prevGroupFace - the image for "prev group of items"
Throws:
JXCSkinException - if the file cannot be loaded

load

private void load(@NotNull
                  JXCSkinSource skinSource,
                  @NotNull
                  java.lang.String dialogName,
                  @NotNull
                  java.lang.String resourceName,
                  @NotNull
                  java.io.InputStream inputStream,
                  @NotNull
                  CrossfireServerConnection server,
                  @NotNull
                  GuiStateManager guiStateManager,
                  @NotNull
                  TooltipManager tooltipManager,
                  @NotNull
                  JXCWindowRenderer windowRenderer,
                  @NotNull
                  GUIElementListener elementListener,
                  @NotNull
                  MetaserverModel metaserverModel,
                  @NotNull
                  CharacterModel characterModel,
                  @NotNull
                  CommandQueue commandQueue,
                  @Nullable
                  Gui gui,
                  @NotNull
                  Shortcuts shortcuts,
                  @NotNull
                  Commands commands,
                  @NotNull
                  CurrentSpellManager currentSpellManager,
                  @NotNull
                  CommandCallback commandCallback,
                  @NotNull
                  Macros macros,
                  @NotNull
                  java.awt.Image nextGroupFace,
                  @NotNull
                  java.awt.Image prevGroupFace)
           throws JXCSkinException
Loads a skin file and add the entries to a Gui instance.

Parameters:
skinSource - the source to load from
dialogName - the key to identify this dialog
resourceName - the name of the skin resource; used to construct error messages
inputStream - the input stream to load from
server - the server connection to monitor
guiStateManager - the gui state manager instance
tooltipManager - the tooltip manager to update
windowRenderer - the window renderer to add to
elementListener - the element listener to notify
metaserverModel - the metaserver model to use
characterModel - the character model to use
commandQueue - the command queue for sending commands
gui - the Gui representing the skin file
shortcuts - the shortcuts instance
commands - the commands instance for executing commands
currentSpellManager - the current spell manager to use
commandCallback - the command callback to use
macros - the macros instance to use
nextGroupFace - the image for "next group of items"
prevGroupFace - the image for "prev group of items"
Throws:
JXCSkinException - if the file cannot be loaded

newGaugeUpdater

@NotNull
private GaugeUpdater newGaugeUpdater(@NotNull
                                             java.lang.String name)
                              throws java.io.IOException
Creates a new GaugeUpdater instance from a string representation.

Parameters:
name - the gauge updater value to parse
Returns:
the gauge updater
Throws:
java.io.IOException - if the gauge updater value does not exist

parseButton

private void parseButton(@NotNull
                         Args args,
                         @NotNull
                         TooltipManager tooltipManager,
                         @NotNull
                         GUIElementListener elementListener,
                         @NotNull
                         java.io.LineNumberReader lnr)
                  throws java.io.IOException,
                         JXCSkinException
Parses a "button" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
lnr - the line number reader for reading more lines
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseCharacterList

private void parseCharacterList(@NotNull
                                Args args,
                                @NotNull
                                TooltipManager tooltipManager,
                                @NotNull
                                GUIElementListener elementListener,
                                @NotNull
                                CharacterModel characterModel)
                         throws java.io.IOException,
                                JXCSkinException
Parses a "character_list" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
characterModel - the character model to use
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseCheckbox

private void parseCheckbox(@NotNull
                           Args args,
                           @NotNull
                           TooltipManager tooltipManager,
                           @NotNull
                           GUIElementListener elementListener,
                           @NotNull
                           java.io.LineNumberReader lnr)
                    throws java.io.IOException,
                           JXCSkinException
Parses a "checkbox" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
lnr - the line number reader for reading more lines
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseCommandList

private void parseCommandList(@NotNull
                              Args args,
                              @NotNull
                              GuiStateManager guiStateManager,
                              @NotNull
                              java.io.LineNumberReader lnr,
                              @NotNull
                              Commands commands,
                              @NotNull
                              CommandQueue commandQueue,
                              @NotNull
                              CrossfireServerConnection server,
                              @NotNull
                              CommandCallback commandCallback,
                              @NotNull
                              Macros macros)
                       throws java.io.IOException,
                              JXCSkinException
Parses a "commandlist" command.

Parameters:
args - the command arguments
guiStateManager - the gui state manager instance
lnr - the line number reader for reading more lines
commands - the commands to add to
commandQueue - the command queue to use
server - the server to use
commandCallback - the command callback to use
macros - the macros instance to use
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseCommandListAdd

private void parseCommandListAdd(@NotNull
                                 Args args,
                                 @NotNull
                                 GuiStateManager guiStateManager,
                                 @NotNull
                                 java.io.LineNumberReader lnr,
                                 @NotNull
                                 Commands commands,
                                 @NotNull
                                 CommandQueue commandQueue,
                                 @NotNull
                                 CrossfireServerConnection server,
                                 @NotNull
                                 CommandCallback commandCallback,
                                 @NotNull
                                 Macros macros)
                          throws java.io.IOException,
                                 JXCSkinException
Parses a "commandlist_add" command.

Parameters:
args - the command arguments
guiStateManager - the gui state manager instance
lnr - the line number reader for reading more lines
commands - the commands to add to
commandQueue - the command queue to use
server - the server to use
commandCallback - the command callback to use
macros - the macros instance to use
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseCommandText

private void parseCommandText(@NotNull
                              Args args,
                              @NotNull
                              CommandCallback commandCallback,
                              @NotNull
                              TooltipManager tooltipManager,
                              @NotNull
                              GUIElementListener elementListener,
                              @NotNull
                              Commands commands)
                       throws java.io.IOException,
                              JXCSkinException
Parses a "command_text" command.

Parameters:
args - the command arguments
commandCallback - the command callback to use
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
commands - the commands to use
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseDef

private void parseDef(@NotNull
                      Args args,
                      @NotNull
                      java.io.LineNumberReader lnr)
               throws java.io.IOException,
                      JXCSkinException
Parses a "def" command.

Parameters:
args - the command arguments
lnr - the line number reader for reading more lines
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseDialog

private void parseDialog(@NotNull
                         Args args,
                         @NotNull
                         TooltipManager tooltipManager,
                         @NotNull
                         JXCWindowRenderer windowRenderer,
                         @NotNull
                         GUIElementListener elementListener,
                         @NotNull
                         java.io.LineNumberReader lnr,
                         @NotNull
                         Gui gui,
                         @NotNull
                         java.lang.String dialogName)
                  throws java.io.IOException,
                         JXCSkinException
Parses a "dialog" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
windowRenderer - the window renderer the dialog belongs to
elementListener - the element listener to notify
lnr - the line number reader for reading more lines
gui - the gui instance to add to
dialogName - the dialog name
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseDialogHide

private static void parseDialogHide(@NotNull
                                    Args args,
                                    @NotNull
                                    Gui gui)
                             throws java.io.IOException
Parses a "dialog_hide" command.

Parameters:
args - the command arguments
gui - the gui instance to use
Throws:
java.io.IOException - if the command cannot be parsed

parseDupGauge

private void parseDupGauge(@NotNull
                           Args args,
                           @NotNull
                           TooltipManager tooltipManager,
                           @NotNull
                           GUIElementListener elementListener,
                           @NotNull
                           java.io.LineNumberReader lnr)
                    throws java.io.IOException,
                           JXCSkinException
Parses a "dupgauge" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
lnr - the line number reader for reading more lines
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseDupTextGauge

private void parseDupTextGauge(@NotNull
                               Args args,
                               @NotNull
                               TooltipManager tooltipManager,
                               @NotNull
                               GUIElementListener elementListener,
                               @NotNull
                               java.io.LineNumberReader lnr)
                        throws java.io.IOException,
                               JXCSkinException
Parses a "duptextgauge" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
lnr - the line number reader for reading more lines
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseEvent

private void parseEvent(@NotNull
                        Args args,
                        @NotNull
                        GuiStateManager guiStateManager,
                        @NotNull
                        CrossfireServerConnection server)
                 throws java.io.IOException,
                        JXCSkinException
Parses an "event" command.

Parameters:
args - the command arguments
guiStateManager - the gui state manager instance
server - the server to monitor
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseExtent

@NotNull
private static Extent parseExtent(Args args)
                           throws java.io.IOException
Creates an Extent from four parameters.

Parameters:
args - the parameters
Returns:
the extent
Throws:
java.io.IOException - if the extent cannot be parsed

parseFill

private void parseFill(@NotNull
                       Args args,
                       @NotNull
                       TooltipManager tooltipManager,
                       @NotNull
                       GUIElementListener elementListener)
                throws java.io.IOException,
                       JXCSkinException
Parses a "fill" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseFont

private void parseFont(@NotNull
                       Args args)
                throws java.io.IOException,
                       JXCSkinException
Parses a "font" command.

Parameters:
args - the command arguments
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseGauge

private void parseGauge(@NotNull
                        Args args,
                        @NotNull
                        TooltipManager tooltipManager,
                        @NotNull
                        GUIElementListener elementListener,
                        @NotNull
                        java.io.LineNumberReader lnr)
                 throws java.io.IOException,
                        JXCSkinException
Parses a "gauge" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
lnr - the line number reader for reading more lines
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseHideInput

private void parseHideInput(@NotNull
                            Args args)
                     throws java.io.IOException,
                            JXCSkinException
Parses a "hide_input" command.

Parameters:
args - the command arguments
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseIgnore

private void parseIgnore(@NotNull
                         Args args)
                  throws java.io.IOException,
                         JXCSkinException
Parses an "ignore" command.

Parameters:
args - the command arguments
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseItem

private void parseItem(@NotNull
                       Args args,
                       @NotNull
                       TooltipManager tooltipManager,
                       @NotNull
                       GUIElementListener elementListener,
                       @NotNull
                       CommandQueue commandQueue,
                       @NotNull
                       CrossfireServerConnection server,
                       @NotNull
                       Shortcuts shortcuts,
                       @NotNull
                       CurrentSpellManager currentSpellManager,
                       @NotNull
                       java.awt.Image nextGroupFace,
                       @NotNull
                       java.awt.Image prevGroupFace)
                throws java.io.IOException,
                       JXCSkinException
Parses an "item" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
commandQueue - the command queue to use
server - the server to use
shortcuts - the shortcuts to use
currentSpellManager - the current spell manager to use
nextGroupFace - the image for "next group of items"
prevGroupFace - the image for "prev group of items"
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseKey

private void parseKey(@NotNull
                      Args args,
                      @Nullable
                      Gui gui,
                      @NotNull
                      java.lang.String line)
               throws java.io.IOException
Parses a "key" command.

Parameters:
args - the command arguments
gui - the gui to add to
line - the unparsed command line
Throws:
java.io.IOException - if the command cannot be parsed

parseLabelFailure

private void parseLabelFailure(@NotNull
                               Args args,
                               @NotNull
                               TooltipManager tooltipManager,
                               @NotNull
                               GUIElementListener elementListener,
                               @NotNull
                               CrossfireServerConnection server)
                        throws java.io.IOException,
                               JXCSkinException
Parses a "label_failure" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
server - the server instance to monitor
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLabelHtml

private void parseLabelHtml(@NotNull
                            Args args,
                            @NotNull
                            TooltipManager tooltipManager,
                            @NotNull
                            GUIElementListener elementListener,
                            @NotNull
                            java.io.LineNumberReader lnr)
                     throws java.io.IOException,
                            JXCSkinException
Parses a "label_html" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
lnr - the line number reader for reading more lines
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLabelMessage

private void parseLabelMessage(@NotNull
                               Args args,
                               @NotNull
                               TooltipManager tooltipManager,
                               @NotNull
                               GUIElementListener elementListener,
                               @NotNull
                               CrossfireServerConnection server,
                               @NotNull
                               JXCWindowRenderer windowRenderer)
                        throws java.io.IOException,
                               JXCSkinException
Parses a "label_message" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
server - the server instance to monitor
windowRenderer - the window renderer to create the element for
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLabelMulti

private void parseLabelMulti(@NotNull
                             Args args,
                             @NotNull
                             TooltipManager tooltipManager,
                             @NotNull
                             GUIElementListener elementListener,
                             @NotNull
                             java.io.LineNumberReader lnr)
                      throws java.io.IOException,
                             JXCSkinException
Parses a "label_multi" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
lnr - the line number reader for reading more lines
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLabelQuery

private void parseLabelQuery(@NotNull
                             Args args,
                             @NotNull
                             TooltipManager tooltipManager,
                             @NotNull
                             GUIElementListener elementListener,
                             @NotNull
                             CrossfireServerConnection server)
                      throws java.io.IOException,
                             JXCSkinException
Parses a "label_query" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
server - the server instance to monitor
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLabelSpell

private void parseLabelSpell(@NotNull
                             Args args,
                             @NotNull
                             TooltipManager tooltipManager,
                             @NotNull
                             GUIElementListener elementListener,
                             @NotNull
                             CurrentSpellManager currentSpellManager)
                      throws java.io.IOException,
                             JXCSkinException
Parses a "label_spell" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
currentSpellManager - the current spell manager to use
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLabelStat

private void parseLabelStat(@NotNull
                            Args args,
                            @NotNull
                            TooltipManager tooltipManager,
                            @NotNull
                            GUIElementListener elementListener)
                     throws java.io.IOException,
                            JXCSkinException
Parses a "label_stat" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLabelStat2

private void parseLabelStat2(@NotNull
                             Args args,
                             @NotNull
                             TooltipManager tooltipManager,
                             @NotNull
                             GUIElementListener elementListener)
                      throws java.io.IOException,
                             JXCSkinException
Parses a "label_stat2" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLabelText

private void parseLabelText(@NotNull
                            Args args,
                            @NotNull
                            TooltipManager tooltipManager,
                            @NotNull
                            GUIElementListener elementListener,
                            @NotNull
                            java.io.LineNumberReader lnr)
                     throws java.io.IOException,
                            JXCSkinException
Parses a "label_text" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
lnr - the line number reader for reading more lines
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseList

private void parseList(@NotNull
                       Args args,
                       boolean inventoryList,
                       @NotNull
                       TooltipManager tooltipManager,
                       @NotNull
                       GUIElementListener elementListener,
                       @NotNull
                       CommandQueue commandQueue,
                       @NotNull
                       CrossfireServerConnection server,
                       @NotNull
                       java.awt.Image nextGroupFace,
                       @NotNull
                       java.awt.Image prevGroupFace)
                throws java.io.IOException,
                       JXCSkinException
Parses an "inventory_list" or a "floor_list" command.

Parameters:
args - the command arguments
inventoryList - true for "inventory_list" command, false for "floor_list" command
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
commandQueue - the command queue to use
server - the server to use
nextGroupFace - the image for "next group of items"
prevGroupFace - the image for "prev group of items"
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLogColor

private void parseLogColor(@NotNull
                           Args args)
                    throws java.io.IOException,
                           JXCSkinException
Parses a "log_color" command.

Parameters:
args - the command arguments
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLogFilter

private void parseLogFilter(@NotNull
                            Args args)
                     throws java.io.IOException,
                            JXCSkinException
Parses a "log_filter" command.

Parameters:
args - the command arguments
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLogLabel

private void parseLogLabel(@NotNull
                           Args args,
                           @NotNull
                           TooltipManager tooltipManager,
                           @NotNull
                           GUIElementListener elementListener)
                    throws java.io.IOException,
                           JXCSkinException
Parses a "log_label" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseLogMessage

private void parseLogMessage(@NotNull
                             Args args,
                             @NotNull
                             TooltipManager tooltipManager,
                             @NotNull
                             GUIElementListener elementListener,
                             @NotNull
                             CrossfireServerConnection server)
                      throws java.io.IOException,
                             JXCSkinException
Parses a "log_message" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
server - the server to use
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseMap

private void parseMap(@NotNull
                      Args args,
                      @NotNull
                      TooltipManager tooltipManager,
                      @NotNull
                      GUIElementListener elementListener,
                      @NotNull
                      CrossfireServerConnection server)
               throws java.io.IOException,
                      JXCSkinException
Parses a "map" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
server - the server to monitor
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseMetaList

private void parseMetaList(@NotNull
                           Args args,
                           @NotNull
                           TooltipManager tooltipManager,
                           @NotNull
                           GUIElementListener elementListener,
                           @NotNull
                           MetaserverModel metaserverModel)
                    throws java.io.IOException,
                           JXCSkinException
Parses a "meta_list" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
metaserverModel - the metaserver model to use
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseMinimap

private void parseMinimap(@NotNull
                          Args args,
                          @NotNull
                          TooltipManager tooltipManager,
                          @NotNull
                          GUIElementListener elementListener)
                   throws java.io.IOException,
                          JXCSkinException
Parses a "minimap" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parsePicture

private void parsePicture(@NotNull
                          Args args,
                          @NotNull
                          TooltipManager tooltipManager,
                          @NotNull
                          GUIElementListener elementListener)
                   throws java.io.IOException,
                          JXCSkinException
Parses a "picture" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseQueryText

private void parseQueryText(@NotNull
                            Args args,
                            @NotNull
                            CrossfireServerConnection server,
                            @NotNull
                            CommandCallback commandCallback,
                            @NotNull
                            TooltipManager tooltipManager,
                            @NotNull
                            GUIElementListener elementListener)
                     throws java.io.IOException,
                            JXCSkinException
Parses a "query_text" command.

Parameters:
args - the command arguments
server - the crossfire server connection for sending reply commands
commandCallback - the command callback to use
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseResolution

@NotNull
private static Resolution parseResolution(@NotNull
                                                  java.lang.String text)
                                   throws java.io.IOException
Parses a resolution specification.

Parameters:
text - the resolution specification
Returns:
the resolution
Throws:
java.io.IOException - if the resolution specification cannot be parsed

parseScrollbar

private void parseScrollbar(@NotNull
                            Args args,
                            @NotNull
                            TooltipManager tooltipManager,
                            @NotNull
                            GUIElementListener elementListener)
                     throws java.io.IOException,
                            JXCSkinException
Parses a "scrollbar" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseSetAutoSize

private static void parseSetAutoSize(@NotNull
                                     Gui gui)
Parses a "set_auto_size" command.

Parameters:
gui - the gui to modify

parseSetDefault

private void parseSetDefault(@NotNull
                             Args args)
                      throws java.io.IOException,
                             JXCSkinException
Parses a "set_default" command.

Parameters:
args - the command arguments
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseSetForcedActive

private void parseSetForcedActive(@NotNull
                                  Args args,
                                  @NotNull
                                  Gui gui)
                           throws java.io.IOException,
                                  JXCSkinException
Parses a "set_forced_active" command.

Parameters:
args - the command arguments
gui - the gui to modify
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseSetInvisible

private void parseSetInvisible(@NotNull
                               Args args)
                        throws java.io.IOException,
                               JXCSkinException
Parses a "set_invisible" command.

Parameters:
args - the command arguments
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseSetModal

private static void parseSetModal(@NotNull
                                  Gui gui)
Parses a "set_modal" command.

Parameters:
gui - the gui to modify

parseSetNumLookObjects

private void parseSetNumLookObjects(@NotNull
                                    Args args)
                             throws java.io.IOException
Parses a "set_num_look_objects" command.

Parameters:
args - the command arguments
Throws:
java.io.IOException - if the command cannot be parsed

parseSkinName

private void parseSkinName(@NotNull
                           Args args)
                    throws java.io.IOException
Parses a "skin_name" command.

Parameters:
args - the command arguments
Throws:
java.io.IOException - if the command cannot be parsed

parseText

private void parseText(@NotNull
                       Args args,
                       @NotNull
                       CommandCallback commandCallback,
                       @NotNull
                       TooltipManager tooltipManager,
                       @NotNull
                       GUIElementListener elementListener)
                throws java.io.IOException,
                       JXCSkinException
Parses a "text" command.

Parameters:
args - the command arguments
commandCallback - the command callback to use
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseTextButton

private void parseTextButton(@NotNull
                             Args args,
                             @NotNull
                             TooltipManager tooltipManager,
                             @NotNull
                             GUIElementListener elementListener,
                             @NotNull
                             java.io.LineNumberReader lnr)
                      throws java.io.IOException,
                             JXCSkinException
Parses a "textbutton" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
lnr - the line number reader for reading more lines
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseTextGauge

private void parseTextGauge(@NotNull
                            Args args,
                            @NotNull
                            TooltipManager tooltipManager,
                            @NotNull
                            GUIElementListener elementListener,
                            @NotNull
                            java.io.LineNumberReader lnr)
                     throws java.io.IOException,
                            JXCSkinException
Parses a "textgauge" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
lnr - the line number reader for reading more lines
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed

parseTooltip

private void parseTooltip(@NotNull
                          Args args,
                          @NotNull
                          TooltipManager tooltipManager,
                          @NotNull
                          GUIElementListener elementListener)
                   throws java.io.IOException,
                          JXCSkinException
Parses a "tooltip" command.

Parameters:
args - the command arguments
tooltipManager - the tooltip manager to update
elementListener - the element listener to notify
Throws:
java.io.IOException - if the command cannot be parsed
JXCSkinException - if the command cannot be parsed