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 Link icon

  • Constructor Details Link icon

    • GeneralProjector Link icon

      public GeneralProjector()
  • Method Details Link icon

    • getHoverDataList Link icon

      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 Link icon

      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 Link icon

      public abstract Coordinate3d getCoord3d(T dataObject)
      Same as getCoordinate3d but using the generic type
      Parameters:
      dataObject - object extending PamCoordinate
      Returns:
      3d coordinate.
    • getDataPosition Link icon

      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 Link icon

      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 Link icon

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

      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 Link icon

      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 Link icon

      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 Link icon

      public GeneralProjector.ParameterUnits[] getParameterUnits()
      Returns:
      full list of parameter units.
    • getMouseHoverAdapter Link icon

      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 Link icon

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

      public String getHoverText(Point mousePoint)
    • getHoverText Link icon

      public String getHoverText(Point mousePoint, int ploNumberMatch)
    • clearHoverList Link icon

      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 Link icon

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

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

      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 Link icon

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

      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 Link icon

      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 Link icon

      public int findClosestDataUnitIndex(Coordinate3d coordinate3d)
    • findClosestDataUnitIndex Link icon

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

      public boolean isViewer()
      Returns:
      the viewer
    • getDataSelector Link icon

      public DataSelector getDataSelector()
      Returns:
      the dataSelector
    • setDataSelector Link icon

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

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

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

      public PamSymbolChooser getPamSymbolChooser()
      Returns:
      the pamSymbolChooser
    • setPamSymbolChooser Link icon

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

      public Object getHoverDataSynchroniser()
      Returns:
      the hoverDataSynchroniser