Class MTClassifierControl

java.lang.Object
PamController.PamControlledUnit
matchedTemplateClassifer.MTClassifierControl
All Implemented Interfaces:
ClickTypeProvider, PamSettings, SettingsNameProvider

public class MTClassifierControl extends PamControlledUnit implements PamSettings, ClickTypeProvider
Classifier which classifies clicks.
Author:
Jamie Macaulay
  • Field Details

    • PROCESSING_START

      public static final int PROCESSING_START
      Flag for processing start
      See Also:
    • NEW_PARAMS

      public static final int NEW_PARAMS
      Flag to indicate a setup is required
      See Also:
    • PROCESSING_END

      public static final int PROCESSING_END
      See Also:
  • Constructor Details

    • MTClassifierControl

      public MTClassifierControl(String unitName)
  • Method Details

    • 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
    • setupClickClassifier

      public void setupClickClassifier()
      Currently the click detector has an integrated classifier and click detection type flags are integrated into this. Therefore to properly display flags in the click detectior display and generic time base displays a classifer needs to be set up in the click detector. This is a bit of a HACK for now. Currently we set the flag of this classifier to 101.
    • showSettingsDialog

      public void showSettingsDialog(Frame parentFrame)
      Show settings dialog.
      Parameters:
      parentFrame - - the frame.
    • 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
    • createDetectionMenu

      public JMenuItem createDetectionMenu(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.

    • getSettingsPane

      public MTSettingsPane getSettingsPane()
      Get the settings pane.
      Returns:
      the settings pane.
    • getMTParams

      public MatchedTemplateParams getMTParams()
      Get params for the controlled unit.
      Returns:
      the params.
    • getSettingsVersion

      public long getSettingsVersion()
      Specified by:
      getSettingsVersion in interface PamSettings
      Returns:
      An integer version number for the settings
    • 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
    • getUnitType

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Overrides:
      getUnitType in class PamControlledUnit
      Returns:
      A Name specific to the type, e.g. Click detector
    • getSettingsReference

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getParentDataBlock

      public PamDataBlock getParentDataBlock()
      Convenience function to get parent data block
      Returns:
      the parent data block.
    • getMTProcess

      public MTProcess getMTProcess()
      Get the MT process.
      Returns:
      the MT process.
    • update

      public void update(int processingFlag)
      Called whenever offline processing is occurring
      Parameters:
      processingFlag -
    • getSymbolData

      public SymbolData getSymbolData(byte clickType)
      Returns the symbol data for a classification type. If the type does not match the current type then null is returned.
      Parameters:
      clickType - - the click type.
      Returns:
      symbol data for the click type.
    • getSpeciesList

      public String[] getSpeciesList()
      Description copied from interface: ClickTypeProvider
      Get a list of species names.
      Specified by:
      getSpeciesList in interface ClickTypeProvider
      Returns:
      list speces names.
    • getCodeList

      public int[] getCodeList()
      Description copied from interface: ClickTypeProvider
      Returns a list of the currently-defined click types / species codes.
      Specified by:
      getCodeList in interface ClickTypeProvider
      Returns:
      int array with the codes
    • codeToListIndex

      public int codeToListIndex(int code)
      Description copied from interface: ClickTypeProvider
      Returns the index in the list for the click type.
      Specified by:
      codeToListIndex in interface ClickTypeProvider
      Parameters:
      code - - the click type code
      Returns:
      the index.
    • getSymbolsData

      public SymbolData[] getSymbolsData()
      Description copied from interface: ClickTypeProvider
      Get a list of symbols for each species corresponding to getSpeciesList.
      Specified by:
      getSymbolsData in interface ClickTypeProvider
      Returns:
      list of species symbols.
    • getOfflineMTProcess

      public MTOfflineProcess getOfflineMTProcess()
      The offline MT process.
      Returns:
      the offline mt process.
    • setMTParams

      public void setMTParams(MatchedTemplateParams newParams)
    • getGUI

      public PamControlledUnitGUI getGUI(int flag)
      Get the GUI for the PAMControlled unit. This has multiple GUI options which are instantiated depending on the view type.
      Overrides:
      getGUI in class PamControlledUnit
      Parameters:
      flag - . The GUI type flag defined in PAMGuiManager.
      Returns:
      the GUI for the PamControlledUnit unit.