Package dataPlots

Class TDControl

All Implemented Interfaces:
PamSettings, SettingsNameProvider, UserDisplayComponent

public class TDControl extends UserDisplayComponentAdapter implements PamSettings
  • Constructor Details

    • TDControl

      public TDControl(TDParameters tdParameters)
    • TDControl

      public TDControl(TDParameters tdParameters, boolean registerSettings)
    • TDControl

      public TDControl(TDParameters tdParameters, boolean registerSettings, boolean showControlPanel)
      Create a new time display.
      Parameters:
      tdParameters - - time display paramaters.
      registerSettings - - register settings or not.
      showControlPanel - - show a control panel on the graph allowing users to add/remnove panels.
    • TDControl

      public TDControl()
  • Method Details

    • subscribeScrollDataBlocks

      public void subscribeScrollDataBlocks()
      Subscribe datablocks to the time scroller.
      seems like a daft call sequence, but the time scroller will only hold one copy of each block, so if a block is removed, it may be that it shouldn't be removed - so easer just to remake the entire list every time
    • layoutGraphs

      public void layoutGraphs()
    • createScroller

      public PamScroller createScroller()
    • getComponent

      public Component getComponent()
      Specified by:
      getComponent in interface UserDisplayComponent
      Returns:
      The Swing component to add to the frame
    • openComponent

      public void openComponent()
      Description copied from interface: UserDisplayComponent
      Called when the component is first displayed.
      Specified by:
      openComponent in interface UserDisplayComponent
      Overrides:
      openComponent in class UserDisplayComponentAdapter
    • closeComponent

      public void closeComponent()
      Description copied from interface: UserDisplayComponent
      Called when the component is removed from the display.
      Specified by:
      closeComponent in interface UserDisplayComponent
      Overrides:
      closeComponent in class UserDisplayComponentAdapter
    • notifyModelChanged

      public void notifyModelChanged(int changeType)
      Description copied from interface: UserDisplayComponent
      Pick up model changed notifications from a parent user display.
      Specified by:
      notifyModelChanged in interface UserDisplayComponent
      Overrides:
      notifyModelChanged in class UserDisplayComponentAdapter
    • getTdParameters

      public TDParameters getTdParameters()
      Returns:
      the tdParameters
    • getTdAxes

      public TDAxes getTdAxes()
      Returns:
      the tdAxes
    • getRunMode

      public int getRunMode()
      Returns:
      the runMode
    • getTimeScroller

      public PamScroller getTimeScroller()
      Returns:
      the pamScroller
    • getGraphs

      public ArrayList<TDGraph> getGraphs()
      Returns:
      the graphs
    • repaintAll

      public void repaintAll()
    • repaintAll

      public void repaintAll(long millis)
    • getTimeRangeSpinner

      public RangeSpinner getTimeRangeSpinner()
      Returns:
      the timeRangeSpinner
    • addGraph

      public void addGraph()
    • removeGraph

      public void removeGraph(int iGraph)
      Remove graph with given index.
      Parameters:
      iGraph - graph index.
    • getUnitName

      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

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      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
    • 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
    • isViewer

      public boolean isViewer()
      Returns:
      the isViewer
    • getDataObserver

      public PamObserver getDataObserver()
    • getGraphTimePixels

      public int getGraphTimePixels()
      Get the number of pixels in a time graph. All should be the same, so just grab the first one.
      Returns:
      number of time pixels in the plots.
    • isShowControlPanel

      public boolean isShowControlPanel()
      Check whether the time display has a control panel.
      Returns:
      true if there is a control panel. False if not control panel is present.
    • setShowControlPanel

      public void setShowControlPanel(boolean showControlPanel)
      Set whether the graphs has a control panel, allowing panels etc to be added.
      Parameters:
      showControlPanel - - true to show a control panel.
    • setShowGraphLabels

      public void setShowGraphLabels(boolean show)
      Set whether graphs within the display show their label. Generally this is only to save a little space.
      Parameters:
      show - - true if graphs show a label describing graph on top right.
    • getPauseButton

      public JCheckBox getPauseButton()
      Get the pause button.
      Returns:
      the pause button for the graph.
    • getFrameTitle

      public String getFrameTitle()
      Description copied from interface: UserDisplayComponent
      Get a title for the frame the component will be added to.
      Specified by:
      getFrameTitle in interface UserDisplayComponent
      Overrides:
      getFrameTitle in class UserDisplayComponentAdapter
      Returns:
      a title for the components frame.