PamView
Interface PanelOverlayDraw

All Known Implementing Classes:
AbstractWhistleDataBlock, AbstractWhistleDataBlock, AcousticDataBlock, AirgunGraphics, AISDataBlock, AISGraphics, AmplifiedDataBlock, AngleDataBlock, BeakedDataBlock, BeakedExperimentDataBlock, BeakedExperimentGraphics, BeakedGraphics, ClickDataBlock, ClickGroupDataBlock, ClickGroupGraphics, ClickTrainDataBlock, ClickTrainGraphics, ClickTrainLocalisationGraphics, ClickTriggerFunctionDataBlock, ConnectedRegionDataBlock, ConnectedRegionDataBlock, CROverlayGraphics, CROverlayGraphics, DepthDataBlock, FFTDataBlock, GPSDataBlock, IshmaelGraphics, IshOverlayGraphics, LandmarkDataBlock, LandmarkGraphics, ListeningEffortGraphics, MapCommentDataBlock, MapCommentOverlayGraphics, NewClickOverlayGraphics, NMEADataBlock, NoiseDataBlock, NoiseDataBlock, OfflineEventDataBlock, OfflineEventGraphics, PamDataBlock, PamDetectionOverlayGraphics, PamObservable, PamRawDataBlock, PatchPanelDataBlock, PeakGraphics, RoccaContourDataBlock, RoccaGraphics, RoccaSightingDataBlock, ShoreStationDataBlock, ShoreStationGraphics, SimGraphics, SimObjectsDataBlock, SingletonDataBlock, TerrellaDataBlock, ThingHeardGraphics, TowedArray3DOverlayGraphics, TrackedClickDataBlock, TrackedClickGraphics, VRDataBlock, WhistleClasificationDataBlock, WhistleDataBlock, WhistleEventGraphics, WhistleGraphics, WhistleLocalisationGraphics, WhistleToneLocalisationGraphics, WorkshopOverlayGraphics

public interface PanelOverlayDraw

Author:
Doug Gillespie

Used by PamDataBlocks to draw PamDataUnits on display objects (maps, spectrograms, etc)

If a PanelOverlayDraw object is instantiated for a PamObservable, then any display (usually an observer of that PamObservable) will call the PamObservable function PamObservable.DrawDataUnit(...), parsing it a Graphics2d handle, a PamDataUnit, and a concrete instance of a GeneralProjector. The DrawDataUnit function in PanelOverlayDraw may then use the Projector to convert data in the PamDatablock into screen coordinates and then draw them (in any way it likes) on the graphics handle.

If the Observable may be drawn on multiple types of display, then DrawDataUnit should check the ParameterTypes and ParameterUnits required by the Projector and then draw whatever is appropriate for that Projector (e.g. The Whistle DataBlock draws contours on the display that has TIME and FREQUENCY as ParameterTypes and a single triangular symbol on the display that has LATITUDE and LONGITUDE as it's parameter types).

See Also:
GeneralProjector

Method Summary
 boolean canDraw(GeneralProjector generalProjector)
           
 PamKeyItem createKeyItem(GeneralProjector generalProjector, int keyType)
          provide a graphics component (probably a JPanel) that can be incorporated into a key panel for maps, and anything else that uses overlay graphics.
 java.awt.Rectangle drawDataUnit(java.awt.Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector)
           
 java.lang.String getHoverText(GeneralProjector generalProjector, PamDataUnit dataUnit, int iSide)
          Provides text for popup hover windows on displays.
 

Method Detail

drawDataUnit

java.awt.Rectangle drawDataUnit(java.awt.Graphics g,
                                PamDataUnit pamDataUnit,
                                GeneralProjector generalProjector)
Parameters:
g - Graphics handle to draw on
pamDataUnit - PamDataUnit to draw
generalProjector - Projector to use when drawing.
Returns:
A rectange surrouding whatever has just been drawn.

canDraw

boolean canDraw(GeneralProjector generalProjector)
Parameters:
generalProjector -
Returns:
Returns whether or not the object can be drawn using the given projector. The implementation of CanDraw should examine the parameter types in GeneralProjector and check that it will know how to prvide those parameters before returning true, or false otherwise.

createKeyItem

PamKeyItem createKeyItem(GeneralProjector generalProjector,
                         int keyType)
provide a graphics component (probably a JPanel) that can be incorporated into a key panel for maps, and anything else that uses overlay graphics.

Since multiple keys may be created in various displays, new ones should normally be created each time this is called.

The GeneralProjector reference is passed as a parameter since the type of symbol or shape drawn on a particular plot may depend on the type of coordinate system. For example, whistles are drawn as a contour on the spectrogram display, but as a point (PamSymbol) on the map.

It is possible that some PanelOverlayDraw implementations will be rather complicated and the keys consequently quite large. The extendedKey parameter may therefore be used to draw a full or a cut down version of the key. It is expected that most implementations will ignore this parameter !

Parameters:
generalProjector - Reference to a GeneralProjector responsible for drawing with the PAnelOverlayDraw implementation
keyType - Draw a more complicated key, giving more detail
Returns:
java.awt compnent (usually a JPanel).
See Also:
WhistleGraphics, PamSymbol

getHoverText

java.lang.String getHoverText(GeneralProjector generalProjector,
                              PamDataUnit dataUnit,
                              int iSide)
Provides text for popup hover windows on displays.

Parameters:
generalProjector - Projector associated with the display requiring the text
dataUnit - Data unit the mouse hovered over
Returns:
Text to display