Package org.ka2ddo.yaac.gui
Class LineOfSightPane
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.ka2ddo.yaac.gui.LineOfSightPane
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Closeable
,Serializable
,AutoCloseable
,Accessible
,TrackerListener
,GpsDataListener
This pane collects a LineOfSightPanel together with border decoration JLabels.
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Define a callback so other data structures can be updated when one of the AGL sliders is manually updated by the user.Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
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
ConstructorDescriptionLineOfSightPane
(double lat, double lon, boolean isStartPos, String name, GeographicalMap geoMap) Create a LineOfSightPane originated at the specified coordinates.LineOfSightPane
(double lat, double lon, boolean isStartPos, GeoMapGuiIfc geoMap) Create a LineOfSightPane originated at the specified coordinates. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Register a new AGLChangeListener against this LineOfSightPane.void
close()
Closes this pane and releases any system resources associated with it.Get the current extension for drawing the line of sight plot.Get the ending coordinates.Get the starting coordinates.void
gpsDataUpdated
(GPSDistributor distributor, GpsFix currentFix, boolean isLocal, String source) Called by the GPSDistributor when the GPS data has been updated.void
messageAdded
(StationState ss, int index, AX25Message msg) Called when a AX25Message is added to the history for a station in the tracker.void
messageDeleted
(StationState ss, int index, AX25Message msg) Called when a AX25Message is deleted from the history for a station in the tracker.void
Register the keystrokes that can be used to move this object's associated map around.void
Unregister a new AGLChangeListener from this LineOfSightPane.void
satDataUpdated
(GPSDistributor distributor, SatelliteCatalog satCatalog, boolean isLocal, String source) Called when the satellite constellation in use changes.void
setDrawExtraOnLineOfSight
(DrawExtraOnLineOfSight drawExtraOnLineOfSight) Set the current extension for drawing the line of sight plot.void
setEndAGLM
(float aglM) Change the ending point's antenna altitude above ground level.void
setEndName
(String name) Set the name for the ending position.void
setEndPoint
(Point2D pt) Change the ending point of the line of sight path.void
setRemoteStation
(StationState remoteStation) Specify the remote station to be tracked on the right side of the pane.void
setStartAGLM
(float aglM) Change the starting point's antenna altitude above ground level.void
setStartName
(String name) Set the name for the starting position.void
setStartPoint
(Point2D pt) Change the starting point of the line of sight path.void
stationAdded
(StationState ss, int index) Called when a new station is initially added to the tracker.void
stationDeleted
(StationState ss, int index) Called when an existing station is deleted from the tracker.void
Called when an existing station is updated with new information in the tracker.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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
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, 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
-
LineOfSightPane
Create a LineOfSightPane originated at the specified coordinates.- Parameters:
lat
- endpoint latitude in degrees Northlon
- endpoint longitude in degrees EastisStartPos
- boolean true if passed coordinate is the first coordinate, false if secondgeoMap
- 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 Northlon
- endpoint longitude in degrees EastisStartPos
- boolean true if passed coordinate is the first coordinate, false if secondname
- String name of specified end-pointgeoMap
- GeographicalMap window parenting the dialog containing this pane
-
-
Method Details
-
getStartPoint
Get the starting coordinates.- Returns:
- Point2D containing the latitude and longitude of the starting point
-
setStartPoint
Change the starting point of the line of sight path.- Parameters:
pt
- Point2D containing the latitude and longitude of the starting point
-
getEndPoint
Get the ending coordinates.- Returns:
- Point2D containing the latitude and longitude of the ending point
-
setEndPoint
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
Set the name for the starting position.- Parameters:
name
- String name for starting position
-
setEndName
Set the name for the ending position.- Parameters:
name
- String name for ending position
-
setRemoteStation
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
Register a new AGLChangeListener against this LineOfSightPane.- Parameters:
l
- AGLChangeListener to notify of GUI control changes
-
removeAGLChangeListener
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 interfaceGpsDataListener
- Parameters:
distributor
- instance of the GPSDistributorcurrentFix
- current position data reported by the local GPSisLocal
- boolean true if this is GPS data for the local station, false if for a remote GPS receiversource
- 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 interfaceGpsDataListener
- Parameters:
distributor
- instance of the GPSDistributorsatCatalog
- updated SatelliteCatalog instanceisLocal
- boolean true if this is GPS data for the local station, false if for a remote GPS receiversource
- String name assigned to remote GPS receiver, or null if for the local receiver
-
stationAdded
Description copied from interface:TrackerListener
Called when a new station is initially added to the tracker.- Specified by:
stationAdded
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's information; the initial AX25Message will not yet be stored within the StationState objectindex
- zero-based integer sequence number for this station in the StationTracker
-
stationUpdated
Description copied from interface:TrackerListener
Called when an existing station is updated with new information in the tracker.- Specified by:
stationUpdated
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's information
-
stationDeleted
Description copied from interface:TrackerListener
Called when an existing station is deleted from the tracker.- Specified by:
stationDeleted
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's informationindex
- zero-based integer sequence number for this station in the StationTracker
-
messageAdded
Description copied from interface:TrackerListener
Called when a AX25Message is added to the history for a station in the tracker.- Specified by:
messageAdded
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's informationindex
- zero-based index of the message added to the StationState objectmsg
- 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
Description copied from interface:TrackerListener
Called when a AX25Message is deleted from the history for a station in the tracker.- Specified by:
messageDeleted
in interfaceTrackerListener
- Parameters:
ss
- StationState containing the station's information; the AX25Message will already be removed from the StationState objectindex
- zero-based index of the message removed from the StationState objectmsg
- 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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
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
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
-