665e9fc65f92293381b4b0f264a9a5a07bdac854
[jalview.git] / srcjar / fr / orsay / lri / varna / applications / VARNAEditor.java
1 /*
2  VARNA is a tool for the automated drawing, visualization and annotation of the secondary structure of RNA, designed as a companion software for web servers and databases.
3  Copyright (C) 2008  Kevin Darty, Alain Denise and Yann Ponty.
4  electronic mail : Yann.Ponty@lri.fr
5  paper mail : LRI, bat 490 Université Paris-Sud 91405 Orsay Cedex France
6
7  This file is part of VARNA version 3.1.
8  VARNA version 3.1 is free software: you can redistribute it and/or 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.
10
11  VARNA version 3.1 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  See the GNU General Public License for more details.
14
15  You should have received a copy of the GNU General Public License along with VARNA version 3.1.
16  If not, see http://www.gnu.org/licenses.
17  */
18 package fr.orsay.lri.varna.applications;
19
20 import java.awt.BorderLayout;
21 import java.awt.Color;
22 import java.awt.Component;
23 import java.awt.Dimension;
24 import java.awt.Font;
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.MouseEvent;
37 import java.awt.event.MouseListener;
38 import java.awt.geom.Point2D.Double;
39 import java.io.File;
40 import java.text.DateFormat;
41 import java.util.ArrayList;
42 import java.util.Collection;
43 import java.util.Date;
44 import java.util.Hashtable;
45 import java.util.List;
46 import java.util.Set;
47
48 import javax.swing.DefaultListModel;
49 import javax.swing.DefaultListSelectionModel;
50 import javax.swing.Icon;
51 import javax.swing.JButton;
52 import javax.swing.JFrame;
53 import javax.swing.JLabel;
54 import javax.swing.JList;
55 import javax.swing.JOptionPane;
56 import javax.swing.JPanel;
57 import javax.swing.JScrollPane;
58 import javax.swing.JSplitPane;
59 import javax.swing.JTextField;
60 import javax.swing.ListModel;
61 import javax.swing.ListSelectionModel;
62 import javax.swing.UIManager;
63 import javax.swing.UnsupportedLookAndFeelException;
64 import javax.swing.event.ListSelectionEvent;
65 import javax.swing.event.ListSelectionListener;
66 import javax.swing.text.BadLocationException;
67 import javax.swing.text.DefaultHighlighter;
68
69 import fr.orsay.lri.varna.VARNAPanel;
70 import fr.orsay.lri.varna.components.ReorderableJList;
71 import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
72 import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
73 import fr.orsay.lri.varna.exceptions.ExceptionNonEqualLength;
74 import fr.orsay.lri.varna.exceptions.ExceptionUnmatchedClosingParentheses;
75 import fr.orsay.lri.varna.factories.RNAFactory;
76 import fr.orsay.lri.varna.interfaces.InterfaceVARNAListener;
77 import fr.orsay.lri.varna.interfaces.InterfaceVARNARNAListener;
78 import fr.orsay.lri.varna.interfaces.InterfaceVARNASelectionListener;
79 import fr.orsay.lri.varna.models.BaseList;
80 import fr.orsay.lri.varna.models.FullBackup;
81 import fr.orsay.lri.varna.models.VARNAConfig;
82 import fr.orsay.lri.varna.models.rna.Mapping;
83 import fr.orsay.lri.varna.models.rna.ModeleBP;
84 import fr.orsay.lri.varna.models.rna.ModeleBase;
85 import fr.orsay.lri.varna.models.rna.RNA;
86
87 public class VARNAEditor extends JFrame implements DropTargetListener, InterfaceVARNAListener, MouseListener {
88
89         /**
90          * 
91          */
92 //      private static final_long serialVersionUID = -790155708306987257L;
93
94         private static final String DEFAULT_SEQUENCE = "CAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIACAGCACGACACUAGCAGUCAGUGUCAGACUGCAIA";
95
96         private static final String DEFAULT_STRUCTURE1 = "..(((((...(((((...(((((...(((((.....)))))...))))).....(((((...(((((.....)))))...))))).....)))))...)))))..";
97         private static final String DEFAULT_STRUCTURE2 = "..(((((...(((((...(((((........(((((...(((((.....)))))...)))))..................))))).....)))))...)))))..";
98         // private static final String DEFAULT_STRUCTURE1 = "((((....))))";
99         // private static final String DEFAULT_STRUCTURE2 =
100         // "((((..(((....)))..))))";
101
102         private VARNAPanel _vp;
103
104         private JPanel _tools = new JPanel();
105         private JPanel _input = new JPanel();
106
107         private JPanel _seqPanel = new JPanel();
108         private JPanel _strPanel = new JPanel();
109         private JLabel _info = new JLabel();
110         
111         private JTextField _str = new JTextField(DEFAULT_STRUCTURE1);
112         Object _hoverHighlightStr = null;
113         ArrayList<Object> _selectionHighlightStr = new ArrayList<Object>();
114         
115         private JTextField _seq = new JTextField(DEFAULT_SEQUENCE);
116         Object _hoverHighlightSeq = null;
117         ArrayList<Object> _selectionHighlightSeq = new ArrayList<Object>();
118         
119         
120         private JLabel _strLabel = new JLabel(" Str:");
121         private JLabel _seqLabel = new JLabel(" Seq:");
122         private JButton _deleteButton = new JButton("Delete");
123         private JButton _duplicateButton = new JButton("Duplicate");
124         
125         private JPanel _listPanel = new JPanel();
126         private ReorderableJList _sideList = null;
127
128
129
130         private static String errorOpt = "error";
131         @SuppressWarnings("unused")
132         private boolean _error;
133
134         private Color _backgroundColor = Color.white;
135
136         private static int _nextID = 1;
137         @SuppressWarnings("unused")
138         private int _algoCode;
139         
140         private BackupHolder _rnaList;
141
142
143         public VARNAEditor() {
144                 super("VARNA Editor");
145                 RNAPanelDemoInit();
146         }
147
148         private void RNAPanelDemoInit() 
149         {
150             DefaultListModel dlm = new DefaultListModel(); 
151             
152
153                 int marginTools = 40;
154
155             DefaultListSelectionModel m = new DefaultListSelectionModel();
156             m.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
157             m.setLeadAnchorNotificationEnabled(false);
158             
159             
160                 _sideList = new ReorderableJList();
161                 _sideList.setModel(dlm);
162                 _sideList.addMouseListener(this);
163             _sideList.setSelectionModel(m);
164             _sideList.setPreferredSize(new Dimension(100, 0));
165             _sideList.addListSelectionListener( new ListSelectionListener(){
166                         public void valueChanged(ListSelectionEvent arg0) {
167                                 //System.out.println(arg0);
168                                 if (!_sideList.isSelectionEmpty() && !arg0.getValueIsAdjusting())
169                                 {
170                                         FullBackup  sel = (FullBackup) _sideList.getSelectedValue();
171                                         Mapping map = Mapping.DefaultOutermostMapping(_vp.getRNA().getSize(), sel.rna.getSize());
172                                         _vp.showRNAInterpolated(sel.rna,sel.config,map);
173                                         _seq.setText(sel.rna.getSeq());
174                                         _str.setText(sel.rna.getStructDBN(true));
175                                 }
176                         }
177             });
178
179             _rnaList = new BackupHolder(dlm,_sideList);
180                 RNA _RNA1 = new RNA("User defined 1");
181                 RNA _RNA2 = new RNA("User defined 2");
182                 try {
183                         _vp = new VARNAPanel("0",".");
184                         _RNA1.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE1);
185                         _RNA1.drawRNARadiate(_vp.getConfig());
186                         _RNA2.setRNA(DEFAULT_SEQUENCE, DEFAULT_STRUCTURE2);
187                         _RNA2.drawRNARadiate(_vp.getConfig());
188                 } catch (ExceptionNonEqualLength e) {
189                         _vp.errorDialog(e);
190                 } catch (ExceptionUnmatchedClosingParentheses e2) {
191                 e2.printStackTrace();
192                 } catch (ExceptionFileFormatOrSyntax e3) {
193                 e3.printStackTrace();
194                 }
195                 _vp.setPreferredSize(new Dimension(400, 400));
196             _rnaList.add(_vp.getConfig().clone(),_RNA2,generateDefaultName());
197             _rnaList.add(_vp.getConfig().clone(),_RNA1,generateDefaultName(),true);
198
199             JScrollPane listScroller = new JScrollPane(_sideList);
200             listScroller.setPreferredSize(new Dimension(150, 0));
201
202                 setBackground(_backgroundColor);
203                 _vp.setBackground(_backgroundColor);
204
205
206                 Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12");
207
208                 _seqLabel.setHorizontalTextPosition(JLabel.LEFT);
209                 _seqLabel.setPreferredSize(new Dimension(marginTools, 15));
210                 _seq.setFont(textFieldsFont);
211                 _seq.setText(DEFAULT_SEQUENCE);
212                 _seq.setEditable(false);
213                 
214
215                 _seqPanel.setLayout(new BorderLayout());
216                 _seqPanel.add(_seqLabel, BorderLayout.WEST);
217                 _seqPanel.add(_seq, BorderLayout.CENTER);
218
219                 _strLabel.setPreferredSize(new Dimension(marginTools, 15));
220                 _strLabel.setHorizontalTextPosition(JLabel.LEFT);
221                 _str.setFont(textFieldsFont);
222                 _str.setEditable(false);
223                 _strPanel.setLayout(new BorderLayout());
224                 _strPanel.add(_strLabel, BorderLayout.WEST);
225                 _strPanel.add(_str, BorderLayout.CENTER);
226
227                 _input.setLayout(new GridLayout(2, 0));
228                 _input.add(_seqPanel);
229                 _input.add(_strPanel);
230
231
232                 _tools.setLayout(new BorderLayout());
233                 _tools.add(_input, BorderLayout.CENTER);
234                 _tools.add(_info, BorderLayout.SOUTH);
235
236                 _deleteButton.addActionListener(new ActionListener() {
237                         public void actionPerformed(ActionEvent e) {
238                                 _rnaList.removeSelected();
239                         }
240                 });
241 //              _duplicateButton.addActionListener(new ActionListener() {
242 //                      public void actionPerformed(ActionEvent e) {
243 //                                      _rnaList.add((VARNAConfig)_vp.getConfig().clone(),_vp.getRNA().clone(),_vp.getRNA().getName()+"-"+DateFormat.getTimeInstance(DateFormat.LONG).format(new Date()),true); 
244 //                      }});
245                 
246                 JPanel ops = new JPanel();
247                 ops.setLayout(new GridLayout(1,2));
248                 ops.add(_deleteButton);
249                 ops.add(_duplicateButton);
250
251                 JLabel j = new JLabel("Structures",JLabel.CENTER);
252                 _listPanel.setLayout(new BorderLayout());
253                 
254                 _listPanel.add(ops,BorderLayout.SOUTH);
255                 _listPanel.add(j,BorderLayout.NORTH);
256                 _listPanel.add(listScroller,BorderLayout.CENTER);
257
258
259                 JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,_listPanel,_vp);
260                 getContentPane().setLayout(new BorderLayout());
261                 getContentPane().add(split, BorderLayout.CENTER);
262                 getContentPane().add(_tools, BorderLayout.NORTH);
263
264                 setVisible(true);
265                 DropTarget dt = new DropTarget(_vp, this);
266                 
267                 _vp.addRNAListener(new InterfaceVARNARNAListener(){
268                         public void onSequenceModified(int index, String oldseq, String newseq) {
269                                 _seq.setText(_vp.getRNA().getSeq());
270                         }
271
272                         public void onStructureModified(Set<ModeleBP> current,
273                                         Set<ModeleBP> addedBasePairs, Set<ModeleBP> removedBasePairs) {
274                                 _str.setText(_vp.getRNA().getStructDBN(true));
275                         }
276
277                         public void onRNALayoutChanged(Hashtable<Integer, Double> previousPositions) {
278                         }
279                         
280                 });
281                 
282                 _vp.addSelectionListener(new InterfaceVARNASelectionListener(){
283
284                         public void onHoverChanged(ModeleBase oldbase, ModeleBase newBase) {
285                                 if (_hoverHighlightSeq!=null)
286                                 {
287                                         _seq.getHighlighter().removeHighlight(_hoverHighlightSeq);
288                                         _hoverHighlightSeq = null;
289                                 }
290                                 if (_hoverHighlightStr!=null)
291                                 {
292                                         _str.getHighlighter().removeHighlight(_hoverHighlightStr);
293                                         _hoverHighlightStr = null;
294                                 }
295                                 if (newBase!=null)
296                                 {
297                                         try {
298                                                 _hoverHighlightSeq = _seq.getHighlighter().addHighlight(newBase.getIndex(), newBase.getIndex()+1, new DefaultHighlighter.DefaultHighlightPainter(Color.green) );
299                                                 _hoverHighlightStr = _str.getHighlighter().addHighlight(newBase.getIndex(), newBase.getIndex()+1, new DefaultHighlighter.DefaultHighlightPainter(Color.green) );
300                                         } catch (BadLocationException e) {
301                                                 e.printStackTrace();
302                                         }
303                                 }
304                         }
305
306                         public void onSelectionChanged(BaseList selection,
307                                         BaseList addedBases, BaseList removedBases) {
308                                 for(Object tag: _selectionHighlightSeq)
309                                 {
310                                         _seq.getHighlighter().removeHighlight(tag);
311                                 }
312                                 _selectionHighlightSeq.clear();
313                                 for(Object tag: _selectionHighlightStr)
314                                 {
315                                         _str.getHighlighter().removeHighlight(tag);
316                                 }
317                                 _selectionHighlightStr.clear();
318                                 for (ModeleBase m: selection.getBases())
319                                 {
320                                         try {
321                                                 _selectionHighlightSeq.add(_seq.getHighlighter().addHighlight(m.getIndex(), m.getIndex()+1, new DefaultHighlighter.DefaultHighlightPainter(Color.orange) ));
322                                                 _selectionHighlightStr.add(_str.getHighlighter().addHighlight(m.getIndex(), m.getIndex()+1, new DefaultHighlighter.DefaultHighlightPainter(Color.orange) ));
323                                         } catch (BadLocationException e) {
324                                                 e.printStackTrace();
325                                         }
326                                 }
327                         }
328                         
329                 });
330                 
331                 _vp.addVARNAListener(this);
332         }
333         
334         public static String generateDefaultName()
335         {
336                 return "User file #"+_nextID++;
337         }
338
339         public RNA getRNA() {
340                 return (RNA)_sideList.getSelectedValue();
341         }
342
343
344
345         public String[][] getParameterInfo() {
346                 String[][] info = {
347                                 // Parameter Name Kind of Value Description,
348                                 { "sequenceDBN", "String", "A raw RNA sequence" },
349                                 { "structureDBN", "String",
350                                                 "An RNA structure in dot bracket notation (DBN)" },
351                                 { errorOpt, "boolean", "To show errors" }, };
352                 return info;
353         }
354
355         public void init() {
356                 _vp.setBackground(_backgroundColor);
357                 _error = true;
358         }
359
360         @SuppressWarnings("unused")
361         private Color getSafeColor(String col, Color def) {
362                 Color result;
363                 try {
364                         result = Color.decode(col);
365                 } catch (Exception e) {
366                         try {
367                                 result = Color.getColor(col, def);
368                         } catch (Exception e2) {
369                                 return def;
370                         }
371                 }
372                 return result;
373         }
374
375         public VARNAPanel get_varnaPanel() {
376                 return _vp;
377         }
378
379         public void set_varnaPanel(VARNAPanel surface) {
380                 _vp = surface;
381         }
382
383
384         public JTextField get_seq() {
385                 return _seq;
386         }
387
388         public void set_seq(JTextField _seq) {
389                 this._seq = _seq;
390         }
391
392         public JLabel get_info() {
393                 return _info;
394         }
395
396         public void set_info(JLabel _info) {
397                 this._info = _info;
398         }
399
400         public static void main(String[] args) {
401                 VARNAEditor d = new VARNAEditor();
402                 d.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
403                 d.pack();
404                 d.setVisible(true);
405         }
406         
407
408         public void dragEnter(DropTargetDragEvent arg0) {
409                 // TODO Auto-generated method stub
410                 
411         }
412
413         public void dragExit(DropTargetEvent arg0) {
414                 // TODO Auto-generated method stub
415                 
416         }
417
418         public void dragOver(DropTargetDragEvent arg0) {
419                 // TODO Auto-generated method stub
420                 
421         }
422
423         public void drop(DropTargetDropEvent dtde) {
424             try {
425                 Transferable tr = dtde.getTransferable();
426                 DataFlavor[] flavors = tr.getTransferDataFlavors();
427                 for (int i = 0; i < flavors.length; i++) {
428             if (flavors[i].isFlavorJavaFileListType()) {
429               dtde.acceptDrop(DnDConstants.ACTION_COPY_OR_MOVE);
430               Object ob = tr.getTransferData(flavors[i]);
431               if (ob instanceof List)
432               {
433                   List list = (List) ob;
434                   for (int j = 0; j < list.size(); j++) {
435                   Object o = list.get(j);
436                   
437                   if (dtde.getSource() instanceof DropTarget)
438                   {
439                           DropTarget dt = (DropTarget) dtde.getSource();
440                           Component c = dt.getComponent();
441                           if (c instanceof VARNAPanel)
442                           {
443                                           String path = o.toString();
444                                   VARNAPanel vp = (VARNAPanel) c;
445                                           try{
446                                   FullBackup bck =  VARNAPanel.importSession((File) o); // BH SwingJS
447                                   _rnaList.add(bck.config, bck.rna,bck.name,true);
448                                           }
449                                           catch (ExceptionLoadingFailed e3)
450                                           {
451                                                   Collection<RNA> rnas = RNAFactory.loadSecStr((File) o); // BH SwingJS 
452                                                   if (rnas.isEmpty())
453                                                   {
454                                                           throw new ExceptionFileFormatOrSyntax("No RNA could be parsed from that source.");
455                                                   }
456                                                   
457                                                   int id = 1;
458                                                   for(RNA r: rnas)
459                                                   {
460                                                           r.drawRNA(vp.getConfig());
461                                                           String name = r.getName();
462                                                           if (name.equals(""))
463                                                           { 
464                                                                   name = path.substring(path.lastIndexOf(File.separatorChar)+1);
465                                                           }
466                                                           if (rnas.size()>1)
467                                                           {
468                                                                   name += " - Molecule# "+id++;
469                                                           }
470                                                           _rnaList.add(vp.getConfig().clone(),r,name,true);
471                                                   }
472                                           }                                       
473                           }
474                   }
475                   }
476               }
477               // If we made it this far, everything worked.
478               dtde.dropComplete(true);
479               return;
480             }
481                 }
482                 // Hmm, the user must not have dropped a file list
483                 dtde.rejectDrop();
484               } catch (Exception e) {
485                 e.printStackTrace();
486                 dtde.rejectDrop();
487               }
488                 
489         }
490
491         public void dropActionChanged(DropTargetDragEvent arg0) {
492         }
493
494         private class BackupHolder{
495                 private DefaultListModel _rnaList;
496                 private ArrayList<RNA> _rnas = new ArrayList<RNA>();
497                 JList _l;
498                 
499                 public BackupHolder(DefaultListModel rnaList, JList l)
500                 {
501                         _rnaList = rnaList;
502                         _l = l;
503                 }
504                 
505                 public void add(VARNAConfig c, RNA r)
506                 {
507                         add(c, r, r.getName(),false);
508                 }
509
510                 public void add(VARNAConfig c, RNA r,boolean select)
511                 {
512                         add(c, r, r.getName(),select);
513                 }
514
515                 public void add(VARNAConfig c, RNA r, String name)
516                 {
517                         add(c, r, name,false);                  
518                 }
519                 public void add(VARNAConfig c, RNA r, String name, boolean select)
520                 {
521                         if (select){
522                                 _l.removeSelectionInterval(0, _rnaList.size());
523                         }
524                         if (name.equals(""))
525                         {
526                                 name = generateDefaultName();
527                         }
528                         FullBackup bck = new FullBackup(c,r,name);
529                         _rnas.add(0, r);
530                         _rnaList.add(0,bck);
531                         if (select){
532                           _l.setSelectedIndex(0);
533                         }
534                 }
535
536                 public void remove(int i)
537                 {
538                         _rnas.remove(i);
539                         _rnaList.remove(i);
540                         
541                 }
542                 public DefaultListModel getModel()
543                 {
544                         return _rnaList;
545                 }
546                 public boolean contains(RNA r)
547                 {
548                         return _rnas.contains(r);
549                 }
550                 /*public int getSize()
551                 {
552                         return _rnaList.getSize();
553                 }*/
554                 public FullBackup getElementAt(int i)
555                 {
556                         return (FullBackup) _rnaList.getElementAt(i);
557                 }
558                 
559                 public void removeSelected()
560                 {
561                         int i = _l.getSelectedIndex();
562                         if (i!=-1)
563                         {
564                           if (_rnaList.getSize()==1)
565                           {
566                                   RNA r = new RNA();
567                                   try {
568                                         r.setRNA(" ", ".");
569                                   } catch (ExceptionUnmatchedClosingParentheses e1) {
570                                   } catch (ExceptionFileFormatOrSyntax e1) {
571                                   }
572                                   _vp.showRNA(r);
573                                   _vp.repaint();
574                           }
575                           else
576                           {  
577                                  int newi = i+1;
578                                  if (newi==_rnaList.getSize())
579                                  {
580                                          newi = _rnaList.getSize()-2;
581                                  }
582                                  FullBackup bck = (FullBackup) _rnaList.getElementAt(newi);
583                                  _l.setSelectedValue(bck,true);
584                           }
585                           _rnaList.remove(i);
586                         }
587
588                 }
589         }
590
591         public void onStructureRedrawn() {
592                 // TODO Auto-generated method stub
593                 
594         }
595
596         public void onUINewStructure(VARNAConfig v, RNA r) {
597                 _rnaList.add(v, r,"",true);
598         }
599
600         public void onWarningEmitted(String s) {
601                 // TODO Auto-generated method stub
602                 
603         }
604
605         public void mouseClicked(MouseEvent e) {
606                            if(e.getClickCount() == 2){
607                              int index = _sideList.locationToIndex(e.getPoint());
608                              ListModel dlm = _sideList.getModel();
609                              FullBackup item = (FullBackup) dlm.getElementAt(index);;
610                              _sideList.ensureIndexIsVisible(index);
611                              Object newName = JOptionPane.showInputDialog(
612                                             this,
613                                             "Specify a new name for this RNA",
614                                             "Rename RNA", 
615                                             JOptionPane.QUESTION_MESSAGE,
616                                             (Icon)null,
617                                             null,
618                                             item.toString());
619                              if (newName!=null)
620                              {
621                                  item.name = newName.toString();
622                                  this._sideList.repaint();
623                              }
624                              }
625         }
626
627         public void mouseEntered(MouseEvent arg0) {
628                 // TODO Auto-generated method stub
629                 
630         }
631
632         public void mouseExited(MouseEvent arg0) {
633                 // TODO Auto-generated method stub
634                 
635         }
636
637         public void mousePressed(MouseEvent arg0) {
638                 // TODO Auto-generated method stub
639                 
640         }
641
642         public void mouseReleased(MouseEvent arg0) {
643                 // TODO Auto-generated method stub
644                 
645         }
646
647         public void onZoomLevelChanged() {
648                 // TODO Auto-generated method stub
649                 
650         }
651
652         public void onTranslationChanged() {
653                 // TODO Auto-generated method stub
654                 
655         }
656 }