private AbstractRequestHandler chimeraListener;
/*
- * set if chimera state is being restored from some source - instructs binding
- * not to apply default display style when structure set is updated for first
- * time.
- */
- private boolean loadingFromArchive = false;
-
- /*
- * flag to indicate if the Chimera viewer should ignore sequence colouring
- * events from the structure manager because the GUI is still setting up
- */
- private boolean loadingFinished = true;
-
- /*
* Map of ChimeraModel objects keyed by PDB full local file name
*/
private Map<String, List<ChimeraModel>> chimeraMaps = new LinkedHashMap<>();
String lastHighlightCommand;
- /*
- * incremented every time a load notification is successfully handled -
- * lightweight mechanism for other threads to detect when they can start
- * referring to new structures.
- */
- private long loadNotifiesHandled = 0;
-
private Thread chimeraMonitor;
/**
/**
* Send a command to Chimera, and optionally log and return any responses.
- * <p>
- * Does nothing, and returns null, if the command is the same as the last one
- * sent [why?].
*
* @param command
* @param getResponse
return null;
}
List<String> reply = null;
- viewerCommandHistory(false);
- if (true /*lastCommand == null || !lastCommand.equals(command)*/)
+ // trim command or it may never find a match in the replyLog!!
+ List<String> lastReply = chimeraManager
+ .sendChimeraCommand(command.trim(), getResponse);
+ if (getResponse)
{
- // trim command or it may never find a match in the replyLog!!
- List<String> lastReply = chimeraManager.sendChimeraCommand(command.trim(),
- getResponse);
- if (getResponse)
+ reply = lastReply;
+ if (debug)
{
- reply = lastReply;
- if (debug)
- {
- log("Response from command ('" + command + "') was:\n"
- + lastReply);
- }
+ log("Response from command ('" + command + "') was:\n" + lastReply);
}
}
- viewerCommandHistory(true);
return reply;
}
// //////////////////////////
/**
- * instruct the Jalview binding to update the pdbentries vector if necessary
- * prior to matching the viewer's contents to the list of structure files
- * Jalview knows about.
- */
- public abstract void refreshPdbEntries();
-
- /**
* map between index of model filename returned from getPdbFile and the first
* index of models from this file in the viewer. Note - this is not trimmed -
* use getPdbFile to get number of unique models.
System.err.println("## Chimera log: " + message);
}
- private void viewerCommandHistory(boolean enable)
- {
- // log("(Not yet implemented) History "
- // + ((debug || enable) ? "on" : "off"));
- }
-
- public long getLoadNotifiesHandled()
- {
- return loadNotifiesHandled;
- }
-
- /**
- * called when the binding thinks the UI needs to be refreshed after a Chimera
- * state change. this could be because structures were loaded, or because an
- * error has occurred.
- */
- public abstract void refreshGUI();
-
- @Override
- public void setLoadingFromArchive(boolean loadingFromArchive)
- {
- this.loadingFromArchive = loadingFromArchive;
- }
-
- /**
- *
- * @return true if Chimeral is still restoring state or loading is still going
- * on (see setFinsihedLoadingFromArchive)
- */
- @Override
- public boolean isLoadingFromArchive()
- {
- return loadingFromArchive && !loadingFinished;
- }
-
- /**
- * modify flag which controls if sequence colouring events are honoured by the
- * binding. Should be true for normal operation
- *
- * @param finishedLoading
- */
- @Override
- public void setFinishedLoadingFromArchive(boolean finishedLoading)
- {
- loadingFinished = finishedLoading;
- }
-
/**
* Ask Chimera to save its session to the given file. Returns true if
* successful, else false.