public boolean autoCalculated = false;
public String annotationId;
-
+
public SequenceI sequenceRef;
/** DOCUMENT ME!! */
* RNA secondary structure contact positions
*/
public SequenceFeature[] _rnasecstr = null;
+
+ public String rnaStructure;
/**
* Updates the _rnasecstr field Determines the positions that base pair and
{
_rnasecstr = Rna.GetBasePairs(RNAannot);
Rna.HelixMap(_rnasecstr);
+
+ setRNAStruc(RNAannot);
if (_rnasecstr != null && _rnasecstr.length > 0)
{
}
// System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup());
}
-
+
public java.util.Hashtable sequenceMapping;
/** DOCUMENT ME!! */
annotationId = this.hashCode() + "";
}
- /**
+ public void setRNAStruc(String string) {
+ rnaStructure=string;
+}
+
+ public String getRNAStruc(){
+ return rnaStructure;
+ }
+
+/**
* Creates a new AlignmentAnnotation object.
*
* @param label
Image image;
AlignmentPanel ap;
-
+
AlignViewport av;
boolean resizing = false;
public void mouseClicked(MouseEvent evt)
{
AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+
if (SwingUtilities.isLeftMouseButton(evt))
{
if (selectedRow > -1 && selectedRow < aa.length)
JMenuItem item = new JMenuItem(ADDNEW);
item.addActionListener(this);
pop.add(item);
+
if (selectedRow < 0)
{
if (hasHiddenRows)
initVarna();
}
- public AppVarna(String seq,String name){
- vab = new AppVarnaBinding(seq);
+ public AppVarna(String seq,String struc,String name){
+ vab = new AppVarnaBinding(seq,struc);
name=this.name;
initVarna();
}
public void initVarna(){
+ //TODO: Why is it not possible to include varnaPanel in the AppVarna-Jframe?
//vab.setFinishedInit(false);
- varnaPanel=vab.vp;
- this.getContentPane().add(varnaPanel);
- jalview.gui.Desktop.addInternalFrame(this,name,getBounds().width, getBounds().height);
+ varnaPanel=vab.get_varnaPanel();
+ //varnaPanel.setVisible(true);
+ //getContentPane().setLayout(new BorderLayout());
+ //getContentPane().add(varnaPanel, BorderLayout.CENTER);
+ //setVisible(true);
+ //jalview.gui.Desktop.addInternalFrame(this,name,getBounds().width, getBounds().height);
showPanel(true);
}
public void showPanel(boolean show){
- //vab.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- //vab.pack();
- //vab.setVisible(show);
- varnaPanel.setVisible(show);
+ vab.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ vab.pack();
+ vab.setVisible(show);
+
+ //varnaPanel.setVisible(show);
}
private boolean _started = false;
initVarna(this.DEFAULT_SEQUENCE,this.DEFAULT_STRUCTURE1);
}
- public AppVarnaBinding(String seq){
+ public AppVarnaBinding(String seq, String struc){
super("VARNA in Jalview");
- initVarna(seq,this.DEFAULT_STRUCTURE1);
+ initVarna(seq,struc);
}
private void initVarna(String seq, String str){
DefaultListModel dlm = new DefaultListModel();
-
DefaultListSelectionModel m = new DefaultListSelectionModel();
m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
m.setLeadAnchorNotificationEnabled(false);
-
- _sideList = new ReorderableJList();
+ _sideList = new ReorderableJList();
_sideList.setModel(dlm);
_sideList.addMouseListener(this);
_sideList.setSelectionModel(m);
//TODO: Something to check if it's an RNA
//like: if(seq.getAnnotation()[0].annotations[0].secondaryStructure == 'S')
final SequenceI seqI = seq.getDatasetSequence();
- //ap.getAlignment().get
+ AlignmentAnnotation[] aa = ap.av.alignment.getAlignmentAnnotation();
+
+
+ //for(int i=0; i<aa.length;i++){
+ final String rnastruc=aa[0].getRNAStruc();
+ if(aa[0]._rnasecstr != null){
+ System.out.println("Is RNA: "+aa[0].getRNAStruc()+" "+aa.length);
+
+ }
+
menuItem = new JMenuItem();
menuItem.setText("RNA structure");
menuItem.addActionListener(new java.awt.event.ActionListener()
public void actionPerformed(ActionEvent e)
{
System.out.println("Call Varna "+seqI.getSequenceAsString()+" "+seqI.getName());
- new AppVarna(seqI.getSequenceAsString(),seqI.getName());
+ new AppVarna(seqI.getSequenceAsString(),rnastruc,seqI.getName());
}
- });
+ });
viewStructureMenu.add(menuItem);
+
//}