Package clipgenerator.clipDisplay
Class ClipDisplayPanel
java.lang.Object
userDisplay.UserDisplayComponentAdapter
clipgenerator.clipDisplay.ClipDisplayPanel
- All Implemented Interfaces:
PamSettings
,SettingsNameProvider
,SymbolUpdateMonitor
,UserDisplayComponent
public class ClipDisplayPanel
extends UserDisplayComponentAdapter
implements PamSettings, SymbolUpdateMonitor
Clip display panel. Can be incorporated into a tab panel or stand alone in
a general display.
- Author:
- Doug Gillespie
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
addPopupMenuItems
(JPopupMenu popupMenu, MouseEvent mouseEvent) void
void
Called when the component is removed from the display.void
displayControlChanged
(boolean needNewImage) int
getClipIndex
(ClipDisplayUnit clipDisplayUnit) Get the index of a clip display unit.Get a title for the frame the component will be added to.Get a list of highlighted display units.float
long
void
mouseClicked
(MouseEvent e, ClipDisplayUnit clipDisplayUnit) A notification from a ClipDisplayUnit that the mouse was clickedvoid
mousePressed
(MouseEvent e, ClipDisplayUnit clipDisplayUnit) A notification from a ClipDisplayUnit that the mouse was pressedvoid
mouseReleased
(MouseEvent e, ClipDisplayUnit clipDisplayUnit) A notification from a ClipDisplayUnit that the mouse was releasedvoid
newViewerTimes
(long start, long end) void
notifyModelChanged
(int changeType) Pick up model changed notifications from a parent user display.void
Called when the component is first displayed.void
void
removeClip
(ClipDataUnit clipDataUnit) Remove the display component associated with a specific data unit.boolean
restoreSettings
(PamControlledUnitSettings pamControlledUnitSettings) void
selectClipRange
(ClipDisplayUnit firstClickedUnit, ClipDisplayUnit clipDisplayUnit) Select / highlight a range of unitsvoid
setSampleRate
(float sampleRate) void
Menu that allows colour chosingvoid
void
update the panel layout.void
Methods inherited from class userDisplay.UserDisplayComponentAdapter
getUniqueName, setUniqueName
-
Field Details
-
mouseDown
public boolean mouseDown
-
-
Constructor Details
-
ClipDisplayPanel
-
-
Method Details
-
getClipDisplayProjector
- Returns:
- the clipDisplayProjector
-
removeClip
Remove the display component associated with a specific data unit.- Parameters:
clipDataUnit
-
-
getUnitsPanel
- Returns:
- the unitsPanel
-
removeAllClips
public void removeAllClips() -
newViewerTimes
public void newViewerTimes(long start, long end) -
updatePanelLater
public void updatePanelLater() -
updatePanel
public void updatePanel()update the panel layout. -
getDisplayPanel
- Returns:
- the displayPanel
-
getColourArray
- Returns:
- the colourArray
-
setSampleRate
public void setSampleRate(float sampleRate) - Parameters:
sampleRate
- the sampleRate to set
-
getSampleRate
public float getSampleRate()- Returns:
- the sampleRate
-
mousePressed
A notification from a ClipDisplayUnit that the mouse was pressed- Parameters:
e
-clipDisplayUnit
-
-
mouseReleased
A notification from a ClipDisplayUnit that the mouse was released -
mouseClicked
A notification from a ClipDisplayUnit that the mouse was clicked -
getHighlightedUnits
Get a list of highlighted display units.- Returns:
- lit of highlighted units.
-
getClipIndex
Get the index of a clip display unit.- Parameters:
clipDisplayUnit
-- Returns:
- index in display.
-
clearAllHighlights
public void clearAllHighlights() -
selectClipRange
Select / highlight a range of units- Parameters:
clipDisplayUnit
-firstClickedUnit2
-
-
displayControlChanged
public void displayControlChanged(boolean needNewImage) -
showPopupMenu
Menu that allows colour chosing- Parameters:
e
-
-
getClipDataProjector
- Returns:
- the spectrogramProjector
-
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
-
getSymbolManager
-
getSymbolChooser
-
getUnitName
- Specified by:
getUnitName
in interfaceSettingsNameProvider
- Returns:
- A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
-
getUnitType
- Specified by:
getUnitType
in interfacePamSettings
- Returns:
- A Name specific to the type, e.g. Click detector
-
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
-
getComponent
- Specified by:
getComponent
in interfaceUserDisplayComponent
- Returns:
- The Swing component to add to the frame
-
openComponent
public void openComponent()Description copied from interface:UserDisplayComponent
Called when the component is first displayed.- Specified by:
openComponent
in interfaceUserDisplayComponent
- Overrides:
openComponent
in classUserDisplayComponentAdapter
-
closeComponent
public void closeComponent()Description copied from interface:UserDisplayComponent
Called when the component is removed from the display.- Specified by:
closeComponent
in interfaceUserDisplayComponent
- Overrides:
closeComponent
in classUserDisplayComponentAdapter
-
getClipDisplayParameters
- Returns:
- the clipDisplayParameters
-
getClipDisplayParent
- Returns:
- the clipDisplayParent
-
notifyModelChanged
public void notifyModelChanged(int changeType) Description copied from interface:UserDisplayComponent
Pick up model changed notifications from a parent user display.- Specified by:
notifyModelChanged
in interfaceUserDisplayComponent
- Overrides:
notifyModelChanged
in classUserDisplayComponentAdapter
-
getFrameTitle
Description copied from interface:UserDisplayComponent
Get a title for the frame the component will be added to.- Specified by:
getFrameTitle
in interfaceUserDisplayComponent
- Overrides:
getFrameTitle
in classUserDisplayComponentAdapter
- Returns:
- a title for the components frame.
-
addPopupMenuItems
-
symbolUpdate
public void symbolUpdate()- Specified by:
symbolUpdate
in interfaceSymbolUpdateMonitor
-