Package Spectrogram
Class SpectrogramDisplay
java.lang.Object
Layout.PamFramePlots
userDisplay.UserFramePlots
Spectrogram.SpectrogramDisplay
- All Implemented Interfaces:
EventListener
,InternalFrameListener
,DisplayPanelContainer
,PamSettings
,SettingsNameProvider
,LoadObserver
,PamObserver
,SpectrogramParametersUser
public class SpectrogramDisplay
extends UserFramePlots
implements PamObserver, LoadObserver, InternalFrameListener, DisplayPanelContainer, SpectrogramParametersUser, PamSettings
-
Field Summary
Fields inherited from class userDisplay.UserFramePlots
FRAME_TYPE_RADAR, FRAME_TYPE_SPECTROGRAM
Fields inherited from interface Layout.DisplayPanelContainer
DRAW_BORDER
-
Constructor Summary
ConstructorDescriptionSpectrogramDisplay
(UserDisplayControl userDisplayControl, SpectrogramDisplayComponent specDisplayComponent, SpectrogramParameters oldSpecParameters) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addData
(PamObservable obs, PamDataUnit newData) Informs the PamObserver that new data have been added to the Observable classvoid
Checks the frequency range range to be displayed.void
Called whenever the display size changes so that buffered images can be recreated.double
Get the current X pixel in screen (not image) coordinates.long
Get the current time, i.e.getDataSelectorName
(int panelId) int
int
int
Width of the window thats being drawn on - not the number of pixels, though these may often be the same.int
getName()
Get a unique name for the displaygetOverlayDataInfo
(PamDataBlock dataBlock, int panelId) long
Required data history depends on what's happening with the mouse.long
double
get the display duration in millisecondsvoid
void
masterClockUpdate
(long milliSeconds, long sampleNumber) void
void
notifyModelChanged
(int changeType) void
void
panelNotify
(int noteType) notification from a display panel that it's necessary to perform some action - such as redrawing axis.void
Should receive play commands from the top toolbar.void
receiveSourceNotification
(int type, Object object) Receive a notification from the data source - typically a change in DAQ status.void
called when an Observable (PamDataBlock) is removed from the systemvoid
boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) void
Called when amplitude range is changed on the hiding amplitude range slider.void
setLoadStatus
(int loadState) void
setParams
(SpectrogramParameters newParameters, boolean fullLayout) void
setSampleRate
(float sampleRate, boolean notify) New sample ratevoid
void
setSpectrogramParameters
(SpectrogramParameters spectrogramParameters) void
specMouseOffline
(Spectrogram.SpectrogramDisplay.SpectrogramPanel spectrogramPanel, Point point) Called when the spectrogrammouse is moved or pressed in viewer mode.void
updateData
(PamObservable observable, PamDataUnit pamDataUnit) Informs the PamObserver that existing data have been updatedboolean
Methods inherited from class userDisplay.UserFramePlots
getUserFrameParameters, internalFrameActivated, internalFrameClosed, internalFrameDeactivated, internalFrameDeiconified, internalFrameIconified, internalFrameOpened, setUserFrameParameters
Methods inherited from class Layout.PamFramePlots
checkDualDisplay, getAxisPanel, getCopyMenuItem, getEastPanel, getFrame, getLeftPlotPanel, getNorthPanel, getPlotPanel, getRightPlotPanel, getSouthPanel, getWestPanel, repaint, setAxisPanel, setEastPanel, setFrame, setLeftPlotPanel, setNorthPanel, setPlotPanel, setRightPlotPanel, setSouthPanel, setWestPanel
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.swing.event.InternalFrameListener
internalFrameActivated, internalFrameClosed, internalFrameDeactivated, internalFrameDeiconified, internalFrameIconified, internalFrameOpened
-
Field Details
-
mousePressedButton
public int mousePressedButton
-
-
Constructor Details
-
SpectrogramDisplay
public SpectrogramDisplay(UserDisplayControl userDisplayControl, SpectrogramDisplayComponent specDisplayComponent, SpectrogramParameters oldSpecParameters)
-
-
Method Details
-
getObserverObject
- Specified by:
getObserverObject
in interfacePamObserver
- 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
Description copied from class:PamFramePlots
Get a unique name for the display- Overrides:
getName
in classUserFramePlots
- 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
-
getFullTitle
-
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 interfacePamObserver
- Parameters:
notify
- Notify other PamObservers and PamObservables in the chain.
-
masterClockUpdate
public void masterClockUpdate(long milliSeconds, long sampleNumber) - Specified by:
masterClockUpdate
in interfacePamObserver
-
PamToStart
public void PamToStart() -
getRequiredDataHistory
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 interfacePamObserver
- Parameters:
arg
- optional argument from PamObservable- Returns:
- time in milliseconds required by data held in PamObservable
- See Also:
-
getObserverName
- Specified by:
getObserverName
in interfacePamObserver
-
addData
Description copied from interface:PamObserver
Informs the PamObserver that new data have been added to the Observable class- Specified by:
addData
in interfacePamObserver
-
updateData
Description copied from interface:PamObserver
Informs the PamObserver that existing data have been updated- Specified by:
updateData
in interfacePamObserver
-
receiveSourceNotification
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 interfacePamObserver
- Parameters:
type
- the type of changeobject
- generic object added here so that we can include anything in the future
-
setLoadStatus
public void setLoadStatus(int loadState) - Specified by:
setLoadStatus
in interfaceLoadObserver
-
setSettings
public void setSettings() -
getSpectrogramParameters
- Specified by:
getSpectrogramParameters
in interfaceSpectrogramParametersUser
-
setSpectrogramParameters
- Specified by:
setSpectrogramParameters
in interfaceSpectrogramParametersUser
-
getFFTDataBlock
- Specified by:
getFFTDataBlock
in interfaceSpectrogramParametersUser
-
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 classUserFramePlots
-
internalFrameClosing
- Specified by:
internalFrameClosing
in interfaceInternalFrameListener
- Overrides:
internalFrameClosing
in classUserFramePlots
-
noteNewSettings
public void noteNewSettings()- Specified by:
noteNewSettings
in interfacePamObserver
-
removeObservable
Description copied from interface:PamObserver
called when an Observable (PamDataBlock) is removed from the system- Specified by:
removeObservable
in interfacePamObserver
-
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 interfaceDisplayPanelContainer
-
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 interfaceDisplayPanelContainer
-
wrapDisplay
public boolean wrapDisplay()- Specified by:
wrapDisplay
in interfaceDisplayPanelContainer
- 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 interfaceDisplayPanelContainer
- 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 interfaceDisplayPanelContainer
-
getFrameType
public int getFrameType()- Specified by:
getFrameType
in classUserFramePlots
-
getSourceFFTDataBlock
-
getSourceRawDataBlock
-
playViewerSound
public void playViewerSound()Should receive play commands from the top toolbar. -
getColourArray
- Returns:
- the colourArray
-
getUnitName
- Specified by:
getUnitName
in interfaceSettingsNameProvider
- Returns:
- the overlayMarker
-
getUnitType
- Specified by:
getUnitType
in interfacePamSettings
- Returns:
- A Name specific to the type, e.g. Click detector
-
getSettingsReference
- Specified by:
getSettingsReference
in interfacePamSettings
- Returns:
- The serialisable object that will be stored
-
getSettingsVersion
public long getSettingsVersion()- Specified by:
getSettingsVersion
in interfacePamSettings
- Returns:
- An integer version number for the settings
-
restoreSettings
- Specified by:
restoreSettings
in interfacePamSettings
- 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
-
getOverlayDataInfo
-