Class LineOfSightPanel

All Implemented Interfaces:
ComponentListener, MouseListener, ImageObserver, MenuContainer, Serializable, EventListener, Observer

public class LineOfSightPanel extends JComponent implements ComponentListener, MouseListener, Observer
This panel displays a side-view plot of the straight-line propagation path between two points on the map, using the SRTM topographic data (assuming it is available).
Author:
Andrew Pavlin, KA2DDO
See Also:
  • Constructor Details

    • LineOfSightPanel

      public LineOfSightPanel(GeoMapGuiIfc geoMap, double startLat, double startLon)
      Create the LineOfSightPanel with both ends of the great circle route at the same point (for now),
      Parameters:
      geoMap - GeographicalMap window parenting the dialog containing this pane
      startLat - initial latitude in fractional degrees North
      startLon - initial longitude in fractional degrees East
  • Method Details

    • getEndPoint

      public Point2D getEndPoint()
      Get the current end point of the great circle route.
      Returns:
      Point2D containing the latitude and longitude of the end point
    • getStartPoint

      public Point2D getStartPoint()
      Get the current start point of the great circle route.
      Returns:
      Point2D containing the latitude and longitude of the start point
    • getEndAGLM

      public float getEndAGLM()
      Get the end point's altitude above ground level (AGL).
      Returns:
      altitude in meters
    • setEndAGLM

      public void setEndAGLM(float endAGLM)
      Set the end point's altitude above ground level (AGL).
      Parameters:
      endAGLM - altitude in meters
    • getStartAGLM

      public float getStartAGLM()
      Get the start point's altitude above ground level (AGL).
      Returns:
      altitude in meters
    • setStartAGLM

      public void setStartAGLM(float startAGLM)
      Set the start point's altitude above ground level (AGL).
      Parameters:
      startAGLM - altitude in meters
    • setStartPoint

      public void setStartPoint(Point2D pt)
      Set the current start point of the great circle route.
      Parameters:
      pt - Point2D containing the latitude and longitude of the start point
    • setEndPoint

      public void setEndPoint(Point2D pt)
      Set the current end point of the great circle route.
      Parameters:
      pt - Point2D containing the latitude and longitude of the end point
    • paintComponent

      protected void paintComponent(Graphics g)
      Paint the LineOfSightPanel.
      Overrides:
      paintComponent in class JComponent
      Parameters:
      g - the Graphics object to protect
      See Also:
    • getStartUpTilt

      public float getStartUpTilt()
      Compute the uptilt (downtilt is negative) at the starting point to look at the ending point, relative to the start point's tangential horizontal plane.
      Returns:
      uptilt in degrees
    • 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
    • componentHidden

      public void componentHidden(ComponentEvent e)
      Callback invoked when the LineOfSightPanel has been made invisible.
      Specified by:
      componentHidden in interface ComponentListener
    • componentResized

      public void componentResized(ComponentEvent e)
      Callback invoked when the component's size changes.
      Specified by:
      componentResized in interface ComponentListener
    • componentMoved

      public void componentMoved(ComponentEvent e)
      Callback invoked when the component's position changes.
      Specified by:
      componentMoved in interface ComponentListener
    • componentShown

      public void componentShown(ComponentEvent e)
      Callback invoked when the LineOfSightPanel has been made visible.
      Specified by:
      componentShown in interface ComponentListener
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Callback invoked when the mouse button has been clicked (pressed and released) on a LineOfSightPanel.
      Specified by:
      mouseClicked in interface MouseListener
    • mousePressed

      public void mousePressed(MouseEvent e)
      Callback invoked when a mouse button has been pressed on a LineOfSightPanel.
      Specified by:
      mousePressed in interface MouseListener
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Callback invoked when a mouse button has been released on a LineOfSightPanel.
      Specified by:
      mouseReleased in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Callback invoked when the mouse enters a LineOfSightPanel.
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent e)
      Callback invoked when the mouse exits a LineOfSightPanel.
      Specified by:
      mouseExited in interface MouseListener
    • update

      public void update(Observable o, Object arg)
      This method is called whenever the observed AttentionAlert is cancelled.
      Specified by:
      update in interface Observer
      Parameters:
      o - the observable AttentionAlert.
      arg - an argument passed to the notifyObservers method.