Package detectionPlotFX.plots
Class SpectrumPlot<D extends PamDataUnit>
java.lang.Object
detectionPlotFX.plots.SpectrumPlot<D>
- Type Parameters:
 D- - the input data unit type
- All Implemented Interfaces:
 DetectionPlot<D>
- Direct Known Subclasses:
 CTSpectrumPlot,RawSpectrumPlot,TemplateSpectrumPane.SpectrumTemplatePlot
public abstract class SpectrumPlot<D extends PamDataUnit>
extends Object
implements DetectionPlot<D>
Plot for the spectrum of a waveform.
- Author:
 - Jamie Macaulay
 
- 
Field Summary
Fields inherited from interface detectionPlotFX.layout.DetectionPlot
SCROLLPANE_DRAW, STANDARD_DRAW - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoiddrawLogSpectrum(javafx.scene.canvas.GraphicsContext g2, javafx.scene.shape.Rectangle clipRect, double[][] clickLineData, DetectionPlotProjector projector) Draw the shapes for the log spectrum.abstract double[][]getCepstrum(D data, int minSample, int maxSample) Get the cepstrum for the detectiongetName()Get the name of the plot e.g.abstract double[][]getPowerSpectrum(D data, int minSample, int maxSample) Get the power spectrum for the detectiondoublegetSampleRate(D currentDetection) Get the sample rate in samples per second of the last data unit.javafx.scene.layout.PaneGet the settings pane for the particular plot.Get spectrum params.booleanCheck whether the spectrum is filled with a transparent polygon/voidpaintPlot(D data, javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Rectangle rectangle, DetectionPlotProjector projector, int flag) Plot the relevent data from a detection.voidRe paint the last data unit.voidsetFillSpectrum(boolean fillSpectrum) Set whether the spectrum is filled with a transparent polygonvoidsetupAxis(D data, double sR, DetectionPlotProjector plotProjector) Setup the axis.voidSetup the plot. 
- 
Constructor Details
- 
SpectrumPlot
 
 - 
 - 
Method Details
- 
getName
Description copied from interface:DetectionPlotGet the name of the plot e.g. waveform, spectrum etc.- Specified by:
 getNamein interfaceDetectionPlot<D extends PamDataUnit>
 - 
getPowerSpectrum
Get the power spectrum for the detection- Parameters:
 data- - the pamDetection- Returns:
 - the power spectrum for each channel.
 
 - 
getCepstrum
Get the cepstrum for the detection- Parameters:
 data- - the pamDetection- Returns:
 - the cepstrum for each channel.
 
 - 
setupPlot
public void setupPlot()Description copied from interface:DetectionPlotSetup the plot. This may, for example, involve changing axis etc.- Specified by:
 setupPlotin interfaceDetectionPlot<D extends PamDataUnit>
 - 
setupAxis
Description copied from interface:DetectionPlotSetup the axis. This is called before paintPlot. Ensures axis are correct values- Specified by:
 setupAxisin interfaceDetectionPlot<D extends PamDataUnit>- Parameters:
 data- - the data of every channel. e.g. might be a waveform with each point representing a sample.sR- - the sample rate. Primarily used to convert bins into time values.
 - 
paintPlot
public void paintPlot(D data, javafx.scene.canvas.GraphicsContext gc, javafx.scene.shape.Rectangle rectangle, DetectionPlotProjector projector, int flag) Description copied from interface:DetectionPlotPlot the relevent data from a detection.- Specified by:
 paintPlotin interfaceDetectionPlot<D extends PamDataUnit>- Parameters:
 data- - the data of every channel. e.g. might be a waveform with each point representing a sample.gc- - the graphics handle to draw on.
 - 
drawLogSpectrum
public void drawLogSpectrum(javafx.scene.canvas.GraphicsContext g2, javafx.scene.shape.Rectangle clipRect, double[][] clickLineData, DetectionPlotProjector projector) Draw the shapes for the log spectrum. This function should eventually be integrated with the drawSpectrum() function.- Parameters:
 clipRect-clickLineData-g-eventLineData-
 - 
getSettingsPane
public javafx.scene.layout.Pane getSettingsPane()Description copied from interface:DetectionPlotGet the settings pane for the particular plot. This sits on the right hand side of the display inside a hiding pane.- Specified by:
 getSettingsPanein interfaceDetectionPlot<D extends PamDataUnit>- Returns:
 - a pane with controls for changing settings in a node.
 
 - 
getSampleRate
Get the sample rate in samples per second of the last data unit.- Parameters:
 the- detection to find sample rate for.- Returns:
 - the sample rate in samples per second.
 
 - 
getSpectrumParams
Get spectrum params.- Returns:
 - the spectrum params.
 
 - 
reDrawLastUnit
public void reDrawLastUnit()Re paint the last data unit. - 
isFillSpectrum
public boolean isFillSpectrum()Check whether the spectrum is filled with a transparent polygon/- Returns:
 - true if spectum is filled.
 
 - 
setFillSpectrum
public void setFillSpectrum(boolean fillSpectrum) Set whether the spectrum is filled with a transparent polygon- Parameters:
 fillSpectrum- - true to fill spectrum
 
 -