com.compomics.util.gui.spectrum
Class DefaultSpectrumAnnotation

java.lang.Object
  extended by com.compomics.util.gui.spectrum.DefaultSpectrumAnnotation
All Implemented Interfaces:
SpectrumAnnotation

public class DefaultSpectrumAnnotation
extends java.lang.Object
implements SpectrumAnnotation

This class provideds 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
DefaultSpectrumAnnotation(double aMZ, double aErrorMargin, java.awt.Color aColor, java.lang.String aLabel)
          Constructor creating a DefaultSpectrumAnnotation object.
 
Method Summary
 java.awt.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].
 java.lang.String getLabel()
          This method returns the label for the annotation.
 double getMZ()
          This method returns the M/Z of the feature to annotate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSpectrumAnnotation

public DefaultSpectrumAnnotation(double aMZ,
                                 double aErrorMargin,
                                 java.awt.Color aColor,
                                 java.lang.String aLabel)
Constructor creating a DefaultSpectrumAnnotation object.

Parameters:
aMZ - the mz value to annotate
aErrorMargin - the mz error margin
aColor - the color to use for the annotation
aLabel - the label to use for the annotation
Method Detail

getColor

public java.awt.Color getColor()
This method returns the color for the annotation.

Specified by:
getColor in interface SpectrumAnnotation
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 interface SpectrumAnnotation
Returns:
double with the error margin.

getLabel

public java.lang.String getLabel()
This method returns the label for the annotation.

Specified by:
getLabel in interface SpectrumAnnotation
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 interface SpectrumAnnotation
Returns:
double with the M/Z.


Copyright © 2013. All Rights Reserved.