}
@Override
- public void releaseReferences(Object svl)
- {
- }
-
- @Override
public Map<String, Object> getJSpecViewProperty(String arg0)
{
return null;
{
private String lastMessage;
- boolean allChainsSelected = false;
-
/*
* when true, try to search the associated datamodel for sequences that are
* associated with any unknown structures in the Jmol view.
*/
private boolean associateNewStructs = false;
- Vector<String> atomsPicked = new Vector<>();
-
- /*
- * the default or current model displayed if the model cannot be identified
- * from the selection message
- */
- int frameNo = 0;
-
- // protected JmolGenericPopup jmolpopup; // not used - remove?
+ private Vector<String> atomsPicked = new Vector<>();
- String lastCommand;
+ private String lastCommand;
- boolean loadedInline;
+ private boolean loadedInline;
- StringBuffer resetLastRes = new StringBuffer();
+ private StringBuffer resetLastRes = new StringBuffer();
public Viewer jmolViewer;
/**
* superpose the structures associated with sequences in the alignment
* according to their corresponding positions.
+ *
+ * @deprecated not used - remove?
*/
+ @Deprecated
public void superposeStructures(AlignmentI alignment)
{
superposeStructures(alignment, -1, null);
* @param refStructure
* - select which pdb file to use as reference (default is -1 - the
* first structure in the alignment)
+ * @deprecated not used - remove?
*/
+ @Deprecated
public void superposeStructures(AlignmentI alignment, int refStructure)
{
superposeStructures(alignment, refStructure, null);
* first structure in the alignment)
* @param hiddenCols
* TODO
+ * @deprecated not used - remove?
*/
+ @Deprecated
public void superposeStructures(AlignmentI alignment, int refStructure,
HiddenColumns hiddenCols)
{
}
/**
- * instruct the Jalview binding to update the pdbentries vector if necessary
- * prior to matching the jmol view'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.
jmolHistory(false);
StringBuilder cmd = new StringBuilder(64);
- cmd.append("select " + pdbResNum); // +modelNum
+ cmd.append("select ").append(String.valueOf(pdbResNum)); // +modelNum
- resetLastRes.append("select " + pdbResNum); // +modelNum
+ resetLastRes.append("select ").append(String.valueOf(pdbResNum)); // +modelNum
cmd.append(":");
resetLastRes.append(":");
resetLastRes.append(chain);
}
{
- cmd.append(" /" + (mdlNum + 1));
- resetLastRes.append("/" + (mdlNum + 1));
+ cmd.append(" /").append(String.valueOf(mdlNum + 1));
+ resetLastRes.append("/").append(String.valueOf(mdlNum + 1));
}
cmd.append(";wireframe 100;" + cmd.toString() + " and not hetero;");
}
- boolean debug = true;
+ private boolean debug = true;
private void jmolHistory(boolean enable)
{
chainId = " ";
}
- String pdbfilename = modelFileNames[frameNo]; // default is first or current
- // model
+ String pdbfilename = modelFileNames[0]; // default is first model
if (mdlSep > -1)
{
if (chainSeparator1 == -1)
public abstract void showUrl(String url, String target);
/**
- * called when the binding thinks the UI needs to be refreshed after a Jmol
- * state change. this could be because structures were loaded, or because an
- * error has occured.
- */
- public abstract void refreshGUI();
-
- /**
* called to show or hide the associated console window container.
*
* @param show
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.
}
@Override
- public void updateColours(Object source)
- {
- AlignmentPanel ap = (AlignmentPanel) source;
- // ignore events from panels not used to colour this view
- if (!getViewer().isUsedForColourBy(ap))
- {
- return;
- }
- if (!isLoadingFromArchive())
- {
- colourBySequence(ap);
- }
- }
-
- @Override
public void notifyScriptTermination(String strStatus, int msWalltime)
{
// todo - script termination doesn't happen ?
@Override
public void selectionChanged(BS arg0)
{
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void refreshPdbEntries()
- {
- // TODO Auto-generated method stub
-
}
@Override
});
}
- @Override
- public void updateColours(Object source)
- {
- AlignmentViewPanel ap = (AlignmentViewPanel) source;
- // ignore events from panels not used to colour this view
- if (!getViewer().isUsedForColourBy(ap))
- {
- return;
- }
- if (!isLoadingFromArchive())
- {
- colourBySequence(ap);
- }
- }
-
- @Override
- public void releaseReferences(Object svl)
- {
- }
-
- @Override
- protected void releaseUIResources()
- {
- }
-
- @Override
- public void refreshPdbEntries()
- {
- }
-
/**
* Send an asynchronous command to Chimera, in a new thread, optionally with
* an 'in progress' message in a progress bar somewhere
*/
protected void releaseUIResources()
{
+ }
+ @Override
+ public void releaseReferences(Object svl)
+ {
}
public boolean isColourBySequence()
return colourBySequence;
}
+ /**
+ * Called when the binding thinks the UI needs to be refreshed after a
+ * structure viewer state change. This could be because structures were
+ * loaded, or because an error has occurred. Default does nothing, override as
+ * required.
+ */
+ public void refreshGUI()
+ {
+ }
+
+ /**
+ * Instruct the Jalview binding to update the pdbentries vector if necessary
+ * prior to matching the jmol view's contents to the list of structure files
+ * Jalview knows about. By default does nothing, override as required.
+ */
+ public void refreshPdbEntries()
+ {
+ }
+
public void setColourBySequence(boolean colourBySequence)
{
this.colourBySequence = colourBySequence;
{
return chainFile.get(chainId);
}
+
+ @Override
+ public void updateColours(Object source)
+ {
+ AlignmentViewPanel ap = (AlignmentViewPanel) source;
+ // ignore events from panels not used to colour this view
+ if (!getViewer().isUsedForColourBy(ap))
+ {
+ return;
+ }
+ if (!isLoadingFromArchive())
+ {
+ colourBySequence(ap);
+ }
+ }
}