Initial import of plugin files
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 14 Jul 2015 12:20:50 +0000 (12:20 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 14 Jul 2015 12:20:50 +0000 (12:20 +0000)
39 files changed:
.gitattributes
eu.etaxonomy.taxeditor.molecular/.classpath [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/.project [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_de.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_en.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/build.properties [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/icons/insert-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/icons/overwrite-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-left-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-left-disabled-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-right-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-right-disabled-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/plugin.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/pom.xml [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/TaxeditorMolecularPlugin.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditor.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditorInput.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/PherogramMouseListener.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/PherogramViewPart.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/AbstractAlignmentEditorHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/AbstractPherogramComponentHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ChangePherogramQualityOutputType.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CreateConsensusSequenceHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CutPherogramLeftHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CutPherogramRightHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/EditSequenceHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/HandlerTools.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/LoadPherogramHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ReverseComplementHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ShowPherogramHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/SpecimenPropertyTester.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleInsertOverwriteHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleLeftRightInsertionHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleShowPherogramBaseCallLinesHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleShowPherogramProbabilitiesHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/UpdateConsensusSequenceHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/package-info.java [new file with mode: 0644]

index 3bddeb6..ed822cf 100644 (file)
@@ -969,6 +969,44 @@ eu.etaxonomy.taxeditor.help/src/eu/etaxonomy/taxeditor/help/Activator.java -text
 eu.etaxonomy.taxeditor.help/toc.xml -text
 eu.etaxonomy.taxeditor.help/tocgettingstarted.xml -text
 eu.etaxonomy.taxeditor.help/tocnameparser.xml -text
+eu.etaxonomy.taxeditor.molecular/.classpath -text
+eu.etaxonomy.taxeditor.molecular/.project -text
+eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF -text
+eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin.properties -text
+eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_de.properties -text
+eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_en.properties -text
+eu.etaxonomy.taxeditor.molecular/build.properties -text
+eu.etaxonomy.taxeditor.molecular/icons/insert-16x16.png -text
+eu.etaxonomy.taxeditor.molecular/icons/overwrite-16x16.png -text
+eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-left-16x16.png -text
+eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-left-disabled-16x16.png -text
+eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-right-16x16.png -text
+eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-right-disabled-16x16.png -text
+eu.etaxonomy.taxeditor.molecular/plugin.xml -text
+eu.etaxonomy.taxeditor.molecular/pom.xml -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/TaxeditorMolecularPlugin.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditor.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditorInput.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/PherogramMouseListener.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/PherogramViewPart.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/AbstractAlignmentEditorHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/AbstractPherogramComponentHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ChangePherogramQualityOutputType.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CreateConsensusSequenceHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CutPherogramLeftHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CutPherogramRightHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/EditSequenceHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/HandlerTools.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/LoadPherogramHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ReverseComplementHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ShowPherogramHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/SpecimenPropertyTester.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleInsertOverwriteHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleLeftRightInsertionHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleShowPherogramBaseCallLinesHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleShowPherogramProbabilitiesHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/UpdateConsensusSequenceHandler.java -text
+eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/package-info.java -text
 eu.etaxonomy.taxeditor.navigation/.classpath -text
 eu.etaxonomy.taxeditor.navigation/.project -text
 eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF -text
diff --git a/eu.etaxonomy.taxeditor.molecular/.classpath b/eu.etaxonomy.taxeditor.molecular/.classpath
new file mode 100644 (file)
index 0000000..c5dd8f3
--- /dev/null
@@ -0,0 +1,20 @@
+<?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.7"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry including="**/*.java" kind="src" path="src"/>
+       <classpathentry kind="lib" path="commons-logging-1.1.1.jar" sourcepath="/home/pplitzner/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-sources.jar">
+               <attributes>
+                       <attribute name="javadoc_location" value="jar:file:/home/pplitzner/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1-javadoc.jar!/"/>
+               </attributes>
+       </classpathentry>
+       <classpathentry exported="true" kind="lib" path="bioinfweb-commons-bio-2-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="bioinfweb-commons-core-2-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="bioinfweb-commons-swing-2-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="bioinfweb-commons-swt-2-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="libralign-core-0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="libralign-swt-0-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="tic-core-2-SNAPSHOT.jar"/>
+       <classpathentry exported="true" kind="lib" path="tic-swt-2-SNAPSHOT.jar"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/eu.etaxonomy.taxeditor.molecular/.project b/eu.etaxonomy.taxeditor.molecular/.project
new file mode 100644 (file)
index 0000000..c19e354
--- /dev/null
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>eu.etaxonomy.taxeditor.molecular</name>
+       <comment>Provides editors, views and operations for handling molecular data and alignments. 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>
+       <linkedResources>
+               <link>
+                       <name>bioinfweb-commons-bio-2-SNAPSHOT.jar</name>
+                       <type>1</type>
+                       <location>/home/pplitzner/.m2/repository/info/bioinfweb/commons/java/bioinfweb-commons-bio/2-SNAPSHOT/bioinfweb-commons-bio-2-SNAPSHOT.jar</location>
+               </link>
+               <link>
+                       <name>bioinfweb-commons-core-2-SNAPSHOT.jar</name>
+                       <type>1</type>
+                       <location>/home/pplitzner/.m2/repository/info/bioinfweb/commons/java/bioinfweb-commons-core/2-SNAPSHOT/bioinfweb-commons-core-2-SNAPSHOT.jar</location>
+               </link>
+               <link>
+                       <name>bioinfweb-commons-swing-2-SNAPSHOT.jar</name>
+                       <type>1</type>
+                       <location>/home/pplitzner/.m2/repository/info/bioinfweb/commons/java/bioinfweb-commons-swing/2-SNAPSHOT/bioinfweb-commons-swing-2-SNAPSHOT.jar</location>
+               </link>
+               <link>
+                       <name>bioinfweb-commons-swt-2-SNAPSHOT.jar</name>
+                       <type>1</type>
+                       <location>/home/pplitzner/.m2/repository/info/bioinfweb/commons/java/bioinfweb-commons-swt/2-SNAPSHOT/bioinfweb-commons-swt-2-SNAPSHOT.jar</location>
+               </link>
+               <link>
+                       <name>commons-logging-1.1.1.jar</name>
+                       <type>1</type>
+                       <location>/home/pplitzner/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar</location>
+               </link>
+               <link>
+                       <name>libralign-core-0-SNAPSHOT.jar</name>
+                       <type>1</type>
+                       <location>/home/pplitzner/.m2/repository/info/bioinfweb/libralign/libralign-core/0-SNAPSHOT/libralign-core-0-SNAPSHOT.jar</location>
+               </link>
+               <link>
+                       <name>libralign-swt-0-SNAPSHOT.jar</name>
+                       <type>1</type>
+                       <location>/home/pplitzner/.m2/repository/info/bioinfweb/libralign/libralign-swt/0-SNAPSHOT/libralign-swt-0-SNAPSHOT.jar</location>
+               </link>
+               <link>
+                       <name>tic-core-2-SNAPSHOT.jar</name>
+                       <type>1</type>
+                       <location>/home/pplitzner/.m2/repository/info/bioinfweb/tic/tic-core/2-SNAPSHOT/tic-core-2-SNAPSHOT.jar</location>
+               </link>
+               <link>
+                       <name>tic-swt-2-SNAPSHOT.jar</name>
+                       <type>1</type>
+                       <location>/home/pplitzner/.m2/repository/info/bioinfweb/tic/tic-swt/2-SNAPSHOT/tic-swt-2-SNAPSHOT.jar</location>
+               </link>
+       </linkedResources>
+</projectDescription>
diff --git a/eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF b/eu.etaxonomy.taxeditor.molecular/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..5814c85
--- /dev/null
@@ -0,0 +1,26 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Molecular Bundle
+Bundle-SymbolicName: eu.etaxonomy.taxeditor.molecular;singleton:=true
+Bundle-Version: 3.6.1.SNAPSHOT
+Bundle-Activator: eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.expressions,
+ eu.etaxonomy.taxeditor.store,
+ eu.etaxonomy.taxeditor.cdmlib,
+ eu.etaxonomy.taxeditor.editor
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: EDIT
+Bundle-ClassPath: .,
+ commons-logging-1.1.1.jar,
+ bioinfweb-commons-bio-2-SNAPSHOT.jar,
+ bioinfweb-commons-core-2-SNAPSHOT.jar,
+ bioinfweb-commons-swing-2-SNAPSHOT.jar,
+ bioinfweb-commons-swt-2-SNAPSHOT.jar,
+ libralign-core-0-SNAPSHOT.jar,
+ libralign-swt-0-SNAPSHOT.jar,
+ tic-core-2-SNAPSHOT.jar,
+ tic-swt-2-SNAPSHOT.jar
+Import-Package: eu.etaxonomy.cdm.model.molecular
diff --git a/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin.properties b/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin.properties
new file mode 100644 (file)
index 0000000..1c03030
--- /dev/null
@@ -0,0 +1,164 @@
+#Properties file for taxeditor-editor\r
+Bundle-Vendor.0 = EDIT\r
+Bundle-Name.0 = EDIT Taxonomic Editor - Editor Bundle\r
+command.name.17 = Set Basionym\r
+command.name.18 = Remove Basionym\r
+editor.name = Multipage Taxon Editor\r
+editor.name.0 = Taxon Name Editor\r
+editor.name.1 = Key\r
+editor.name.2 = Polytomous Key Graph Editor\r
+editor.name.3 = Polytomous Key List Editor\r
+editor.name.4 = Cdm Authority Editor\r
+editor.name.5 = Derivative View\r
+view.name = Factual Data\r
+view.name.0 = Uses\r
+view.name.1 = Media\r
+view.name.2 = Concept Relations\r
+view.name.3 = Concept Graph\r
+category.name = Taxonomic Editor\r
+command.label = Reference\r
+command.label.0 = Name\r
+command.label.1 = Team\r
+command.label.2 = Person\r
+command.label.3 = Specimen\r
+command.label.4 = Factual Data\r
+command.label.5 = Media\r
+command.label.6 = Concept\r
+command.label.7 = Concept Graph\r
+command.label.8 = Open Parent\r
+menu.label = New\r
+command.label.9 = Heterotypic Synonym\r
+command.label.10 = Homotypic Synonym\r
+command.label.11 = Synonym In Homotypical Group\r
+menu.label.0 = Change To\r
+command.label.12 = Accepted Taxon\r
+command.label.13 = Synonym\r
+command.label.14 = Misapplication\r
+command.label.15 = Delete\r
+command.label.16 = Delete All Empty Names\r
+command.label.17 = Swap Synonym With Accepted\r
+command.label.18 = Show Details\r
+command.label.19 = Save\r
+command.label.20 = New Node\r
+command.label.21 = Delete\r
+command.label.22 = Apply Layout\r
+command.label.23 = New Key Number\r
+command.label.24 = New Alternative\r
+command.label.25 = Refresh Nodes\r
+command.label.26 = Delete\r
+command.label.27 = New Factual Data\r
+menu.label.1 = New\r
+command.label.28 = Move Description to Taxon\r
+command.label.29 = Move Elements to Taxon\r
+command.label.30 = Delete\r
+command.label.31 = Save\r
+menu.label.2 = New Derivative\r
+command.label.32 = New Use\r
+command.label.33 = New Use Summary\r
+command.label.34 = New Use Record\r
+command.label.35 = Delete\r
+command.label.36 = Save\r
+command.label.37 = New Image Gallery\r
+command.label.38 = New Image\r
+command.label.39 = Move Image Up In List\r
+command.label.40 = Move Image Down In List\r
+command.label.41 = Delete\r
+command.label.42 = Save\r
+menu.label.3 = New\r
+command.label.43 = Open Related Concept\r
+command.label.44 = Delete\r
+command.label.45 = Edit Authorities\r
+extension.name = Name Commands\r
+category.name.0 = -- Name Editor\r
+command.name = Open Parent\r
+command.name.0 = Create Homotypic Synonym\r
+command.name.1 = Create Heterotypic Synonym\r
+command.name.2 = Create Synonym In Homotypical Group\r
+command.name.3 = Change To Synonym\r
+command.name.4 = Change To Accepted Taxon\r
+command.name.5 = Change To Misapplication\r
+command.name.6 = Swap Synonym With Accepted\r
+\r
+command.name.7 = Set Basionym / Original Combination\r
+command.name.8 = Remove Basionym / Original Combination\r
+command.name.9 = Delete All Empty Names\r
+category.name.1 = -- Factual\r
+command.name.10 = Create Description Element\r
+command.name.11 = New Description\r
+command.name.12 = Move Description Elements to Taxon\r
+command.name.13 = Move Description to Taxon\r
+category.name.2 = -- New Uses\r
+command.name.14 = New Use\r
+command.name.15 = New Use Summary\r
+command.name.16 = New Use Record\r
+category.name.3 = -- Media\r
+command.name.19 = Move Image Down In List\r
+command.name.20 = New Image Gallery\r
+command.name.21 = New Image\r
+command.name.22 = Move Image Up In List\r
+category.name.4 = -- New Entity\r
+command.name.23 = New Reference\r
+command.name.24 = New Name\r
+command.name.25 = New Team\r
+command.name.26 = New Person\r
+command.name.27 = New Specimen\r
+category.name.5 = -- Polytomous Keys\r
+command.name.28 = New Child Node\r
+command.name.29 = New Sibling Node\r
+command.name.30 = Refresh Node Numbering\r
+command.name.31 = Apply Layout\r
+category.name.6 = -- Concept Relations\r
+command.name.32 = Create Concept Relation\r
+command.name.33 = Open Related Concept\r
+category.name.7 = -- Group\r
+command.name.34 = Edit CDM Authorities\r
+command.name.35 = Open Derivative View\r
+scheme.description = The default key binding scheme for the Taxonomic Editor\r
+scheme.name = Taxonomic Editor Default Key Bindings\r
+editor.name.6 = Specimen Import Editor\r
+editor.name.7 = Gbif Import Editor\r
+editor.name.8 = Checklist Editor\r
+view.name.4 = Specimen Import\r
+view.name.5 = GBIF Specimen Import\r
+command.label.46 = Name\r
+command.label.47 = Reference\r
+command.label.48 = Datasource\r
+command.label.49 = Misapplication\r
+command.label.50 = Use Existing Image\r
+command.name.36 = Create Misapplication\r
+command.name.37 = Use Existing Image\r
+command.name.38 = Open Checklist Editor\r
+command.name.39 = New Datasource\r
+wizard.name = Specimen Search/Import\r
+wizard.description = Queries data provider for specimens with specified parameters.\nNote: Query results are currently limited to 100.\r
+command.name.40 = Validation\r
+view.name.6 = Validation\r
+marker.field.0 = Object Type\r
+marker.field.1 = Object\r
+marker.field.2 = Attribute\r
+marker.field.3 = Problematic Value\r
+marker.field.4 = Problem description\r
+marker.field.5 = Validator\r
+marker.field.6 = Entity Class\r
+marker.field.7 = Entity Id\r
+extension.name.0 = Validation Error\r
+command.label.51 = Open in Specimen Editor\r
+command.label.52 = Delete\r
+command.label.53 = Create Field Unit\r
+command.label.54 = Delete (with children)\r
+command.tooltip = Show Only Individuals Associations\r
+command.label.55 = Open Associated Specimens\r
+command.name.41 = Show Only Individual Associations\r
+command.name.42 = Open Taxon Editor\r
+command.name.43 = Create Field Unit\r
+command.name.44 = Deep Delete\r
+command.name.46 = Move Synonym (Homotypical Group) to another Accepted Taxon\r
+command.label.56 = Move Synonym (Homotypical Group) to another Accepted Taxon\r
+markerContentGenerator.name = Validation Problems Marker Generator\r
+command.name.45 = Delete\r
+command.name.47 = Delete\r
+commandParameter.name = taxonUUID\r
+Bundle-Name = Editor Bundle\r
+command.name.48 = delete\r
+command.name.49 = delete\r
+command.name.50 = delete
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_de.properties b/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_de.properties
new file mode 100644 (file)
index 0000000..8c098c3
--- /dev/null
@@ -0,0 +1,156 @@
+# Properties file for taxeditor-editor
+Bundle-Vendor.0 = EDIT
+Bundle-Name.0 = EDIT Taxonomischer Editor - Editor Bundle
+command.name.17 = Setze Basionym
+command.name.18 = Entferne Basionym
+editor.name = Multipage Taxon Editor
+editor.name.0 = Editor Taxonname
+editor.name.1 = Bestimmungsschl\u00fcssel
+editor.name.2 = Polytomer Bestimmungsschl\u00fcssel Graph Editor
+editor.name.3 = Polytomer Bestimmungsschl\u00fcssel List Editor
+editor.name.4 = CDM Rechtemanagement
+editor.name.5 = Ansicht Derivate
+view.name = Faktendaten
+view.name.0 = Nutzung
+view.name.1 = Medien
+view.name.2 = Konzeptrelationen
+view.name.3 = Konzeptgraph
+category.name = Taxonomischer Editor
+command.label = Referenz
+command.label.0 = Name
+command.label.1 = Team
+command.label.2 = Person
+command.label.3 = Beleg
+command.label.4 = Faktendaten
+command.label.5 = Medien
+command.label.6 = Konzeptrelationen
+command.label.7 = Konzeptgraph
+command.label.8 = \u00d6ffne Parent
+menu.label = Neue
+command.label.9 = Heterotypisches Synonym
+command.label.10 = Homotypisches Synonym
+command.label.11 = Synonym in Homotypischer Gruppe
+menu.label.0 = \u00c4ndere zu
+command.label.12 = Akzeptiertes Taxon
+command.label.13 = Synonym
+command.label.14 = Misapplication
+command.label.15 = L\u00f6schen
+command.label.16 = L\u00f6sche alle leeren Namen
+command.label.17 = Tausche Synonym mit akzeptiertem Namen
+command.label.18 = Zeige Details
+command.label.19 = Speichern
+command.label.20 = Neue Knoten
+command.label.21 = L\u00f6schen
+command.label.22 = Wende Layout an
+command.label.23 = Neue Bestimmungsschl\u00fcsselnummer
+command.label.24 = Neue Alternative
+command.label.25 = Erneuere Knoten
+command.label.26 = L\u00f6schen
+command.label.27 = Neue Faktendaten
+menu.label.1 = Neue
+command.label.28 = Verschiebe Eigenschaften zu Taxon
+command.label.29 = Verschiebe Elemente zu Taxon
+command.label.30 = L\u00f6schen
+command.label.31 = Speichern
+menu.label.2 = Neue Derivate
+command.label.32 = Neue Nutzung
+command.label.33 = Neue Zusammenfassung
+command.label.34 = Neuer Nutzungsdatensatz
+command.label.35 = L\u00f6schen
+command.label.36 = Speichern
+command.label.37 = Neue Bildergalerie
+command.label.38 = Neues Bild
+command.label.39 = Bild nach oben
+command.label.40 = Bild nach unten
+command.label.41 = L\u00f6schen
+command.label.42 = Speichern
+menu.label.3 = Neue
+command.label.43 = \u00d6ffne verbundenes Konzept
+command.label.44 = L\u00f6schen
+command.label.45 = Bearbeite Rechte
+extension.name = Namensbefehle
+category.name.0 = -- Namenseditor
+command.name = \u00d6ffne Elter
+command.name.0 = Erstelle homotypisches Synonym
+command.name.1 = Erstelle heterotypisches Synonym
+command.name.2 = Erstelle Synonym in homotypischer Gruppe
+command.name.3 = \u00c4ndere zu Synonym
+command.name.4 = \u00c4ndere zu akzeptiertem Taxon
+command.name.5 = \u00c4ndere zu Misapplication
+command.name.6 = Tausche Synonym mit akzeptiertem Namen
+
+command.name.7 = Setze Basionym / Originalkombination
+command.name.8 = Entferne Basionym / Originalkombination
+command.name.9 = L\u00f6sche alle leeren Namen
+category.name.1 = -- Fakten
+command.name.10 = Erstelle Beschreibungselement
+command.name.11 = Neue Beschreibung
+command.name.12 = Bewege Beschreibungselement zu Taxon
+command.name.13 = Bewege Beschreibung zu Taxon
+category.name.2 = -- Neue Nutzung
+command.name.14 = Neue Nutzung
+command.name.15 = Neue Zusammenfassung
+command.name.16 = Neuer Nutzungsdatensatz
+category.name.3 = -- Media
+command.name.19 = Bewege Bild nach unten
+command.name.20 = Neue Bildergalerie
+command.name.21 = Neues Bild
+command.name.22 = Bewege Bild nach oben
+category.name.4 = -- Neue Entit\u00e4t
+command.name.23 = Neue Referenz
+command.name.24 = Neuer Name
+command.name.25 = Neues Team
+command.name.26 = Neue Person
+command.name.27 = Neuer Beleg
+category.name.5 = -- Polytomer Bestimmungsschl\u00fcssel
+command.name.28 = Neue Kinderknoten
+command.name.29 = Neuer Geschwisterknoten
+command.name.30 = Knotennummerierung aktualisieren
+command.name.31 = Layout anwenden
+category.name.6 = -- Konzeptbeziehungen
+command.name.32 = Erstelle Konzeptrelationen
+command.name.33 = \u00d6ffne verbundenes Konzept
+category.name.7 = -- Gruppe
+command.name.34 = Bearbeite CDM Rechte
+command.name.35 = \u00d6ffne Derivate Ansicht
+scheme.description = Die Standard Tastenkombinationsschema f\u00fcr den Taxonomischen Editor
+scheme.name = Taxonomic Editor Standard Tastenkombinationen
+editor.name.6 = Specimen Import Editor
+editor.name.7 = GBIF Import Editor
+editor.name.8 = Checklist Editor
+view.name.4 = Specimen Import
+view.name.5 = GBIF Specimen Import
+command.label.46 = Name
+command.label.47 = Referenz
+command.label.48 = Datenquelle
+command.label.49 = Misapplication
+command.label.50 = Benutze vorhandenes Bild
+command.name.36 = Erstelle Misapplication
+command.name.37 = Benutze vorhandenes Bild
+command.name.38 = \u00d6ffne Checklist Editor
+command.name.39 = Neue Datenquelle
+wizard.name = Specimen Suche/Import
+wizard.description = Sendet eine Anfrage mit den eingegebenen Parametern an den Datenprovider.\nHinweis: Die Anzahl der Anfrageergebnisse sind auf 100 begrenzt.
+command.name.40 = Validierung
+view.name.6 = Validierung
+marker.field.0 = Objekttyp
+marker.field.1 = Objekt
+marker.field.2 = Attribut
+marker.field.3 = Problematischer Wert
+marker.field.4 = Problembeschreibung
+marker.field.5 = Validierer
+marker.field.6 = Entit�tsklasse
+marker.field.7 = Entit�ts ID
+extension.name.0 = Validierungs-Fehler
+command.label.51 = \u00d6ffne Specimen-Editor
+command.label.52 = L\u00f6schen
+command.label.53 = Neue Field Unit
+command.label.54 = L\u00f6schen (mit Kindern)
+command.tooltip = Nur Individuals Associations anzeigen
+command.label.55 = \u00d6ffne zugeh\u00f6rige Specimens
+command.name.41 = Nur Individuals Associations anzeigen
+command.name.42 = \u00d6ffne Taxon Editor
+command.name.43 = Neue Field Unit
+command.name.44 = L\u00f6schen (mit Kindern)
+command.name.46 = Verschiebe Synonym(Homotypische Gruppe) zu neuem Akzeptierten Taxon
+command.label.56 = Verschiebe Synonym(Homotypische Gruppe) zu neuem Akzeptierten Taxon
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_en.properties b/eu.etaxonomy.taxeditor.molecular/OSGI-INF/l10n/plugin_en.properties
new file mode 100644 (file)
index 0000000..65d48ba
--- /dev/null
@@ -0,0 +1,141 @@
+#Properties file for taxeditor-editor\r
+Bundle-Vendor.0 = EDIT\r
+Bundle-Name.0 = EDIT Taxonomic Editor - Editor Bundle\r
+command.name.17 = Set Basionym\r
+command.name.18 = Remove Basionym\r
+editor.name = Multipage Taxon Editor\r
+editor.name.0 = Taxon Name Editor\r
+editor.name.1 = Key\r
+editor.name.2 = Polytomous Key Graph Editor\r
+editor.name.3 = Polytomous Key List Editor\r
+editor.name.4 = Cdm Authority Editor\r
+editor.name.5 = Derivate View\r
+view.name = Factual Data\r
+view.name.0 = Uses\r
+view.name.1 = Media\r
+view.name.2 = Concept Relations\r
+view.name.3 = Concept Graph\r
+category.name = Taxonomic Editor\r
+command.label = Reference\r
+command.label.0 = Name\r
+command.label.1 = Team\r
+command.label.2 = Person\r
+command.label.3 = Specimen\r
+command.label.4 = Factual Data\r
+command.label.5 = Media\r
+command.label.6 = Concept\r
+command.label.7 = Concept Graph\r
+command.label.8 = Open Parent\r
+menu.label = New\r
+command.label.9 = Heterotypic Synonym\r
+command.label.10 = Homotypic Synonym\r
+command.label.11 = Synonym In Homotypical Group\r
+menu.label.0 = Change To\r
+command.label.12 = Accepted Taxon\r
+command.label.13 = Synonym\r
+command.label.14 = Misapplication\r
+command.label.15 = Delete\r
+command.label.16 = Delete All Empty Names\r
+command.label.17 = Swap Synonym With Accepted\r
+command.label.18 = Show Details\r
+command.label.19 = Save\r
+command.label.20 = New Node\r
+command.label.21 = Delete\r
+command.label.22 = Apply Layout\r
+command.label.23 = New Key Number\r
+command.label.24 = New Alternative\r
+command.label.25 = Refresh Nodes\r
+command.label.26 = Delete\r
+command.label.27 = New Factual Data\r
+menu.label.1 = New\r
+command.label.28 = Move Description to Taxon\r
+command.label.29 = Move Elements to Taxon\r
+command.label.30 = Delete\r
+command.label.31 = Save\r
+menu.label.2 = New Derivate\r
+command.label.32 = New Use\r
+command.label.33 = New Use Summary\r
+command.label.34 = New Use Record\r
+command.label.35 = Delete\r
+command.label.36 = Save\r
+command.label.37 = New Image Gallery\r
+command.label.38 = New Image\r
+command.label.39 = Move Image Up In List\r
+command.label.40 = Move Image Down In List\r
+command.label.41 = Delete\r
+command.label.42 = Save\r
+menu.label.3 = New\r
+command.label.43 = Open Related Concept\r
+command.label.44 = Delete\r
+command.label.45 = Edit Authorities\r
+extension.name = Name Commands\r
+category.name.0 = -- Name Editor\r
+command.name = Open Parent\r
+command.name.0 = Create Homotypic Synonym\r
+command.name.1 = Create Heterotypic Synonym\r
+command.name.2 = Create Synonym In Homotypical Group\r
+command.name.3 = Change To Synonym\r
+command.name.4 = Change To Accepted Taxon\r
+command.name.5 = Change To Misapplication\r
+command.name.6 = Swap Synonym With Accepted\r
+command.name.7 = Set Basionym / Original Combination\r
+command.name.8 = Remove Basionym / Original Combination\r
+command.name.9 = Delete All Empty Names\r
+category.name.1 = -- Factual\r
+command.name.10 = Create Description Element\r
+command.name.11 = New Description\r
+command.name.12 = Move Description Elements to Taxon\r
+command.name.13 = Move Description to Taxon\r
+category.name.2 = -- New Uses\r
+command.name.14 = New Use\r
+command.name.15 = New Use Summary\r
+command.name.16 = New Use Record\r
+category.name.3 = -- Media\r
+command.name.19 = Move Image Down In List\r
+command.name.20 = New Image Gallery\r
+command.name.21 = New Image\r
+command.name.22 = Move Image Up In List\r
+category.name.4 = -- New Entity\r
+command.name.23 = New Reference\r
+command.name.24 = New Name\r
+command.name.25 = New Team\r
+command.name.26 = New Person\r
+command.name.27 = New Specimen\r
+category.name.5 = -- Polytomous Keys\r
+command.name.28 = New Child Node\r
+command.name.29 = New Sibling Node\r
+command.name.30 = Refresh Node Numbering\r
+command.name.31 = Apply Layout\r
+category.name.6 = -- Concept Relations\r
+command.name.32 = Create Concept Relation\r
+command.name.33 = Open Related Concept\r
+category.name.7 = -- Group\r
+command.name.34 = Edit CDM Authorities\r
+command.name.35 = Open Derivate View\r
+scheme.description = The default key binding scheme for the Taxonomic Editor\r
+scheme.name = Taxonomic Editor Default Key Bindingseditor.name.6 = Specimen Import Editor\r
+editor.name.7 = Gbif Import Editor\r
+editor.name.8 = Checklist Editor\r
+view.name.4 = Specimen Import\r
+view.name.5 = GBIF Specimen Import\r
+command.label.46 = Name\r
+command.label.47 = Reference\r
+command.label.48 = Datasource\r
+command.label.49 = Misapplication\r
+command.label.50 = Use Existing Image\r
+command.name.36 = Create Misapplication\r
+command.name.37 = Use Existing Image\r
+command.name.38 = Open Checklist Editor\r
+command.name.39 = New Datasource\r
+wizard.name = Specimen Search/Import\r
+wizard.description = Queries data provider for specimens with specified parameters.\nNote: Query results are currently limited to 100.\r
+command.name.40 = Validation\r
+view.name.6 = Validation\r
+marker.field.0 = Object Type\r
+marker.field.1 = Object\r
+marker.field.2 = Attribute\r
+marker.field.3 = Problematic Value\r
+marker.field.4 = Problem description\r
+marker.field.5 = Validator\r
+marker.field.6 = Entity Class\r
+marker.field.7 = Entity Id
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.molecular/build.properties b/eu.etaxonomy.taxeditor.molecular/build.properties
new file mode 100644 (file)
index 0000000..18f9637
--- /dev/null
@@ -0,0 +1,14 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               plugin.xml,\
+               lib/libralign-core-0-20150713.112743-1.jar,\
+               lib/libralign-swt-0-20150713.113034-1.jar,\
+               icons/,\
+               OSGI-INF/
+source.. = src/
+src.includes = src/,\
+               plugin.xml,\
+               icons/,\
+               OSGI-INF/,\
+               META-INF/
diff --git a/eu.etaxonomy.taxeditor.molecular/icons/insert-16x16.png b/eu.etaxonomy.taxeditor.molecular/icons/insert-16x16.png
new file mode 100644 (file)
index 0000000..6c9bce7
Binary files /dev/null and b/eu.etaxonomy.taxeditor.molecular/icons/insert-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.molecular/icons/overwrite-16x16.png b/eu.etaxonomy.taxeditor.molecular/icons/overwrite-16x16.png
new file mode 100644 (file)
index 0000000..d2aa9e2
Binary files /dev/null and b/eu.etaxonomy.taxeditor.molecular/icons/overwrite-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-left-16x16.png b/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-left-16x16.png
new file mode 100644 (file)
index 0000000..d36e479
Binary files /dev/null and b/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-left-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-left-disabled-16x16.png b/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-left-disabled-16x16.png
new file mode 100644 (file)
index 0000000..b7a23fa
Binary files /dev/null and b/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-left-disabled-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-right-16x16.png b/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-right-16x16.png
new file mode 100644 (file)
index 0000000..4d10fb1
Binary files /dev/null and b/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-right-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-right-disabled-16x16.png b/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-right-disabled-16x16.png
new file mode 100644 (file)
index 0000000..3f9fa7c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.molecular/icons/pherogram-insert-right-disabled-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.molecular/plugin.xml b/eu.etaxonomy.taxeditor.molecular/plugin.xml
new file mode 100644 (file)
index 0000000..0a11445
--- /dev/null
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.ui.editors">
+      <editor
+            class="eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor"
+            default="false"
+            id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor"
+            name="Alignment Editor">
+      </editor>
+   </extension>
+      <extension
+            point="org.eclipse.ui.views">
+         <view
+               allowMultiple="true"
+               class="eu.etaxonomy.taxeditor.molecular.editor.PherogramViewPart"
+               id="eu.etaxonomy.taxeditor.molecular.PherogramView"
+               name="PherogramView"
+               restorable="true">
+         </view>
+      </extension>
+      <extension
+            point="org.eclipse.ui.commands">
+         <command
+               defaultHandler="eu.etaxonomy.taxeditor.molecular.handler.EditSequenceHandler"
+               id="eu.etaxonomy.taxeditor.molecular.editSequence"
+               name="Edit Sequence">
+         </command>
+         <command
+               defaultHandler="eu.etaxonomy.taxeditor.molecular.handler.ShowPherogramHandler"
+               id="eu.etaxonomy.taxeditor.molecular.showPherogram"
+               name="Show Pherogram">
+         </command>
+         <command
+               id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.cutPherogramLeft"
+               name="Cut pherogram left">
+         </command>
+         <command
+               id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.cutPherogramRight"
+               name="Cut pherogram right">
+         </command>
+         <command
+               id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.reverseComplementRows"
+               name="Reverse complement selected rows">
+         </command>
+         <command
+               id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.createConsensus"
+               name="(Re)create consensus sequence">
+         </command>
+         <command
+               id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.updateConsensus"
+               name="Update consensus sequence">
+         </command>
+         <command
+               id="eu.etaxonomy.taxeditor.molecular.pherogramComponent.toggleShowProbabilities"
+               name="Toggle show probability values">
+         </command>
+         <command
+               id="eu.etaxonomy.taxeditor.molecular.pherogramComponent.toggleShowBaseCallLines"
+               name="Toggle show base call lines">
+         </command>
+         <command
+               id="eu.etaxonomy.taxeditor.molecular.pherogramComponent.changeQualityOutput"
+               name="Change quality output">
+         </command>
+         <command
+               defaultHandler="eu.etaxonomy.taxeditor.molecular.handler.OpenAlignmentEditorHandler"
+               id="eu.etaxonomy.taxeditor.molecular.OpenAlignmentEditor"
+               name="Open Alignment Editor">
+         </command>
+         <command
+               id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.loadPherogram"
+               name="Load Pherogram">
+         </command>
+         <command
+               id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleInsertOverwrite"
+               name="Toggle insert/overwrite">
+         </command>
+         <command
+               id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleLeftRightInsertion"
+               name="Toggle left/right insertion in base call sequence">
+         </command>
+      </extension>
+      <extension
+            point="org.eclipse.ui.menus">
+         <menuContribution
+               locationURI="toolbar:org.eclipse.ui.main.toolbar?after=eu.etaxonomy.taxeditor.navigation.search.toolbar">
+            <toolbar
+                  id="eu.etaxonomy.taxeditor.molecular.alignmentToolbar">
+               <command
+                     commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleInsertOverwrite"
+                     label="Toggle insert/overwrite"
+                     style="push">
+                  <visibleWhen
+                        checkEnabled="true">
+                     <with
+                           variable="activePartId">
+                        <equals
+                              value="eu.etaxonomy.taxeditor.molecular.AlignmentEditor">
+                        </equals>
+                     </with>
+                  </visibleWhen>
+               </command>
+               <command
+                     commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleLeftRightInsertion"
+                     icon="icons/pherogram-insert-left-16x16.png"
+                     style="push">
+                  <visibleWhen
+                        checkEnabled="false">
+                     <with
+                           variable="activePartId">
+                        <equals
+                              value="eu.etaxonomy.taxeditor.molecular.AlignmentEditor">
+                        </equals>
+                     </with>
+                  </visibleWhen>
+               </command>
+            </toolbar>
+         </menuContribution>
+         <menuContribution
+               allPopups="false"
+               locationURI="menu:org.eclipse.ui.main.menu">
+            <menu
+                  label="View">
+               <menu
+                     label="Pherogram">
+                  <command
+                        commandId="eu.etaxonomy.taxeditor.molecular.pherogramComponent.changeQualityOutput"
+                        style="push">
+                  </command>
+                  <command
+                        commandId="eu.etaxonomy.taxeditor.molecular.pherogramComponent.toggleShowProbabilities"
+                        style="push">
+                  </command>
+                  <command
+                        commandId="eu.etaxonomy.taxeditor.molecular.pherogramComponent.toggleShowBaseCallLines"
+                        style="push">
+                  </command>
+                  <visibleWhen
+                        checkEnabled="true">
+                     <with
+                           variable="activePartId">
+                        <or>
+                           <equals
+                                 value="eu.etaxonomy.taxeditor.molecular.AlignmentEditor">
+                           </equals>
+                           <equals
+                                 value="eu.etaxonomy.taxeditor.molecular.PherogramView">
+                           </equals>
+                        </or>
+                     </with>
+                  </visibleWhen>
+               </menu>
+            </menu>
+            <menu
+                  label="Alignment Editor">
+               <command
+                     commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.loadPherogram"
+                     style="push">
+               </command>
+               <command
+                     commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.cutPherogramLeft"
+                     id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.cutPherogramLeft"
+                     name="Cut pherogram left">
+               </command>
+               <command
+                     commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.cutPherogramRight"
+                     id="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.cutPherogramRight"
+                     style="push">
+               </command>
+               <command
+                     commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.reverseComplementRows"
+                     mnemonic="r"
+                     style="push">
+               </command>
+               <command
+                     commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.createConsensus"
+                     style="push">
+               </command>
+               <command
+                     commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.updateConsensus"
+                     style="push">
+               </command>
+               <visibleWhen
+                     checkEnabled="true">
+                  <with
+                        variable="activePartId">
+                     <equals
+                           value="eu.etaxonomy.taxeditor.molecular.AlignmentEditor">
+                     </equals>
+                  </with>
+               </visibleWhen>
+            </menu>
+         </menuContribution>
+         <menuContribution
+               locationURI="popup:eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView">
+            <command
+                  commandId="eu.etaxonomy.taxeditor.molecular.editSequence"
+                  label="Edit Sequence"
+                  style="push">
+               <visibleWhen
+                     checkEnabled="true">
+                  <reference
+                        definitionId="isSequence">
+                  </reference>
+               </visibleWhen>
+            </command>
+            <command
+                  commandId="eu.etaxonomy.taxeditor.molecular.showPherogram"
+                  label="Show Pherogram"
+                  style="push">
+               <visibleWhen
+                     checkEnabled="true">
+                  <reference
+                        definitionId="isSingleRead">
+                  </reference>
+               </visibleWhen>
+            </command>
+         </menuContribution>
+      </extension>
+      <extension
+            point="org.eclipse.ui.handlers">
+         <handler
+               class="eu.etaxonomy.taxeditor.molecular.handler.LoadPherogramHandler"
+               commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.loadPherogram">
+            <activeWhen>
+               <with
+                     variable="activePartId">
+                  <equals
+                        value="eu.etaxonomy.taxeditor.molecular.AlignmentEditor">
+                  </equals>
+               </with>
+            </activeWhen>
+         </handler>
+         <handler
+               class="eu.etaxonomy.taxeditor.molecular.handler.ToggleInsertOverwriteHandler"
+               commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleInsertOverwrite">
+         </handler>
+         <handler
+               class="eu.etaxonomy.taxeditor.molecular.handler.ToggleLeftRightInsertionHandler"
+               commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleLeftRightInsertion">
+         </handler>
+         <handler
+               class="eu.etaxonomy.taxeditor.molecular.handler.CutPherogramLeftHandler"
+               commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.cutPherogramLeft">
+         </handler>
+         <handler
+               class="eu.etaxonomy.taxeditor.molecular.handler.CutPherogramRightHandler"
+               commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.cutPherogramRight">
+         </handler>
+         <handler
+               class="eu.etaxonomy.taxeditor.molecular.handler.ReverseComplementHandler"
+               commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.reverseComplementRows">
+         </handler>
+         <handler
+               class="eu.etaxonomy.taxeditor.molecular.handler.CreateConsensusSequenceHandler"
+               commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.createConsensus">
+         </handler>
+         <handler
+               class="eu.etaxonomy.taxeditor.molecular.handler.UpdateConsensusSequenceHandler"
+               commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.updateConsensus">
+         </handler>
+         <handler
+               class="eu.etaxonomy.taxeditor.molecular.handler.ToggleShowPherogramProbabilitiesHandler"
+               commandId="eu.etaxonomy.taxeditor.molecular.pherogramComponent.toggleShowProbabilities">
+         </handler>
+         <handler
+               class="eu.etaxonomy.taxeditor.molecular.handler.ToggleShowPherogramBaseCallLinesHandler"
+               commandId="eu.etaxonomy.taxeditor.molecular.pherogramComponent.toggleShowBaseCallLines">
+         </handler>
+         <handler
+               class="eu.etaxonomy.taxeditor.molecular.handler.ChangePherogramQualityOutputType"
+               commandId="eu.etaxonomy.taxeditor.molecular.pherogramComponent.changeQualityOutput">
+         </handler>
+      </extension>
+      <extension
+            point="org.eclipse.core.expressions.definitions">
+         <definition
+               id="isSequence">
+            <with
+                  variable="selection">
+               <test
+                     property="eu.etaxonomy.taxeditor.molecular.SpecimenPropertyTester.isSequence">
+               </test>
+            </with>
+         </definition>
+         <definition
+               id="isSingleRead">
+            <with
+                  variable="selection">
+               <test
+                     property="eu.etaxonomy.taxeditor.molecular.SpecimenPropertyTester.isSingleRead">
+               </test>
+            </with>
+         </definition>
+      </extension>
+      <extension
+            point="org.eclipse.core.expressions.propertyTesters">
+         <propertyTester
+               class="eu.etaxonomy.taxeditor.molecular.handler.SpecimenPropertyTester"
+               id="eu.etaxonomy.taxeditor.molecular.SpecimenPropertyTester"
+               namespace="eu.etaxonomy.taxeditor.molecular.SpecimenPropertyTester"
+               properties="isSequence,isSingleRead"
+               type="org.eclipse.jface.viewers.IStructuredSelection">
+         </propertyTester>
+      </extension>
+      <extension
+            point="org.eclipse.ui.bindings">
+         <scheme
+               description="%scheme.description"
+               id="eu.etaxonomy.taxeditor.bindings.scheme.default"
+               name="%scheme.name">
+         </scheme>
+         <key
+               commandId="eu.etaxonomy.taxeditor.molecular.AlignmentEditor.loadPherogram"
+               schemeId="eu.etaxonomy.taxeditor.bindings.scheme.default"
+               sequence="M1+O">
+         </key>
+      </extension>
+      
+</plugin>
diff --git a/eu.etaxonomy.taxeditor.molecular/pom.xml b/eu.etaxonomy.taxeditor.molecular/pom.xml
new file mode 100644 (file)
index 0000000..06d8479
--- /dev/null
@@ -0,0 +1,106 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <parent>
+    <groupId>eu.etaxonomy</groupId>
+    <artifactId>taxeditor-parent</artifactId>
+    <version>3.6.1-SNAPSHOT</version>
+  </parent>
+
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>eu.etaxonomy.taxeditor.molecular</artifactId>
+  <packaging>eclipse-plugin</packaging>
+
+  <name>Molecular Bundle</name>
+  <description>Provides editors, views and operations for handling molecular data and alignments</description>
+
+  <!-- <build> -->
+  <!-- <plugins> -->
+  <!-- <plugin> -->
+  <!-- <groupId>org.apache.maven.plugins</groupId> -->
+  <!-- <artifactId>maven-dependency-plugin</artifactId> -->
+  <!-- <version>2.4</version> -->
+  <!-- <executions> -->
+  <!-- <execution> -->
+  <!-- <id>copy-dependencies</id> -->
+  <!-- <phase>validate</phase> -->
+  <!-- <goals> -->
+  <!-- <goal>copy-dependencies</goal> -->
+  <!-- </goals> -->
+  <!-- <configuration> -->
+  <!-- <includeGroupIds>info.bioinfweb.libralign, info.bioinfweb.commons.java</includeGroupIds> -->
+  <!-- <includeArtifactIds>libralign-swt, libralign-core</includeArtifactIds> -->
+  <!-- <outputDirectory>lib</outputDirectory> -->
+  <!-- <overWriteReleases>true</overWriteReleases> -->
+  <!-- <overWriteSnapshots>true</overWriteSnapshots> -->
+  <!-- <excludeTransitive>true</excludeTransitive> -->
+  <!-- </configuration> -->
+  <!-- </execution> -->
+  <!-- <execution> -->
+  <!-- <id>copy-dependencies-sources</id> -->
+  <!-- <phase>validate</phase> -->
+  <!-- <goals> -->
+  <!-- <goal>copy-dependencies</goal> -->
+  <!-- </goals> -->
+  <!-- <configuration> -->
+  <!-- <classifier>sources</classifier> -->
+  <!-- <includeArtifactIds>cdmlib-commons,cdmlib-model,cdmlib-persistence,cdmlib-remote,cdmlib-print,cdmlib-services,cdmlib-ext,cdmlib-io</includeArtifactIds> -->
+  <!-- <outputDirectory>lib</outputDirectory> -->
+  <!-- <overWriteReleases>true</overWriteReleases> -->
+  <!-- <overWriteSnapshots>true</overWriteSnapshots> -->
+  <!-- <excludeTransitive>true</excludeTransitive> -->
+  <!-- <failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact> -->
+  <!-- </configuration> -->
+  <!-- </execution> -->
+  <!-- </executions> -->
+  <!-- </plugin> -->
+  <!-- </plugins> -->
+  <!-- </build> -->
+
+  <dependencies>
+    <dependency>
+      <groupId>info.bioinfweb.libralign</groupId>
+      <artifactId>libralign-core</artifactId>
+      <version>0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>info.bioinfweb.libralign</groupId>
+      <artifactId>libralign-swt</artifactId>
+      <version>0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>info.bioinfweb.commons.java</groupId>
+      <artifactId>bioinfweb-commons-swt</artifactId>
+      <version>2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>info.bioinfweb.commons.java</groupId>
+      <artifactId>bioinfweb-commons-core</artifactId>
+      <version>2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>info.bioinfweb.commons.java</groupId>
+      <artifactId>bioinfweb-commons-bio</artifactId>
+      <version>2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>info.bioinfweb.commons.java</groupId>
+      <artifactId>bioinfweb-commons-swing</artifactId>
+      <version>2-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>info.bioinfweb.tic</groupId>
+      <artifactId>tic-core</artifactId>
+      <version>2-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+
+  <repositories>
+    <repository>
+      <id>bioinfweb-maven-repo</id>
+      <name>bioinfweb repository</name>
+      <url>http://bioinfweb.info/MavenRepository/</url>
+    </repository>
+  </repositories>
+
+</project>
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/TaxeditorMolecularPlugin.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/TaxeditorMolecularPlugin.java
new file mode 100644 (file)
index 0000000..77818ed
--- /dev/null
@@ -0,0 +1,44 @@
+package eu.etaxonomy.taxeditor.molecular;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class TaxeditorMolecularPlugin extends AbstractUIPlugin {
+
+       // The plug-in ID
+       public static final String PLUGIN_ID = "eu.etaxonomy.taxeditor.molecular"; //$NON-NLS-1$
+
+       // The shared instance
+       private static TaxeditorMolecularPlugin plugin;
+
+       /**
+        * The constructor
+        */
+       public TaxeditorMolecularPlugin() {
+       }
+
+       @Override
+    public void start(BundleContext context) throws Exception {
+               super.start(context);
+               plugin = this;
+       }
+
+       @Override
+    public void stop(BundleContext context) throws Exception {
+               plugin = null;
+               super.stop(context);
+       }
+
+       /**
+        * Returns the shared instance
+        *
+        * @return the shared instance
+        */
+       public static TaxeditorMolecularPlugin getDefault() {
+               return plugin;
+       }
+
+}
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditor.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditor.java
new file mode 100644 (file)
index 0000000..3ec5475
--- /dev/null
@@ -0,0 +1,718 @@
+// $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.molecular.editor;
+
+
+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.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin;
+import eu.etaxonomy.taxeditor.molecular.handler.ToggleInsertOverwriteHandler;
+import eu.etaxonomy.taxeditor.molecular.handler.ToggleLeftRightInsertionHandler;
+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.
+ * <p>
+ * The contained GUI components used to edit the alignment come from <a href="http://bioinfweb.info/LibrAlign/">LibrAlign</a>.
+ *
+ * @author Ben Stöver
+ * @author pplitzner
+ * @date 04.08.2014
+ */
+public class AlignmentEditor extends EditorPart {
+    public static final String ID = "eu.etaxonomy.taxeditor.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 <T> void afterTokenChange(TokenChangeEvent<T> e) {
+                                       setDirty();
+                               }
+
+                               @Override
+                               public <T> void afterSequenceRenamed(SequenceRenamedEvent<T> e) {
+                                       setDirty();
+                               }
+
+                               @Override
+                               public <T> void afterSequenceChange(SequenceChangeEvent<T> e) {
+                                       setDirty();
+                               }
+
+                               @Override
+                               public <T, U> void afterProviderChanged(AlignmentModel<T> oldProvider,
+                                               AlignmentModel<U> newProvider) {  // Not expected.
+
+                                       setDirty();
+                               }
+                       };
+
+    private MultipleAlignmentsContainer alignmentsContainer = null;
+    private final Map<Integer, SingleReadAlignment> cdmMap = new TreeMap<Integer, SingleReadAlignment>();  //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<Character> provider = new PackedAlignmentModel<Character>(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<Object> tokens = new ArrayList<Object>();  // First save tokens in a collection to avoid GUI updated for each token.
+                       tokens.add(consensusModel.getTokenSet().tokenByRepresentation("A"));
+                       tokens.add(consensusModel.getTokenSet().tokenByRepresentation("C"));
+                       tokens.add(consensusModel.getTokenSet().tokenByRepresentation("G"));
+                       tokens.add(consensusModel.getTokenSet().tokenByRepresentation("T"));
+                       consensusModel.insertTokensAt(id, 0, tokens);
+               }
+               catch (Exception e) {
+                       throw new RuntimeException(e);
+               }
+    }
+
+
+    private void readCDMData(Sequence sequenceNode) {
+       //TODO If called from somewhere else than createPartControl() the editorInput needs to be checked and previous contents need to be cleared (or updated).
+
+               // Add reads:
+               for (SingleReadAlignment singleReadAlignment : sequenceNode.getSingleReadAlignments()) {
+                       try {
+                               SingleRead pherogramInfo = singleReadAlignment.getSingleRead();
+                               URI uri = null;
+                               if (pherogramInfo.getPherogram() != null) {
+                                   uri = MediaUtils.getFirstMediaRepresentationPart(pherogramInfo.getPherogram()).getUri();
+                               }
+                               int id = addRead(DerivateLabelProvider.getDerivateText(pherogramInfo, conversationHolder),
+                                               uri,
+                                               singleReadAlignment.isReverseComplement(),
+                                               singleReadAlignment.getEditedSequence(),
+                                               singleReadAlignment.getFirstSeqPosition(),
+                                               singleReadAlignment.getLeftCutPosition(),
+                                               singleReadAlignment.getRightCutPosition(),
+                                               singleReadAlignment.getShifts());
+                               cdmMap.put(id, singleReadAlignment);
+                       }
+                       catch (Exception e) {  // Usually due to an error while trying to read the pherogram (e.g. due to an unsupported format or an invalid URI).
+                MessagingUtils.errorDialog("Error", null, "A single read was skipped because of the following error:\n\n" +
+                        e.getLocalizedMessage(), TaxeditorMolecularPlugin.PLUGIN_ID, e, false);
+                       }
+               }
+
+               // Set consensus sequence:
+               AlignmentModel consensusProvider = getEditableConsensusArea().getAlignmentModel();
+               int id = consensusProvider.addSequence(CONSENSUS_NAME);
+               consensusProvider.insertTokensAt(id, 0, AlignmentModelUtils.charSequenceToTokenList(
+                               sequenceNode.getConsensusSequence().getString(), consensusProvider.getTokenSet()));
+               //TODO Can the consensus sequence also be null? / Should it be created here, if nothing is in the DB?
+    }
+
+
+       /* (non-Javadoc)
+     * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+     */
+    @Override
+    public void createPartControl(Composite parent) {
+               SWTComponentFactory.getInstance().getSWTComponent(getAlignmentsContainer(), parent, SWT.NONE);
+               updateStatusBar();
+
+               if (getEditorInput() instanceof AlignmentEditorInput) {
+                       if (((AlignmentEditorInput)getEditorInput()).getSequenceNodeUuid() != null) {
+                           Sequence sequenceNode = CdmStore.getService(ISequenceService.class).load(((AlignmentEditorInput)getEditorInput()).getSequenceNodeUuid());
+                       //re-load into the current session if it is already persisted in the DB
+                       if(sequenceNode!=null && sequenceNode.getId()!=0){
+                           sequenceNode = CdmStore.getService(ISequenceService.class).load(sequenceNode.getUuid());
+                       }
+                               readCDMData(sequenceNode);
+                       }
+                       else {
+                               createTestContents();  // This case will removed after the test phase and an exception should probably be thrown.
+                       }
+               }
+               else {
+                       throw new IllegalArgumentException("The editor input must have the type " +
+                                       AlignmentEditorInput.class.getCanonicalName());  //TODO What should be done here?
+               }
+       }
+
+
+    private void updateStatusBar() {
+        IActionBars bars = getEditorSite().getActionBars();
+        bars.getStatusLineManager().setMessage("Edit mode: " +
+                       (getReadsArea().getEditSettings().isInsert() ? "Insert" : "Overwrite") + "  " +
+                       "Insertion in pherogram: " +
+                       (getReadsArea().getEditSettings().isInsertLeftInDataArea() ? "Left" : "Right"));
+    }
+
+
+    private SingleReadAlignment.Shift[] convertToCDMShifts(PherogramAreaModel model) {
+       Iterator<ShiftChange> iterator = model.shiftChangeIterator();
+       List<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[]{});
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+     */
+    @Override
+    public void doSave(IProgressMonitor monitor) {
+       if (getEditorInput() instanceof AlignmentEditorInput) {
+               String taskName = "Saving alignment";
+            monitor.beginTask(taskName, 3);
+
+            //re-loading sequence to avoid session conflicts
+               Sequence sequenceNode = CdmStore.getService(ISequenceService.class).load(((AlignmentEditorInput)getEditorInput()).getSequenceNodeUuid());
+               StringAdapter stringProvider = new StringAdapter(getEditableConsensusArea().getAlignmentModel(), false);  // Throws an exception if a token has more than one character.
+
+               // Write consensus sequence:
+               SequenceString consensusSequenceObj = sequenceNode.getConsensusSequence();
+               String newConsensusSequence = stringProvider.getSequence(
+                               getEditableConsensusArea().getAlignmentModel().sequenceIDByName(CONSENSUS_NAME));
+               if (consensusSequenceObj == null) {
+                       sequenceNode.setConsensusSequence(SequenceString.NewInstance(newConsensusSequence));
+               }
+               else {
+                       consensusSequenceObj.setString(newConsensusSequence);
+               }
+
+               // Write single reads:
+               stringProvider.setUnderlyingProvider(getReadsArea().getAlignmentModel());
+               sequenceNode.getSingleReadAlignments().retainAll(cdmMap.values());  // Remove all reads that are not in the alignment anymore.
+               Iterator<Integer> iterator = getReadsArea().getAlignmentModel().sequenceIDIterator();
+               while (iterator.hasNext()) {
+                       int id = iterator.next();
+                       SingleReadAlignment singleRead = cdmMap.get(id);
+                       if (singleRead == null) {
+                           throw new InternalError("Creating new reads from AlignmentEditor not implemented.");
+                               //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);
+                       }
+
+                       singleRead.setEditedSequence(stringProvider.getSequence(id));
+
+                       PherogramAreaModel model = getPherogramArea(id).getModel();
+                       singleRead.setReverseComplement(model.getPherogramProvider() instanceof ReverseComplementPherogramProvider);  // Works only if ReverseComplementPherogramProvider instances are not nested.
+                       singleRead.setShifts(convertToCDMShifts(getPherogramArea(id).getModel()));
+                       singleRead.setFirstSeqPosition(model.getFirstSeqPos());
+                       singleRead.setLeftCutPosition(model.getLeftCutPosition());
+                       singleRead.setRightCutPosition(model.getRightCutPosition());
+               }
+
+               if (!conversationHolder.isBound()) {
+                conversationHolder.bind();
+            }
+            monitor.worked(1);
+
+            // Commit the conversation and start a new transaction immediately:
+            conversationHolder.commit(true);
+            monitor.worked(1);
+
+            dirty = false;
+            monitor.worked(1);
+            monitor.done();
+            firePropertyChange(PROP_DIRTY);
+       }
+       else {
+               //TODO Throw exception as soon as testing period which allows unlinked AlignmentEditor is over.
+       }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.part.EditorPart#doSaveAs()
+     */
+    @Override
+    public void doSaveAs() {}
+
+
+    /* (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() {
+        return dirty;
+    }
+
+
+    private void setDirty() {
+       dirty = true;
+       firePropertyChange(IEditorPart.PROP_DIRTY);
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+     */
+    @Override
+    public boolean isSaveAsAllowed() {
+        return false;  // "Save as" not allowed.
+    }
+
+
+    @Override
+    public void setFocus() {
+        if(conversationHolder!=null){
+            conversationHolder.bind();
+        }
+    }
+
+
+    public boolean isInsertMode() {
+        return getAlignmentsContainer().getEditSettings().isInsert();
+    }
+
+
+    public boolean isInsertLeftInPherogram() {
+        return getAlignmentsContainer().getEditSettings().isInsertLeftInDataArea();
+    }
+
+
+    public void toggleLeftRightInsertionInPherogram() {
+       getAlignmentsContainer().getEditSettings().toggleInsertLeftInDataArea();
+    }
+
+
+    public void toggleInsertOverwrite() {
+       getAlignmentsContainer().getEditSettings().toggleInsert();
+    }
+
+
+    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.";
+        }
+        else {
+            PherogramArea pherogramArea =
+                    getPherogramArea(getReadsArea().getSequenceOrder().idByIndex(selection.getCursorRow()));
+            if (pherogramArea == null) {
+                return "There is no pherogram attached to the current sequence.";
+            }
+            else {
+                if (left) {
+                    if (pherogramArea.setLeftCutPositionBySelection()) {
+                        return null;
+                    }
+                    else {
+                        return "The left end of the selection lies outside the pherogram attached to this sequence.";
+                    }
+                }
+                else {
+                    if (pherogramArea.setRightCutPositionBySelection()) {
+                        return null;
+                    }
+                    else {
+                        return "The right end of the selection lies outside the pherogram attached to this sequence.";
+                    }
+                }
+            }
+        }
+    }
+
+
+    public String cutPherogramLeft() {
+        return cutPherogram(true);
+    }
+
+
+    public String cutPherogramRight() {
+        return cutPherogram(false);
+    }
+
+
+    public void reverseComplementSelectedSequences() {
+       SelectionModel selection = getReadsArea().getSelection();
+       AlignmentModel<?> model = getReadsArea().getAlignmentModel();
+       for (int row = selection.getFirstRow(); row < selection.getFirstRow() + selection.getCursorHeight(); row++) {
+                       int sequenceID = getReadsArea().getSequenceOrder().idByIndex(row);
+                       PherogramArea area = getPherogramArea(sequenceID);
+                       PherogramAreaModel pherogramAlignmentModel = area.getModel();
+                       AlignmentModelUtils.reverseComplement(model, sequenceID,
+                               pherogramAlignmentModel.editableIndexByBaseCallIndex(
+                                       pherogramAlignmentModel.getLeftCutPosition()).getBeforeValidIndex(),
+                               pherogramAlignmentModel.editableIndexByBaseCallIndex(
+                                       pherogramAlignmentModel.getRightCutPosition()).getAfterValidIndex());
+                       pherogramAlignmentModel.reverseComplement();
+               }
+    }
+
+
+    /**
+     * Recreates the whole consensus sequence from all single read sequences. The previous consensus
+     * sequence is overwritte.
+     */
+    @SuppressWarnings("unchecked")
+    public <T> void createConsensusSequence() {
+        ConsensusSequenceArea area = getConsensusHintDataArea();
+        AlignmentModel<T> model = (AlignmentModel<T>)getEditableConsensusArea().getAlignmentModel();
+        int sequenceID = model.sequenceIDIterator().next();  // There is always one sequence contained.
+        int length = getReadsArea().getAlignmentModel().getMaxSequenceLength();
+
+        Collection<T> tokens = new ArrayList<T>(length);
+        for (int column = 0; column < length; column++) {
+            tokens.add(model.getTokenSet().tokenByRepresentation(area.getConsensusToken(column)));
+        }
+
+        model.removeTokensAt(sequenceID, 0, model.getSequenceLength(sequenceID));
+        model.insertTokensAt(sequenceID, 0, tokens);
+    }
+
+
+    /**
+     * Updates the current consensus sequence by replacing gaps by the according consensus tokens
+     * calculated from the single read sequences and extends the consensus sequence if necessary.
+     */
+    @SuppressWarnings("unchecked")
+    public <T> void updateConsensusSequence() {
+        ConsensusSequenceArea area = getConsensusHintDataArea();
+        AlignmentModel<T> model = (AlignmentModel<T>)getEditableConsensusArea().getAlignmentModel();
+        TokenSet<T> tokenSet = model.getTokenSet();
+        int sequenceID = model.sequenceIDIterator().next();  // There is always one sequence contained.
+        int currentConsensusLength = model.getSequenceLength(sequenceID);
+        int overallLength = getReadsArea().getAlignmentModel().getMaxSequenceLength();
+
+        // Replace gaps by new information:
+        for (int column = 0; column < currentConsensusLength; column++) {
+            if (tokenSet.isGapToken(model.getTokenAt(sequenceID, column))) {
+                T newToken = tokenSet.tokenByRepresentation(area.getConsensusToken(column));
+                if (!tokenSet.isGapToken(newToken)) {
+                    model.setTokenAt(sequenceID, column, newToken);
+                }
+            }
+        }
+
+        // Append additional tokens:
+        if (overallLength > currentConsensusLength) {
+            Collection<T> tokens = new ArrayList<T>(overallLength);
+            for (int column = currentConsensusLength; column < overallLength; column++) {
+                tokens.add(tokenSet.tokenByRepresentation(area.getConsensusToken(column)));
+            }
+            model.appendTokens(sequenceID, tokens);
+        }
+    }
+
+
+       public static PherogramProvider readPherogram(URI uri) throws IOException, UnsupportedChromatogramFormatException {
+           PherogramProvider result;
+               InputStream stream = uri.toURL().openStream();
+               try {
+                       result = new BioJavaPherogramProvider(ChromatogramFactory.create(stream));
+               }
+               finally {
+                       stream.close();
+               }
+               return result;
+       }
+
+
+       private String newReadName() {
+               int index = 1;
+               while (getReadsArea().getAlignmentModel().sequenceIDByName(DEFAULT_READ_NAME_PREFIX + index)
+                               != AlignmentModel.NO_SEQUENCE_FOUND) {
+
+                       index++;
+               }
+               return DEFAULT_READ_NAME_PREFIX + index;
+       }
+
+
+    public void addRead(URI pherogramURI, boolean reverseComplemented) throws IOException, UnsupportedChromatogramFormatException {
+       addRead(newReadName(), pherogramURI, reverseComplemented, null, null, null, null, null);
+    }
+
+
+    /**
+     * Adds a new sequence with attached phergram data area to the reads alignment.
+     * <p>
+     * If {@code null} is specified as {@code editedSequence} the base call sequence from the pherogram will
+     * be set as the edited sequence. If {@code null} is specified as {@code shifts} no shifts between the edited
+     * and the base calls sequence are assumed.
+     *
+     * @param name the name of the new sequence
+     * @param pherogramURI the URI where the associated pherogram file is located
+     * @param reverseComplemented Specify {@code true} here, if the reverse complement of the pherogram data should
+     *        be added, {@code false} otherwise.
+     * @param editedSequence the edited version of the base call sequence (May be {@code null}.)
+     * @param shifts the alignment information that links the edited and the base call sequence (May be {@code null}.)
+     * @return the sequence ID of the added read
+     * @throws IOException if an error occurred when trying to read the pherogram file
+     * @throws UnsupportedChromatogramFormatException if the format of the pherogram file is not supported
+     */
+    public int addRead(String name, URI pherogramURI, boolean reverseComplemented, String editedSequence,
+            Integer firstSeqPos, Integer leftCutPos, Integer rightCutPos, SingleReadAlignment.Shift[] shifts)
+            throws IOException, UnsupportedChromatogramFormatException {
+
+               AlignmentModel provider = getReadsArea().getAlignmentModel();
+               PherogramProvider pherogramProvider = null;
+               if (pherogramURI != null) {
+                   pherogramProvider = readPherogram(pherogramURI);  // Must happen before a sequence is added, because it might throw an exception.
+            if (reverseComplemented) {
+                pherogramProvider = new ReverseComplementPherogramProvider(pherogramProvider);
+            }
+               }
+
+        // Create sequence:
+               provider.addSequence(name);
+               int id = provider.sequenceIDByName(name);
+
+               // Set edited sequence:
+               Collection<Object> tokens = null;  // First save tokens in a collection to avoid GUI updated for each token.
+               if (editedSequence != null) {
+                       tokens = AlignmentModelUtils.charSequenceToTokenList(editedSequence, provider.getTokenSet());
+               }
+               else if (pherogramProvider != null) {  // Copy base call sequence into alignment:
+                       tokens = new ArrayList<Object>();
+                       for (int i = 0; i < pherogramProvider.getSequenceLength(); i++) {
+                               tokens.add(provider.getTokenSet().tokenByRepresentation(
+                                       Character.toString(pherogramProvider.getBaseCall(i))));
+                       }
+                       setDirty();
+               }
+
+               if (tokens != null) {  // If either an edited sequence or a pherogram URI was provided.
+                   provider.insertTokensAt(id, 0, tokens);
+               // Create pherogram area:
+               PherogramArea pherogramArea = new PherogramArea(getReadsArea().getContentArea(),
+                       new PherogramAreaModel(pherogramProvider));
+
+               // Set position properties and shifts:
+               PherogramAreaModel model = pherogramArea.getModel();
+               if ((firstSeqPos != null) && (leftCutPos != null)) {
+                   model.setFirstSeqLeftCutPos(firstSeqPos, leftCutPos);
+               }
+               if (rightCutPos != null) {
+                   model.setRightCutPosition(rightCutPos);
+               }
+               if ((shifts != null) && (shifts.length > 0)) {
+                   for (int i = 0; i < shifts.length; i++) {
+                       model.addShiftChange(shifts[i].position, shifts[i].shift);
+                   }
+                   setDirty();
+               }
+
+               // Add pherogram area to GUI:
+               pherogramArea.addMouseListener(new PherogramMouseListener(pherogramArea));
+               getReadsArea().getDataAreas().getSequenceAreas(id).add(pherogramArea);
+               }
+
+               return id;
+       }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditorInput.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditorInput.java
new file mode 100644 (file)
index 0000000..b823625
--- /dev/null
@@ -0,0 +1,138 @@
+// $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.molecular.editor;
+
+
+import java.util.UUID;
+
+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";
+
+
+    private final UUID sequenceNodeUuid;
+
+
+    public AlignmentEditorInput(UUID sequenceNodeUuid) {
+               super();
+               this.sequenceNodeUuid = sequenceNodeUuid;
+       }
+
+
+       /* (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;
+    }
+
+
+       /**
+        * Returns the {@link UUID} of the sequence CDM node that should be edited by the {@link AlignmentEditor} this object
+        * is used with.
+        *
+        * @return the uuid of the CDM node to work on
+        */
+       public UUID getSequenceNodeUuid() {
+               return sequenceNodeUuid;
+       }
+
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result
+                               + ((sequenceNodeUuid == null) ? 0 : sequenceNodeUuid.hashCode());
+               return result;
+       }
+
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj) {
+            return true;
+        }
+               if (obj == null) {
+            return false;
+        }
+               if (getClass() != obj.getClass()) {
+            return false;
+        }
+               AlignmentEditorInput other = (AlignmentEditorInput) obj;
+               if (sequenceNodeUuid == null) {
+                       if (other.sequenceNodeUuid != null) {
+                return false;
+            }
+               } else if (!sequenceNodeUuid.equals(other.sequenceNodeUuid)) {
+            return false;
+        }
+               return true;
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/PherogramMouseListener.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/PherogramMouseListener.java
new file mode 100644 (file)
index 0000000..582b0fa
--- /dev/null
@@ -0,0 +1,56 @@
+/**\r
+* Copyright (C) 2007 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.editor;\r
+\r
+\r
+import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea;\r
+import info.bioinfweb.tic.input.TICMouseAdapter;\r
+import info.bioinfweb.tic.input.TICMouseEvent;\r
+\r
+import org.eclipse.ui.PartInitException;\r
+\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
+import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin;\r
+import eu.etaxonomy.taxeditor.molecular.handler.ShowPherogramHandler;\r
+\r
+\r
+\r
+/**\r
+ * Listens to mouse events on data areas displaying a pherogram in {@link AlignmentEditor}.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 25.11.2014\r
+ */\r
+public class PherogramMouseListener extends TICMouseAdapter {\r
+       private final PherogramArea area;\r
+\r
+\r
+       public PherogramMouseListener(PherogramArea area) {\r
+               super();\r
+               this.area = area;\r
+       }\r
+\r
+\r
+       @Override\r
+       public boolean mousePressed(TICMouseEvent event) {\r
+               if (event.getClickCount() == 2) {  // Double click\r
+                       try {\r
+                           ShowPherogramHandler.showPherogram(area.getModel());\r
+                       }\r
+                       catch (PartInitException e) {\r
+                MessagingUtils.errorDialog("Unable to create pherogram view", null, e.getLocalizedMessage(),\r
+                        TaxeditorMolecularPlugin.PLUGIN_ID,  e, false);  //TODO set pluginID\r
+                       }\r
+            return true;\r
+               }\r
+               else {\r
+                   return false;\r
+               }\r
+       }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/PherogramViewPart.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/editor/PherogramViewPart.java
new file mode 100644 (file)
index 0000000..ec89118
--- /dev/null
@@ -0,0 +1,68 @@
+/**\r
+* Copyright (C) 2007 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.editor;\r
+\r
+\r
+import info.bioinfweb.libralign.pherogram.PherogramFormats.QualityOutputType;\r
+import info.bioinfweb.libralign.pherogram.model.PherogramComponentModel;\r
+import info.bioinfweb.libralign.pherogram.view.PherogramView;\r
+import info.bioinfweb.tic.SWTComponentFactory;\r
+\r
+import org.eclipse.swt.SWT;\r
+import org.eclipse.swt.widgets.Composite;\r
+import org.eclipse.ui.PartInitException;\r
+import org.eclipse.ui.PlatformUI;\r
+import org.eclipse.ui.part.ViewPart;\r
+\r
+\r
+\r
+/**\r
+ * Component that allows to view a pherogram without the distortion due to aligning it to a sequence as in\r
+ * {@link AlignmentEditor}.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date Nov 20, 2014\r
+ */\r
+public class PherogramViewPart extends ViewPart {\r
+    public static final String ID = "eu.etaxonomy.taxeditor.molecular.PherogramView";\r
+\r
+    private PherogramView pherogramView = null;\r
+\r
+\r
+    public static PherogramViewPart createView(PherogramComponentModel model) throws PartInitException {\r
+        PherogramViewPart view = (PherogramViewPart)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ID);\r
+        view.getPherogramView().getTraceCurveView().setModel(model);\r
+        view.getPherogramView().assignSize();\r
+        return view;\r
+    }\r
+\r
+\r
+       public PherogramView getPherogramView() {\r
+               if (pherogramView == null) {\r
+                       pherogramView = new PherogramView();\r
+                       pherogramView.getTraceCurveView().getFormats().setShowProbabilityValues(true);\r
+                       pherogramView.getTraceCurveView().setHorizontalScale(1);\r
+                       pherogramView.getTraceCurveView().setVerticalScale(100);\r
+                       pherogramView.getTraceCurveView().getFormats().setQualityOutputType(QualityOutputType.NONE);  //TODO Make this user defined\r
+                       pherogramView.getTraceCurveView().getFormats().setShowProbabilityValues(false);\r
+               }\r
+               return pherogramView;\r
+       }\r
+\r
+\r
+       @Override\r
+       public void createPartControl(Composite parent) {\r
+               SWTComponentFactory.getInstance().getSWTComponent(getPherogramView(), parent, SWT.NONE);\r
+               getPherogramView().assignSize();\r
+       }\r
+\r
+\r
+       @Override\r
+       public void setFocus() {}  // nothing to do\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/AbstractAlignmentEditorHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/AbstractAlignmentEditorHandler.java
new file mode 100644 (file)
index 0000000..fa74f5d
--- /dev/null
@@ -0,0 +1,43 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.ui.IEditorPart;\r
+\r
+import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+\r
+\r
+\r
+\r
+/**\r
+ * Abstract implementation for all handlers triggering actions in an active instance of\r
+ * {@link AlignmentEditor}.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 19.06.2015\r
+ */\r
+public abstract class AbstractAlignmentEditorHandler extends AbstractHandler {\r
+    @Override\r
+    public Object execute(ExecutionEvent event) throws ExecutionException {\r
+        IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
+        if (activeEditor instanceof AlignmentEditor) {\r
+            doExecute(event, (AlignmentEditor)activeEditor);\r
+        }\r
+        return null;\r
+    }\r
+\r
+\r
+    public abstract void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException;\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/AbstractPherogramComponentHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/AbstractPherogramComponentHandler.java
new file mode 100644 (file)
index 0000000..50d6597
--- /dev/null
@@ -0,0 +1,60 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import info.bioinfweb.libralign.alignmentarea.AlignmentArea;\r
+import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea;\r
+import info.bioinfweb.libralign.pherogram.PherogramComponent;\r
+\r
+import java.util.Iterator;\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.ui.IWorkbenchPart;\r
+\r
+import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.molecular.editor.PherogramViewPart;\r
+\r
+\r
+\r
+/**\r
+ * Abstract handler implementation allows to performs the concrete operation either on an instance of\r
+ * {@link PherogramViewPart} or all {@link AlignmentArea}s inside an instance of {@link AlignmentEditor}.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 23.06.2015\r
+ */\r
+public abstract class AbstractPherogramComponentHandler extends AbstractHandler {\r
+    @Override\r
+    public Object execute(ExecutionEvent event) throws ExecutionException {\r
+        IWorkbenchPart activePart = AbstractUtility.getActivePart();\r
+\r
+        if (activePart instanceof AlignmentEditor) {\r
+            AlignmentEditor editor = (AlignmentEditor)activePart;\r
+            Iterator<Integer> idIterator = editor.getReadsArea().getAlignmentModel().sequenceIDIterator();\r
+            while (idIterator.hasNext()) {\r
+                PherogramArea area = editor.getPherogramArea(idIterator.next());\r
+                if (area != null) {\r
+                    doExecute(event, area);\r
+                }\r
+            }\r
+        }\r
+        else if (activePart instanceof PherogramViewPart) {\r
+            doExecute(event, ((PherogramViewPart)activePart).getPherogramView().getTraceCurveView());\r
+        }\r
+        return null;\r
+    }\r
+\r
+\r
+    public abstract void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException;\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ChangePherogramQualityOutputType.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ChangePherogramQualityOutputType.java
new file mode 100644 (file)
index 0000000..9d0febc
--- /dev/null
@@ -0,0 +1,31 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import info.bioinfweb.libralign.pherogram.PherogramComponent;\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+\r
+\r
+/**\r
+ * Switches between the quality output types available for components displaying pherograms.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 19.06.2015\r
+ */\r
+public class ChangePherogramQualityOutputType extends AbstractPherogramComponentHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException {\r
+        component.getFormats().changeQualityOutputType();\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CreateConsensusSequenceHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CreateConsensusSequenceHandler.java
new file mode 100644 (file)
index 0000000..e04c148
--- /dev/null
@@ -0,0 +1,34 @@
+/**\r
+* Copyright (C) 2007 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+\r
+\r
+\r
+\r
+/**\r
+ * Handler that creates the consensus sequence from all single read sequences in the active instance\r
+ * of {@link AlignmentEditor}. A previously present consensus sequence will be overwritten.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 19.06.2015\r
+ * @see UpdateConsensusSequenceHandler\r
+ * @see AlignmentEditor#createConsensusSequence()\r
+ */\r
+public class CreateConsensusSequenceHandler extends AbstractAlignmentEditorHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        editor.createConsensusSequence();\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CutPherogramLeftHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CutPherogramLeftHandler.java
new file mode 100644 (file)
index 0000000..bbbd4e0
--- /dev/null
@@ -0,0 +1,37 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
+import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin;\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+\r
+\r
+\r
+/**\r
+ * Handler that cuts the base call sequence of a pherogram attached to the current sequence on the left\r
+ * of the current selection or cursor position.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 15.06.2015\r
+ */\r
+public class CutPherogramLeftHandler extends AbstractAlignmentEditorHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        String errorMessage = editor.cutPherogramLeft();\r
+        if (errorMessage != null) {\r
+            MessagingUtils.errorDialog("Unable to cut base call sequence", this, errorMessage, TaxeditorMolecularPlugin.PLUGIN_ID, null, false);\r
+        }\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CutPherogramRightHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/CutPherogramRightHandler.java
new file mode 100644 (file)
index 0000000..85be2f7
--- /dev/null
@@ -0,0 +1,37 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
+import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin;\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+\r
+\r
+\r
+/**\r
+ * Handler that cuts the base call sequence of a pherogram attached to the current sequence on the right\r
+ * of the current selection or cursor position.\r
+ *\r
+ * @author BenStoever\r
+ * @date 15.06.2015\r
+ */\r
+public class CutPherogramRightHandler extends AbstractAlignmentEditorHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        String errorMessage = editor.cutPherogramRight();\r
+        if (errorMessage != null) {\r
+            MessagingUtils.errorDialog("Unable to cut base call sequence", this, errorMessage, TaxeditorMolecularPlugin.PLUGIN_ID, null, false);\r
+        }\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/EditSequenceHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/EditSequenceHandler.java
new file mode 100644 (file)
index 0000000..69597f1
--- /dev/null
@@ -0,0 +1,46 @@
+package eu.etaxonomy.taxeditor.molecular.handler;
+
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.TreeNode;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.molecular.Sequence;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin;
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditorInput;
+
+
+
+/**
+ * Opens the alignment editor from the CDM tree.
+ *
+ * @author Ben St&ouml;ver
+ * @author pplitzner
+ */
+public class EditSequenceHandler extends AbstractHandler {
+
+    org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(EditSequenceHandler.class);
+
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
+        TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(currentSelection);
+        if(treeNodeOfSelection != null && treeNodeOfSelection.getValue() instanceof Sequence){
+            AlignmentEditorInput input = new AlignmentEditorInput(((Sequence)treeNodeOfSelection.getValue()).getUuid());  //TODO Should there always be a new instance created here? What if the specified CDM node is already opened in an AlignmentEditor? => Possible create Singleton that keeps instances by sequence objects in a map.
+            try {
+                TaxeditorMolecularPlugin.getDefault().getWorkbench()
+                .getActiveWorkbenchWindow().getActivePage().openEditor(input, AlignmentEditor.ID);
+            }
+            catch (PartInitException e) {
+                logger.error("Could not open AlignmentEditor", e);
+            }
+        }
+        return null;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/HandlerTools.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/HandlerTools.java
new file mode 100644 (file)
index 0000000..07c1fc4
--- /dev/null
@@ -0,0 +1,40 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import java.net.URL;\r
+\r
+import org.eclipse.core.runtime.FileLocator;\r
+import org.eclipse.core.runtime.Path;\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
+\r
+import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin;\r
+\r
+\r
+\r
+/**\r
+ * Implements shared functionality for handler implementations using tool bar icons.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 15.06.2015\r
+ */\r
+public class HandlerTools {  //TODO Move this class or method somewhere else?\r
+    public static ImageDescriptor createImageDescriptor(String iconName) {\r
+        URL url = FileLocator.find(TaxeditorMolecularPlugin.getDefault().getBundle(),\r
+                new Path("icons/" + iconName), null);\r
+        if (url != null) {\r
+            return ImageDescriptor.createFromURL(url);\r
+        }\r
+        else {\r
+            throw new InternalError("Icon \"" + iconName + "\" could not be loaded.");  //TODO Throw other type of exception?\r
+        }\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/LoadPherogramHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/LoadPherogramHandler.java
new file mode 100644 (file)
index 0000000..97e1b97
--- /dev/null
@@ -0,0 +1,70 @@
+/**
+* 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.molecular.handler;
+
+
+import java.io.File;
+import java.io.IOException;
+
+import org.biojava.bio.chromatogram.UnsupportedChromatogramFormatException;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.ui.IEditorPart;
+
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin;
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;
+
+
+
+/**
+ * Handler that loads an additional read into the contig alignment displayed by an instance of {@link AlignmentEditor}.
+ *
+ * @author Ben Stöver
+ * @author pplitzner
+ */
+public class LoadPherogramHandler extends AbstractHandler {
+       //TODO Change so that also URIs which do not point to files can be specified.
+
+       /* (non-Javadoc)
+     * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        IEditorPart activeEditor = AbstractUtility.getActiveEditor();
+        if (activeEditor instanceof AlignmentEditor) {
+            AlignmentEditor alignmentEditor = (AlignmentEditor)activeEditor;
+
+            FileDialog fileDialog = new FileDialog(alignmentEditor.getSite().getShell());
+            fileDialog.setText("Import pherogram into contig alignment");
+            fileDialog.setFilterNames(new String[]{"All supported formats", "AB1 pherogram files", "SCF pherogram files", "All files"});
+            fileDialog.setFilterExtensions(new String[]{"*.ab1;*.scf", "*.ab1", "*.scf", "*.*"});
+
+            String path = fileDialog.open();
+            if (path != null) {
+               try {
+                       alignmentEditor.addRead(new File(path).toURI(), false);
+               }
+               catch (UnsupportedChromatogramFormatException e) {
+                    MessagingUtils.errorDialog("Unsupported format", this, "The format of the pherogram file \"" + path +
+                               "\" is not supported. (Only AB1 and SCF are supported.)", TaxeditorMolecularPlugin.PLUGIN_ID, e, false);  //TODO set pluginID
+               }
+               catch (IOException e) {
+                    MessagingUtils.errorDialog("Unsupported format", this,
+                               "An IO error occurred while trying to read the file \"" + path + "\".",
+                               TaxeditorMolecularPlugin.PLUGIN_ID, e, false);  //TODO set pluginID
+               }
+            }
+        }
+        return null;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ReverseComplementHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ReverseComplementHandler.java
new file mode 100644 (file)
index 0000000..a814a77
--- /dev/null
@@ -0,0 +1,31 @@
+/**\r
+* Copyright (C) 2007 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+\r
+\r
+\r
+\r
+/**\r
+ * Reverse complements the single read sequence in an active {@link AlignmentEditor}, where the alignment cursor\r
+ * is currently located.\r
+ *\r
+ * @author Ben Stöver\r
+ */\r
+public class ReverseComplementHandler extends AbstractAlignmentEditorHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        editor.reverseComplementSelectedSequences();\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ShowPherogramHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ShowPherogramHandler.java
new file mode 100644 (file)
index 0000000..f9773aa
--- /dev/null
@@ -0,0 +1,66 @@
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import info.bioinfweb.libralign.pherogram.model.PherogramComponentModel;\r
+\r
+import java.net.URI;\r
+\r
+import org.eclipse.core.commands.AbstractHandler;\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.jface.viewers.ISelection;\r
+import org.eclipse.jface.viewers.TreeNode;\r
+import org.eclipse.ui.PartInitException;\r
+import org.eclipse.ui.handlers.HandlerUtil;\r
+\r
+import eu.etaxonomy.cdm.model.media.MediaUtils;\r
+import eu.etaxonomy.cdm.model.molecular.SingleRead;\r
+import eu.etaxonomy.taxeditor.editor.EditorUtil;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\r
+import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin;\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.molecular.editor.PherogramViewPart;\r
+\r
+\r
+\r
+/**\r
+ * Displays an undistorted pherogram with {@link PherogramViewPart}.\r
+ *\r
+ * @author Ben Stöver\r
+ *\r
+ */\r
+public class ShowPherogramHandler extends AbstractHandler {\r
+       public static void showPherogram(PherogramComponentModel model) throws PartInitException {\r
+               PherogramViewPart.createView(model);\r
+       }\r
+\r
+\r
+       @Override\r
+       public Object execute(ExecutionEvent event) throws ExecutionException {\r
+               ISelection currentSelection = HandlerUtil.getCurrentSelection(event);\r
+               TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(currentSelection);\r
+               if (treeNodeOfSelection != null && treeNodeOfSelection.getValue() instanceof SingleRead) {\r
+                   //TODO Can the parent node (containing the cut positions) be extracted from SingleRead?\r
+                       try {\r
+                           SingleRead singleRead = (SingleRead)treeNodeOfSelection.getValue();\r
+                           URI uri = null;\r
+                           if (singleRead.getPherogram() != null) {  // Pherogram objects without URI are possible.\r
+                               uri = MediaUtils.getFirstMediaRepresentationPart(singleRead.getPherogram()).getUri();\r
+                           }\r
+\r
+                           if (uri == null) {\r
+                       MessagingUtils.messageDialog("No pherogram available", this,\r
+                               "The selected read does not have an associated pherogram.");\r
+                           }\r
+                           else {\r
+                     showPherogram(new PherogramComponentModel(AlignmentEditor.readPherogram(uri)));\r
+                           }\r
+                       }\r
+               catch (Exception e) {\r
+                   MessagingUtils.errorDialog("Error", null, e.getLocalizedMessage(), TaxeditorMolecularPlugin.PLUGIN_ID,\r
+                           e, false);\r
+               }\r
+        }\r
+        return null;\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/SpecimenPropertyTester.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/SpecimenPropertyTester.java
new file mode 100644 (file)
index 0000000..0a59a70
--- /dev/null
@@ -0,0 +1,58 @@
+package eu.etaxonomy.taxeditor.molecular.handler;
+
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeNode;
+
+import eu.etaxonomy.cdm.model.molecular.Sequence;
+import eu.etaxonomy.cdm.model.molecular.SingleRead;
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+
+
+
+/**
+ * Tests types of specimens to add items to the context menu.
+ *
+ * @author pplitzner
+ * @author BenStoever
+ */
+public class SpecimenPropertyTester extends PropertyTester {
+    private static final String SEQUENCE = "isSequence";
+    private static final String SINGLE_READ = "isSingleRead";
+
+
+    public SpecimenPropertyTester() {}
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+     */
+    /** {@inheritDoc} */
+    @Override
+    public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+        if (receiver instanceof IStructuredSelection) {
+            IStructuredSelection selection = (IStructuredSelection) receiver;
+            TreeNode treeNodeOfSelection = EditorUtil.getTreeNodeOfSelection(selection);
+            if (treeNodeOfSelection!=null) {
+                if (SEQUENCE.equals(property)) {
+                    return isSequence(treeNodeOfSelection.getValue());
+                }
+                else if (SINGLE_READ.equals(property)) {
+                       return isSingleReadAlignment(treeNodeOfSelection.getValue());
+                }
+            }
+        }
+        return false;
+    }
+
+
+       private boolean isSequence(Object object) {
+       return (object instanceof Sequence);
+       }
+
+
+       private boolean isSingleReadAlignment(Object object) {
+       return (object instanceof SingleRead);
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleInsertOverwriteHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleInsertOverwriteHandler.java
new file mode 100644 (file)
index 0000000..8468a11
--- /dev/null
@@ -0,0 +1,68 @@
+/**\r
+* Copyright (C) 2007 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import java.util.Map;\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
+import org.eclipse.ui.IEditorPart;\r
+import org.eclipse.ui.PlatformUI;\r
+import org.eclipse.ui.commands.ICommandService;\r
+import org.eclipse.ui.commands.IElementUpdater;\r
+import org.eclipse.ui.menus.UIElement;\r
+\r
+import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+\r
+\r
+\r
+/**\r
+ * Switches an {@link AlignmentEditor} between insertion and overwrite mode.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 04.12.2014\r
+ */\r
+public class ToggleInsertOverwriteHandler extends AbstractAlignmentEditorHandler implements IElementUpdater {\r
+       public static final String COMMAND_ID =\r
+                       "eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleInsertOverwrite";\r
+\r
+\r
+    private final ImageDescriptor INSERT_DESCRIPTOR = HandlerTools.createImageDescriptor("insert-16x16.png");\r
+    private final ImageDescriptor OVERWRITE_DESCRIPTOR = HandlerTools.createImageDescriptor("overwrite-16x16.png");\r
+\r
+\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        editor.toggleInsertOverwrite();\r
+    }\r
+\r
+\r
+       @Override\r
+       public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {\r
+        IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
+               if (activeEditor instanceof AlignmentEditor) {\r
+                       if (((AlignmentEditor)activeEditor).isInsertMode()) {\r
+                           element.setIcon(INSERT_DESCRIPTOR);\r
+                               element.setText("INS");\r
+                               element.setTooltip("Click to switch to overwrite mode");\r
+                       }\r
+                       else {\r
+                element.setIcon(OVERWRITE_DESCRIPTOR);\r
+                               element.setText("OVR");\r
+                               element.setTooltip("Click to switch to insertion mode");\r
+                       }\r
+            ((ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class)).refreshElements(\r
+                    ToggleLeftRightInsertionHandler.COMMAND_ID, null);\r
+               }\r
+       }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleLeftRightInsertionHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleLeftRightInsertionHandler.java
new file mode 100644 (file)
index 0000000..d1f8e89
--- /dev/null
@@ -0,0 +1,72 @@
+/**\r
+ * Copyright (C) 2007 EDIT\r
+ * European Distributed Institute of Taxonomy\r
+ * http://www.e-taxonomy.eu\r
+ *\r
+ * The contents of this file are subject to the Mozilla Public License Version 1.1\r
+ * See LICENSE.TXT at the top of this package for the full license terms.\r
+ */\r
+\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+import java.util.Map;\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+import org.eclipse.jface.resource.ImageDescriptor;\r
+import org.eclipse.ui.IEditorPart;\r
+import org.eclipse.ui.commands.IElementUpdater;\r
+import org.eclipse.ui.menus.UIElement;\r
+\r
+import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+\r
+\r
+\r
+/**\r
+ * Switches an {@link AlignmentEditor} between insertion in the base sequence to\r
+ * the left or to the right.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 04.12.2014\r
+ */\r
+public class ToggleLeftRightInsertionHandler extends AbstractAlignmentEditorHandler implements IElementUpdater {\r
+    public static final String COMMAND_ID = "eu.etaxonomy.taxeditor.molecular.AlignmentEditor.toggleLeftRightInsertion";\r
+\r
+\r
+    private final ImageDescriptor INSERT_LEFT_DESCRIPTOR =\r
+            HandlerTools.createImageDescriptor("pherogram-insert-left-16x16.png");\r
+    private final ImageDescriptor INSERT_RIGHT_DESCRIPTOR =\r
+            HandlerTools.createImageDescriptor("pherogram-insert-right-16x16.png");\r
+    private final ImageDescriptor INSERT_LEFT_DISABLED_DESCRIPTOR =\r
+            HandlerTools.createImageDescriptor("pherogram-insert-left-disabled-16x16.png");\r
+    private final ImageDescriptor INSERT_RIGHT_DISABLED_DESCRIPTOR =\r
+            HandlerTools.createImageDescriptor("pherogram-insert-right-disabled-16x16.png");\r
+\r
+\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        editor.toggleLeftRightInsertionInPherogram();\r
+    }\r
+\r
+\r
+    @Override\r
+    public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {\r
+        IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
+        if (activeEditor instanceof AlignmentEditor) {\r
+            setBaseEnabled(((AlignmentEditor)activeEditor).isInsertMode());\r
+            if (((AlignmentEditor)activeEditor).isInsertLeftInPherogram()) {\r
+                element.setIcon(INSERT_LEFT_DESCRIPTOR);\r
+                element.setDisabledIcon(INSERT_LEFT_DISABLED_DESCRIPTOR);\r
+                element.setText("Left");\r
+                element.setTooltip("Switch to insert pherogram distorsions right of future edits.");\r
+            }\r
+            else {\r
+                element.setIcon(INSERT_RIGHT_DESCRIPTOR);\r
+                element.setDisabledIcon(INSERT_RIGHT_DISABLED_DESCRIPTOR);\r
+                element.setText("Right");\r
+                element.setTooltip("Switch to insert pherogram distorsions left of future edits.");\r
+            }\r
+        }\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleShowPherogramBaseCallLinesHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleShowPherogramBaseCallLinesHandler.java
new file mode 100644 (file)
index 0000000..293559b
--- /dev/null
@@ -0,0 +1,30 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import info.bioinfweb.libralign.pherogram.PherogramComponent;\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+\r
+\r
+/**\r
+ * @author BenStoever\r
+ * @date 23.06.2015\r
+ *\r
+ */\r
+public class ToggleShowPherogramBaseCallLinesHandler extends AbstractPherogramComponentHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException {\r
+        component.getFormats().toggleShowBaseCallLines();\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleShowPherogramProbabilitiesHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/ToggleShowPherogramProbabilitiesHandler.java
new file mode 100644 (file)
index 0000000..df1a76a
--- /dev/null
@@ -0,0 +1,36 @@
+// $Id$\r
+/**\r
+* Copyright (C) 2015 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import info.bioinfweb.libralign.pherogram.PherogramComponent;\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.molecular.editor.PherogramViewPart;\r
+\r
+\r
+\r
+\r
+/**\r
+ * Toggles whether probability values (substitution, overcall and undercall) should be displayed\r
+ * in pherogram areas of {@link AlignmentEditor} or {@link PherogramViewPart}.\r
+ *\r
+ * @author Ben Stöver\r
+ * @date 23.06.2015\r
+ */\r
+public class ToggleShowPherogramProbabilitiesHandler extends AbstractPherogramComponentHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException {\r
+        component.getFormats().toggleShowProbabilityValues();\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/UpdateConsensusSequenceHandler.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/UpdateConsensusSequenceHandler.java
new file mode 100644 (file)
index 0000000..9c76e9b
--- /dev/null
@@ -0,0 +1,25 @@
+/**\r
+* Copyright (C) 2007 EDIT\r
+* European Distributed Institute of Taxonomy\r
+* http://www.e-taxonomy.eu\r
+*\r
+* The contents of this file are subject to the Mozilla Public License Version 1.1\r
+* See LICENSE.TXT at the top of this package for the full license terms.\r
+*/\r
+package eu.etaxonomy.taxeditor.molecular.handler;\r
+\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
+\r
+\r
+\r
+\r
+public class UpdateConsensusSequenceHandler extends AbstractAlignmentEditorHandler {\r
+    @Override\r
+    public void doExecute(ExecutionEvent event, AlignmentEditor editor) throws ExecutionException {\r
+        editor.updateConsensusSequence();\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/package-info.java b/eu.etaxonomy.taxeditor.molecular/src/eu/etaxonomy/taxeditor/molecular/handler/package-info.java
new file mode 100644 (file)
index 0000000..8c761e3
--- /dev/null
@@ -0,0 +1,17 @@
+// $Id$\r
+/**\r
+ * Copyright (C) 2015 EDIT\r
+ * European Distributed Institute of Taxonomy\r
+ * http://www.e-taxonomy.eu\r
+ *\r
+ * The contents of this file are subject to the Mozilla Public License Version 1.1\r
+ * See LICENSE.TXT at the top of this package for the full license terms.\r
+ */\r
+/**\r
+ * Contains handlers that trigger actions in an active instance of\r
+ * {@link eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor}. Handlers opening\r
+ * an alignment editor or pherogram view are not contained in here.\r
+ *\r
+ * @author Ben Stöver\r
+ */\r
+package eu.etaxonomy.taxeditor.molecular.handler;
\ No newline at end of file