Package rocca

Class RoccaSidePanel

All Implemented Interfaces:
PamObserver, PamSidePanel

public class RoccaSidePanel extends PamObserverAdapter implements PamSidePanel
  • Constructor Details Link icon

    • RoccaSidePanel Link icon

      public RoccaSidePanel(RoccaControl roccaControl)
  • Method Details Link icon

    • getRSDB Link icon

      public RoccaSightingDataBlock getRSDB()
    • setNewEncounterID Link icon

      public void setNewEncounterID()
      Updates the Encounter ID text box to the current Rocca Parameters value
    • setNewSpeciesID Link icon

      public void setNewSpeciesID()
      Updates the Known Species ID text box to the current Rocca Parameters value
    • getPanel Link icon

      public JComponent getPanel()
      Specified by:
      getPanel in interface PamSidePanel
      Returns:
      Reference to a graphics component that can be added to the view. This will typically be a JPanel or a JInternalFrame; The component will be displayed to the side of the main tab control.
    • rename Link icon

      public void rename(String newName)
      Specified by:
      rename in interface PamSidePanel
    • getObserverName Link icon

      public String getObserverName()
      Specified by:
      getObserverName in interface PamObserver
    • receiveSourceNotification Link icon

      public void receiveSourceNotification(int type, Object object)
      Description copied from interface: PamObserver
      Receive a notification from the data source - typically a change in DAQ status. See the constants listed in AcquisitionProcess for potential change types.
      Specified by:
      receiveSourceNotification in interface PamObserver
      Overrides:
      receiveSourceNotification in class PamObserverAdapter
      Parameters:
      type - the type of change
      object - generic object added here so that we can include anything in the future
    • setSpecies Link icon

      public void setSpecies(String[] speciesAsString)
      Creates a new list of species and sets the counts to 0. Repaints the sidepanel once the fields are updated
      Parameters:
      speciesAsString - a string array of species names (max 5 characters). Note that "Ambig" is automatically added to the beginning of the list, and should note be included in the speciesAsString parameter.
    • updateSightingClass Link icon

      public void updateSightingClass()
    • getSpeciesClassCount Link icon

      public int[] getSpeciesClassCount()
      Returns the classification counts for the current species list
      Returns:
      an int array containing the classification counts
    • setSpeciesClassCount Link icon

      public void setSpeciesClassCount(int[] speciesClassCount)
      Sets all the species counts.
      Parameters:
      speciesClassCount - an int array with the counts for each species. The length of the array must match the length of the species list
    • findSightingUnit Link icon

      public RoccaSightingDataUnit findSightingUnit(String sNum)
      Searches through the Sighting Data Block for the passed sighting number. If the sighting number is not found, a "-1" is returned
      Parameters:
      sNum - The sighting number to search for
      Returns:
      The RoccaSightingDataUnit matching the sighting number passed, or a new RoccaSightingDataUnit if the sighting number wasn't found found
    • incSpeciesCount Link icon

      public void incSpeciesCount(String sNum, int speciesToInc, double startTime, double dur, boolean isClick)
      Increments a specific species classification count serialVersionUID=15 2014/11/12 add start time to method, and pass to the RoccaSightingDataUnit. serialVersionUID = 22 2015/06/13 add duration and isClick flag to method
      Parameters:
      sNum - the sighting number to increment
      speciesToInc - the index of the species to increment
      startTime - the time of the first data unit, in milliseconds
      dur - the duration of the detection, in milliseconds
      isClick - a flag indicating whether the detection is a click or not
    • incSpeciesCount Link icon

      public void incSpeciesCount(String sNum, String speciesToInc, double startTime, double dur, boolean isClick)
      Increments a specific species classification count serialVersionUID=15 2014/11/12 add start time to method, and pass to the RoccaSightingDataUnit. serialVersionUID = 22 2015/06/13 add duration and click flag to method
      Parameters:
      sNum - the sighting number to increment
      speciesToInc - the index of the species to increment
      startTime - the time of the first data unit, in milliseconds
      dur - the duration of the detection, in milliseconds
      isClick - a flag indicating whether the detection is a click or not
    • addSpeciesTreeVotes Link icon

      public void addSpeciesTreeVotes(String sNum, double[] newTreeVotes)
      Finds the RoccaSightingDataUnit with the passed sighting number, and adds the tree votes to the running total. If the sighting number is not found, a new RoccaSightingDataUnit is created. serialVersionUID=24 2016/08/10 also set boolean indicating that there's new data in the list, so that the ancillary variables are recalculated on the next save
      Parameters:
      sNum - The sighting number to search for
      newTreeVotes - An array of tree votes
    • getSightingNum Link icon

      public String getSightingNum()
    • setStartOfWhistle Link icon

      public void setStartOfWhistle(long time, double freq)
    • setEndOfWhistle Link icon

      public void setEndOfWhistle(long time, double freq)
    • getAutosaveFreq Link icon

      public int getAutosaveFreq()
    • setAutosaveFreq Link icon

      public void setAutosaveFreq(int autosaveFreq)
      Note: this method changes the field, but does not update the timer. In order to adjust the period the old timer would need to be deleted and a new timer started. Could also use a ScheduledThreadPoolExecutor...
      Parameters:
      autosaveFreq -
    • setCurrentUnit Link icon

      public void setCurrentUnit(RoccaSightingDataUnit currentUnit)
    • getRequiredDataHistory Link icon

      public long getRequiredDataHistory(PamObservable o, Object arg)
      Specified by:
      getRequiredDataHistory in interface PamObserver
      Overrides:
      getRequiredDataHistory in class PamObserverAdapter
      Parameters:
      arg - optional argument from PamObservable
      Returns:
      time in milliseconds required by data held in PamObservable