Package detectionPlotFX.projector
Class DetectionPlotProjector
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
-
Nested Class Summary
Nested classes/interfaces inherited from class PamView.GeneralProjector
GeneralProjector.ParameterType, GeneralProjector.ParameterUnits
-
Field Summary
Modifier and TypeFieldDescriptionboolean
True to enable the scroll bar.double
The maximum limit of the scroll bar.double
The minimum limit of the scroll bar.Fields inherited from class PamView.GeneralProjector
NPARAMETERS
-
Constructor Summary
ConstructorDescriptionDetectionPlotProjector
(DDPlotPane dDPlotPane) Constructor for the projector. -
Method Summary
Modifier and TypeMethodDescriptiongetAxis()
Get all the axis of the plot pane.getAxis
(javafx.geometry.Side side) Get a plot pane axis.getCoord3d
(double d1, double d2, double d3) Function ultimately used by a PamDataBlock to convert it's own data, in whatever form that is in into screen coordinates.getCoord3d
(double d1, double d2, double d3, javafx.geometry.Side topbottom, javafx.geometry.Side rightLeft) Get the pixel co-ordinates for two data points.getCoord3d
(double d1, double d2, javafx.geometry.Side topbottom, javafx.geometry.Side rightLeft) Get the pixel co-ordinates for two data points.getCoord3d
(Coordinate3d dataObject) Same as getCoordinate3d but using the generic typegetDataPosition
(PamCoordinate screenPosition) Do the exact opposite of getCoord3d and turn a screen position back into a data coordinate (e.g.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.double
double
Get the minimum limit of the scrollbar,javafx.geometry.Side
Get the scroll axis.double[]
Get the current minimum and maximum axis values of the scroll axis.boolean
void
setAxisInterval
(double interval, javafx.geometry.Side axis) Set the axis intervalvoid
setAxisLabel
(String string, javafx.geometry.Side axis) Set the axis label.void
setAxisMinMax
(double minVal, double maxVal, javafx.geometry.Side axis) Set the minimum and maximum value fo an axisvoid
setAxisMinMax
(double minVal, double maxVal, javafx.geometry.Side axis, String labels) Set the minimum and maximum values of the axis and labels.void
setEnableScrollBar
(boolean enableScrollBar) void
setMaxScrollLimit
(double maxScrollLimit) void
setMinScrollLimit
(double minScrollLimit) void
setNumberPlots
(int numberplots) Sets the number of plots on the y axis.void
setScrollAxis
(javafx.geometry.Side top) Set the scroll axis.Methods inherited from class PamView.GeneralProjector
addHoverData, addHoverData, addHoverData, addHoverData, addHoverData, addHoverData, clearHoverList, findClosestDataUnitIndex, findClosestDataUnitIndex, getDataSelector, getHoverDataList, getHoverDataSynchroniser, getHoveredDataUnit, getHoverText, getHoverText, getMouseHoverAdapter, getPamSymbolChooser, getParameterTypes, getParameterUnits, getParmeterType, getParmeterUnits, getProjectorDrawingOptions, isViewer, setDataSelector, setPamSymbolChooser, setParmeterType, setParmeterUnits, setProjectorDrawingOptions
-
Field Details
-
minScrollLimit
public double minScrollLimitThe minimum limit of the scroll bar. In millis -
maxScrollLimit
public double maxScrollLimitThe 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 enableScrollBarTrue to enable the scroll bar.
-
-
Constructor Details
-
DetectionPlotProjector
Constructor for the projector.
-
-
Method Details
-
getAxis
Get all the axis of the plot pane.- Returns:
- a list of axis in the order: TOP, RIGHT, BOTTOM, LEFT.
-
getAxis
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 axismin
- - the minimum value in axis units.max
- - the maximum value in axis units.
-
setAxisMinMax
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
Set the axis label.- Parameters:
string
- - the labelaxis
- - 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 axistopbottom
- - 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 axisd3
- - 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
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 classGeneralProjector<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
Description copied from class:GeneralProjector
Same as getCoordinate3d but using the generic type- Specified by:
getCoord3d
in classGeneralProjector<Coordinate3d>
- Parameters:
dataObject
- object extending PamCoordinate- Returns:
- 3d coordinate.
-
getDataPosition
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 classGeneralProjector<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 pixelstopbottom
- - 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.
-