Package org.ka2ddo.yaac.gui
Class LineOfSightPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
org.ka2ddo.yaac.gui.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:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
ConstructorDescriptionLineOfSightPanel
(GeoMapGuiIfc geoMap, double startLat, double startLon) Create the LineOfSightPanel with both ends of the great circle route at the same point (for now), -
Method Summary
Modifier and TypeMethodDescriptionvoid
Callback invoked when the LineOfSightPanel has been made invisible.void
Callback invoked when the component's position changes.void
Callback invoked when the component's size changes.void
Callback invoked when the LineOfSightPanel has been made visible.Get the current extension for drawing the line of sight plot.float
Get the end point's altitude above ground level (AGL).Get the current end point of the great circle route.float
Get the start point's altitude above ground level (AGL).Get the current start point of the great circle route.float
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.void
Callback invoked when the mouse button has been clicked (pressed and released) on a LineOfSightPanel.void
Callback invoked when the mouse enters a LineOfSightPanel.void
Callback invoked when the mouse exits a LineOfSightPanel.void
Callback invoked when a mouse button has been pressed on a LineOfSightPanel.void
Callback invoked when a mouse button has been released on a LineOfSightPanel.protected void
Paint the LineOfSightPanel.void
setDrawExtraOnLineOfSight
(DrawExtraOnLineOfSight drawExtraOnLineOfSight) Set the current extension for drawing the line of sight plot.void
setEndAGLM
(float endAGLM) Set the end point's altitude above ground level (AGL).void
setEndPoint
(Point2D pt) Set the current end point of the great circle route.void
setStartAGLM
(float startAGLM) Set the start point's altitude above ground level (AGL).void
setStartPoint
(Point2D pt) Set the current start point of the great circle route.void
update
(Observable o, Object arg) This method is called whenever the observed AttentionAlert is cancelled.Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
LineOfSightPanel
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 panestartLat
- initial latitude in fractional degrees NorthstartLon
- initial longitude in fractional degrees East
-
-
Method Details
-
getEndPoint
Get the current end point of the great circle route.- Returns:
- Point2D containing the latitude and longitude of the end point
-
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
Set the current start point of the great circle route.- Parameters:
pt
- Point2D containing the latitude and longitude of the start point
-
setEndPoint
Set the current end point of the great circle route.- Parameters:
pt
- Point2D containing the latitude and longitude of the end point
-
paintComponent
Paint the LineOfSightPanel.- Overrides:
paintComponent
in classJComponent
- Parameters:
g
- theGraphics
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
Get the current extension for drawing the line of sight plot.- Returns:
- active DrawExtraOnLineOfSight implementation, or null if no extension
-
setDrawExtraOnLineOfSight
Set the current extension for drawing the line of sight plot.- Parameters:
drawExtraOnLineOfSight
- active DrawExtraOnLineOfSight implementation, or null if no extension
-
componentHidden
Callback invoked when the LineOfSightPanel has been made invisible.- Specified by:
componentHidden
in interfaceComponentListener
-
componentResized
Callback invoked when the component's size changes.- Specified by:
componentResized
in interfaceComponentListener
-
componentMoved
Callback invoked when the component's position changes.- Specified by:
componentMoved
in interfaceComponentListener
-
componentShown
Callback invoked when the LineOfSightPanel has been made visible.- Specified by:
componentShown
in interfaceComponentListener
-
mouseClicked
Callback invoked when the mouse button has been clicked (pressed and released) on a LineOfSightPanel.- Specified by:
mouseClicked
in interfaceMouseListener
-
mousePressed
Callback invoked when a mouse button has been pressed on a LineOfSightPanel.- Specified by:
mousePressed
in interfaceMouseListener
-
mouseReleased
Callback invoked when a mouse button has been released on a LineOfSightPanel.- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseEntered
Callback invoked when the mouse enters a LineOfSightPanel.- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
Callback invoked when the mouse exits a LineOfSightPanel.- Specified by:
mouseExited
in interfaceMouseListener
-
update
This method is called whenever the observed AttentionAlert is cancelled.
-