java.lang.Object com.realtime.crossfire.jxclient.skin.io.CommandParser
public class CommandParser
Parser for creating GUICommand
instances from string
representations.
Field Summary | |
---|---|
private JXCSkinCache<GUIElement> |
definedGUIElements
The defined GUI elements. |
private Dialogs |
dialogs
The Dialogs instance to use. |
private FloorView |
floorView
The FloorView to use. |
Constructor Summary | |
---|---|
CommandParser(Dialogs dialogs,
FloorView floorView,
JXCSkinCache<GUIElement> definedGUIElements)
Creates a new instance. |
Method Summary | |
---|---|
private static GUICommand |
parseAccountCreate(GUIElement element,
CommandCallback commandCallback)
Parses and builds an "ACCOUNT_CREATE" command. |
private static GUICommand |
parseAccountCreateCharacter(GUIElement element,
CommandCallback commandCallback)
Parses and builds an "ACCOUNT_CREATE_CHARACTER" command. |
private static GUICommand |
parseAccountLink(GUIElement element,
CommandCallback commandCallback)
Parses and builds an "ACCOUNT_LINK" command. |
private static GUICommand |
parseAccountLogin(GUIElement element,
CommandCallback commandCallback)
Parses and builds an "ACCOUNT_LOGIN" command. |
private static GUICommand |
parseAccountPlay(GUIElement element,
CommandCallback commandCallback)
Parses and builds an "ACCOUNT_PLAY" command. |
GUICommand |
parseCommandArgs(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 static GUICommand |
parseConnect(GUIElement element,
GuiStateManager guiStateManager)
Parses and builds a "CONNECT" command. |
private GUICommand |
parseDialogClose(Args args,
GUIElement element,
CommandCallback commandCallback)
Parses and builds a "DIALOG_CLOSE" command. |
private GUICommand |
parseDialogOpen(Args args,
GUIElement element,
CommandCallback commandCallback)
Parses and builds a "DIALOG_OPEN" command. |
private GUICommand |
parseDialogToggle(Args args,
GUIElement element,
CommandCallback commandCallback)
Parses and builds a "DIALOG_TOGGLE" command. |
private static GUICommand |
parseDisconnect(GUIElement element,
GuiStateManager guiStateManager)
Parses and builds a "DISCONNECT" command. |
private GUICommand |
parseExecSelection(Args args,
GUIElement element,
CommandQueue commandQueue,
CrossfireServerConnection crossfireServerConnection)
Parses and builds a "" command. |
private static GUICommand |
parseGuiExecuteCommand(Args args,
GUIElement element,
Commands commands,
java.io.LineNumberReader lnr,
Macros macros)
Parses and builds a "GUI_EXECUTE_COMMAND" command. |
private static GUICommand |
parseGuiExecuteElement(GUIElement element)
Parses and builds a "GUI_EXECUTE_ELEMENT" command. |
private static GUICommand |
parseGuiMeta(GUIElement element,
GuiStateManager guiStateManager)
Parses and builds a "GUI_META" command. |
private static GUICommand |
parseGuiStart(GUIElement element,
GuiStateManager guiStateManager)
Parses and builds a "GUI_START" command. |
private static GUICommand |
parseHide(GUIElement element)
Parses and builds a "HIDE" command. |
private GUICommand |
parseMoveFocus(Args args,
GUIElement element)
Parses and builds a "MOVE_FOCUS" command. |
private static GUICommand |
parseMoveSelection(Args args,
GUIElement element)
Parses and builds a "MOVE_SELECTION" command. |
private static GUICommand |
parsePrint(GUIElement element)
Parses and builds a "PRINT" command. |
private static GUICommand |
parseQuit(GUIElement element,
CommandCallback commandCallback)
Parses and builds a "QUIT" command. |
private static GUICommand |
parseScroll(Args args,
GUIElement element,
boolean isScroll)
Parses and builds a "SCROLL" or "SCROLL_NEVER command. |
private static GUICommand |
parseScrollList(Args args,
GUIElement element)
Parses and builds a "SCROLL_LIST" command. |
private static GUICommand |
parseScrollReset(GUIElement element)
Parses and builds a "SCROLL_RESET" command. |
private static GUICommand |
parseShow(GUIElement element)
Parses and builds a "SHOW" command. |
private static GUICommand |
parseToggle(GUIElement element)
Parses and builds a "TOGGLE" command. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private final JXCSkinCache<GUIElement> definedGUIElements
@NotNull private final Dialogs dialogs
Dialogs
instance to use.
@NotNull private final FloorView floorView
FloorView
to use.
Constructor Detail |
---|
public CommandParser(@NotNull Dialogs dialogs, @NotNull FloorView floorView, @NotNull JXCSkinCache<GUIElement> definedGUIElements)
dialogs
- the dialogs instance to usefloorView
- the floor view to usedefinedGUIElements
- the defined GUI elementsMethod Detail |
---|
@NotNull private static GUICommand parseAccountCreate(@Nullable GUIElement element, @NotNull CommandCallback commandCallback) throws java.io.IOException
element
- the target elementcommandCallback
- the command callback to use
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseAccountCreateCharacter(@Nullable GUIElement element, @NotNull CommandCallback commandCallback) throws java.io.IOException
element
- the target elementcommandCallback
- the command callback to use
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseAccountLink(@Nullable GUIElement element, @NotNull CommandCallback commandCallback) throws java.io.IOException
element
- the target elementcommandCallback
- the command callback to use
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseAccountLogin(@Nullable GUIElement element, @NotNull CommandCallback commandCallback) throws java.io.IOException
element
- the target elementcommandCallback
- the command callback to use
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseAccountPlay(@Nullable GUIElement element, @NotNull CommandCallback commandCallback) throws java.io.IOException
element
- the target elementcommandCallback
- the command callback to use
java.io.IOException
- if a syntax error occurs@NotNull public GUICommand parseCommandArgs(@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
args
- the list of argumentselement
- the target elementcommand
- the command to parse the arguments ofguiStateManager
- the gui state manager instancecommands
- the commands instance for executing commandslnr
- the source to read more parameters fromcommandQueue
- the command queue for executing commandscrossfireServerConnection
- the server connection to usecommandCallback
- the command callback to usemacros
- the macros instance to use
java.io.IOException
- if a syntax error occurs
JXCSkinException
- if an element cannot be found@NotNull private static GUICommand parseConnect(@Nullable GUIElement element, @NotNull GuiStateManager guiStateManager) throws java.io.IOException
element
- the target elementguiStateManager
- the gui state manager instance
java.io.IOException
- if a syntax error occurs@NotNull private GUICommand parseDialogClose(@NotNull Args args, @Nullable GUIElement element, @NotNull CommandCallback commandCallback) throws java.io.IOException
args
- the list of argumentselement
- the target elementcommandCallback
- the command callback to use
java.io.IOException
- if a syntax error occurs@NotNull private GUICommand parseDialogOpen(@NotNull Args args, @Nullable GUIElement element, @NotNull CommandCallback commandCallback) throws java.io.IOException
args
- the list of argumentselement
- the target elementcommandCallback
- the command callback to use
java.io.IOException
- if a syntax error occurs@NotNull private GUICommand parseDialogToggle(@NotNull Args args, @Nullable GUIElement element, @NotNull CommandCallback commandCallback) throws java.io.IOException
args
- the list of argumentselement
- the target elementcommandCallback
- the command callback to use
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseDisconnect(@Nullable GUIElement element, @NotNull GuiStateManager guiStateManager) throws java.io.IOException
element
- the target elementguiStateManager
- the gui state manager instance
java.io.IOException
- if a syntax error occurs@NotNull private GUICommand parseExecSelection(@NotNull Args args, @Nullable GUIElement element, @NotNull CommandQueue commandQueue, @NotNull CrossfireServerConnection crossfireServerConnection) throws java.io.IOException
args
- the list of argumentselement
- the target elementcommandQueue
- the command queue for executing commandscrossfireServerConnection
- the server connection to use
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseGuiExecuteCommand(@NotNull Args args, @Nullable GUIElement element, @NotNull Commands commands, @NotNull java.io.LineNumberReader lnr, @NotNull Macros macros) throws java.io.IOException
args
- the list of argumentselement
- the target elementcommands
- the commands instance for executing commandslnr
- the source to read more parameters frommacros
- the macros instance to use
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseGuiExecuteElement(@Nullable GUIElement element) throws java.io.IOException
element
- the target element
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseGuiMeta(@Nullable GUIElement element, @NotNull GuiStateManager guiStateManager) throws java.io.IOException
element
- the target elementguiStateManager
- the gui state manager instance
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseGuiStart(@Nullable GUIElement element, @NotNull GuiStateManager guiStateManager) throws java.io.IOException
element
- the target elementguiStateManager
- the gui state manager instance
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseHide(@Nullable GUIElement element) throws java.io.IOException
element
- the target element
java.io.IOException
- if a syntax error occurs@NotNull private GUICommand parseMoveFocus(@NotNull Args args, @Nullable GUIElement element) throws java.io.IOException, JXCSkinException
args
- the list of argumentselement
- the target element
java.io.IOException
- if a syntax error occurs
JXCSkinException
- if a syntax error occurs@NotNull private static GUICommand parseMoveSelection(@NotNull Args args, @Nullable GUIElement element) throws java.io.IOException
args
- the list of argumentselement
- the target element
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parsePrint(@Nullable GUIElement element) throws java.io.IOException
element
- the target element
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseQuit(@Nullable GUIElement element, @NotNull CommandCallback commandCallback) throws java.io.IOException
element
- the target elementcommandCallback
- the command callback to use
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseScroll(@NotNull Args args, @Nullable GUIElement element, boolean isScroll) throws java.io.IOException
args
- the list of argumentselement
- the target elementisScroll
- whether to parse a "SCROLL" (true
) or a
"SCROLL_NEVER" (false
) command
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseScrollList(@NotNull Args args, @Nullable GUIElement element) throws java.io.IOException
args
- the list of argumentselement
- the target element
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseScrollReset(@Nullable GUIElement element) throws java.io.IOException
element
- the target element
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseShow(@Nullable GUIElement element) throws java.io.IOException
element
- the target element
java.io.IOException
- if a syntax error occurs@NotNull private static GUICommand parseToggle(@Nullable GUIElement element) throws java.io.IOException
element
- the target element
java.io.IOException
- if a syntax error occurs