Merge branch 'LibrAlign' into develop
[taxeditor.git] / eu.etaxonomy.taxeditor.molecular / src / main / java / eu / etaxonomy / taxeditor / molecular / handler / AbstractPherogramComponentHandler.java
index 50d65974cd9ecadaa251ad806afd9867e1d60af9..55c24e32aab50088dfbd93aa3c363c67a988cc45 100644 (file)
@@ -1,60 +1,60 @@
-// $Id$\r
-/**\r
-* Copyright (C) 2015 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.molecular.handler;\r
-\r
-\r
-import info.bioinfweb.libralign.alignmentarea.AlignmentArea;\r
-import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea;\r
-import info.bioinfweb.libralign.pherogram.PherogramComponent;\r
-\r
-import java.util.Iterator;\r
-\r
-import org.eclipse.core.commands.AbstractHandler;\r
-import org.eclipse.core.commands.ExecutionEvent;\r
-import org.eclipse.core.commands.ExecutionException;\r
-import org.eclipse.ui.IWorkbenchPart;\r
-\r
-import eu.etaxonomy.taxeditor.model.AbstractUtility;\r
-import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;\r
-import eu.etaxonomy.taxeditor.molecular.editor.PherogramViewPart;\r
-\r
-\r
-\r
-/**\r
- * Abstract handler implementation allows to performs the concrete operation either on an instance of\r
- * {@link PherogramViewPart} or all {@link AlignmentArea}s inside an instance of {@link AlignmentEditor}.\r
- *\r
- * @author Ben Stöver\r
- * @date 23.06.2015\r
- */\r
-public abstract class AbstractPherogramComponentHandler extends AbstractHandler {\r
-    @Override\r
-    public Object execute(ExecutionEvent event) throws ExecutionException {\r
-        IWorkbenchPart activePart = AbstractUtility.getActivePart();\r
-\r
-        if (activePart instanceof AlignmentEditor) {\r
-            AlignmentEditor editor = (AlignmentEditor)activePart;\r
-            Iterator<Integer> idIterator = editor.getReadsArea().getAlignmentModel().sequenceIDIterator();\r
-            while (idIterator.hasNext()) {\r
-                PherogramArea area = editor.getPherogramArea(idIterator.next());\r
-                if (area != null) {\r
-                    doExecute(event, area);\r
-                }\r
-            }\r
-        }\r
-        else if (activePart instanceof PherogramViewPart) {\r
-            doExecute(event, ((PherogramViewPart)activePart).getPherogramView().getTraceCurveView());\r
-        }\r
-        return null;\r
-    }\r
-\r
-\r
-    public abstract void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException;\r
-}\r
+// $Id$
+/**
+* Copyright (C) 2015 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.molecular.handler;
+
+
+import info.bioinfweb.libralign.alignmentarea.AlignmentArea;
+import info.bioinfweb.libralign.dataarea.implementations.pherogram.PherogramArea;
+import info.bioinfweb.libralign.pherogram.PherogramComponent;
+
+import java.util.Iterator;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IWorkbenchPart;
+
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.molecular.editor.AlignmentEditor;
+import eu.etaxonomy.taxeditor.molecular.editor.PherogramViewPart;
+
+
+
+/**
+ * Abstract handler implementation allows to performs the concrete operation either on an instance of
+ * {@link PherogramViewPart} or all {@link AlignmentArea}s inside an instance of {@link AlignmentEditor}.
+ *
+ * @author Ben Stöver
+ * @date 23.06.2015
+ */
+public abstract class AbstractPherogramComponentHandler extends AbstractHandler {
+    @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
+        IWorkbenchPart activePart = AbstractUtility.getActivePart();
+
+        if (activePart instanceof AlignmentEditor) {
+            AlignmentEditor editor = (AlignmentEditor)activePart;
+            Iterator<Integer> idIterator = editor.getReadsArea().getAlignmentModel().sequenceIDIterator();
+            while (idIterator.hasNext()) {
+                PherogramArea area = editor.getPherogramArea(idIterator.next());
+                if (area != null) {
+                    doExecute(event, area);
+                }
+            }
+        }
+        else if (activePart instanceof PherogramViewPart) {
+            doExecute(event, ((PherogramViewPart)activePart).getPherogramView().getTraceCurveView());
+        }
+        return null;
+    }
+
+
+    public abstract void doExecute(ExecutionEvent event, PherogramComponent component) throws ExecutionException;
+}