|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuavsim.graphics.instruments.A_Instrument
uavsim.graphics.instruments.A_RectangularInstrument
uavsim.graphics.instruments.gpsmap.GPSMap
public class GPSMap
Defines a basic moving-map GPS overlain with a navigation chart.
| Field Summary | |
|---|---|
private PushButton |
_buttonOrientation
the orientation button |
private static ButtonProperties |
_buttonOrientationProperties
the orientation-button properties |
private PushButton |
_buttonPower
the power button |
private static ButtonProperties |
_buttonPowerProperties
the power-button properties |
private PushButton |
_buttonZoomIn
the zoom-in button |
private static ButtonProperties |
_buttonZoomInProperties
the zoom-in-button properties |
private PushButton |
_buttonZoomOut
the zoom-out button |
private static ButtonProperties |
_buttonZoomOutProperties
the zoom-out-button properties |
private NavigationChart |
_chart
the navigation chart |
private boolean |
_isMapUpNorth
whether the display is in north-up mode or heading-up mode |
private boolean |
_isPowerOn
whether the power is on |
private CoordinateCartesianAbsolute |
_mapCenter
the pixel center of the map |
private Interval<Latitude> |
_mapLatitudeInterval
the vertical interval of the map scale |
private Interval<Longitude> |
_mapLongitudeInterval
the horizontal interval of the map scale |
private Size |
_mapSize
the pixel size of the map |
private CoordinateWorld |
_selectedCoordinate
the word coordinate referenced by the mouse position |
private SevenDOFDescriptor |
_spatialDescriptor
the spatial descriptor |
private java.util.List<CoordinateWorld3D> |
_track
the track history |
private int |
_trackSampleCountdown
the countdown to triggering a track sample |
private double |
_zoom
the zoom factor. |
private static double[][] |
AIRPLANE
the polygon description of the airplane |
private static java.awt.Color |
AIRPLANE_COLOR
the color of the airplane glyph |
private static Scaler |
AIRPLANE_SCALE
the size scale of the airplane relative to the instrument size |
private static CoordinateCartesianRelative |
ALTITUDE_ANCHOR_SCALE
the anchor position of the altitude text relative to the center of the instrument |
private static TextProperties |
ALTITUDE_TEXT
the text properties of the altitude |
private static CoordinateCartesianRelative |
BEARING_ANCHOR_SCALE
the anchor position of the bearing text relative to the center of the instrument |
private static TextProperties |
BUTTON_LABEL_PROPERTIES
the text properties of the knob label |
private static CoordinateCartesianRelative |
COORDINATES_CURRENT_ANCHOR_SCALE
the anchor position of the actual-coordinates text relative to the center of the instrument |
private static CoordinateCartesianRelative |
COORDINATES_SELECTED_ANCHOR_SCALE
the anchor position of the selected-coordinates text relative to the center of the instrument |
private static TextProperties |
COORDINATES_TEXT
the text properties of the coordinates |
private static TextProperties |
DISTANCE_TEXT
the text properties of the distance |
private static RectangularFaceplaceDescriptor |
FACEPLATE
the faceplace |
private static java.awt.Color |
GRID_COLOR
the color of the latitude/longitude grid |
private static CoordinateCartesianRelative |
HEADING_ANCHOR_SCALE
the anchor position of the heading text relative to the center of the instrument |
private static TextProperties |
HEADING_TEXT
the text properties of the heading |
private static CoordinateCartesianRelative |
MAP_WINDOW_ANCHOR_SCALE
the anchor position of the map window relative to the center of the instrument |
private static java.awt.Color |
MAP_WINDOW_OUTLINE_COLOR
the color of the window outline |
private static Scaler |
MAP_WINDOW_OUTLINE_SCALE
the size scale of the map-window outline relative to the instrument size |
private static java.awt.Color |
MAP_WINDOW_POWER_OFF_BODY_COLOR
the color of the power button in off mode |
static java.awt.Color |
MAP_WINDOW_POWER_ON_BODY_COLOR
the color of the power button in on mode |
private static ScalerPair |
MAP_WINDOW_SIZE_SCALE
the size scale of the window relative to the instrument size |
private static java.awt.Color |
NORTH_INDICATOR_COLOR
the color of the barb indicating north |
private static CoordinateWorld |
NORTH_INDICATOR_PRIMARY_OFFSET
the length of the north-indicator barb |
private static CoordinateWorld |
NORTH_INDICATOR_SECONDARY_OFFSET
the length of the shortened north-indicator barb that is hidden by the regular one. |
(package private) int |
PROFILE_SAMPLE_WINDOW_SIZE
the number of altitude previous samples to display in the profile view |
(package private) double |
PROFILE_VERTICAL_SIZE
the vertical size of the profile view relative to the map vertical size |
private static java.awt.Color |
TRACK_HORIZONTAL_COLOR
the color of the horizontal track |
private static int |
TRACK_SAMPLE_RATE
the sample rate as a function of calls to update() for recording track entries |
private static java.awt.Color |
TRACK_VERTICAL_COLOR
the color of the vertical track |
private static double |
ZOOM_DEFAULT
the default zoom factor |
private static double |
ZOOM_MAX
the maximum zoom factor |
private static double |
ZOOM_MIN
the minimum zoom factor |
private static double |
ZOOM_STEP
the zoom step |
| Fields inherited from class uavsim.graphics.instruments.A_RectangularInstrument |
|---|
_faceplaceDescriptor, _faceSize |
| Fields inherited from class uavsim.graphics.instruments.A_Instrument |
|---|
_canvasAnchor, _canvasSize, _graphics, _id |
| Constructor Summary | |
|---|---|
GPSMap(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor,
NavigationChart chart)
Creates a GPS map. |
|
| Method Summary | |
|---|---|
private void |
configureControls()
Configures the control.s |
NavigationChart |
getChart()
Gets the navigation chart. |
SevenDOFDescriptor |
getSpatialDescriptor()
Gets the spatial descriptor of the aircraft. |
void |
handleControlCallback(ControlCallbackEvent event)
Handles an event from a registered control. |
CoordinateWorld |
mapWindowCoordinateToWorldCoordinate_(CoordinateCartesianAbsolute coordinateWindow)
Translates a window coordinate in pixels to a world coordinate in latitude and longitude. |
CoordinateCartesianAbsolute |
mapWorldCoordinateToWindowCoordinate_(CoordinateWorld coordinateWorld)
Translates a world coordinate in latitude and longitude to a window coordinate in pixels. |
double |
mapWorldDistanceToWindowDistance_(Latitude distance)
Computes a world distance in latitude to a window distance in pixels. |
void |
mouseMoved(java.awt.event.MouseEvent event)
|
void |
render(java.awt.Graphics graphics)
Renders the current state of the instrument. |
private void |
renderAirplane()
Renders the needle. |
private void |
renderChart(boolean areDetailsVisible)
Renders the chart. |
private void |
renderControls()
Renders the controls. |
private void |
renderGrid()
Renders the latitude/longitude grid. |
private void |
renderInfo()
Renders the text information. |
private void |
renderMapFrame()
Renders the map frame. |
private void |
renderMapWindow()
Renders the map window. |
private void |
renderNorthIndicator(CoordinateWorld coordinate)
Renders the barb indicate north from the aircraft. |
private void |
renderTrackHorizontal()
Renders the aircraft horizontal track. |
private void |
renderTrackVertical()
Renders the aircraft vertical track. |
private void |
sampleTrack()
Records a entry in the track history at the defined sample rate. |
java.lang.String |
toString()
|
void |
update(SevenDOFDescriptor spatialDescriptor)
Updates the state of the instrument without rendering it. |
private void |
updateMapScale()
Updates the map scale. |
| Methods inherited from class uavsim.graphics.instruments.A_RectangularInstrument |
|---|
getFaceSize, renderBox |
| Methods inherited from class uavsim.graphics.instruments.A_Instrument |
|---|
getAnchor, getCanvasSize, getGraphics, getID, getParentComponent, hasControls, mouseClicked, mouseDragged, mouseEntered, mouseExited, mousePressed, mouseReleased, refresh, registerControl, setCanvasAnchor, setCanvasSize, setParentComponent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final PushButton _buttonOrientation
private static final ButtonProperties _buttonOrientationProperties
private final PushButton _buttonPower
private static final ButtonProperties _buttonPowerProperties
private final PushButton _buttonZoomIn
private static final ButtonProperties _buttonZoomInProperties
private final PushButton _buttonZoomOut
private static final ButtonProperties _buttonZoomOutProperties
private final NavigationChart _chart
private boolean _isMapUpNorth
private boolean _isPowerOn
private CoordinateCartesianAbsolute _mapCenter
private Interval<Latitude> _mapLatitudeInterval
private Interval<Longitude> _mapLongitudeInterval
private Size _mapSize
private CoordinateWorld _selectedCoordinate
private SevenDOFDescriptor _spatialDescriptor
private final java.util.List<CoordinateWorld3D> _track
private int _trackSampleCountdown
private double _zoom
private static final double[][] AIRPLANE
private static final java.awt.Color AIRPLANE_COLOR
private static final Scaler AIRPLANE_SCALE
private static final CoordinateCartesianRelative ALTITUDE_ANCHOR_SCALE
private static final TextProperties ALTITUDE_TEXT
private static final CoordinateCartesianRelative BEARING_ANCHOR_SCALE
private static final TextProperties BUTTON_LABEL_PROPERTIES
private static final CoordinateCartesianRelative COORDINATES_CURRENT_ANCHOR_SCALE
private static final CoordinateCartesianRelative COORDINATES_SELECTED_ANCHOR_SCALE
private static final TextProperties COORDINATES_TEXT
private static final TextProperties DISTANCE_TEXT
private static final RectangularFaceplaceDescriptor FACEPLATE
private static final java.awt.Color GRID_COLOR
private static final CoordinateCartesianRelative HEADING_ANCHOR_SCALE
private static final TextProperties HEADING_TEXT
private static final CoordinateCartesianRelative MAP_WINDOW_ANCHOR_SCALE
private static final java.awt.Color MAP_WINDOW_OUTLINE_COLOR
private static final Scaler MAP_WINDOW_OUTLINE_SCALE
private static final java.awt.Color MAP_WINDOW_POWER_OFF_BODY_COLOR
public static final java.awt.Color MAP_WINDOW_POWER_ON_BODY_COLOR
private static final ScalerPair MAP_WINDOW_SIZE_SCALE
private static final java.awt.Color NORTH_INDICATOR_COLOR
private static final CoordinateWorld NORTH_INDICATOR_PRIMARY_OFFSET
private static final CoordinateWorld NORTH_INDICATOR_SECONDARY_OFFSET
final int PROFILE_SAMPLE_WINDOW_SIZE
final double PROFILE_VERTICAL_SIZE
private static final java.awt.Color TRACK_HORIZONTAL_COLOR
private static final int TRACK_SAMPLE_RATE
private static final java.awt.Color TRACK_VERTICAL_COLOR
private static final double ZOOM_DEFAULT
private static final double ZOOM_MAX
private static final double ZOOM_MIN
private static final double ZOOM_STEP
| Constructor Detail |
|---|
public GPSMap(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor,
NavigationChart chart)
id - - the unique instrument identifiercanvasSize - - the square size of the instrument footprint in pixelscanvasAnchor - - the anchor position for the center of the canvas in pixelschart - - the chart providing the navigational elements| Method Detail |
|---|
private void configureControls()
public NavigationChart getChart()
public SevenDOFDescriptor getSpatialDescriptor()
public void handleControlCallback(ControlCallbackEvent event)
handleControlCallback in class A_Instrumentevent - - the callback eventpublic CoordinateWorld mapWindowCoordinateToWorldCoordinate_(CoordinateCartesianAbsolute coordinateWindow)
mapWindowCoordinateToWorldCoordinate_ in interface I_WorldMappablecoordinateWindow - - the window coordinate
public CoordinateCartesianAbsolute mapWorldCoordinateToWindowCoordinate_(CoordinateWorld coordinateWorld)
mapWorldCoordinateToWindowCoordinate_ in interface I_WorldMappablecoordinateWorld - - the world coordinate
public double mapWorldDistanceToWindowDistance_(Latitude distance)
mapWorldDistanceToWindowDistance_ in interface I_WorldMappabledistance - - the world distance
public void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class A_Instrumentpublic void render(java.awt.Graphics graphics)
render in class A_RectangularInstrumentgraphics - - the graphics contextprivate void renderAirplane()
private void renderChart(boolean areDetailsVisible)
areDetailsVisible - - whether to render details at the current zoom levelprivate void renderControls()
private void renderGrid()
private void renderInfo()
private void renderMapFrame()
private void renderMapWindow()
private void renderNorthIndicator(CoordinateWorld coordinate)
coordinate - - the coordinate of the end of the barbprivate void renderTrackHorizontal()
private void renderTrackVertical()
private void sampleTrack()
public java.lang.String toString()
toString in class java.lang.Objectpublic void update(SevenDOFDescriptor spatialDescriptor)
spatialDescriptor - - the spatial descriptorprivate void updateMapScale()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||