merge-update from trunk
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 8 Sep 2014 14:00:23 +0000 (14:00 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 8 Sep 2014 14:00:23 +0000 (14:00 +0000)
20 files changed:
.gitattributes
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar
eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar
eu.etaxonomy.taxeditor.editor/.classpath
eu.etaxonomy.taxeditor.editor/.project
eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.editor/build.properties
eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditor.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CMDAlignmentObjectPlaceholder.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf [new file with mode: 0644]
eu.etaxonomy.taxeditor/.classpath

index 34da68eeb4c2f51a6547f186d5963e3203861540..bf6b83942b3ef27231924ff3f6da1ab684502b0d 100644 (file)
@@ -362,6 +362,11 @@ eu.etaxonomy.taxeditor.editor/icons/edit_16x16.gif -text
 eu.etaxonomy.taxeditor.editor/icons/emblem-photos.png -text
 eu.etaxonomy.taxeditor.editor/icons/leaf_detail.png -text
 eu.etaxonomy.taxeditor.editor/icons/xper64.png -text
+eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar -text
+eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar -text
+eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar -text
+eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar -text
+eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar -text
 eu.etaxonomy.taxeditor.editor/p2.inf -text
 eu.etaxonomy.taxeditor.editor/plugin.xml -text
 eu.etaxonomy.taxeditor.editor/pom.xml -text
@@ -386,6 +391,7 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditNewTaxonHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditor.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenParentHandler.java -text
@@ -418,6 +424,9 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/po
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/CreateNodeOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/DeleteNodeOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RefreshNodeNumberingOperation.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CMDAlignmentObjectPlaceholder.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroup.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroupedContainer.java -text
@@ -587,6 +596,7 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/u
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateUseRecordOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/uses/operation/CreateUseSummaryOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/resources/TaonDescriptionEditor.screen -text
+eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf -text
 eu.etaxonomy.taxeditor.editor/src/main/resources/log4j.properties -text
 eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/Application.java -text
 eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/ApplicationActionBarAdvisor.java -text
index 9fb167cc8644ced846238dee40784f7341832719..4cf488ee33f1a17bac6e7badc2adfac6cf54f75d 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.common-3.6.0.v20110523.jar differ
index 25f118068392d39fda76feea6c855dfb3633db17..f131a431cbf20a8f2194c84912950bd3e0a6485b 100644 (file)
Binary files a/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar and b/eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.osgi-3.7.2.v20120110-1415.jar differ
index 856e9f909acec2ac78d360355e9cb4be88f8eaa3..f7c4e43f8a11d788866a22c632addd9bd811cc3b 100644 (file)
@@ -1,9 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-       <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
-       <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
-       <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
-       <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+       <classpathentry including="**/*.java" kind="src" path="src/main/java"/>\r
+       <classpathentry including="**/*.java" kind="src" path="src/test/java"/>\r
+       <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/biojava3-alignment-3.0.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/biojava3-core-3.0.7.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/core-1.8.5.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/sequencing-1.8.5.jar"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/bioinfweb.commons"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/LibrAlign" sourcepath="lib/LibrAlign"/>\r
+       <classpathentry exported="true" kind="lib" path="lib/commons-lang3-3.1.jar"/>\r
+       <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
index e25293c2fcd8c813e182d2540716f7b232713c7e..ce8935ac2072251cf6f225298b65070a1a8fc91e 100644 (file)
@@ -1,28 +1,40 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>eu.etaxonomy.taxeditor.editor</name>
-       <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-               <nature>org.eclipse.pde.PluginNature</nature>
-       </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<projectDescription>\r
+       <name>eu.etaxonomy.taxeditor.editor</name>\r
+       <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>\r
+       <projects>\r
+       </projects>\r
+       <buildSpec>\r
+               <buildCommand>\r
+                       <name>org.eclipse.jdt.core.javabuilder</name>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+               <buildCommand>\r
+                       <name>org.eclipse.pde.ManifestBuilder</name>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+               <buildCommand>\r
+                       <name>org.eclipse.pde.SchemaBuilder</name>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+       </buildSpec>\r
+       <natures>\r
+               <nature>org.eclipse.jdt.core.javanature</nature>\r
+               <nature>org.eclipse.pde.PluginNature</nature>\r
+       </natures>\r
+       <linkedResources>\r
+               <link>\r
+                       <name>lib/LibrAlign</name>\r
+                       <type>2</type>\r
+                       <locationURI>WORKSPACE_LOC/LibrAlign/bin</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>lib/bioinfweb.commons</name>\r
+                       <type>2</type>\r
+                       <locationURI>WORKSPACE_LOC/_Lib/bin</locationURI>\r
+               </link>\r
+       </linkedResources>\r
+</projectDescription>\r
index 11da103872c8d8303729eb0b2915e1ab58aba9c1..15fa5be38f8768556325778e282a93c04e3c563f 100644 (file)
@@ -175,4 +175,11 @@ Bundle-ClassPath: .,
  jdimodel.jar,
  pdebuild.jar,
  compatibility.jar,
- junit.jar
+ junit.jar,
+ lib/biojava3-alignment-3.0.7.jar,
+ lib/biojava3-core-3.0.7.jar,
+ lib/core-1.8.5.jar,
+ lib/sequencing-1.8.5.jar,
+ lib/bioinfweb.commons/,
+ lib/LibrAlign/,
+ lib/commons-lang3-3.1.jar
index 356db7a1cda467ef29a56af7be60e2cd7b2bc5c8..91b72a915f0fd3b88450f0d7c20155a94c86664a 100644 (file)
@@ -7,4 +7,11 @@ bin.includes = META-INF/,\
                icons/,\
                p2.inf,\
                OSGI-INF/l10n/plugin_de.properties,\
-               OSGI-INF/l10n/plugin_en.properties
+               OSGI-INF/l10n/plugin_en.properties,\
+               lib/biojava3-alignment-3.0.7.jar,\
+               lib/biojava3-core-3.0.7.jar,\
+               lib/core-1.8.5.jar,\
+               lib/sequencing-1.8.5.jar,\
+               lib/bioinfweb.commons/,\
+               lib/LibrAlign/,\
+               lib/commons-lang3-3.1.jar
diff --git a/eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar b/eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar
new file mode 100644 (file)
index 0000000..e5f1d6b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar differ
diff --git a/eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar b/eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar
new file mode 100644 (file)
index 0000000..c9f1f81
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar differ
diff --git a/eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar b/eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar
new file mode 100644 (file)
index 0000000..a85e539
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar b/eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar
new file mode 100644 (file)
index 0000000..c6c7bdc
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar differ
diff --git a/eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar b/eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar
new file mode 100644 (file)
index 0000000..b987ebe
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar differ
index 378771f924454cd77f975bf0257c2e0b80e5a4bb..3e9c53eb8f35c52b43e02964397d9b3e6f9fd4f0 100644 (file)
             id="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor"
             name="Checklist Editor">
       </editor>
+      <editor
+            class="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor"
+            default="false"
+            id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor"
+            name="Alignment Editor">
+      </editor>
    </extension>
       <extension
             point="org.eclipse.ui.views">
                </reference>
             </visibleWhen>
          </command>
+         <command
+               commandId="eu.etaxonomy.taxeditor.editor.handler.OpenAlignmentEditor"
+               label="Alignment Editor"
+               style="push">
+         </command>
       </menuContribution>
       <menuContribution
             locationURI="menu:org.eclipse.ui.main.menu.navigate">
              defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
              id="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistViewHandler"
              name="Open Checklist Editor">
-       </command>
+      </command>
       <command
             categoryId="eu.etaxonomy.taxeditor.editor.new.category"
             defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.CreateDataSourceHandler"
             id="eu.etaxonomy.taxeditor.editor.command.new.datasource"
             name="New Datasource">
       </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenAlignmentEditor"
+            id="eu.etaxonomy.taxeditor.editor.handler.OpenAlignmentEditor"
+            name="Open Alignment Editor">
+      </command>
+
    </extension>
    <extension
          point="org.eclipse.core.expressions.definitions">
index d3f414a0334e9c9f93ee75f1216c7e1ea9d12b9a..4ed9313d32cf8063e44cccad67ca856f13df9eb9 100644 (file)
@@ -35,6 +35,8 @@ import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditorInput;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
 import eu.etaxonomy.taxeditor.editor.view.dataimport.BioCaseEditorInput;
@@ -116,6 +118,16 @@ public class EditorUtil extends AbstractUtility {
            open(input, ChecklistEditor.ID);
        }
 
+       /**
+        * Opens a new AlignmentEditor for the given input
+        * @param input
+        * @throws PartInitException
+        */
+       public static void open(AlignmentEditorInput input)
+               throws PartInitException {
+           open(input, AlignmentEditor.ID);
+       }
+
        /**
         * Opens a new {@link DataImportEditor} for the given input
         * @param input a {@link DataImportEditorInput}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditor.java
new file mode 100644 (file)
index 0000000..b978857
--- /dev/null
@@ -0,0 +1,42 @@
+// $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.handler;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.PartInitException;
+
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
+/**
+ * @author pplitzner
+ * @date 04.08.2014
+ *
+ */
+public class OpenAlignmentEditor extends AbstractHandler {
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+
+        AlignmentEditorInput input = new AlignmentEditorInput();
+        try {
+            EditorUtil.open(input);
+        } catch (PartInitException e) {
+            MessagingUtils.error(OpenAlignmentEditor.class, "Could not open AlignmentEditor", e);
+        }
+        return null;
+    }
+}
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
new file mode 100644 (file)
index 0000000..c79dddc
--- /dev/null
@@ -0,0 +1,197 @@
+// $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 java.io.File;
+
+import info.bioinfweb.commons.bio.biojava3.alignment.SimpleAlignment;
+import info.bioinfweb.commons.bio.biojava3.alignment.template.Alignment;
+import info.bioinfweb.commons.bio.biojava3.core.sequence.compound.AlignmentAmbiguityNucleotideCompoundSet;
+import info.bioinfweb.libralign.AlignmentArea;
+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.pherogram.BioJavaPherogramProvider;
+import info.bioinfweb.libralign.sequenceprovider.implementations.BioJavaSequenceDataProvider;
+import info.bioinfweb.libralign.sequenceprovider.tokenset.BioJavaTokenSet;
+
+import org.biojava.bio.chromatogram.ChromatogramFactory;
+import org.biojava3.core.sequence.DNASequence;
+import org.biojava3.core.sequence.compound.NucleotideCompound;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.EditorPart;
+
+
+
+/**
+ * Editor component to edit a contig alignment used to combine different overlapping pherograms from Sanger sequencing to
+ * a consensus sequence.
+ * <p>
+ * The contained GUI components used to edit the alignment come from <a href="http://bioinfweb.info/LibrAlign/">LibrAlign</a>.
+ * 
+ * @author pplitzner
+ * @author Ben Stöver
+ * @date 04.08.2014
+ */
+public class AlignmentEditor extends EditorPart {
+    public static final String ID = "eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor";
+    
+    private AlignmentArea alignmentArea;
+
+
+       private AlignmentArea createAlignmentArea() {
+               try {
+                       //ResourcesPlugin.getWorkspace().getRoot().getFile("/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf");
+                       //System.out.println(AlignmentEditor.class.getResource("/"));
+                       //System.out.println(AlignmentEditor.class.getResource("/../resources/TestPherogram_qualityScore.scf"));
+                       BioJavaPherogramProvider pherogramProvider = new BioJavaPherogramProvider(ChromatogramFactory.create(
+                                       new File("D:\\Users\\BenStoever\\Documents\\Studium\\Projekte\\Promotion\\EDITor\\Quelltexte\\LibrAlign branch\\Repository\\eu.etaxonomy.taxeditor.editor\\src\\main\\resources\\TestPherogram_qualityScore.scf")));
+                   //TODO Replace this absolute path with a path working with every workspace location.
+                       
+                       Alignment<DNASequence, NucleotideCompound> alignment = 
+                                       new SimpleAlignment<DNASequence, NucleotideCompound>();
+                       alignment.add("Sequence 1", new DNASequence("ATCGTAGATCGTAGATCGTAGATCGTAGATCGTAGATCGTAGATCGTAG"));
+                       alignment.add("Sequence 2", new DNASequence("AT-GTTG"));
+                       alignment.add("Sequence 3", new DNASequence("AT-GTAG"));
+                       
+                       StringBuffer seqBuffer = new StringBuffer(pherogramProvider.getSequenceLength());
+                       for (int i = 1; i <= pherogramProvider.getSequenceLength(); i++) {
+                               seqBuffer.append(pherogramProvider.getBaseCall(i).getUpperedBase());
+                       }
+                       alignment.add("Sequence 4", new DNASequence("-----" + seqBuffer.substring(0, 38) + 
+                                       seqBuffer.substring(39, 49) + "--" + seqBuffer.substring(49)));  // One A is deleted for shift change specified below. 
+                       
+                       BioJavaSequenceDataProvider<DNASequence, NucleotideCompound> sequenceProvider = 
+                                       new BioJavaSequenceDataProvider<DNASequence, NucleotideCompound>(
+                                                       new BioJavaTokenSet<NucleotideCompound>(
+                                                                       AlignmentAmbiguityNucleotideCompoundSet.getAlignmentAmbiguityNucleotideCompoundSet()),
+                                                       alignment);
+                       
+                       AlignmentArea result = new AlignmentArea();
+                       result.setSequenceProvider(sequenceProvider, false);
+                       SequenceIndexArea sequenceIndexArea = new SequenceIndexArea(result);
+                       //sequenceIndexArea.setFirstIndex(5);
+                       //sequenceIndexArea.setHeight(25);
+                       result.getDataAreas().getTopAreas().add(sequenceIndexArea);
+                       
+                       PherogramArea pherogramArea = new PherogramArea(result, pherogramProvider);
+                       pherogramArea.setFirstSeqPos(34 + 5);
+                       pherogramArea.setLeftCutPosition(34);
+                       pherogramArea.setRightCutPosition(820);
+                       pherogramArea.getAlignmentModel().setShiftChange(38, -1);
+                       pherogramArea.getAlignmentModel().setShiftChange(49, 2);
+                       result.getDataAreas().getSequenceAreas(sequenceProvider.sequenceIDByName("Sequence 4")).add(pherogramArea);
+                       
+                       result.getDataAreas().getBottomAreas().add(new ConsensusSequenceArea(result));
+                       return result;
+               }
+               catch (Exception e) {
+                       throw new RuntimeException(e);
+               }
+               
+//             Alignment<DNASequence, NucleotideCompound> alignment = 
+//                             new SimpleAlignment<DNASequence, NucleotideCompound>();
+//             alignment.add("Sequence 1", new DNASequence("ATCGTAGATCGTAGATCGTAGATCGTAGATCGTAGATCGTAGATCGTAG"));
+//             alignment.add("Sequence 2", new DNASequence("AT-GTTG"));
+//             alignment.add("Sequence 3", new DNASequence("AT-GTAG"));
+//             
+//             BioJavaSequenceDataProvider<DNASequence, NucleotideCompound> sequenceProvider = 
+//                             new BioJavaSequenceDataProvider<DNASequence, NucleotideCompound>(
+//                                             new BioJavaTokenSet<NucleotideCompound>(
+//                                                             AlignmentAmbiguityNucleotideCompoundSet.getAlignmentAmbiguityNucleotideCompoundSet()),
+//                                             alignment);
+//             
+//             AlignmentArea result = new AlignmentArea();
+//             result.setSequenceProvider(sequenceProvider, false);
+//             SequenceIndexArea sequenceIndexArea = new SequenceIndexArea(result);
+//             //sequenceIndexArea.setFirstIndex(5);
+//             //sequenceIndexArea.setHeight(25);
+//             result.getDataAreas().getTopAreas().add(sequenceIndexArea);
+//             result.getDataAreas().getBottomAreas().add(new ConsensusSequenceArea(result));
+//             return result;
+       }
+       
+       
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+     */
+    @Override
+    public void createPartControl(Composite parent) {
+       alignmentArea = createAlignmentArea();
+               Composite alignmentWidget = alignmentArea.createSWTWidget(parent, SWT.NONE);
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+     */
+    @Override
+    public void doSave(IProgressMonitor monitor) {
+        // TODO Auto-generated method stub
+
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+     */
+    @Override
+    public void doSaveAs() {
+        // TODO Auto-generated method stub
+
+    }
+    
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+     */
+    @Override
+    public void init(IEditorSite site, IEditorInput input) throws PartInitException {
+        setSite(site);
+        setInput(input);
+    }
+    
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.part.EditorPart#isDirty()
+     */
+    @Override
+    public boolean isDirty() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+     */
+    @Override
+    public boolean isSaveAsAllowed() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+    
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
+     */
+    @Override
+    public void setFocus() {
+       alignmentArea.getToolkitComponent().redistributeHeight();
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java
new file mode 100644 (file)
index 0000000..9d25d66
--- /dev/null
@@ -0,0 +1,83 @@
+// $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 org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+
+
+/**
+ * @author pplitzner
+ * @author Ben Stöver
+ * @date 04.08.2014
+ */
+public class AlignmentEditorInput implements IEditorInput {
+    private static final String name = "AlignmentEditor";
+    
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+     */
+    @Override
+    public Object getAdapter(Class adapter) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#exists()
+     */
+    @Override
+    public boolean exists() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
+     */
+    @Override
+    public ImageDescriptor getImageDescriptor() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+    
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getName()
+     */
+    @Override
+    public String getName() {
+        return name;
+    }
+    
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getPersistable()
+     */
+    @Override
+    public IPersistableElement getPersistable() {
+        return null;
+    }
+    
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IEditorInput#getToolTipText()
+     */
+    @Override
+    public String getToolTipText() {
+        return name;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CMDAlignmentObjectPlaceholder.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CMDAlignmentObjectPlaceholder.java
new file mode 100644 (file)
index 0000000..589b1c2
--- /dev/null
@@ -0,0 +1,76 @@
+package eu.etaxonomy.taxeditor.editor.molecular;\r
+\r
+\r
+import info.bioinfweb.libralign.dataarea.implementations.pherogram.ShiftChange;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import java.util.Map;\r
+import java.util.TreeMap;\r
+\r
+import org.biojava3.core.sequence.compound.NucleotideCompound;\r
+import org.biojava3.core.sequence.template.Sequence;\r
+\r
+\r
+\r
+/**\r
+ * This class is used as a replacement for a class representing the CMD objects storing an contig alignment during early\r
+ * development phase.\r
+ * \r
+ * @author Ben Stöver\r
+ * @date 06.08.2014\r
+ */\r
+public class CMDAlignmentObjectPlaceholder {\r
+       /**\r
+        * Represents information in the contig alignment describing a single read sequence and the relation to its associated\r
+        * pherogram.\r
+        * \r
+        * @author Ben Stöver\r
+     * @date 06.08.2014\r
+        */\r
+       public static class Read {\r
+               private long pherogramObjectID = Long.MIN_VALUE;  // The ID used in the CMD to identify the object storing the pherogram URL. (Dont' know if this is long, just as an example-)\r
+               private Sequence<NucleotideCompound> editableSequence = null;  // Could also be of type String, if helpful for CDM architecture.\r
+               private List<ShiftChange> shiftChangeList = new ArrayList<ShiftChange>();\r
+               \r
+               \r
+               public Read(long pherogramObjectID) {\r
+                       super();\r
+                       this.pherogramObjectID = pherogramObjectID;\r
+               }\r
+\r
+\r
+               public long getPherogramObjectID() {\r
+                       return pherogramObjectID;\r
+               }\r
+\r
+\r
+               public void setPherogramObjectID(long pherogramObjectID) {\r
+                       this.pherogramObjectID = pherogramObjectID;\r
+               }\r
+\r
+\r
+               public List<ShiftChange> getShiftChangeList() {\r
+                       return shiftChangeList;\r
+               }\r
+\r
+\r
+               public Sequence<NucleotideCompound> getEditableSequence() {\r
+                       return editableSequence;\r
+               }\r
+       }\r
+       \r
+       \r
+       private Map<String, Sequence<NucleotideCompound>> consensusSequences = new TreeMap<String, Sequence<NucleotideCompound>>();    // Could also be of type Map<String, String>, if helpful for CDM architecture.\r
+       private Map<Long, Read> readSequences = new TreeMap<Long, Read>();\r
+       \r
+       \r
+       public Map<String, Sequence<NucleotideCompound>> getConsensusSequences() {\r
+               return consensusSequences;\r
+       }\r
+       \r
+       \r
+       public Map<Long, Read> getReadSequences() {\r
+               return readSequences;\r
+       }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf b/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf
new file mode 100644 (file)
index 0000000..e680999
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf differ
index 7c95b583fcd7040a62be4722c8119d5f1ae50409..3446faf90f1926ee4bb2b230c4ec8ee62efaabbc 100644 (file)
@@ -1,12 +1,12 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.application"/>
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.bulkeditor"/>
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.cdmlib"/>
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.editor"/>
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.navigation"/>
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.printpublisher"/>
-       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.store"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-       <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.application"/>\r
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.bulkeditor"/>\r
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.cdmlib"/>\r
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.editor"/>\r
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.navigation"/>\r
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.printpublisher"/>\r
+       <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.store"/>\r
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
+       <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r