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 java.awt.BorderLayout;
24 import java.awt.Color;
25 import java.awt.Component;
26 import java.awt.Dimension;
28 import java.awt.GridLayout;
29 import java.awt.datatransfer.DataFlavor;
30 import java.awt.datatransfer.Transferable;
31 import java.awt.dnd.DnDConstants;
32 import java.awt.dnd.DropTarget;
33 import java.awt.dnd.DropTargetDragEvent;
34 import java.awt.dnd.DropTargetDropEvent;
35 import java.awt.dnd.DropTargetEvent;
36 import java.awt.dnd.DropTargetListener;
37 import java.awt.event.ActionEvent;
38 import java.awt.event.ActionListener;
39 import java.awt.event.ComponentEvent;
40 import java.awt.event.MouseEvent;
41 import java.awt.event.MouseListener;
43 import java.util.ArrayList;
44 import java.util.Collection;
45 import java.util.List;
47 import javax.swing.DefaultListModel;
48 import javax.swing.DefaultListSelectionModel;
49 import javax.swing.JButton;
50 import javax.swing.JLabel;
51 import javax.swing.JList;
52 import javax.swing.JPanel;
53 import javax.swing.JScrollPane;
54 import javax.swing.JTextField;
55 import javax.swing.ListModel;
56 import javax.swing.ListSelectionModel;
57 import javax.swing.event.ListSelectionEvent;
58 import javax.swing.event.ListSelectionListener;
60 import fr.orsay.lri.varna.VARNAPanel;
61 import fr.orsay.lri.varna.components.ReorderableJList;
62 import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
63 import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
64 import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength;
65 import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
66 import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;
67 import fr.orsay.lri.varna.models.FullBackup;
68 import fr.orsay.lri.varna.models.VARNAConfig;
69 import fr.orsay.lri.varna.models.rna.Mapping;
70 import fr.orsay.lri.varna.models.rna.RNA;
72 import jalview.datamodel.SequenceI;
73 import jalview.structure.AtomSpec;
74 import jalview.util.MessageManager;
76 public class AppVarnaBinding extends jalview.ext.varna.JalviewVarnaBinding
77 implements DropTargetListener, InterfaceVARNAListener,
84 // private static final long serialVersionUID = -790155708306987257L;
86 private String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA";
88 private String DEFAULT_STRUCTURE1 = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...)))))..";
90 private String DEFAULT_STRUCTURE2 = "..(((((...(((((...(((((........(((((...(((((.....)))))...)))))..................))))).....)))))...)))))..";
94 protected JPanel _tools = new JPanel();
96 private JPanel _input = new JPanel();
98 private JPanel _seqPanel = new JPanel();
100 private JPanel _strPanel = new JPanel();
102 private JLabel _info = new JLabel();
104 private JTextField _str = new JTextField();
106 private JTextField _seq = new JTextField();
108 private JLabel _strLabel = new JLabel(
109 MessageManager.getString("label.str"));
111 private JLabel _seqLabel = new JLabel(
112 MessageManager.getString("label.seq"));
114 private JButton _createButton = new JButton(
115 MessageManager.getString("action.create"));
117 private JButton _updateButton = new JButton(
118 MessageManager.getString("action.update"));
120 private JButton _deleteButton = new JButton(
121 MessageManager.getString("action.delete"));
123 private JButton _duplicateButton = new JButton(
124 MessageManager.getString("action.snapshot"));
126 protected JPanel _listPanel = new JPanel();
128 private ReorderableJList _sideList = null;
130 private static String errorOpt = "error";
132 @SuppressWarnings("unused")
133 private boolean _error;
135 private Color _backgroundColor = Color.white;
137 private static int _nextID = 1;
139 @SuppressWarnings("unused")
140 private int _algoCode;
142 private BackupHolder _rnaList;
145 * public AppVarnaBinding() { //super("VARNA in Jalview");
146 * //this.set_seq("ATGC"); //this.set_str(".()."); //RNAPanelDemoInit();
148 * //initVarna("ATGCATGATATATATATAT","....((((...))))....");
149 * initVarna(this.DEFAULT_SEQUENCE,this.DEFAULT_STRUCTURE1); }
152 public AppVarnaBinding(String seq, String struc)
154 // super("VARNA in Jalview");
155 initVarna(seq, struc);
159 public AppVarnaBinding(ArrayList<RNA> rnaList)
162 // super("VARNA in Jalview");
163 initVarnaEdit(rnaList);
166 private void initVarna(String seq, String str)
169 DefaultListModel dlm = new DefaultListModel();
171 DefaultListSelectionModel m = new DefaultListSelectionModel();
172 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
173 m.setLeadAnchorNotificationEnabled(false);
175 _sideList = new ReorderableJList();
176 _sideList.setModel(dlm);
177 _sideList.addMouseListener(this);
178 _sideList.setSelectionModel(m);
179 _sideList.setPreferredSize(new Dimension(100, 0));
180 _sideList.addListSelectionListener(new ListSelectionListener()
182 public void valueChanged(ListSelectionEvent arg0)
184 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
186 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
187 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
188 .getSize(), sel.rna.getSize());
189 vp.showRNAInterpolated(sel.rna, sel.config, map);
190 _seq.setText(sel.rna.getSeq());
191 _str.setText(sel.rna.getStructDBN());
196 _rnaList = new BackupHolder(dlm, _sideList);
197 RNA _RNA1 = new RNA("User defined 1");
202 vp = new VARNAPanel("0", ".");
203 _RNA1.setRNA(seq, str);
204 _RNA1.drawRNARadiate(vp.getConfig());
205 } catch (ExceptionNonEqualLength e)
208 } catch (ExceptionUnmatchedClosingParentheses e2)
210 e2.printStackTrace();
211 } catch (ExceptionFileFormatOrSyntax e3)
213 e3.printStackTrace();
215 vp.setPreferredSize(new Dimension(400, 400));
216 _rnaList.add(vp.getConfig().clone(), _RNA1, generateDefaultName(), true);
218 // TODO setBackground(_backgroundColor);
219 vp.setBackground(_backgroundColor);
221 // TODO getContentPane().setLayout(new BorderLayout());
222 // TODO getContentPane().add(vp, BorderLayout.CENTER);
225 vp.addVARNAListener(this);
228 private void initVarnaEdit(ArrayList<RNA> rnaInList)
231 DefaultListModel dlm = new DefaultListModel();
233 int marginTools = 40;
235 DefaultListSelectionModel m = new DefaultListSelectionModel();
236 m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
237 m.setLeadAnchorNotificationEnabled(false);
239 _sideList = new ReorderableJList();
240 _sideList.setModel(dlm);
241 _sideList.addMouseListener(this);
242 _sideList.setSelectionModel(m);
243 _sideList.setPreferredSize(new Dimension(100, 0));
244 _sideList.addListSelectionListener(new ListSelectionListener()
246 public void valueChanged(ListSelectionEvent arg0)
248 // System.out.println(arg0);
249 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
251 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
252 Mapping map = Mapping.DefaultOutermostMapping(vp.getRNA()
253 .getSize(), sel.rna.getSize());
254 // vp.showRNAInterpolated(sel.rna, sel.config, map);
255 vp.showRNA(sel.rna, sel.config);
256 // _seq.setText(sel.rna.getSeq());
257 _str.setText(sel.rna.getStructDBN());
261 _rnaList = new BackupHolder(dlm, _sideList);
266 vp = new VARNAPanel("0", ".");
267 for (int i = 0; i < rnaInList.size(); i++)
269 rnaInList.get(i).drawRNARadiate(vp.getConfig());
272 } catch (ExceptionNonEqualLength e)
276 vp.setPreferredSize(new Dimension(400, 400));
277 for (int i = 0; i < rnaInList.size(); i++)
279 if (i < rnaInList.size() - 1)
281 _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
286 _rnaList.add(vp.getConfig().clone(), rnaInList.get(i), rnaInList
287 .get(i).getName(), true);
292 * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
293 * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
296 JScrollPane listScroller = new JScrollPane(_sideList);
297 listScroller.setPreferredSize(new Dimension(150, 0));
299 vp.setBackground(_backgroundColor);
301 Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
303 // _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
304 // _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
305 _seq.setFont(textFieldsFont);
306 _seq.setText(rnaInList.get(0).getSeq());
308 _updateButton.addActionListener(new ActionListener()
310 public void actionPerformed(ActionEvent e)
312 FullBackup sel = (FullBackup) _sideList.getSelectedValue();
313 sel.rna.setSequence("A");
317 // _seqPanel.setLayout(new BorderLayout());
318 // _seqPanel.add(_seqLabel, BorderLayout.WEST);
319 // _seqPanel.add(_seq, BorderLayout.CENTER);
321 _strLabel.setPreferredSize(new Dimension(marginTools, 15));
322 _strLabel.setHorizontalTextPosition(JLabel.LEFT);
323 _str.setFont(textFieldsFont);
324 _strPanel.setLayout(new BorderLayout());
325 _strPanel.add(_strLabel, BorderLayout.WEST);
326 _strPanel.add(_str, BorderLayout.CENTER);
328 _input.setLayout(new GridLayout(1, 0));
329 // _input.add(_seqPanel);
330 _input.add(_strPanel);
332 JPanel goPanel = new JPanel();
333 goPanel.setLayout(new BorderLayout());
335 _tools.setLayout(new BorderLayout());
336 _tools.add(_input, BorderLayout.CENTER);
337 // _tools.add(_info, BorderLayout.SOUTH);
338 _tools.add(goPanel, BorderLayout.EAST);
341 * _deleteButton.addActionListener(new ActionListener() { public void
342 * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
343 * _duplicateButton.addActionListener(new ActionListener() { public void
344 * actionPerformed(ActionEvent e) {
345 * _rnaList.add((VARNAConfig)vp.getConfig().
346 * clone(),vp.getRNA().clone(),vp.getRNA
347 * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
348 * Date()),true); }});
350 goPanel.add(_updateButton, BorderLayout.CENTER);
352 JPanel ops = new JPanel();
353 ops.setLayout(new GridLayout(1, 2));
354 ops.add(_deleteButton);
355 ops.add(_duplicateButton);
357 JLabel j = new JLabel(
358 MessageManager.getString("label.structures_manager"),
360 _listPanel.setLayout(new BorderLayout());
362 // _listPanel.add(ops, BorderLayout.SOUTH);
363 _listPanel.add(j, BorderLayout.NORTH);
364 _listPanel.add(listScroller, BorderLayout.CENTER);
366 // JSplitPane split = new
367 // JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
369 * TODO getContentPane().setLayout(new BorderLayout());
370 * getContentPane().add(split, BorderLayout.CENTER);
371 * getContentPane().add(_tools, BorderLayout.NORTH);
374 // TODO setVisible(true);
375 DropTarget dt = new DropTarget(vp, this);
377 vp.addVARNAListener(this);
380 public JPanel getTools()
385 public JPanel getListPanel()
391 * TODO: Is it effective to transfer the whole RNA?
393 * @return Currently selected RNA
395 public RNA getSelectedRNA()
397 return _rnaList.getElementAt(_sideList.getSelectedIndex()).rna;
401 * Substitute currently selected RNA with the edited one
405 public void updateSelectedRNA(RNA rnaEdit)
412 * private void RNAPanelDemoInit() { DefaultListModel dlm = new
413 * DefaultListModel();
416 * int marginTools = 40;
418 * DefaultListSelectionModel m = new DefaultListSelectionModel();
419 * m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
420 * m.setLeadAnchorNotificationEnabled(false);
423 * _sideList = new ReorderableJList(); _sideList.setModel(dlm);
424 * _sideList.addMouseListener(this); _sideList.setSelectionModel(m);
425 * _sideList.setPreferredSize(new Dimension(100, 0));
426 * _sideList.addListSelectionListener( new ListSelectionListener(){ public
427 * void valueChanged(ListSelectionEvent arg0) { //System.out.println(arg0); if
428 * (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting()) { FullBackup
429 * sel = (FullBackup) _sideList.getSelectedValue(); Mapping map =
430 * Mapping.DefaultOutermostMapping(vp.getRNA().getSize(), sel.rna.getSize());
431 * vp.showRNAInterpolated(sel.rna,sel.config,map);
432 * _seq.setText(sel.rna.getSeq()); _str.setText(sel.rna.getStructDBN()); } }
435 * _rnaList = new BackupHolder(dlm,_sideList); RNA _RNA1 = new
436 * RNA("User defined 1"); RNA _RNA2 = new RNA("User defined 2"); try { vp =
437 * new VARNAPanel("0","."); _RNA1.setRNA(DEFAULT_SEQUENCE,
438 * DEFAULT_STRUCTURE1); _RNA1.drawRNARadiate(vp.getConfig());
439 * _RNA2.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE2);
440 * _RNA2.drawRNARadiate(vp.getConfig()); } catch (ExceptionNonEqualLength e) {
441 * vp.errorDialog(e); } catch (ExceptionUnmatchedClosingParentheses e2) {
442 * e2.printStackTrace(); } catch (ExceptionFileFormatOrSyntax e3) {
443 * e3.printStackTrace(); } vp.setPreferredSize(new Dimension(400, 400));
444 * _rnaList.add(vp.getConfig().clone(),_RNA2,generateDefaultName());
445 * _rnaList.add(vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
447 * JScrollPane listScroller = new JScrollPane(_sideList);
448 * listScroller.setPreferredSize(new Dimension(150, 0));
450 * setBackground(_backgroundColor); vp.setBackground(_backgroundColor);
453 * Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
455 * _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
456 * _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
457 * _seq.setFont(textFieldsFont); _seq.setText(DEFAULT_SEQUENCE);
459 * _createButton.addActionListener(new ActionListener() { public void
460 * actionPerformed(ActionEvent e) { try { RNA nRNA = new
461 * RNA(generateDefaultName()); nRNA.setRNA(_seq.getText(), _str.getText());
462 * nRNA.drawRNARadiate(vp.getConfig()); _rnaList.add(new
463 * VARNAConfig(),nRNA,true); } catch (ExceptionUnmatchedClosingParentheses e1)
464 * { JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
465 * JOptionPane.ERROR_MESSAGE); } catch (ExceptionFileFormatOrSyntax e1) {
466 * JOptionPane.showMessageDialog(vp, e1.getMessage(),"Error",
467 * JOptionPane.ERROR_MESSAGE); } } });
470 * _seqPanel.setLayout(new BorderLayout()); _seqPanel.add(_seqLabel,
471 * BorderLayout.WEST); _seqPanel.add(_seq, BorderLayout.CENTER);
473 * _strLabel.setPreferredSize(new Dimension(marginTools, 15));
474 * _strLabel.setHorizontalTextPosition(JLabel.LEFT);
475 * _str.setFont(textFieldsFont); _strPanel.setLayout(new BorderLayout());
476 * _strPanel.add(_strLabel, BorderLayout.WEST); _strPanel.add(_str,
477 * BorderLayout.CENTER);
479 * _input.setLayout(new GridLayout(2, 0)); _input.add(_seqPanel);
480 * _input.add(_strPanel);
482 * JPanel goPanel = new JPanel(); goPanel.setLayout(new BorderLayout());
484 * _tools.setLayout(new BorderLayout()); _tools.add(_input,
485 * BorderLayout.CENTER); _tools.add(_info, BorderLayout.SOUTH);
486 * _tools.add(goPanel, BorderLayout.EAST);
488 * _deleteButton.addActionListener(new ActionListener() { public void
489 * actionPerformed(ActionEvent e) { _rnaList.removeSelected(); } });
490 * _duplicateButton.addActionListener(new ActionListener() { public void
491 * actionPerformed(ActionEvent e) {
492 * _rnaList.add((VARNAConfig)vp.getConfig().clone
493 * (),vp.getRNA().clone(),vp.getRNA
494 * ().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new
495 * Date()),true); }});
497 * JPanel ops = new JPanel(); ops.setLayout(new GridLayout(1,2));
498 * ops.add(_deleteButton); ops.add(_duplicateButton);
500 * JLabel j = new JLabel("Structures Manager",JLabel.CENTER);
501 * _listPanel.setLayout(new BorderLayout());
503 * _listPanel.add(ops,BorderLayout.SOUTH);
504 * _listPanel.add(j,BorderLayout.NORTH);
505 * _listPanel.add(listScroller,BorderLayout.CENTER);
507 * goPanel.add(_createButton, BorderLayout.CENTER);
509 * JSplitPane split = new
510 * JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,vp);
511 * getContentPane().setLayout(new BorderLayout()); getContentPane().add(split,
512 * BorderLayout.CENTER); getContentPane().add(_tools, BorderLayout.NORTH);
514 * setVisible(true); DropTarget dt = new DropTarget(vp, this);
516 * vp.addVARNAListener(this); }
518 public static String generateDefaultName()
520 return "User file #" + _nextID++;
525 return (RNA) _sideList.getSelectedValue();
528 public String[][] getParameterInfo()
532 // Parameter Name Kind of Value Description,
533 { "sequenceDBN", "String", "A raw RNA sequence" },
534 { "structureDBN", "String",
535 "An RNA structure in dot bracket notation (DBN)" },
536 { errorOpt, "boolean", "To show errors" }, };
542 vp.setBackground(_backgroundColor);
546 @SuppressWarnings("unused")
547 private Color getSafeColor(String col, Color def)
552 result = Color.decode(col);
553 } catch (Exception e)
557 result = Color.getColor(col, def);
558 } catch (Exception e2)
566 public VARNAPanel get_varnaPanel()
571 public void set_varnaPanel(VARNAPanel surface)
576 public String get_seq()
578 return _seq.getText();
581 public void set_seq(String _seq)
583 this._seq.setText(_seq);
586 public String get_str()
588 return _str.getText();
591 public void set_str(String _str)
593 this._str.setText(_str);
596 public JLabel get_info()
601 public void set_info(JLabel _info)
607 * public static void main(String[] args) { AppVarnaBinding d = new
608 * AppVarnaBinding(); d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
609 * d.pack(); d.setVisible(true); }
612 public void dragEnter(DropTargetDragEvent arg0)
614 // TODO Auto-generated method stub
618 public void dragExit(DropTargetEvent arg0)
620 // TODO Auto-generated method stub
624 public void dragOver(DropTargetDragEvent arg0)
626 // TODO Auto-generated method stub
630 public void drop(DropTargetDropEvent dtde)
634 Transferable tr = dtde.getTransferable();
635 DataFlavor[] flavors = tr.getTransferDataFlavors();
636 for (int i = 0; i < flavors.length; i++)
638 if (flavors[i].isFlavorJavaFileListType())
640 dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
641 Object ob = tr.getTransferData(flavors[i]);
642 if (ob instanceof List)
644 List list = (List) ob;
645 for (int j = 0; j < list.size(); j++)
647 Object o = list.get(j);
649 if (dtde.getSource() instanceof DropTarget)
651 DropTarget dt = (DropTarget) dtde.getSource();
652 Component c = dt.getComponent();
653 if (c instanceof VARNAPanel)
655 String path = o.toString();
656 VARNAPanel vp = (VARNAPanel) c;
659 FullBackup bck = VARNAPanel.importSession(path);
660 _rnaList.add(bck.config, bck.rna, bck.name, true);
661 } catch (ExceptionLoadingFailed e3)
664 Collection<RNA> mdls = fr.orsay.lri.varna.factories.RNAFactory
668 r.drawRNA(vp.getConfig());
669 String name = r.getName();
672 name = path.substring(path
673 .lastIndexOf(File.separatorChar) + 1);
677 name += " (Model " + mn++ + ")";
679 _rnaList.add(vp.getConfig().clone(), r, name, true);
686 // If we made it this far, everything worked.
687 dtde.dropComplete(true);
691 // Hmm, the user must not have dropped a file list
693 } catch (Exception e)
701 public void dropActionChanged(DropTargetDragEvent arg0)
705 private class BackupHolder
707 private DefaultListModel _rnaList;
709 private ArrayList<RNA> _rnas = new ArrayList<RNA>();
713 public BackupHolder(DefaultListModel rnaList, JList l)
719 public void add(VARNAConfig c, RNA r)
721 add(c, r, r.getName(), false);
724 public void add(VARNAConfig c, RNA r, boolean select)
726 add(c, r, r.getName(), select);
729 public void add(VARNAConfig c, RNA r, String name)
731 add(c, r, name, false);
734 public void add(VARNAConfig c, RNA r, String name, boolean select)
738 _l.removeSelectionInterval(0, _rnaList.size());
742 name = generateDefaultName();
744 FullBackup bck = new FullBackup(c, r, name);
746 _rnaList.add(0, bck);
749 _l.setSelectedIndex(0);
753 public void remove(int i)
760 public DefaultListModel getModel()
765 public boolean contains(RNA r)
767 return _rnas.contains(r);
771 * public int getSize() { return _rnaList.getSize(); }
773 public FullBackup getElementAt(int i)
775 return (FullBackup) _rnaList.getElementAt(i);
778 public void removeSelected()
780 int i = _l.getSelectedIndex();
783 if (_rnaList.getSize() == 1)
789 } catch (ExceptionUnmatchedClosingParentheses e1)
791 } catch (ExceptionFileFormatOrSyntax e1)
800 if (newi == _rnaList.getSize())
802 newi = _rnaList.getSize() - 2;
804 FullBackup bck = (FullBackup) _rnaList.getElementAt(newi);
805 _l.setSelectedValue(bck, true);
813 public void onLayoutChanged()
815 // TODO Auto-generated method stub
819 public void onUINewStructure(VARNAConfig v, RNA r)
821 // patch to fix infinite loop
822 // The problem is that onUINewStructure is called when user clicks
823 // check with Yann about whether Jalview should do anything with this event.
824 // e.g. if user has used VARNA's menu to import a structure .. Jalview may
825 // need to be told which structure is displayed.
827 // _rnaList.add(v, r, "", true);
830 public void onWarningEmitted(String s)
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)
857 public void mouseExited(MouseEvent arg0)
861 public void mousePressed(MouseEvent arg0)
865 public void mouseReleased(MouseEvent arg0)
870 public String[] getPdbFile()
876 public void releaseReferences(Object svl)
881 public void updateColours(Object source)
886 public void componentHidden(ComponentEvent e)
891 public void componentMoved(ComponentEvent e)
896 public void componentResized(ComponentEvent e)
901 public void componentShown(ComponentEvent e)
906 public void onStructureRedrawn()
911 public void onZoomLevelChanged()
916 public void onTranslationChanged()
921 public void highlightAtoms(List<AtomSpec> atoms)
926 public boolean isListeningFor(SequenceI seq)