2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ 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.structure.AtomSpec;
24 import jalview.util.MessageManager;
26 import java.awt.BorderLayout;
27 import java.awt.Color;
28 import java.awt.Component;
29 import java.awt.Dimension;
31 import java.awt.GridLayout;
32 import java.awt.datatransfer.DataFlavor;
33 import java.awt.datatransfer.Transferable;
34 import java.awt.dnd.DnDConstants;
35 import java.awt.dnd.DropTarget;
36 import java.awt.dnd.DropTargetDragEvent;
37 import java.awt.dnd.DropTargetDropEvent;
38 import java.awt.dnd.DropTargetEvent;
39 import java.awt.dnd.DropTargetListener;
40 import java.awt.event.ActionEvent;
41 import java.awt.event.ActionListener;
42 import java.awt.event.ComponentEvent;
43 import java.awt.event.MouseEvent;
44 import java.awt.event.MouseListener;
46 import java.util.ArrayList;
47 import java.util.Collection;
48 import java.util.List;
50 import javax.swing.DefaultListModel;
51 import javax.swing.DefaultListSelectionModel;
52 import javax.swing.JButton;
53 import javax.swing.JLabel;
54 import javax.swing.JList;
55 import javax.swing.JPanel;
56 import javax.swing.JScrollPane;
57 import javax.swing.JTextField;
58 import javax.swing.ListModel;
59 import javax.swing.ListSelectionModel;
60 import javax.swing.event.ListSelectionEvent;
61 import javax.swing.event.ListSelectionListener;
63 import fr.orsay.lri.varna.VARNAPanel;
64 import fr.orsay.lri.varna.components.ReorderableJList;
65 import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
66 import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
67 import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength;
68 import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
69 import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;
70 import fr.orsay.lri.varna.models.FullBackup;
71 import fr.orsay.lri.varna.models.VARNAConfig;
72 import fr.orsay.lri.varna.models.rna.Mapping;
73 import fr.orsay.lri.varna.models.rna.RNA;
75 public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
76 implements DropTargetListener, InterfaceVARNAListener,
83 // private static final long serialVersionUID = -790155708306987257L;
85 private String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA";
87 private String DEFAULT_STRUCTURE1 = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...)))))..";
89 private String DEFAULT_STRUCTURE2 = "..(((((...(((((...(((((........(((((...(((((.....)))))...)))))..................))))).....)))))...)))))..";
93 protected JPanel _tools = new JPanel();
95 private JPanel _input = new JPanel();
97 private JPanel _seqPanel = new JPanel();
99 private JPanel _strPanel = new JPanel();
101 private JLabel _info = new JLabel();
103 private JTextField _str = new JTextField();
105 private JTextField _seq = new JTextField();
107 private JLabel _strLabel = new JLabel(
108 MessageManager.getString("label.str"));
110 private JLabel _seqLabel = new JLabel(
111 MessageManager.getString("label.seq"));
113 private JButton _createButton = new JButton(
114 MessageManager.getString("action.create"));
116 private JButton _updateButton = new JButton(
117 MessageManager.getString("action.update"));
119 private JButton _deleteButton = new JButton(
120 MessageManager.getString("action.delete"));
122 private JButton _duplicateButton = new JButton(
123 MessageManager.getString("action.snapshot"));
125 protected JPanel _listPanel = new JPanel();
127 private ReorderableJList _sideList = null;
129 private static String errorOpt = "error";
131 @SuppressWarnings("unused")
132 private boolean _error;
134 private Color _backgroundColor = Color.white;
136 private static int _nextID = 1;
138 @SuppressWarnings("unused")
139 private int _algoCode;
141 private BackupHolder _rnaList;
144 * public AppVarnaBinding() { //super("VARNA in Jalview");
145 * //this.set_seq("ATGC"); //this.set_str(".()."); //RNAPanelDemoInit();
147 * //initVarna("ATGCATGATATATATATAT","....((((...))))....");
148 * initVarna(this.DEFAULT_SEQUENCE,this.DEFAULT_STRUCTURE1); }
151 public AppVarnaBinding(String seq, String struc)
153 // super("VARNA in Jalview");
154 initVarna(seq, struc);
158 public AppVarnaBinding(ArrayList<RNA> rnaList)
161 // super("VARNA in Jalview");
162 initVarnaEdit(rnaList);
165 private void initVarna(String seq, String str)
168 DefaultListModel dlm = new DefaultListModel();
170 DefaultListSelectionModel m = new DefaultListSelectionModel();
171 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
172 m.setLeadAnchorNotificationEnabled(false);
174 _sideList = new ReorderableJList();
175 _sideList.setModel(dlm);
176 _sideList.addMouseListener(this);
177 _sideList.setSelectionModel(m);
178 _sideList.setPreferredSize(new Dimension(100, 0));
179 _sideList.addListSelectionListener(new ListSelectionListener()
181 public void valueChanged(ListSelectionEvent arg0)
183 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
185 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
186 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
187 .getSize(), sel.rna.getSize());
188 vp.showRNAInterpolated(sel.rna, sel.config, map);
189 _seq.setText(sel.rna.getSeq());
190 _str.setText(sel.rna.getStructDBN());
195 _rnaList = new BackupHolder(dlm, _sideList);
196 RNA _RNA1 = new RNA("User defined 1");
201 vp = new VARNAPanel("0", ".");
202 _RNA1.setRNA(seq, str);
203 _RNA1.drawRNARadiate(vp.getConfig());
204 } catch (ExceptionNonEqualLength e)
207 } catch (ExceptionUnmatchedClosingParentheses e2)
209 e2.printStackTrace();
210 } catch (ExceptionFileFormatOrSyntax e3)
212 e3.printStackTrace();
214 vp.setPreferredSize(new Dimension(400, 400));
215 _rnaList.add(vp.getConfig().clone(), _RNA1, generateDefaultName(), true);
217 // TODO setBackground(_backgroundColor);
218 vp.setBackground(_backgroundColor);
220 // TODO getContentPane().setLayout(new BorderLayout());
221 // TODO getContentPane().add(vp, BorderLayout.CENTER);
224 vp.addVARNAListener(this);
227 private void initVarnaEdit(ArrayList<RNA> rnaInList)
230 DefaultListModel dlm = new DefaultListModel();
232 int marginTools = 40;
234 DefaultListSelectionModel m = new DefaultListSelectionModel();
235 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
236 m.setLeadAnchorNotificationEnabled(false);
238 _sideList = new ReorderableJList();
239 _sideList.setModel(dlm);
240 _sideList.addMouseListener(this);
241 _sideList.setSelectionModel(m);
242 _sideList.setPreferredSize(new Dimension(100, 0));
243 _sideList.addListSelectionListener(new ListSelectionListener()
245 public void valueChanged(ListSelectionEvent arg0)
247 // System.out.println(arg0);
248 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
250 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
251 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
252 .getSize(), sel.rna.getSize());
253 // vp.showRNAInterpolated(sel.rna, sel.config, map);
254 vp.showRNA(sel.rna, sel.config);
255 // _seq.setText(sel.rna.getSeq());
256 _str.setText(sel.rna.getStructDBN());
260 _rnaList = new BackupHolder(dlm, _sideList);
265 vp = new VARNAPanel("0", ".");
266 for (int i = 0; i < rnaInList.size(); i++)
268 rnaInList.get(i).drawRNARadiate(vp.getConfig());
271 } catch (ExceptionNonEqualLength e)
275 vp.setPreferredSize(new Dimension(400, 400));
276 for (int i = 0; i < rnaInList.size(); i++)
278 if (i < rnaInList.size() - 1)
280 _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
285 _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
286 .get(i).getName(), true);
291 * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
292 * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
295 JScrollPane listScroller = new JScrollPane(_sideList);
296 listScroller.setPreferredSize(new Dimension(150, 0));
298 vp.setBackground(_backgroundColor);
300 Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
302 // _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
303 // _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
304 _seq.setFont(textFieldsFont);
305 _seq.setText(rnaInList.get(0).getSeq());
307 _updateButton.addActionListener(new ActionListener()
309 public void actionPerformed(ActionEvent e)
311 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
312 sel.rna.setSequence("A");
316 // _seqPanel.setLayout(new BorderLayout());
317 // _seqPanel.add(_seqLabel, BorderLayout.WEST);
318 // _seqPanel.add(_seq, BorderLayout.CENTER);
320 _strLabel.setPreferredSize(new Dimension(marginTools, 15));
321 _strLabel.setHorizontalTextPosition(JLabel.LEFT);
322 _str.setFont(textFieldsFont);
323 _strPanel.setLayout(new BorderLayout());
324 _strPanel.add(_strLabel, BorderLayout.WEST);
325 _strPanel.add(_str, BorderLayout.CENTER);
327 _input.setLayout(new GridLayout(1, 0));
328 // _input.add(_seqPanel);
329 _input.add(_strPanel);
331 JPanel goPanel = new JPanel();
332 goPanel.setLayout(new BorderLayout());
334 _tools.setLayout(new BorderLayout());
335 _tools.add(_input, BorderLayout.CENTER);
336 // _tools.add(_info, BorderLayout.SOUTH);
337 _tools.add(goPanel, BorderLayout.EAST);
340 * _deleteButton.addActionListener(new ActionListener() { public void
341 * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
342 * _duplicateButton.addActionListener(new ActionListener() { public void
343 * actionPerformed(ActionEvent e) {
344 * _rnaList.add((VARNAConfig)vp.getConfig().
345 * clone(),vp.getRNA().clone(),vp.getRNA
346 * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
347 * Date()),true); }});
349 goPanel.add(_updateButton, BorderLayout.CENTER);
351 JPanel ops = new JPanel();
352 ops.setLayout(new GridLayout(1, 2));
353 ops.add(_deleteButton);
354 ops.add(_duplicateButton);
356 JLabel j = new JLabel(
357 MessageManager.getString("label.structures_manager"),
359 _listPanel.setLayout(new BorderLayout());
361 // _listPanel.add(ops, BorderLayout.SOUTH);
362 _listPanel.add(j, BorderLayout.NORTH);
363 _listPanel.add(listScroller, BorderLayout.CENTER);
365 // JSplitPane split = new
366 // JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
368 * TODO getContentPane().setLayout(new BorderLayout());
369 * getContentPane().add(split, BorderLayout.CENTER);
370 * getContentPane().add(_tools, BorderLayout.NORTH);
373 // TODO setVisible(true);
374 DropTarget dt = new DropTarget(vp, this);
376 vp.addVARNAListener(this);
379 public JPanel getTools()
384 public JPanel getListPanel()
390 * TODO: Is it effective to transfer the whole RNA?
392 * @return Currently selected RNA
394 public RNA getSelectedRNA()
396 return _rnaList.getElementAt(_sideList.getSelectedIndex()).rna;
400 * Substitute currently selected RNA with the edited one
404 public void updateSelectedRNA(RNA rnaEdit)
411 * private void RNAPanelDemoInit() { DefaultListModel dlm = new
412 * DefaultListModel();
415 * int marginTools = 40;
417 * DefaultListSelectionModel m = new DefaultListSelectionModel();
418 * m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
419 * m.setLeadAnchorNotificationEnabled(false);
422 * _sideList = new ReorderableJList(); _sideList.setModel(dlm);
423 * _sideList.addMouseListener(this); _sideList.setSelectionModel(m);
424 * _sideList.setPreferredSize(new Dimension(100, 0));
425 * _sideList.addListSelectionListener( new ListSelectionListener(){ public
426 * void valueChanged(ListSelectionEvent arg0) { //System.out.println(arg0); if
427 * (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting()) { FullBackup
428 * sel = (FullBackup) _sideList.getSelectedValue(); Mapping map =
429 * Mapping.DefaultOutermostMapping(vp.getRNA().getSize(), sel.rna.getSize());
430 * vp.showRNAInterpolated(sel.rna,sel.config,map);
431 * _seq.setText(sel.rna.getSeq()); _str.setText(sel.rna.getStructDBN()); } }
434 * _rnaList = new BackupHolder(dlm,_sideList); RNA _RNA1 = new
435 * RNA("User defined 1"); RNA _RNA2 = new RNA("User defined 2"); try { vp =
436 * new VARNAPanel("0","."); _RNA1.setRNA(DEFAULT_SEQUENCE,
437 * DEFAULT_STRUCTURE1); _RNA1.drawRNARadiate(vp.getConfig());
438 * _RNA2.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE2);
439 * _RNA2.drawRNARadiate(vp.getConfig()); } catch (ExceptionNonEqualLength e) {
440 * vp.errorDialog(e); } catch (ExceptionUnmatchedClosingParentheses e2) {
441 * e2.printStackTrace(); } catch (ExceptionFileFormatOrSyntax e3) {
442 * e3.printStackTrace(); } vp.setPreferredSize(new Dimension(400, 400));
443 * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
444 * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
446 * JScrollPane listScroller = new JScrollPane(_sideList);
447 * listScroller.setPreferredSize(new Dimension(150, 0));
449 * setBackground(_backgroundColor); vp.setBackground(_backgroundColor);
452 * Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
454 * _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
455 * _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
456 * _seq.setFont(textFieldsFont); _seq.setText(DEFAULT_SEQUENCE);
458 * _createButton.addActionListener(new ActionListener() { public void
459 * actionPerformed(ActionEvent e) { try { RNA nRNA = new
460 * RNA(generateDefaultName()); nRNA.setRNA(_seq.getText(), _str.getText());
461 * nRNA.drawRNARadiate(vp.getConfig()); _rnaList.add(new
462 * VARNAConfig(),nRNA,true); } catch (ExceptionUnmatchedClosingParentheses e1)
463 * { JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
464 * JOptionPane.ERROR_MESSAGE); } catch (ExceptionFileFormatOrSyntax e1) {
465 * JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
466 * JOptionPane.ERROR_MESSAGE); } } });
469 * _seqPanel.setLayout(new BorderLayout()); _seqPanel.add(_seqLabel,
470 * BorderLayout.WEST); _seqPanel.add(_seq, BorderLayout.CENTER);
472 * _strLabel.setPreferredSize(new Dimension(marginTools, 15));
473 * _strLabel.setHorizontalTextPosition(JLabel.LEFT);
474 * _str.setFont(textFieldsFont); _strPanel.setLayout(new BorderLayout());
475 * _strPanel.add(_strLabel, BorderLayout.WEST); _strPanel.add(_str,
476 * BorderLayout.CENTER);
478 * _input.setLayout(new GridLayout(2, 0)); _input.add(_seqPanel);
479 * _input.add(_strPanel);
481 * JPanel goPanel = new JPanel(); goPanel.setLayout(new BorderLayout());
483 * _tools.setLayout(new BorderLayout()); _tools.add(_input,
484 * BorderLayout.CENTER); _tools.add(_info, BorderLayout.SOUTH);
485 * _tools.add(goPanel, BorderLayout.EAST);
487 * _deleteButton.addActionListener(new ActionListener() { public void
488 * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
489 * _duplicateButton.addActionListener(new ActionListener() { public void
490 * actionPerformed(ActionEvent e) {
491 * _rnaList.add((VARNAConfig)vp.getConfig().clone
492 * (),vp.getRNA().clone(),vp.getRNA
493 * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
494 * Date()),true); }});
496 * JPanel ops = new JPanel(); ops.setLayout(new GridLayout(1,2));
497 * ops.add(_deleteButton); ops.add(_duplicateButton);
499 * JLabel j = new JLabel("Structures Manager",JLabel.CENTER);
500 * _listPanel.setLayout(new BorderLayout());
502 * _listPanel.add(ops,BorderLayout.SOUTH);
503 * _listPanel.add(j,BorderLayout.NORTH);
504 * _listPanel.add(listScroller,BorderLayout.CENTER);
506 * goPanel.add(_createButton, BorderLayout.CENTER);
508 * JSplitPane split = new
509 * JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
510 * getContentPane().setLayout(new BorderLayout()); getContentPane().add(split,
511 * BorderLayout.CENTER); getContentPane().add(_tools, BorderLayout.NORTH);
513 * setVisible(true); DropTarget dt = new DropTarget(vp, this);
515 * vp.addVARNAListener(this); }
517 public static String generateDefaultName()
519 return "User file #" + _nextID++;
524 return (RNA) _sideList.getSelectedValue();
527 public String[][] getParameterInfo()
531 // Parameter Name Kind of Value Description,
532 { "sequenceDBN", "String", "A raw RNA sequence" },
533 { "structureDBN", "String",
534 "An RNA structure in dot bracket notation (DBN)" },
535 { errorOpt, "boolean", "To show errors" }, };
541 vp.setBackground(_backgroundColor);
545 @SuppressWarnings("unused")
546 private Color getSafeColor(String col, Color def)
551 result = Color.decode(col);
552 } catch (Exception e)
556 result = Color.getColor(col, def);
557 } catch (Exception e2)
565 public VARNAPanel get_varnaPanel()
570 public void set_varnaPanel(VARNAPanel surface)
575 public String get_seq()
577 return _seq.getText();
580 public void set_seq(String _seq)
582 this._seq.setText(_seq);
585 public String get_str()
587 return _str.getText();
590 public void set_str(String _str)
592 this._str.setText(_str);
595 public JLabel get_info()
600 public void set_info(JLabel _info)
606 * public static void main(String[] args) { AppVarnaBinding d = new
607 * AppVarnaBinding(); d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
608 * d.pack(); d.setVisible(true); }
611 public void dragEnter(DropTargetDragEvent arg0)
613 // TODO Auto-generated method stub
617 public void dragExit(DropTargetEvent arg0)
619 // TODO Auto-generated method stub
623 public void dragOver(DropTargetDragEvent arg0)
625 // TODO Auto-generated method stub
629 public void drop(DropTargetDropEvent dtde)
633 Transferable tr = dtde.getTransferable();
634 DataFlavor[] flavors = tr.getTransferDataFlavors();
635 for (int i = 0; i < flavors.length; i++)
637 if (flavors[i].isFlavorJavaFileListType())
639 dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
640 Object ob = tr.getTransferData(flavors[i]);
641 if (ob instanceof List)
643 List list = (List) ob;
644 for (int j = 0; j < list.size(); j++)
646 Object o = list.get(j);
648 if (dtde.getSource() instanceof DropTarget)
650 DropTarget dt = (DropTarget) dtde.getSource();
651 Component c = dt.getComponent();
652 if (c instanceof VARNAPanel)
654 String path = o.toString();
655 VARNAPanel vp = (VARNAPanel) c;
658 FullBackup bck = VARNAPanel.importSession(path);
659 _rnaList.add(bck.config, bck.rna, bck.name, true);
660 } catch (ExceptionLoadingFailed e3)
663 Collection<RNA> mdls = fr.orsay.lri.varna.factories.RNAFactory
667 r.drawRNA(vp.getConfig());
668 String name = r.getName();
671 name = path.substring(path
672 .lastIndexOf(File.separatorChar) + 1);
676 name += " (Model " + mn++ + ")";
678 _rnaList.add(vp.getConfig().clone(), r, name, true);
685 // If we made it this far, everything worked.
686 dtde.dropComplete(true);
690 // Hmm, the user must not have dropped a file list
692 } catch (Exception e)
700 public void dropActionChanged(DropTargetDragEvent arg0)
704 private class BackupHolder
706 private DefaultListModel _rnaList;
708 private ArrayList<RNA> _rnas = new ArrayList<RNA>();
712 public BackupHolder(DefaultListModel rnaList, JList l)
718 public void add(VARNAConfig c, RNA r)
720 add(c, r, r.getName(), false);
723 public void add(VARNAConfig c, RNA r, boolean select)
725 add(c, r, r.getName(), select);
728 public void add(VARNAConfig c, RNA r, String name)
730 add(c, r, name, false);
733 public void add(VARNAConfig c, RNA r, String name, boolean select)
737 _l.removeSelectionInterval(0, _rnaList.size());
741 name = generateDefaultName();
743 FullBackup bck = new FullBackup(c, r, name);
745 _rnaList.add(0, bck);
748 _l.setSelectedIndex(0);
752 public void remove(int i)
759 public DefaultListModel getModel()
764 public boolean contains(RNA r)
766 return _rnas.contains(r);
770 * public int getSize() { return _rnaList.getSize(); }
772 public FullBackup getElementAt(int i)
774 return (FullBackup) _rnaList.getElementAt(i);
777 public void removeSelected()
779 int i = _l.getSelectedIndex();
782 if (_rnaList.getSize() == 1)
788 } catch (ExceptionUnmatchedClosingParentheses e1)
790 } catch (ExceptionFileFormatOrSyntax e1)
799 if (newi == _rnaList.getSize())
801 newi = _rnaList.getSize() - 2;
803 FullBackup bck = (FullBackup) _rnaList.getElementAt(newi);
804 _l.setSelectedValue(bck, true);
812 public void onLayoutChanged()
814 // TODO Auto-generated method stub
818 public void onUINewStructure(VARNAConfig v, RNA r)
820 // patch to fix infinite loop
821 // The problem is that onUINewStructure is called when user clicks
822 // check with Yann about whether Jalview should do anything with this event.
823 // e.g. if user has used VARNA's menu to import a structure .. Jalview may
824 // need to be told which structure is displayed.
826 // _rnaList.add(v, r, "", true);
829 public void onWarningEmitted(String s)
833 public void mouseClicked(MouseEvent e)
835 if (e.getClickCount() == 2)
837 int index = _sideList.locationToIndex(e.getPoint());
838 ListModel dlm = _sideList.getModel();
839 FullBackup item = (FullBackup) dlm.getElementAt(index);
841 _sideList.ensureIndexIsVisible(index);
843 * TODO Object newName = JOptionPane.showInputDialog( this,
844 * "Specify a new name for this RNA", "Rename RNA",
845 * JOptionPane.QUESTION_MESSAGE, (Icon)null, null, item.toString()); if
846 * (newName!=null) { item.name = newName.toString();
847 * this._sideList.repaint(); }
852 public void mouseEntered(MouseEvent arg0)
856 public void mouseExited(MouseEvent arg0)
860 public void mousePressed(MouseEvent arg0)
864 public void mouseReleased(MouseEvent arg0)
869 public String[] getPdbFile()
875 public void releaseReferences(Object svl)
880 public void updateColours(Object source)
885 public void componentHidden(ComponentEvent e)
890 public void componentMoved(ComponentEvent e)
895 public void componentResized(ComponentEvent e)
900 public void componentShown(ComponentEvent e)
905 public void onStructureRedrawn()
910 public void onZoomLevelChanged()
915 public void onTranslationChanged()
920 public void highlightAtoms(List<AtomSpec> atoms)