merge-update from trunk
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 29 Jun 2015 12:39:34 +0000 (12:39 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 29 Jun 2015 12:39:34 +0000 (12:39 +0000)
56 files changed:
.gitattributes
.gitignore
eu.etaxonomy.taxeditor.application/plugin_customization.ini
eu.etaxonomy.taxeditor.cdmlib/.gitignore [deleted file]
eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.editor/.classpath
eu.etaxonomy.taxeditor.editor/.project
eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.editor/build.properties
eu.etaxonomy.taxeditor.editor/icons/insert-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/icons/overwrite-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.png [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditSequenceHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/HandlerTools.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/LoadPherogramHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditorHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/ShowPherogramHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SpecimenPropertyTester.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractAlignmentEditorHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractPherogramComponentHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ChangePherogramQualityOutputType.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CreateConsensusSequenceHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramLeftHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramRightHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ReverseComplementHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleInsertOverwriteHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleLeftRightInsertionHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramBaseCallLinesHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramProbabilitiesHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/UpdateConsensusSequenceHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/package-info.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CDMAlignmentObjectPlaceholder.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/ContigSequenceDataProvider.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/PherogramMouseListener.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/PherogramViewPart.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1 [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1 [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/Test_qualityScore.scf [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf [new file with mode: 0644]
eu.etaxonomy.taxeditor.printpublisher/.classpath
eu.etaxonomy.taxeditor.test/META-INF/MANIFEST.MF
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/AbstractEditorTest.java
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/test/SwtBotUtils.java
eu.etaxonomy.taxeditor/.gitignore [deleted file]

index e6bb9df13a99bf906f9bb0b0bf78c8ce9ee2a42f..3daa4eca1bc10dcdccba0e6b1c2db113629e4e02 100644 (file)
@@ -367,9 +367,20 @@ eu.etaxonomy.taxeditor.editor/icons/deep-delete-16x16-32.png -text
 eu.etaxonomy.taxeditor.editor/icons/derivate_view-16x16-32.png -text
 eu.etaxonomy.taxeditor.editor/icons/edit_16x16.gif -text
 eu.etaxonomy.taxeditor.editor/icons/emblem-photos.png -text
+eu.etaxonomy.taxeditor.editor/icons/insert-16x16.png -text
 eu.etaxonomy.taxeditor.editor/icons/leaf_detail.png -text
 eu.etaxonomy.taxeditor.editor/icons/link_obj.gif -text
+eu.etaxonomy.taxeditor.editor/icons/overwrite-16x16.png -text
+eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-16x16.png -text
+eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png -text
+eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png -text
+eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.png -text
 eu.etaxonomy.taxeditor.editor/icons/xper64.png -text
+eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar -text
+eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar -text
+eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar -text
+eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar -text
+eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar -text
 eu.etaxonomy.taxeditor.editor/p2.inf -text
 eu.etaxonomy.taxeditor.editor/plugin.xml -text
 eu.etaxonomy.taxeditor.editor/pom.xml -text
@@ -395,13 +406,32 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/handler/EditCdmAuthoritiesHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditNewTaxonHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditSequenceHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/HandlerTools.java -text svneol=unset#text/plain
+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/alignmenteditor/AbstractAlignmentEditorHandler.java -text svneol=unset#text/plain
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractPherogramComponentHandler.java -text svneol=unset#text/plain
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ChangePherogramQualityOutputType.java -text svneol=unset#text/plain
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CreateConsensusSequenceHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramLeftHandler.java -text svneol=unset#text/plain
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramRightHandler.java -text svneol=unset#text/plain
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ReverseComplementHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleInsertOverwriteHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleLeftRightInsertionHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramBaseCallLinesHandler.java -text svneol=unset#text/plain
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramProbabilitiesHandler.java -text svneol=unset#text/plain
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/UpdateConsensusSequenceHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/package-info.java -text svneol=unset#text/plain
 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
@@ -429,6 +459,12 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/po
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/CreateNodeOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/DeleteNodeOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RefreshNodeNumberingOperation.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/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
@@ -618,7 +654,11 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/v
 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/AlignmentTestData/Test_qualityScore.scf -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
@@ -976,7 +1016,6 @@ eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigatio
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonLinkHelper.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorDataChangeBehavior.java -text
-eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeComparator.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeContentProvider.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodeLabelProvider.java -text
 eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNodePropertyTester.java -text
index 5c8b928b8e9810e6ba3615b0efdeead665c5c54d..87dc88128e4c55100ba12b0ceb536fcbed647dd4 100644 (file)
@@ -5,14 +5,43 @@ eu.etaxonomy.taxeditor.bulkeditor/.settings
 eu.etaxonomy.taxeditor.bulkeditor/target
 eu.etaxonomy.taxeditor.cdmlib/.directory
 eu.etaxonomy.taxeditor.cdmlib/.settings
+eu.etaxonomy.taxeditor.cdmlib/META-INF/bin
+eu.etaxonomy.taxeditor.cdmlib/bin
 eu.etaxonomy.taxeditor.cdmlib/cdmlib-*.jar
 eu.etaxonomy.taxeditor.cdmlib/cdmlib-*.zip
 eu.etaxonomy.taxeditor.cdmlib/dist
+eu.etaxonomy.taxeditor.cdmlib/lib/bin
 eu.etaxonomy.taxeditor.cdmlib/lib/cdmlib*
 eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.servletbridge.extensionbundle-1.2.0.v20100503.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.transforms.hook-1.0.300.v20100719.jar
 eu.etaxonomy.taxeditor.cdmlib/lib/org.eclipse.equinox.weaving.hook-1.0.100.v20110502.jar
 eu.etaxonomy.taxeditor.cdmlib/log4j-1.2.14src.zip
+eu.etaxonomy.taxeditor.cdmlib/src/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/application/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/lazyloading/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/remote/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/collection/internal/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/hibernate/proxy/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/bin
+eu.etaxonomy.taxeditor.cdmlib/src/main/resources/eu/etaxonomy/cdm/bin
+eu.etaxonomy.taxeditor.cdmlib/src/test/bin
+eu.etaxonomy.taxeditor.cdmlib/src/test/resources/bin
+eu.etaxonomy.taxeditor.cdmlib/src/test/resources/eu/bin
+eu.etaxonomy.taxeditor.cdmlib/src/test/resources/eu/etaxonomy/bin
+eu.etaxonomy.taxeditor.cdmlib/src/test/resources/eu/etaxonomy/cdm/bin
+eu.etaxonomy.taxeditor.cdmlib/src/test/resources/eu/etaxonomy/cdm/datasources/bin
 eu.etaxonomy.taxeditor.cdmlib/target
 eu.etaxonomy.taxeditor.editor/.settings
 eu.etaxonomy.taxeditor.editor/target
@@ -37,6 +66,7 @@ eu.etaxonomy.taxeditor.store/target
 eu.etaxonomy.taxeditor.test/screenshots/*.jpeg
 eu.etaxonomy.taxeditor.test/target
 eu.etaxonomy.taxeditor/.settings
+eu.etaxonomy.taxeditor/rcp.target
 eu.etaxonomy.taxeditor/target
 /runtime-taxeditor.product
 /target
index d97cc21c8167c7c2b4a36a9ba7765c4874539578..7369371009b25e33919f838a7be15cc08c851164 100644 (file)
@@ -1,4 +1,5 @@
 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
diff --git a/eu.etaxonomy.taxeditor.cdmlib/.gitignore b/eu.etaxonomy.taxeditor.cdmlib/.gitignore
deleted file mode 100644 (file)
index c5e82d7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-bin
\ No newline at end of file
index 879087a8b1a1cd314fe813a5d07a5812bee0be83..c29cbbc934941400da167fab12c0633318a24dbc 100644 (file)
@@ -258,7 +258,6 @@ Export-Package: com.google.api,
  org.apache.lucene.util,
  org.apache.sanselan;uses:="org.apache.sanselan.common,org.apache.sanselan.common.byteSources",
  org.apache.xerces.dom,
- org.eclipse.osgi.internal.loader,
  org.eclipse.osgi.util,
  org.h2.jdbc,
  org.hamcrest,
@@ -303,7 +302,6 @@ Export-Package: com.google.api,
  org.joda.time.format;uses:="org.joda.time",
  org.joda.time.tz;uses:="org.joda.time",
  org.junit;uses:="org.hamcrest",
- org.junit.runner,
  org.odftoolkit.odfdom,
  org.odftoolkit.odfdom.doc,
  org.odftoolkit.odfdom.doc.office,
index 1389dff1f7b6604e2e9992e96b02938cad915866..ada5dc9b3c829d3e5c3fce622488b4f5717365d9 100644 (file)
@@ -5,5 +5,13 @@
        <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 exported="true" kind="lib" path="lib/JPhyloIO" sourcepath="lib/JPhyloIO"/>\r
        <classpathentry kind="output" path="target/classes"/>\r
 </classpath>\r
index e25293c2fcd8c813e182d2540716f7b232713c7e..ae393bcbdba6fa4f7375b348031c4bf5cb376b60 100644 (file)
@@ -1,28 +1,45 @@
-<?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/JPhyloIO</name>\r
+                       <type>2</type>\r
+                       <locationURI>WORKSPACE_LOC/JPhyloIO/bin</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>lib/LibrAlign</name>\r
+                       <type>2</type>\r
+                       <locationURI>WORKSPACE_LOC/LibrAlign/bin</locationURI>\r
+               </link>\r
+               <link>\r
+                       <name>lib/bioinfweb.commons</name>\r
+                       <type>2</type>\r
+                       <locationURI>WORKSPACE_LOC/_Lib/bin</locationURI>\r
+               </link>\r
+       </linkedResources>\r
+</projectDescription>\r
index bcd8ff062f8d8d9861f1404cfdbe1f160bead4b7..a9120795f7ed83fed1bc99377cf0cfcb758fddaf 100644 (file)
@@ -177,4 +177,12 @@ Bundle-ClassPath: .,
  jdimodel.jar,
  pdebuild.jar,
  compatibility.jar,
- junit.jar
+ junit.jar,
+ lib/biojava3-alignment-3.0.7.jar,
+ lib/biojava3-core-3.0.7.jar,
+ lib/core-1.8.5.jar,
+ lib/sequencing-1.8.5.jar,
+ lib/bioinfweb.commons/,
+ lib/LibrAlign/,
+ lib/commons-lang3-3.1.jar,
+ lib/JPhyloIO/
index 51792637faccc249bf51af76837e830741d53322..956dd0e7c615eaa094797206385335f56fe914ff 100644 (file)
@@ -6,4 +6,12 @@ bin.includes = META-INF/,\
                icons/,\
                p2.inf,\
                OSGI-INF/l10n/plugin.properties,\
-               OSGI-INF/l10n/plugin_de.properties
+               OSGI-INF/l10n/plugin_de.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,\
+               lib/JPhyloIO/
diff --git a/eu.etaxonomy.taxeditor.editor/icons/insert-16x16.png b/eu.etaxonomy.taxeditor.editor/icons/insert-16x16.png
new file mode 100644 (file)
index 0000000..6c9bce7
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/icons/insert-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.editor/icons/overwrite-16x16.png b/eu.etaxonomy.taxeditor.editor/icons/overwrite-16x16.png
new file mode 100644 (file)
index 0000000..d2aa9e2
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/icons/overwrite-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-16x16.png b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-16x16.png
new file mode 100644 (file)
index 0000000..d36e479
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png
new file mode 100644 (file)
index 0000000..b7a23fa
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-left-disabled-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png
new file mode 100644 (file)
index 0000000..4d10fb1
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.png b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.png
new file mode 100644 (file)
index 0000000..3f9fa7c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/icons/pherogram-insert-right-disabled-16x16.png differ
diff --git a/eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar b/eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar
new file mode 100644 (file)
index 0000000..e5f1d6b
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/biojava3-alignment-3.0.7.jar differ
diff --git a/eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar b/eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar
new file mode 100644 (file)
index 0000000..c9f1f81
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/biojava3-core-3.0.7.jar differ
diff --git a/eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar b/eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar
new file mode 100644 (file)
index 0000000..a85e539
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/commons-lang3-3.1.jar differ
diff --git a/eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar b/eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar
new file mode 100644 (file)
index 0000000..c6c7bdc
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/core-1.8.5.jar differ
diff --git a/eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar b/eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar
new file mode 100644 (file)
index 0000000..b987ebe
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/lib/sequencing-1.8.5.jar differ
index d06b782aa811d6b29e2875ed6f37b4a6d63f1d12..d16220bdc5b4f5e10c4758c6909592848ad81dc3 100644 (file)
             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="%extension.name.0" 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">
             <visibleWhen
                   checkEnabled="true">
                <and>
-                  <with
-                        variable="selection">
-                     <count
-                           value="+">
-                     </count>
-                  </with>
+               <with
+                     variable="selection">
+                  <count
+                        value="+">
+                  </count>
+               </with>
                   <reference
                         definitionId="isIndividualsAssociation">
                   </reference>
                name="eu.etaxonomy.taxeditor.taxonDescriptionEditor.separator.afterNew"
                visible="true">
          </separator>
-                  <command
+         <command
                commandId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.delete"
                label="%command.label.30"
                style="push">
                label="%command.label.54"
                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="View">
+            <menu
+                  label="Pherogram">
+               <command
+                     commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.changeQualityOutput"
+                     style="push">
+               </command>
+               <command
+                     commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowProbabilities"
+                     style="push">
+               </command>
+               <command
+                     commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowBaseCallLines"
+                     style="push">
+               </command>
+               <visibleWhen
+                     checkEnabled="true">
+                  <with
+                        variable="activePartId">
+                     <or>
+                        <equals
+                              value="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor">
+                        </equals>
+                        <equals
+                              value="eu.etaxonomy.taxeditor.editor.molecular.PherogramView">
+                        </equals>
+                     </or>
+                  </with>
+               </visibleWhen>
+            </menu>
+         </menu>
+         <menu
+               label="Alignment Editor">
+            <command
+                  commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.loadPherogram"
+                  style="push">
+            </command>
+            <command
+                  commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.cutPherogramLeft"
+                  id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.cutPherogramLeft"
+                  name="Cut pherogram left">
+            </command>
+            <command
+                  commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.cutPherogramRight"
+                  id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.cutPherogramRight"
+                  style="push">
+            </command>
+            <command
+                  commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.reverseComplementRows"
+                  mnemonic="r"
+                  style="push">
+            </command>
+            <command
+                  commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.createConsensus"
+                  style="push">
+            </command>
+            <command
+                  commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.updateConsensus"
+                  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"
+                  icon="icons/pherogram-insert-left-16x16.png"
+                  style="push">
+               <visibleWhen
+                     checkEnabled="false">
+                  <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">
                        value="eu.etaxonomy.taxeditor.editor.view.uses">
                                </equals>
                 </or>
-                </with>
-         </activeWhen>
+             </with>
+          </activeWhen>
       </handler>
       <handler
             class="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.DeleteNodeHandler"
             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"
             commandId="eu.etaxonomy.taxeditor.editor.view.derivate.command.delete">
             class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.ToggleShowOnlyIndividualAssociationsHandler"
             commandId="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations">
       </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.ToggleInsertOverwriteHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleInsertOverwrite">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.ToggleLeftRightInsertionHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.toggleLeftRightInsertion">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.CutPherogramLeftHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.cutPherogramLeft">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.CutPherogramRightHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.cutPherogramRight">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.ReverseComplementHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.reverseComplementRows">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.CreateConsensusSequenceHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.createConsensus">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.UpdateConsensusSequenceHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.updateConsensus">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.ToggleShowPherogramProbabilitiesHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowProbabilities">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.ToggleShowPherogramBaseCallLinesHandler"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowBaseCallLines">
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.ChangePherogramQualityOutputType"
+            commandId="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.changeQualityOutput">
+      </handler>
    </extension>
    <extension
          name="%extension.name"
             id="eu.etaxonomy.taxeditor.editor.name.swapSynonymAndAccepted"
             name="%command.name.6">
       </command>
-      <command
+       <command
             categoryId="eu.etaxonomy.taxeditor.editor.taxon.name.command.category"
             defaultHandler="eu.etaxonomy.taxeditor.editor.name.handler.MoveSynonymToAnotherAcceptedTaxonHandler"
             id="eu.etaxonomy.taxeditor.editor.name.moveSynonymToAnotherAcceptedTaxon"
             id="eu.etaxonomy.taxeditor.editor.view.descriptive.command.adddescription"
             name="%command.name.11">
       </command>
-       <command
-             categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
+      <command
+            categoryId="eu.etaxonomy.taxeditor.editor.view.descriptive.command.category"
              defaultHandler="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DeleteHandler"
              id="eu.etaxonomy.taxeditor.editor.view.descriptive.command.delete"
              name="%command.name.48">
              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="%command.name.41">
       </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.description.commands.moveDescriptionElements"
             name="%command.name.12">
       </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>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.cutPherogramLeft"
+            name="Cut pherogram left">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.cutPherogramRight"
+            name="Cut pherogram right">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.reverseComplementRows"
+            name="Reverse complement selected rows">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.createConsensus"
+            name="(Re)create consensus sequence">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor.updateConsensus"
+            name="Update consensus sequence">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowProbabilities"
+            name="Toggle show probability values">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.toggleShowBaseCallLines"
+            name="Toggle show base call lines">
+      </command>
+      <command
+            id="eu.etaxonomy.taxeditor.editor.molecular.pherogramComponent.changeQualityOutput"
+            name="Change quality output">
+      </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="isGroupEditor"
             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">
index c9350145261000221c842ae1127f8c5d96779a32..d923dd9b8a7dcb49424471312505a5f04c9853e9 100644 (file)
@@ -37,6 +37,8 @@ import eu.etaxonomy.taxeditor.editor.group.authority.CdmAuthorityEditorInput;
 import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
 import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor;
 import eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditorInput;
 import eu.etaxonomy.taxeditor.editor.view.dataimport.BioCaseEditorInput;
@@ -120,6 +122,16 @@ public class EditorUtil extends AbstractUtility {
            open(input, ChecklistEditor.ID);
        }
 
+       /**
+        * Opens a new AlignmentEditor for the given input
+        * @param input
+        * @throws PartInitException
+        */
+       public static void open(AlignmentEditorInput input)
+               throws PartInitException {
+           open(input, AlignmentEditor.ID);
+       }
+
        /**
         * Opens a new {@link DataImportEditor} for the given input
         * @param input a {@link DataImportEditorInput}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditSequenceHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/EditSequenceHandler.java
new file mode 100644 (file)
index 0000000..961273c
--- /dev/null
@@ -0,0 +1,41 @@
+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.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&ouml;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;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/HandlerTools.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/HandlerTools.java
new file mode 100644 (file)
index 0000000..31b96f9
--- /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.editor.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.editor.internal.TaxeditorEditorPlugin;\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(TaxeditorEditorPlugin.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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/LoadPherogramHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/LoadPherogramHandler.java
new file mode 100644 (file)
index 0000000..a803a64
--- /dev/null
@@ -0,0 +1,69 @@
+/**
+* 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;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditorHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/OpenAlignmentEditorHandler.java
new file mode 100644 (file)
index 0000000..4350fa2
--- /dev/null
@@ -0,0 +1,47 @@
+// $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
+ */
+@Deprecated
+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;
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/ShowPherogramHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/ShowPherogramHandler.java
new file mode 100644 (file)
index 0000000..8d7d2b2
--- /dev/null
@@ -0,0 +1,55 @@
+package eu.etaxonomy.taxeditor.editor.handler;\r
+\r
+\r
+import info.bioinfweb.libralign.pherogram.model.PherogramComponentModel;\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.editor.molecular.AlignmentEditor;\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(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
+//                 SingleRead singleRead = (SingleRead)treeNodeOfSelection.getValue();\r
+//                 singleRead.get\r
+                   //TODO Can the parent node (containing the cut positions) be extracted from SingleRead?\r
+\r
+                       try {\r
+                           showPherogram(new PherogramComponentModel(AlignmentEditor.readPherogram(MediaUtils.getFirstMediaRepresentationPart(\r
+                           ((SingleRead)treeNodeOfSelection.getValue()).getPherogram()).getUri())));\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
+        return null;\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SpecimenPropertyTester.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/SpecimenPropertyTester.java
new file mode 100644 (file)
index 0000000..17c8213
--- /dev/null
@@ -0,0 +1,58 @@
+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);
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractAlignmentEditorHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractAlignmentEditorHandler.java
new file mode 100644 (file)
index 0000000..96ce973
--- /dev/null
@@ -0,0 +1,42 @@
+// $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.editor.handler.alignmenteditor;\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.editor.molecular.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.model.AbstractUtility;\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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractPherogramComponentHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/AbstractPherogramComponentHandler.java
new file mode 100644 (file)
index 0000000..e7b92d6
--- /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.editor.handler.alignmenteditor;\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.editor.molecular.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.editor.molecular.PherogramViewPart;\r
+import eu.etaxonomy.taxeditor.model.AbstractUtility;\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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ChangePherogramQualityOutputType.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ChangePherogramQualityOutputType.java
new file mode 100644 (file)
index 0000000..18fc06f
--- /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.editor.handler.alignmenteditor;\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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CreateConsensusSequenceHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CreateConsensusSequenceHandler.java
new file mode 100644 (file)
index 0000000..2a2cc73
--- /dev/null
@@ -0,0 +1,33 @@
+/**\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.handler.alignmenteditor;\r
+\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;\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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramLeftHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramLeftHandler.java
new file mode 100644 (file)
index 0000000..305d63e
--- /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.editor.handler.alignmenteditor;\r
+\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\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, "eu.etaxonomy.taxeditor.editor", null, false);  //TODO set pluginID\r
+        }\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramRightHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/CutPherogramRightHandler.java
new file mode 100644 (file)
index 0000000..7844fc6
--- /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.editor.handler.alignmenteditor;\r
+\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.model.MessagingUtils;\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, "eu.etaxonomy.taxeditor.editor", null, false);  //TODO set pluginID\r
+        }\r
+    }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ReverseComplementHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ReverseComplementHandler.java
new file mode 100644 (file)
index 0000000..f8b003e
--- /dev/null
@@ -0,0 +1,30 @@
+/**\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.handler.alignmenteditor;\r
+\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;\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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleInsertOverwriteHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleInsertOverwriteHandler.java
new file mode 100644 (file)
index 0000000..283767b
--- /dev/null
@@ -0,0 +1,69 @@
+/**\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.alignmenteditor;\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.editor.handler.HandlerTools;\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 AbstractAlignmentEditorHandler implements IElementUpdater {\r
+       public static final String COMMAND_ID =\r
+                       "eu.etaxonomy.taxeditor.editor.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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleLeftRightInsertionHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleLeftRightInsertionHandler.java
new file mode 100644 (file)
index 0000000..d149eb1
--- /dev/null
@@ -0,0 +1,73 @@
+/**\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.alignmenteditor;\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.editor.handler.HandlerTools;\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\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.editor.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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramBaseCallLinesHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramBaseCallLinesHandler.java
new file mode 100644 (file)
index 0000000..43ceb31
--- /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.editor.handler.alignmenteditor;\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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramProbabilitiesHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/ToggleShowPherogramProbabilitiesHandler.java
new file mode 100644 (file)
index 0000000..41b03a0
--- /dev/null
@@ -0,0 +1,35 @@
+// $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.editor.handler.alignmenteditor;\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.editor.molecular.AlignmentEditor;\r
+import eu.etaxonomy.taxeditor.editor.molecular.PherogramViewPart;\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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/UpdateConsensusSequenceHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/UpdateConsensusSequenceHandler.java
new file mode 100644 (file)
index 0000000..6bcdf98
--- /dev/null
@@ -0,0 +1,24 @@
+/**\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.handler.alignmenteditor;\r
+\r
+\r
+import org.eclipse.core.commands.ExecutionEvent;\r
+import org.eclipse.core.commands.ExecutionException;\r
+\r
+import eu.etaxonomy.taxeditor.editor.molecular.AlignmentEditor;\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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/package-info.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/alignmenteditor/package-info.java
new file mode 100644 (file)
index 0000000..bd0508a
--- /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.editor.molecular.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.editor.handler.alignmenteditor;
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditor.java
new file mode 100644 (file)
index 0000000..c17ffa4
--- /dev/null
@@ -0,0 +1,696 @@
+// $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.jphyloio.events.TokenSetType;
+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.BioJavaTokenSet;
+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 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.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.taxeditor.editor.handler.alignmenteditor.ToggleInsertOverwriteHandler;
+import eu.etaxonomy.taxeditor.editor.handler.alignmenteditor.ToggleLeftRightInsertionHandler;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+
+
+/**
+ * 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 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);
+
+               TokenSet<NucleotideCompound> tokenSet = new BioJavaTokenSet<NucleotideCompound>(
+                               TokenSetType.DNA, new DNACompoundSet(), true);  //TODO Should NUCLEOTIDE be used instead?
+               AlignmentModel<NucleotideCompound> provider = new PackedAlignmentModel<NucleotideCompound>(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 PherogramArea getPherogramArea(int sequenceID) {
+       return (PherogramArea)getReadsArea().getDataAreas().getSequenceAreas(sequenceID).get(
+               PHEROGRAM_AREA_INDEX);
+    }
+
+
+    private ConsensusSequenceArea getConsensusHintDataArea() {
+        return (ConsensusSequenceArea)getAlignmentsContainer().getAlignmentAreas().
+                get(CONSENSUS_HINT_AREA_INDEX).getDataAreas().getBottomAreas().
+                get(CONSENSUS_DATA_AREA_INDEX);
+    }
+
+
+    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().tokenByKeyChar('A'));
+                       tokens.add(consensusModel.getTokenSet().tokenByKeyChar('C'));
+                       tokens.add(consensusModel.getTokenSet().tokenByKeyChar('G'));
+                       tokens.add(consensusModel.getTokenSet().tokenByKeyChar('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();
+                               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.getFirstSeqPosition(),
+                                               singleReadAlignment.getLeftCutPosition(),
+                                               singleReadAlignment.getRightCutPosition(),
+                                               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:
+               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) {
+               getAlignmentsContainer().createSWTWidget(parent, SWT.NONE);
+               updateStatusBar();
+
+               if (getEditorInput() instanceof AlignmentEditorInput) {
+                       if (((AlignmentEditorInput)getEditorInput()).getSequenceNode() != null) {
+                           Sequence sequenceNode = ((AlignmentEditorInput)getEditorInput()).getSequenceNode();
+                       //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) {
+       SingleReadAlignment.Shift[] result = new SingleReadAlignment.Shift[model.getShiftChangeCount()];
+       Iterator<ShiftChange> iterator = model.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) {
+       if (getEditorInput() instanceof AlignmentEditorInput) {
+               String taskName = "Saving alignment";
+            monitor.beginTask(taskName, 3);
+
+               Sequence sequenceNode = ((AlignmentEditorInput)getEditorInput()).getSequenceNode();
+               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) {
+                               //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, 0, 0, 0, null);  // Position values will be ignored, if shifts == 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,
+            int firstSeqPos, int leftCutPos, int rightCutPos, SingleReadAlignment.Shift[] shifts)
+            throws IOException, UnsupportedChromatogramFormatException {
+
+               AlignmentModel provider = getReadsArea().getAlignmentModel();
+               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 = AlignmentModelUtils.charSequenceToTokenList(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(),
+                       new PherogramAreaModel(pherogramProvider));
+
+               // Set position properties and shifts:
+               if ((shifts != null) && (shifts.length > 0)) {
+                       PherogramAreaModel model = pherogramArea.getModel();
+                   model.setFirstSeqLeftCutPos(firstSeqPos, leftCutPos);
+            model.setRightCutPosition(rightCutPos);
+
+                       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);
+
+               // Save source URI:
+               return id;
+       }
+}
\ No newline at end of file
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/AlignmentEditorInput.java
new file mode 100644 (file)
index 0000000..9d6201d
--- /dev/null
@@ -0,0 +1,133 @@
+// $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;
+       }
+
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result
+                               + ((sequenceNode == null) ? 0 : sequenceNode.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 (sequenceNode == null) {
+                       if (other.sequenceNode != null)
+                               return false;
+               } else if (!sequenceNode.equals(other.sequenceNode))
+                       return false;
+               return true;
+       }
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CDMAlignmentObjectPlaceholder.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/CDMAlignmentObjectPlaceholder.java
new file mode 100644 (file)
index 0000000..8cd3edb
--- /dev/null
@@ -0,0 +1,98 @@
+package eu.etaxonomy.taxeditor.editor.molecular;\r
+\r
+\r
+import info.bioinfweb.libralign.pherogram.model.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 final Sequence<NucleotideCompound> editableSequence = null;  // Could also be of type String, if helpful for CDM architecture.\r
+               private final 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 final 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 final Map<Long, Read> readSequences = new TreeMap<Long, Read>();\r
+\r
+\r
+       public Map<String, Sequence<NucleotideCompound>> getConsensusSequences() {\r
+               return consensusSequences;\r
+       }\r
+\r
+\r
+       public Map<Long, Read> getReadSequences() {\r
+               return readSequences;\r
+       }\r
+}\r
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/ContigSequenceDataProvider.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/ContigSequenceDataProvider.java
new file mode 100644 (file)
index 0000000..2139f62
--- /dev/null
@@ -0,0 +1,47 @@
+// $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.jphyloio.events.TokenSetType;\r
+import info.bioinfweb.libralign.model.AlignmentModel;\r
+import info.bioinfweb.libralign.model.implementations.PackedAlignmentModel;\r
+import info.bioinfweb.libralign.model.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 PackedAlignmentModel<NucleotideCompound> \r
+        implements AlignmentModel<NucleotideCompound> {\r
+\r
+       \r
+       public ContigSequenceDataProvider() {\r
+               super(new BioJavaTokenSet<NucleotideCompound>(TokenSetType.NUCLEOTIDE, \r
+                               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
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/PherogramMouseListener.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/PherogramMouseListener.java
new file mode 100644 (file)
index 0000000..b69ea06
--- /dev/null
@@ -0,0 +1,55 @@
+/**\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
+import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea;\r
+\r
+import org.eclipse.ui.PartInitException;\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 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
+                        "eu.etaxonomy.taxeditor.editor",  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.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/PherogramViewPart.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/molecular/PherogramViewPart.java
new file mode 100644 (file)
index 0000000..752ef9e
--- /dev/null
@@ -0,0 +1,67 @@
+/**\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.libralign.pherogram.PherogramFormats.QualityOutputType;\r
+import info.bioinfweb.libralign.pherogram.model.PherogramComponentModel;\r
+import info.bioinfweb.libralign.pherogram.view.PherogramView;\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.editor.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
+               getPherogramView().createSWTWidget(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.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1 b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1
new file mode 100644 (file)
index 0000000..83a3be3
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR430_JR-P01.ab1 differ
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1 b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1
new file mode 100644 (file)
index 0000000..be62c7c
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/JR444_JR-P05.ab1 differ
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/Test_qualityScore.scf b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/Test_qualityScore.scf
new file mode 100644 (file)
index 0000000..e680999
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/src/main/resources/AlignmentTestData/Test_qualityScore.scf differ
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf b/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf
new file mode 100644 (file)
index 0000000..e680999
Binary files /dev/null and b/eu.etaxonomy.taxeditor.editor/src/main/resources/TestPherogram_qualityScore.scf differ
index f14ba2c2e26a0591f2789a408011882ac75ed185..32c94a0aa1bacba9e35ca84eb3895d6f886e2382 100644 (file)
@@ -1,7 +1,8 @@
-<?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 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" output="target/test-classes" path="src/test/java"/>\r
+       <classpathentry including="**/*.java" kind="src" path="src/main/java"/>\r
+       <classpathentry kind="output" path="target/classes"/>\r
+</classpath>\r
index dd55c822551cf19c70da92cb4b1f3e0c86ff48c9..4d33cf2f602b5d8a87980dbe33796788f829cb37 100644 (file)
@@ -9,7 +9,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Require-Bundle: org.apache.log4j,
  org.eclipse.ui,
  org.eclipse.core.runtime,
- org.eclipse.swtbot.eclipse.core,
+ org.eclipse.swtbot.eclipse.core;bundle-version="2.0.5",
  org.eclipse.swtbot.eclipse.finder,
  org.eclipse.swtbot.junit4_x,
  org.eclipse.ui.ide,
@@ -22,3 +22,4 @@ Require-Bundle: org.apache.log4j,
  eu.etaxonomy.taxeditor.printpublisher,
  eu.etaxonomy.taxeditor.store
 Eclipse-RegisterBuddy: org.apache.log4j
+Import-Package: org.junit.runner
index 7cc4c0b90305af5081261f455972792de3d66705..78a24ab76e8d9819c9f9ab75e063755b84fc4751 100644 (file)
@@ -1,51 +1,52 @@
 /**\r
- *\r
+ * \r
  */\r
 package eu.etaxonomy.taxeditor.test;\r
 \r
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;\r
 import org.eclipse.swtbot.eclipse.finder.waits.Conditions;\r
+import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;\r
 import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;\r
 import org.junit.Before;\r
-\r
+import org.junit.runner.RunWith;\r
 \r
 /**\r
  * @author n.hoffmann\r
  *\r
  */\r
-//@RunWith(SWTBotJunit4ClassRunner.class)\r
+@RunWith(SWTBotJunit4ClassRunner.class)\r
 public abstract class AbstractEditorTest {\r
-\r
+       \r
        protected SWTWorkbenchBot bot;\r
-\r
+       \r
        public SwtBotUtils utils;\r
-\r
+       \r
        @Before\r
        public void setup() {\r
                bot = new SWTWorkbenchBot();\r
                SWTBotPreferences.TIMEOUT = 300000;\r
                utils = new SwtBotUtils(bot);\r
-\r
+               \r
                // unfortunately swt bot is not available at the time this is set up\r
 //             if("Choose a nomenclatural code".equals(getActiveShellHeadline())){\r
 //                     ok();\r
 //                     bot.waitUntil(Conditions.shellIsActive("Nomenclatural code set"));\r
 //                     ok();\r
 //             }\r
-\r
+               \r
                if("Connecting to datasource: cdm".equals(utils.getActiveShellHeadline())){\r
                        performLogin();\r
                }\r
        }\r
-\r
+       \r
        private void performLogin(){\r
                bot.waitUntil(Conditions.shellIsActive("Login"));\r
                bot.textWithLabel("Username").setText("admin");\r
                bot.textWithLabel("Password").setText("00000");\r
                bot.button("OK").click();\r
        }\r
+       \r
 \r
-\r
-\r
+       \r
 \r
 }\r
index 1c01bc0a71f8e556c44d56a97301d5f9621437a8..b2d7c455ab2a37c25b970c31f420c8e36d100f08 100644 (file)
@@ -2,6 +2,7 @@ package eu.etaxonomy.taxeditor.test;
 \r
 import java.util.List;\r
 \r
+import org.eclipse.osgi.internal.loader.FilteredSourcePackage;\r
 import org.eclipse.swt.widgets.Tree;\r
 import org.eclipse.swt.widgets.Widget;\r
 import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;\r
@@ -14,28 +15,27 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton;
 import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;\r
 \r
 public class SwtBotUtils {\r
-\r
+       \r
        private SWTWorkbenchBot bot;\r
-\r
+       \r
        public SwtBotUtils(SWTWorkbenchBot bot) {\r
                this.bot = bot;\r
        }\r
-\r
+       \r
        /**\r
         * @return\r
         * @throws WidgetNotFoundException\r
         */\r
        public SWTBotTree tree(Widget widget) throws WidgetNotFoundException {\r
                List<Tree> controls = new ChildrenControlFinder(widget).findControls(WidgetMatcherFactory.widgetOfType(Tree.class));\r
-               if (controls.isEmpty()) {\r
-            throw new WidgetNotFoundException("Could not find any tree");\r
-        }\r
-               SWTBotTree tree = new SWTBotTree(controls.get(0));\r
+               if (controls.isEmpty())\r
+                       throw new WidgetNotFoundException("Could not find any tree");\r
+               SWTBotTree tree = new SWTBotTree((Tree) controls.get(0));\r
                return tree;\r
        }\r
-\r
+       \r
        /**\r
-        *\r
+        * \r
         * @param index the index of the SelectionElement\r
         * @param dialogName the title of the expected dialog\r
         */\r
@@ -52,23 +52,23 @@ public class SwtBotUtils {
        public SWTBotView view(String title) throws WidgetNotFoundException {\r
                return getBot().viewByTitle(title);\r
        }\r
-\r
+       \r
        public void cancel() {\r
                clickButton("Cancel");\r
        }\r
-\r
+       \r
        public void ok() {\r
                clickButton("OK");\r
        }\r
-\r
+       \r
        public void finish() {\r
                clickButton("Finish");\r
        }\r
-\r
+       \r
        public void clickButton(String label) {\r
                getBot().button(label).click();\r
        }\r
-\r
+       \r
        public String getActiveShellHeadline(){\r
                return getBot().activeShell().getText();\r
        }\r
diff --git a/eu.etaxonomy.taxeditor/.gitignore b/eu.etaxonomy.taxeditor/.gitignore
deleted file mode 100644 (file)
index d62e6a2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/rcp.target