PamguardMVC
Class RawDataDisplay.RawDisplayPanel

java.lang.Object
  extended by Layout.DisplayPanel
      extended by PamguardMVC.RawDataDisplay.RawDisplayPanel
All Implemented Interfaces:
PamSettings, PamObserver
Direct Known Subclasses:
TriggerFunctionDisplay.TriggerFunctionDisplayPanel
Enclosing class:
RawDataDisplay

public class RawDataDisplay.RawDisplayPanel
extends DisplayPanel
implements PamObserver, PamSettings

There may be several actual DisplayPanels if lots of different displays all want one. The outer class must keep a list of them all.

Author:
Doug Gillespie

Nested Class Summary
(package private)  class RawDataDisplay.RawDisplayPanel.OptionsListener
           
 
Field Summary
(package private)  RepeatedAxis eastAxis
           
(package private)  int lastPixel
           
(package private)  double maxMax
           
(package private)  javax.swing.JCheckBoxMenuItem menuAutoScale
           
(package private)  double minMin
           
(package private)  float sampleRate
          Implementation of PamObserver
(package private)  double scale
          do the drawing here to avoid problems with datablocks not all arriving at same time.
(package private)  RawDataDisplayOptions waveOptions
           
(package private)  RepeatedAxis westAxis
           
 
Fields inherited from class Layout.DisplayPanel
displayPanelContainer, displayPanelProvider, plotBackground
 
Constructor Summary
RawDataDisplay.RawDisplayPanel(DisplayPanelProvider displayPanelProvider, DisplayPanelContainer displayPanelContainer)
           
 
Method Summary
(package private)  void checkMenuItem()
           
 void containerNotification(DisplayPanelContainer displayContainer, int noteType)
          Not used - all timing is controlled by the arrival of new data blocks.
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.
protected  void drawSamples(java.awt.Graphics2D g2d, double[] wavData, int pixel, int startSample, int nSamples, int y0, double yScale)
           
 PamAxis getEastAxis()
           
 java.lang.String getObserverName()
           
 PamObserver getObserverObject()
           
 long getRequiredDataHistory(PamObservable o, java.lang.Object arg)
          Implementation of PamObserver
 java.io.Serializable getSettingsReference()
          Implementation of PamSettings
 long getSettingsVersion()
           
 java.lang.String getUnitName()
           
 java.lang.String getUnitType()
           
 PamAxis getWestAxis()
           
 void masterClockUpdate(long milliSeconds, long sampleNumber)
           
 void noteNewSettings()
          Implementation of PamObserver
 void removeObservable(PamObservable o)
          Implementation of PamObserver
 boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
           
protected  void setAxisRange(double range)
           
 void setSampleRate(float sampleRate, boolean notify)
          New sample rate
 void update(PamObservable o, PamDataUnit dataUnit)
          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, getInnerHeight, getInnerPanel, getInnerWidth, getNorthAxis, getPanel, getPanelBorder, getSouthAxis, repaint, repaint, setPanelBorder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

waveOptions

RawDataDisplayOptions waveOptions

westAxis

RepeatedAxis westAxis

eastAxis

RepeatedAxis eastAxis

menuAutoScale

javax.swing.JCheckBoxMenuItem menuAutoScale

sampleRate

float sampleRate
Implementation of PamObserver


scale

double scale
do the drawing here to avoid problems with datablocks not all arriving at same time.


minMin

double minMin

maxMax

double maxMax

lastPixel

int lastPixel
Constructor Detail

RawDataDisplay.RawDisplayPanel

public RawDataDisplay.RawDisplayPanel(DisplayPanelProvider displayPanelProvider,
                                      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.

getObserverName

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

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

checkMenuItem

void checkMenuItem()

getRequiredDataHistory

public long getRequiredDataHistory(PamObservable o,
                                   java.lang.Object arg)
Implementation of PamObserver

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()
Implementation of PamObserver

Specified by:
noteNewSettings in interface PamObserver

removeObservable

public void removeObservable(PamObservable o)
Implementation of PamObserver

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 dataUnit)
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)
dataUnit - Reference to the new PamDataUnit

setAxisRange

protected void setAxisRange(double range)

drawSamples

protected void drawSamples(java.awt.Graphics2D g2d,
                           double[] wavData,
                           int pixel,
                           int startSample,
                           int nSamples,
                           int y0,
                           double yScale)

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

containerNotification

public void containerNotification(DisplayPanelContainer displayContainer,
                                  int noteType)
Not used - all timing is controlled by the arrival of new data blocks.

Specified by:
containerNotification in class DisplayPanel

getSettingsReference

public java.io.Serializable getSettingsReference()
Implementation of PamSettings

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

getWestAxis

public PamAxis getWestAxis()
Overrides:
getWestAxis in class DisplayPanel

getEastAxis

public PamAxis getEastAxis()
Overrides:
getEastAxis in class DisplayPanel