uavsim.graphics.instruments.dme
Class DMEMarkerIndicator

java.lang.Object
  extended by uavsim.graphics.instruments.A_Instrument
      extended by uavsim.graphics.instruments.A_RectangularInstrument
          extended by uavsim.graphics.instruments.dme.DMEMarkerIndicator
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, javax.swing.event.MouseInputListener

public class DMEMarkerIndicator
extends A_RectangularInstrument

Defines a display for distance measuring equipment (DME). It always indicates a distance, even when there is no valid signal from a VOR station. zzz

Author:
Dan Tappan [16.07.11]

Nested Class Summary
static class DMEMarkerIndicator.E_Marker
          Defines the marker beacons that can be indicated.
private static class DMEMarkerIndicator.MarkerDescriptor
          Defines the indicator light for a marker.
 
Field Summary
private  Distance _distance
          the distance to the station
private  boolean _isDMEAlive
          zzz
private  DMEMarkerIndicator.E_Marker _marker
          the active marker
private static DMEMarkerIndicator.MarkerDescriptor _markerInnerDescriptor
          the inner-marker descriptor
private static DMEMarkerIndicator.MarkerDescriptor _markerMiddleDescriptor
          the middle-marker descriptor
private static DMEMarkerIndicator.MarkerDescriptor _markerOuterDescriptor
          the outer-marker descriptor
private static TextProperties DISTANCE_TEXT
          the text properties of the distance
private static CoordinateCartesianRelative DISTANCE_WINDOW_ANCHOR_SCALE
          the anchor position of the display relative to the center of the instrument
private static java.awt.Color DISTANCE_WINDOW_BODY_COLOR
          the color of the window body
private static java.awt.Color DISTANCE_WINDOW_OUTLINE_COLOR
          the color of the window body outline
private static Scaler DISTANCE_WINDOW_OUTLINE_SCALE
          the size scale of the distance-window outline relative to the instrument size
private static ScalerPair DISTANCE_WINDOW_SIZE_SCALE
          the size scale of the distance window relative to the instrument size
private static RectangularFaceplaceDescriptor FACEPLATE
          the faceplace
private  java.text.DecimalFormat FORMATTER
          the distance format
private static java.awt.Color MARKER_OUTLINE_COLOR
          the color of the marker outline
private static Scaler MARKER_OUTLINE_SCALE
          the size scale of the marker outline relative to the instrument size
private static Scaler MARKER_SIZE_SCALE
          the size scale of the marker relative to the instrument size
 
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
DMEMarkerIndicator(java.lang.String id, int canvasSize, CoordinateCartesianAbsolute canvasAnchor)
          Creates a DME instrument.
 
Method Summary
 Distance getDistance()
          Gets the azimuth.
 DMEMarkerIndicator.E_Marker getMarker()
          Gets the active marker.
 void render(java.awt.Graphics graphics)
          Renders the current state of the instrument.
private  void renderDistanceWindow()
          Renders the distance window.
private  void renderMarker(DMEMarkerIndicator.MarkerDescriptor descriptor, boolean isActive)
          Renders a marker.
private  void renderMarkers()
          Renders the markers.
 java.lang.String toString()
          
 void update()
          Updates the state of the instrument without rendering it.
 void update(Distance distance)
          Updates the state of the instrument without rendering it.
 void update(DMEMarkerIndicator.E_Marker marker)
          Updates the state of the instrument without rendering it.
 
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, handleControlCallback, hasControls, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, 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

_distance

private Distance _distance
the distance to the station


_isDMEAlive

private boolean _isDMEAlive
zzz


_marker

private DMEMarkerIndicator.E_Marker _marker
the active marker


_markerInnerDescriptor

private static final DMEMarkerIndicator.MarkerDescriptor _markerInnerDescriptor
the inner-marker descriptor


_markerMiddleDescriptor

private static final DMEMarkerIndicator.MarkerDescriptor _markerMiddleDescriptor
the middle-marker descriptor


_markerOuterDescriptor

private static final DMEMarkerIndicator.MarkerDescriptor _markerOuterDescriptor
the outer-marker descriptor


DISTANCE_TEXT

private static final TextProperties DISTANCE_TEXT
the text properties of the distance


DISTANCE_WINDOW_ANCHOR_SCALE

private static final CoordinateCartesianRelative DISTANCE_WINDOW_ANCHOR_SCALE
the anchor position of the display relative to the center of the instrument


DISTANCE_WINDOW_BODY_COLOR

private static final java.awt.Color DISTANCE_WINDOW_BODY_COLOR
the color of the window body


DISTANCE_WINDOW_OUTLINE_COLOR

private static final java.awt.Color DISTANCE_WINDOW_OUTLINE_COLOR
the color of the window body outline


DISTANCE_WINDOW_OUTLINE_SCALE

private static final Scaler DISTANCE_WINDOW_OUTLINE_SCALE
the size scale of the distance-window outline relative to the instrument size


DISTANCE_WINDOW_SIZE_SCALE

private static final ScalerPair DISTANCE_WINDOW_SIZE_SCALE
the size scale of the distance window relative to the instrument size


FACEPLATE

private static final RectangularFaceplaceDescriptor FACEPLATE
the faceplace


FORMATTER

private final java.text.DecimalFormat FORMATTER
the distance format


MARKER_OUTLINE_COLOR

private static final java.awt.Color MARKER_OUTLINE_COLOR
the color of the marker outline


MARKER_OUTLINE_SCALE

private static final Scaler MARKER_OUTLINE_SCALE
the size scale of the marker outline relative to the instrument size


MARKER_SIZE_SCALE

private static final Scaler MARKER_SIZE_SCALE
the size scale of the marker relative to the instrument size

Constructor Detail

DMEMarkerIndicator

public DMEMarkerIndicator(java.lang.String id,
                          int canvasSize,
                          CoordinateCartesianAbsolute canvasAnchor)
Creates a DME instrument.

Parameters:
id - - the unique instrument identifier
canvasSize - - the square size of the instrument footprint in pixels
canvasAnchor - - the anchor position for the center of the canvas in pixels
Method Detail

getDistance

public Distance getDistance()
Gets the azimuth.

Returns:
the azimuth

getMarker

public DMEMarkerIndicator.E_Marker getMarker()
Gets the active marker.

Returns:
the marker

render

public void render(java.awt.Graphics graphics)
Renders the current state of the instrument.

Overrides:
render in class A_RectangularInstrument
Parameters:
graphics - - the graphics context

renderDistanceWindow

private void renderDistanceWindow()
Renders the distance window.


renderMarker

private void renderMarker(DMEMarkerIndicator.MarkerDescriptor descriptor,
                          boolean isActive)
Renders a marker.

Parameters:
descriptor - - the marker descriptor
isActive - - the marker illumination state

renderMarkers

private void renderMarkers()
Renders the markers.


toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

update

public void update()
Updates the state of the instrument without rendering it. This variant is for when there is no DME signal.


update

public void update(Distance distance)
Updates the state of the instrument without rendering it.

Parameters:
distance - - the slant distance to the station

update

public void update(DMEMarkerIndicator.E_Marker marker)
Updates the state of the instrument without rendering it.

Parameters:
marker - - the active marker