eu.etaxonomy.taxeditor.editor/icons/leaf_detail.png -text
eu.etaxonomy.taxeditor.editor/icons/link_obj.gif -text
eu.etaxonomy.taxeditor.editor/icons/xper64.png -text
+eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar -text
+eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar -text
+eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar -text
+eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar -text
+eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar -text
eu.etaxonomy.taxeditor.editor/p2.inf -text
eu.etaxonomy.taxeditor.editor/plugin.xml -text
eu.etaxonomy.taxeditor.editor/pom.xml -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditNewTaxonHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditSequenceHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/FixClassificationHierarchyHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/LoadPherogramHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditorHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenChecklistEditorHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenDerivateViewHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenParentHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenTaxonEditorHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SaveAllHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SaveTaxonHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/ShowPherogramHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SpecimenPropertyTester.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/TaxonParameterConverter.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/ToggleInsertOverwriteHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/ToggleLeftRightInsertionHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/create/NewNameHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/create/NewPersonHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/create/NewReferenceHandler.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/CreateNodeOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/DeleteNodeOperation.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RefreshNodeNumberingOperation.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CDMAlignmentObjectPlaceholder.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/ContigSequenceDataProvider.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/PherogramMouseListener.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/PherogramViewPart.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroup.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroupedContainer.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/validation/ValidationProblemsView.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/validation/ValidatorClassMarkerField.java -text
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/validation/ValidatorMessageMarkerField.java -text
+eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1 -text
+eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1 -text
eu.etaxonomy.taxeditor.editor/src/main/resources/TaonDescriptionEditor.screen -text
+eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf -text
eu.etaxonomy.taxeditor.editor/src/main/resources/log4j.properties -text
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/Application.java -text
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/ApplicationActionBarAdvisor.java -text
org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true
org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=false
org.eclipse.ui/DOCK_PERSPECTIVE_BAR=top-right
-org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=true
\ No newline at end of file
+org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=true
+org.eclipse.ui/KEY_CONFIGURATION_ID=eu.etaxonomy.taxeditor.bindings.scheme.default
\ No newline at end of file
<classpathentry exported="true" kind="lib" path="lib/spring-security-remoting-3.1.3.RELEASE.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jena-core-2.11.2.jar"/>
<classpathentry exported="true" kind="lib" path="lib/jena-iri-1.0.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.4.1-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.4.1-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.4.1-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.4.1-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.4.1-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.4.1-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.4.1-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.4.1-SNAPSHOT.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.4.1-SNAPSHOT-sources.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.4.1-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.5.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-commons-3.5.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.5.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-ext-3.5.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.5.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-io-3.5.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.5.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-model-3.5.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.5.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-persistence-3.5.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.5.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-print-3.5.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.5.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-remote-3.5.0-SNAPSHOT.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.5.0-SNAPSHOT-sources.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/cdmlib-services-3.5.0-SNAPSHOT.jar"/>
<classpathentry exported="true" kind="lib" path="lib/poi-3.10-FINAL.jar"/>
<classpathentry exported="true" kind="lib" path="lib/poi-ooxml-3.10-FINAL.jar"/>
<classpathentry exported="true" kind="lib" path="lib/xmlbeans-2.3.0.jar"/>
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
- <classpathentry including="**/*.java" kind="src" path="src/test/java"/>
- <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/main/java"/>\r
+ <classpathentry including="**/*.java" kind="src" path="src/test/java"/>\r
+ <classpathentry excluding="**/*.java" kind="src" path="src/main/resources"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/biojava3-alignment-3.0.7.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/biojava3-core-3.0.7.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/core-1.8.5.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/sequencing-1.8.5.jar"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/bioinfweb.commons"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/LibrAlign" sourcepath="lib/LibrAlign"/>\r
+ <classpathentry exported="true" kind="lib" path="lib/commons-lang3-3.1.jar"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>eu.etaxonomy.taxeditor.editor</name>
- <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<projectDescription>\r
+ <name>eu.etaxonomy.taxeditor.editor</name>\r
+ <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>\r
+ <projects>\r
+ </projects>\r
+ <buildSpec>\r
+ <buildCommand>\r
+ <name>org.eclipse.jdt.core.javabuilder</name>\r
+ <arguments>\r
+ </arguments>\r
+ </buildCommand>\r
+ <buildCommand>\r
+ <name>org.eclipse.pde.ManifestBuilder</name>\r
+ <arguments>\r
+ </arguments>\r
+ </buildCommand>\r
+ <buildCommand>\r
+ <name>org.eclipse.pde.SchemaBuilder</name>\r
+ <arguments>\r
+ </arguments>\r
+ </buildCommand>\r
+ </buildSpec>\r
+ <natures>\r
+ <nature>org.eclipse.jdt.core.javanature</nature>\r
+ <nature>org.eclipse.pde.PluginNature</nature>\r
+ </natures>\r
+ <linkedResources>\r
+ <link>\r
+ <name>lib/LibrAlign</name>\r
+ <type>2</type>\r
+ <locationURI>WORKSPACE_LOC/LibrAlign/bin</locationURI>\r
+ </link>\r
+ <link>\r
+ <name>lib/bioinfweb.commons</name>\r
+ <type>2</type>\r
+ <locationURI>WORKSPACE_LOC/_Lib/bin</locationURI>\r
+ </link>\r
+ </linkedResources>\r
+</projectDescription>\r
jdimodel.jar,
pdebuild.jar,
compatibility.jar,
- junit.jar
+ junit.jar,
+ lib/biojava3-alignment-3.0.7.jar,
+ lib/biojava3-core-3.0.7.jar,
+ lib/core-1.8.5.jar,
+ lib/sequencing-1.8.5.jar,
+ lib/bioinfweb.commons/,
+ lib/LibrAlign/,
+ lib/commons-lang3-3.1.jar
p2.inf,\
OSGI-INF/l10n/plugin.properties,\
OSGI-INF/l10n/plugin_de.properties,\
- OSGI-INF/l10n/plugin_en.properties
+ OSGI-INF/l10n/plugin_en.properties,\
+ lib/biojava3-alignment-3.0.7.jar,\
+ lib/biojava3-core-3.0.7.jar,\
+ lib/core-1.8.5.jar,\
+ lib/sequencing-1.8.5.jar,\
+ lib/bioinfweb.commons/,\
+ lib/LibrAlign/,\
+ lib/commons-lang3-3.1.jar
id="eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor"
name="%editor.name.8">
</editor>
+ <editor
+ class="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor"
+ default="false"
+ id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor"
+ name="Alignment Editor">
+ </editor>
</extension>
<extension
+ id="eu.etaxonomy.taxeditor.editor.molecular.PherogramView"
point="org.eclipse.ui.views">
<view
allowMultiple="false"
id="eu.etaxonomy.taxeditor.editor.view.validation.problems"
name="%view.name.6">
</view>
+ <view
+ allowMultiple="true"
+ class="eu.etaxonomy.taxeditor.editor.molecular.PherogramViewPart"
+ id="eu.etaxonomy.taxeditor.editor.molecular.PherogramView"
+ name="PherogramView"
+ restorable="true">
+ </view>
</extension>
-
- <!-- VALIDATION RELATED STUFF -->
+ <!-- VALIDATION RELATED STUFF -->
<extension point="org.eclipse.core.resources.markers" name="Validation Error" id="eu.etaxonomy.taxeditor.markers.validationerror">
<super type="org.eclipse.core.resources.problemmarker"/>
<attribute name="databaseId"/>
name="%marker.field.7">
</markerField>
</extension>
-
- <extension
+ <extension
point="org.eclipse.ui.elementFactories">
<factory
class="eu.etaxonomy.taxeditor.editor.TaxonEditorInputFactory"
</reference>
</visibleWhen>
</command>
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.handler.OpenAlignmentEditor"
+ label="Alignment Editor"
+ style="push">
+ </command>
</menuContribution>
<menuContribution
locationURI="menu:org.eclipse.ui.main.menu.navigate">
label="Delete (with children)"
style="push">
</command>
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.editSequence"
+ label="Edit Sequence"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <reference
+ definitionId="isSequence">
+ </reference>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.showPherogram"
+ label="Show Pherogram"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <reference
+ definitionId="isSingleRead">
+ </reference>
+ </visibleWhen>
+ </command>
<dynamic
class="eu.etaxonomy.taxeditor.editor.view.derivate.contextMenu.DerivateViewContextMenu"
id="eu.etaxonomy.taxeditor.editor.view.derivate.DerivateContextMenu">
</visibleWhen>
</command>
</menuContribution>
+ <menuContribution
+ allPopups="false"
+ locationURI="menu:org.eclipse.ui.main.menu">
+ <menu
+ label="Alignment Editor">
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.loadPherogram"
+ label="Load Pherogram"
+ style="push">
+ </command>
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="activePartId">
+ <equals
+ value="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </menu>
+ </menuContribution>
+ <menuContribution
+ locationURI="toolbar:org.eclipse.ui.main.toolbar?after=eu.etaxonomy.taxeditor.navigation.search.toolbar">
+ <toolbar
+ id="eu.etaxonomy.taxeditor.editor.alignmentToolbar">
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleInsertOverwrite"
+ label="Toggle insert/overwrite"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="activePartId">
+ <equals
+ value="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ <command
+ commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleLeftRightInsertion"
+ label="Toggle left/right insertion"
+ style="push">
+ <visibleWhen
+ checkEnabled="true">
+ <with
+ variable="activePartId">
+ <equals
+ value="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor">
+ </equals>
+ </with>
+ </visibleWhen>
+ </command>
+ </toolbar>
+ </menuContribution>
+
<menuContribution
allPopups="false"
locationURI="toolbar:eu.etaxonomy.taxeditor.editor.view.descriptive">
<handler
class="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
commandId="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler">
+ </handler>
+ <handler
+ class="eu.etaxonomy.taxeditor.editor.handler.LoadPherogramHandler"
+ commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.loadPherogram">
+ <activeWhen>
+ <with
+ variable="activePartId">
+ <equals
+ value="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor">
+ </equals>
+ </with>
+ </activeWhen>
</handler>
<handler
class="eu.etaxonomy.taxeditor.editor.view.derivate.handler.DeleteDerivateHandler"
class="eu.etaxonomy.taxeditor.editor.handler.FixClassificationHierarchyHandler"
commandId="eu.etaxonomy.taxeditor.editor.handler.FixClassificationHierarchyHandler">
</handler>
+ <handler
+ class="eu.etaxonomy.taxeditor.editor.handler.ToggleInsertOverwriteHandler"
+ commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleInsertOverwrite">
+ </handler>
+ <handler
+ class="eu.etaxonomy.taxeditor.editor.handler.ToggleLeftRightInsertionHandler"
+ commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleLeftRightInsertion">
+ </handler>
</extension>
<extension
name="%extension.name"
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistEditorHandler"
id="eu.etaxonomy.taxeditor.editor.handler.OpenChecklistViewHandler"
name="%command.name.38">
- </command>
+ </command>
<command
categoryId="eu.etaxonomy.taxeditor.editor.new.category"
defaultHandler="eu.etaxonomy.taxeditor.view.datasource.handler.CreateDataSourceHandler"
id="eu.etaxonomy.taxeditor.editor.command.new.datasource"
name="%command.name.39">
</command>
+ <command
+ defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenAlignmentEditorHandler"
+ id="eu.etaxonomy.taxeditor.editor.handler.OpenAlignmentEditor"
+ name="Open Alignment Editor">
+ </command>
+ <command
+ id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.loadPherogram"
+ name="Load Pherogram">
+ </command>
<command
id="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations"
name="Show Only Individual Associations">
</command>
+ <command
+ id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleInsertOverwrite"
+ name="Toggle insert/overwrite">
+ </command>
+ <command
+ id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleLeftRightInsertion"
+ name="Toggle left/right insertion in base call sequence">
+ </command>
<command
defaultHandler="eu.etaxonomy.taxeditor.editor.handler.OpenTaxonEditorHandler"
id="eu.etaxonomy.taxeditor.editor.openTaxonEditor"
id="eu.etaxonomy.taxeditor.editor.handler.OpenFixClassificationHierarchyHandler"
name="Fix Classification Hierarchy">
</command>
+ <command
+ defaultHandler="eu.etaxonomy.taxeditor.editor.handler.EditSequenceHandler"
+ id="eu.etaxonomy.taxeditor.editor.editSequence"
+ name="Edit Sequence">
+ </command>
+ <command
+ defaultHandler="eu.etaxonomy.taxeditor.editor.handler.ShowPherogramHandler"
+ id="eu.etaxonomy.taxeditor.editor.showPherogram"
+ name="Show Pherogram">
+ </command>
</extension>
<extension
point="org.eclipse.core.expressions.definitions">
</test>
</with>
</definition>
+ <definition
+ id="isSequence">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isSequence">
+ </test>
+ </with>
+ </definition>
+ <definition
+ id="isSingleRead">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester.isSingleRead">
+ </test>
+ </with>
+ </definition>
</extension>
<extension
point="org.eclipse.core.expressions.propertyTesters">
properties="isGroup"
type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">
</propertyTester>
+ <propertyTester
+ class="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
+ id="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
+ namespace="eu.etaxonomy.taxeditor.editor.handler.SpecimenPropertyTester"
+ properties="isSequence,isSingleRead"
+ type="org.eclipse.jface.viewers.IStructuredSelection">
+ </propertyTester>
</extension>
<extension
point="org.eclipse.ui.bindings">
id="eu.etaxonomy.taxeditor.bindings.scheme.default"
name="%scheme.name">
</scheme>
+ <key
+ commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.loadPherogram"
+ schemeId="eu.etaxonomy.taxeditor.bindings.scheme.default"
+ sequence="M1+O">
+ </key>
</extension>
<extension
point="org.eclipse.ui.importWizards">
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditorInput;
import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditorInput;
import eu.etaxonomy.taxeditor.editor.view.dataimport.BioCaseEditorInput;
open(input, ChecklistEditor.ID);
}
+ /**
+ * Opens a new AlignmentEditor for the given input
+ * @param input
+ * @throws PartInitException
+ */
+ public static void open(AlignmentEditorInput input)
+ throws PartInitException {
+ open(input, AlignmentEditor.ID);
+ }
+
/**
* Opens a new {@link DataImportEditor} for the given input
* @param input a {@link DataImportEditorInput}
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.handler;
+
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+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.editor.molecular.AlignmentEditorInput;
+
+
+
+/**
+ * Opens the alignment editor from the CDM tree.
+ *
+ * @author Ben Stöver
+ * @author pplitzner
+ */
+public class EditSequenceHandler extends AbstractHandler {
+ @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()); //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 {
+ EditorUtil.open(input);
+ }
+ catch (PartInitException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ return null;
+ }
+}
--- /dev/null
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.handler;
+
+
+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.editor.molecular.AlignmentEditor;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
+
+
+/**
+ * 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.)", "eu.etaxonomy.taxeditor.editor", e, false); //TODO set pluginID
+ }
+ catch (IOException e) {
+ MessagingUtils.errorDialog("Unsupported format", this,
+ "An IO error occurred while trying to read the file \"" + path + "\".",
+ "/eu.etaxonomy.taxeditor.editor", e, false); //TODO set pluginID
+ }
+ }
+ }
+ return null;
+ }
+}
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.handler;
+
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.PartInitException;
+
+import eu.etaxonomy.taxeditor.editor.EditorUtil;
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditorInput;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
+
+
+
+/**
+ * Opens the {@link AlignmentEditor}.
+ *
+ * @author pplitzner
+ * @date 04.08.2014
+ */
+public class OpenAlignmentEditorHandler extends AbstractHandler {
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ AlignmentEditorInput input = new AlignmentEditorInput(null); //TODO Does it make sense to start an empty editor?
+ try {
+ EditorUtil.open(input);
+ }
+ catch (PartInitException e) {
+ MessagingUtils.error(OpenAlignmentEditorHandler.class, "Could not open AlignmentEditor", e);
+ }
+ return null;
+ }
+}
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.handler;\r
+\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.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.editor.molecular.PherogramViewPart;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\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(URI uri) {\r
+ try {\r
+ PherogramViewPart.createView(uri);\r
+ }\r
+ catch (Exception e) {\r
+ MessagingUtils.errorDialog("Error", null, e.getLocalizedMessage(), "eu.etaxonomy.taxeditor.editor", //TODO Is null a valid value here? \r
+ e, false); //TODO set pluginID\r
+ } \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
+ showPherogram(MediaUtils.getFirstMediaRepresentationPart(\r
+ ((SingleRead)treeNodeOfSelection.getValue()).getPherogram()).getUri());\r
+ }\r
+ return null;\r
+ }\r
+}\r
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.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);
+ }
+}
--- /dev/null
+/**\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.editor.handler;\r
+\r
+\r
+import java.util.Map;\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
+import org.eclipse.ui.commands.IElementUpdater;\r
+import org.eclipse.ui.menus.UIElement;\r
+\r
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.model.AbstractUtility;\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 AbstractHandler implements IElementUpdater {\r
+ public static final String COMMAND_ID = \r
+ "eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleInsertOverwrite";\r
+ \r
+ \r
+ @Override\r
+ public Object execute(ExecutionEvent event) throws ExecutionException {\r
+ IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
+ if (activeEditor instanceof AlignmentEditor) {\r
+ ((AlignmentEditor)activeEditor).toggleInsertOverwrite();\r
+ }\r
+ return null;\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.setText(" INS ");\r
+ element.setTooltip("Click to switch to overwrite mode");\r
+ }\r
+ else {\r
+ element.setText("OVR");\r
+ element.setTooltip("Click to switch to insertion mode");\r
+ }\r
+ }\r
+ }\r
+}\r
--- /dev/null
+/**\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.editor.handler;\r
+\r
+\r
+import java.util.Map;\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
+import org.eclipse.ui.commands.IElementUpdater;\r
+import org.eclipse.ui.menus.UIElement;\r
+\r
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
+\r
+\r
+\r
+/**\r
+ * Switches an {@link AlignmentEditor} between insertion in the base sequence to the left or to the right.\r
+ * \r
+ * @author Ben Stöver\r
+ * @date 04.12.2014\r
+ */\r
+public class ToggleLeftRightInsertionHandler extends AbstractHandler implements IElementUpdater {\r
+ public static final String COMMAND_ID = \r
+ "eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleLeftRightInsertion";\r
+ \r
+ \r
+ @Override\r
+ public Object execute(ExecutionEvent event) throws ExecutionException {\r
+ IEditorPart activeEditor = AbstractUtility.getActiveEditor();\r
+ if (activeEditor instanceof AlignmentEditor) {\r
+ ((AlignmentEditor)activeEditor).toggleLeftRightInsertionInPherogram();\r
+ }\r
+ return null;\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
+ //TODO Use icons instead.\r
+ if (((AlignmentEditor)activeEditor).isInsertLeftInPherogram()) {\r
+ element.setText(" Left ");\r
+ element.setTooltip("Click to switch to insert new distorsions of the base call sequence right of future edits.");\r
+ }\r
+ else {\r
+ element.setText("Right");\r
+ element.setTooltip("Click to switch to insert new distorsions of the base call sequence left of future edits.");\r
+ }\r
+ }\r
+ }\r
+}\r
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.molecular;
+
+
+import info.bioinfweb.libralign.alignmentarea.AlignmentArea;
+import info.bioinfweb.libralign.dataarea.implementations.ConsensusSequenceArea;
+import info.bioinfweb.libralign.dataarea.implementations.SequenceIndexArea;
+import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramAlignmentModel;
+import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea;
+import info.bioinfweb.libralign.dataarea.implementations.pherogram.ShiftChange;
+import info.bioinfweb.libralign.editsettings.EditSettingsChangeEvent;
+import info.bioinfweb.libralign.editsettings.EditSettingsListener;
+import info.bioinfweb.libralign.multiplealignments.AlignmentAreaList;
+import info.bioinfweb.libralign.multiplealignments.MultipleAlignmentsContainer;
+import info.bioinfweb.libralign.pherogram.provider.BioJavaPherogramProvider;
+import info.bioinfweb.libralign.pherogram.provider.PherogramProvider;
+import info.bioinfweb.libralign.pherogram.provider.ReverseComplementPherogramProvider;
+import info.bioinfweb.libralign.sequenceprovider.SequenceDataChangeListener;
+import info.bioinfweb.libralign.sequenceprovider.SequenceDataProvider;
+import info.bioinfweb.libralign.sequenceprovider.SequenceUtils;
+import info.bioinfweb.libralign.sequenceprovider.adapters.StringAdapter;
+import info.bioinfweb.libralign.sequenceprovider.events.SequenceChangeEvent;
+import info.bioinfweb.libralign.sequenceprovider.events.SequenceRenamedEvent;
+import info.bioinfweb.libralign.sequenceprovider.events.TokenChangeEvent;
+import info.bioinfweb.libralign.sequenceprovider.implementations.PackedSequenceDataProvider;
+import info.bioinfweb.libralign.sequenceprovider.tokenset.BioJavaTokenSet;
+import info.bioinfweb.libralign.sequenceprovider.tokenset.TokenSet;
+
+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.Map;
+import java.util.TreeMap;
+
+import org.biojava.bio.chromatogram.ChromatogramFactory;
+import org.biojava.bio.chromatogram.UnsupportedChromatogramFormatException;
+import org.biojava3.core.sequence.compound.DNACompoundSet;
+import org.biojava3.core.sequence.compound.NucleotideCompound;
+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.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.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.taxeditor.editor.handler.ToggleInsertOverwriteHandler;
+import eu.etaxonomy.taxeditor.editor.handler.ToggleLeftRightInsertionHandler;
+
+
+
+/**
+ * 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.editor.molecular.AlignmentEditor";
+ public static final int READS_AREA_INDEX = 1;
+ public static final int CONSENSUS_AREA_INDEX = READS_AREA_INDEX + 1;
+ public static final int PHEROGRAM_AREA_INDEX = 0;
+ public static final String DEFAULT_READ_NAME_PREFIX = "Read ";
+ public static final String CONSENSUS_NAME = "Consensus";
+
+
+ private final SequenceDataChangeListener DIRTY_LISTENER = new SequenceDataChangeListener() {
+ @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(SequenceDataProvider<T> oldProvider,
+ SequenceDataProvider<U> newProvider) { // Not expected.
+
+ setDirty();
+ }
+ };
+
+ private MultipleAlignmentsContainer alignmentsContainer = null;
+ private Map<Integer, SingleReadAlignment> cdmMap = new TreeMap<Integer, SingleReadAlignment>(); //TODO Move this to ContigSequenceDataProvider
+ private boolean dirty = false;
+
+
+ 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 result = new AlignmentArea(container);
+ result.setAllowVerticalScrolling(false);
+ result.getDataAreas().getTopAreas().add(new SequenceIndexArea(result.getContentArea()));
+ return result;
+ }
+
+
+ private AlignmentArea createEditableAlignmentArea(MultipleAlignmentsContainer container, boolean allowVerticalScrolling) {
+ AlignmentArea result = new AlignmentArea(container);
+ result.setAllowVerticalScrolling(allowVerticalScrolling);
+
+ TokenSet<NucleotideCompound> tokenSet = new BioJavaTokenSet<NucleotideCompound>(new DNACompoundSet(), true);
+ SequenceDataProvider<NucleotideCompound> provider = new PackedSequenceDataProvider<NucleotideCompound>(tokenSet);
+ result.setSequenceProvider(provider, false);
+ provider.getChangeListeners().add(DIRTY_LISTENER);
+
+ return result;
+ }
+
+
+ private AlignmentArea createConsensusHintArea(MultipleAlignmentsContainer container,
+ SequenceDataProvider<?> sequenceProvider) {
+
+ AlignmentArea result = new AlignmentArea(container);
+ result.setAllowVerticalScrolling(false);
+ result.getDataAreas().getBottomAreas().add(
+ new ConsensusSequenceArea(result.getContentArea(), sequenceProvider));
+ return result;
+ }
+
+
+ private MultipleAlignmentsContainer getAlignmentsContainer() {
+ if (alignmentsContainer == null) {
+ alignmentsContainer = new MultipleAlignmentsContainer();
+
+ AlignmentAreaList list = alignmentsContainer.getAlignmentAreas();
+ list.add(createIndexArea(alignmentsContainer));
+ AlignmentArea readsArea = createEditableAlignmentArea(alignmentsContainer, true);
+ 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.getSequenceProvider()));
+
+ registerEditSettingListener(alignmentsContainer);
+ }
+ return alignmentsContainer;
+ }
+
+
+ private AlignmentArea getReadsArea() {
+ return getAlignmentsContainer().getAlignmentAreas().get(READS_AREA_INDEX);
+ }
+
+
+ private AlignmentArea getConsensusArea() {
+ return getAlignmentsContainer().getAlignmentAreas().get(CONSENSUS_AREA_INDEX);
+ }
+
+
+ private PherogramArea getPherogramArea(int sequenceID) {
+ return (PherogramArea)getReadsArea().getDataAreas().getSequenceAreas(sequenceID).get(PHEROGRAM_AREA_INDEX);
+ }
+
+
+ private void createTestContents() {
+ // Just for testing:
+ try {
+ addRead(new File("D:/Users/BenStoever/Documents/Studium/Projekte/Promotion/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/Documents/Studium/Projekte/Promotion/EDITor/Quelltexte/LibrAlign branch/Repository/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1").toURI(), false);
+
+ // Add test consensus sequence:
+ SequenceDataProvider consensusProvider = getConsensusArea().getSequenceProvider();
+ int id = consensusProvider.addSequence(CONSENSUS_NAME);
+ Collection<Object> tokens = new ArrayList<Object>(); // First save tokens in a collection to avoid GUI updated for each token.
+ tokens.add(consensusProvider.getTokenSet().tokenByKeyChar('A'));
+ tokens.add(consensusProvider.getTokenSet().tokenByKeyChar('C'));
+ tokens.add(consensusProvider.getTokenSet().tokenByKeyChar('G'));
+ tokens.add(consensusProvider.getTokenSet().tokenByKeyChar('T'));
+ consensusProvider.insertTokensAt(id, 0, tokens);
+ }
+ catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+
+ private void readCDMData() {
+ //TODO If called from somewhere else than createPartControl() the editorInput needs to be checked and previous contents need to be cleared (or updated).
+ Sequence sequenceNode = ((AlignmentEditorInput)getEditorInput()).getSequenceNode();
+
+ // Add reads:
+ for (SingleReadAlignment singleReadAlignment : sequenceNode.getSingleReadAlignments()) {
+ try {
+ SingleRead pherogramInfo = singleReadAlignment.getSingleRead();
+ int id = addRead(pherogramInfo.getPrimer().getLabel(), //TODO Should the sequence name contain other/additional/alternative data? Can the same string as in the derivative tree be used here?
+ MediaUtils.getFirstMediaRepresentationPart(pherogramInfo.getPherogram()).getUri(),
+ singleReadAlignment.isReverseComplement(),
+ singleReadAlignment.getEditedSequence(),
+ singleReadAlignment.getShifts());
+ cdmMap.put(id, singleReadAlignment);
+ }
+ catch (IOException e) {
+ e.printStackTrace(); //TODO Output to user (Possibly collect for all pherograms and display in the end.)
+ }
+ catch (UnsupportedChromatogramFormatException e) {
+ e.printStackTrace(); //TODO Output to user (Possibly collect for all pherograms and display in the end.)
+ }
+ }
+
+ // Set consensus sequence:
+ SequenceDataProvider consensusProvider = getConsensusArea().getSequenceProvider();
+ int id = consensusProvider.addSequence(CONSENSUS_NAME);
+ consensusProvider.insertTokensAt(id, 0, SequenceUtils.stringToTokenList(
+ 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) {
+ getAlignmentsContainer().createSWTWidget(parent, SWT.NONE);
+ updateStatusBar();
+
+ if (getEditorInput() instanceof AlignmentEditorInput) {
+ if (((AlignmentEditorInput)getEditorInput()).getSequenceNode() != null) {
+ readCDMData();
+ }
+ else {
+ createTestContents(); //TODO What to do here instead in the final version?
+ }
+ }
+ 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(PherogramAlignmentModel alignmentModel) {
+ SingleReadAlignment.Shift[] result = new SingleReadAlignment.Shift[alignmentModel.getShiftChangeCount()];
+ Iterator<ShiftChange> iterator = alignmentModel.shiftChangeIterator();
+ int pos = 0;
+ while (iterator.hasNext()) {
+ ShiftChange shiftChange = iterator.next();
+ result[pos] = new SingleReadAlignment.Shift(shiftChange.getBaseCallIndex(), shiftChange.getShiftChange());
+ }
+ return result;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void doSave(IProgressMonitor monitor) {
+ System.out.println("save 1");
+ if (getEditorInput() instanceof AlignmentEditorInput) {
+ System.out.println("save 2");
+ Sequence sequenceNode = ((AlignmentEditorInput)getEditorInput()).getSequenceNode();
+ StringAdapter stringProvider = new StringAdapter(getConsensusArea().getSequenceProvider(), false); // Throws an exception if a token has more than one character.
+
+ // Write consensus sequence:
+ SequenceString consensusSequenceObj = sequenceNode.getConsensusSequence();
+ String newConsensusSequence = stringProvider.getSequence(
+ getConsensusArea().getSequenceProvider().sequenceIDByName(CONSENSUS_NAME));
+ if (consensusSequenceObj == null) {
+ sequenceNode.setConsensusSequence(SequenceString.NewInstance(newConsensusSequence));
+ }
+ else {
+ consensusSequenceObj.setString(newConsensusSequence);
+ }
+
+ // Write single reads:
+ stringProvider.setUnderlyingProvider(getReadsArea().getSequenceProvider());
+ sequenceNode.getSingleReadAlignments().retainAll(cdmMap.values()); // Remove all reads that are not in the alignment anymore.
+ Iterator<Integer> iterator = getReadsArea().getSequenceProvider().sequenceIDIterator();
+ while (iterator.hasNext()) {
+ int id = iterator.next();
+ System.out.println("Saving sequence " + id);
+ SingleReadAlignment singleRead = cdmMap.get(id);
+ if (singleRead == null) {
+ //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));
+ singleRead.setReverseComplement(getPherogramArea(id).getProvider() instanceof ReverseComplementPherogramProvider); // Works only if ReverseComplementPherogramProvider instances are not nested.
+ singleRead.setShifts(convertToCDMShifts(getPherogramArea(id).getAlignmentModel()));
+ System.out.println(singleRead.getShifts());
+ }
+ }
+ dirty = false; //TODO "*" is not removed from editor title. Why not? (Should be save action in the tool bar be disabled when isDirty() returns false? This is also not the case.)
+ }
+
+
+ /* (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;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
+ */
+ @Override
+ public boolean isSaveAsAllowed() {
+ return false; // "Save as" not allowed.
+ }
+
+
+ @Override
+ public void setFocus() {}
+
+
+ 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();
+ }
+
+
+ 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().getSequenceProvider().sequenceIDByName(DEFAULT_READ_NAME_PREFIX + index)
+ != SequenceDataProvider.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);
+ }
+
+
+ /**
+ * 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,
+ SingleReadAlignment.Shift[] shifts) throws IOException, UnsupportedChromatogramFormatException {
+
+ SequenceDataProvider provider = getReadsArea().getSequenceProvider();
+ PherogramProvider 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; // First save tokens in a collection to avoid GUI updated for each token.
+ if (editedSequence != null) {
+ tokens = SequenceUtils.stringToTokenList(editedSequence, provider.getTokenSet());
+ }
+ else { // Copy base call sequence into alignment:
+ tokens = new ArrayList<Object>();
+ for (int i = 0; i < pherogramProvider.getSequenceLength(); i++) {
+ tokens.add(provider.getTokenSet().tokenByKeyChar(
+ pherogramProvider.getBaseCall(i).getUpperedBase().charAt(0)));
+ }
+ setDirty();
+ }
+ provider.insertTokensAt(id, 0, tokens);
+
+ // Create pherogram area:
+ PherogramArea pherogramArea = new PherogramArea(getReadsArea().getContentArea(), pherogramProvider);
+
+ // Set shifts:
+ if (shifts != null) {
+ PherogramAlignmentModel alignmentModel = pherogramArea.getAlignmentModel();
+ for (int i = 0; i < shifts.length; i++) {
+ alignmentModel.addShiftChange(shifts[i].position, shifts[i].shift);
+ }
+ setDirty();
+ }
+
+ // Add pherogram area to GUI:
+ pherogramArea.addMouseListener(new PherogramMouseListener(pherogramURI));
+ getReadsArea().getDataAreas().getSequenceAreas(id).add(pherogramArea);
+
+ // Save source URI:
+ return id;
+ }
+}
\ No newline at end of file
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2014 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.editor.molecular;
+
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+import eu.etaxonomy.cdm.model.molecular.Sequence;
+
+
+
+/**
+ * @author pplitzner
+ * @author Ben Stöver
+ * @date 04.08.2014
+ */
+public class AlignmentEditorInput implements IEditorInput {
+ private static final String name = "AlignmentEditor";
+
+
+ private final Sequence sequenceNode;
+
+
+ public AlignmentEditorInput(Sequence sequenceNode) {
+ super();
+ this.sequenceNode = sequenceNode;
+ }
+
+
+ /* (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 sequence CDM node that should be edited by the {@link AlignmentEditor} this object
+ * is used with.
+ *
+ * @return the CDM node to work on
+ */
+ public Sequence getSequenceNode() {
+ return sequenceNode;
+ }
+}
--- /dev/null
+package eu.etaxonomy.taxeditor.editor.molecular;\r
+\r
+\r
+import info.bioinfweb.libralign.dataarea.implementations.pherogram.ShiftChange;\r
+\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+import java.util.Map;\r
+import java.util.TreeMap;\r
+\r
+import org.biojava3.core.sequence.compound.NucleotideCompound;\r
+import org.biojava3.core.sequence.template.Sequence;\r
+\r
+\r
+\r
+/**\r
+ * This class is used as a replacement for a class representing the CMD objects storing an contig alignment during early\r
+ * development phase.\r
+ * \r
+ * @author Ben Stöver\r
+ * @date 06.08.2014\r
+ */\r
+public class CDMAlignmentObjectPlaceholder {\r
+ /**\r
+ * Represents information in the contig alignment describing a single read sequence and the relation to its associated\r
+ * pherogram.\r
+ * \r
+ * @author Ben Stöver\r
+ * @date 06.08.2014\r
+ */\r
+ public static class Read {\r
+ private long pherogramObjectID = Long.MIN_VALUE; // The ID used in the CMD to identify the object storing the pherogram URL. (Dont' know if this is long, just as an example-)\r
+ private Sequence<NucleotideCompound> editableSequence = null; // Could also be of type String, if helpful for CDM architecture.\r
+ private List<ShiftChange> shiftChangeList = new ArrayList<ShiftChange>();\r
+ private String readName = "";\r
+ private boolean reverseComplemeted = false;\r
+ \r
+ \r
+ public Read(long pherogramObjectID) {\r
+ super();\r
+ this.pherogramObjectID = pherogramObjectID;\r
+ }\r
+\r
+\r
+ public long getPherogramObjectID() {\r
+ return pherogramObjectID;\r
+ }\r
+\r
+\r
+ public void setPherogramObjectID(long pherogramObjectID) {\r
+ this.pherogramObjectID = pherogramObjectID;\r
+ }\r
+\r
+\r
+ public List<ShiftChange> getShiftChangeList() {\r
+ return shiftChangeList;\r
+ }\r
+\r
+\r
+ public Sequence<NucleotideCompound> getEditableSequence() {\r
+ return editableSequence;\r
+ }\r
+\r
+\r
+ public String getReadName() {\r
+ return readName;\r
+ }\r
+\r
+\r
+ public void setReadName(String readName) {\r
+ this.readName = readName;\r
+ }\r
+\r
+\r
+ public boolean isReverseComplemeted() {\r
+ return reverseComplemeted;\r
+ }\r
+\r
+\r
+ public void setReverseComplemeted(boolean reverseComplemeted) {\r
+ this.reverseComplemeted = reverseComplemeted;\r
+ }\r
+ }\r
+ \r
+ \r
+ private Map<String, Sequence<NucleotideCompound>> consensusSequences = new TreeMap<String, Sequence<NucleotideCompound>>(); // Could also be of type Map<String, String>, if helpful for CDM architecture.\r
+ private Map<Long, Read> readSequences = new TreeMap<Long, Read>();\r
+ \r
+ \r
+ public Map<String, Sequence<NucleotideCompound>> getConsensusSequences() {\r
+ return consensusSequences;\r
+ }\r
+ \r
+ \r
+ public Map<Long, Read> getReadSequences() {\r
+ return readSequences;\r
+ }\r
+}\r
--- /dev/null
+// $Id$\r
+/**\r
+* Copyright (C) 2014 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.editor.molecular;\r
+\r
+\r
+import org.biojava3.core.sequence.compound.NucleotideCompound;\r
+\r
+import info.bioinfweb.commons.bio.biojava3.core.sequence.compound.AlignmentAmbiguityDNACompoundSet;\r
+import info.bioinfweb.libralign.sequenceprovider.SequenceDataProvider;\r
+import info.bioinfweb.libralign.sequenceprovider.implementations.PackedSequenceDataProvider;\r
+import info.bioinfweb.libralign.sequenceprovider.tokenset.BioJavaTokenSet;\r
+\r
+\r
+\r
+/**\r
+ * The LibrAlign sequence data provider used to edit contig alignments with the {@link AlignmentEditor}.\r
+ * \r
+ * @author Ben Stöver\r
+ * @date 04.08.2014\r
+ */\r
+public class ContigSequenceDataProvider extends PackedSequenceDataProvider<NucleotideCompound> \r
+ implements SequenceDataProvider<NucleotideCompound> {\r
+\r
+ \r
+ public ContigSequenceDataProvider() {\r
+ super(new BioJavaTokenSet<NucleotideCompound>(AlignmentAmbiguityDNACompoundSet.getAlignmentAmbiguityDNACompoundSet(), true));\r
+ }\r
+ \r
+ \r
+ public void saveToCMD() { //TODO Add cmd node as parameter \r
+ //TODO impl.\r
+ }\r
+ \r
+ \r
+ public void loadFromCMD() { //TODO Add cmd node as parameter\r
+ //TODO impl.\r
+ }\r
+}\r
--- /dev/null
+/**\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.editor.molecular;\r
+\r
+\r
+import info.bioinfweb.commons.tic.input.TICMouseAdapter;\r
+import info.bioinfweb.commons.tic.input.TICMouseEvent;\r
+\r
+import java.net.URI;\r
+\r
+import eu.etaxonomy.taxeditor.editor.handler.ShowPherogramHandler;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\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 URI uri;\r
+ \r
+ \r
+ public PherogramMouseListener(URI uri) {\r
+ super();\r
+ this.uri = uri;\r
+ }\r
+\r
+\r
+ @Override\r
+ public void mousePressed(TICMouseEvent event) {\r
+ if (event.getClickCount() == 2) { // Double click\r
+ ShowPherogramHandler.showPherogram(uri);\r
+ }\r
+ }\r
+}\r
--- /dev/null
+/**\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.editor.molecular;\r
+\r
+\r
+import java.io.IOException;\r
+import java.net.MalformedURLException;\r
+import java.net.URI;\r
+\r
+import info.bioinfweb.libralign.pherogram.PherogramFormats.QualityOutputType;\r
+import info.bioinfweb.libralign.pherogram.view.PherogramView;\r
+\r
+import org.biojava.bio.chromatogram.UnsupportedChromatogramFormatException;\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.editor.molecular.PherogramView";\r
+\r
+ private URI uri = null;\r
+ private PherogramView pherogramView = null;\r
+ \r
+ \r
+ public static PherogramViewPart createView(URI uri) throws PartInitException, MalformedURLException, \r
+ UnsupportedChromatogramFormatException, IOException {\r
+ \r
+ PherogramViewPart view = (PherogramViewPart)PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ID);\r
+ view.setURI(uri);\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
+ public URI getURI() {\r
+ return uri;\r
+ }\r
+\r
+\r
+ protected void setURI(URI uri) throws MalformedURLException, IOException, UnsupportedChromatogramFormatException {\r
+ this.uri = uri;\r
+ getPherogramView().getTraceCurveView().setProvider(AlignmentEditor.readPherogram(uri));\r
+ getPherogramView().assignSize();\r
+ }\r
+\r
+\r
+ @Override\r
+ public void createPartControl(Composite parent) {\r
+ getPherogramView().createSWTWidget(parent, SWT.NONE);\r
+ getPherogramView().assignSize();\r
+ }\r
+ \r
+ \r
+ @Override\r
+ public void setFocus() {} // nothing to do\r
+}\r
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.application"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.bulkeditor"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.cdmlib"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.editor"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.navigation"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.printpublisher"/>
- <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.store"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>\r
+<classpath>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.application"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.bulkeditor"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.cdmlib"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.editor"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.navigation"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.printpublisher"/>\r
+ <classpathentry kind="src" path="/eu.etaxonomy.taxeditor.store"/>\r
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
+ <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r