import jalview.datamodel.SearchResultsI;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
-import jalview.gui.Preferences;
import jalview.gui.StructureViewer.ViewerType;
import jalview.httpserver.AbstractRequestHandler;
import jalview.io.DataSourceType;
import jalview.structure.AtomSpec;
+import jalview.structure.StructureCommandsI.SuperposeData;
import jalview.structure.StructureSelectionManager;
import jalview.structures.models.AAStructureBindingModel;
import jalview.util.MessageManager;
{
super(ssm, pdbentry, sequenceIs, protocol);
chimeraManager = new ChimeraManager(new StructureManager(true));
- String viewerType = Cache.getProperty(Preferences.STRUCTURE_DISPLAY);
- chimeraManager.setChimeraX(ViewerType.CHIMERAX.name().equals(viewerType));
+ chimeraManager.setChimeraX(ViewerType.CHIMERAX.equals(getViewerType()));
setStructureCommands(new ChimeraCommands());
}
+ @Override
+ protected ViewerType getViewerType()
+ {
+ return ViewerType.CHIMERA;
+ }
+
/**
* Starts a thread that waits for the Chimera process to finish, so that we can
* then close the associated resources. This avoids leaving orphaned Chimera
/**
* {@inheritDoc}
*/
- @Override
public String superposeStructures(AlignmentI[] _alignment,
int[] _refStructure, HiddenColumns[] _hiddenCols)
{
SuperposeData[] structures = new SuperposeData[files.length];
for (int f = 0; f < files.length; f++)
{
- structures[f] = new SuperposeData(alignment.getWidth());
+ structures[f] = new SuperposeData(alignment.getWidth(), f);
}
/*
}
else
{
- allComs.append("chain @CA|P; ribbon ; focus");
- allComs.append(selectioncom.toString());
+ allComs.append("chain @CA|P; ribbon ");
+ allComs.append(selectioncom.toString()).append("; focus");
}
// allComs.append("; ~display all; chain @CA|P; ribbon ")
// .append(selectioncom.toString()).append("; focus");
}
/**
- * Send a Chimera command asynchronously in a new thread. If the progress
- * message is not null, display this message while the command is executing.
- *
- * @param command
- * @param progressMsg
- */
- protected abstract void sendAsynchronousCommand(String command,
- String progressMsg);
-
- /**
* @param command
*/
protected void executeWhenReady(String command)
* Chimera: https://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/midas/save.html
* ChimeraX: https://www.cgl.ucsf.edu/chimerax/docs/user/commands/save.html
*/
- String command = getSaveSessionCommand(filepath);
+ String command = getCommandGenerator().saveSession(filepath);
List<String> reply = chimeraManager.sendChimeraCommand(command, true);
if (reply.contains("Session written"))
{
}
/**
- * Returns the command to save the viewer session to the given file path
- *
- * @param filepath
- * @return
- */
- protected String getSaveSessionCommand(String filepath)
- {
- return "save " + filepath;
- }
-
- /**
* Ask Chimera to open a session file. Returns true if successful, else false.
* The filename must have a .py (Chimera) or .cxs (ChimeraX) extension for
* this command to work.
out.flush();
out.close();
String path = tmp.getAbsolutePath();
- String command = getOpenCommandFileCommand(path);
+ String command = getCommandGenerator().openCommandFile(path);
sendAsynchronousCommand(command, null);
} catch (IOException e)
{
}
/**
- * Returns the command for the structure viewer to open a file of commands at
- * the given file path
- *
- * @param path
- * @return
- */
- protected String getOpenCommandFileCommand(String path)
- {
- return "open cmd:" + path;
- }
-
- /**
* Returns the file extension required for a file of commands to be read by
* the structure viewer
* @return