Class TDDataInfo

java.lang.Object
dataPlots.data.TDDataInfo
Direct Known Subclasses:
ClickPlotInfo, CPODPlotinfo, D3PlotInfo, DifarBearingPlotInfo, DifarIntensityPlotInfo, SpectrogramPlotInfo, StandardBearingInfo, StandardDataInfo, WhistlePlotInfo

public abstract class TDDataInfo extends Object
Information about a type of data that can be displayed on any of the plots.
Life is complicated since many data types can display many different things, e.g. amplitude / bearing / ici, etc.
Therefore getDataUnits can return multiple types of units
Life is even more complicated since data cannot only be identified by their units, e.g. three channels of accelerometer data in dtag data.
Author:
Doug Gillespie
  • Field Details

  • Constructor Details

  • Method Details

    • getDataBlock

      public PamDataBlock getDataBlock()
      Get the datablock for this information
      Returns:
    • getDataValue

      public abstract Double getDataValue(PamDataUnit pamDataUnit)
      Gets a value for a specific data unit which should be in the same units as the scale information. This will then be converted into a plot position by the TDGraph.
      Parameters:
      pamDataUnit -
      Returns:
      data value or null if this data poit should not be plotted.
    • getDataLineInfos

      public ArrayList<DataLineInfo> getDataLineInfos()
      Short string names of the dimensions of the data. This will be something like Bearing, Angle, Amplitude, ICI, etc. Each graph will only be able to contain data which have the same units.
      Returns:
      name of the units for the data.
    • addDataUnits

      public void addDataUnits(DataLineInfo dataLineInfo)
      Add a type of data unit to the list.
      Parameters:
      unitType - String name of the data unit.
    • setCurrentAxisName

      public boolean setCurrentAxisName(String axisName)
      Set the current data units - this must be a String which matches one of the strings in dataLineInfos() or all will go horribly wrong.
      Parameters:
      AxisName -
    • hasAxisName

      public boolean hasAxisName(String axisName)
      Parameters:
      axisName -
      Returns:
      true if the data have a datalineinfo with the given name
    • getCurrentDataLine

      public DataLineInfo getCurrentDataLine()
      Returns:
      the name of the currently set data units.
    • getDataName

      public final String getDataName()
      A longer data name, more descriptive than the data units. Note that a single data block may have many different types of data it can plot !
      This is now taken only from the data provider so that they can remain matched up as settings are serialized and de-serialized.
      Returns:
      a name for the data.
    • getShortName

      public String getShortName()
      Get a shorter name for use in displays. This is used because a lot of the default names are quite long since they are based on standard datablock names.
      Returns:
      a short name for use in the display.
    • getDataProvider

      public final TDDataProvider getDataProvider()
      Returns:
      Get the data provider. References to this are needed when settings are serialised and de-serialised.
    • getScaleInformation

      public TDScaleInfo getScaleInformation(int orientation, boolean autoScale)
      Parameters:
      orientation -
      Returns:
      Information about the scales of the data.
    • getFixedScaleInformation

      public TDScaleInfo getFixedScaleInformation(int orientation)
      Returns:
      the fixedScaleInformation
    • setFixedScaleInformation

      public void setFixedScaleInformation(TDScaleInfo fixedScaleInformation)
      Parameters:
      fixedScaleInformation - the fixedScaleInformation to set
    • getDataDimensions

      public int getDataDimensions()
      Returns:
      1 or 2 for the data (lines are 1, things that will make a 3D plot, such as spectrograms, get 2.
    • getSymbolChooser

      public abstract TDSymbolChooser getSymbolChooser()
      Returns:
      a class containing functions to chose a symbol to plot.
    • getToolTipText

      public String getToolTipText(PamDataUnit pamDataUnit)
      Parameters:
      pamDataUnit - data unit
      Returns:
      text to display in tooltip if mouse hovered over symbol
    • clearDraw

      public void clearDraw()
      Clear any residual drawing objects that get held between calls, e.g. the point of the previous unit plotted which may have been held so that lines can be drawn between points.
    • drawData

      public void drawData(int plotNumber, Graphics g, Rectangle windowRect, int orientation, PamAxis timeAxis, long scrollStart, PamAxis graphAxis)
      Paint data into the graphics window.
      Parameters:
      plotNumber - plot number
      g - graphics
      windowRect - Window rectangle to draw in
      orientation - orientation
      graphAxis - graph data axis for scaling.
      pamAxis - scroll start time in milliseconds
      tScale - time scale in pixels per millisecond.
    • drawHighLightData

      public void drawHighLightData(int plotNumber, Graphics g, Rectangle windowRect, int orientation, PamAxis timeAxis, long scrollStart, PamAxis graphAxis)
      Draw highlighted data.
      Parameters:
      plotNumber -
      g -
      windowRect -
      orientation -
      timeAxis -
      scrollStart -
      graphAxis -
    • drawDataUnit

      public Polygon drawDataUnit(PamDataUnit pamDataUnit, Graphics g, Rectangle windowRect, int orientation, PamAxis timeAxis, long scrollStart, PamAxis yAxis, int type)
      Draw a data unit.
      Parameters:
      pamDataUnit - data unit to draw
      g - graphics handle to draw on
      windowRect -
      orientation - orientation of the display
      timeAxis - start time of the display
      yAxis - yAxis (used for scale information for the data point)
      type - flag for which type of symbol to draw. e.g normal or highlighted.
      timeScale - timescale in pixels per millisecond
      Returns:
      polygon of area drawn on.
    • selectDataLine

      public void selectDataLine(DataLineInfo dataLine)
      Called when the user selects a specific data line
      Parameters:
      dataLine -
    • getCurrentDataLineIndex

      public int getCurrentDataLineIndex()
      Returns:
      the currentDataLineIndex
    • hasOptions

      public boolean hasOptions()
      Has options that will result in a dialog.
      Returns:
      true if there are options.
    • editOptions

      public boolean editOptions(Window frame)
      Edit options - generally involves throwing up a dialog of some sort.
      Returns:
      true if options dialog OK button was pressed.
    • getHidingDialogComponent

      public HidingDialogComponent getHidingDialogComponent()
      Return a hiding dialog component which will get incorporated into a larger tabbed sliding dialog.
      Returns:
      sliding dialog component.
    • getTdGraph

      public TDGraph getTdGraph()
      Returns:
      the tdGraph
    • getStoredSettings

      public Serializable getStoredSettings()
      Get an object that will be packed up with the serialised settings when information about a plot get's stored.
      The Object MUST implement serializable and ideally also cloneable or it will go belly up !
      This only gets called when settings are to be saved so there is no need to keep parameters this returns up to date except right at settings save time (when this is called)
      Returns:
      serializable object to save.
    • setStoredSettings

      public boolean setStoredSettings(Serializable storedSettings)
      Set settings which have been read back from storage (the psf file). Assume these are of the right type and cast into whatever is needed !
      Parameters:
      storedSettings -
      Returns:
      true if all OK.
    • removeData

      public void removeData()
      Called whenever a data line is removed from a graph, or when a graph is removed from a plot.
      Is a good opportunity for the DataInfo to unsubscribe itself from any datablocks it might be observing.
    • timeScrollValueChanged

      public void timeScrollValueChanged(long valueMillis)
      Called in viewer mode when the time scroller moves.

      Most data won't need to do anything here since they are already subscribed to the scroller and will get their data loaded from psf automatically.

      Parameters:
      valueMillis - new scroll value in millis
    • timeScrollRangeChanged

      public void timeScrollRangeChanged(long minimumMillis, long maximumMillis)
      Called in viewer mode when the time scroll range moves.

      Most data won't need to do anything here since they are already subscribed to the scroller and will get their data loaded from psf automatically.

      Parameters:
      minimumMillis - new minimum in millis
      maximumMillis - new maximum in millis.
    • setShowing

      public void setShowing(boolean isShowing)
      Set whether or not it's showing in current graph window.
      Parameters:
      isShowing -
    • isShowing

      public boolean isShowing()
      Returns:
      the showing
    • timeRangeSpinnerChange

      public void timeRangeSpinnerChange(double oldValue, double newValue)
      Called when the time range spinner on the main display panel changes.
      Parameters:
      oldValue - old value (seconds)
      newValue - new value (seconds)
    • notifyModelChanged

      public void notifyModelChanged(int changeType)
      Get notifications from the main controller.
      Parameters:
      changeType -