Class DataSelector

java.lang.Object
PamguardMVC.dataSelector.DataSelector
Direct Known Subclasses:
AnnotationDataSelector, ClickDataSelector, ClickTrainDataSelector, ClickTrainDataSelector2, CompoundDataSelector, ControlDataSelector, CPODDataSelector, CTDataSelector, DifarDataSelector, FormDataSelector, FormsDataSelector, Group3DDataSelector, RWDataSelector, SuperDetDataSelector, WMDDataSelector, WslClsDataSelector

public abstract class DataSelector extends Object
Standard classed which are attached to a datablock and can be used to select certain types of data unit (e.g. clicks of a particular type or whistles within a particular frequency band)
Author:
Doug Gillespie
  • Constructor Details

    • DataSelector

      public DataSelector(PamDataBlock pamDataBlock, String selectorName, boolean allowScores)
      Create a data selector for a DataBlock. If allowScores is true, then the selector MAY (but may not) offer a more complicated dialog panel that has score values for each thing selected rather than just yes / no's.
      Parameters:
      pamDataBlock -
      selectorName -
      allowScores -
  • Method Details

    • getSQLSelectClause

      public PAMSelectClause getSQLSelectClause(SQLTypes sqlTypes)
      Get a database clause which can be used with a database Query for this data type. These may easily end up in an inner join, so in the clause, spell out column names in full.
      Returns:
      a database clause.
    • setParams

      public abstract void setParams(DataSelectParams dataSelectParams)
      Set selection parameters from centralised storage.
      Parameters:
      dataSelectParams -
    • getParams

      public abstract DataSelectParams getParams()
      Get selection parameters for more organised centralised storage. This must never be null since all selectors have an enable / disable options added to them automatically in their dialogs.
      Returns:
    • getDialogPanel

      public abstract PamDialogPanel getDialogPanel()
      Returns:
      a dialog panel which can be used in a wider dialog
    • getDialogPaneFX

      public abstract DynamicSettingsPane<Boolean> getDialogPaneFX()
      Returns:
      a FX pane which can be used in a wider dialog
    • findDataSelector

      public DataSelector findDataSelector(Class selectorClass)
      Find a data selector within a data selector. This is primarily for use with ComoundDataSelector objects which may encapsulate multiple other selectors, particularly when annotations are in use. but it's needed here so that it can be called on any DataSelector object.
      Parameters:
      selectorClass - class to data selector to find.
      Returns:
      DataSelector or null if that class of data selector doesn't exist.
    • getMenuItem

      public JMenuItem getMenuItem(Window parentFrame, DataSelectorChangeListener changeListener)
      Get a menu item for the data selector that can be easily added to any other menu.
      Parameters:
      parentFrame -
      Returns:
      menu item
    • showSelectDialog

      public final boolean showSelectDialog(Window frame)
    • getDescription

      public String getDescription()
      Get descriptive text about the data selector which can be added to dialogs and other information panels.
      Returns:
      descriptive text. Default is a xml dump of params.
    • scoreData

      public abstract double scoreData(PamDataUnit pamDataUnit)
      Score a PAMDataUnit. this is used in preference to a boolean select function so that the user can add different return flags. Generally 0 indicates false.
      Parameters:
      pamDataUnit - - the input data unit.
      Returns:
      score of data out. 0 usually indicates false.
    • getPamDataBlock

      public PamDataBlock getPamDataBlock()
      Returns:
      the pamDataBlock
    • getSelectorName

      public String getSelectorName()
      This is the name used to identify the data selector in a hash table of all data selectors for a specific datablock so should be the unique name of the display in order that each display can use a different selection.
      Returns:
      the selectorName
    • getSelectorTitle

      public String getSelectorTitle()
      This is a title for the data selector which can be used in dialogs. This can be different to the name, since the name is generally the display, which we know anyway. Particularly with complicated compound data selectors, it's useful to have a more informative name for various sub-components.
      Returns:
      title to use in dialog components.
    • setSelectorTitle

      public void setSelectorTitle(String selectorTitle)
      This is a title for the data selector which can be used in dialogs. This can be different to the name, since the name is generally the display, which we know anyway. Particularly with complicated compound data selectors, it's useful to have a more informative name for various sub-components.
      Parameters:
      selectorTitle -
    • getLongSelectorName

      public String getLongSelectorName()
      Need a longer more unique name when making compound data selectors, particularly those which are pulling in multiple similar super detections which might be from different datablocks, but might be given the same name.
      Returns:
    • isAllowScores

      public boolean isAllowScores()
      Returns:
      the allowScores
    • getDialogButton

      public JButton getDialogButton(Window parentWindow)
      Create a settings type button that can be inserted into a larger dialog.
      Parameters:
      parentWindow -
    • getDialogButton

      public JButton getDialogButton(Window parentWindow, DataSelectorChangeListener changeListener)
      Create a settings type button that can be inserted into a larger dialog.
      Parameters:
      parentWindow -