Spectrogram
Class SpectrogramProjector

java.lang.Object
  extended by PamView.GeneralProjector
      extended by Spectrogram.SpectrogramProjector

public class SpectrogramProjector
extends GeneralProjector

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:
DirectDrawProjector

Nested Class Summary
 
Nested classes/interfaces inherited from class PamView.GeneralProjector
GeneralProjector.ParameterType, GeneralProjector.ParameterUnits
 
Field Summary
private  int pixOriginX
           
private  int pixOriginY
           
private  int specHeight
           
private  SpectrogramDisplay spectrogramDisplay
           
private  int specWidth
           
private  long timeOffsetMillis
           
private  double xScale
          xScale is in pixels per millisecond.
private  double yScale
           
 
Fields inherited from class PamView.GeneralProjector
NPARAMETERS
 
Constructor Summary
SpectrogramProjector(SpectrogramDisplay spectrogramDisplay)
           
 
Method Summary
 double dataToX(double d1, double d2)
           
 double dataToY(double d1, double frequency)
           
 Coordinate3d 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.
 void setOffset(long timeOffsetMillis, int timeOffsetPixs)
          Set the x and the time offset
 void setScales(double xScale, double yScale, int specWidth, int specHeight)
           
 
Methods inherited from class PamView.GeneralProjector
addHoverData, addHoverData, clearHoverList, findClosestDataUnitIndex, findClosestDataUnitIndex, getHoveredDataUnit, getMouseHoverAdapter, getParmeterType, getParmeterUnits, setParmeterType, setParmeterUnits
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xScale

private double xScale
xScale is in pixels per millisecond.


yScale

private double yScale

pixOriginX

private int pixOriginX

pixOriginY

private int pixOriginY

specWidth

private int specWidth

specHeight

private int specHeight

timeOffsetMillis

private long timeOffsetMillis

spectrogramDisplay

private SpectrogramDisplay spectrogramDisplay
Constructor Detail

SpectrogramProjector

SpectrogramProjector(SpectrogramDisplay spectrogramDisplay)
Method Detail

setScales

public void setScales(double xScale,
                      double yScale,
                      int specWidth,
                      int specHeight)
Parameters:
xScale - pixels per millisecond
yScale - 2/fftLength
specWidth - display width
specHeight - display height

setOffset

public void setOffset(long timeOffsetMillis,
                      int timeOffsetPixs)
Set the x and the time offset

Parameters:
timeOffsetMillis - time offset in Java milliseconds
timeOffsetPixs - position in pixels

getCoord3d

public Coordinate3d getCoord3d(double d1,
                               double d2,
                               double d3)
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 class GeneralProjector
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)

dataToX

public double dataToX(double d1,
                      double d2)

dataToY

public double dataToY(double d1,
                      double frequency)