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 Details

    • mouseDown

      public boolean mouseDown
  • Constructor Details

  • Method Details

    • getClipDisplayProjector

      public ClipDisplayProjector getClipDisplayProjector()
      Returns:
      the clipDisplayProjector
    • removeClip

      public void removeClip(ClipDataUnit clipDataUnit)
      Remove the display component associated with a specific data unit.
      Parameters:
      clipDataUnit -
    • getUnitsPanel

      public JPanel 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

      public JPanel getDisplayPanel()
      Returns:
      the displayPanel
    • getColourArray

      public ColourArray getColourArray()
      Returns:
      the colourArray
    • setSampleRate

      public void setSampleRate(float sampleRate)
      Parameters:
      sampleRate - the sampleRate to set
    • getSampleRate

      public float getSampleRate()
      Returns:
      the sampleRate
    • mousePressed

      public void mousePressed(MouseEvent e, ClipDisplayUnit clipDisplayUnit)
      A notification from a ClipDisplayUnit that the mouse was pressed
      Parameters:
      e -
      clipDisplayUnit -
    • mouseReleased

      public void mouseReleased(MouseEvent e, ClipDisplayUnit clipDisplayUnit)
      A notification from a ClipDisplayUnit that the mouse was released
    • mouseClicked

      public void mouseClicked(MouseEvent e, ClipDisplayUnit clipDisplayUnit)
      A notification from a ClipDisplayUnit that the mouse was clicked
    • getHighlightedUnits

      public ArrayList<ClipDisplayUnit> getHighlightedUnits()
      Get a list of highlighted display units.
      Returns:
      lit of highlighted units.
    • getClipIndex

      public int getClipIndex(ClipDisplayUnit clipDisplayUnit)
      Get the index of a clip display unit.
      Parameters:
      clipDisplayUnit -
      Returns:
      index in display.
    • clearAllHighlights

      public void clearAllHighlights()
    • selectClipRange

      public void selectClipRange(ClipDisplayUnit firstClickedUnit, ClipDisplayUnit clipDisplayUnit)
      Select / highlight a range of units
      Parameters:
      clipDisplayUnit -
      firstClickedUnit2 -
    • displayControlChanged

      public void displayControlChanged(boolean needNewImage)
    • showPopupMenu

      public void showPopupMenu(MouseEvent e)
      Menu that allows colour chosing
      Parameters:
      e -
    • getClipDataProjector

      public ClipDataProjector getClipDataProjector()
      Returns:
      the spectrogramProjector
    • 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
    • getSymbolManager

      public PamSymbolManager getSymbolManager()
    • getSymbolChooser

      public PamSymbolChooser getSymbolChooser()
    • getUnitName

      public String getUnitName()
      Specified by:
      getUnitName in interface SettingsNameProvider
      Returns:
      A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
    • getUnitType

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Returns:
      A Name specific to the type, e.g. Click 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
    • getComponent

      public Component getComponent()
      Specified by:
      getComponent in interface UserDisplayComponent
      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 interface UserDisplayComponent
      Overrides:
      openComponent in class UserDisplayComponentAdapter
    • closeComponent

      public void closeComponent()
      Description copied from interface: UserDisplayComponent
      Called when the component is removed from the display.
      Specified by:
      closeComponent in interface UserDisplayComponent
      Overrides:
      closeComponent in class UserDisplayComponentAdapter
    • getClipDisplayParameters

      public ClipDisplayParameters getClipDisplayParameters()
      Returns:
      the clipDisplayParameters
    • getClipDisplayParent

      public ClipDisplayParent 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 interface UserDisplayComponent
      Overrides:
      notifyModelChanged in class UserDisplayComponentAdapter
    • getFrameTitle

      public String getFrameTitle()
      Description copied from interface: UserDisplayComponent
      Get a title for the frame the component will be added to.
      Specified by:
      getFrameTitle in interface UserDisplayComponent
      Overrides:
      getFrameTitle in class UserDisplayComponentAdapter
      Returns:
      a title for the components frame.
    • addPopupMenuItems

      public int addPopupMenuItems(JPopupMenu popupMenu, MouseEvent mouseEvent)
    • symbolUpdate

      public void symbolUpdate()
      Specified by:
      symbolUpdate in interface SymbolUpdateMonitor