Package Spectrogram

Class SpectrogramDisplay

All Implemented Interfaces:
EventListener, InternalFrameListener, DisplayPanelContainer, PamSettings, SettingsNameProvider, LoadObserver, PamObserver, SpectrogramParametersUser

  • Field Details

    • mousePressedButton

      public int mousePressedButton
  • Constructor Details

  • Method Details

    • 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.
    • getName

      public String getName()
      Description copied from class: PamFramePlots
      Get a unique name for the display
      Overrides:
      getName in class UserFramePlots
      Returns:
      a unique name for the display.
    • setAmplitudeParams

      public void setAmplitudeParams()
      Called when amplitude range is changed on the hiding amplitude range slider.
    • calcFrequencyRangeDisplay

      public void calcFrequencyRangeDisplay()
      Checks the frequency range range to be displayed.
    • setParams

      public void setParams(SpectrogramParameters newParameters, boolean fullLayout)
    • getFullTitle

      public String getFullTitle()
    • getFrameTitle

      public String getFrameTitle()
    • repaintAll

      public void repaintAll()
    • getFrozenImageWidth

      public int getFrozenImageWidth()
      Width of the window thats being drawn on - not the number of pixels, though these may often be the same.
      Returns:
      the width of the final rendered image in pixels
    • getDisplayWidth

      public int getDisplayWidth()
      Returns:
      With of the display panels in pixels.
    • getImageHeight

      public int getImageHeight()
      Returns:
      half the fft length. Always draw the full image then select a portion as it's rendered onto the screen (if zoomed).
    • createAllImages

      public void createAllImages()
      Called whenever the display size changes so that buffered images can be recreated.
    • setSampleRate

      public void setSampleRate(float sampleRate, boolean notify)
      Description copied from interface: PamObserver
      New sample rate
      Specified by:
      setSampleRate in interface PamObserver
      Parameters:
      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:
      arg - optional argument from PamObservable
      Returns:
      time in milliseconds required by data held in PamObservable
      See Also:
    • getObserverName

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

      public void addData(PamObservable obs, PamDataUnit newData)
      Description copied from interface: PamObserver
      Informs the PamObserver that new data have been added to the Observable class
      Specified by:
      addData in interface PamObserver
    • updateData

      public void updateData(PamObservable observable, PamDataUnit pamDataUnit)
      Description copied from interface: PamObserver
      Informs the PamObserver that existing data have been updated
      Specified by:
      updateData in interface PamObserver
    • receiveSourceNotification

      public void receiveSourceNotification(int type, Object object)
      Description copied from interface: PamObserver
      Receive a notification from the data source - typically a change in DAQ status. See the constants listed in AcquisitionProcess for potential change types.
      Specified by:
      receiveSourceNotification in interface PamObserver
      Parameters:
      type - the type of change
      object - generic object added here so that we can include anything in the future
    • setLoadStatus

      public void setLoadStatus(int loadState)
      Specified by:
      setLoadStatus in interface LoadObserver
    • setSettings

      public void setSettings()
    • getSpectrogramParameters

      public SpectrogramParameters getSpectrogramParameters()
      Specified by:
      getSpectrogramParameters in interface SpectrogramParametersUser
    • setSpectrogramParameters

      public void setSpectrogramParameters(SpectrogramParameters spectrogramParameters)
      Specified by:
      setSpectrogramParameters in interface SpectrogramParametersUser
    • getFFTDataBlock

      public FFTDataBlock getFFTDataBlock()
      Specified by:
      getFFTDataBlock in interface SpectrogramParametersUser
    • specMouseOffline

      public void specMouseOffline(Spectrogram.SpectrogramDisplay.SpectrogramPanel spectrogramPanel, Point point)
      Called when the spectrogrammouse is moved or pressed in viewer mode.
      Parameters:
      spectrogramPanel -
      point -
    • 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()
      Get the current X pixel in screen (not image) coordinates.
      In viewer mode, this is always 0; in normal operation, the following rules apply:
      If it's wrapping, then the current pixel is the current imagePos scaled by the ratio of the panel width to the image width.
      If it's scrolling, then it's just the panel width.
      Specified by:
      getCurrentXPixel in interface DisplayPanelContainer
    • getCurrentXTime

      public long getCurrentXTime()
      Get the current time, i.e. the time at the cursor in milliseconds. If there is a frozen image, this is the time of the when it was frozen.
      Specified by:
      getCurrentXTime in interface DisplayPanelContainer
    • wrapDisplay

      public boolean wrapDisplay()
      Specified by:
      wrapDisplay in interface DisplayPanelContainer
      Returns:
      true if the display wraps (rather than scrolls).
    • getXDuration

      public double getXDuration()
      Description copied from interface: DisplayPanelContainer
      get the display duration in milliseconds
      Specified by:
      getXDuration in interface DisplayPanelContainer
      Returns:
      the display length in milliseconds.
    • 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()
    • playViewerSound

      public void playViewerSound()
      Should receive play commands from the top toolbar.
    • getColourArray

      public ColourArray getColourArray()
      Returns:
      the colourArray
    • getUnitName

      public String getUnitName()
      Specified by:
      getUnitName in interface SettingsNameProvider
      Returns:
      the overlayMarker
    • getUnitType

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Returns:
      A Name specific to the type, e.g. Click detector
    • getSettingsReference

      public 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
    • 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
    • getDataSelectorName

      public String getDataSelectorName(int panelId)
    • getOverlayDataInfo

      public OverlayDataInfo getOverlayDataInfo(PamDataBlock dataBlock, int panelId)