idIterator = editor.getReadsArea().getAlignmentModel().sequenceIDIterator();
- while (idIterator.hasNext()) {
- PherogramArea area = editor.getPherogramArea(idIterator.next());
- if (area != null) {
- doExecute(event, area);
- }
- }
- }
- else if (activePart instanceof PherogramViewPart) {
- doExecute(event, ((PherogramViewPart)activePart).getPherogramView().getTraceCurveView());
- }
- return null;
- }
-
-
- public abstract void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException;
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ChangePherogramQualityOutputType.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ChangePherogramQualityOutputType.java
deleted file mode 100644
index 18fc06f69..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ChangePherogramQualityOutputType.java
+++ /dev/null
@@ -1,31 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2015 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
-
-
-import info.bioinfweb.libralign.pherogram.PherogramComponent;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-
-
-
-/**
- * Switches between the quality output types available for components displaying pherograms.
- *
- * @author Ben Stöver
- * @date 19.06.2015
- */
-public class ChangePherogramQualityOutputType extends AbstractPherogramComponentHandler {
- @Override
- public void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException {
- component.getFormats().changeQualityOutputType();
- }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CreateConsensusSequenceHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CreateConsensusSequenceHandler.java
deleted file mode 100644
index 2a2cc7326..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CreateConsensusSequenceHandler.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
-
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-
-import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
-
-
-
-/**
- * Handler that creates the consensus sequence from all single read sequences in the active instance
- * of {@link AlignmentEditor}. A previously present consensus sequence will be overwritten.
- *
- * @author Ben Stöver
- * @date 19.06.2015
- * @see UpdateConsensusSequenceHandler
- * @see AlignmentEditor#createConsensusSequence()
- */
-public class CreateConsensusSequenceHandler extends AbstractAlignmentEditorHandler {
- @Override
- public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {
- editor.createConsensusSequence();
- }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramLeftHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramLeftHandler.java
deleted file mode 100644
index 305d63edf..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramLeftHandler.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2015 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
-
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-
-import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-
-
-
-/**
- * Handler that cuts the base call sequence of a pherogram attached to the current sequence on the left
- * of the current selection or cursor position.
- *
- * @author Ben Stöver
- * @date 15.06.2015
- */
-public class CutPherogramLeftHandler extends AbstractAlignmentEditorHandler {
- @Override
- public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {
- String errorMessage = editor.cutPherogramLeft();
- if (errorMessage != null) {
- MessagingUtils.errorDialog("Unable to cut base call sequence", this, errorMessage, "eu.etaxonomy.taxeditor.editor", null, false); //TODO set pluginID
- }
- }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramRightHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramRightHandler.java
deleted file mode 100644
index 7844fc610..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramRightHandler.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2015 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
-
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-
-import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-
-
-
-/**
- * Handler that cuts the base call sequence of a pherogram attached to the current sequence on the right
- * of the current selection or cursor position.
- *
- * @author BenStoever
- * @date 15.06.2015
- */
-public class CutPherogramRightHandler extends AbstractAlignmentEditorHandler {
- @Override
- public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {
- String errorMessage = editor.cutPherogramRight();
- if (errorMessage != null) {
- MessagingUtils.errorDialog("Unable to cut base call sequence", this, errorMessage, "eu.etaxonomy.taxeditor.editor", null, false); //TODO set pluginID
- }
- }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ReverseComplementHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ReverseComplementHandler.java
deleted file mode 100644
index f8b003e56..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ReverseComplementHandler.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
-
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-
-import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
-
-
-
-/**
- * Reverse complements the single read sequence in an active {@link AlignmentEditor}, where the alignment cursor
- * is currently located.
- *
- * @author Ben Stöver
- */
-public class ReverseComplementHandler extends AbstractAlignmentEditorHandler {
- @Override
- public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {
- editor.reverseComplementSelectedSequences();
- }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleInsertOverwriteHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleInsertOverwriteHandler.java
deleted file mode 100644
index 283767bd3..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleInsertOverwriteHandler.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
-
-
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.commands.IElementUpdater;
-import org.eclipse.ui.menus.UIElement;
-
-import eu.etaxonomy.taxeditor.editor.handler.HandlerTools;
-import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
-
-
-
-/**
- * Switches an {@link AlignmentEditor} between insertion and overwrite mode.
- *
- * @author Ben Stöver
- * @date 04.12.2014
- */
-public class ToggleInsertOverwriteHandler extends AbstractAlignmentEditorHandler implements IElementUpdater {
- public static final String COMMAND_ID =
- "eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleInsertOverwrite";
-
-
- private final ImageDescriptor INSERT_DESCRIPTOR = HandlerTools.createImageDescriptor("insert-16x16.png");
- private final ImageDescriptor OVERWRITE_DESCRIPTOR = HandlerTools.createImageDescriptor("overwrite-16x16.png");
-
-
- @Override
- public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {
- editor.toggleInsertOverwrite();
- }
-
-
- @Override
- public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
- IEditorPart activeEditor = AbstractUtility.getActiveEditor();
- if (activeEditor instanceof AlignmentEditor) {
- if (((AlignmentEditor)activeEditor).isInsertMode()) {
- element.setIcon(INSERT_DESCRIPTOR);
- element.setText("INS");
- element.setTooltip("Click to switch to overwrite mode");
- }
- else {
- element.setIcon(OVERWRITE_DESCRIPTOR);
- element.setText("OVR");
- element.setTooltip("Click to switch to insertion mode");
- }
- ((ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class)).refreshElements(
- ToggleLeftRightInsertionHandler.COMMAND_ID, null);
- }
- }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleLeftRightInsertionHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleLeftRightInsertionHandler.java
deleted file mode 100644
index d149eb16b..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleLeftRightInsertionHandler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
- * http://www.e-taxonomy.eu
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1
- * See LICENSE.TXT at the top of this package for the full license terms.
- */
-
-package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
-
-import java.util.Map;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.commands.IElementUpdater;
-import org.eclipse.ui.menus.UIElement;
-
-import eu.etaxonomy.taxeditor.editor.handler.HandlerTools;
-import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
-import eu.etaxonomy.taxeditor.model.AbstractUtility;
-
-
-
-/**
- * Switches an {@link AlignmentEditor} between insertion in the base sequence to
- * the left or to the right.
- *
- * @author Ben Stöver
- * @date 04.12.2014
- */
-public class ToggleLeftRightInsertionHandler extends AbstractAlignmentEditorHandler implements IElementUpdater {
- public static final String COMMAND_ID = "eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleLeftRightInsertion";
-
-
- private final ImageDescriptor INSERT_LEFT_DESCRIPTOR =
- HandlerTools.createImageDescriptor("pherogram-insert-left-16x16.png");
- private final ImageDescriptor INSERT_RIGHT_DESCRIPTOR =
- HandlerTools.createImageDescriptor("pherogram-insert-right-16x16.png");
- private final ImageDescriptor INSERT_LEFT_DISABLED_DESCRIPTOR =
- HandlerTools.createImageDescriptor("pherogram-insert-left-disabled-16x16.png");
- private final ImageDescriptor INSERT_RIGHT_DISABLED_DESCRIPTOR =
- HandlerTools.createImageDescriptor("pherogram-insert-right-disabled-16x16.png");
-
-
- @Override
- public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {
- editor.toggleLeftRightInsertionInPherogram();
- }
-
-
- @Override
- public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
- IEditorPart activeEditor = AbstractUtility.getActiveEditor();
- if (activeEditor instanceof AlignmentEditor) {
- setBaseEnabled(((AlignmentEditor)activeEditor).isInsertMode());
- if (((AlignmentEditor)activeEditor).isInsertLeftInPherogram()) {
- element.setIcon(INSERT_LEFT_DESCRIPTOR);
- element.setDisabledIcon(INSERT_LEFT_DISABLED_DESCRIPTOR);
- element.setText("Left");
- element.setTooltip("Switch to insert pherogram distorsions right of future edits.");
- }
- else {
- element.setIcon(INSERT_RIGHT_DESCRIPTOR);
- element.setDisabledIcon(INSERT_RIGHT_DISABLED_DESCRIPTOR);
- element.setText("Right");
- element.setTooltip("Switch to insert pherogram distorsions left of future edits.");
- }
- }
- }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramBaseCallLinesHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramBaseCallLinesHandler.java
deleted file mode 100644
index 43ceb3115..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramBaseCallLinesHandler.java
+++ /dev/null
@@ -1,30 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2015 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
-
-
-import info.bioinfweb.libralign.pherogram.PherogramComponent;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-
-
-
-/**
- * @author BenStoever
- * @date 23.06.2015
- *
- */
-public class ToggleShowPherogramBaseCallLinesHandler extends AbstractPherogramComponentHandler {
- @Override
- public void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException {
- component.getFormats().toggleShowBaseCallLines();
- }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramProbabilitiesHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramProbabilitiesHandler.java
deleted file mode 100644
index 41b03a010..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramProbabilitiesHandler.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2015 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
-
-
-import info.bioinfweb.libralign.pherogram.PherogramComponent;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-
-import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
-import eu.etaxonomy.taxeditor.editor.molecular.PherogramViewPart;
-
-
-
-/**
- * Toggles whether probability values (substitution, overcall and undercall) should be displayed
- * in pherogram areas of {@link AlignmentEditor} or {@link PherogramViewPart}.
- *
- * @author Ben Stöver
- * @date 23.06.2015
- */
-public class ToggleShowPherogramProbabilitiesHandler extends AbstractPherogramComponentHandler {
- @Override
- public void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException {
- component.getFormats().toggleShowProbabilityValues();
- }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/UpdateConsensusSequenceHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/UpdateConsensusSequenceHandler.java
deleted file mode 100644
index 6bcdf98d4..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/UpdateConsensusSequenceHandler.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
-
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-
-import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
-
-
-
-public class UpdateConsensusSequenceHandler extends AbstractAlignmentEditorHandler {
- @Override
- public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {
- editor.updateConsensusSequence();
- }
-}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/package-info.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/package-info.java
deleted file mode 100644
index bd0508a83..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/package-info.java
+++ /dev/null
@@ -1,17 +0,0 @@
-// $Id$
-/**
- * Copyright (C) 2015 EDIT
- * European Distributed Institute of Taxonomy
- * http://www.e-taxonomy.eu
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1
- * See LICENSE.TXT at the top of this package for the full license terms.
- */
-/**
- * Contains handlers that trigger actions in an active instance of
- * {@link eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor}. Handlers opening
- * an alignment editor or pherogram view are not contained in here.
- *
- * @author Ben Stöver
- */
-package eu.etaxonomy.taxeditor.editor.handler.alignmenteditor;
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java
deleted file mode 100644
index acf1aac70..000000000
--- a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java
+++ /dev/null
@@ -1,717 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2014 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.taxeditor.editor.molecular;
-
-
-import info.bioinfweb.libralign.alignmentarea.AlignmentArea;
-import info.bioinfweb.libralign.alignmentarea.selection.SelectionModel;
-import info.bioinfweb.libralign.alignmentarea.tokenpainter.NucleotideTokenPainter;
-import info.bioinfweb.libralign.dataarea.implementations.ConsensusSequenceArea;
-import info.bioinfweb.libralign.dataarea.implementations.SequenceIndexArea;
-import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea;
-import info.bioinfweb.libralign.editsettings.EditSettingsChangeEvent;
-import info.bioinfweb.libralign.editsettings.EditSettingsListener;
-import info.bioinfweb.libralign.model.AlignmentModel;
-import info.bioinfweb.libralign.model.AlignmentModelChangeListener;
-import info.bioinfweb.libralign.model.AlignmentModelUtils;
-import info.bioinfweb.libralign.model.adapters.StringAdapter;
-import info.bioinfweb.libralign.model.events.SequenceChangeEvent;
-import info.bioinfweb.libralign.model.events.SequenceRenamedEvent;
-import info.bioinfweb.libralign.model.events.TokenChangeEvent;
-import info.bioinfweb.libralign.model.implementations.PackedAlignmentModel;
-import info.bioinfweb.libralign.model.tokenset.CharacterTokenSet;
-import info.bioinfweb.libralign.model.tokenset.TokenSet;
-import info.bioinfweb.libralign.multiplealignments.AlignmentAreaList;
-import info.bioinfweb.libralign.multiplealignments.MultipleAlignmentsContainer;
-import info.bioinfweb.libralign.pherogram.model.PherogramAreaModel;
-import info.bioinfweb.libralign.pherogram.model.ShiftChange;
-import info.bioinfweb.libralign.pherogram.provider.BioJavaPherogramProvider;
-import info.bioinfweb.libralign.pherogram.provider.PherogramProvider;
-import info.bioinfweb.libralign.pherogram.provider.ReverseComplementPherogramProvider;
-import info.bioinfweb.tic.SWTComponentFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
-import org.biojava.bio.chromatogram.ChromatogramFactory;
-import org.biojava.bio.chromatogram.UnsupportedChromatogramFormatException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.part.EditorPart;
-
-import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
-import eu.etaxonomy.cdm.api.service.molecular.ISequenceService;
-import eu.etaxonomy.cdm.model.media.MediaUtils;
-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.editor.handler.alignmenteditor.ToggleInsertOverwriteHandler;
-import eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.ToggleLeftRightInsertionHandler;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-import eu.etaxonomy.taxeditor.view.derivateSearch.DerivateLabelProvider;
-
-
-
-/**
- * Editor component to edit a contig alignment used to combine different overlapping pherograms from Sanger sequencing to
- * a consensus sequence.
- *
- * The contained GUI components used to edit the alignment come from LibrAlign.
- *
- * @author Ben Stöver
- * @author pplitzner
- * @date 04.08.2014
- */
-public class AlignmentEditor extends EditorPart {
- public static final String ID = "eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor";
-
- public static final int READS_AREA_INDEX = 1;
- public static final int EDITABLE_CONSENSUS_AREA_INDEX = READS_AREA_INDEX + 1;
- public static final int CONSENSUS_HINT_AREA_INDEX = EDITABLE_CONSENSUS_AREA_INDEX + 1;
- public static final int PHEROGRAM_AREA_INDEX = 0;
- public static final int CONSENSUS_DATA_AREA_INDEX = 0;
- public static final String DEFAULT_READ_NAME_PREFIX = "Read ";
- public static final String CONSENSUS_NAME = "Consensus";
-
-
- private final ConversationHolder conversationHolder;
-
- private final AlignmentModelChangeListener DIRTY_LISTENER = new AlignmentModelChangeListener() {
- @Override
- public void afterTokenChange(TokenChangeEvent e) {
- setDirty();
- }
-
- @Override
- public void afterSequenceRenamed(SequenceRenamedEvent e) {
- setDirty();
- }
-
- @Override
- public void afterSequenceChange(SequenceChangeEvent e) {
- setDirty();
- }
-
- @Override
- public void afterProviderChanged(AlignmentModel oldProvider,
- AlignmentModel newProvider) { // Not expected.
-
- setDirty();
- }
- };
-
- private MultipleAlignmentsContainer alignmentsContainer = null;
- private final Map cdmMap = new TreeMap(); //TODO Move this to ContigSequenceDataProvider
- private boolean dirty = false;
-
-
- public AlignmentEditor() {
- super();
- conversationHolder = CdmStore.createConversation();
- //conversationHolder = null;
- }
-
-
- private void refreshToolbarElement(String id) {
- ICommandService commandService =
- (ICommandService)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getService(ICommandService.class);
- if (commandService != null) {
- commandService.refreshElements(id, Collections.EMPTY_MAP);
- }
- }
-
-
- private void registerEditSettingListener(MultipleAlignmentsContainer container) {
- container.getEditSettings().addListener(new EditSettingsListener() {
- @Override
- public void workingModeChanged(EditSettingsChangeEvent e) {} // Currently nothing to do
-
- @Override
- public void insertLeftInDataAreaChanged(EditSettingsChangeEvent e) {
- updateStatusBar();
- refreshToolbarElement(ToggleLeftRightInsertionHandler.COMMAND_ID);
- }
-
- @Override
- public void insertChanged(EditSettingsChangeEvent e) {
- updateStatusBar();
- refreshToolbarElement(ToggleInsertOverwriteHandler.COMMAND_ID);
- }
- });
- }
-
-
- private AlignmentArea createIndexArea(MultipleAlignmentsContainer container, AlignmentArea labeledArea) {
- AlignmentArea result = new AlignmentArea(container);
- result.setAllowVerticalScrolling(false);
- result.getDataAreas().getTopAreas().add(new SequenceIndexArea(result.getContentArea(), labeledArea));
- return result;
- }
-
-
- private AlignmentArea createEditableAlignmentArea(MultipleAlignmentsContainer container, boolean allowVerticalScrolling) {
- AlignmentArea result = new AlignmentArea(container);
- result.setAllowVerticalScrolling(allowVerticalScrolling);
-
- CharacterTokenSet tokenSet = CharacterTokenSet.newDNAInstance(); //TODO Should NUCLEOTIDE be used instead?
- AlignmentModel provider = new PackedAlignmentModel(tokenSet);
- result.setAlignmentModel(provider, false);
- provider.getChangeListeners().add(DIRTY_LISTENER);
- result.getPaintSettings().getTokenPainterList().set(0, new NucleotideTokenPainter());
-
- return result;
- }
-
-
- private AlignmentArea createConsensusHintArea(MultipleAlignmentsContainer container,
- AlignmentArea labeledArea) {
-
- AlignmentArea result = new AlignmentArea(container);
- result.setAllowVerticalScrolling(false);
- result.getDataAreas().getBottomAreas().add(
- new ConsensusSequenceArea(result.getContentArea(), labeledArea));
- return result;
- }
-
-
- private MultipleAlignmentsContainer getAlignmentsContainer() {
- if (alignmentsContainer == null) {
- alignmentsContainer = new MultipleAlignmentsContainer();
-
- AlignmentAreaList list = alignmentsContainer.getAlignmentAreas();
- AlignmentArea readsArea = createEditableAlignmentArea(alignmentsContainer, true);
- list.add(createIndexArea(alignmentsContainer, readsArea));
- list.add(readsArea); // Make sure READS_AREA_INDEX is correct.
- list.add(createEditableAlignmentArea(alignmentsContainer, false)); // Make sure COMSENSUS_AREA_INDEX is correct.
- list.add(createConsensusHintArea(alignmentsContainer, readsArea));
-
- registerEditSettingListener(alignmentsContainer);
- }
- return alignmentsContainer;
- }
-
-
- public AlignmentArea getReadsArea() {
- return getAlignmentsContainer().getAlignmentAreas().get(READS_AREA_INDEX);
- }
-
-
- private AlignmentArea getEditableConsensusArea() {
- return getAlignmentsContainer().getAlignmentAreas().get(EDITABLE_CONSENSUS_AREA_INDEX);
- }
-
-
- public boolean hasPherogram(int sequenceID) {
- return getReadsArea().getDataAreas().getSequenceAreas(sequenceID).size() > PHEROGRAM_AREA_INDEX;
- }
-
-
- public PherogramArea getPherogramArea(int sequenceID) {
- if (hasPherogram(sequenceID)) {
- return (PherogramArea)getReadsArea().getDataAreas().getSequenceAreas(sequenceID).get(PHEROGRAM_AREA_INDEX);
- }
- else {
- return null;
- }
- }
-
-
- private ConsensusSequenceArea getConsensusHintDataArea() {
- return (ConsensusSequenceArea)getAlignmentsContainer().getAlignmentAreas().
- get(CONSENSUS_HINT_AREA_INDEX).getDataAreas().getBottomAreas().
- get(CONSENSUS_DATA_AREA_INDEX);
- }
-
-
- @Deprecated //TODO Remove as soon as testing period is over
- private void createTestContents() {
- // Just for testing:
- try {
- addRead(new File("D:/Users/BenStoever/ownCloud/Dokumente/Projekte/EDITor/Quelltexte/LibrAlign branch/Repository/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1").toURI(), false);
- //addRead(new File("D:/Users/BenStoever/ownCloud/Dokumente/Projekte/EDITor/Quelltexte/LibrAlign branch/Repository/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1").toURI(), false);
- addRead(new File("D:/Users/BenStoever/ownCloud/Dokumente/Projekte/EDITor/Quelltexte/LibrAlign branch/Repository/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/Test_qualityScore.scf").toURI(), false);
-
- // Add test consensus sequence:
- AlignmentModel consensusModel = getEditableConsensusArea().getAlignmentModel();
- int id = consensusModel.addSequence(CONSENSUS_NAME);
- Collection