Class DetectionPlotProjector

java.lang.Object
PamView.GeneralProjector<Coordinate3d>
detectionPlotFX.projector.DetectionPlotProjector

public class DetectionPlotProjector extends GeneralProjector<Coordinate3d>
The detection plot projector deals with all co-ordinate conversion from screen to the pixels and vice versa. This is a generic system throughout PAMGuard displays.

The detection plot projector holds four axis which can be accessed through the projector. Only the bottom and left axis are used by the super class GeneralProjector functions for co-ordinate conversion although function exist for the right and upper left axis too.

Author:
Jamie Macaulay
  • Field Details

    • minScrollLimit

      public double minScrollLimit
      The minimum limit of the scroll bar. In millis
    • maxScrollLimit

      public double maxScrollLimit
      The maximum limit of the scroll bar. i.e. the maximum value that can be scrolled to (e.g. the length of a waveform) In millis
    • enableScrollBar

      public boolean enableScrollBar
      True to enable the scroll bar.
  • Constructor Details

    • DetectionPlotProjector

      public DetectionPlotProjector(DDPlotPane dDPlotPane)
      Constructor for the projector.
  • Method Details

    • getAxis

      public PamAxisFX[] getAxis()
      Get all the axis of the plot pane.
      Returns:
      a list of axis in the order: TOP, RIGHT, BOTTOM, LEFT.
    • getAxis

      public PamAxisFX getAxis(javafx.geometry.Side side)
      Get a plot pane axis.
      Parameters:
      the - axis side. TOP, BOTTOM, LEFT or RIGHT.
      Returns:
      the associated PamAxisFX.
    • setAxisMinMax

      public void setAxisMinMax(double minVal, double maxVal, javafx.geometry.Side axis)
      Set the minimum and maximum value fo an axis
      Parameters:
      axis - - the axis
      min - - the minimum value in axis units.
      max - - the maximum value in axis units.
    • setAxisMinMax

      public void setAxisMinMax(double minVal, double maxVal, javafx.geometry.Side axis, String labels)
      Set the minimum and maximum values of the axis and labels.
      Parameters:
      minVal - - the minimum value in axis units.
      maxVal - - the maximum value in axis units.
    • setAxisInterval

      public void setAxisInterval(double interval, javafx.geometry.Side axis)
      Set the axis interval
      Parameters:
      minVal - - the minimum value in axis units.
    • setAxisLabel

      public void setAxisLabel(String string, javafx.geometry.Side axis)
      Set the axis label.
      Parameters:
      string - - the label
      axis - - the axis
    • setNumberPlots

      public void setNumberPlots(int numberplots)
      Sets the number of plots on the y axis. For example waveforms have multiple plots whilst a spectrum is usually plotted on the same plot.
      Parameters:
      numberplots - - the number of plots to set.
    • getCoord3d

      public Coordinate3d getCoord3d(double d1, double d2, javafx.geometry.Side topbottom, javafx.geometry.Side rightLeft)
      Get the pixel co-ordinates for two data points.
      Parameters:
      d1 - - the data point pn the x axis.
      d2 - - the data point on the y axis
      topbottom - - which axis to use for the x axis, the top or the bottom.
      rightLeft - - which axis to use for the y axis, the left or right.
      Returns:
      a Coordinate3d of the pixel locat5ion of d1 and d2.
    • getCoord3d

      public Coordinate3d getCoord3d(double d1, double d2, double d3, javafx.geometry.Side topbottom, javafx.geometry.Side rightLeft)
      Get the pixel co-ordinates for two data points.
      Parameters:
      d1 - - the data point on the x axis.
      d2 - - the data point on the y axis
      d3 - - the data point on the z axis. (currently not implemented)
      topbottom - - which axis to use for the x axis, the top or the bottom.
      rightLeft - - which axis to use for the y axis, the left or right.
      Returns:
      a Coordinate3d of the pixel locat5ion of d1 and d2.
    • getCoord3d

      public Coordinate3d getCoord3d(double d1, double d2, double d3)
      Description copied from class: GeneralProjector
      Function ultimately used by a PamDataBlock to convert it's own data, in whatever form that is in into screen coordinates.
      Specified by:
      getCoord3d in class GeneralProjector<Coordinate3d>
      Parameters:
      d1 - d2 and d3 are data representing whatever is appropriate for the concrete instance of the projector (e.g. Latitude, Longitude, depth, Time Frequency, etc)
      Returns:
      A 3 dimensional coordinate (realistically z is never currently used)
    • getCoord3d

      public Coordinate3d getCoord3d(Coordinate3d dataObject)
      Description copied from class: GeneralProjector
      Same as getCoordinate3d but using the generic type
      Specified by:
      getCoord3d in class GeneralProjector<Coordinate3d>
      Parameters:
      dataObject - object extending PamCoordinate
      Returns:
      3d coordinate.
    • getDataPosition

      public Coordinate3d getDataPosition(PamCoordinate screenPosition)
      Description copied from class: GeneralProjector
      Do the exact opposite of getCoord3d and turn a screen position back into a data coordinate (e.g. a time / freq, a lat long, etc)/.
      Specified by:
      getDataPosition in class GeneralProjector<Coordinate3d>
      Parameters:
      screenPosition - screen position
      Returns:
      data object.
    • getDataPosition

      public Coordinate3d getDataPosition(PamCoordinate screenPosition, javafx.geometry.Side topbottom, javafx.geometry.Side rightLeft)
      Do the exact opposite of getCoord3d and turn a screen position back into a data coordinate (e.g. a time / freq, a lat long, etc)/.
      Parameters:
      screenPosition - - the screen position in pixels
      topbottom - - which axis to use for the x axis, the top or the bottom.
      rightLeft - - which axis to use for the y axis, the left or right.
      Returns:
      a Coordinate3d with data position
    • getScrollAxisMinMax

      public double[] getScrollAxisMinMax()
      Get the current minimum and maximum axis values of the scroll axis. Note that these are not the scroll limits but the current values defined by the scroll bar.
      Returns:
      the minimum and maximum values of the scroll axis.
    • getMinScrollLimit

      public double getMinScrollLimit()
      Get the minimum limit of the scrollbar,
      Returns:
    • setMinScrollLimit

      public void setMinScrollLimit(double minScrollLimit)
    • getMaxScrollLimit

      public double getMaxScrollLimit()
    • setMaxScrollLimit

      public void setMaxScrollLimit(double maxScrollLimit)
    • isEnableScrollBar

      public boolean isEnableScrollBar()
    • setEnableScrollBar

      public void setEnableScrollBar(boolean enableScrollBar)
    • setScrollAxis

      public void setScrollAxis(javafx.geometry.Side top)
      Set the scroll axis. This is the axis that the scroll bar changes on the plot. If null then the scroll bar will not notify the axis. Note that the scroll bar has units of milliseconds and thus this axis must also have millisecond units. Otherwise strange things will happen!
      Parameters:
      top - - the scroll axis.
    • getScrollAxis

      public javafx.geometry.Side getScrollAxis()
      Get the scroll axis. This is the axis that the scroll bar changes on the plot. If null then the scroll bar will not notify the axis.
      Returns:
      - the scroll axis.