Spectrogram
Class SpectrogramDisplay

java.lang.Object
  extended by Layout.PamFramePlots
      extended by userDisplay.UserFramePlots
          extended by Spectrogram.SpectrogramDisplay
All Implemented Interfaces:
EventListener, InternalFrameListener, DisplayPanelContainer, PamObserver

public class SpectrogramDisplay
extends UserFramePlots
implements PamObserver, InternalFrameListener, DisplayPanelContainer


Field Summary
 
Fields inherited from class userDisplay.UserFramePlots
FRAME_TYPE_RADAR, FRAME_TYPE_SPECTROGRAM, userDisplayControl
 
Fields inherited from interface Layout.DisplayPanelContainer
DRAW_BORDER
 
Constructor Summary
SpectrogramDisplay(UserDisplayControl userDisplayControl, SpectrogramParameters spectrogramParameters)
           
 
Method Summary
 void createAllImages()
           
 double getCurrentXPixel()
          current pixel (need not be integer !
 long getCurrentXTime()
          get the time at the cursor in milliseconds
 int getFrameType()
           
 int getImageHeight()
           
 int getImageWidth()
          Width of the bitmap thats beeing drawn on - not the number of pixels, though these may often be the same.
 String getName()
           
 String getObserverName()
           
 long getRequiredDataHistory(PamObservable o, Object arg)
          Required data history depends on what's happening with the mouse.
 FFTDataBlock getSourceFFTDataBlock()
           
 PamRawDataBlock getSourceRawDataBlock()
           
 SpectrogramParameters getSpectrogramParameters()
           
 double getXDuration()
          get the display duration in milliseconds
 void internalFrameClosing(InternalFrameEvent e)
           
 void masterClockUpdate(long milliSeconds, long sampleNumber)
           
 void noteNewSettings()
           
 void notifyModelChanged(int changeType)
           
 void PamToStart()
           
 void panelNotify(int noteType)
          notification from a display panel that it's necessary to perform some action - such as redrawing axis.
 void removeObservable(PamObservable o)
          called when an Observable (PamDataBlock) is removed from the system
 void repaintAll()
           
 void setParams(SpectrogramParameters newParameters)
           
 void setSampleRate(float sampleRate, boolean notify)
          New sample rate
 void setSettings()
           
 void update(PamObservable obs, PamDataUnit newData)
          Informs the PamObserver that new data have been added to the Observable class
 
Methods inherited from class userDisplay.UserFramePlots
getUserFrameParameters, internalFrameActivated, internalFrameClosed, internalFrameDeactivated, internalFrameDeiconified, internalFrameIconified, internalFrameOpened, setUserFrameParameters
 
Methods inherited from class Layout.PamFramePlots
getAxisPanel, getEastPanel, getFrame, getNorthPanel, getPlotPanel, getSouthPanel, getWestPanel, repaint, repaint, setAxisPanel, setEastPanel, setFrame, setNorthPanel, setPlotPanel, setSouthPanel, setWestPanel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.event.InternalFrameListener
internalFrameActivated, internalFrameClosed, internalFrameDeactivated, internalFrameDeiconified, internalFrameIconified, internalFrameOpened
 

Constructor Detail

SpectrogramDisplay

public SpectrogramDisplay(UserDisplayControl userDisplayControl,
                          SpectrogramParameters spectrogramParameters)
Method Detail

getName

public String getName()
Overrides:
getName in class UserFramePlots

setParams

public void setParams(SpectrogramParameters newParameters)

repaintAll

public void repaintAll()

getImageWidth

public int getImageWidth()
Width of the bitmap thats beeing drawn on - not the number of pixels, though these may often be the same.

Returns:
the width of the image in pixels

getImageHeight

public int getImageHeight()

createAllImages

public void createAllImages()

setSampleRate

public void setSampleRate(float sampleRate,
                          boolean notify)
Description copied from interface: PamObserver
New sample rate

Specified by:
setSampleRate in interface PamObserver
notify - Notify other PamObservers and PamObservables in the chain.

masterClockUpdate

public void masterClockUpdate(long milliSeconds,
                              long sampleNumber)
Specified by:
masterClockUpdate in interface PamObserver

PamToStart

public void PamToStart()

getRequiredDataHistory

public long getRequiredDataHistory(PamObservable o,
                                   Object arg)
Required data history depends on what's happening with the mouse. If the mouse is doing nothing and there are no SpectrogramMarkObservers then no data needs to be stored for drawing the spectrogram. If there are mark observers and the mouse is up, then make sure that at least one screen full of data is always in memory (both FFT data and Raw wave data). If the mouse is down, then keep the maximum of either one screen full of from whenever the mouse was pressed - the use may hold it down for a long time !

Specified by:
getRequiredDataHistory in interface PamObserver
Parameters:
o - PamObservable class requiring the data
arg - optional argument from PamObservable
Returns:
time in milliseconds requried by data held in PamObservable
See Also:
SpectrogramMarkObserver

getObserverName

public String getObserverName()
Specified by:
getObserverName in interface PamObserver

update

public void update(PamObservable obs,
                   PamDataUnit newData)
Description copied from interface: PamObserver
Informs the PamObserver that new data have been added to the Observable class

Specified by:
update in interface PamObserver
Parameters:
obs - Reference to the Observable (a PamDataBlock)
newData - Reference to the new PamDataUnit

setSettings

public void setSettings()

getSpectrogramParameters

public SpectrogramParameters getSpectrogramParameters()

notifyModelChanged

public void notifyModelChanged(int changeType)
Specified by:
notifyModelChanged in class UserFramePlots

internalFrameClosing

public void internalFrameClosing(InternalFrameEvent e)
Specified by:
internalFrameClosing in interface InternalFrameListener
Overrides:
internalFrameClosing in class UserFramePlots

noteNewSettings

public void noteNewSettings()
Specified by:
noteNewSettings in interface PamObserver

removeObservable

public void removeObservable(PamObservable o)
Description copied from interface: PamObserver
called when an Observable (PamDataBlock) is removed from the system

Specified by:
removeObservable in interface PamObserver

getCurrentXPixel

public double getCurrentXPixel()
Description copied from interface: DisplayPanelContainer
current pixel (need not be integer !

Specified by:
getCurrentXPixel in interface DisplayPanelContainer

getCurrentXTime

public long getCurrentXTime()
Description copied from interface: DisplayPanelContainer
get the time at the cursor in milliseconds

Specified by:
getCurrentXTime in interface DisplayPanelContainer

getXDuration

public double getXDuration()
Description copied from interface: DisplayPanelContainer
get the display duration in milliseconds

Specified by:
getXDuration in interface DisplayPanelContainer

panelNotify

public void panelNotify(int noteType)
Description copied from interface: DisplayPanelContainer
notification from a display panel that it's necessary to perform some action - such as redrawing axis.

Specified by:
panelNotify in interface DisplayPanelContainer

getFrameType

public int getFrameType()
Specified by:
getFrameType in class UserFramePlots

getSourceFFTDataBlock

public FFTDataBlock getSourceFFTDataBlock()

getSourceRawDataBlock

public PamRawDataBlock getSourceRawDataBlock()