* @param protocol
*/
public JalviewChimeraBinding(StructureSelectionManager ssm,
- PDBEntry[] pdbentry, SequenceI[][] sequenceIs, String[][] chains,
- String protocol)
+ PDBEntry[] pdbentry, SequenceI[][] sequenceIs, DataSourceType protocol)
{
- super(ssm, pdbentry, sequenceIs, chains, protocol);
+ super(ssm, pdbentry, sequenceIs, protocol);
- viewer = new ChimeraManager(
- new ext.edu.ucsf.rbvi.strucviz2.StructureManager(true));
+ viewer = new ChimeraManager(new StructureManager(true));
+ }
+
+ /**
+ * 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 viewer panels in Jalview if the user closes Chimera.
+ */
+ protected void startChimeraProcessMonitor()
+ {
+ final Process p = viewer.getChimeraProcess();
+ chimeraMonitor = new Thread(new Runnable()
+ {
+
+ @Override
+ public void run()
+ {
+ try
+ {
+ p.waitFor();
+ JalviewStructureDisplayI display = getViewer();
+ if (display != null)
+ {
+ display.closeViewer(false);
+ }
+ } catch (InterruptedException e)
+ {
+ // exit thread if Chimera Viewer is closed in Jalview
+ }
+ }
+ });
+ chimeraMonitor.start();
}
/**
}
/**
-- * Returns a list of chains mapped in this viewer. Note this list is not
-- * currently scoped per structure.
-- *
-- * @return
-- */
-
- /**
- public List<String> getChainNames()
- {
- List<String> names = new ArrayList<String>();
- String[][] allNames = getChains();
- if (allNames != null)
- {
- for (String[] chainsForPdb : allNames)
- {
- if (chainsForPdb != null)
- {
- for (String chain : chainsForPdb)
- {
- if (chain != null && !names.contains(chain))
- {
- names.add(chain);
- }
- }
- }
- }
- }
- return names;
- }
-
- /**
* Send a 'focus' command to Chimera to recentre the visible display
*/
public void focusView()