2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.taxeditor
.molecular
.editor
;
12 import info
.bioinfweb
.libralign
.pherogram
.PherogramFormats
.QualityOutputType
;
13 import info
.bioinfweb
.libralign
.pherogram
.model
.PherogramComponentModel
;
14 import info
.bioinfweb
.libralign
.pherogram
.view
.PherogramView
;
15 import info
.bioinfweb
.tic
.SWTComponentFactory
;
17 import org
.eclipse
.swt
.SWT
;
18 import org
.eclipse
.swt
.widgets
.Composite
;
19 import org
.eclipse
.ui
.PartInitException
;
20 import org
.eclipse
.ui
.PlatformUI
;
21 import org
.eclipse
.ui
.part
.ViewPart
;
26 * Component that allows to view a pherogram without the distortion due to aligning it to a sequence as in
27 * {@link AlignmentEditor}.
32 public class PherogramViewPart
extends ViewPart
{
33 public static final String ID
= "eu.etaxonomy.taxeditor.molecular.PherogramView";
35 private PherogramView pherogramView
= null;
38 public static PherogramViewPart
createView(PherogramComponentModel model
) throws PartInitException
{
39 PherogramViewPart view
= (PherogramViewPart
)PlatformUI
.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ID
);
40 view
.getPherogramView().getTraceCurveView().setModel(model
);
41 view
.getPherogramView().assignSize();
46 public PherogramView
getPherogramView() {
47 if (pherogramView
== null) {
48 pherogramView
= new PherogramView();
49 pherogramView
.getTraceCurveView().getFormats().setShowProbabilityValues(true);
50 pherogramView
.getTraceCurveView().setHorizontalScale(1);
51 pherogramView
.getTraceCurveView().setVerticalScale(100);
52 pherogramView
.getTraceCurveView().getFormats().setQualityOutputType(QualityOutputType
.NONE
); //TODO Make this user defined
53 pherogramView
.getTraceCurveView().getFormats().setShowProbabilityValues(false);
60 public void createPartControl(Composite parent
) {
61 SWTComponentFactory
.getInstance().getSWTComponent(getPherogramView(), parent
, SWT
.NONE
);
62 getPherogramView().assignSize();
67 public void setFocus() {} // nothing to do