package jalview.gui;
import jalview.api.AlignmentViewPanel;
+import jalview.api.structures.JalviewStructureDisplayI;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.ext.rbvi.chimera.JalviewChimeraBinding;
+import jalview.io.DataSourceType;
import jalview.structure.StructureSelectionManager;
+import javax.swing.SwingUtilities;
+
public class JalviewChimeraBindingModel extends JalviewChimeraBinding
{
private ChimeraViewFrame cvf;
public JalviewChimeraBindingModel(ChimeraViewFrame chimeraViewFrame,
StructureSelectionManager ssm, PDBEntry[] pdbentry,
- SequenceI[][] sequenceIs, String protocol)
+ SequenceI[][] sequenceIs, DataSourceType protocol)
{
super(ssm, pdbentry, sequenceIs, protocol);
cvf = chimeraViewFrame;
protected void sendAsynchronousCommand(final String command,
final String progressMsg)
{
- Thread thread = new Thread(new Runnable()
+ final long handle = progressMsg == null ? 0 : cvf
+ .startProgressBar(progressMsg);
+ SwingUtilities.invokeLater(new Runnable()
{
-
@Override
public void run()
{
- long handle = 0;
- if (progressMsg != null)
- {
- handle = cvf.startProgressBar(progressMsg);
- }
try
{
sendChimeraCommand(command, false);
}
}
});
- thread.start();
-
}
-
+ @Override
+ public JalviewStructureDisplayI getViewer()
+ {
+ return cvf;
+ }
}