Class SpeciesMapManager

java.lang.Object
tethys.species.SpeciesMapManager
All Implemented Interfaces:
PamSettings, SettingsNameProvider

public class SpeciesMapManager extends Object implements PamSettings
Master manager for species maps which will eventually allow for export and import from XML documents, databases and other things ...
Might be a problem for some batch task management having these so global and having datablocks in the external config that are not in the main model. Will move storage to individual datablocks and here simply have functions to gather all for some global output.
(Perhaps not as XML, will simply output the serialized map - easier.
Author:
dg50
  • Field Details Link icon

  • Method Details Link icon

    • getInstance Link icon

      public static SpeciesMapManager getInstance()
      Get an instance of the global species manager. This handles look up tables for each datablock to convert from internal PAMGuard names to ITIS species codes and usefully call types for output to Tethys.
      Returns:
    • getUnitName Link icon

      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 Link icon

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

      public Serializable getSettingsReference()
      Gathers species maps from datablocks using the default configuration.
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getSettingsReference Link icon

      public Serializable getSettingsReference(PamConfiguration pamConfiguration)
      Gathers species maps from datablocks using the given configuration (used in batch control)
      Parameters:
      pamConfiguration -
      Returns:
      serialised data for species maps.
    • gatherSpeciesMaps Link icon

      public void gatherSpeciesMaps()
      Get species maps from all PAMGuard datablocks which have such a map Nothing is ever removed from here, which probably matters.
    • gatherSpeciesMaps Link icon

      public void gatherSpeciesMaps(PamConfiguration configuration)
      Get species maps from all PAMGuard datablocks which have such a map Nothing is ever removed from here, which probably matters.
      Parameters:
      configuration - PAMGuard configuration if not the main one (used in batch processing job control)
    • getSpeciesMap Link icon

      public DataBlockSpeciesMap getSpeciesMap(PamDataBlock pamDataBlock)
    • getSettingsVersion Link icon

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

      public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
      Specified by:
      restoreSettings in interface PamSettings
      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
    • getExportAction Link icon

      public ActionListener getExportAction(Window parentFrame)
    • getImportAction Link icon

      public ActionListener getImportAction(Window parentFrame)
    • exportSpeciesMaps Link icon

      public boolean exportSpeciesMaps(Window parentFrame, String singleDataBlock)
      Export all species maps to a serialized object file.
      Parameters:
      parentFrame -
      singleDataBlock - name of datablock to automatically check.
      Returns:
    • importSpeciesMaps Link icon

      public boolean importSpeciesMaps(Window parentFrame, String selectedBlock)
      Import global species maps from selected file.
      Parameters:
      parentFrame -
      selectedBlock - specific block, which will get checked by default in the dialog. Can be null
      Returns: