clickDetector
Class ClickControl

java.lang.Object
  extended by PamController.PamControlledUnit
      extended by clickDetector.ClickControl
All Implemented Interfaces:
PamSettings

public class ClickControl
extends PamControlledUnit
implements PamSettings

Main Controller for click detection.

ClickControl contains both the detector and the display panel. It also contains information on Detection and Display menus which will get added to the main PamGuard menu.

Author:
Doug Gillespie

Nested Class Summary
(package private)  class ClickControl.BatchConverClkFiles
          Batch convert rainbow click files into the latest PAMGUARD binary format.
(package private)  class ClickControl.MapOptions
           
(package private)  class ClickControl.MenuClickClassification
           
(package private)  class ClickControl.MenuClickTrainId
           
private  class ClickControl.MenuDetection
           
(package private)  class ClickControl.MenuPreFilter
           
(package private)  class ClickControl.MenuStorageOptions
           
(package private)  class ClickControl.MenuTriggerFilter
           
 
Field Summary
protected  AngleVetoes angleVetoes
           
private  ClickClassifierManager classifierManager
           
protected  ClickControl clickControl
           
protected  ClickDetector clickDetector
           
private  ClickIdentifier clickIdentifier
           
protected  ClickTabPanel clickPanel
           
protected  ClickParameters clickParameters
           
protected  ClickSidePanel clickSidePanel
           
private  ClicksOffline clicksOffline
           
(package private)  javax.swing.JMenuBar clickTabMenu
           
protected  ClickTrainDetector clickTrainDetector
           
private  boolean developmentBranch
           
private  OfflineEventDataUnit latestOfflineEvent
           
private  boolean modelComplete
           
private  OfflineToolbar offlineToolbar
           
protected  javax.swing.JMenu rightMouseMenu
           
protected  ClickTabPanelControl tabPanelControl
           
protected  TrackedClickLocaliser trackedClickLocaliser
           
private  boolean viewerMode
           
 
Fields inherited from class PamController.PamControlledUnit
isViewer
 
Constructor Summary
ClickControl(java.lang.String name)
           
 
Method Summary
 void addOtherRelatedMenuItems(java.awt.Frame parentFrame, javax.swing.JMenu menu, java.lang.String name)
           
private  void batchConvertClicks(java.awt.Frame parentFrame)
          Batch convert RainbowClick files to the latest PAMGUARD binary format.
 boolean canClose()
          Called before Pamguard shuts down.
 boolean classificationDialog(java.awt.Frame pf)
          Opens the offline click dialog.
protected  void clickedOnClick(ClickDetection click)
           
 javax.swing.JMenu createDetectionMenu(java.awt.Frame parentFrame)
          Create a JMenu object containing MenuItems associated with PamProcesses
 javax.swing.JMenu createDisplayMenu(java.awt.Frame parentFrame)
          Create a JMenu object containing MenuItems associated with the view
 void deleteEvent(OfflineEventDataUnit event)
          Delete an offline event.
 void displayTriggerHistogram(TriggerHistogram[] triggerHistogram)
           
 ClickClassifierManager getClassifierManager()
           
 ClickDataBlock getClickDataBlock()
          Get the datablock containing click data
 ClickDetector getClickDetector()
           
 ClickIdentifier getClickIdentifier()
           
 ClickParameters getClickParameters()
           
 ClicksOffline getClicksOffline()
           
 OfflineEventDataUnit getLatestOfflineEvent()
           
 OfflineToolbar getOfflineToolbar()
           
 java.io.Serializable getSettingsReference()
           
 long getSettingsVersion()
           
 javax.swing.JMenuBar getTabSpecificMenuBar(java.awt.Frame parentFrame, javax.swing.JMenuBar standardMenu, PamGui pamGui)
          Create a tab specific menu to go with this PamControlledUnit.
 int getTrueChannelNumber(int iCh)
           
 void gotoEvent(OfflineEventDataUnit event)
          Scrolls the display to a specific event.
 boolean isDevelopmentBranch()
           
 boolean isViewerMode()
          Speedier way of knowing if it's viewer mode than going back to the controller every time
