Map
Class MapCommentOverlayGraphics

java.lang.Object
  extended by PamView.PamDetectionOverlayGraphics
      extended by Map.MapCommentOverlayGraphics
All Implemented Interfaces:
ManagedSymbol, PanelOverlayDraw

public class MapCommentOverlayGraphics
extends PamDetectionOverlayGraphics


Field Summary
 
Fields inherited from class PamView.PamDetectionOverlayGraphics
lineColour
 
Constructor Summary
MapCommentOverlayGraphics(PamDataBlock parentDataBlock)
           
 
Method Summary
 boolean canDraw(GeneralProjector projector)
          Used to tell the various displays whether or not the data in the parentDataBlock can be drawn on each of those displays.
 java.awt.Rectangle drawDataUnit(java.awt.Graphics g, PamDataUnit pamDataUnit, GeneralProjector generalProjector)
          Draw a PamDataUnit on a display.
 java.lang.String getHoverText(GeneralProjector generalProjector, PamDataUnit dataUnit, int side)
          Provides text for popup hover windows on displays.
 
Methods inherited from class PamView.PamDetectionOverlayGraphics
canDrawOnMap, canDrawOnRadar, canDrawOnSpectrogram, createKeyItem, drawAmplitudeOnRadar, drawLineAndSymbol, drawLineAndSymbol, drawLineOnly, drawOnMap, drawOnSpectrogram, drawRangeOnRadar, getDefaultRange, getHydrophones, getLineColor, getLineColour, getMenuKeyItem, getPamSymbol, getPamSymbol, getParentDataBlock, getSymbolInfo, isDetectionData, isDrawLineToLocations, setDefaultRange, setDetectionData, setDrawLineToLocations, setLineColor, setLineColour, setPamSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapCommentOverlayGraphics

public MapCommentOverlayGraphics(PamDataBlock parentDataBlock)
Method Detail

canDraw

public boolean canDraw(GeneralProjector projector)
Description copied from class: PamDetectionOverlayGraphics
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.

Specified by:
canDraw in interface PanelOverlayDraw
Overrides:
canDraw in class PamDetectionOverlayGraphics
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.

drawDataUnit

public java.awt.Rectangle drawDataUnit(java.awt.Graphics g,
                                       PamDataUnit pamDataUnit,
                                       GeneralProjector generalProjector)
Description copied from class: PamDetectionOverlayGraphics
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 interface PanelOverlayDraw
Overrides:
drawDataUnit in class PamDetectionOverlayGraphics
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.

getHoverText

public java.lang.String getHoverText(GeneralProjector generalProjector,
                                     PamDataUnit dataUnit,
                                     int side)
Description copied from interface: PanelOverlayDraw
Provides text for popup hover windows on displays.

Specified by:
getHoverText in interface PanelOverlayDraw
Overrides:
getHoverText in class PamDetectionOverlayGraphics
Parameters:
generalProjector - Projector associated with the display requiring the text
dataUnit - Data unit the mouse hovered over
Returns:
Text to display