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 Details

    • DefaultSpectrumAnnotation

      public DefaultSpectrumAnnotation()
      Empty default constructor
    • DefaultSpectrumAnnotation

      public DefaultSpectrumAnnotation​(double aMZ, double aErrorMargin, Color aColor, 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 Details

    • getColor

      public 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 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.