protected  void newRawData(PamObservable source, PamDataUnit data)
           
 void notifyArrayChanged()
          Called whenever the array configuration dialog has been called.
 void notifyModelChanged(int changeType)
          General notification when the PAMGAURD model changes.
 void notifyNewStorage(java.lang.String storageName)
           
 void offlineDataChanged()
          Called from clicksOffline when data have changed (eg from re doing click id).
 void pamStart()
           
 void pamStop()
           
 boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
           
 void secondTimer(long sampleNumber)
           
 void setClassifierManager(ClickClassifierManager classifierManager)
           
 void setClickIdentifier(ClickIdentifier clickIdentifier)
           
 void setClickParameters(ClickParameters clickParameters)
           
 void setLatestOfflineEvent(OfflineEventDataUnit latestOfflineEvent)
           
 void setupControlledUnit()
          called for all PamControlledUnits after all units have been created.
 void showOfflineEvents(java.awt.Frame frame)
          Show a list of offline events.
 
Methods inherited from class PamController.PamControlledUnit
addPamProcess, addRelatedMenuItems, createFileMenu, createHelpMenu, fillXMLElement, fillXMLParameters, getFrameNumber, getNumPamProcesses, getPamController, getPamModuleInfo, getPamProcess, getPamView, getSidePanel, getTabClipCopier, getTabPanel, getUnitName, getUnitType, gotoTab, pamHasStopped, pamToStart, removePamProcess, removeUnit, rename, saveViewerData, setFrameNumber, setPamController, setPamModuleInfo, setPamView, setSidePanel, setTabPanel, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface PamController.PamSettings
getUnitName, getUnitType
 

Field Detail

clickDetector

protected ClickDetector clickDetector

clickTrainDetector

protected ClickTrainDetector clickTrainDetector

trackedClickLocaliser

protected TrackedClickLocaliser trackedClickLocaliser

tabPanelControl

protected ClickTabPanelControl tabPanelControl

clickParameters

protected ClickParameters clickParameters

rightMouseMenu

protected javax.swing.JMenu rightMouseMenu

clickPanel

protected ClickTabPanel clickPanel

clickControl

protected ClickControl clickControl

offlineToolbar

private OfflineToolbar offlineToolbar

clickSidePanel

protected ClickSidePanel clickSidePanel

angleVetoes

protected AngleVetoes angleVetoes

clickIdentifier

private ClickIdentifier clickIdentifier

clicksOffline

private ClicksOffline clicksOffline

classifierManager

private ClickClassifierManager classifierManager

viewerMode

private boolean viewerMode

developmentBranch

private boolean developmentBranch

latestOfflineEvent

private OfflineEventDataUnit latestOfflineEvent

modelComplete

private boolean modelComplete

clickTabMenu

javax.swing.JMenuBar clickTabMenu
Constructor Detail

ClickControl

public ClickControl(java.lang.String name)
Method Detail

getClickDataBlock

public ClickDataBlock getClickDataBlock()
Get the datablock containing click data

Returns:
Click data block

isViewerMode

public boolean isViewerMode()
Speedier way of knowing if it's viewer mode than going back to the controller every time

Returns:

secondTimer

public void secondTimer(long sampleNumber)

getTrueChannelNumber

public int getTrueChannelNumber(int iCh)

displayTriggerHistogram

public void displayTriggerHistogram(TriggerHistogram[] triggerHistogram)

notifyNewStorage

public void notifyNewStorage(java.lang.String storageName)

createDetectionMenu

public javax.swing.JMenu createDetectionMenu(java.awt.Frame parentFrame)
Description copied from class: PamControlledUnit
Create a JMenu object containing MenuItems associated with PamProcesses

Overrides:
createDetectionMenu in class PamControlledUnit
Parameters:
parentFrame - The owner frame of the menu
Returns:
reference to a JMenu which can be added to an existing menu or menu bar

Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.


createDisplayMenu

public javax.swing.JMenu createDisplayMenu(java.awt.Frame parentFrame)
Description copied from class: PamControlledUnit
Create a JMenu object containing MenuItems associated with the view

Overrides:
createDisplayMenu in class PamControlledUnit
Returns:
reference to a JMenu which can be added to an existing menu or menu bar

Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.


notifyModelChanged

public void notifyModelChanged(int changeType)
Description copied from class: PamControlledUnit
General notification when the PAMGAURD model changes.

Overrides:
notifyModelChanged in class PamControlledUnit
Parameters:
changeType - type of change

notifyArrayChanged

public void notifyArrayChanged()
Description copied from class: PamControlledUnit
Called whenever the array configuration dialog has been called.

