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
FieldsFields inherited from class userDisplay.UserFramePlots
FRAME_TYPE_RADAR, FRAME_TYPE_SPECTROGRAMFields inherited from interface Layout.DisplayPanelContainer
DRAW_BORDER - 
Constructor Summary
ConstructorsConstructorDescriptionSpectrogramDisplay(UserDisplayControl userDisplayControl, SpectrogramDisplayComponent specDisplayComponent, SpectrogramParameters oldSpecParameters)  - 
Method Summary
Modifier and TypeMethodDescriptionvoidaddData(PamObservable obs, PamDataUnit newData) Informs the PamObserver that new data have been added to the Observable classvoidChecks the frequency range range to be displayed.voidCalled whenever the display size changes so that buffered images can be recreated.protected booleandoubleGet the current X pixel in screen (not image) coordinates.longGet the current time, i.e.getDataSelectorName(int panelId) intintintWidth of the window thats being drawn on - not the number of pixels, though these may often be the same.intgetName()Get a unique name for the displaygetOverlayDataInfo(PamDataBlock dataBlock, int panelId) longRequired data history depends on what's happening with the mouse.longdoubleget the display duration in millisecondsvoidvoidmasterClockUpdate(long milliSeconds, long sampleNumber) voidvoidnotifyModelChanged(int changeType) voidvoidpanelNotify(int noteType) notification from a display panel that it's necessary to perform some action - such as redrawing axis.voidShould receive play commands from the top toolbar.voidreceiveSourceNotification(int type, Object object) Receive a notification from the data source - typically a change in DAQ status.voidcalled when an Observable (PamDataBlock) is removed from the systemvoidbooleanrestoreSettings(PamControlledUnitSettings pamControlledUnitSettings) voidCalled when amplitude range is changed on the hiding amplitude range slider.voidsetLoadStatus(int loadState) voidsetParams(SpectrogramParameters newParameters, boolean fullLayout) voidsetSampleRate(float sampleRate, boolean notify) New sample ratevoidvoidsetSpectrogramParameters(SpectrogramParameters spectrogramParameters) voidspecMouseOffline(Spectrogram.SpectrogramDisplay.SpectrogramPanel spectrogramPanel, Point point) Called when the spectrogrammouse is moved or pressed in viewer mode.voidupdateData(PamObservable observable, PamDataUnit pamDataUnit) Informs the PamObserver that existing data have been updatedbooleanMethods inherited from class userDisplay.UserFramePlots
getUserFrameParameters, internalFrameActivated, internalFrameClosed, internalFrameDeactivated, internalFrameDeiconified, internalFrameIconified, internalFrameOpened, setUserFrameParametersMethods 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, setWestPanelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.swing.event.InternalFrameListener
internalFrameActivated, internalFrameClosed, internalFrameDeactivated, internalFrameDeiconified, internalFrameIconified, internalFrameOpened 
- 
Field Details
- 
panelClipBoardCopier
 - 
mousePressedButton
public int mousePressedButton 
 - 
 - 
Constructor Details
- 
SpectrogramDisplay
public SpectrogramDisplay(UserDisplayControl userDisplayControl, SpectrogramDisplayComponent specDisplayComponent, SpectrogramParameters oldSpecParameters)  
 - 
 - 
Method Details
- 
getObserverObject
- Specified by:
 getObserverObjectin 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:PamFramePlotsGet a unique name for the display- Overrides:
 getNamein 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. - 
createColours
protected boolean createColours() - 
setSampleRate
public void setSampleRate(float sampleRate, boolean notify) Description copied from interface:PamObserverNew sample rate- Specified by:
 setSampleRatein interfacePamObserver- Parameters:
 sampleRate-notify- Notify other PamObservers and PamObservables in the chain.
 - 
masterClockUpdate
public void masterClockUpdate(long milliSeconds, long sampleNumber) - Specified by:
 masterClockUpdatein 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:
 getRequiredDataHistoryin interfacePamObserver- Parameters:
 arg- optional argument from PamObservable- Returns:
 - time in milliseconds required by data held in PamObservable
 - See Also:
 
 - 
getObserverName
- Specified by:
 getObserverNamein interfacePamObserver
 - 
addData
Description copied from interface:PamObserverInforms the PamObserver that new data have been added to the Observable class- Specified by:
 addDatain interfacePamObserver
 - 
updateData
Description copied from interface:PamObserverInforms the PamObserver that existing data have been updated- Specified by:
 updateDatain interfacePamObserver
 - 
receiveSourceNotification
Description copied from interface:PamObserverReceive a notification from the data source - typically a change in DAQ status. See the constants listed in AcquisitionProcess for potential change types.- Specified by:
 receiveSourceNotificationin 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:
 setLoadStatusin interfaceLoadObserver
 - 
setSettings
public void setSettings() - 
getSpectrogramParameters
- Specified by:
 getSpectrogramParametersin interfaceSpectrogramParametersUser
 - 
setSpectrogramParameters
- Specified by:
 setSpectrogramParametersin interfaceSpectrogramParametersUser
 - 
getFFTDataBlock
- Specified by:
 getFFTDataBlockin 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:
 notifyModelChangedin classUserFramePlots
 - 
internalFrameClosing
- Specified by:
 internalFrameClosingin interfaceInternalFrameListener- Overrides:
 internalFrameClosingin classUserFramePlots
 - 
noteNewSettings
public void noteNewSettings()- Specified by:
 noteNewSettingsin interfacePamObserver
 - 
removeObservable
Description copied from interface:PamObservercalled when an Observable (PamDataBlock) is removed from the system- Specified by:
 removeObservablein 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:
 getCurrentXPixelin 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:
 getCurrentXTimein interfaceDisplayPanelContainer
 - 
wrapDisplay
public boolean wrapDisplay()- Specified by:
 wrapDisplayin interfaceDisplayPanelContainer- Returns:
 - true if the display wraps (rather than scrolls).
 
 - 
getXDuration
public double getXDuration()Description copied from interface:DisplayPanelContainerget the display duration in milliseconds- Specified by:
 getXDurationin interfaceDisplayPanelContainer- Returns:
 - the display length in milliseconds.
 
 - 
panelNotify
public void panelNotify(int noteType) Description copied from interface:DisplayPanelContainernotification from a display panel that it's necessary to perform some action - such as redrawing axis.- Specified by:
 panelNotifyin interfaceDisplayPanelContainer- Parameters:
 noteType-
 - 
getFrameType
public int getFrameType()- Specified by:
 getFrameTypein classUserFramePlots
 - 
getSourceFFTDataBlock
 - 
getSourceRawDataBlock
 - 
playViewerSound
public void playViewerSound()Should receive play commands from the top toolbar. - 
getColourArray
- Returns:
 - the colourArray
 
 - 
getUnitName
- Specified by:
 getUnitNamein interfaceSettingsNameProvider- Returns:
 - the overlayMarker
 
 - 
getUnitType
- Specified by:
 getUnitTypein interfacePamSettings- Returns:
 - A Name specific to the type, e.g. Click detector
 
 - 
getSettingsReference
- Specified by:
 getSettingsReferencein interfacePamSettings- Returns:
 - The serialisable object that will be stored
 
 - 
getSettingsVersion
public long getSettingsVersion()- Specified by:
 getSettingsVersionin interfacePamSettings- Returns:
 - An integer version number for the settings
 
 - 
restoreSettings
- Specified by:
 restoreSettingsin interfacePamSettings- Parameters:
 pamControlledUnitSettings-- 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
 
 -