Refactored alignment viewport to use common base, extended viewport API with getters...
[jalview.git] / src / jalview / gui / AppVarnaBinding.java
index 493e4a7..d413c54 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
+ * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
  * 
  * This file is part of Jalview.
  * 
@@ -221,7 +221,6 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
                                }
                        }
            });
-           
            _rnaList = new BackupHolder(dlm,_sideList);
                        
                try {
@@ -261,17 +260,7 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
                        public void actionPerformed(ActionEvent e) {
                                FullBackup  sel = (FullBackup) _sideList.getSelectedValue();
                                sel.rna.setSequence("A");
-                               /*try {
-                               RNA nRNA = new RNA(generateDefaultName());
-                               nRNA.setRNA(_seq.getText(), _str.getText());
-                               nRNA.drawRNARadiate(vp.getConfig());
-                               _rnaList.add(new VARNAConfig(),nRNA,true);
-                               } catch (ExceptionUnmatchedClosingParentheses e1) {
-                                       JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error", JOptionPane.ERROR_MESSAGE);
-                               } catch (ExceptionFileFormatOrSyntax e1) {
-                                       JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error", JOptionPane.ERROR_MESSAGE);
-                               }*/
-                       }
+                               }
                });
                
                //_seqPanel.setLayout(new BorderLayout());
@@ -344,6 +333,23 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
        public JPanel getListPanel(){
                return _listPanel;
        }
+       
+       /**
+        * TODO: Is it effective to transfer the whole RNA?
+        * @return Currently selected RNA
+        */
+       public RNA getSelectedRNA(){
+               return _rnaList.getElementAt(_sideList.getSelectedIndex()).rna;
+       }
+       
+       /**
+        * Substitute currently selected RNA with the edited one
+        * @param rnaEdit
+        */
+       public void updateSelectedRNA(RNA rnaEdit){
+               vp.repaint();
+               vp.showRNA(rnaEdit);
+       }
 
        /*
        private void RNAPanelDemoInit() 
@@ -855,6 +861,13 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
                // TODO Auto-generated method stub
                
        }
+
+  @Override
+  public void onStructureRedrawn()
+  {
+    // TODO Auto-generated method stub
+    
+  }
 }