2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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/>.
20 import java.awt.BorderLayout;
21 import java.awt.Color;
22 import java.awt.Component;
23 import java.awt.Dimension;
25 import java.awt.GridLayout;
26 import java.awt.datatransfer.DataFlavor;
27 import java.awt.datatransfer.Transferable;
28 import java.awt.dnd.DnDConstants;
29 import java.awt.dnd.DropTarget;
30 import java.awt.dnd.DropTargetDragEvent;
31 import java.awt.dnd.DropTargetDropEvent;
32 import java.awt.dnd.DropTargetEvent;
33 import java.awt.dnd.DropTargetListener;
34 import java.awt.event.ActionEvent;
35 import java.awt.event.ActionListener;
36 import java.awt.event.ComponentEvent;
37 import java.awt.event.MouseEvent;
38 import java.awt.event.MouseListener;
40 import java.text.DateFormat;
41 import java.util.ArrayList;
42 import java.util.Collection;
43 import java.util.Date;
44 import java.util.List;
46 import javax.swing.DefaultListModel;
47 import javax.swing.DefaultListSelectionModel;
48 import javax.swing.Icon;
49 import javax.swing.JButton;
50 import javax.swing.JFrame;
51 import javax.swing.JLabel;
52 import javax.swing.JList;
53 import javax.swing.JOptionPane;
54 import javax.swing.JPanel;
55 import javax.swing.JScrollPane;
56 import javax.swing.JSplitPane;
57 import javax.swing.JTextField;
58 import javax.swing.ListModel;
59 import javax.swing.ListSelectionModel;
60 import javax.swing.UIManager;
61 import javax.swing.UnsupportedLookAndFeelException;
62 import javax.swing.event.ListSelectionEvent;
63 import javax.swing.event.ListSelectionListener;
65 import fr.orsay.lri.varna.VARNAPanel;
66 import fr.orsay.lri.varna.components.ReorderableJList;
67 import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
68 import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
69 import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength;
70 import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
71 import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;
72 import fr.orsay.lri.varna.models.FullBackup;
73 import fr.orsay.lri.varna.models.VARNAConfig;
74 import fr.orsay.lri.varna.models.rna.Mapping;
75 import fr.orsay.lri.varna.models.rna.RNA;
77 public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
78 implements DropTargetListener, InterfaceVARNAListener,
85 // private static final long serialVersionUID = -790155708306987257L;
87 private String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA";
89 private String DEFAULT_STRUCTURE1 = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...)))))..";
91 private String DEFAULT_STRUCTURE2 = "..(((((...(((((...(((((........(((((...(((((.....)))))...)))))..................))))).....)))))...)))))..";
95 protected JPanel _tools = new JPanel();
97 private JPanel _input = new JPanel();
99 private JPanel _seqPanel = new JPanel();
101 private JPanel _strPanel = new JPanel();
103 private JLabel _info = new JLabel();
105 private JTextField _str = new JTextField();
107 private JTextField _seq = new JTextField();
109 private JLabel _strLabel = new JLabel(" Str:");
111 private JLabel _seqLabel = new JLabel(" Seq:");
113 private JButton _createButton = new JButton("Create");
115 private JButton _updateButton = new JButton("Update");
117 private JButton _deleteButton = new JButton("Delete");
119 private JButton _duplicateButton = new JButton("Snapshot");
121 protected JPanel _listPanel = new JPanel();
123 private ReorderableJList _sideList = null;
125 private static String errorOpt = "error";
127 @SuppressWarnings("unused")
128 private boolean _error;
130 private Color _backgroundColor = Color.white;
132 private static int _nextID = 1;
134 @SuppressWarnings("unused")
135 private int _algoCode;
137 private BackupHolder _rnaList;
140 * public AppVarnaBinding() { //super("VARNA in Jalview");
141 * //this.set_seq("ATGC"); //this.set_str(".()."); //RNAPanelDemoInit();
143 * //initVarna("ATGCATGATATATATATAT","....((((...))))....");
144 * initVarna(this.DEFAULT_SEQUENCE,this.DEFAULT_STRUCTURE1); }
147 public AppVarnaBinding(String seq, String struc)
149 // super("VARNA in Jalview");
150 initVarna(seq, struc);
153 public AppVarnaBinding(ArrayList<RNA> rnaList)
155 // super("VARNA in Jalview");
156 initVarnaEdit(rnaList);
159 private void initVarna(String seq, String str)
161 DefaultListModel dlm = new DefaultListModel();
163 DefaultListSelectionModel m = new DefaultListSelectionModel();
164 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
165 m.setLeadAnchorNotificationEnabled(false);
167 _sideList = new ReorderableJList();
168 _sideList.setModel(dlm);
169 _sideList.addMouseListener(this);
170 _sideList.setSelectionModel(m);
171 _sideList.setPreferredSize(new Dimension(100, 0));
172 _sideList.addListSelectionListener(new ListSelectionListener()
174 public void valueChanged(ListSelectionEvent arg0)
176 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
178 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
179 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
180 .getSize(), sel.rna.getSize());
181 vp.showRNAInterpolated(sel.rna, sel.config, map);
182 _seq.setText(sel.rna.getSeq());
183 _str.setText(sel.rna.getStructDBN());
188 _rnaList = new BackupHolder(dlm, _sideList);
189 RNA _RNA1 = new RNA("User defined 1");
193 vp = new VARNAPanel("0", ".");
194 _RNA1.setRNA(seq, str);
195 _RNA1.drawRNARadiate(vp.getConfig());
196 } catch (ExceptionNonEqualLength e)
199 } catch (ExceptionUnmatchedClosingParentheses e2)
201 e2.printStackTrace();
202 } catch (ExceptionFileFormatOrSyntax e3)
204 e3.printStackTrace();
206 vp.setPreferredSize(new Dimension(400, 400));
207 _rnaList.add(vp.getConfig().clone(), _RNA1, generateDefaultName(), true);
209 // TODO setBackground(_backgroundColor);
210 vp.setBackground(_backgroundColor);
212 // TODO getContentPane().setLayout(new BorderLayout());
213 // TODO getContentPane().add(vp, BorderLayout.CENTER);
216 vp.addVARNAListener(this);
219 private void initVarnaEdit(ArrayList<RNA> rnaInList)
221 DefaultListModel dlm = new DefaultListModel();
223 int marginTools = 40;
225 DefaultListSelectionModel m = new DefaultListSelectionModel();
226 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
227 m.setLeadAnchorNotificationEnabled(false);
229 _sideList = new ReorderableJList();
230 _sideList.setModel(dlm);
231 _sideList.addMouseListener(this);
232 _sideList.setSelectionModel(m);
233 _sideList.setPreferredSize(new Dimension(100, 0));
234 _sideList.addListSelectionListener(new ListSelectionListener()
236 public void valueChanged(ListSelectionEvent arg0)
238 // System.out.println(arg0);
239 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
241 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
242 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
243 .getSize(), sel.rna.getSize());
244 vp.showRNAInterpolated(sel.rna, sel.config, map);
245 // _seq.setText(sel.rna.getSeq());
246 _str.setText(sel.rna.getStructDBN());
250 _rnaList = new BackupHolder(dlm, _sideList);
254 vp = new VARNAPanel("0", ".");
255 for (int i = 0; i < rnaInList.size(); i++)
257 rnaInList.get(i).drawRNARadiate(vp.getConfig());
259 } catch (ExceptionNonEqualLength e)
263 vp.setPreferredSize(new Dimension(400, 400));
264 for (int i = 0; i < rnaInList.size(); i++)
266 if (i < rnaInList.size() - 1)
268 _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
273 _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
274 .get(i).getName(), true);
279 * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
280 * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
283 JScrollPane listScroller = new JScrollPane(_sideList);
284 listScroller.setPreferredSize(new Dimension(150, 0));
286 vp.setBackground(_backgroundColor);
288 Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
290 // _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
291 // _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
292 _seq.setFont(textFieldsFont);
293 _seq.setText(rnaInList.get(0).getSeq());
295 _updateButton.addActionListener(new ActionListener()
297 public void actionPerformed(ActionEvent e)
299 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
300 sel.rna.setSequence("A");
304 // _seqPanel.setLayout(new BorderLayout());
305 // _seqPanel.add(_seqLabel, BorderLayout.WEST);
306 // _seqPanel.add(_seq, BorderLayout.CENTER);
308 _strLabel.setPreferredSize(new Dimension(marginTools, 15));
309 _strLabel.setHorizontalTextPosition(JLabel.LEFT);
310 _str.setFont(textFieldsFont);
311 _strPanel.setLayout(new BorderLayout());
312 _strPanel.add(_strLabel, BorderLayout.WEST);
313 _strPanel.add(_str, BorderLayout.CENTER);
315 _input.setLayout(new GridLayout(1, 0));
316 // _input.add(_seqPanel);
317 _input.add(_strPanel);
319 JPanel goPanel = new JPanel();
320 goPanel.setLayout(new BorderLayout());
322 _tools.setLayout(new BorderLayout());
323 _tools.add(_input, BorderLayout.CENTER);
324 // _tools.add(_info, BorderLayout.SOUTH);
325 _tools.add(goPanel, BorderLayout.EAST);
328 * _deleteButton.addActionListener(new ActionListener() { public void
329 * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
330 * _duplicateButton.addActionListener(new ActionListener() { public void
331 * actionPerformed(ActionEvent e) {
332 * _rnaList.add((VARNAConfig)vp.getConfig().
333 * clone(),vp.getRNA().clone(),vp.getRNA
334 * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
335 * Date()),true); }});
337 goPanel.add(_updateButton, BorderLayout.CENTER);
339 JPanel ops = new JPanel();
340 ops.setLayout(new GridLayout(1, 2));
341 ops.add(_deleteButton);
342 ops.add(_duplicateButton);
344 JLabel j = new JLabel("Structures Manager", JLabel.CENTER);
345 _listPanel.setLayout(new BorderLayout());
347 //_listPanel.add(ops, BorderLayout.SOUTH);
348 _listPanel.add(j, BorderLayout.NORTH);
349 _listPanel.add(listScroller, BorderLayout.CENTER);
351 // JSplitPane split = new
352 // JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
354 * TODO getContentPane().setLayout(new BorderLayout());
355 * getContentPane().add(split, BorderLayout.CENTER);
356 * getContentPane().add(_tools, BorderLayout.NORTH);
359 // TODO setVisible(true);
360 DropTarget dt = new DropTarget(vp, this);
362 vp.addVARNAListener(this);
365 public JPanel getTools()
370 public JPanel getListPanel()
376 * TODO: Is it effective to transfer the whole RNA?
378 * @return Currently selected RNA
380 public RNA getSelectedRNA()
382 return _rnaList.getElementAt(_sideList.getSelectedIndex()).rna;
386 * Substitute currently selected RNA with the edited one
390 public void updateSelectedRNA(RNA rnaEdit)
397 * private void RNAPanelDemoInit() { DefaultListModel dlm = new
398 * DefaultListModel();
401 * int marginTools = 40;
403 * DefaultListSelectionModel m = new DefaultListSelectionModel();
404 * m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
405 * m.setLeadAnchorNotificationEnabled(false);
408 * _sideList = new ReorderableJList(); _sideList.setModel(dlm);
409 * _sideList.addMouseListener(this); _sideList.setSelectionModel(m);
410 * _sideList.setPreferredSize(new Dimension(100, 0));
411 * _sideList.addListSelectionListener( new ListSelectionListener(){ public
412 * void valueChanged(ListSelectionEvent arg0) { //System.out.println(arg0); if
413 * (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting()) { FullBackup
414 * sel = (FullBackup) _sideList.getSelectedValue(); Mapping map =
415 * Mapping.DefaultOutermostMapping(vp.getRNA().getSize(), sel.rna.getSize());
416 * vp.showRNAInterpolated(sel.rna,sel.config,map);
417 * _seq.setText(sel.rna.getSeq()); _str.setText(sel.rna.getStructDBN()); } }
420 * _rnaList = new BackupHolder(dlm,_sideList); RNA _RNA1 = new
421 * RNA("User defined 1"); RNA _RNA2 = new RNA("User defined 2"); try { vp =
422 * new VARNAPanel("0","."); _RNA1.setRNA(DEFAULT_SEQUENCE,
423 * DEFAULT_STRUCTURE1); _RNA1.drawRNARadiate(vp.getConfig());
424 * _RNA2.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE2);
425 * _RNA2.drawRNARadiate(vp.getConfig()); } catch (ExceptionNonEqualLength e) {
426 * vp.errorDialog(e); } catch (ExceptionUnmatchedClosingParentheses e2) {
427 * e2.printStackTrace(); } catch (ExceptionFileFormatOrSyntax e3) {
428 * e3.printStackTrace(); } vp.setPreferredSize(new Dimension(400, 400));
429 * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
430 * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
432 * JScrollPane listScroller = new JScrollPane(_sideList);
433 * listScroller.setPreferredSize(new Dimension(150, 0));
435 * setBackground(_backgroundColor); vp.setBackground(_backgroundColor);
438 * Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
440 * _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
441 * _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
442 * _seq.setFont(textFieldsFont); _seq.setText(DEFAULT_SEQUENCE);
444 * _createButton.addActionListener(new ActionListener() { public void
445 * actionPerformed(ActionEvent e) { try { RNA nRNA = new
446 * RNA(generateDefaultName()); nRNA.setRNA(_seq.getText(), _str.getText());
447 * nRNA.drawRNARadiate(vp.getConfig()); _rnaList.add(new
448 * VARNAConfig(),nRNA,true); } catch (ExceptionUnmatchedClosingParentheses e1)
449 * { JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
450 * JOptionPane.ERROR_MESSAGE); } catch (ExceptionFileFormatOrSyntax e1) {
451 * JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
452 * JOptionPane.ERROR_MESSAGE); } } });
455 * _seqPanel.setLayout(new BorderLayout()); _seqPanel.add(_seqLabel,
456 * BorderLayout.WEST); _seqPanel.add(_seq, BorderLayout.CENTER);
458 * _strLabel.setPreferredSize(new Dimension(marginTools, 15));
459 * _strLabel.setHorizontalTextPosition(JLabel.LEFT);
460 * _str.setFont(textFieldsFont); _strPanel.setLayout(new BorderLayout());
461 * _strPanel.add(_strLabel, BorderLayout.WEST); _strPanel.add(_str,
462 * BorderLayout.CENTER);
464 * _input.setLayout(new GridLayout(2, 0)); _input.add(_seqPanel);
465 * _input.add(_strPanel);
467 * JPanel goPanel = new JPanel(); goPanel.setLayout(new BorderLayout());
469 * _tools.setLayout(new BorderLayout()); _tools.add(_input,
470 * BorderLayout.CENTER); _tools.add(_info, BorderLayout.SOUTH);
471 * _tools.add(goPanel, BorderLayout.EAST);
473 * _deleteButton.addActionListener(new ActionListener() { public void
474 * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
475 * _duplicateButton.addActionListener(new ActionListener() { public void
476 * actionPerformed(ActionEvent e) {
477 * _rnaList.add((VARNAConfig)vp.getConfig().clone
478 * (),vp.getRNA().clone(),vp.getRNA
479 * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
480 * Date()),true); }});
482 * JPanel ops = new JPanel(); ops.setLayout(new GridLayout(1,2));
483 * ops.add(_deleteButton); ops.add(_duplicateButton);
485 * JLabel j = new JLabel("Structures Manager",JLabel.CENTER);
486 * _listPanel.setLayout(new BorderLayout());
488 * _listPanel.add(ops,BorderLayout.SOUTH);
489 * _listPanel.add(j,BorderLayout.NORTH);
490 * _listPanel.add(listScroller,BorderLayout.CENTER);
492 * goPanel.add(_createButton, BorderLayout.CENTER);
494 * JSplitPane split = new
495 * JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
496 * getContentPane().setLayout(new BorderLayout()); getContentPane().add(split,
497 * BorderLayout.CENTER); getContentPane().add(_tools, BorderLayout.NORTH);
499 * setVisible(true); DropTarget dt = new DropTarget(vp, this);
501 * vp.addVARNAListener(this); }
503 public static String generateDefaultName()
505 return "User file #" + _nextID++;
510 return (RNA) _sideList.getSelectedValue();
513 public String[][] getParameterInfo()
517 // Parameter Name Kind of Value Description,
518 { "sequenceDBN", "String", "A raw RNA sequence" },
519 { "structureDBN", "String",
520 "An RNA structure in dot bracket notation (DBN)" },
521 { errorOpt, "boolean", "To show errors" }, };
527 vp.setBackground(_backgroundColor);
531 @SuppressWarnings("unused")
532 private Color getSafeColor(String col, Color def)
537 result = Color.decode(col);
538 } catch (Exception e)
542 result = Color.getColor(col, def);
543 } catch (Exception e2)
551 public VARNAPanel get_varnaPanel()
556 public void set_varnaPanel(VARNAPanel surface)
561 public String get_seq()
563 return _seq.getText();
566 public void set_seq(String _seq)
568 this._seq.setText(_seq);
571 public String get_str()
573 return _str.getText();
576 public void set_str(String _str)
578 this._str.setText(_str);
581 public JLabel get_info()
586 public void set_info(JLabel _info)
592 * public static void main(String[] args) { AppVarnaBinding d = new
593 * AppVarnaBinding(); d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
594 * d.pack(); d.setVisible(true); }
597 public void dragEnter(DropTargetDragEvent arg0)
599 // TODO Auto-generated method stub
603 public void dragExit(DropTargetEvent arg0)
605 // TODO Auto-generated method stub
609 public void dragOver(DropTargetDragEvent arg0)
611 // TODO Auto-generated method stub
615 public void drop(DropTargetDropEvent dtde)
619 Transferable tr = dtde.getTransferable();
620 DataFlavor[] flavors = tr.getTransferDataFlavors();
621 for (int i = 0; i < flavors.length; i++)
623 if (flavors[i].isFlavorJavaFileListType())
625 dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
626 Object ob = tr.getTransferData(flavors[i]);
627 if (ob instanceof List)
629 List list = (List) ob;
630 for (int j = 0; j < list.size(); j++)
632 Object o = list.get(j);
634 if (dtde.getSource() instanceof DropTarget)
636 DropTarget dt = (DropTarget) dtde.getSource();
637 Component c = dt.getComponent();
638 if (c instanceof VARNAPanel)
640 String path = o.toString();
641 VARNAPanel vp = (VARNAPanel) c;
644 FullBackup bck = VARNAPanel.importSession(path);
645 _rnaList.add(bck.config, bck.rna, bck.name, true);
646 } catch (ExceptionLoadingFailed e3)
649 Collection<RNA> mdls=fr.orsay.lri.varna.factories.RNAFactory.loadSecStr(path);
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); } }