Package Spectrogram
Class SpectrogramProjector
Spectrogram projector for overlaying data onto the spectrogram bitmap
which will always be scaled 1:1 with regard to pixels per frequency or
time bin.
- Author:
- Doug Gillespie
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class PamView.GeneralProjector
GeneralProjector.ParameterType, GeneralProjector.ParameterUnits
-
Field Summary
Fields inherited from class PamView.GeneralProjector
NPARAMETERS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
dataToX
(double d1, double d2) double
dataToY
(double d1, double frequency) int
getCoord3d
(double d1, double d2, double d3) Function ultimately used by a PamDataBlock to convert it's own data, in whatever form that is in into screen coordinates.getCoord3d
(TimeFrequencyPoint data) Same as getCoordinate3d but using the generic typegetDataPosition
(PamCoordinate screenPos) Do the exact opposite of getCoord3d and turn a screen position back into a data coordinate (e.g.long
void
setChannel
(int channel) void
setOffset
(long timeOffsetMillis, int timeOffsetPixs) Set the x and the time offsetvoid
setScales
(double xScale, double yScale, int specWidth, int specHeight) Methods inherited from class PamView.GeneralProjector
addHoverData, addHoverData, addHoverData, addHoverData, addHoverData, addHoverData, clearHoverList, findClosestDataUnitIndex, findClosestDataUnitIndex, getDataSelector, getHoverDataList, getHoverDataSynchroniser, getHoveredDataUnit, getHoverText, getHoverText, getMouseHoverAdapter, getPamSymbolChooser, getParameterTypes, getParameterUnits, getParmeterType, getParmeterUnits, getProjectorDrawingOptions, isViewer, setDataSelector, setPamSymbolChooser, setParmeterType, setParmeterUnits, setProjectorDrawingOptions
-
Constructor Details
-
SpectrogramProjector
-
-
Method Details
-
getTimeOffsetMillis
public long getTimeOffsetMillis()- Returns:
- the timeOffsetMillis
-
setScales
public void setScales(double xScale, double yScale, int specWidth, int specHeight) - Parameters:
xScale
- pixels per millisecondyScale
- 2/fftLengthspecWidth
- display widthspecHeight
- display height
-
setOffset
public void setOffset(long timeOffsetMillis, int timeOffsetPixs) Set the x and the time offset- Parameters:
timeOffsetMillis
- time offset in Java millisecondstimeOffsetPixs
- position in pixels
-
getCoord3d
Description copied from class:GeneralProjector
Same as getCoordinate3d but using the generic type- Specified by:
getCoord3d
in classGeneralProjector<TimeFrequencyPoint>
- Parameters:
data
- object extending PamCoordinate- Returns:
- 3d coordinate.
-
getCoord3d
Description copied from class:GeneralProjector
Function ultimately used by a PamDataBlock to convert it's own data, in whatever form that is in into screen coordinates.- Specified by:
getCoord3d
in classGeneralProjector<TimeFrequencyPoint>
- Parameters:
d1
- d2 and d3 are data representing whatever is appropriate for the concrete instance of the projector (e.g. Latitude, Longitude, depth, Time Frequency, etc)- Returns:
- A 3 dimensional coordinate (realistically z is never currently used)
-
getDataPosition
Description copied from class:GeneralProjector
Do the exact opposite of getCoord3d and turn a screen position back into a data coordinate (e.g. a time / freq, a lat long, etc)/.- Specified by:
getDataPosition
in classGeneralProjector<TimeFrequencyPoint>
- Parameters:
screenPos
- screen position- Returns:
- data object.
-
dataToX
public double dataToX(double d1, double d2) -
dataToY
public double dataToY(double d1, double frequency) -
getSpectrogramDisplay
- Returns:
- the spectrogramDisplay
-
setChannel
public void setChannel(int channel) - Parameters:
channel
- the channel to set
-
getChannel
public int getChannel()- Returns:
- the channel
-