2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, 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.util.ArrayList;
41 import java.util.Collection;
42 import java.util.List;
44 import javax.swing.DefaultListModel;
45 import javax.swing.DefaultListSelectionModel;
46 import javax.swing.JButton;
47 import javax.swing.JLabel;
48 import javax.swing.JList;
49 import javax.swing.JPanel;
50 import javax.swing.JScrollPane;
51 import javax.swing.JTextField;
52 import javax.swing.ListModel;
53 import javax.swing.ListSelectionModel;
54 import javax.swing.event.ListSelectionEvent;
55 import javax.swing.event.ListSelectionListener;
57 import fr.orsay.lri.varna.VARNAPanel;
58 import fr.orsay.lri.varna.components.ReorderableJList;
59 import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
60 import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
61 import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength;
62 import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
63 import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;
64 import fr.orsay.lri.varna.models.FullBackup;
65 import fr.orsay.lri.varna.models.VARNAConfig;
66 import fr.orsay.lri.varna.models.rna.Mapping;
67 import fr.orsay.lri.varna.models.rna.RNA;
69 public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
70 implements DropTargetListener, InterfaceVARNAListener,
77 // private static final long serialVersionUID = -790155708306987257L;
79 private String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA";
81 private String DEFAULT_STRUCTURE1 = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...)))))..";
83 private String DEFAULT_STRUCTURE2 = "..(((((...(((((...(((((........(((((...(((((.....)))))...)))))..................))))).....)))))...)))))..";
87 protected JPanel _tools = new JPanel();
89 private JPanel _input = new JPanel();
91 private JPanel _seqPanel = new JPanel();
93 private JPanel _strPanel = new JPanel();
95 private JLabel _info = new JLabel();
97 private JTextField _str = new JTextField();
99 private JTextField _seq = new JTextField();
101 private JLabel _strLabel = new JLabel(" Str:");
103 private JLabel _seqLabel = new JLabel(" Seq:");
105 private JButton _createButton = new JButton("Create");
107 private JButton _updateButton = new JButton("Update");
109 private JButton _deleteButton = new JButton("Delete");
111 private JButton _duplicateButton = new JButton("Snapshot");
113 protected JPanel _listPanel = new JPanel();
115 private ReorderableJList _sideList = null;
117 private static String errorOpt = "error";
119 @SuppressWarnings("unused")
120 private boolean _error;
122 private Color _backgroundColor = Color.white;
124 private static int _nextID = 1;
126 @SuppressWarnings("unused")
127 private int _algoCode;
129 private BackupHolder _rnaList;
132 * public AppVarnaBinding() { //super("VARNA in Jalview");
133 * //this.set_seq("ATGC"); //this.set_str(".()."); //RNAPanelDemoInit();
135 * //initVarna("ATGCATGATATATATATAT","....((((...))))....");
136 * initVarna(this.DEFAULT_SEQUENCE,this.DEFAULT_STRUCTURE1); }
139 public AppVarnaBinding(String seq, String struc)
141 // super("VARNA in Jalview");
142 initVarna(seq, struc);
146 public AppVarnaBinding(ArrayList<RNA> rnaList)
149 // super("VARNA in Jalview");
150 initVarnaEdit(rnaList);
153 private void initVarna(String seq, String str)
156 DefaultListModel dlm = new DefaultListModel();
158 DefaultListSelectionModel m = new DefaultListSelectionModel();
159 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
160 m.setLeadAnchorNotificationEnabled(false);
162 _sideList = new ReorderableJList();
163 _sideList.setModel(dlm);
164 _sideList.addMouseListener(this);
165 _sideList.setSelectionModel(m);
166 _sideList.setPreferredSize(new Dimension(100, 0));
167 _sideList.addListSelectionListener(new ListSelectionListener()
169 public void valueChanged(ListSelectionEvent arg0)
171 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
173 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
174 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
175 .getSize(), sel.rna.getSize());
176 vp.showRNAInterpolated(sel.rna, sel.config, map);
177 _seq.setText(sel.rna.getSeq());
178 _str.setText(sel.rna.getStructDBN());
183 _rnaList = new BackupHolder(dlm, _sideList);
184 RNA _RNA1 = new RNA("User defined 1");
189 vp = new VARNAPanel("0", ".");
190 _RNA1.setRNA(seq, str);
191 _RNA1.drawRNARadiate(vp.getConfig());
192 } catch (ExceptionNonEqualLength e)
195 } catch (ExceptionUnmatchedClosingParentheses e2)
197 e2.printStackTrace();
198 } catch (ExceptionFileFormatOrSyntax e3)
200 e3.printStackTrace();
202 vp.setPreferredSize(new Dimension(400, 400));
203 _rnaList.add(vp.getConfig().clone(), _RNA1, generateDefaultName(), true);
205 // TODO setBackground(_backgroundColor);
206 vp.setBackground(_backgroundColor);
208 // TODO getContentPane().setLayout(new BorderLayout());
209 // TODO getContentPane().add(vp, BorderLayout.CENTER);
212 vp.addVARNAListener(this);
215 private void initVarnaEdit(ArrayList<RNA> rnaInList)
218 DefaultListModel dlm = new DefaultListModel();
220 int marginTools = 40;
222 DefaultListSelectionModel m = new DefaultListSelectionModel();
223 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
224 m.setLeadAnchorNotificationEnabled(false);
226 _sideList = new ReorderableJList();
227 _sideList.setModel(dlm);
228 _sideList.addMouseListener(this);
229 _sideList.setSelectionModel(m);
230 _sideList.setPreferredSize(new Dimension(100, 0));
231 _sideList.addListSelectionListener(new ListSelectionListener()
233 public void valueChanged(ListSelectionEvent arg0)
235 // System.out.println(arg0);
236 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
238 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
239 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
240 .getSize(), sel.rna.getSize());
241 //vp.showRNAInterpolated(sel.rna, sel.config, map);
242 vp.showRNA(sel.rna, sel.config);
243 // _seq.setText(sel.rna.getSeq());
244 _str.setText(sel.rna.getStructDBN());
248 _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());
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
653 r.drawRNA(vp.getConfig());
654 String name = r.getName();
657 name = path.substring(path
658 .lastIndexOf(File.separatorChar) + 1);
662 name += " (Model " + mn++ + ")";
664 _rnaList.add(vp.getConfig().clone(), r, name, true);
671 // If we made it this far, everything worked.
672 dtde.dropComplete(true);
676 // Hmm, the user must not have dropped a file list
678 } catch (Exception e)
686 public void dropActionChanged(DropTargetDragEvent arg0)
690 private class BackupHolder
692 private DefaultListModel _rnaList;
694 private ArrayList<RNA> _rnas = new ArrayList<RNA>();
698 public BackupHolder(DefaultListModel rnaList, JList l)
704 public void add(VARNAConfig c, RNA r)
706 add(c, r, r.getName(), false);
709 public void add(VARNAConfig c, RNA r, boolean select)
711 add(c, r, r.getName(), select);
714 public void add(VARNAConfig c, RNA r, String name)
716 add(c, r, name, false);
719 public void add(VARNAConfig c, RNA r, String name, boolean select)
723 _l.removeSelectionInterval(0, _rnaList.size());
727 name = generateDefaultName();
729 FullBackup bck = new FullBackup(c, r, name);
731 _rnaList.add(0, bck);
734 _l.setSelectedIndex(0);
738 public void remove(int i)
745 public DefaultListModel getModel()
750 public boolean contains(RNA r)
752 return _rnas.contains(r);
756 * public int getSize() { return _rnaList.getSize(); }
758 public FullBackup getElementAt(int i)
760 return (FullBackup) _rnaList.getElementAt(i);
763 public void removeSelected()
765 int i = _l.getSelectedIndex();
768 if (_rnaList.getSize() == 1)
774 } catch (ExceptionUnmatchedClosingParentheses e1)
776 } catch (ExceptionFileFormatOrSyntax e1)
785 if (newi == _rnaList.getSize())
787 newi = _rnaList.getSize() - 2;
789 FullBackup bck = (FullBackup) _rnaList.getElementAt(newi);
790 _l.setSelectedValue(bck, true);
798 public void onLayoutChanged()
800 // TODO Auto-generated method stub
804 public void onUINewStructure(VARNAConfig v, RNA r)
806 // patch to fix infinite loop
807 // The problem is that onUINewStructure is called when user clicks
808 // check with Yann about whether Jalview should do anything with this event.
809 // e.g. if user has used VARNA's menu to import a structure .. Jalview may need to be told which structure is displayed.
811 // _rnaList.add(v, r, "", true);
814 public void onWarningEmitted(String s)
816 // TODO Auto-generated method stub
820 public void mouseClicked(MouseEvent e)
822 if (e.getClickCount() == 2)
824 int index = _sideList.locationToIndex(e.getPoint());
825 ListModel dlm = _sideList.getModel();
826 FullBackup item = (FullBackup) dlm.getElementAt(index);
828 _sideList.ensureIndexIsVisible(index);
830 * TODO Object newName = JOptionPane.showInputDialog( this,
831 * "Specify a new name for this RNA", "Rename RNA",
832 * JOptionPane.QUESTION_MESSAGE, (Icon)null, null, item.toString()); if
833 * (newName!=null) { item.name = newName.toString();
834 * this._sideList.repaint(); }
839 public void mouseEntered(MouseEvent arg0)
841 // TODO Auto-generated method stub
845 public void mouseExited(MouseEvent arg0)
847 // TODO Auto-generated method stub
851 public void mousePressed(MouseEvent arg0)
853 // TODO Auto-generated method stub
857 public void mouseReleased(MouseEvent arg0)
859 // TODO Auto-generated method stub
864 public Color getColour(int atomIndex, int pdbResNum, String chain,
867 // TODO Auto-generated method stub
872 public String[] getPdbFile()
874 // TODO Auto-generated method stub
879 public void highlightAtom(int atomIndex, int pdbResNum, String chain,
882 // TODO Auto-generated method stub
887 public void mouseOverStructure(int atomIndex, String strInfo)
889 // TODO Auto-generated method stub
894 public void releaseReferences(Object svl)
896 // TODO Auto-generated method stub
901 public void updateColours(Object source)
903 // TODO Auto-generated method stub
908 public void componentHidden(ComponentEvent e)
910 // TODO Auto-generated method stub
915 public void componentMoved(ComponentEvent e)
917 // TODO Auto-generated method stub
922 public void componentResized(ComponentEvent e)
924 // TODO Auto-generated method stub
929 public void componentShown(ComponentEvent e)
931 // TODO Auto-generated method stub
936 public void onStructureRedrawn()
938 // TODO Auto-generated method stub
943 public void onZoomLevelChanged()
945 // TODO Auto-generated method stub
950 public void onTranslationChanged()
952 // TODO Auto-generated method stub
958 * public static void main(String[] args) { JTextField str = new
959 * JTextField("ATGC");
961 * AppVarnaBinding vab = new AppVarnaBinding(); vab.varnagui.set_seq(str);
962 * vab.varnagui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
963 * vab.varnagui.pack(); vab.varnagui.setVisible(true); } }