clickDetector
Class ClickSpectrum

java.lang.Object
  extended by Layout.PamFramePlots
      extended by clickDetector.ClickDisplay
          extended by clickDetector.ClickSpectrum
All Implemented Interfaces:
PamSettings, PamObserver

public class ClickSpectrum
extends ClickDisplay
implements PamObserver, PamSettings


Nested Class Summary
private  class ClickSpectrum.LogScale
           
(package private)  class ClickSpectrum.MouseFuncs
           
private  class ClickSpectrum.PlotOptions
           
(package private)  class ClickSpectrum.SpectrumAxis
           
(package private)  class ClickSpectrum.SpectrumInfo
           
(package private)  class ClickSpectrum.SpectrumPlot
           
 
Field Summary
private  PamAxis amplitudeAxis
           
private  ClickControl clickControl
           
private  ClickSpectrumParams clickSpectrumParams
           
private  PamLabel cursorPos
           
private  PamAxis frequencyAxis
           
private  double[][] logSpectrum
           
private  ClickSpectrum.SpectrumAxis spectrumAxisPanel
           
private  ClickSpectrum.SpectrumInfo spectrumInfo
           
private  ClickSpectrum.SpectrumPlot spectrumPlotPanl
           
private  ClickDetection storedClick
           
private  double[][] storedSpectrum
           
private  java.lang.Object storedSpectrumLock
           
 
Fields inherited from class clickDetector.ClickDisplay
clickDisplayInfo, clickDisplayManager
 
Constructor Summary
ClickSpectrum(ClickControl clickControl, ClickDisplayManager clickDisplayManager, ClickDisplayManager.ClickDisplayInfo clickDisplayInfo)
           
 
Method Summary
 void clickedOnClick(ClickDetection click)
           
 java.lang.String getName()
           
 java.lang.String getObserverName()
           
 PamObserver getObserverObject()
           
 long getRequiredDataHistory(PamObservable o, java.lang.Object arg)
           
 java.io.Serializable getSettingsReference()
           
 long getSettingsVersion()
           
 java.lang.String getUnitName()
           
 java.lang.String getUnitType()
           
 void masterClockUpdate(long milliSeconds, long sampleNumber)
           
 void newClick(ClickDetection newClick)
           
 void noteNewSettings()
           
private  void plotOptions()
           
 void removeObservable(PamObservable o)
          called when an Observable (PamDataBlock) is removed from the system
 boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
           
 void setSampleRate(float sampleRate, boolean notify)
          New sample rate
private  void showClick(ClickDetection newClick)
           
private  void sortWestAxis()
           
 void update(PamObservable o, PamDataUnit arg)
          Informs the PamObserver that new data have been added to the Observable class
 
Methods inherited from class clickDetector.ClickDisplay
created, getClickDisplayInfo, offlineDataChanged, pamStart
 
Methods inherited from class Layout.PamFramePlots
getAxisPanel, getCopyMenuItem, getEastPanel, getFrame, getNorthPanel, getPlotPanel, getSouthPanel, getWestPanel, 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
 

Field Detail

clickControl

private ClickControl clickControl

spectrumAxisPanel

private ClickSpectrum.SpectrumAxis spectrumAxisPanel

spectrumPlotPanl

private ClickSpectrum.SpectrumPlot spectrumPlotPanl

spectrumInfo

private ClickSpectrum.SpectrumInfo spectrumInfo

cursorPos

private PamLabel cursorPos

frequencyAxis

private PamAxis frequencyAxis

amplitudeAxis

private PamAxis amplitudeAxis

storedClick

private ClickDetection storedClick

storedSpectrum

private double[][] storedSpectrum

logSpectrum

private double[][] logSpectrum

clickSpectrumParams

private ClickSpectrumParams clickSpectrumParams

storedSpectrumLock

private java.lang.Object storedSpectrumLock
Constructor Detail

ClickSpectrum

public ClickSpectrum(ClickControl clickControl,
                     ClickDisplayManager clickDisplayManager,
                     ClickDisplayManager.ClickDisplayInfo clickDisplayInfo)
Method Detail

getObserverObject

public PamObserver getObserverObject()
Specified by:
getObserverObject in interface PamObserver
Returns:
the actual observer. In most cases concrete classes will just return 'this' in response. The exception is the Threaded observer, which will return the single thread observer.

sortWestAxis

private void sortWestAxis()

plotOptions

private void plotOptions()

getName

public java.lang.String getName()
Specified by:
getName in class PamFramePlots

newClick

public void newClick(ClickDetection newClick)

showClick

private void showClick(ClickDetection newClick)

getObserverName

public java.lang.String getObserverName()
Specified by:
getObserverName in interface PamObserver

getRequiredDataHistory

public long getRequiredDataHistory(PamObservable o,
                                   java.lang.Object arg)
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

noteNewSettings

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

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

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

update

public void update(PamObservable o,
                   PamDataUnit arg)
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:
o - Reference to the Observable (a PamDataBlock)
arg - Reference to the new PamDataUnit

clickedOnClick

public void clickedOnClick(ClickDetection click)
Overrides:
clickedOnClick in class ClickDisplay

getSettingsReference

public java.io.Serializable getSettingsReference()
Specified by:
getSettingsReference in interface PamSettings
Returns:
The serialisable object that will be stored

getSettingsVersion

public long getSettingsVersion()
Specified by:
getSettingsVersion in interface PamSettings
Returns:
An integer version number for the settings

getUnitName

public java.lang.String getUnitName()
Specified by:
getUnitName in interface PamSettings
Returns:
A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.

getUnitType

public java.lang.String getUnitType()
Specified by:
getUnitType in interface PamSettings
Returns:
A Name specific to the type, e.g. Glick detector

restoreSettings

public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
Specified by:
restoreSettings in interface PamSettings
Returns:
true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required