JAL-842; Added the TextField to edit structure in VARNA
authorjanengelhardt <engelhardt87@googlemail.com>
Tue, 12 Jul 2011 08:28:19 +0000 (10:28 +0200)
committerjanengelhardt <engelhardt87@googlemail.com>
Mon, 25 Jul 2011 12:58:34 +0000 (14:58 +0200)
Change-Id: I93a90da2468c4c6b69570aac9741b286300b6430

src/jalview/gui/AppVarna.java
src/jalview/gui/AppVarnaBinding.java

index 5dd65c4..bc83400 100644 (file)
@@ -86,7 +86,7 @@ public class AppVarna extends JInternalFrame implements InterfaceVARNAListener//
          JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,vab.getListPanel(),varnaPanel);
          getContentPane().setLayout(new BorderLayout());
          getContentPane().add(split, BorderLayout.CENTER);
-         //getContentPane().add(vab.getTools(), BorderLayout.NORTH);   
+         getContentPane().add(vab.getTools(), BorderLayout.NORTH);     
          varnaPanel.addVARNAListener(this);
          jalview.gui.Desktop.addInternalFrame(this,"VARNA -"+name,getBounds().width, getBounds().height);
          this.pack();
index 1d2d8fd..493e4a7 100644 (file)
@@ -96,6 +96,7 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
        private JLabel _strLabel = new JLabel(" Str:");
        private JLabel _seqLabel = new JLabel(" Seq:");
        private JButton _createButton = new JButton("Create");
+       private JButton _updateButton = new JButton("Update");
        private JButton _deleteButton = new JButton("Delete");
        private JButton _duplicateButton = new JButton("Snapshot");
        
@@ -195,7 +196,7 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
            DefaultListModel dlm = new DefaultListModel(); 
            
 
-               //int marginTools = 40;
+               int marginTools = 40;
 
            DefaultListSelectionModel m = new DefaultListSelectionModel();
            m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
@@ -216,7 +217,7 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
                                        Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA().getSize(), sel.rna.getSize());
                                        vp.showRNAInterpolated(sel.rna,sel.config,map);
                                        //_seq.setText(sel.rna.getSeq());
-                                       //_str.setText(sel.rna.getStructDBN());
+                                       _str.setText(sel.rna.getStructDBN());
                                }
                        }
            });
@@ -248,17 +249,19 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
 
                vp.setBackground(_backgroundColor);
                
-               /*
+               
                Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
 
-               _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
-               _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
+               //_seqLabel.setHorizontalTextPosition(JLabel.LEFT);
+               //_seqLabel.setPreferredSize(new Dimension(marginTools, 15));
                _seq.setFont(textFieldsFont);
                _seq.setText(rnaInList.get(0).getSeq());
-
-               _createButton.addActionListener(new ActionListener() {
+               
+               _updateButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
-                               try {
+                               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());
@@ -267,13 +270,13 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
                                        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());
-               _seqPanel.add(_seqLabel, BorderLayout.WEST);
-               _seqPanel.add(_seq, BorderLayout.CENTER);
+               //_seqPanel.setLayout(new BorderLayout());
+               //_seqPanel.add(_seqLabel, BorderLayout.WEST);
+               //_seqPanel.add(_seq, BorderLayout.CENTER);
 
                _strLabel.setPreferredSize(new Dimension(marginTools, 15));
                _strLabel.setHorizontalTextPosition(JLabel.LEFT);
@@ -282,8 +285,8 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
                _strPanel.add(_strLabel, BorderLayout.WEST);
                _strPanel.add(_str, BorderLayout.CENTER);
 
-               _input.setLayout(new GridLayout(2, 0));
-               _input.add(_seqPanel);
+               _input.setLayout(new GridLayout(1, 0));
+               //_input.add(_seqPanel);
                _input.add(_strPanel);
 
                JPanel goPanel = new JPanel();
@@ -291,10 +294,10 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
 
                _tools.setLayout(new BorderLayout());
                _tools.add(_input, BorderLayout.CENTER);
-               _tools.add(_info, BorderLayout.SOUTH);
+               //_tools.add(_info, BorderLayout.SOUTH);
                _tools.add(goPanel, BorderLayout.EAST);
 
-               _deleteButton.addActionListener(new ActionListener() {
+               /*_deleteButton.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                                _rnaList.removeSelected();
                        }
@@ -303,20 +306,22 @@ public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding imple
                        public void actionPerformed(ActionEvent e) {
                                        _rnaList.add((VARNAConfig)vp.getConfig().clone(),vp.getRNA().clone(),vp.getRNA().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new Date()),true); 
                        }});
-               goPanel.add(_createButton, BorderLayout.CENTER);
                */
+               goPanel.add(_updateButton, BorderLayout.CENTER);
+               
+               
                JPanel ops = new JPanel();
                ops.setLayout(new GridLayout(1,2));
                ops.add(_deleteButton);
                ops.add(_duplicateButton);
-
+               
                JLabel j = new JLabel("Structures Manager",JLabel.CENTER);
                _listPanel.setLayout(new BorderLayout());
                
                _listPanel.add(ops,BorderLayout.SOUTH);
                _listPanel.add(j,BorderLayout.NORTH);
                _listPanel.add(listScroller,BorderLayout.CENTER);
-
+               
                
                
                //JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);