2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 import java.awt.BorderLayout;
22 import java.awt.Color;
23 import java.awt.Component;
24 import java.awt.Dimension;
26 import java.awt.GridLayout;
27 import java.awt.datatransfer.DataFlavor;
28 import java.awt.datatransfer.Transferable;
29 import java.awt.dnd.DnDConstants;
30 import java.awt.dnd.DropTarget;
31 import java.awt.dnd.DropTargetDragEvent;
32 import java.awt.dnd.DropTargetDropEvent;
33 import java.awt.dnd.DropTargetEvent;
34 import java.awt.dnd.DropTargetListener;
35 import java.awt.event.ActionEvent;
36 import java.awt.event.ActionListener;
37 import java.awt.event.ComponentEvent;
38 import java.awt.event.MouseEvent;
39 import java.awt.event.MouseListener;
41 import java.util.ArrayList;
42 import java.util.Collection;
43 import java.util.List;
45 import javax.swing.DefaultListModel;
46 import javax.swing.DefaultListSelectionModel;
47 import javax.swing.Icon;
48 import javax.swing.JButton;
49 import javax.swing.JFrame;
50 import javax.swing.JLabel;
51 import javax.swing.JList;
52 import javax.swing.JOptionPane;
53 import javax.swing.JPanel;
54 import javax.swing.JScrollPane;
55 import javax.swing.JSplitPane;
56 import javax.swing.JTextField;
57 import javax.swing.ListModel;
58 import javax.swing.ListSelectionModel;
59 import javax.swing.UIManager;
60 import javax.swing.UnsupportedLookAndFeelException;
61 import javax.swing.event.ListSelectionEvent;
62 import javax.swing.event.ListSelectionListener;
64 import fr.orsay.lri.varna.VARNAPanel;
65 import fr.orsay.lri.varna.components.ReorderableJList;
66 import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
67 import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
68 import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength;
69 import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
70 import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;
71 import fr.orsay.lri.varna.models.FullBackup;
72 import fr.orsay.lri.varna.models.VARNAConfig;
73 import fr.orsay.lri.varna.models.rna.Mapping;
74 import fr.orsay.lri.varna.models.rna.RNA;
76 public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
77 implements DropTargetListener, InterfaceVARNAListener,
84 // private static final long serialVersionUID = -790155708306987257L;
86 private String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA";
88 private String DEFAULT_STRUCTURE1 = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...)))))..";
90 private String DEFAULT_STRUCTURE2 = "..(((((...(((((...(((((........(((((...(((((.....)))))...)))))..................))))).....)))))...)))))..";
94 protected JPanel _tools = new JPanel();
96 private JPanel _input = new JPanel();
98 private JPanel _seqPanel = new JPanel();
100 private JPanel _strPanel = new JPanel();
102 private JLabel _info = new JLabel();
104 private JTextField _str = new JTextField();
106 private JTextField _seq = new JTextField();
108 private JLabel _strLabel = new JLabel(" Str:");
110 private JLabel _seqLabel = new JLabel(" Seq:");
112 private JButton _createButton = new JButton("Create");
114 private JButton _updateButton = new JButton("Update");
116 private JButton _deleteButton = new JButton("Delete");
118 private JButton _duplicateButton = new JButton("Snapshot");
120 protected JPanel _listPanel = new JPanel();
122 private ReorderableJList _sideList = null;
124 private static String errorOpt = "error";
126 @SuppressWarnings("unused")
127 private boolean _error;
129 private Color _backgroundColor = Color.white;
131 private static int _nextID = 1;
133 @SuppressWarnings("unused")
134 private int _algoCode;
136 private BackupHolder _rnaList;
139 * public AppVarnaBinding() { //super("VARNA in Jalview");
140 * //this.set_seq("ATGC"); //this.set_str(".()."); //RNAPanelDemoInit();
142 * //initVarna("ATGCATGATATATATATAT","....((((...))))....");
143 * initVarna(this.DEFAULT_SEQUENCE,this.DEFAULT_STRUCTURE1); }
146 public AppVarnaBinding(String seq, String struc)
148 // super("VARNA in Jalview");
149 initVarna(seq, struc);
152 public AppVarnaBinding(ArrayList<RNA> rnaList)
154 // super("VARNA in Jalview");
155 initVarnaEdit(rnaList);
158 private void initVarna(String seq, String str)
160 DefaultListModel dlm = new DefaultListModel();
162 DefaultListSelectionModel m = new DefaultListSelectionModel();
163 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
164 m.setLeadAnchorNotificationEnabled(false);
166 _sideList = new ReorderableJList();
167 _sideList.setModel(dlm);
168 _sideList.addMouseListener(this);
169 _sideList.setSelectionModel(m);
170 _sideList.setPreferredSize(new Dimension(100, 0));
171 _sideList.addListSelectionListener(new ListSelectionListener()
173 public void valueChanged(ListSelectionEvent arg0)
175 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
177 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
178 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
179 .getSize(), sel.rna.getSize());
180 vp.showRNAInterpolated(sel.rna, sel.config, map);
181 _seq.setText(sel.rna.getSeq());
182 _str.setText(sel.rna.getStructDBN());
187 _rnaList = new BackupHolder(dlm, _sideList);
188 RNA _RNA1 = new RNA("User defined 1");
192 vp = new VARNAPanel("0", ".");
193 _RNA1.setRNA(seq, str);
194 _RNA1.drawRNARadiate(vp.getConfig());
195 } catch (ExceptionNonEqualLength e)
198 } catch (ExceptionUnmatchedClosingParentheses e2)
200 e2.printStackTrace();
201 } catch (ExceptionFileFormatOrSyntax e3)
203 e3.printStackTrace();
205 vp.setPreferredSize(new Dimension(400, 400));
206 _rnaList.add(vp.getConfig().clone(), _RNA1, generateDefaultName(), true);
208 // TODO setBackground(_backgroundColor);
209 vp.setBackground(_backgroundColor);
211 // TODO getContentPane().setLayout(new BorderLayout());
212 // TODO getContentPane().add(vp, BorderLayout.CENTER);
215 vp.addVARNAListener(this);
218 private void initVarnaEdit(ArrayList<RNA> rnaInList)
220 DefaultListModel dlm = new DefaultListModel();
222 int marginTools = 40;
224 DefaultListSelectionModel m = new DefaultListSelectionModel();
225 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
226 m.setLeadAnchorNotificationEnabled(false);
228 _sideList = new ReorderableJList();
229 _sideList.setModel(dlm);
230 _sideList.addMouseListener(this);
231 _sideList.setSelectionModel(m);
232 _sideList.setPreferredSize(new Dimension(100, 0));
233 _sideList.addListSelectionListener(new ListSelectionListener()
235 public void valueChanged(ListSelectionEvent arg0)
237 // System.out.println(arg0);
238 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
240 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
241 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
242 .getSize(), sel.rna.getSize());
243 vp.showRNAInterpolated(sel.rna, sel.config, map);
244 // _seq.setText(sel.rna.getSeq());
245 _str.setText(sel.rna.getStructDBN());
249 _rnaList = new BackupHolder(dlm, _sideList);
253 vp = new VARNAPanel("0", ".");
254 for (int i = 0; i < rnaInList.size(); i++)
256 rnaInList.get(i).drawRNARadiate(vp.getConfig());
258 } catch (ExceptionNonEqualLength e)
262 vp.setPreferredSize(new Dimension(400, 400));
263 for (int i = 0; i < rnaInList.size(); i++)
265 if (i < rnaInList.size() - 1)
267 _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
272 _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
273 .get(i).getName(), true);
278 * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
279 * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
282 JScrollPane listScroller = new JScrollPane(_sideList);
283 listScroller.setPreferredSize(new Dimension(150, 0));
285 vp.setBackground(_backgroundColor);
287 Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
289 // _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
290 // _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
291 _seq.setFont(textFieldsFont);
292 _seq.setText(rnaInList.get(0).getSeq());
294 _updateButton.addActionListener(new ActionListener()
296 public void actionPerformed(ActionEvent e)
298 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
299 sel.rna.setSequence("A");
303 // _seqPanel.setLayout(new BorderLayout());
304 // _seqPanel.add(_seqLabel, BorderLayout.WEST);
305 // _seqPanel.add(_seq, BorderLayout.CENTER);
307 _strLabel.setPreferredSize(new Dimension(marginTools, 15));
308 _strLabel.setHorizontalTextPosition(JLabel.LEFT);
309 _str.setFont(textFieldsFont);
310 _strPanel.setLayout(new BorderLayout());
311 _strPanel.add(_strLabel, BorderLayout.WEST);
312 _strPanel.add(_str, BorderLayout.CENTER);
314 _input.setLayout(new GridLayout(1, 0));
315 // _input.add(_seqPanel);
316 _input.add(_strPanel);
318 JPanel goPanel = new JPanel();
319 goPanel.setLayout(new BorderLayout());
321 _tools.setLayout(new BorderLayout());
322 _tools.add(_input, BorderLayout.CENTER);
323 // _tools.add(_info, BorderLayout.SOUTH);
324 _tools.add(goPanel, BorderLayout.EAST);
327 * _deleteButton.addActionListener(new ActionListener() { public void
328 * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
329 * _duplicateButton.addActionListener(new ActionListener() { public void
330 * actionPerformed(ActionEvent e) {
331 * _rnaList.add((VARNAConfig)vp.getConfig().
332 * clone(),vp.getRNA().clone(),vp.getRNA
333 * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
334 * Date()),true); }});
336 goPanel.add(_updateButton, BorderLayout.CENTER);
338 JPanel ops = new JPanel();
339 ops.setLayout(new GridLayout(1, 2));
340 ops.add(_deleteButton);
341 ops.add(_duplicateButton);
343 JLabel j = new JLabel("Structures Manager", JLabel.CENTER);
344 _listPanel.setLayout(new BorderLayout());
346 // _listPanel.add(ops, BorderLayout.SOUTH);
347 _listPanel.add(j, BorderLayout.NORTH);
348 _listPanel.add(listScroller, BorderLayout.CENTER);
350 // JSplitPane split = new
351 // JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
353 * TODO getContentPane().setLayout(new BorderLayout());
354 * getContentPane().add(split, BorderLayout.CENTER);
355 * getContentPane().add(_tools, BorderLayout.NORTH);
358 // TODO setVisible(true);
359 DropTarget dt = new DropTarget(vp, this);
361 vp.addVARNAListener(this);
364 public JPanel getTools()
369 public JPanel getListPanel()
375 * TODO: Is it effective to transfer the whole RNA?
377 * @return Currently selected RNA
379 public RNA getSelectedRNA()
381 return _rnaList.getElementAt(_sideList.getSelectedIndex()).rna;
385 * Substitute currently selected RNA with the edited one
389 public void updateSelectedRNA(RNA rnaEdit)
396 * private void RNAPanelDemoInit() { DefaultListModel dlm = new
397 * DefaultListModel();
400 * int marginTools = 40;
402 * DefaultListSelectionModel m = new DefaultListSelectionModel();
403 * m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
404 * m.setLeadAnchorNotificationEnabled(false);
407 * _sideList = new ReorderableJList(); _sideList.setModel(dlm);
408 * _sideList.addMouseListener(this); _sideList.setSelectionModel(m);
409 * _sideList.setPreferredSize(new Dimension(100, 0));
410 * _sideList.addListSelectionListener( new ListSelectionListener(){ public
411 * void valueChanged(ListSelectionEvent arg0) { //System.out.println(arg0); if
412 * (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting()) { FullBackup
413 * sel = (FullBackup) _sideList.getSelectedValue(); Mapping map =
414 * Mapping.DefaultOutermostMapping(vp.getRNA().getSize(), sel.rna.getSize());
415 * vp.showRNAInterpolated(sel.rna,sel.config,map);
416 * _seq.setText(sel.rna.getSeq()); _str.setText(sel.rna.getStructDBN()); } }
419 * _rnaList = new BackupHolder(dlm,_sideList); RNA _RNA1 = new
420 * RNA("User defined 1"); RNA _RNA2 = new RNA("User defined 2"); try { vp =
421 * new VARNAPanel("0","."); _RNA1.setRNA(DEFAULT_SEQUENCE,
422 * DEFAULT_STRUCTURE1); _RNA1.drawRNARadiate(vp.getConfig());
423 * _RNA2.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE2);
424 * _RNA2.drawRNARadiate(vp.getConfig()); } catch (ExceptionNonEqualLength e) {
425 * vp.errorDialog(e); } catch (ExceptionUnmatchedClosingParentheses e2) {
426 * e2.printStackTrace(); } catch (ExceptionFileFormatOrSyntax e3) {
427 * e3.printStackTrace(); } vp.setPreferredSize(new Dimension(400, 400));
428 * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
429 * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
431 * JScrollPane listScroller = new JScrollPane(_sideList);
432 * listScroller.setPreferredSize(new Dimension(150, 0));
434 * setBackground(_backgroundColor); vp.setBackground(_backgroundColor);
437 * Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
439 * _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
440 * _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
441 * _seq.setFont(textFieldsFont); _seq.setText(DEFAULT_SEQUENCE);
443 * _createButton.addActionListener(new ActionListener() { public void
444 * actionPerformed(ActionEvent e) { try { RNA nRNA = new
445 * RNA(generateDefaultName()); nRNA.setRNA(_seq.getText(), _str.getText());
446 * nRNA.drawRNARadiate(vp.getConfig()); _rnaList.add(new
447 * VARNAConfig(),nRNA,true); } catch (ExceptionUnmatchedClosingParentheses e1)
448 * { JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
449 * JOptionPane.ERROR_MESSAGE); } catch (ExceptionFileFormatOrSyntax e1) {
450 * JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
451 * JOptionPane.ERROR_MESSAGE); } } });
454 * _seqPanel.setLayout(new BorderLayout()); _seqPanel.add(_seqLabel,
455 * BorderLayout.WEST); _seqPanel.add(_seq, BorderLayout.CENTER);
457 * _strLabel.setPreferredSize(new Dimension(marginTools, 15));
458 * _strLabel.setHorizontalTextPosition(JLabel.LEFT);
459 * _str.setFont(textFieldsFont); _strPanel.setLayout(new BorderLayout());
460 * _strPanel.add(_strLabel, BorderLayout.WEST); _strPanel.add(_str,
461 * BorderLayout.CENTER);
463 * _input.setLayout(new GridLayout(2, 0)); _input.add(_seqPanel);
464 * _input.add(_strPanel);
466 * JPanel goPanel = new JPanel(); goPanel.setLayout(new BorderLayout());
468 * _tools.setLayout(new BorderLayout()); _tools.add(_input,
469 * BorderLayout.CENTER); _tools.add(_info, BorderLayout.SOUTH);
470 * _tools.add(goPanel, BorderLayout.EAST);
472 * _deleteButton.addActionListener(new ActionListener() { public void
473 * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
474 * _duplicateButton.addActionListener(new ActionListener() { public void
475 * actionPerformed(ActionEvent e) {
476 * _rnaList.add((VARNAConfig)vp.getConfig().clone
477 * (),vp.getRNA().clone(),vp.getRNA
478 * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
479 * Date()),true); }});
481 * JPanel ops = new JPanel(); ops.setLayout(new GridLayout(1,2));
482 * ops.add(_deleteButton); ops.add(_duplicateButton);
484 * JLabel j = new JLabel("Structures Manager",JLabel.CENTER);
485 * _listPanel.setLayout(new BorderLayout());
487 * _listPanel.add(ops,BorderLayout.SOUTH);
488 * _listPanel.add(j,BorderLayout.NORTH);
489 * _listPanel.add(listScroller,BorderLayout.CENTER);
491 * goPanel.add(_createButton, BorderLayout.CENTER);
493 * JSplitPane split = new
494 * JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
495 * getContentPane().setLayout(new BorderLayout()); getContentPane().add(split,
496 * BorderLayout.CENTER); getContentPane().add(_tools, BorderLayout.NORTH);
498 * setVisible(true); DropTarget dt = new DropTarget(vp, this);
500 * vp.addVARNAListener(this); }
502 public static String generateDefaultName()
504 return "User file #" + _nextID++;
509 return (RNA) _sideList.getSelectedValue();
512 public String[][] getParameterInfo()
516 // Parameter Name Kind of Value Description,
517 { "sequenceDBN", "String", "A raw RNA sequence" },
518 { "structureDBN", "String",
519 "An RNA structure in dot bracket notation (DBN)" },
520 { errorOpt, "boolean", "To show errors" }, };
526 vp.setBackground(_backgroundColor);
530 @SuppressWarnings("unused")
531 private Color getSafeColor(String col, Color def)
536 result = Color.decode(col);
537 } catch (Exception e)
541 result = Color.getColor(col, def);
542 } catch (Exception e2)
550 public VARNAPanel get_varnaPanel()
555 public void set_varnaPanel(VARNAPanel surface)
560 public String get_seq()
562 return _seq.getText();
565 public void set_seq(String _seq)
567 this._seq.setText(_seq);
570 public String get_str()
572 return _str.getText();
575 public void set_str(String _str)
577 this._str.setText(_str);
580 public JLabel get_info()
585 public void set_info(JLabel _info)
591 * public static void main(String[] args) { AppVarnaBinding d = new
592 * AppVarnaBinding(); d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
593 * d.pack(); d.setVisible(true); }
596 public void dragEnter(DropTargetDragEvent arg0)
598 // TODO Auto-generated method stub
602 public void dragExit(DropTargetEvent arg0)
604 // TODO Auto-generated method stub
608 public void dragOver(DropTargetDragEvent arg0)
610 // TODO Auto-generated method stub
614 public void drop(DropTargetDropEvent dtde)
618 Transferable tr = dtde.getTransferable();
619 DataFlavor[] flavors = tr.getTransferDataFlavors();
620 for (int i = 0; i < flavors.length; i++)
622 if (flavors[i].isFlavorJavaFileListType())
624 dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
625 Object ob = tr.getTransferData(flavors[i]);
626 if (ob instanceof List)
628 List list = (List) ob;
629 for (int j = 0; j < list.size(); j++)
631 Object o = list.get(j);
633 if (dtde.getSource() instanceof DropTarget)
635 DropTarget dt = (DropTarget) dtde.getSource();
636 Component c = dt.getComponent();
637 if (c instanceof VARNAPanel)
639 String path = o.toString();
640 VARNAPanel vp = (VARNAPanel) c;
643 FullBackup bck = VARNAPanel.importSession(path);
644 _rnaList.add(bck.config, bck.rna, bck.name, true);
645 } catch (ExceptionLoadingFailed e3)
648 Collection<RNA> mdls = fr.orsay.lri.varna.factories.RNAFactory
652 r.drawRNA(vp.getConfig());
653 String name = r.getName();
656 name = path.substring(path
657 .lastIndexOf(File.separatorChar) + 1);
661 name += " (Model " + mn++ + ")";
663 _rnaList.add(vp.getConfig().clone(), r, name, true);
670 // If we made it this far, everything worked.
671 dtde.dropComplete(true);
675 // Hmm, the user must not have dropped a file list
677 } catch (Exception e)
685 public void dropActionChanged(DropTargetDragEvent arg0)
689 private class BackupHolder
691 private DefaultListModel _rnaList;
693 private ArrayList<RNA> _rnas = new ArrayList<RNA>();
697 public BackupHolder(DefaultListModel rnaList, JList l)
703 public void add(VARNAConfig c, RNA r)
705 add(c, r, r.getName(), false);
708 public void add(VARNAConfig c, RNA r, boolean select)
710 add(c, r, r.getName(), select);
713 public void add(VARNAConfig c, RNA r, String name)
715 add(c, r, name, false);
718 public void add(VARNAConfig c, RNA r, String name, boolean select)
722 _l.removeSelectionInterval(0, _rnaList.size());
726 name = generateDefaultName();
728 FullBackup bck = new FullBackup(c, r, name);
730 _rnaList.add(0, bck);
733 _l.setSelectedIndex(0);
737 public void remove(int i)
744 public DefaultListModel getModel()
749 public boolean contains(RNA r)
751 return _rnas.contains(r);
755 * public int getSize() { return _rnaList.getSize(); }
757 public FullBackup getElementAt(int i)
759 return (FullBackup) _rnaList.getElementAt(i);
762 public void removeSelected()
764 int i = _l.getSelectedIndex();
767 if (_rnaList.getSize() == 1)
773 } catch (ExceptionUnmatchedClosingParentheses e1)
775 } catch (ExceptionFileFormatOrSyntax e1)
784 if (newi == _rnaList.getSize())
786 newi = _rnaList.getSize() - 2;
788 FullBackup bck = (FullBackup) _rnaList.getElementAt(newi);
789 _l.setSelectedValue(bck, true);
797 public void onLayoutChanged()
799 // TODO Auto-generated method stub
803 public void onUINewStructure(VARNAConfig v, RNA r)
805 _rnaList.add(v, r, "", true);
808 public void onWarningEmitted(String s)
810 // TODO Auto-generated method stub
814 public void mouseClicked(MouseEvent e)
816 if (e.getClickCount() == 2)
818 int index = _sideList.locationToIndex(e.getPoint());
819 ListModel dlm = _sideList.getModel();
820 FullBackup item = (FullBackup) dlm.getElementAt(index);
822 _sideList.ensureIndexIsVisible(index);
824 * TODO Object newName = JOptionPane.showInputDialog( this,
825 * "Specify a new name for this RNA", "Rename RNA",
826 * JOptionPane.QUESTION_MESSAGE, (Icon)null, null, item.toString()); if
827 * (newName!=null) { item.name = newName.toString();
828 * this._sideList.repaint(); }
833 public void mouseEntered(MouseEvent arg0)
835 // TODO Auto-generated method stub
839 public void mouseExited(MouseEvent arg0)
841 // TODO Auto-generated method stub
845 public void mousePressed(MouseEvent arg0)
847 // TODO Auto-generated method stub
851 public void mouseReleased(MouseEvent arg0)
853 // TODO Auto-generated method stub
858 public Color getColour(int atomIndex, int pdbResNum, String chain,
861 // TODO Auto-generated method stub
866 public String[] getPdbFile()
868 // TODO Auto-generated method stub
873 public void highlightAtom(int atomIndex, int pdbResNum, String chain,
876 // TODO Auto-generated method stub
881 public void mouseOverStructure(int atomIndex, String strInfo)
883 // TODO Auto-generated method stub
888 public void releaseReferences(Object svl)
890 // TODO Auto-generated method stub
895 public void updateColours(Object source)
897 // TODO Auto-generated method stub
902 public void componentHidden(ComponentEvent e)
904 // TODO Auto-generated method stub
909 public void componentMoved(ComponentEvent e)
911 // TODO Auto-generated method stub
916 public void componentResized(ComponentEvent e)
918 // TODO Auto-generated method stub
923 public void componentShown(ComponentEvent e)
925 // TODO Auto-generated method stub
930 public void onStructureRedrawn()
932 // TODO Auto-generated method stub
938 * public static void main(String[] args) { JTextField str = new
939 * JTextField("ATGC");
941 * AppVarnaBinding vab = new AppVarnaBinding(); vab.varnagui.set_seq(str);
942 * vab.varnagui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
943 * vab.varnagui.pack(); vab.varnagui.setVisible(true); } }