Package com.compomics.util.gui.spectrum
Class DefaultSpectrumAnnotation
java.lang.Object
com.compomics.util.gui.spectrum.DefaultSpectrumAnnotation
- All Implemented Interfaces:
SpectrumAnnotation
public class DefaultSpectrumAnnotation extends Object implements SpectrumAnnotation
This class provides a default implementation of the SpectrumAnnotation interface.
- Version:
- $Id: DefaultSpectrumAnnotation.java,v 1.1 2007/10/22 10:09:02 lennart Exp $
- Author:
- Lennart Martens
-
Constructor Summary
Constructors Constructor Description DefaultSpectrumAnnotation()
Empty default constructorDefaultSpectrumAnnotation(double aMZ, double aErrorMargin, Color aColor, String aLabel)
Constructor creating a DefaultSpectrumAnnotation object. -
Method Summary
Modifier and Type Method Description Color
getColor()
This method returns the color for the annotation.double
getErrorMargin()
This method returns the allowed error margin (both sides) for the M/Z of the annotation (eg., 0.1 means an allowed interval of [M/Z-0.1, M/Z+0.1].String
getLabel()
This method returns the label for the annotation.double
getMZ()
This method returns the M/Z of the feature to annotate.
-
Constructor Details
-
DefaultSpectrumAnnotation
public DefaultSpectrumAnnotation()Empty default constructor -
DefaultSpectrumAnnotation
Constructor creating a DefaultSpectrumAnnotation object.- Parameters:
aMZ
- the mz value to annotateaErrorMargin
- the mz error marginaColor
- the color to use for the annotationaLabel
- the label to use for the annotation
-
-
Method Details
-
getColor
This method returns the color for the annotation.- Specified by:
getColor
in interfaceSpectrumAnnotation
- Returns:
- Color with the color for the annotation.
-
getErrorMargin
public double getErrorMargin()This method returns the allowed error margin (both sides) for the M/Z of the annotation (eg., 0.1 means an allowed interval of [M/Z-0.1, M/Z+0.1].- Specified by:
getErrorMargin
in interfaceSpectrumAnnotation
- Returns:
- double with the error margin.
-
getLabel
This method returns the label for the annotation.- Specified by:
getLabel
in interfaceSpectrumAnnotation
- Returns:
- String with the label to display (above the M/Z) for this annotation.
-
getMZ
public double getMZ()This method returns the M/Z of the feature to annotate.- Specified by:
getMZ
in interfaceSpectrumAnnotation
- Returns:
- double with the M/Z.
-