public abstract class GraphicsPanel extends JPanel
Modifier and Type | Class and Description |
---|---|
static class |
GraphicsPanel.DrawingStyle
An enumerator of the possible GraphicsPanel types.
|
protected static class |
GraphicsPanel.GraphicsPanelType
An enumerator of the possible GraphicsPanel types.
|
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected float |
alphaLevel
The opacity of the spectra.
|
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 int |
dataSetCounter
The number of datasets currently displayed in the panel.
|
protected int |
dataSetCounterMirroredSpectra
The number of mirrored datasets currently displayed in the panel.
|
protected double |
deltaMassWindow
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.
|
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 ArrayList<Color> |
iAreaUnderCurveColorMirroredSpectra
Colors in which the chromatogram polyline is rendered for the mirrored
spectra.
|
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 GraphicsPanel.DrawingStyle |
iCurrentDrawStyle
This variable holds the current drawing style.
|
protected ArrayList<Color> |
iDataPointAndLineColor
Colors in which the data points and peaks are rendered.
|
protected ArrayList<Color> |
iDataPointAndLineColorMirroredSpectra
Colors in which the data points and peaks are rendered for the mirrored
spectra.
|
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 |
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 String |
iFilenameMirrorredSpectrum
The spectrum or chromatogram filename for the mirrored spectrum or
chromatogram.
|
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.
|
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 String |
iPrecursorChargeMirorredSpectrum
This String holds the charge for the precursor for the mirrored spectrum.
|
protected double |
iPrecursorMZ
This variable holds the precursor M/Z.
|
protected double |
iPrecursorMZMirroredSpectrum
This variable holds the precursor M/Z for the mirrored spectrum.
|
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 ArrayList<int[]> |
iXAxisDataInPixelsMirroredSpectrum
This array will hold the x-coordinates in pixels for all the x-axis
values of the mirrored spectrum.
|
protected ArrayList<double[]> |
iXAxisDataMirroredSpectrum
All the x-axis data points for the mirrored spectrum.
|
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 ArrayList<int[]> |
iYAxisDataInPixelsMirroredSpectrum
This array will hold the y-coordinates in pixels for all the y-axis
values of the mirrored spectrum.
|
protected ArrayList<double[]> |
iYAxisDataMirroredSpectrum
All the y-axis values for the mirrored spectra.
|
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 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 |
yAxisZoomExcludesBackgroundPeaks
If true, the automatic y-axis zoom excludes the background peaks.
|
protected boolean |
yDataIsPositive
If set to true, all y data is assumed to be positive.
|
protected int |
yTagCount
The number of Y-axis tags.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
GraphicsPanel() |
Modifier and Type | Method and Description |
---|---|
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 |
drawMirroredPeaks(Graphics g)
This method draws all of the peaks for all datasets in the current x-axis
range on the panel.
|
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.
|
float |
getBackgroundPeakWidth()
Returns the current width of the background peaks.
|
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
across 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.
|
float |
getPeakWidth()
Returns the current width of the peaks.
|
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,
int aAnnotationCounter)
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 miniature form.
|
boolean |
isSubscriptAnnotationNumbers()
Returns true if the numbers in the peak annotations are to be
subscripted.
|
void |
paint(Graphics g)
Invoked by Swing to draw components.
|
protected void |
processMirroredXAndYData(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.
|
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 identifier)
Removes the x-axis reference area with the given identifier.
|
void |
removeReferenceAreaYAxis(String identifier)
Removes the y-axis reference area with the given identifier.
|
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 |
setBackgroundPeakWidth(float backgroundPeakWidth)
Set the backgroundPeakWidth peak width.
|
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 miniature form.
|
void |
setPeakWaterMarkColor(Color peakWaterMarkColor)
Set the peak water mark color.
|
void |
setPeakWidth(float peakWidth)
Set the peak width.
|
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 |
setShowPrecursorDetails(boolean showPrecursorDetails)
Set whether the precursor details are to be shown.
|
void |
setShowResolution(boolean showResolution)
Set whether the resolution is to be shown.
|
void |
setSubscriptAnnotationNumbers(boolean subscriptAnnotationNumbers)
Set if the numbers in the peak annotations are to be subscripted.
|
void |
setUseMassDeltaCombinations(boolean useMassDeltaCombinations)
If true, pairs of delta mass annotations are used when doing de novo
sequencing.
|
void |
setXAxisStartAtZero(boolean aXAxisStartAtZero)
This method sets the start value of the x-axis to zero.
|
void |
setYAxisZoomExcludesBackgroundPeaks(boolean yAxisZoomExcludesBackgroundPeaks)
Set if the automatic y-axis zoom only considers the anotated peaks.
|
void |
setYDataIsPositive(boolean yDataIsPositive)
Set to true of all y data values can be assumed to be positive.
|
boolean |
showPrecursorDetails()
Returns true of the precursor details are to be shown.
|
boolean |
showResolution()
Returns true if the resolution is to be shown.
|
boolean |
useMassDeltaCombinations()
If true, pairs of delta mass annotations are used when doing de novo
sequencing.
|
boolean |
yAxisZoomOnlyExcludesBackgroundPeaks()
Returns true if the automatic y-axis zoom excludes background peaks.
|
boolean |
yDataIsPositive()
Returns true of all the y-data is to be assumed as positive.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected boolean miniature
protected boolean yDataIsPositive
protected float alphaLevel
protected int dataSetCounter
protected int dataSetCounterMirroredSpectra
public final int INTERACTIVE_STATUS
public 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> iDataPointAndLineColorMirroredSpectra
protected ArrayList<Color> iAreaUnderCurveColor
protected ArrayList<Color> iAreaUnderCurveColorMirroredSpectra
protected Integer iPointSize
protected String iFilename
protected String iFilenameMirrorredSpectrum
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 ArrayList<double[]> iXAxisDataMirroredSpectrum
protected double iXAxisMin
protected double iXAxisMax
protected double iYAxisMin
protected double iYAxisMax
protected double iAnnotationYAxisThreshold
protected ArrayList<double[]> iYAxisData
protected ArrayList<double[]> iYAxisDataMirroredSpectrum
protected double iPrecursorMZ
protected double iPrecursorMZMirroredSpectrum
protected String iPrecursorCharge
protected String iPrecursorChargeMirorredSpectrum
protected ArrayList<int[]> iXAxisDataInPixels
protected ArrayList<int[]> iYAxisDataInPixels
protected ArrayList<int[]> iXAxisDataInPixelsMirroredSpectrum
protected ArrayList<int[]> iYAxisDataInPixelsMirroredSpectrum
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 GraphicsPanel.DrawingStyle iCurrentDrawStyle
protected int iDotRadius
protected int iMSLevel
protected boolean showAllPeaks
protected boolean yAxisZoomExcludesBackgroundPeaks
protected GraphicsPanel.GraphicsPanelType currentGraphicsPanelType
public boolean isSubscriptAnnotationNumbers()
public void setSubscriptAnnotationNumbers(boolean subscriptAnnotationNumbers)
subscriptAnnotationNumbers
- set if the numbers in the peak
annotations are to be subscriptedpublic boolean yAxisZoomOnlyExcludesBackgroundPeaks()
public void setYAxisZoomExcludesBackgroundPeaks(boolean yAxisZoomExcludesBackgroundPeaks)
yAxisZoomExcludesBackgroundPeaks
- public boolean useMassDeltaCombinations()
public void setUseMassDeltaCombinations(boolean useMassDeltaCombinations)
useMassDeltaCombinations
- the useMassDeltaCombinations to setpublic boolean showPrecursorDetails()
public void setShowPrecursorDetails(boolean showPrecursorDetails)
showPrecursorDetails
- the showPrecursorDetails to setpublic boolean showResolution()
public void setShowResolution(boolean showResolution)
showResolution
- the showResolution to setpublic 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 miniature 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 float getPeakWidth()
public void setPeakWidth(float peakWidth)
peakWidth
- the new peak widthpublic float getBackgroundPeakWidth()
public void setBackgroundPeakWidth(float backgroundPeakWidth)
backgroundPeakWidth
- the new backgroundPeakWidth peak widthpublic 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 identifier)
identifier
- the identifier of 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 identifier)
identifier
- the identifier of 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 void processMirroredXAndYData(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, int aAnnotationCounter)
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.aAnnotationCounter
- the number of annotation of the given peakprotected 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 searchprotected 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 drawMirroredPeaks(Graphics g)
g
- Graphics object to draw on.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 setCopyright © 2014. All rights reserved.