23 package com.realtime.crossfire.jxclient.skin.io;
83 import java.awt.Component;
84 import java.io.IOException;
85 import java.io.LineNumberReader;
86 import org.jetbrains.annotations.NotNull;
87 import org.jetbrains.annotations.Nullable;
171 public GUICommand parseCommandArgs(@NotNull
final Args args, @Nullable
final AbstractGUIElement element, @NotNull
final String command, @NotNull
final GuiStateManager guiStateManager, @NotNull
final CommandExecutor commandExecutor, @NotNull
final LineNumberReader lnr, @NotNull
final CommandQueue commandQueue, @NotNull
final CrossfireServerConnection crossfireServerConnection, @NotNull
final CommandCallback commandCallback, @NotNull
final Macros macros)
throws IOException,
JXCSkinException {
172 if (command.equals(
"SHOW")) {
175 if (command.equals(
"HIDE")) {
178 if (command.equals(
"TOGGLE")) {
181 if (command.equals(
"PRINT")) {
184 if (command.equals(
"QUIT")) {
185 return parseQuit(element, commandCallback);
187 if (command.equals(
"CONNECT")) {
190 if (command.equals(
"DISCONNECT")) {
193 if (command.equals(
"GUI_META")) {
196 if (command.equals(
"GUI_START")) {
199 if (command.equals(
"GUI_EXECUTE_ELEMENT")) {
202 if (command.equals(
"DIALOG_OPEN")) {
205 if (command.equals(
"DIALOG_TOGGLE")) {
208 if (command.equals(
"DIALOG_CLOSE")) {
211 if (command.equals(
"GUI_EXECUTE_COMMAND")) {
214 if (command.equals(
"EXEC_SELECTION")) {
217 if (command.equals(
"MOVE_SELECTION")) {
220 if (command.equals(
"SCROLL_LIST")) {
223 if (command.equals(
"SCROLL") || command.equals(
"SCROLL_NEVER")) {
224 return parseScroll(args, element, command.equals(
"SCROLL"));
226 if (command.equals(
"SCROLL_RESET")) {
229 if (command.equals(
"MOVE_FOCUS")) {
232 if (command.equals(
"ACCOUNT_LOGIN")) {
235 if (command.equals(
"ACCOUNT_CREATE")) {
238 if (command.equals(
"ACCOUNT_PLAY")) {
241 if (command.equals(
"ACCOUNT_LINK")) {
244 if (command.equals(
"ACCOUNT_CREATE_CHARACTER")) {
247 if (command.equals(
"ACCOUNT_PASSWORD")) {
250 if (command.equals(
"SELECT")) {
253 if (command.equals(
"INVENTORY_OPTION")) {
256 if (command.equals(
"QUESTS_FILTER")) {
270 if (element ==
null) {
271 throw new IOException(
"<element> is required");
285 if (element ==
null) {
286 throw new IOException(
"<element> is required");
300 if (element ==
null) {
301 throw new IOException(
"<element> is required");
316 if (element !=
null) {
317 throw new IOException(
"<element> is not allowed");
333 if (element !=
null) {
334 throw new IOException(
"<element> is not allowed");
349 if (element ==
null) {
350 throw new IOException(
"<element> is required");
353 if (!(element instanceof
GUIText)) {
354 throw new IOException(
"'"+element+
"' must be an input field");
370 if (element !=
null) {
371 throw new IOException(
"<element> is not allowed");
387 if (element !=
null) {
388 throw new IOException(
"<element> is not allowed");
404 if (element !=
null) {
405 throw new IOException(
"<element> is not allowed");
419 if (element ==
null) {
420 throw new IOException(
"<element> is required");
423 if (!(element instanceof
GUIItem)) {
424 throw new IOException(
"'"+element+
"' must be an item element");
441 if (element !=
null) {
442 throw new IOException(
"<element> is not allowed");
445 final String name = args.get();
461 if (element !=
null) {
462 throw new IOException(
"<element> is not allowed");
465 final String name = args.get();
481 if (element !=
null) {
482 throw new IOException(
"<element> is not allowed");
485 final String name = args.get();
503 if (element !=
null) {
504 throw new IOException(
"<element> is not allowed");
524 if (element ==
null) {
525 throw new IOException(
"<element> is required");
529 throw new IOException(
"'"+element+
"' must be an item list");
546 if (diffLines == 0 && diffElements == 0) {
547 throw new IOException(
"Invalid zero scroll distance");
550 if (element ==
null) {
551 throw new IOException(
"<element> is required");
554 if (!(element instanceof
GUIList)) {
555 throw new IOException(
"'"+element+
"' must be a list");
572 throw new IOException(
"Invalid zero scroll distance");
575 if (element ==
null) {
576 throw new IOException(
"<element> is required");
580 throw new IOException(
"'"+element+
"' must be a scrollable");
599 throw new IOException(
"Invalid zero scroll distance");
602 if (element ==
null) {
603 throw new IOException(
"<element> is required");
607 throw new IOException(
"'"+element+
"' must be a scrollable element");
621 if (element ==
null) {
622 throw new IOException(
"<element> is required");
626 throw new IOException(
"'"+element+
"' must be a scrollable element");
644 throw new IOException(
"'"+args.getPrev()+
"' cannot become active");
648 if (apply != 0 && apply != 1) {
649 throw new IOException(
"<apply> must be 0 or 1");
652 if (element ==
null) {
653 throw new IOException(
"<element> is required");
657 throw new IOException(
"'"+element+
"' cannot become active");
672 if (element ==
null) {
673 throw new IOException(
"<element> is required");
688 if (element ==
null) {
689 throw new IOException(
"<element> is required");
704 if (element ==
null) {
705 throw new IOException(
"<element> is required");
720 if (element ==
null) {
721 throw new IOException(
"<element> is required");
736 if (element ==
null) {
737 throw new IOException(
"<element> is required");
752 if (element ==
null) {
753 throw new IOException(
"<element> is required");
770 if (element ==
null) {
771 throw new IOException(
"<element> is required");
775 throw new IOException(
"'"+element+
"' must be a selectable element");
793 if (element !=
null) {
794 throw new IOException(
"<element> is not allowed");
805 if (element !=
null) {
806 throw new IOException(
"<element> is not allowed");