Package Map

Class MapPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, PamObserver, ColorManaged
Direct Known Subclasses:
DialogMapPanel3D

public class MapPanel extends JPanelWithPamKey implements PamObserver, ColorManaged
This is the actual map display, with the bluebackground, the gps track, etc. IT sits inside the SimpleMap along with the right hand controls.
See Also:
  • Field Details

    • ship

      public Vessel ship
    • myCompass

      public Compass myCompass
    • DATASELECTNAME

      public static final String DATASELECTNAME
      String type name for map based data selectors.
      See Also:
  • Constructor Details

  • Method Details

    • getObserverObject

      public PamObserver getObserverObject()
      Specified by:
      getObserverObject in interface PamObserver
      Returns:
      the actual observer. In most cases concrete classes will just return 'this' in response. The exception is the Threaded observer, which will return the single thread observer.
    • getColorId

      public PamColors.PamColor getColorId()
      Description copied from interface: ColorManaged
      The components colour scheme.
      Specified by:
      getColorId in interface ColorManaged
      Overrides:
      getColorId in class PamPanel
      Returns:
      PamColor
    • newViewTime

      public void newViewTime(GpsDataUnit gpsDataUnit)
    • paintComponent

      public void paintComponent(Graphics g)
    • isFillSurface

      public boolean isFillSurface()
      Returns:
      true if the entire surface should be filled, not a rated rectangle.
    • getMinCornerLatLong

      public LatLong getMinCornerLatLong()
      Returns:
      the minCornerLatLong
    • getMaxCornerLatLong

      public LatLong getMaxCornerLatLong()
      Returns:
      the maxCornerLatLong
    • findEffortProvider

      public EffortProvider findEffortProvider()
    • repaintBaseDrawing

      public void repaintBaseDrawing()
      Instruct map to redraw it's base image next time anything is redrawn.
    • repaint

      public void repaint(boolean baseToo)
    • getMapRotationDegrees

      public double getMapRotationDegrees()
    • setMapRotationDegrees

      public void setMapRotationDegrees(double mapRotationDegrees)
    • getMapVerticalRotationDegrees

      public double getMapVerticalRotationDegrees()
    • getMapCentreDegrees

      public LatLong getMapCentreDegrees()
    • setMapCentreDegrees

      public void setMapCentreDegrees(LatLong mapCentreDegrees)
    • setMapCentreCoords

      public void setMapCentreCoords(Coordinate3d c)
    • getMapRangeMetres

      public int getMapRangeMetres()
    • setMapRangeMetres

      public void setMapRangeMetres(int mapRangeMetres)
    • getShipLLD

      public LatLong getShipLLD()
    • getShipGpsData

      public GpsData getShipGpsData(boolean predict)
    • newShipLLD

      public void newShipLLD()
    • getRectProj

      public MapRectProjector getRectProj()
    • setRectProj

      public void setRectProj(MapRectProjector rectProj)
    • addData

      public void addData(PamObservable o, PamDataUnit arg)
      Description copied from interface: PamObserver
      Informs the PamObserver that new data have been added to the Observable class
      Specified by:
      addData in interface PamObserver
    • updateData

      public void updateData(PamObservable observable, PamDataUnit pamDataUnit)
      Description copied from interface: PamObserver
      Informs the PamObserver that existing data have been updated
      Specified by:
      updateData in interface PamObserver
    • getObserverName

      public String getObserverName()
      Specified by:
      getObserverName in interface PamObserver
    • setSampleRate

      public void setSampleRate(float sampleRate, boolean notify)
      Description copied from interface: PamObserver
      New sample rate
      Specified by:
      setSampleRate in interface PamObserver
      Parameters:
      notify - Notify other PamObservers and PamObservables in the chain.
    • masterClockUpdate

      public void masterClockUpdate(long milliSeconds, long sampleNumber)
      Specified by:
      masterClockUpdate in interface PamObserver
    • receiveSourceNotification

      public void receiveSourceNotification(int type, Object object)
      Description copied from interface: PamObserver
      Receive a notification from the data source - typically a change in DAQ status. See the constants listed in AcquisitionProcess for potential change types.
      Specified by:
      receiveSourceNotification in interface PamObserver
      Parameters:
      type - the type of change
      object - generic object added here so that we can include anything in the future
    • getPixelsPerMetre

      public double getPixelsPerMetre()
    • setPixelsPerMetre

      public void setPixelsPerMetre(double pixelsPerMetre)
    • getRequiredDataHistory

      public long getRequiredDataHistory(PamObservable o, Object arg)
      Specified by:
      getRequiredDataHistory in interface PamObserver
      Parameters:
      arg - optional argument from PamObservable
      Returns:
      time in milliseconds required by data held in PamObservable
    • noteNewSettings

      public void noteNewSettings()
      Specified by:
      noteNewSettings in interface PamObserver
    • stepMapZoom

      public void stepMapZoom(int direction)
    • setMapZoom

      public void setMapZoom(float zoomFactor)
    • removeObservable

      public void removeObservable(PamObservable o)
      Description copied from interface: PamObserver
      called when an Observable (PamDataBlock) is removed from the system
      Specified by:
      removeObservable in interface PamObserver
    • getSimpleMapRef

      public SimpleMap getSimpleMapRef()
    • setSimpleMapRef

      public void setSimpleMapRef(SimpleMap simpleMapRef)
    • setBackground

      public void setBackground(Color bg)
      Overrides:
      setBackground in class PamPanel
    • addConstantOverlay

      public void addConstantOverlay(MarkOverlayDraw markOverlayDraw)
    • showPopupMenu

      public void showPopupMenu(MouseEvent e)
    • handleMarkedMapUnits

      public boolean handleMarkedMapUnits(List<PamDataUnit> markedDataUnits)
      This gets called when there are no other markes being used on the map, but some data have been marked out. Can use to annotate data units that have everything built into them using generic annotations.
      Parameters:
      markedDataUnits -
      Returns:
    • getMapController

      public MapController getMapController()
      Get the map controller.
      Returns:
      the map controller.
    • setMapController

      public void setMapController(MapController mapController)
    • getToolTipText

      public String getToolTipText(MouseEvent event)
      Overrides:
      getToolTipText in class JComponent
    • findEffortThing

      public EffortDataUnit findEffortThing(long timeMilliseconds)