+ /**
+ * @j2sAlias showStructure
+ */
+ @Override
+ public void showStructure(AlignFrame af, String pdbID, String fileType) {
+ if (af == null)
+ af = Jalview.getCurrentAlignFrame();
+ PDBEntry pe = null;
+ SequenceI[] seqs = null;
+ if (pdbID == null) {
+ seqs = af.getViewport().getSequenceSelection();
+ if (seqs.length == 0)
+ seqs = af.getViewport().getAlignment().getSequencesArray();
+ for (int i = 0; i < seqs.length; i++) {
+ Vector<PDBEntry> list = seqs[i].getAllPDBEntries();
+ if (list.size() > 0) {
+ pe = list.get(0);
+ break;
+ }
+ }
+ }
+ if (pe == null) {
+ if (pdbID == null)
+ return;
+ pe = new PDBEntry(pdbID, null, fileType);
+ List<SequenceI> list = af.getViewport().getAlignment().getSequences();
+ List<SequenceI> tmp = new ArrayList<SequenceI>();
+ for (int i = 0; i < list.size(); i++) {
+ SequenceI seq = list.get(i);
+ if (seq.getPDBEntry(pdbID) != null) {
+ tmp.add(seq);
+ }
+ }
+ seqs = tmp.toArray(new SequenceI[tmp.size()]);
+ af.alignPanel.selectSequences(tmp);
+ }
+ StructureViewer.launchStructureViewer(
+ af.alignPanel,
+ pe, seqs);
+ }
+