public abstract class GeneralProjector
extends java.lang.Object
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.
Coordinate3d
,
PanelOverlayDraw
Modifier and Type | Class and Description |
---|---|
static class |
GeneralProjector.ParameterType |
static class |
GeneralProjector.ParameterUnits |
Modifier and Type | Field and Description |
---|---|
static int |
NPARAMETERS |
Constructor and Description |
---|
GeneralProjector() |
Modifier and Type | Method and Description |
---|---|
boolean |
addHoverData(Coordinate3d coordinate3d,
PamDataUnit pamDataUnit) |
boolean |
addHoverData(Coordinate3d coordinate3d,
PamDataUnit pamDataUnit,
int iSide) |
void |
clearHoverList()
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) |
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.
|
PamDataUnit |
getHoveredDataUnit() |
java.lang.String |
getHoverText(java.awt.Point mousePoint) |
PamView.GeneralProjector.MouseHoverAdapter |
getMouseHoverAdapter(javax.swing.JComponent component) |
GeneralProjector.ParameterType |
getParmeterType(int iDim)
Returns the prameter type for a specific data type required by
Coordinate3d
|
GeneralProjector.ParameterUnits |
getParmeterUnits(int iDim)
Returns the prameter unit for a specific data type required by
Coordinate3d
|
boolean |
isViewer() |
void |
setParmeterType(int iDim,
GeneralProjector.ParameterType parmeterType)
Sets the parameter type for a specific data type required by Coordinate3d
|
void |
setParmeterUnits(int iDim,
GeneralProjector.ParameterUnits parmeterUnits)
Sets the parameter unit for a specific data type required by Coordinate3d
|
public static final int NPARAMETERS
public abstract Coordinate3d getCoord3d(double d1, double d2, double d3)
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)public GeneralProjector.ParameterType getParmeterType(int iDim)
iDim
- Dimension number (0 - 2)public void setParmeterType(int iDim, GeneralProjector.ParameterType parmeterType)
iDim
- dimension number (0 - 2)parmeterType
- Parameter Type (see enum ParmaeterType)public GeneralProjector.ParameterUnits getParmeterUnits(int iDim)
iDim
- Dimension number (0 - 2)public void setParmeterUnits(int iDim, GeneralProjector.ParameterUnits parmeterUnits)
iDim
- Dimension number (0 - 2)parmeterUnits
- enum ParameterUnitpublic PamView.GeneralProjector.MouseHoverAdapter getMouseHoverAdapter(javax.swing.JComponent component)
public PamDataUnit getHoveredDataUnit()
public java.lang.String getHoverText(java.awt.Point mousePoint)
public void clearHoverList()
PanelOverlayDraw
public boolean addHoverData(Coordinate3d coordinate3d, PamDataUnit pamDataUnit)
coordinate3d
- 3D coordinate of point plotted on mappamDataUnit
- corresponding data unitpublic boolean addHoverData(Coordinate3d coordinate3d, PamDataUnit pamDataUnit, int iSide)
coordinate3d
- 3D coordinate of point plotted on mappamDataUnit
- corresponding data unitiSide
- either 0 or 1 (the index, not +/- 1)public int findClosestDataUnitIndex(Coordinate3d coordinate3d)
public int findClosestDataUnitIndex(Coordinate3d cTest, int minDistance)
public boolean isViewer()