Overrides:
notifyArrayChanged in class PamControlledUnit

classificationDialog

public boolean classificationDialog(java.awt.Frame pf)
Opens the offline click dialog.

Parameters:
pf - frame
Returns:
Returns true if settings have changed

batchConvertClicks

private void batchConvertClicks(java.awt.Frame parentFrame)
Batch convert RainbowClick files to the latest PAMGUARD binary format.

Parameters:
parentFrame - parent frame for dialog.

getClickDetector

public ClickDetector getClickDetector()

newRawData

protected void newRawData(PamObservable source,
                          PamDataUnit data)

pamStart

public void pamStart()

pamStop

public void pamStop()

canClose

public boolean canClose()
Description copied from class: PamControlledUnit
Called before Pamguard shuts down. Rather than returning false, this function can be used as a final oportunity to save settings, write to the database, etc.

Overrides:
canClose in class PamControlledUnit
Returns:
true if OK for Pamguard to shut down, false otherwise.

getSettingsVersion

public long getSettingsVersion()
Specified by:
getSettingsVersion in interface PamSettings
Returns:
An integer version number for the settings

getSettingsReference

public java.io.Serializable getSettingsReference()
Specified by:
getSettingsReference in interface PamSettings
Returns:
The serialisable object that will be stored

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

getTabSpecificMenuBar

public javax.swing.JMenuBar getTabSpecificMenuBar(java.awt.Frame parentFrame,
                                                  javax.swing.JMenuBar standardMenu,
                                                  PamGui pamGui)
Description copied from class: PamControlledUnit
Create a tab specific menu to go with this PamControlledUnit.

Default is to throw back the standard menu to be used. This function should clone the standard menu and then modify the clone (usually by replacing the Display sub menu)

Overrides:
getTabSpecificMenuBar in class PamControlledUnit
standardMenu - the standard menu for the Pam GUI.
Returns:
a complete menu bar to be shown while a particular tab is selected

addOtherRelatedMenuItems

public void addOtherRelatedMenuItems(java.awt.Frame parentFrame,
                                     javax.swing.JMenu menu,
                                     java.lang.String name)
Overrides:
addOtherRelatedMenuItems in class PamControlledUnit

clickedOnClick

protected void clickedOnClick(ClickDetection click)

setupControlledUnit

public void setupControlledUnit()
Description copied from class: PamControlledUnit
called for all PamControlledUnits after all units have been created. This is a good time for the controlled units and processes to find and check their source data and the configuration generally since most onjects (i.e. output data blocks) should be in place

Overrides:
setupControlledUnit in class PamControlledUnit

getClickIdentifier

public ClickIdentifier getClickIdentifier()

setClickIdentifier

public void setClickIdentifier(ClickIdentifier clickIdentifier)

setClassifierManager

public void setClassifierManager(ClickClassifierManager classifierManager)
Parameters:
classifierManager - the classifierManager to set

getClassifierManager

public ClickClassifierManager getClassifierManager()
Returns:
the classifierManager

getClickParameters

public ClickParameters getClickParameters()

setClickParameters

public void setClickParameters(ClickParameters clickParameters)

offlineDataChanged

public void offlineDataChanged()
Called from clicksOffline when data have changed (eg from re doing click id). Needs to notify the display and maybe some other classes.


getOfflineToolbar

public OfflineToolbar getOfflineToolbar()

getClicksOffline

public ClicksOffline getClicksOffline()
Returns:
the clicksOffline

isDevelopmentBranch

public boolean isDevelopmentBranch()
Returns:
the developmentBranch

getLatestOfflineEvent

public OfflineEventDataUnit getLatestOfflineEvent()
Returns:
the latestOfflineEvent

setLatestOfflineEvent

public void setLatestOfflineEvent(OfflineEventDataUnit latestOfflineEvent)
Parameters:
latestOfflineEvent - the latestOfflineEvent to set

showOfflineEvents

public void showOfflineEvents(java.awt.Frame frame)
Show a list of offline events. Later on will add more functionality to it.

Parameters:
frame -

gotoEvent

public void gotoEvent(OfflineEventDataUnit event)
Scrolls the display to a specific event.

Parameters:
event - event to scroll to

deleteEvent

public void deleteEvent(OfflineEventDataUnit event)
Delete an offline event. Un-assign all clicks and delete from datablock, ready for deletion from database.

Parameters:
event - event to delete.