Package PamView
Class PamDetectionOverlayGraphics
java.lang.Object
PamView.PanelOverlayDraw
PamView.PamDetectionOverlayGraphics
- Direct Known Subclasses:
AISGraphics
,ClickTrainGraphics
,ClipOverlayGraphics
,CROverlayGraphics
,CTDataUnitGraphics
,DetectionGroupGraphics
,DifarOverlayGraphics
,DLDetectionGraphics
,DLGraphics
,GeneratorOverlayGraphics
,GPLOverlayGraphics
,Group3DOverlayDraw
,IshOverlayGraphics
,MapCommentOverlayGraphics
,MarkOverlayDraw
,NewClickOverlayGraphics
,OfflineEventGraphics
,RavenGraphics
,RoccaGraphics
,RWEOverlayGraphics
,TowedArray3DOverlayGraphics
,TrackedClickGraphics
,TrackedGroupOverlayGraphics
,UserInputOverlayGraphics
,WhistleEventGraphics
,WhistleGraphics
,WhistleLocalisationGraphics
,WhistleToneLocalisationGraphics
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPamDetectionOverlayGraphics
(PamDataBlock parentDataBlock, PamSymbol defaultSymbol) Constructor for standard overlay graphics class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canDraw
(GeneralProjector generalProjector) Used to tell the various displays whether or not the data in the parentDataBlock can be drawn on each of those displays.boolean
canDraw
(GeneralProjector.ParameterType[] parameterTypes, GeneralProjector.ParameterUnits[] parameterUnits) Used to tell the various displays whether or not the data in the parentDataBlock can be drawn on each of those displays.protected boolean
protected boolean
canDrawOnRadar
(GeneralProjector.ParameterType radialParameter) protected boolean
createKeyItem
(GeneralProjector generalProjector, int keyType) Gets information for making up a key on various displays.protected Rectangle
drawAmplitudeOnRadar
(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) drawDataUnit
(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) Draw a PamDataUnit on a display.protected Rectangle
drawLineAndSymbol
(Graphics g, PamDataUnit pamDataUnit, Point p1, Point p2, PamSymbol symbol, int symbolWidth, int symbolHeight, ProjectorDrawingOptions drawingOptions) protected Rectangle
drawLineAndSymbol
(Graphics g, PamDataUnit pamDataUnit, Point p1, Point p2, PamSymbol symbol, ProjectorDrawingOptions drawingOptions) protected Rectangle
drawLineAndSymbol
(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector, LatLong LL1, LatLong LL2, PamSymbol symbol, ProjectorDrawingOptions drawingOptions) protected Rectangle
drawLineOnly
(Graphics g, PamDataUnit pamDataUnit, Point p1, Point p2, PamSymbol symbol, ProjectorDrawingOptions drawingOptions) protected Rectangle
drawOnMap
(Graphics g, PamDataUnit pamDetection, GeneralProjector generalProjector) protected Rectangle
drawOnSpectrogram
(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) Draw on spectrogram changed March 2010 so that the default time unit is milliseconds (Java time from 1970) rather than samples.protected Rectangle
drawRangeOnRadar
(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) protected Rectangle
drawSlantOnRadar
(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) double
getDefaultRange
(GeneralProjector generalProjector) getHoverImage
(GeneralProjector generalProjector, PamDataUnit dataUnit, int iSide) GEt an image for the data unit to include in overlay text.getHoverText
(GeneralProjector generalProjector, PamDataUnit dataUnit, int iSide) Get tool tip content for the data unit for this projector.getHoverTextWithoutWrap
(GeneralProjector generalProjector, PamDataUnit dataUnit, int iSide) protected int
getHydrophones
(PamDataUnit pamDetection) Get the colour for localisation symbols on the mapgetPamSymbol
(PamDataUnit pamDataUnit, GeneralProjector projector) getPerspectiveSymbol
(PamDataUnit pamDataUnit, GeneralProjector projector, Coordinate3d screenCoordinate) Get the symbol.boolean
hasOptionsDialog
(GeneralProjector generalProjector) boolean
void
setDefaultRange
(double defaultRange) void
setDetectionData
(boolean isDetectionData) void
void
setLineColour
(Color lineColour) void
setLocColour
(Color locColour) Set the colour of localisation symbols on the map.boolean
showOptions
(Window parentWindow, GeneralProjector generalProjector) Show an options dialog for a particular projector.Methods inherited from class PamView.PanelOverlayDraw
getDefaultSymbol, preDrawAnything, setDefaultSymbol
-
Field Details
-
Constructor Details
-
Method Details
-
getParentDataBlock
- Returns:
- parent PamDataBlock for this PanelOverlayDraw.
-
canDraw
Used to tell the various displays whether or not the data in the parentDataBlock can be drawn on each of those displays. This is based purely on the axis types of the displays and whether or not the parentDataBlock's data untits are likely to have data which can transform into those axis types.For simplicity I've broken it up into the three main display types currently existing in Pamguard.
- Overrides:
canDraw
in classPanelOverlayDraw
- 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.
-
canDraw
public boolean canDraw(GeneralProjector.ParameterType[] parameterTypes, GeneralProjector.ParameterUnits[] parameterUnits) Used to tell the various displays whether or not the data in the parentDataBlock can be drawn on each of those displays. This is based purely on the axis types of the displays and whether or not the parentDataBlock's data untits are likely to have data which can transform into those axis types.- Specified by:
canDraw
in classPanelOverlayDraw
- Parameters:
parameterTypes
- parameter typesparameterUnits
- parameter units.- Returns:
- true if the data can be (probably) drawn using this projector.
-
canDrawOnMap
protected boolean canDrawOnMap()- Returns:
- true if these data can be drawn on the map.
Thsi shoudl always be true, since it's always possible to draw a symbol at the hydrophone location even if no range or bearing information are available.
-
canDrawOnSpectrogram
protected boolean canDrawOnSpectrogram()- Returns:
- true if these data can be drawn on the spectrogram.
Generally, this is always true since it will just draw a rectangle with the time and frequency limits of the sound. If it is not the case, then override this function and return false.
-
canDrawOnRadar
- Parameters:
radialParameter
-- Returns:
- true if these data can be drawn on the radar. The detection will always need a bearing. The radial parameter is either amplitude (which all detections should have) or range which may or may not be there.
-
createKeyItem
Gets information for making up a key on various displays. PamKeyItem is not yet implemented.- Specified by:
createKeyItem
in classPanelOverlayDraw
- Parameters:
generalProjector
- Reference to a GeneralProjector responsible for drawing with the PAnelOverlayDraw implementationkeyType
- Draw a more complicated key, giving more detail- Returns:
- java.awt compnent (usually a JPanel).
- See Also:
-
drawDataUnit
public Rectangle drawDataUnit(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) Draw a PamDataUnit on a display.This is split into separate routines for the three main display types for simplicity both of reading this code and for overriding the various functions.
If display types are added to PAMGUARD, these functions will need to be added to.
- Specified by:
drawDataUnit
in classPanelOverlayDraw
- Parameters:
g
- Graphics handle to draw onpamDataUnit
- PamDataUnit to drawgeneralProjector
- Projector to use when drawing.- Returns:
- A rectangle surrouding whatever has just been drawn.
-
drawOnMap
protected Rectangle drawOnMap(Graphics g, PamDataUnit pamDetection, GeneralProjector generalProjector) -
drawLineAndSymbol
protected Rectangle drawLineAndSymbol(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector, LatLong LL1, LatLong LL2, PamSymbol symbol, ProjectorDrawingOptions drawingOptions) -
drawLineAndSymbol
protected Rectangle drawLineAndSymbol(Graphics g, PamDataUnit pamDataUnit, Point p1, Point p2, PamSymbol symbol, ProjectorDrawingOptions drawingOptions) -
drawLineAndSymbol
protected Rectangle drawLineAndSymbol(Graphics g, PamDataUnit pamDataUnit, Point p1, Point p2, PamSymbol symbol, int symbolWidth, int symbolHeight, ProjectorDrawingOptions drawingOptions) -
drawLineOnly
protected Rectangle drawLineOnly(Graphics g, PamDataUnit pamDataUnit, Point p1, Point p2, PamSymbol symbol, ProjectorDrawingOptions drawingOptions) -
getHydrophones
- Parameters:
pamDetection
- PamDetection- Returns:
- a map of hydrophones associated with this detection.
-
drawOnSpectrogram
protected Rectangle drawOnSpectrogram(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) Draw on spectrogram changed March 2010 so that the default time unit is milliseconds (Java time from 1970) rather than samples. This makes it posible to work with data collected over multiple files when operating in viewer mode.- Parameters:
g
-pamDataUnit
-generalProjector
-- Returns:
- updated rectangle
-
drawAmplitudeOnRadar
protected Rectangle drawAmplitudeOnRadar(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) -
drawRangeOnRadar
protected Rectangle drawRangeOnRadar(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) -
drawSlantOnRadar
protected Rectangle drawSlantOnRadar(Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector) -
getHoverText
Get tool tip content for the data unit for this projector.- Specified by:
getHoverText
in classPanelOverlayDraw
- Parameters:
generalProjector
- projectordataUnit
- dataunitiSide
- left or right (0 or 1 I think, might be -1 or +1 though !)- Returns:
- tooltip content consisting of text and / or an image.
-
getHoverImage
public BufferedImage getHoverImage(GeneralProjector generalProjector, PamDataUnit dataUnit, int iSide) GEt an image for the data unit to include in overlay text.- Parameters:
generalProjector
- projectordataUnit
- dataunitiSide
- left or right (0 or 1 I think, might be -1 or +1 though !)- Returns:
- a small image or null
-
getHoverTextWithoutWrap
public String getHoverTextWithoutWrap(GeneralProjector generalProjector, PamDataUnit dataUnit, int iSide) -
getLineColour
-
setLineColour
-
getPamSymbol
- Overrides:
getPamSymbol
in classPanelOverlayDraw
- Parameters:
pamDataUnit
-- Returns:
- PamSymbol to use in plotting. Generally this is just the set symbol for the overlay, but can be overridden if a detector has some complicated way of using different symbols for different dataUnits.
-
getPerspectiveSymbol
public PamSymbol getPerspectiveSymbol(PamDataUnit pamDataUnit, GeneralProjector projector, Coordinate3d screenCoordinate) Get the symbol.- Parameters:
pamDataUnit
-projector
-screenCoordinate
-- Returns:
-
getDefaultRange
-
setDefaultRange
public void setDefaultRange(double defaultRange) -
isDetectionData
public boolean isDetectionData()- Returns:
- true if the datablock associated with this overlay contians data units subclassed from PamDetection - in which case they might have Localisation information.
-
setDetectionData
public void setDetectionData(boolean isDetectionData) -
getSymbolInfo
-
getMenuKeyItem
-
setLineColor
-
getLineColor
-
hasOptionsDialog
- Overrides:
hasOptionsDialog
in classPanelOverlayDraw
- Parameters:
generalProjector
- projector- Returns:
- true if the drawing methods have options relevant to this projection which can be shown in a dialog of some sort (see showOptions)
-
showOptions
Description copied from class:PanelOverlayDraw
Show an options dialog for a particular projector.- Overrides:
showOptions
in classPanelOverlayDraw
- Parameters:
parentWindow
- parent window or framegeneralProjector
- projector- Returns:
-
getLocColour
Get the colour for localisation symbols on the map- Returns:
- the colour of localisation symbols
-
setLocColour
Set the colour of localisation symbols on the map.- Parameters:
locColour
-
-