- });
- return null;
- }
- }
-
- /**
- * Execute one structure viewer command. If {@code getReply} is true, may
- * optionally return one or more reply messages, else returns null.
- *
- * @param cmd
- * @param getReply
- */
- protected abstract List<String> executeCommand(StructureCommandI cmd,
- boolean getReply);
-
- /**
- * Executes one or more structure viewer commands. If a progress message is
- * provided, it is shown first, and removed after all commands have been run.
- *
- * @param commands
- * @param getReply
- * @param msg
- */
- protected List<String> executeCommands(List<StructureCommandI> commands,
- boolean getReply, String msg)
- {
- /*
- * show progress message if specified
- */
- final JalviewStructureDisplayI theViewer = getViewer();
- final long handle = msg == null ? 0 : theViewer.startProgressBar(msg);
-
- List<String> response = getReply ? new ArrayList<>() : null;
- try
- {
- for (StructureCommandI cmd : commands)
- {
- List<String> replies = executeCommand(cmd, getReply, null);
- if (getReply && replies != null)
- {
- response.addAll(replies);
- }