From: jprocter Date: Wed, 6 Apr 2005 16:20:55 +0000 (+0000) Subject: next version of Jpred functionality using new client code. X-Git-Tag: Release_2_0~488 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7535505ef73485ad43881cb72a6c52cfb0033c63;p=jalview.git next version of Jpred functionality using new client code. --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 8c7c9be..5ee6c62 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1131,11 +1131,51 @@ if ( viewport.getConservationSelected() ) protected void jpred_actionPerformed(ActionEvent e) { + JInternalFrame frame = new JInternalFrame(); + if (viewport.getSelectionGroup() != null && viewport.getSelectionGroup().getSize()>0) + { + // JBPNote UGLY! To prettify, make SequenceGroup and Alignment conform to some common interface! + SequenceGroup seqs = viewport.getSelectionGroup(); + if (seqs.getSize() == 1 || !viewport.alignment.isAligned()) + { + JPredClient ct = new JPredClient( (SequenceI) + seqs.getSequenceAt(0)); + } + else + { + int sz; + SequenceI[] msa = new SequenceI[sz=seqs.getSize()]; + for (int i = 0; i < sz; i++) + { + msa[i] = (SequenceI) seqs.getSequenceAt(i); + } + + JPredClient ct = new JPredClient(msa); + } - JInternalFrame frame = new JInternalFrame(); - JPredClient ct = new JPredClient((SequenceI) - viewport.getAlignment().getSequences().elementAt(0)); } + else + { + Vector seqs = viewport.getAlignment().getSequences(); + + if (seqs.size() == 1 || !viewport.alignment.isAligned()) + { + JPredClient ct = new JPredClient( (SequenceI) + seqs.elementAt(0)); + } + else + { + SequenceI[] msa = new SequenceI[seqs.size()]; + for (int i = 0; i < seqs.size(); i++) + { + msa[i] = (SequenceI) seqs.elementAt(i); + } + + JPredClient ct = new JPredClient(msa); + } + + } + } protected void LoadtreeMenuItem_actionPerformed(ActionEvent e) { // Pick the tree file diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index c94a5a8..5c6bcf4 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -308,7 +308,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio } int res = evt.getX() / av.getCharWidth() + av.getStartRes(); - if(row>-1 && aa[row].annotations[res]!=null) + if(row>-1 && res