Class GeneralProjector<T extends PamCoordinate>
- Direct Known Subclasses:
BTProjector
,ClipDataProjector
,ClipDisplayProjector
,DetectionPlotProjector
,DirectDrawProjector
,MapProjector
,RadarProjector
,SpectrogramProjector
,TimeProjectorFX
- Author:
- Doug Gillespie
GeneralProjector is an abstract class used to draw any type of information contained within a PamDataBlock on a display (e.g. Map, spectrogram, etc).
The display must set the parameter types and the units (these lists can be added to as necessary)
Drawing is all done via calls that the display makes to PanelOverlayDraw.DrawDataUnit(...)
The DataBlocks using the projector will need to check parameter types and units when parsed a projector to check that they can provide these parameters.
The owning display will need to create concrete instances of GeneralProjector which implement getCoord3d. It is also possible that they will need to create other functions which are called by the display to set scaling parameters, scale offsets or other information Required by the projector that may change with time. If a display requires many types of similar projectors (e.g. different map projections) then it will be necessary to create a special interface to manage these functions and to implement that interface in all concrete classes used by that display.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addHoverData
(Shape drawnShape, PamDataUnit pamDataUnit) boolean
addHoverData
(Coordinate3d coordinate3d, PamDataUnit pamDataUnit) boolean
addHoverData
(Coordinate3d coordinate3d, PamDataUnit pamDataUnit, int iSide) void
addHoverData
(HoverData hoverData) Add hover data to the projector.void
addHoverData
(TransformShape shape, PamDataUnit pamDetection) Add hover data to the projectorboolean
addHoverData
(TransformShape shape, PamDataUnit pamDetection, int Side) Add hover data to the projectorvoid
Any display that is using click hovering should call this at the start of their paintComponent(Graphics g) function.int
findClosestDataUnitIndex
(Coordinate3d coordinate3d) int
findClosestDataUnitIndex
(Coordinate3d cTest, int minDistance, int subPlotMatch) abstract Coordinate3d
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.abstract Coordinate3d
getCoord3d
(T dataObject) Same as getCoordinate3d but using the generic typeabstract T
getDataPosition
(PamCoordinate screenPosition) Do the exact opposite of getCoord3d and turn a screen position back into a data coordinate (e.g.This should effectively be a list of everything that just got displayed on whatever was using this projector.getHoverText
(Point mousePoint) getHoverText
(Point mousePoint, int ploNumberMatch) GeneralProjector<T>.PamView.GeneralProjector.MouseHoverAdapter
getMouseHoverAdapter
(JComponent component) Gets an adapter that can provide tooltips automatically based on plotted data units.getParmeterType
(int iDim) Returns the parameter type for a specific data type required by Coordinate3dgetParmeterUnits
(int iDim) Returns the prameter unit for a specific data type required by Coordinate3dboolean
isViewer()
void
setDataSelector
(DataSelector dataSelector) void
setPamSymbolChooser
(PamSymbolChooser pamSymbolChooser) void
setParmeterType
(int iDim, GeneralProjector.ParameterType parmeterType) Sets the parameter type for a specific data type required by Coordinate3dvoid
setParmeterUnits
(int iDim, GeneralProjector.ParameterUnits parmeterUnits) Sets the parameter unit for a specific data type required by Coordinate3dvoid
setProjectorDrawingOptions
(ProjectorDrawingOptions projectorDrawingOptions)
-
Field Details
-
NPARAMETERS
public static final int NPARAMETERS- See Also:
-
-
Constructor Details
-
GeneralProjector
public GeneralProjector()
-
-
Method Details
-
getHoverDataList
This should effectively be a list of everything that just got displayed on whatever was using this projector. Get's used when marking stuff out.- Returns:
- the hoverData
-
getCoord3d
Function ultimately used by a PamDataBlock to convert it's own data, in whatever form that is in into screen coordinates.- 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
Same as getCoordinate3d but using the generic type- Parameters:
dataObject
- object extending PamCoordinate- Returns:
- 3d coordinate.
-
getDataPosition
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
- screen position- Returns:
- data object.
-
getParmeterType
Returns the parameter type for a specific data type required by Coordinate3d- Parameters:
iDim
- Dimension number (0 - 2)- Returns:
- enum ParameterType
-
getParameterTypes
- Returns:
- the full list of parameter types.
-
setParmeterType
Sets the parameter type for a specific data type required by Coordinate3d- Parameters:
iDim
- dimension number (0 - 2)parmeterType
- Parameter Type (see enum ParmaeterType)
-
getParmeterUnits
Returns the prameter unit for a specific data type required by Coordinate3d- Parameters:
iDim
- Dimension number (0 - 2)- Returns:
- enum ParameterUnit
-
setParmeterUnits
Sets the parameter unit for a specific data type required by Coordinate3d- Parameters:
iDim
- Dimension number (0 - 2)parmeterUnits
- enum ParameterUnit
-
getParameterUnits
- Returns:
- full list of parameter units.
-
getMouseHoverAdapter
public GeneralProjector<T>.PamView.GeneralProjector.MouseHoverAdapter getMouseHoverAdapter(JComponent component) Gets an adapter that can provide tooltips automatically based on plotted data units.- Parameters:
component
-- Returns:
-
getHoveredDataUnit
- Returns:
- data unit currently being hovered, or null.
-
getHoverText
-
getHoverText
-
clearHoverList
public void clearHoverList()Any display that is using click hovering should call this at the start of their paintComponent(Graphics g) function. The list will be repopulated as data are drawn in the PanelOverlayDraw implementations.- See Also:
-
addHoverData
- Parameters:
coordinate3d
- 3D coordinate of point plotted on mappamDataUnit
- corresponding data unit- Returns:
- true
-
addHoverData
Add hover data to the projector.- Parameters:
hoverData
-
-
addHoverData
- Parameters:
coordinate3d
- 3D coordinate of point plotted on mappamDataUnit
- corresponding data unitiSide
- either 0 or 1 (the index, not +/- 1)- Returns:
- true
-
addHoverData
-
addHoverData
Add hover data to the projector- Parameters:
shape
- shape plotted on the mappamDataUnit
- corresponding data unit
-
addHoverData
Add hover data to the projector- Parameters:
shape
- shape plotted on the mappamDataUnit
- corresponding data unitiSide
- either 0 or 1 (the index, not +/- 1)- Returns:
- true
-
findClosestDataUnitIndex
-
findClosestDataUnitIndex
-
isViewer
public boolean isViewer()- Returns:
- the viewer
-
getDataSelector
- Returns:
- the dataSelector
-
setDataSelector
- Parameters:
dataSelector
- the dataSelector to set
-
getProjectorDrawingOptions
- Returns:
- The projectorDrawingOptions.
!! Note that these will often be null !!
-
setProjectorDrawingOptions
- Parameters:
projectorDrawingOptions
- the projectorDrawingOptions to set
-
getPamSymbolChooser
- Returns:
- the pamSymbolChooser
-
setPamSymbolChooser
- Parameters:
pamSymbolChooser
- the pamSymbolChooser to set
-
getHoverDataSynchroniser
- Returns:
- the hoverDataSynchroniser
-