import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
-import java.util.Vector;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
if (seq.getPDBId() != null)
{
- for (PDBEntry entry : (Vector<PDBEntry>) seq.getPDBId())
+ for (PDBEntry entry : seq.getPDBId())
{
queryBuilder.append("text:").append(entry.getId()).append(" OR ");
}
pdbEntry.setType("PDB");
pdbEntriesToView[count++] = pdbEntry;
}
- new StructureViewer(ap.getStructureSelectionManager())
- .viewStructures(ap, pdbEntriesToView,
- ap.av.collateForPDB(pdbEntriesToView));
+
+ StructureViewer sViewer = new StructureViewer(
+ ap.getStructureSelectionManager());
+ if (pdbEntriesToView.length > 1)
+ {
+ sViewer.viewStructures(ap, pdbEntriesToView,
+ ap.av.collateForPDB(pdbEntriesToView));
+ }
+ else
+ {
+ sViewer.viewStructures(pdbEntriesToView[0], selectedSequences,
+ null, ap);
+ }
+
}
else if (currentView == VIEWS_ENTER_ID)
{
- selectedSequence = ((AssociateSeqOptions) idInputAssSeqPanel
+ SequenceI userSelectedSeq = ((AssociateSeqOptions) idInputAssSeqPanel
.getCmb_assSeq().getSelectedItem()).getSequence();
+ if (userSelectedSeq != null)
+ {
+ selectedSequence = userSelectedSeq;
+ }
PDBEntry pdbEntry = new PDBEntry();
pdbEntry.setId(txt_search.getText());
pdbEntry.setType("PDB");
}
else if (currentView == VIEWS_FROM_FILE)
{
- selectedSequence = ((AssociateSeqOptions) fileChooserAssSeqPanel
+ SequenceI userSelectedSeq = ((AssociateSeqOptions) fileChooserAssSeqPanel
.getCmb_assSeq().getSelectedItem()).getSequence();
+ if (userSelectedSeq != null)
+ {
+ selectedSequence = userSelectedSeq;
+ }
+ System.out.println(">>>>>>>>>>>>> Selected file >>>>>>>>>>>>>>> "
+ + selectedPdbFileName);
new AssociatePdbFileWithSeq().associatePdbWithSeq(
selectedPdbFileName, jalview.io.AppletFormatAdapter.FILE,
selectedSequence, true, Desktop.instance);