|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.compomics.util.gui.spectrum.GraphicsPanel
com.compomics.util.gui.spectrum.SpectrumPanel
public class SpectrumPanel
This class presents a JPanel that will hold and display a mass spectrum in centroid or profile mode.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.compomics.util.gui.spectrum.GraphicsPanel |
---|
GraphicsPanel.GraphicsPanelType |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
SpectrumPanel(double[] aXAxisData,
double[] aYAxisData,
double aPrecursorMZ,
String aPrecursorCharge,
String aFileName)
This constructor creates a SpectrumPanel based on the passed parameters. |
|
SpectrumPanel(double[] aXAxisData,
double[] aYAxisData,
double aPrecursorMZ,
String aPrecursorCharge,
String aFileName,
boolean aShowFileName)
This constructor creates a SpectrumPanel based on the passed parameters. |
|
SpectrumPanel(double[] aXAxisData,
double[] aYAxisData,
double aPrecursorMZ,
String aPrecursorCharge,
String aFileName,
int aMaxPadding,
boolean aShowFileName)
This constructor creates a SpectrumPanel based on the passed parameters. |
|
SpectrumPanel(double[] aXAxisData,
double[] aYAxisData,
double aPrecursorMZ,
String aPrecursorCharge,
String aFileName,
int aMaxPadding,
boolean aShowFileName,
boolean aShowPrecursorDetails,
boolean aShowResolution)
This constructor creates a SpectrumPanel based on the passed parameters. |
|
SpectrumPanel(double[] aXAxisData,
double[] aYAxisData,
double aPrecursorMZ,
String aPrecursorCharge,
String aFileName,
int aMaxPadding,
boolean aShowFileName,
boolean aShowPrecursorDetails,
boolean aShowResolution,
int aMSLevel)
This constructor creates a SpectrumPanel based on the passed parameters. |
|
SpectrumPanel(double[] aXAxisData,
double[] aYAxisData,
double aPrecursorMZ,
String aPrecursorCharge,
String aFileName,
int aMaxPadding,
boolean aShowFileName,
boolean aShowPrecursorDetails,
boolean aShowResolution,
int aMSLevel,
boolean aProfileMode)
This constructor creates a SpectrumPanel based on the passed parameters. |
|
SpectrumPanel(SpectrumFile aSpecFile)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile as an interactive lines plot. |
|
SpectrumPanel(SpectrumFile aSpecFile,
boolean aEnableInteraction)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile as a line plot. |
|
SpectrumPanel(SpectrumFile aSpecFile,
int aDrawStyle,
boolean aEnableInteraction)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style. |
|
SpectrumPanel(SpectrumFile aSpecFile,
int aDrawStyle,
boolean aEnableInteraction,
Color aSpectrumFilenameColor)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style. |
|
SpectrumPanel(SpectrumFile aSpecFile,
int aDrawStyle,
boolean aEnableInteraction,
Color aSpectrumFilenameColor,
int aMaxPadding,
boolean aShowFileName)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style. |
|
SpectrumPanel(SpectrumFile aSpecFile,
int aDrawStyle,
boolean aEnableInteraction,
Color aSpectrumFilenameColor,
int aMaxPadding,
boolean aShowFileName,
boolean aShowPrecursorDetails,
boolean aShowResolution)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style. |
|
SpectrumPanel(SpectrumFile aSpecFile,
int aDrawStyle,
boolean aEnableInteraction,
Color aSpectrumFilenameColor,
int aMaxPadding,
boolean aShowFileName,
boolean aShowPrecursorDetails,
boolean aShowResolution,
int aMSLevel)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style. |
|
SpectrumPanel(SpectrumFile aSpecFile,
int aDrawStyle,
boolean aEnableInteraction,
Color aSpectrumFilenameColor,
int aMaxPadding,
boolean aShowFileName,
boolean aShowPrecursorDetails,
boolean aShowResolution,
int aMSLevel,
boolean aProfileMode)
This constructor creates a SpectrumPanel based on the spectrum information in the specified SpectrumFile with the specified drawing style. |
Method Summary | |
---|---|
void |
addAdditionalDataset(double[] aXAxisData,
double[] aYAxisData,
Color dataPointAndLineColor,
Color areaUnderCurveColor)
Adds an additional spectrum dataset to be displayed in the same Spectrum Panel. |
static Color |
determineColorOfPeak(String peakLabel)
Returns the peak color to be used for the given peak label. |
static Color |
determineFragmentIonColor(PeptideFragmentIon fragmentIon)
Returns the peak color to be used for the given peak label. |
static Color |
determineFragmentIonColor(String seriesLabel)
Returns the color to use for the given fragment ion label. |
static Vector<DefaultSpectrumAnnotation> |
filterAnnotations(Vector<DefaultSpectrumAnnotation> annotations,
ArrayList<PeptideFragmentIon.PeptideFragmentIonType> fragmentIonTypes,
ArrayList<NeutralLoss> neutralLosses,
boolean singleChargeSelected,
boolean doubleChargeSelected,
boolean moreThanTwoChargesSelected)
Deprecated. Filtering of annotations should not be necessary anymore. |
void |
setProfileMode(boolean aProfileMode)
Change the drawing type of the spectrum. |
void |
setSpectrumFile(SpectrumFile aSpecFile)
This method initializes a SpectrumPanel based on the spectrum information in the specified SpectrumFile. |
void |
showAnnotatedPeaksOnly(boolean aAnnotatedPeaks)
If true only the annotated peaks will be drawn. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SpectrumPanel(SpectrumFile aSpecFile)
aSpecFile
- SpectrumFile with the information about masses and intensities
that will be copied here. Note that mass-sorting will take place
in this step as well.public SpectrumPanel(SpectrumFile aSpecFile, boolean aEnableInteraction)
aSpecFile
- SpectrumFile with the information about masses and intensities
that will be copied here. Note that mass-sorting will take place
in this step as well.aEnableInteraction
- boolean that specifies whether user-derived events should
be caught and dealt with.public SpectrumPanel(SpectrumFile aSpecFile, int aDrawStyle, boolean aEnableInteraction)
aSpecFile
- SpectrumFile with the information about masses and intensities
that will be copied here. Note that mass-sorting will take place
in this step as well.aDrawStyle
- int with the drawing style to use. It should be one of the constants
defined on this class.aEnableInteraction
- boolean that specifies whether user-derived events should
be caught and dealt with.public SpectrumPanel(SpectrumFile aSpecFile, int aDrawStyle, boolean aEnableInteraction, Color aSpectrumFilenameColor)
aSpecFile
- SpectrumFile with the information about masses and intensities
that will be copied here. Note that mass-sorting will take place
in this step as well.aDrawStyle
- int with the drawing style to use. It should be one of the constants
defined on this class.aEnableInteraction
- boolean that specifies whether user-derived events should
be caught and dealt with.aSpectrumFilenameColor
- Color with the color for the spectrumfilename on the panel
can be 'null' for default coloring.public SpectrumPanel(SpectrumFile aSpecFile, int aDrawStyle, boolean aEnableInteraction, Color aSpectrumFilenameColor, int aMaxPadding, boolean aShowFileName)
aSpecFile
- SpectrumFile with the information about masses and intensities
that will be copied here. Note that mass-sorting will take place
in this step as well.aDrawStyle
- int with the drawing style to use. It should be one of the constants
defined on this class.aEnableInteraction
- boolean that specifies whether user-derived events should
be caught and dealt with.aSpectrumFilenameColor
- Color with the color for the spectrumfilename on the panel
can be 'null' for default coloring.aMaxPadding
- int the sets the maximum padding size.aShowFileName
- boolean that specifies if the file name should be shown in the panelpublic SpectrumPanel(SpectrumFile aSpecFile, int aDrawStyle, boolean aEnableInteraction, Color aSpectrumFilenameColor, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution)
aSpecFile
- SpectrumFile with the information about masses and intensities
that will be copied here. Note that mass-sorting will take place
in this step as well.aDrawStyle
- int with the drawing style to use. It should be one of the constants
defined on this class.aEnableInteraction
- boolean that specifies whether user-derived events should
be caught and dealt with.aSpectrumFilenameColor
- Color with the color for the spectrumfilename on the panel
can be 'null' for default coloring.aMaxPadding
- int the sets the maximum padding size.aShowFileName
- boolean that specifies if the file name should be shown in the panelaShowPrecursorDetails
- boolean that specifies if the precursor details should be shown in the panelaShowResolution
- boolean that specifies if the resolution should be shown in the panelpublic SpectrumPanel(SpectrumFile aSpecFile, int aDrawStyle, boolean aEnableInteraction, Color aSpectrumFilenameColor, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution, int aMSLevel)
aSpecFile
- SpectrumFile with the information about masses and intensities
that will be copied here. Note that mass-sorting will take place
in this step as well.aDrawStyle
- int with the drawing style to use. It should be one of the constants
defined on this class.aEnableInteraction
- boolean that specifies whether user-derived events should
be caught and dealt with.aSpectrumFilenameColor
- Color with the color for the spectrumfilename on the panel
can be 'null' for default coloring.aMaxPadding
- int the sets the maximum padding size.aShowFileName
- boolean that specifies if the file name should be shown in the panelaShowPrecursorDetails
- boolean that specifies if the precursor details should be shown in the panelaShowResolution
- boolean that specifies if the resolution should be shown in the panelaMSLevel
- int with the ms level for the spectrumpublic SpectrumPanel(SpectrumFile aSpecFile, int aDrawStyle, boolean aEnableInteraction, Color aSpectrumFilenameColor, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution, int aMSLevel, boolean aProfileMode)
aSpecFile
- SpectrumFile with the information about masses and intensities
that will be copied here. Note that mass-sorting will take place
in this step as well.aDrawStyle
- int with the drawing style to use. It should be one of the constants
defined on this class.aEnableInteraction
- boolean that specifies whether user-derived events should
be caught and dealt with.aSpectrumFilenameColor
- Color with the color for the spectrumfilename on the panel
can be 'null' for default coloring.aMaxPadding
- int the sets the maximum padding size.aShowFileName
- boolean that specifies if the file name should be shown in the panelaShowPrecursorDetails
- boolean that specifies if the precursor details should be shown in the panelaShowResolution
- boolean that specifies if the resolution should be shown in the panelaMSLevel
- int with the ms level for the spectrum, set to 0 if ms level is unknownaProfileMode
- boolean if set to true the spectrum will be drawn in profile modepublic SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName)
aXAxisData
- double[] with all the x-axis values.aYAxisData
- double[] with all the y-axis values.aPrecursorMZ
- double with the precursor mass.aPrecursorCharge
- String with the precursor intensity.aFileName
- String with the title of the Query.public SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName, boolean aShowFileName)
aXAxisData
- double[] with all the x-axis values.aYAxisData
- double[] with all the y-axis values.aPrecursorMZ
- double with the precursor mass.aPrecursorCharge
- String with the precursor intensity.aFileName
- String with the title of the Query.aShowFileName
- boolean that specifies if the file name should be shown in the panel.public SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName, int aMaxPadding, boolean aShowFileName)
aXAxisData
- double[] with all the x-axis values.aYAxisData
- double[] with all the y-axis values.aPrecursorMZ
- double with the precursor mass.aPrecursorCharge
- String with the precursor intensity.aFileName
- String with the title of the Query.aMaxPadding
- int the sets the maximum padding size.aShowFileName
- boolean that specifies if the file name should be shown in the panel.public SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution)
aXAxisData
- double[] with all the x-axis values.aYAxisData
- double[] with all the y-axis values.aPrecursorMZ
- double with the precursor mass.aPrecursorCharge
- String with the precursor intensity.aFileName
- String with the title of the Query.aMaxPadding
- int the sets the maximum padding size.aShowFileName
- boolean that specifies if the file name should be shown in the panelaShowPrecursorDetails
- boolean that specifies if the precursor details should be shown in the panelaShowResolution
- boolean that specifies if the resolution should be shown in the panelpublic SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution, int aMSLevel)
aXAxisData
- double[] with all the x-axis values.aYAxisData
- double[] with all the y-axis values.aPrecursorMZ
- double with the precursor mass.aPrecursorCharge
- String with the precursor intensity.aFileName
- String with the title of the Query.aMaxPadding
- int the sets the maximum padding size.aShowFileName
- boolean that specifies if the file name should be shown in the panelaShowPrecursorDetails
- boolean that specifies if the precursor details should be shown in the panelaShowResolution
- boolean that specifies if the resolution should be shown in the panelaMSLevel
- int with the ms level for the spectrum, set to 0 if ms level is unknownpublic SpectrumPanel(double[] aXAxisData, double[] aYAxisData, double aPrecursorMZ, String aPrecursorCharge, String aFileName, int aMaxPadding, boolean aShowFileName, boolean aShowPrecursorDetails, boolean aShowResolution, int aMSLevel, boolean aProfileMode)
aXAxisData
- double[] with all the x-axis values.aYAxisData
- double[] with all the y-axis values.aPrecursorMZ
- double with the precursor mass.aPrecursorCharge
- String with the precursor intensity.aFileName
- String with the title of the Query.aMaxPadding
- int the sets the maximum padding size.aShowFileName
- boolean that specifies if the file name should be shown in the panelaShowPrecursorDetails
- boolean that specifies if the precursor details should be shown in the panelaShowResolution
- boolean that specifies if the resolution should be shown in the panelaMSLevel
- int with the ms level for the spectrum, set to 0 if ms level is unknownaProfileMode
- boolean if set to true the spectrum will be drawn in profile modeMethod Detail |
---|
public void addAdditionalDataset(double[] aXAxisData, double[] aYAxisData, Color dataPointAndLineColor, Color areaUnderCurveColor)
aXAxisData
- double[] with all the x-axis values.aYAxisData
- double[] with all the y-axis valuesdataPointAndLineColor
- the color to use for the data points and linesareaUnderCurveColor
- the color to use for the area under the curvepublic void setProfileMode(boolean aProfileMode)
aProfileMode
- if true, the spectrum is drawn in profile modepublic void showAnnotatedPeaksOnly(boolean aAnnotatedPeaks)
aAnnotatedPeaks
- if true only the annotated peaks will be drawnpublic void setSpectrumFile(SpectrumFile aSpecFile)
aSpecFile
- SpectrumFile with the information about masses and intensities
that will be copied here. Note that mass-sorting will take place
in this step as well.public static Color determineColorOfPeak(String peakLabel)
peakLabel
-
public static Vector<DefaultSpectrumAnnotation> filterAnnotations(Vector<DefaultSpectrumAnnotation> annotations, ArrayList<PeptideFragmentIon.PeptideFragmentIonType> fragmentIonTypes, ArrayList<NeutralLoss> neutralLosses, boolean singleChargeSelected, boolean doubleChargeSelected, boolean moreThanTwoChargesSelected)
annotations
- the annotations to be filtered, the annotations are
assumed to have the following form:
ion type + [ion number] + [charge] + [neutral loss]fragmentIonTypes
- the fragment ion types to include, assumed to be one of
the PeptideFragmentIon types, e.g, PeptideFragmentIon.B_IONneutralLosses
- list of neutral losses to displaysingleChargeSelected
- if singly charged fragments are to be includeddoubleChargeSelected
- if double charged fragments are to be includedmoreThanTwoChargesSelected
- if fragments with more than two charges are to be included
public static Color determineFragmentIonColor(PeptideFragmentIon fragmentIon)
fragmentIonType
-
public static Color determineFragmentIonColor(String seriesLabel)
seriesLabel
- the series label
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |