2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
23 import jalview.util.MessageManager;
25 import java.awt.BorderLayout;
26 import java.awt.Color;
27 import java.awt.Component;
28 import java.awt.Dimension;
30 import java.awt.GridLayout;
31 import java.awt.datatransfer.DataFlavor;
32 import java.awt.datatransfer.Transferable;
33 import java.awt.dnd.DnDConstants;
34 import java.awt.dnd.DropTarget;
35 import java.awt.dnd.DropTargetDragEvent;
36 import java.awt.dnd.DropTargetDropEvent;
37 import java.awt.dnd.DropTargetEvent;
38 import java.awt.dnd.DropTargetListener;
39 import java.awt.event.ActionEvent;
40 import java.awt.event.ActionListener;
41 import java.awt.event.ComponentEvent;
42 import java.awt.event.MouseEvent;
43 import java.awt.event.MouseListener;
45 import java.util.ArrayList;
46 import java.util.Collection;
47 import java.util.List;
49 import javax.swing.DefaultListModel;
50 import javax.swing.DefaultListSelectionModel;
51 import javax.swing.JButton;
52 import javax.swing.JLabel;
53 import javax.swing.JList;
54 import javax.swing.JPanel;
55 import javax.swing.JScrollPane;
56 import javax.swing.JTextField;
57 import javax.swing.ListModel;
58 import javax.swing.ListSelectionModel;
59 import javax.swing.event.ListSelectionEvent;
60 import javax.swing.event.ListSelectionListener;
62 import fr.orsay.lri.varna.VARNAPanel;
63 import fr.orsay.lri.varna.components.ReorderableJList;
64 import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
65 import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
66 import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength;
67 import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
68 import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;
69 import fr.orsay.lri.varna.models.FullBackup;
70 import fr.orsay.lri.varna.models.VARNAConfig;
71 import fr.orsay.lri.varna.models.rna.Mapping;
72 import fr.orsay.lri.varna.models.rna.RNA;
74 public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
75 implements DropTargetListener, InterfaceVARNAListener,
82 // private static final long serialVersionUID = -790155708306987257L;
84 private String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA";
86 private String DEFAULT_STRUCTURE1 = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...)))))..";
88 private String DEFAULT_STRUCTURE2 = "..(((((...(((((...(((((........(((((...(((((.....)))))...)))))..................))))).....)))))...)))))..";
92 protected JPanel _tools = new JPanel();
94 private JPanel _input = new JPanel();
96 private JPanel _seqPanel = new JPanel();
98 private JPanel _strPanel = new JPanel();
100 private JLabel _info = new JLabel();
102 private JTextField _str = new JTextField();
104 private JTextField _seq = new JTextField();
106 private JLabel _strLabel = new JLabel(
107 MessageManager.getString("label.str"));
109 private JLabel _seqLabel = new JLabel(
110 MessageManager.getString("label.seq"));
112 private JButton _createButton = new JButton(
113 MessageManager.getString("action.create"));
115 private JButton _updateButton = new JButton(
116 MessageManager.getString("action.update"));
118 private JButton _deleteButton = new JButton(
119 MessageManager.getString("action.delete"));
121 private JButton _duplicateButton = new JButton(
122 MessageManager.getString("action.snapshot"));
124 protected JPanel _listPanel = new JPanel();
126 private ReorderableJList _sideList = null;
128 private static String errorOpt = "error";
130 @SuppressWarnings("unused")
131 private boolean _error;
133 private Color _backgroundColor = Color.white;
135 private static int _nextID = 1;
137 @SuppressWarnings("unused")
138 private int _algoCode;
140 private BackupHolder _rnaList;
143 * public AppVarnaBinding() { //super("VARNA in Jalview");
144 * //this.set_seq("ATGC"); //this.set_str(".()."); //RNAPanelDemoInit();
146 * //initVarna("ATGCATGATATATATATAT","....((((...))))....");
147 * initVarna(this.DEFAULT_SEQUENCE,this.DEFAULT_STRUCTURE1); }
150 public AppVarnaBinding(String seq, String struc)
152 // super("VARNA in Jalview");
153 initVarna(seq, struc);
157 public AppVarnaBinding(ArrayList<RNA> rnaList)
160 // super("VARNA in Jalview");
161 initVarnaEdit(rnaList);
164 private void initVarna(String seq, String str)
167 DefaultListModel dlm = new DefaultListModel();
169 DefaultListSelectionModel m = new DefaultListSelectionModel();
170 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
171 m.setLeadAnchorNotificationEnabled(false);
173 _sideList = new ReorderableJList();
174 _sideList.setModel(dlm);
175 _sideList.addMouseListener(this);
176 _sideList.setSelectionModel(m);
177 _sideList.setPreferredSize(new Dimension(100, 0));
178 _sideList.addListSelectionListener(new ListSelectionListener()
180 public void valueChanged(ListSelectionEvent arg0)
182 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
184 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
185 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
186 .getSize(), sel.rna.getSize());
187 vp.showRNAInterpolated(sel.rna, sel.config, map);
188 _seq.setText(sel.rna.getSeq());
189 _str.setText(sel.rna.getStructDBN());
194 _rnaList = new BackupHolder(dlm, _sideList);
195 RNA _RNA1 = new RNA("User defined 1");
200 vp = new VARNAPanel("0", ".");
201 _RNA1.setRNA(seq, str);
202 _RNA1.drawRNARadiate(vp.getConfig());
203 } catch (ExceptionNonEqualLength e)
206 } catch (ExceptionUnmatchedClosingParentheses e2)
208 e2.printStackTrace();
209 } catch (ExceptionFileFormatOrSyntax e3)
211 e3.printStackTrace();
213 vp.setPreferredSize(new Dimension(400, 400));
214 _rnaList.add(vp.getConfig().clone(), _RNA1, generateDefaultName(), true);
216 // TODO setBackground(_backgroundColor);
217 vp.setBackground(_backgroundColor);
219 // TODO getContentPane().setLayout(new BorderLayout());
220 // TODO getContentPane().add(vp, BorderLayout.CENTER);
223 vp.addVARNAListener(this);
226 private void initVarnaEdit(ArrayList<RNA> rnaInList)
229 DefaultListModel dlm = new DefaultListModel();
231 int marginTools = 40;
233 DefaultListSelectionModel m = new DefaultListSelectionModel();
234 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
235 m.setLeadAnchorNotificationEnabled(false);
237 _sideList = new ReorderableJList();
238 _sideList.setModel(dlm);
239 _sideList.addMouseListener(this);
240 _sideList.setSelectionModel(m);
241 _sideList.setPreferredSize(new Dimension(100, 0));
242 _sideList.addListSelectionListener(new ListSelectionListener()
244 public void valueChanged(ListSelectionEvent arg0)
246 // System.out.println(arg0);
247 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
249 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
250 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
251 .getSize(), sel.rna.getSize());
252 // vp.showRNAInterpolated(sel.rna, sel.config, map);
253 vp.showRNA(sel.rna, sel.config);
254 // _seq.setText(sel.rna.getSeq());
255 _str.setText(sel.rna.getStructDBN());
259 _rnaList = new BackupHolder(dlm, _sideList);
264 vp = new VARNAPanel("0", ".");
265 for (int i = 0; i < rnaInList.size(); i++)
267 rnaInList.get(i).drawRNARadiate(vp.getConfig());
270 } catch (ExceptionNonEqualLength e)
274 vp.setPreferredSize(new Dimension(400, 400));
275 for (int i = 0; i < rnaInList.size(); i++)
277 if (i < rnaInList.size() - 1)
279 _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
284 _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
285 .get(i).getName(), true);
290 * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
291 * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
294 JScrollPane listScroller = new JScrollPane(_sideList);
295 listScroller.setPreferredSize(new Dimension(150, 0));
297 vp.setBackground(_backgroundColor);
299 Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
301 // _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
302 // _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
303 _seq.setFont(textFieldsFont);
304 _seq.setText(rnaInList.get(0).getSeq());
306 _updateButton.addActionListener(new ActionListener()
308 public void actionPerformed(ActionEvent e)
310 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
311 sel.rna.setSequence("A");
315 // _seqPanel.setLayout(new BorderLayout());
316 // _seqPanel.add(_seqLabel, BorderLayout.WEST);
317 // _seqPanel.add(_seq, BorderLayout.CENTER);
319 _strLabel.setPreferredSize(new Dimension(marginTools, 15));
320 _strLabel.setHorizontalTextPosition(JLabel.LEFT);
321 _str.setFont(textFieldsFont);
322 _strPanel.setLayout(new BorderLayout());
323 _strPanel.add(_strLabel, BorderLayout.WEST);
324 _strPanel.add(_str, BorderLayout.CENTER);
326 _input.setLayout(new GridLayout(1, 0));
327 // _input.add(_seqPanel);
328 _input.add(_strPanel);
330 JPanel goPanel = new JPanel();
331 goPanel.setLayout(new BorderLayout());
333 _tools.setLayout(new BorderLayout());
334 _tools.add(_input, BorderLayout.CENTER);
335 // _tools.add(_info, BorderLayout.SOUTH);
336 _tools.add(goPanel, BorderLayout.EAST);
339 * _deleteButton.addActionListener(new ActionListener() { public void
340 * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
341 * _duplicateButton.addActionListener(new ActionListener() { public void
342 * actionPerformed(ActionEvent e) {
343 * _rnaList.add((VARNAConfig)vp.getConfig().
344 * clone(),vp.getRNA().clone(),vp.getRNA
345 * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
346 * Date()),true); }});
348 goPanel.add(_updateButton, BorderLayout.CENTER);
350 JPanel ops = new JPanel();
351 ops.setLayout(new GridLayout(1, 2));
352 ops.add(_deleteButton);
353 ops.add(_duplicateButton);
355 JLabel j = new JLabel(
356 MessageManager.getString("label.structures_manager"),
358 _listPanel.setLayout(new BorderLayout());
360 // _listPanel.add(ops, BorderLayout.SOUTH);
361 _listPanel.add(j, BorderLayout.NORTH);
362 _listPanel.add(listScroller, BorderLayout.CENTER);
364 // JSplitPane split = new
365 // JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
367 * TODO getContentPane().setLayout(new BorderLayout());
368 * getContentPane().add(split, BorderLayout.CENTER);
369 * getContentPane().add(_tools, BorderLayout.NORTH);
372 // TODO setVisible(true);
373 DropTarget dt = new DropTarget(vp, this);
375 vp.addVARNAListener(this);
378 public JPanel getTools()
383 public JPanel getListPanel()
389 * TODO: Is it effective to transfer the whole RNA?
391 * @return Currently selected RNA
393 public RNA getSelectedRNA()
395 return _rnaList.getElementAt(_sideList.getSelectedIndex()).rna;
399 * Substitute currently selected RNA with the edited one
403 public void updateSelectedRNA(RNA rnaEdit)
410 * private void RNAPanelDemoInit() { DefaultListModel dlm = new
411 * DefaultListModel();
414 * int marginTools = 40;
416 * DefaultListSelectionModel m = new DefaultListSelectionModel();
417 * m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
418 * m.setLeadAnchorNotificationEnabled(false);
421 * _sideList = new ReorderableJList(); _sideList.setModel(dlm);
422 * _sideList.addMouseListener(this); _sideList.setSelectionModel(m);
423 * _sideList.setPreferredSize(new Dimension(100, 0));
424 * _sideList.addListSelectionListener( new ListSelectionListener(){ public
425 * void valueChanged(ListSelectionEvent arg0) { //System.out.println(arg0); if
426 * (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting()) { FullBackup
427 * sel = (FullBackup) _sideList.getSelectedValue(); Mapping map =
428 * Mapping.DefaultOutermostMapping(vp.getRNA().getSize(), sel.rna.getSize());
429 * vp.showRNAInterpolated(sel.rna,sel.config,map);
430 * _seq.setText(sel.rna.getSeq()); _str.setText(sel.rna.getStructDBN()); } }
433 * _rnaList = new BackupHolder(dlm,_sideList); RNA _RNA1 = new
434 * RNA("User defined 1"); RNA _RNA2 = new RNA("User defined 2"); try { vp =
435 * new VARNAPanel("0","."); _RNA1.setRNA(DEFAULT_SEQUENCE,
436 * DEFAULT_STRUCTURE1); _RNA1.drawRNARadiate(vp.getConfig());
437 * _RNA2.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE2);
438 * _RNA2.drawRNARadiate(vp.getConfig()); } catch (ExceptionNonEqualLength e) {
439 * vp.errorDialog(e); } catch (ExceptionUnmatchedClosingParentheses e2) {
440 * e2.printStackTrace(); } catch (ExceptionFileFormatOrSyntax e3) {
441 * e3.printStackTrace(); } vp.setPreferredSize(new Dimension(400, 400));
442 * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
443 * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
445 * JScrollPane listScroller = new JScrollPane(_sideList);
446 * listScroller.setPreferredSize(new Dimension(150, 0));
448 * setBackground(_backgroundColor); vp.setBackground(_backgroundColor);
451 * Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
453 * _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
454 * _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
455 * _seq.setFont(textFieldsFont); _seq.setText(DEFAULT_SEQUENCE);
457 * _createButton.addActionListener(new ActionListener() { public void
458 * actionPerformed(ActionEvent e) { try { RNA nRNA = new
459 * RNA(generateDefaultName()); nRNA.setRNA(_seq.getText(), _str.getText());
460 * nRNA.drawRNARadiate(vp.getConfig()); _rnaList.add(new
461 * VARNAConfig(),nRNA,true); } catch (ExceptionUnmatchedClosingParentheses e1)
462 * { JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
463 * JOptionPane.ERROR_MESSAGE); } catch (ExceptionFileFormatOrSyntax e1) {
464 * JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
465 * JOptionPane.ERROR_MESSAGE); } } });
468 * _seqPanel.setLayout(new BorderLayout()); _seqPanel.add(_seqLabel,
469 * BorderLayout.WEST); _seqPanel.add(_seq, BorderLayout.CENTER);
471 * _strLabel.setPreferredSize(new Dimension(marginTools, 15));
472 * _strLabel.setHorizontalTextPosition(JLabel.LEFT);
473 * _str.setFont(textFieldsFont); _strPanel.setLayout(new BorderLayout());
474 * _strPanel.add(_strLabel, BorderLayout.WEST); _strPanel.add(_str,
475 * BorderLayout.CENTER);
477 * _input.setLayout(new GridLayout(2, 0)); _input.add(_seqPanel);
478 * _input.add(_strPanel);
480 * JPanel goPanel = new JPanel(); goPanel.setLayout(new BorderLayout());
482 * _tools.setLayout(new BorderLayout()); _tools.add(_input,
483 * BorderLayout.CENTER); _tools.add(_info, BorderLayout.SOUTH);
484 * _tools.add(goPanel, BorderLayout.EAST);
486 * _deleteButton.addActionListener(new ActionListener() { public void
487 * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
488 * _duplicateButton.addActionListener(new ActionListener() { public void
489 * actionPerformed(ActionEvent e) {
490 * _rnaList.add((VARNAConfig)vp.getConfig().clone
491 * (),vp.getRNA().clone(),vp.getRNA
492 * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
493 * Date()),true); }});
495 * JPanel ops = new JPanel(); ops.setLayout(new GridLayout(1,2));
496 * ops.add(_deleteButton); ops.add(_duplicateButton);
498 * JLabel j = new JLabel("Structures Manager",JLabel.CENTER);
499 * _listPanel.setLayout(new BorderLayout());
501 * _listPanel.add(ops,BorderLayout.SOUTH);
502 * _listPanel.add(j,BorderLayout.NORTH);
503 * _listPanel.add(listScroller,BorderLayout.CENTER);
505 * goPanel.add(_createButton, BorderLayout.CENTER);
507 * JSplitPane split = new
508 * JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
509 * getContentPane().setLayout(new BorderLayout()); getContentPane().add(split,
510 * BorderLayout.CENTER); getContentPane().add(_tools, BorderLayout.NORTH);
512 * setVisible(true); DropTarget dt = new DropTarget(vp, this);
514 * vp.addVARNAListener(this); }
516 public static String generateDefaultName()
518 return "User file #" + _nextID++;
523 return (RNA) _sideList.getSelectedValue();
526 public String[][] getParameterInfo()
530 // Parameter Name Kind of Value Description,
531 { "sequenceDBN", "String", "A raw RNA sequence" },
532 { "structureDBN", "String",
533 "An RNA structure in dot bracket notation (DBN)" },
534 { errorOpt, "boolean", "To show errors" }, };
540 vp.setBackground(_backgroundColor);
544 @SuppressWarnings("unused")
545 private Color getSafeColor(String col, Color def)
550 result = Color.decode(col);
551 } catch (Exception e)
555 result = Color.getColor(col, def);
556 } catch (Exception e2)
564 public VARNAPanel get_varnaPanel()
569 public void set_varnaPanel(VARNAPanel surface)
574 public String get_seq()
576 return _seq.getText();
579 public void set_seq(String _seq)
581 this._seq.setText(_seq);
584 public String get_str()
586 return _str.getText();
589 public void set_str(String _str)
591 this._str.setText(_str);
594 public JLabel get_info()
599 public void set_info(JLabel _info)
605 * public static void main(String[] args) { AppVarnaBinding d = new
606 * AppVarnaBinding(); d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
607 * d.pack(); d.setVisible(true); }
610 public void dragEnter(DropTargetDragEvent arg0)
612 // TODO Auto-generated method stub
616 public void dragExit(DropTargetEvent arg0)
618 // TODO Auto-generated method stub
622 public void dragOver(DropTargetDragEvent arg0)
624 // TODO Auto-generated method stub
628 public void drop(DropTargetDropEvent dtde)
632 Transferable tr = dtde.getTransferable();
633 DataFlavor[] flavors = tr.getTransferDataFlavors();
634 for (int i = 0; i < flavors.length; i++)
636 if (flavors[i].isFlavorJavaFileListType())
638 dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
639 Object ob = tr.getTransferData(flavors[i]);
640 if (ob instanceof List)
642 List list = (List) ob;
643 for (int j = 0; j < list.size(); j++)
645 Object o = list.get(j);
647 if (dtde.getSource() instanceof DropTarget)
649 DropTarget dt = (DropTarget) dtde.getSource();
650 Component c = dt.getComponent();
651 if (c instanceof VARNAPanel)
653 String path = o.toString();
654 VARNAPanel vp = (VARNAPanel) c;
657 FullBackup bck = VARNAPanel.importSession(path);
658 _rnaList.add(bck.config, bck.rna, bck.name, true);
659 } catch (ExceptionLoadingFailed e3)
662 Collection<RNA> mdls = fr.orsay.lri.varna.factories.RNAFactory
666 r.drawRNA(vp.getConfig());
667 String name = r.getName();
670 name = path.substring(path
671 .lastIndexOf(File.separatorChar) + 1);
675 name += " (Model " + mn++ + ")";
677 _rnaList.add(vp.getConfig().clone(), r, name, true);
684 // If we made it this far, everything worked.
685 dtde.dropComplete(true);
689 // Hmm, the user must not have dropped a file list
691 } catch (Exception e)
699 public void dropActionChanged(DropTargetDragEvent arg0)
703 private class BackupHolder
705 private DefaultListModel _rnaList;
707 private ArrayList<RNA> _rnas = new ArrayList<RNA>();
711 public BackupHolder(DefaultListModel rnaList, JList l)
717 public void add(VARNAConfig c, RNA r)
719 add(c, r, r.getName(), false);
722 public void add(VARNAConfig c, RNA r, boolean select)
724 add(c, r, r.getName(), select);
727 public void add(VARNAConfig c, RNA r, String name)
729 add(c, r, name, false);
732 public void add(VARNAConfig c, RNA r, String name, boolean select)
736 _l.removeSelectionInterval(0, _rnaList.size());
740 name = generateDefaultName();
742 FullBackup bck = new FullBackup(c, r, name);
744 _rnaList.add(0, bck);
747 _l.setSelectedIndex(0);
751 public void remove(int i)
758 public DefaultListModel getModel()
763 public boolean contains(RNA r)
765 return _rnas.contains(r);
769 * public int getSize() { return _rnaList.getSize(); }
771 public FullBackup getElementAt(int i)
773 return (FullBackup) _rnaList.getElementAt(i);
776 public void removeSelected()
778 int i = _l.getSelectedIndex();
781 if (_rnaList.getSize() == 1)
787 } catch (ExceptionUnmatchedClosingParentheses e1)
789 } catch (ExceptionFileFormatOrSyntax e1)
798 if (newi == _rnaList.getSize())
800 newi = _rnaList.getSize() - 2;
802 FullBackup bck = (FullBackup) _rnaList.getElementAt(newi);
803 _l.setSelectedValue(bck, true);
811 public void onLayoutChanged()
813 // TODO Auto-generated method stub
817 public void onUINewStructure(VARNAConfig v, RNA r)
819 // patch to fix infinite loop
820 // The problem is that onUINewStructure is called when user clicks
821 // check with Yann about whether Jalview should do anything with this event.
822 // e.g. if user has used VARNA's menu to import a structure .. Jalview may
823 // need to be told which structure is displayed.
825 // _rnaList.add(v, r, "", true);
828 public void onWarningEmitted(String s)
830 // TODO Auto-generated method stub
834 public void mouseClicked(MouseEvent e)
836 if (e.getClickCount() == 2)
838 int index = _sideList.locationToIndex(e.getPoint());
839 ListModel dlm = _sideList.getModel();
840 FullBackup item = (FullBackup) dlm.getElementAt(index);
842 _sideList.ensureIndexIsVisible(index);
844 * TODO Object newName = JOptionPane.showInputDialog( this,
845 * "Specify a new name for this RNA", "Rename RNA",
846 * JOptionPane.QUESTION_MESSAGE, (Icon)null, null, item.toString()); if
847 * (newName!=null) { item.name = newName.toString();
848 * this._sideList.repaint(); }
853 public void mouseEntered(MouseEvent arg0)
855 // TODO Auto-generated method stub
859 public void mouseExited(MouseEvent arg0)
861 // TODO Auto-generated method stub
865 public void mousePressed(MouseEvent arg0)
867 // TODO Auto-generated method stub
871 public void mouseReleased(MouseEvent arg0)
873 // TODO Auto-generated method stub
878 public Color getColour(int atomIndex, int pdbResNum, String chain,
881 // TODO Auto-generated method stub
886 public String[] getPdbFile()
888 // TODO Auto-generated method stub
893 public void highlightAtom(int atomIndex, int pdbResNum, String chain,
896 // TODO Auto-generated method stub
901 public void mouseOverStructure(int atomIndex, String strInfo)
903 // TODO Auto-generated method stub
908 public void releaseReferences(Object svl)
910 // TODO Auto-generated method stub
915 public void updateColours(Object source)
917 // TODO Auto-generated method stub
922 public void componentHidden(ComponentEvent e)
924 // TODO Auto-generated method stub
929 public void componentMoved(ComponentEvent e)
931 // TODO Auto-generated method stub
936 public void componentResized(ComponentEvent e)
938 // TODO Auto-generated method stub
943 public void componentShown(ComponentEvent e)
945 // TODO Auto-generated method stub
950 public void onStructureRedrawn()
952 // TODO Auto-generated method stub
957 public void onZoomLevelChanged()
959 // TODO Auto-generated method stub
964 public void onTranslationChanged()
966 // TODO Auto-generated method stub
972 * public static void main(String[] args) { JTextField str = new
973 * JTextField("ATGC");
975 * AppVarnaBinding vab = new AppVarnaBinding(); vab.varnagui.set_seq(str);
976 * vab.varnagui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
977 * vab.varnagui.pack(); vab.varnagui.setVisible(true); } }