Class LineOfSightPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Closeable, Serializable, AutoCloseable, Accessible, TrackerListener, GpsDataListener

public class LineOfSightPane extends JPanel implements GpsDataListener, TrackerListener, Closeable
This pane collects a LineOfSightPanel together with border decoration JLabels.
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • LineOfSightPane

      public LineOfSightPane(double lat, double lon, boolean isStartPos, GeoMapGuiIfc geoMap)
      Create a LineOfSightPane originated at the specified coordinates.
      Parameters:
      lat - endpoint latitude in degrees North
      lon - endpoint longitude in degrees East
      isStartPos - boolean true if passed coordinate is the first coordinate, false if second
      geoMap - GeographicalMap window parenting the dialog containing this pane
    • LineOfSightPane

      public LineOfSightPane(double lat, double lon, boolean isStartPos, String name, GeographicalMap geoMap)
      Create a LineOfSightPane originated at the specified coordinates.
      Parameters:
      lat - endpoint latitude in degrees North
      lon - endpoint longitude in degrees East
      isStartPos - boolean true if passed coordinate is the first coordinate, false if second
      name - String name of specified end-point
      geoMap - GeographicalMap window parenting the dialog containing this pane
  • Method Details

    • getStartPoint

      public Point2D getStartPoint()
      Get the starting coordinates.
      Returns:
      Point2D containing the latitude and longitude of the starting point
    • setStartPoint

      public void setStartPoint(Point2D pt)
      Change the starting point of the line of sight path.
      Parameters:
      pt - Point2D containing the latitude and longitude of the starting point
    • getEndPoint

      public Point2D getEndPoint()
      Get the ending coordinates.
      Returns:
      Point2D containing the latitude and longitude of the ending point
    • setEndPoint

      public void setEndPoint(Point2D pt)
      Change the ending point of the line of sight path.
      Parameters:
      pt - Point2D containing the latitude and longitude of the ending point
    • setStartAGLM

      public void setStartAGLM(float aglM)
      Change the starting point's antenna altitude above ground level.
      Parameters:
      aglM - float endpoint antenna altitude in meters above local ground level
    • setEndAGLM

      public void setEndAGLM(float aglM)
      Change the ending point's antenna altitude above ground level.
      Parameters:
      aglM - float endpoint antenna altitude in meters above local ground level
    • setStartName

      public void setStartName(String name)
      Set the name for the starting position.
      Parameters:
      name - String name for starting position
    • setEndName

      public void setEndName(String name)
      Set the name for the ending position.
      Parameters:
      name - String name for ending position
    • setRemoteStation

      public void setRemoteStation(StationState remoteStation)
      Specify the remote station to be tracked on the right side of the pane.
      Parameters:
      remoteStation - StationState of possibly mobile station to anchor one end of the plot
    • addAGLChangeListener

      public void addAGLChangeListener(LineOfSightPane.AGLChangeListener l)
      Register a new AGLChangeListener against this LineOfSightPane.
      Parameters:
      l - AGLChangeListener to notify of GUI control changes
    • removeAGLChangeListener

      public void removeAGLChangeListener(LineOfSightPane.AGLChangeListener l)
      Unregister a new AGLChangeListener from this LineOfSightPane.
      Parameters:
      l - AGLChangeListener to stop notifying of GUI control changes
    • gpsDataUpdated

      public void gpsDataUpdated(GPSDistributor distributor, GpsFix currentFix, boolean isLocal, String source)
      Description copied from interface: GpsDataListener
      Called by the GPSDistributor when the GPS data has been updated.
      Specified by:
      gpsDataUpdated in interface GpsDataListener
      Parameters:
      distributor - instance of the GPSDistributor
      currentFix - current position data reported by the local GPS
      isLocal - boolean true if this is GPS data for the local station, false if for a remote GPS receiver
      source - String name assigned to remote GPS receiver, or null if for the local receiver
    • satDataUpdated

      public void satDataUpdated(GPSDistributor distributor, SatelliteCatalog satCatalog, boolean isLocal, String source)
      Description copied from interface: GpsDataListener
      Called when the satellite constellation in use changes.
      Specified by:
      satDataUpdated in interface GpsDataListener
      Parameters:
      distributor - instance of the GPSDistributor
      satCatalog - updated SatelliteCatalog instance
      isLocal - boolean true if this is GPS data for the local station, false if for a remote GPS receiver
      source - String name assigned to remote GPS receiver, or null if for the local receiver
    • stationAdded

      public void stationAdded(StationState ss, int index)
      Description copied from interface: TrackerListener
      Called when a new station is initially added to the tracker.
      Specified by:
      stationAdded in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information; the initial AX25Message will not yet be stored within the StationState object
      index - zero-based integer sequence number for this station in the StationTracker
    • stationUpdated

      public void stationUpdated(StationState ss)
      Description copied from interface: TrackerListener
      Called when an existing station is updated with new information in the tracker.
      Specified by:
      stationUpdated in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information
    • stationDeleted

      public void stationDeleted(StationState ss, int index)
      Description copied from interface: TrackerListener
      Called when an existing station is deleted from the tracker.
      Specified by:
      stationDeleted in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information
      index - zero-based integer sequence number for this station in the StationTracker
    • messageAdded

      public void messageAdded(StationState ss, int index, AX25Message msg)
      Description copied from interface: TrackerListener
      Called when a AX25Message is added to the history for a station in the tracker.
      Specified by:
      messageAdded in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information
      index - zero-based index of the message added to the StationState object
      msg - APRS Message object being added to the tracker; note that non-APRS packets that can still be decoded (such as OpenTRAC) will also be passed here; AX25Frames that cannot be decoded will pass null here
    • messageDeleted

      public void messageDeleted(StationState ss, int index, AX25Message msg)
      Description copied from interface: TrackerListener
      Called when a AX25Message is deleted from the history for a station in the tracker.
      Specified by:
      messageDeleted in interface TrackerListener
      Parameters:
      ss - StationState containing the station's information; the AX25Message will already be removed from the StationState object
      index - zero-based index of the message removed from the StationState object
      msg - APRS Message object being removed from the tracker; note that non-APRS packets that can still be decoded (such as OpenTRAC) will also be passed here; AX25Frames that cannot be decoded will pass null here
    • close

      public void close()
      Closes this pane and releases any system resources associated with it. If the pane is already closed then invoking this method has no effect.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • registerMapKeystrokeActions

      public void registerMapKeystrokeActions()
      Register the keystrokes that can be used to move this object's associated map around. This is for when this widget takes over keyboard focus from the map but the user needs to move the map.
    • getDrawExtraOnLineOfSight

      public DrawExtraOnLineOfSight getDrawExtraOnLineOfSight()
      Get the current extension for drawing the line of sight plot.
      Returns:
      active DrawExtraOnLineOfSight implementation, or null if no extension
    • setDrawExtraOnLineOfSight

      public void setDrawExtraOnLineOfSight(DrawExtraOnLineOfSight drawExtraOnLineOfSight)
      Set the current extension for drawing the line of sight plot.
      Parameters:
      drawExtraOnLineOfSight - active DrawExtraOnLineOfSight implementation, or null if no extension