Package rocca

Class RoccaSidePanel.SidePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ColorManaged
Enclosing class:
RoccaSidePanel

public class RoccaSidePanel.SidePanel extends PamBorderPanel
See Also:
  • Constructor Details

    • SidePanel

      public SidePanel()
  • Method Details

    • setBackground

      public void setBackground(Color bg)
      Overrides:
      setBackground in class PamPanel
    • drawThePanel

      public void drawThePanel()
    • enableButtons

      public void enableButtons()
      enable/disable the sighting scroll buttons, depending on where we are in the sighting list 2019/11/25 add a check of the current data unit. If it's been loaded from an old encounter stats file, don't let the user try to reclassify it. 2021/05/11 also disable the classify sightings button if we don't have any classifiers loaded
    • prevSighting

      public void prevSighting()
    • nextSighting

      public void nextSighting()
    • clearSpeciesCount

      public void clearSpeciesCount()
    • renameSightingAndFiles

      public void renameSightingAndFiles()
      Rename the sighting number and the files with that sighting number as well. This routine sets the current sighting number to NONE, and then calls the addASighting method. Since the current sighting number is NONE, addASighting will simply change the text of the current sighting instead of creating a whole new sighting.
    • saveSighting

      public void saveSighting()
      Save the sighting information immediately
    • classifySighting

      public void classifySighting()
      Run the current Sighting through the classifier if available, or classify based on the total tree votes for each species serialVersionUID=24 2016/08/10 added
    • createDetectionStatsHeader

      public String createDetectionStatsHeader()
      Creates a string containing the header information for the detection stats file serialVersionUID=15 2014/11/12 add time parameters to header serialVersionUID=22 2015/06/13 add overlap param to header and click/whistle count serialVersionUID=23 2016/01/04 removed spaces and paranethesis from header row, per ONR debrief doc serialVersionUID=24 2016/08/10 added latitude and longitude to output serialVersionUID=25 2017/04/10 added StartHr, PropWhists, PropClicks to output Note that RoccaClassifier.classifySighting searches the detectionHeader String for specific words. If the text ever changes here, it must be updated in the RoccaClassifier as well.
      Returns:
      a String containing the header
    • createDetectionStatsString

      public String createDetectionStatsString(RoccaSightingDataUnit unit)
      Creates a string containing the data for the passed detection. The data includes the detection number, the counts for the current species list, the tree votes for the current species list, a species list combined into a single column as a double-check against the column headers (in case the classifier has changed), and finally the detection classification

      Note that the loadSighting() method reads in the sighting stats information in the same order as shown here; if this format is changed, the loadSighting() method must be changed as well.

      serialVersionUID=15 2014/11/12 tell the data unit to calculate the time params and include them in the output

      serialVersionUID=22 2015/06/13 add overlap param to the timeParams list, and split into separate calls for whistles and clicks. serialVersionUID=24 2016/08/10 check if this encounter was originally loaded from a saved file. If so, just use the data that was recovered from it during the load (since all the underlying data necessary to calculate the ancillary variables is lost) Also, add latitude and longitude

      Parameters:
      unit - the RoccaSightingDataUnit to get the data from
      Returns:
      a string containing the current detection data
    • loadSighting

      public void loadSighting()
      Load the sighting information from an existing file. Note that this method assumes the csv file has the same format as the one specified in the (RoccaSightingDataUnit unit) createDetectionStatsString method. If the format in that method is ever changed, it should be changed here as well. Note also that this method does not check the existing datablock for duplicate sighting numbers. Since (at the moment) this method is only called to load a file when Pamguard starts and the datablock is empty, this isn't a problem.

      serialVersionUID=15 2014/11/12 include the time parameters THIS WAS NOT DONE!!!!! serialVersionUID=22 2015/06/13 include the time parameters (for real this time). Note that we don't load the time parameters, because there is no where to save them. We calculate them whenever we save the sighting stats files based on the start time and duration for each whistle in the sighting. THAT'S really the information we should save, but it would triple the memory requirements. For this method, we just need to skip over them in order to properly load the species tally and tree votes. serialVersionUID=24 2016/08/10 added the lat invalid input: '&' long parameters, so increased the column count by 2

    • deleteSighting

      public void deleteSighting()
      Delete a detection Currently untested and not attached to any buttons
    • addASighting

      public String addASighting(boolean duplicatesOk)
      Ask the user for a new sighting number, and add it to the side panel
      Parameters:
      duplicatesOk - Boolean indicating whether or not it's ok to use duplicate sighting numbers
      Returns:
      the new sighting number
    • addASighting

      public String addASighting(String newSNum)
      Add the new sighting number to the sidepanel
      Parameters:
      newSNum - the new sighting number to be used
      Returns:
      the sighting number
    • saveNewEncounterID

      public void saveNewEncounterID()
      Saves the Encounter ID text to the Rocca Parameters
    • saveNewSpeciesID

      public void saveNewSpeciesID()
      Saves the Known Species ID text to the Rocca Parameters