Package PamView

Class GeneralProjector<T extends PamCoordinate>

java.lang.Object
PamView.GeneralProjector<T>
Direct Known Subclasses:
BTProjector, ClipDataProjector, ClipDisplayProjector, DetectionPlotProjector, DirectDrawProjector, MapProjector, RadarProjector, SpectrogramProjector, TimeProjectorFX

public abstract class GeneralProjector<T extends PamCoordinate> extends Object
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:
  • Field Details

  • Constructor Details

    • GeneralProjector

      public GeneralProjector()
  • Method Details

    • getHoverDataList

      public List<HoverData> 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

      public 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.
      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 abstract Coordinate3d getCoord3d(T dataObject)
      Same as getCoordinate3d but using the generic type
      Parameters:
      dataObject - object extending PamCoordinate
      Returns:
      3d coordinate.
    • getDataPosition

      public abstract T getDataPosition(PamCoordinate screenPosition)
      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

      public GeneralProjector.ParameterType getParmeterType(int iDim)
      Returns the parameter type for a specific data type required by Coordinate3d
      Parameters:
      iDim - Dimension number (0 - 2)
      Returns:
      enum ParameterType
    • getParameterTypes

      public GeneralProjector.ParameterType[] getParameterTypes()
      Returns:
      the full list of parameter types.
    • setParmeterType

      public void setParmeterType(int iDim, GeneralProjector.ParameterType parmeterType)
      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

      public GeneralProjector.ParameterUnits getParmeterUnits(int iDim)
      Returns the prameter unit for a specific data type required by Coordinate3d
      Parameters:
      iDim - Dimension number (0 - 2)
      Returns:
      enum ParameterUnit
    • setParmeterUnits

      public void setParmeterUnits(int iDim, GeneralProjector.ParameterUnits parmeterUnits)
      Sets the parameter unit for a specific data type required by Coordinate3d
      Parameters:
      iDim - Dimension number (0 - 2)
      parmeterUnits - enum ParameterUnit
    • getParameterUnits

      public GeneralProjector.ParameterUnits[] 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

      public PamDataUnit getHoveredDataUnit()
      Returns:
      data unit currently being hovered, or null.
    • getHoverText

      public String getHoverText(Point mousePoint)
    • getHoverText

      public String getHoverText(Point mousePoint, int ploNumberMatch)
    • 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

      public boolean addHoverData(Coordinate3d coordinate3d, PamDataUnit pamDataUnit)
      Parameters:
      coordinate3d - 3D coordinate of point plotted on map
      pamDataUnit - corresponding data unit
      Returns:
      true
    • addHoverData

      public void addHoverData(HoverData hoverData)
      Add hover data to the projector.
      Parameters:
      hoverData -
    • addHoverData

      public boolean addHoverData(Coordinate3d coordinate3d, PamDataUnit pamDataUnit, int iSide)
      Parameters:
      coordinate3d - 3D coordinate of point plotted on map
      pamDataUnit - corresponding data unit
      iSide - either 0 or 1 (the index, not +/- 1)
      Returns:
      true
    • addHoverData

      public boolean addHoverData(Shape drawnShape, PamDataUnit pamDataUnit)
    • addHoverData

      public void addHoverData(TransformShape shape, PamDataUnit pamDetection)
      Add hover data to the projector
      Parameters:
      shape - shape plotted on the map
      pamDataUnit - corresponding data unit
    • addHoverData

      public boolean addHoverData(TransformShape shape, PamDataUnit pamDetection, int Side)
      Add hover data to the projector
      Parameters:
      shape - shape plotted on the map
      pamDataUnit - corresponding data unit
      iSide - either 0 or 1 (the index, not +/- 1)
      Returns:
      true
    • findClosestDataUnitIndex

      public int findClosestDataUnitIndex(Coordinate3d coordinate3d)
    • findClosestDataUnitIndex

      public int findClosestDataUnitIndex(Coordinate3d cTest, int minDistance, int subPlotMatch)
    • isViewer

      public boolean isViewer()
      Returns:
      the viewer
    • getDataSelector

      public DataSelector getDataSelector()
      Returns:
      the dataSelector
    • setDataSelector

      public void setDataSelector(DataSelector dataSelector)
      Parameters:
      dataSelector - the dataSelector to set
    • getProjectorDrawingOptions

      public ProjectorDrawingOptions getProjectorDrawingOptions()
      Returns:
      The projectorDrawingOptions.
      !! Note that these will often be null !!
    • setProjectorDrawingOptions

      public void setProjectorDrawingOptions(ProjectorDrawingOptions projectorDrawingOptions)
      Parameters:
      projectorDrawingOptions - the projectorDrawingOptions to set
    • getPamSymbolChooser

      public PamSymbolChooser getPamSymbolChooser()
      Returns:
      the pamSymbolChooser
    • setPamSymbolChooser

      public void setPamSymbolChooser(PamSymbolChooser pamSymbolChooser)
      Parameters:
      pamSymbolChooser - the pamSymbolChooser to set
    • getHoverDataSynchroniser

      public Object getHoverDataSynchroniser()
      Returns:
      the hoverDataSynchroniser