|
||||||||||
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
public abstract class GraphicsPanel
This class presents a JPanel that will hold and display a mass spectrum in centroid or profile mode, or a chromatogram.
Nested Class Summary | |
---|---|
protected static class |
GraphicsPanel.GraphicsPanelType
An enumerator of the possible GraphicsPanel types |
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 | |
---|---|
protected float |
alphaLevel
The opacity of the spectra. |
static int |
ANNOTATED_STATUS
This status indicates that annotation (if present) will be displayed, while limiting the user to zooming in/out. |
protected GraphicsPanel.GraphicsPanelType |
currentGraphicsPanelType
Sets the current GraphicsPanel type, default to centroid spectrum |
protected int |
currentPadding
The current padding (distance between the axes and the border of the panel). |
protected static int |
dataSetCounter
The number of datasets currently displayed in the panel. |
protected double |
deltaMassWindow
The size of the window to use when searcing for matches in the known masses list when the user hovers over a second data point after clicking a previous data point. |
protected static int |
DOTS
Drawstyle which draws a dot at the measurement height. |
protected Vector |
iAnnotations
The Vector that holds a set of Annotation instances. |
protected double |
iAnnotationYAxisThreshold
The procentual non-inclusive, minimal y-axis value (compared to the highest point in the spectrum) a point should have before being eligible for annotation. |
protected ArrayList<Color> |
iAreaUnderCurveColor
Colors in which the chromatogram polyline is rendered. |
protected boolean |
iClicked
Boolean that indicates whether a point has been marked by clicking. |
protected int |
iClickedDataSetIndex
Int that indicates which dataset contains the clicked point. |
protected int |
iClickedIndex
Int that indicates which point was clicked. |
protected Vector |
iClickedList
The Vector that holds all points clicked up to now. |
protected Vector |
iClickedListDatasetIndices
The Vector that holds the dataset indices of all points clicked up to now. |
protected ArrayList<Color> |
iDataPointAndLineColor
Colors in which the data points and peaks are rendered. |
protected int |
iDotRadius
This variable holds the dot radius; only used when drawing style is DOTS style. |
protected boolean |
iDragged
This boolean is set to 'true' when dragging is performed. |
protected int |
iDragXLoc
The current dragging location. |
protected int |
iDrawStyle
This variable holds the drawing style. |
protected int |
iEndXLoc
When the mouse is dragged, this represents the X-coordinate of the ending location. |
protected String |
iFilename
The spectrum or chromatogram filename. |
protected Color |
iFilenameColor
This is the color the filename should be presented in. |
protected boolean |
iHighLight
Boolean that will be 'true' when a point needs highlighting. |
protected int |
iHighLightDatasetIndex
Index of the dataset containing the point that needs to be highlighted. |
protected int |
iHighLightIndex
Index of the point that needs to be highlighted. |
protected static HashMap<Double,String> |
iKnownMassDeltas
This HashMap instance holds all the known mass deltas (if any). |
protected int |
iMinDrag
Minimal dragging distance in pixels. |
protected int |
iMSLevel
The ms level of the current spectrum. |
static int |
INTERACTIVE_STATUS
This status indicates that no annotation will be displayed, but the user will have a fully functional interface (point clicking, selecting, sequencing etc.) |
protected int |
iPointDetectionTolerance
The deviation (both left and right) allowed for point highlighting detection. |
protected Integer |
iPointSize
Size for the point on a polygon. |
protected String |
iPrecursorCharge
This String holds the charge for the precursor. |
protected double |
iPrecursorMZ
This variable holds the precursor M/Z. |
protected ArrayList |
iSpecPanelListeners
The list of SpectrumPanelListeners. |
protected int |
iStartXLoc
When the mouse is dragged, this represents the X-coordinate of the starting location. |
protected int |
iStartYLoc
When the mouse is dragged, this represents the Y-coordinate of the starting location. |
protected Vector |
iStoredSequence
The Vector that holds a set of stored points from a previously established list. |
protected Vector |
iStoredSequenceDatasetIndices
The Vector that holds the dataset indices of stored points from a previously established list. |
protected int |
iTopPadding
Effective distance from the panel top border to 5 pixels above the top of the highest point (or y-tick mark). |
protected ArrayList<double[]> |
iXAxisData
All the x-axis data points. |
protected ArrayList<int[]> |
iXAxisDataInPixels
This array will hold the x-coordinates in pixels for all the x-axis values. |
protected String |
iXAxisLabel
The label (and unit between brackets, if available) for the x-axis. |
protected double |
iXAxisMax
The maximum x-axis value to display. |
protected double |
iXAxisMin
The minimum x-axis value to display. |
protected boolean |
iXAxisStartAtZero
This boolean is set to 'true' if the x-axis should start at zero. |
protected int |
iXPadding
Effective distance from the x-axis to the panel border. |
protected double |
iXScaleUnit
Scale unit for the X axis |
protected int |
iXUnit
Graphical unit for the X axis |
protected ArrayList<double[]> |
iYAxisData
All the y-axis values. |
protected ArrayList<int[]> |
iYAxisDataInPixels
This array will hold the y-coordinates in pixels for all the y-axis values. |
protected String |
iYAxisLabel
The label (and unit between brackets, if available) for the y-axis. |
protected double |
iYAxisMax
The maximum y-axis value to display. |
protected double |
iYAxisMin
The minimum y-axis value to display. |
protected double |
iYScaleUnit
Scale unit for the Y axis |
protected int |
iYUnit
Graphical unit for the Y axis |
protected static int |
LINES
Drawstyle which draws lines connecting the X-axis with the measurement. |
protected int |
maxPadding
The maximum padding (distance between the axes and the border of the panel). |
protected boolean |
miniature
If set to true, the y-axis is removed, the y- and x-axis tags are removed, and any annotations are hidden. |
protected int |
padding
The padding (distance between the axes and the border of the panel). |
protected boolean |
showAllPeaks
If false, only the annotated peaks will be shown. |
protected boolean |
showFileName
The boolean is set to 'true' if the file name is to be shown in the panel. |
protected boolean |
showPrecursorDetails
The boolean is set to 'true' if the precursor details is to be shown in the panel. |
protected boolean |
showResolution
The boolean is set to 'true' if the resolution is to be shown in the panel. |
protected double |
xAxisZoomRangeLowerValue
The lower range for the current zoom range. |
protected double |
xAxisZoomRangeUpperValue
The upper range for the current zoom range. |
protected int |
xTagCount
The number of X-axis tags. |
protected boolean |
yDataIsPositive
If set to true, all y data is assumed to be positive. |
protected int |
yTagCount
The number of Y-axis tags. |
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 | |
---|---|
GraphicsPanel()
|
Method Summary | |
---|---|
protected void |
addListeners()
This method adds the event listeners to the panel. |
void |
addReferenceAreaXAxis(ReferenceArea referenceArea)
Add a x-axis reference area. |
void |
addReferenceAreaYAxis(ReferenceArea referenceArea)
Add a y-axis reference area. |
void |
addSpectrumPanelListener(SpectrumPanelListener aListener)
This method registers the specified SpectrumPanelListener with this instance and notifies it of all future events. |
protected void |
annotate(SpectrumAnnotation aSA,
Graphics g,
HashMap<String,Integer> aAlReadyAnnotated)
This method attempts to find the specified SpectrumAnnotation in the current peak list and if so, annotates it correspondingly on the screen. |
protected int[] |
drawAxes(Graphics g,
double aXMin,
double aXMax,
int aXScale,
double aYMin,
double aYMax)
This method draws the axes and their labels on the specified Graphics object, taking into account the padding. |
protected void |
drawFilledPolygon(Graphics g)
This method draws filled polygons for all of the peaks for all datasets in the current x-axis range on the panel. |
protected void |
drawMeasurementLine(int aFirstIndex,
int aFirstDatasetIndex,
int aSecondIndex,
int aSecondDatasetIndex,
Graphics g,
Color aColor,
int aExtraPadding)
This method draws a line, measuring the distance between two points in real mass units. |
protected void |
drawPeaks(Graphics g)
This method draws all of the peaks for all datasets in the current x-axis range on the panel. |
protected void |
drawXAxisReferenceAreas(Graphics g,
boolean drawOnTop)
Draws the x-axis reference areas if any. |
protected void |
drawXTags(Graphics g,
int aMin,
int aMax,
int aXScale,
int aXAxisWidth,
int aPadding)
This method draws tags on the X axis. |
protected void |
drawYAxisReferenceAreas(Graphics g,
boolean drawOnTop)
Draws the y-axis reference areas if any. |
protected void |
drawYTags(Graphics g,
int aMin,
int aMax,
int aYAxisHeight,
int aPadding)
This method draws tags on the Y axis. |
protected void |
dropDottedLine(int aPeakIndex,
int aDatasetIndex,
int aTotalHeight,
Graphics g)
This method drops a dotted line from the specified total height to the top of the indicated point. |
protected String |
findDeltaMassMatches(double aDelta,
double aWindow)
This method attempts to find a list of known mass deltas, corresponding with the specified x value in the given window. |
HashMap<String,ReferenceArea> |
getAllReferenceAreasXAxis()
Returns all the x-axis references areas as a hashmap, with the labels as the keys. |
HashMap<String,ReferenceArea> |
getAllReferenceAreasYAxis()
Returns all the y-axis references areas as a hashmap, with the labels as the keys. |
float |
getAlphaLevel()
Returns the alpha level. |
ArrayList<Color> |
getAreaUnderCurveColors()
Returns the list of colors used for the datasets. |
double |
getDeltaMassWindow()
Get the size of the window to use when searching for matches in the known masses list when the user hovers over a second data point after clicking a previous data point. |
static HashMap<Double,String> |
getKnownMassDeltas()
Get all the known mass deltas (if any). |
int |
getMaxPadding()
Returns the max padding (distance between the axes and the border of the panel). |
double |
getMaxXAxisValue()
This method reports on the largest x-axis value in the point collection accross all datasets. |
double |
getMinXAxisValue()
This method reports on the smallest x-axis value in the point collection across all datasets. |
Color |
getPeakWaterMarkColor()
Get the peak water mark color. |
ArrayList<double[]> |
getXAxisData()
Returns the x-axis data. |
double |
getXAxisZoomRangeLowerValue()
Returns the lower range for the current zoom range. |
double |
getXAxisZoomRangeUpperValue()
Returns the upper range for the current zoom range. |
ArrayList<double[]> |
getYAxisData()
Returns the y-axis data. |
protected void |
highLight(int aIndex,
int dataSetIndex,
Graphics g,
Color aColor,
String aComment,
int aPixelsSpacer,
boolean aShowArrow)
This method will highlight the specified point in the specified color by drawing a floating triangle + x-value above it. |
protected void |
highlightClicked(int aIndex,
int dataSetIndex,
Graphics g)
This method will draw a highlighting triangle + x-value on top of the clicked marked point. |
protected void |
highLightPeak(int aIndex,
int dataSetIndex,
Graphics g)
This method will draw a highlighting triangle + x-value on top of the marked point. |
boolean |
isMiniature()
Returns true if the graphics panel is to be drawn in a minature form. |
void |
paint(Graphics g)
Invoked by Swing to draw components. |
protected void |
processXAndYData(double[] aXAxisData,
double[] aYAxisData,
Color dataPointAndLineColor,
Color areaUnderCurveColor)
This method reads the x and y values from the specified arrays and stores these internally for drawing. |
void |
removeAllReferenceAreasXAxis()
Removes all the x-axis reference areas. |
void |
removeAllReferenceAreasYAxis()
Removes all the y-axis reference areas. |
void |
removeReferenceAreaXAxis(String label)
Removes the x-axis reference area with the given label. |
void |
removeReferenceAreaYAxis(String label)
Removes the y-axis reference area with the given label. |
void |
rescale(double aMinXAxisValue,
double aMaxXAxisValue)
This method rescales the x-axis while notifying the observers. |
void |
rescale(double aMinXAxisValue,
double aMaxXAxisValue,
boolean aNotifyListeners)
This method rescales the x-axis, allowing the caller to specify whether the observers need be notified. |
void |
setAlphaLevel(float alphaLevel)
Sets the alpha level |
void |
setAnnotations(Vector aAnnotations)
This method sets all the annotations on this instance. |
void |
setAnnotationYAxisThreshold(double aThreshold)
This method allows the caller to set the procentual minimal, non-inclusive y-axis value threshold (compared to the highest point in the spectrum or chromatogram) a point must pass before being eligible for annotation. |
void |
setAreaUnderCurveColor(Color aColor,
int index)
Sets the color of the area under the curve for chromatograms and profile spectra for the dataset with the given dataset index. |
void |
setDataPointAndLineColor(Color aColor,
int index)
Sets the color of data points and line for the dataset with the given dataset index. |
void |
setDeltaMassWindow(double deltaMassWindow)
Set the size of the window to use when searching for matches in the known masses list when the user hovers over a second data point after clicking a previous data point. |
void |
setFilenameColor(Color aFilenameColor)
This method sets the display color for the filename on the panel. |
static void |
setKnownMassDeltas(HashMap<Double,String> aiKnownMassDeltas)
Set all the known mass deltas (if any). |
void |
setMaxPadding(int aMaxPadding)
Set the max padding (distance between the axes and the border of the panel). |
void |
setMiniature(boolean miniature)
Set if the graphics panel is to be drawn in a minature form. |
void |
setPeakWaterMarkColor(Color peakWaterMarkColor)
Set the peak water mark color. |
void |
setScientificXAxis(boolean scientificXAxis)
Set if the x-axis tags are to be drawn using scientific annotation. |
void |
setScientificXAxis(String pattern)
Set if the x-axis tags are to be drawn using scientific annotation. |
void |
setScientificYAxis(boolean scientificYAxis)
Set if the y-axis tags are to be drawn using scientific annotation. |
void |
setScientificYAxis(String pattern)
Set if the y-axis tags are to be drawn using scientific annotation. |
void |
setXAxisStartAtZero(boolean aXAxisStartAtZero)
This method sets the start value of the x-axis to zero. |
void |
setYDataIsPositive(boolean yDataIsPositive)
Set to true of all y data values can be assumed to be positive. |
boolean |
yDataIsPositive()
Returns true of all the y-data is to be assumed as positive. |
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 |
Field Detail |
---|
protected boolean miniature
protected boolean yDataIsPositive
protected float alphaLevel
protected static int dataSetCounter
public static final int INTERACTIVE_STATUS
public static final int ANNOTATED_STATUS
protected static HashMap<Double,String> iKnownMassDeltas
protected double deltaMassWindow
protected String iXAxisLabel
protected String iYAxisLabel
protected Color iFilenameColor
protected ArrayList<Color> iDataPointAndLineColor
protected ArrayList<Color> iAreaUnderCurveColor
protected Integer iPointSize
protected String iFilename
protected ArrayList iSpecPanelListeners
protected int iPointDetectionTolerance
protected int iStartXLoc
protected int iStartYLoc
protected int iEndXLoc
protected double xAxisZoomRangeLowerValue
protected double xAxisZoomRangeUpperValue
protected int iDragXLoc
protected double iXScaleUnit
protected double iYScaleUnit
protected int iXUnit
protected int iYUnit
protected int iXPadding
protected int iTopPadding
protected boolean iXAxisStartAtZero
protected boolean iDragged
protected int xTagCount
protected int yTagCount
protected int padding
protected int currentPadding
protected int maxPadding
protected boolean showFileName
protected boolean showPrecursorDetails
protected boolean showResolution
protected ArrayList<double[]> iXAxisData
protected double iXAxisMin
protected double iXAxisMax
protected double iYAxisMin
protected double iYAxisMax
protected double iAnnotationYAxisThreshold
protected ArrayList<double[]> iYAxisData
protected double iPrecursorMZ
protected String iPrecursorCharge
protected ArrayList<int[]> iXAxisDataInPixels
protected ArrayList<int[]> iYAxisDataInPixels
protected boolean iHighLight
protected int iHighLightIndex
protected int iHighLightDatasetIndex
protected boolean iClicked
protected int iClickedIndex
protected int iClickedDataSetIndex
protected Vector iClickedList
protected Vector iClickedListDatasetIndices
protected Vector iStoredSequence
protected Vector iStoredSequenceDatasetIndices
protected Vector iAnnotations
protected int iMinDrag
protected int iDrawStyle
protected int iDotRadius
protected static final int LINES
protected static final int DOTS
protected int iMSLevel
protected boolean showAllPeaks
protected GraphicsPanel.GraphicsPanelType currentGraphicsPanelType
Constructor Detail |
---|
public GraphicsPanel()
Method Detail |
---|
public boolean yDataIsPositive()
public void setYDataIsPositive(boolean yDataIsPositive)
yDataIsPositive
- true of all y data values can be assumed to be positivepublic boolean isMiniature()
public void setMiniature(boolean miniature)
miniature
- if the spectrum is to be drawn in a minature formpublic double getXAxisZoomRangeLowerValue()
public double getXAxisZoomRangeUpperValue()
public double getDeltaMassWindow()
public void setDeltaMassWindow(double deltaMassWindow)
deltaMassWindow
- the new size of the delta mass windowpublic static HashMap<Double,String> getKnownMassDeltas()
public static void setKnownMassDeltas(HashMap<Double,String> aiKnownMassDeltas)
aiKnownMassDeltas
- the HasMap of the known mass deltaspublic ArrayList<double[]> getXAxisData()
public ArrayList<double[]> getYAxisData()
public float getAlphaLevel()
public void setAlphaLevel(float alphaLevel)
alphaLevel
- the alphaLevel to setpublic void setXAxisStartAtZero(boolean aXAxisStartAtZero)
aXAxisStartAtZero
- if true the x axis starts at zeropublic void setMaxPadding(int aMaxPadding)
aMaxPadding
- the new max paddingpublic int getMaxPadding()
public void setAnnotations(Vector aAnnotations)
aAnnotations
- Vector with SpectrumAnnotation instances.public void setAnnotationYAxisThreshold(double aThreshold)
aThreshold
- double with the procentual y-axis value (as compared to the highest point
in the spectrum or chromatogram) cutoff threshold for annotation.public void setFilenameColor(Color aFilenameColor)
aFilenameColor
- Color to render the filename in on the panel.
Can be 'null' for default coloring.public void paint(Graphics g)
paint
directly,
but should instead use the repaint
method to
schedule the component for redrawing.
This method actually delegates the work of painting to three
protected methods: paintComponent
,
paintBorder
,
and paintChildren
. They're called in the order
listed to ensure that children appear on top of component itself.
Generally speaking, the component and its children should not
paint in the insets area allocated to the border. Subclasses can
just override this method, as always. A subclass that just
wants to specialize the UI (look and feel) delegate's
paint
method should just override
paintComponent
.
paint
in class JComponent
g
- the Graphics
context in which to paintJComponent.paintComponent(java.awt.Graphics)
,
JComponent.paintBorder(java.awt.Graphics)
,
JComponent.paintChildren(java.awt.Graphics)
,
JComponent.getComponentGraphics(java.awt.Graphics)
,
JComponent.repaint(long, int, int, int, int)
protected void drawXAxisReferenceAreas(Graphics g, boolean drawOnTop)
g
- Graphics object to draw on.drawOnTop
- if true the areas to be drawn on top of the data are drawn,
if false the areas that are to be drawn behind the data are drawnprotected void drawYAxisReferenceAreas(Graphics g, boolean drawOnTop)
g
- Graphics object to draw on.drawOnTop
- if true the areas to be drawn on top of the data are drawn,
if false the areas that are to be drawn behind the data are drawnpublic double getMaxXAxisValue()
public double getMinXAxisValue()
public void addSpectrumPanelListener(SpectrumPanelListener aListener)
aListener
- SpectrumPanelListener to register on this instance.protected void addListeners()
public void rescale(double aMinXAxisValue, double aMaxXAxisValue)
aMinXAxisValue
- double with the new minimum x-axis value to display.aMaxXAxisValue
- double with the new maximum x-axis value to display.public void addReferenceAreaXAxis(ReferenceArea referenceArea)
referenceArea
- the reference area to addpublic void removeReferenceAreaXAxis(String label)
label
- the reference to removepublic void removeAllReferenceAreasXAxis()
public HashMap<String,ReferenceArea> getAllReferenceAreasXAxis()
public void addReferenceAreaYAxis(ReferenceArea referenceArea)
referenceArea
- the reference area to addpublic void removeReferenceAreaYAxis(String label)
label
- the reference to removepublic void removeAllReferenceAreasYAxis()
public HashMap<String,ReferenceArea> getAllReferenceAreasYAxis()
public void setDataPointAndLineColor(Color aColor, int index)
aColor
- the color to useindex
- the index of the datasetpublic void setAreaUnderCurveColor(Color aColor, int index)
aColor
- the color to useindex
- the index of the datasetpublic ArrayList<Color> getAreaUnderCurveColors()
public void rescale(double aMinXAxisValue, double aMaxXAxisValue, boolean aNotifyListeners)
aMinXAxisValue
- double with the new minimum x-axis value to display.aMaxXAxisValue
- double with the new maximum x-axis value to display.aNotifyListeners
- boolean to indicate whether the observers should be notified.protected void processXAndYData(double[] aXAxisData, double[] aYAxisData, Color dataPointAndLineColor, Color areaUnderCurveColor)
aXAxisData
- double[] with the x-axis values.aYAxisData
- double[] with the corresponding y-axis values.dataPointAndLineColor
- the color to use for the data points and lineareaUnderCurveColor
- the color to use for the area under the curveprotected int[] drawAxes(Graphics g, double aXMin, double aXMax, int aXScale, double aYMin, double aYMax)
g
- Graphics object to draw on.aXMin
- double with the minimal x value.aXMax
- double with the maximum x value.aXScale
- int with the scale to display for the X-axis labels (as used in BigDecimal's setScale).aYMin
- double with the minimal y value.aYMax
- double with the maximum y value.
protected void drawXTags(Graphics g, int aMin, int aMax, int aXScale, int aXAxisWidth, int aPadding)
aMin
- double with the minimum value for the axis.aMax
- double with the maximum value for the axis.aXScale
- int with the scale to display for the X-axis labels (as used in BigDecimal's setScale).g
- Graphics object to draw on.aXAxisWidth
- int with the axis width in pixels.aPadding
- int with the amount of padding to take into account.protected void drawYTags(Graphics g, int aMin, int aMax, int aYAxisHeight, int aPadding)
aMin
- double with the minimum value for the axis.aMax
- double with the maximum value for the axis.g
- Graphics object to draw on.aYAxisHeight
- int with the axis height in pixels.aPadding
- int with the amount of padding to take into account.protected void highLightPeak(int aIndex, int dataSetIndex, Graphics g)
aIndex
- int with the index of the point to highlight.dataSetIndex
- the index of the datasetg
- Graphics object to draw the highlighting on.protected void highlightClicked(int aIndex, int dataSetIndex, Graphics g)
aIndex
- int with the index of the clicked point to highlight.dataSetIndex
- the index of the datasetg
- Graphics object to draw the highlighting on.protected void highLight(int aIndex, int dataSetIndex, Graphics g, Color aColor, String aComment, int aPixelsSpacer, boolean aShowArrow)
aIndex
- int with the index.dataSetIndex
- the index of the datasetg
- Graphics object to draw onaColor
- Color to draw the highlighting in.aComment
- String with an optional comment. Can be 'null' in which case
it will be omitted.aPixelsSpacer
- int that gives the vertical spacer in pixels for the highlighting.aShowArrow
- boolean that indicates whether a downward-pointing arrow and dotted line
should be drawn over the point.protected void drawMeasurementLine(int aFirstIndex, int aFirstDatasetIndex, int aSecondIndex, int aSecondDatasetIndex, Graphics g, Color aColor, int aExtraPadding)
aFirstIndex
- int with the first point index to draw from.aFirstDatasetIndex
- the dataset index of the first data pointaSecondIndex
- int with the second point index to draw to.aSecondDatasetIndex
- the dataset index of the second data pointg
- Graphics object on which to draw.aColor
- Color object with the color for all the drawing.aExtraPadding
- int with an optional amount of extra padding (lower on the graph
if positive, higher on the graph if negative)protected void dropDottedLine(int aPeakIndex, int aDatasetIndex, int aTotalHeight, Graphics g)
aPeakIndex
- int with the index of the point to draw the dotted line for.aDatasetIndex
- the index of the datasetaTotalHeight
- int with the height (in pixels) to drop the dotted line from.g
- Graphics object to draw the dotted line on.protected String findDeltaMassMatches(double aDelta, double aWindow)
aDelta
- the delta mass to search foraWindow
- the window used for the search
protected void annotate(SpectrumAnnotation aSA, Graphics g, HashMap<String,Integer> aAlReadyAnnotated)
aSA
- SpectrumAnnotation with the annotation to find.g
- Graphics instance to annotate on.aAlReadyAnnotated
- HashMap with the index of a point as key, and the number
of times it has been annotated as value (or 'null' if not
yet annotated).protected void drawPeaks(Graphics g)
g
- Graphics object to draw on.protected void drawFilledPolygon(Graphics g)
g
- Graphics object to draw on.public void setScientificXAxis(boolean scientificXAxis)
scientificXAxis
- if the x-axis tags is to be drawn using scientific annotationpublic void setScientificXAxis(String pattern)
pattern
- the number format pattern to usepublic void setScientificYAxis(boolean scientificYAxis)
scientificYAxis
- if the y-axis tags is to be drawn using scientific annotationpublic void setScientificYAxis(String pattern)
pattern
- the number format pattern to usepublic Color getPeakWaterMarkColor()
public void setPeakWaterMarkColor(Color peakWaterMarkColor)
peakWaterMarkColor
- the color to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |