new PDBEntry[seqsForPdbs.size()]);
SequenceI[][] theSeqs = seqsForPdbs.values().toArray(
new SequenceI[seqsForPdbs.size()][]);
- JalviewStructureDisplayI sview = null;
+
if (viewerType.equals(ViewerType.JMOL))
{
sview = new AppJmol(ap, pdbsForFile, theSeqs);
private JalviewStructureDisplayI onlyOnePdb(PDBEntry[] pdbs,
SequenceI[] seqsForPdbs, AlignmentPanel ap)
{
- List<SequenceI> seqs = new ArrayList<SequenceI>();
+ List<SequenceI> seqs = new ArrayList<>();
if (pdbs == null || pdbs.length == 0)
{
return null;
ap);
}
+ JalviewStructureDisplayI sview = null;
+
public JalviewStructureDisplayI viewStructures(PDBEntry pdb,
SequenceI[] seqsForPdb, AlignmentPanel ap)
{
ViewerType viewerType = getViewerType();
- JalviewStructureDisplayI sview = null;
if (viewerType.equals(ViewerType.JMOL))
{
sview = new AppJmol(pdb, seqsForPdb, null, ap);
final boolean usetoColourbyseq = viewerData.isColourWithAlignPanel();
final boolean viewerColouring = viewerData.isColourByViewer();
- JalviewStructureDisplayI sview = null;
switch (type)
{
case JMOL:
return sview;
}
+ public boolean isBusy()
+ {
+ if (sview != null)
+ {
+ if (!sview.hasMapping())
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
}
import jalview.jbgui.GStructureViewer;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ColourSchemes;
+import jalview.structure.StructureMapping;
import jalview.structures.models.AAStructureBindingModel;
import jalview.util.MessageManager;
protected JMenu viewSelectionMenu;
/**
+ * set after sequence colouring has been applied for this structure viewer.
+ * used to determine if the final sequence/structure mapping has been
+ * determined
+ */
+ protected boolean seqColoursApplied = false;
+
+ /**
* Default constructor
*/
public StructureViewerBase()
{
binding.colourBySequence(ap);
}
+ seqColoursApplied = true;
}
}
seqColour_actionPerformed(null);
}
}
+
+ @Override
+ public boolean hasMapping()
+ {
+ if (worker != null && (addingStructures || _started))
+ {
+ return false;
+ }
+ if (getBinding() == null)
+ {
+ return false;
+ }
+ String[] pdbids = getBinding().getStructureFiles();
+ if (pdbids == null)
+ {
+ return false;
+ }
+ int p=0;
+ for (String pdbid:pdbids) {
+ StructureMapping sm[] = getBinding().getSsm().getMapping(pdbid);
+ if (sm!=null && sm.length>0 && sm[0]!=null) {
+ p++;
+ }
+ }
+ // only return true if there is a mapping for every structure file we have loaded
+ if (p == 0 || p != pdbids.length)
+ {
+ return false;
+ }
+ // and that coloring has been applied
+ return seqColoursApplied;
+ }
+
}