-// $Id$
/**
* Copyright (C) 2014 EDIT
* European Distributed Institute of Taxonomy
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;
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
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);
}
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) {
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 {
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
}
}
}
return null;
}
}
-}
\ No newline at end of file
+}