fftManager
Class FFTPluginPanelProvider.FFTPluginPanel

java.lang.Object
  extended by Layout.DisplayPanel
      extended by fftManager.FFTPluginPanelProvider.FFTPluginPanel
All Implemented Interfaces:
PamSettings, PamObserver
Enclosing class:
FFTPluginPanelProvider

public class FFTPluginPanelProvider.FFTPluginPanel
extends DisplayPanel
implements PamObserver, PamSettings


Nested Class Summary
private  class FFTPluginPanelProvider.FFTPluginPanel.AverageChannelSpectrum
           
(package private)  class FFTPluginPanelProvider.FFTPluginPanel.FFTPanelMouse
           
(package private)  class FFTPluginPanelProvider.FFTPluginPanel.OptionsListener
           
 
Field Summary
(package private)  AcquisitionProcess acquisitionProcess
           
(package private)  int[] channelNumToIndex
           
(package private)  long currentMillis
           
(package private)  FFTDataBlock fftDataBlock
           
private  FFTPluginPanelProvider fFTPluginPanelProvider
           
private  double frequencyScale
           
(package private)  double maxVal
           
(package private)  double minSpectrumVal
           
private  PamFFTProcess pamFFTProcess
           
private  FFTDataDisplayOptions plotOptions
           
(package private)  long previousMillis
           
(package private)  javax.swing.JMenuItem scaleMenuItem
           
private  PamAxis southAxis
           
(package private)  java.util.ArrayList<FFTPluginPanelProvider.FFTPluginPanel.AverageChannelSpectrum> spectraArrayList
           
(package private)  int tempCounter
           
(package private)  int[] updatesPerChannel
           
private  PamAxis westAxis
           
(package private)  int x0
           
(package private)  int x1
           
(package private)  int y0
           
(package private)  int y1
           
 
Fields inherited from class Layout.DisplayPanel
displayPanelContainer, displayPanelProvider, plotBackground
 
Constructor Summary
FFTPluginPanelProvider.FFTPluginPanel(FFTPluginPanelProvider fFTPluginPanelProvider, DisplayPanelContainer displayPanelContainer)
           
 
Method Summary
 void containerNotification(DisplayPanelContainer displayContainer, int noteType)
          Called by the DisplayPanelContainer whenever the scales change - e.g.
protected  javax.swing.JPopupMenu createPopupMenu()
          Create a popup menu.
 void destroyPanel()
          The displayPanelContainer should call destroyPanel when the panel is no longer required so that the displayPanel can unsubscribe to any data it was observing.
 java.lang.String getObserverName()
           
 PamObserver getObserverObject()
           
(package private)  int getPlottableChannels()
           
 long getRequiredDataHistory(PamObservable o, java.lang.Object arg)
           
private  double getScaleMax()
           
private  double getScaleMin()
           
 java.io.Serializable getSettingsReference()
           
 long getSettingsVersion()
           
 PamAxis getSouthAxis()
           
private  SpectrogramDisplay getSpectrogramDisplay()
           
 java.lang.String getUnitName()
           
 java.lang.String getUnitType()
           
 PamAxis getWestAxis()
           
 void masterClockUpdate(long milliSeconds, long sampleNumber)
           
 void noteNewSettings()
           
private  void prepareChannels()
           
 void removeObservable(PamObservable o)
          called when an Observable (PamDataBlock) is removed from the system
 boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
           
(package private)  void setAxisRange()
           
private  void setMousePosition(java.awt.Point pt)
           
 void setSampleRate(float sampleRate, boolean notify)
          New sample rate
private  void setupPanel()
           
private  void setupSouthAxis(float sampleRate)
           
(package private)  void showDialog()
           
 void update(PamObservable o, PamDataUnit arg)
          Informs the PamObserver that new data have been added to the Observable class
 
Methods inherited from class Layout.DisplayPanel
clearImage, clearImage, clearImage, getDisplayImage, getDisplayPanelContainer, getDisplayPanelProvider, getEastAxis, getInnerHeight, getInnerPanel, getInnerWidth, getNorthAxis, getPanel, getPanelBorder, repaint, repaint, setPanelBorder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fFTPluginPanelProvider

private FFTPluginPanelProvider fFTPluginPanelProvider

pamFFTProcess

private PamFFTProcess pamFFTProcess

fftDataBlock

FFTDataBlock fftDataBlock

plotOptions

private FFTDataDisplayOptions plotOptions

westAxis

private PamAxis westAxis

southAxis

private PamAxis southAxis

updatesPerChannel

int[] updatesPerChannel

tempCounter

int tempCounter

maxVal

double maxVal

minSpectrumVal

double minSpectrumVal

x0

int x0

y0

int y0

x1

int x1

y1

int y1

acquisitionProcess

AcquisitionProcess acquisitionProcess

previousMillis

long previousMillis

currentMillis

long currentMillis

channelNumToIndex

int[] channelNumToIndex

spectraArrayList

java.util.ArrayList<FFTPluginPanelProvider.FFTPluginPanel.AverageChannelSpectrum> spectraArrayList

scaleMenuItem

javax.swing.JMenuItem scaleMenuItem

frequencyScale

private double frequencyScale
Constructor Detail

FFTPluginPanelProvider.FFTPluginPanel

public FFTPluginPanelProvider.FFTPluginPanel(FFTPluginPanelProvider fFTPluginPanelProvider,
                                             DisplayPanelContainer displayPanelContainer)
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.

setupPanel

private void setupPanel()

getScaleMax

private double getScaleMax()

getScaleMin

private double getScaleMin()

getSpectrogramDisplay

private SpectrogramDisplay getSpectrogramDisplay()

getWestAxis

public PamAxis getWestAxis()
Overrides:
getWestAxis in class DisplayPanel

getPlottableChannels

int getPlottableChannels()

getSouthAxis

public PamAxis getSouthAxis()
Overrides:
getSouthAxis in class DisplayPanel

createPopupMenu

protected javax.swing.JPopupMenu createPopupMenu()
Description copied from class: DisplayPanel
Create a popup menu.

This should be overridden in any sub classes that want to present a menu for setting any display options.

Overrides:
createPopupMenu in class DisplayPanel
Returns:
reference to the popup menu for the display panel

showDialog

void showDialog()

prepareChannels

private void prepareChannels()

setAxisRange

void setAxisRange()

containerNotification

public void containerNotification(DisplayPanelContainer displayContainer,
                                  int noteType)
Description copied from class: DisplayPanel
Called by the DisplayPanelContainer whenever the scales change - e.g. every time new data is drawn on the spectrogram.

The display panel can use this information in two ways:

Firstly, it should clear the region of the display just ahead of the current spectrogram x coordinate. Secondly, it may draw additional data on the display.

Specified by:
containerNotification in class DisplayPanel

destroyPanel

public void destroyPanel()
Description copied from class: DisplayPanel
The displayPanelContainer should call destroyPanel when the panel is no longer required so that the displayPanel can unsubscribe to any data it was observing.

Specified by:
destroyPanel in class DisplayPanel

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

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.

setupSouthAxis

private void setupSouthAxis(float sampleRate)

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

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

setMousePosition

private void setMousePosition(java.awt.Point pt)