Merge branch 'develop' into LibrAlign
[taxeditor.git] / eu.etaxonomy.taxeditor.molecular / src / main / java / eu / etaxonomy / taxeditor / molecular / editor / AlignmentEditor.java
index 0b218c832335a4c969bb4bbabdd2a77b461d2b18..41a6b82e139ab0fe2c06b9315a91c183520c8bcc 100644 (file)
@@ -1,4 +1,3 @@
-// $Id$
 /**
 * Copyright (C) 2014 EDIT
 * European Distributed Institute of Taxonomy
@@ -73,7 +72,6 @@ import eu.etaxonomy.cdm.model.molecular.Sequence;
 import eu.etaxonomy.cdm.model.molecular.SequenceString;
 import eu.etaxonomy.cdm.model.molecular.SingleRead;
 import eu.etaxonomy.cdm.model.molecular.SingleReadAlignment;
-import eu.etaxonomy.cdm.model.molecular.SingleReadAlignment.Shift;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin;
 import eu.etaxonomy.taxeditor.molecular.handler.ToggleInsertOverwriteHandler;
@@ -395,25 +393,25 @@ public class AlignmentEditor extends EditorPart {
         bars.getStatusLineManager().setMessage("Edit mode: " +
                        (getReadsArea().getEditSettings().isInsert() ? "Insert" : "Overwrite") + "  " +
                        "Insertion in pherogram: " +
-                       (getReadsArea().getEditSettings().isInsertLeftInDataArea() ? "Left" : "Right"));
+                       (getReadsArea().getEditSettings().isInsertLeftInDataArea() ? "Left" : "Right"));  //TODO multi language
     }
 
 
     private SingleReadAlignment.Shift[] convertToCDMShifts(PherogramAreaModel model) {
        Iterator<ShiftChange> iterator = model.shiftChangeIterator();
-       List<Shift> shifts = new ArrayList<SingleReadAlignment.Shift>();
+       List<SingleReadAlignment.Shift> shifts = new ArrayList<SingleReadAlignment.Shift>();
        while (iterator.hasNext()) {
                ShiftChange shiftChange = iterator.next();
                shifts.add(new SingleReadAlignment.Shift(shiftChange.getBaseCallIndex(), shiftChange.getShiftChange()));
        }
-       return shifts.toArray(new Shift[]{});
+       return shifts.toArray(new SingleReadAlignment.Shift[shifts.size()]);
     }
 
 
     @Override
     public void doSave(IProgressMonitor monitor) {
        if (getEditorInput() instanceof AlignmentEditorInput) {
-               String taskName = "Saving alignment";
+               String taskName = "Saving alignment";  //TODO multi language
             monitor.beginTask(taskName, 3);
 
             //re-loading sequence to avoid session conflicts
@@ -440,7 +438,7 @@ public class AlignmentEditor extends EditorPart {
                        String id = iterator.next();
                        SingleReadAlignment singleRead = cdmMap.get(id);
                        if (singleRead == null) {
-                           throw new InternalError("Creating new reads from AlignmentEditor not implemented.");
+                           throw new InternalError("Creating new reads from AlignmentEditor not implemented.");  //TODO multi language
                                //TODO Create new read object. => Shall it be allowed to add reads in the alignment editor which are not represented in the CDM tree before the alignment editor is saved?
                                //singleRead = SingleReadAlignment.NewInstance(consensusSequence, singleRead, shifts, editedSequence);
                        }
@@ -539,13 +537,13 @@ public class AlignmentEditor extends EditorPart {
     private String cutPherogram(boolean left) {
         SelectionModel selection = getReadsArea().getSelection();
         if (selection.getCursorHeight() != 1) {
-            return "Cutting pherograms is only possible if exactly one row is selected.";
+            return "Cutting pherograms is only possible if exactly one row is selected.";  //TODO multi language
         }
         else {
             PherogramArea pherogramArea =
                     getPherogramArea(getReadsArea().getSequenceOrder().idByIndex(selection.getCursorRow()));
             if (pherogramArea == null) {
-                return "There is no pherogram attached to the current sequence.";
+                return "There is no pherogram attached to the current sequence.";  //TODO multi language
             }
             else {
                 if (left) {
@@ -553,7 +551,7 @@ public class AlignmentEditor extends EditorPart {
                         return null;
                     }
                     else {
-                        return "The left end of the selection lies outside the pherogram attached to this sequence.";
+                        return "The left end of the selection lies outside the pherogram attached to this sequence.";  //TODO multi language
                     }
                 }
                 else {
@@ -561,7 +559,7 @@ public class AlignmentEditor extends EditorPart {
                         return null;
                     }
                     else {
-                        return "The right end of the selection lies outside the pherogram attached to this sequence.";
+                        return "The right end of the selection lies outside the pherogram attached to this sequence.";  //TODO multi language
                     }
                 }
             }
@@ -766,4 +764,4 @@ public class AlignmentEditor extends EditorPart {
             return null;
         }
     }
-}
\ No newline at end of file
+}