uavsim.graphics.instruments.adfreceiver
Class ADFReceiver

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

public class ADFReceiver
extends A_RectangularInstrument

Defines a the receiver for an automatic direction finder.

Author:
Dan Tappan [16.07.11]

Field Summary
private  NDBFrequency _frequency
          the frequency
private  Knob _knobPrimary
          the primary knob for major frequency steps
private static KnobProperties _knobPrimaryProperties
          the primary-knob properties
private  Knob _knobSecondary
          the secondary knob for minor frequency steps
private static KnobProperties _knobSecondaryProperties
          the secondary-knob properties
private static RectangularFaceplaceDescriptor FACEPLATE
          the faceplace
private static TextProperties FREQUENCY_TEXT
          the text properties of the frequency
private static CoordinateCartesianRelative FREQUENCY_WINDOW_ANCHOR_SCALE
          the relative position of the frequency window based on the center of the canvas
private static java.awt.Color FREQUENCY_WINDOW_BODY_COLOR
          the color of the window body
private static java.awt.Color FREQUENCY_WINDOW_OUTLINE_COLOR
          the color of the window outline
private static Scaler FREQUENCY_WINDOW_OUTLINE_SCALE
          the size scale of the window outline relative to the frequency window size
private static ScalerPair FREQUENCY_WINDOW_SIZE_SCALE
          the size scale of the frequency window outline relative to the instrument canvas size
private static TextProperties KNOB_LABEL_PROPERTIES
          the knob label properties
private static NDBFrequency KNOB_PRIMARY_STEP
          the major change in frequency caused by adjusting the primary knob
private static NDBFrequency KNOB_SECONDARY_STEP
          the minor change in frequency caused by adjusting the secondary knob
 
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
ADFReceiver(java.lang.String id, int canvasSize, CoordinateCartesianAbsolute canvasAnchor)
          Creates an ADF receiver.
 
Method Summary
private  void configureKnobs()
          Configures the knobs.
 NDBFrequency getFrequency()
          Gets the azimuth.
 void handleControlCallback(ControlCallbackEvent event)
          Handles an event from a registered control.
 void render(java.awt.Graphics graphics)
          Renders the current state of the instrument.
private  void renderControls()
          Renders the knobs.
private  void renderFrequencyWindow()
          Renders the frequency window.
 java.lang.String toString()
          
 
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, 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

_frequency

private NDBFrequency _frequency
the frequency


_knobPrimary

private final Knob _knobPrimary
the primary knob for major frequency steps


_knobPrimaryProperties

private static final KnobProperties _knobPrimaryProperties
the primary-knob properties


_knobSecondary

private final Knob _knobSecondary
the secondary knob for minor frequency steps


_knobSecondaryProperties

private static final KnobProperties _knobSecondaryProperties
the secondary-knob properties


FACEPLATE

private static final RectangularFaceplaceDescriptor FACEPLATE
the faceplace


FREQUENCY_TEXT

private static final TextProperties FREQUENCY_TEXT
the text properties of the frequency


FREQUENCY_WINDOW_ANCHOR_SCALE

private static final CoordinateCartesianRelative FREQUENCY_WINDOW_ANCHOR_SCALE
the relative position of the frequency window based on the center of the canvas


FREQUENCY_WINDOW_BODY_COLOR

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


FREQUENCY_WINDOW_OUTLINE_COLOR

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


FREQUENCY_WINDOW_OUTLINE_SCALE

private static final Scaler FREQUENCY_WINDOW_OUTLINE_SCALE
the size scale of the window outline relative to the frequency window size


FREQUENCY_WINDOW_SIZE_SCALE

private static final ScalerPair FREQUENCY_WINDOW_SIZE_SCALE
the size scale of the frequency window outline relative to the instrument canvas size


KNOB_LABEL_PROPERTIES

private static final TextProperties KNOB_LABEL_PROPERTIES
the knob label properties


KNOB_PRIMARY_STEP

private static final NDBFrequency KNOB_PRIMARY_STEP
the major change in frequency caused by adjusting the primary knob


KNOB_SECONDARY_STEP

private static final NDBFrequency KNOB_SECONDARY_STEP
the minor change in frequency caused by adjusting the secondary knob

Constructor Detail

ADFReceiver

public ADFReceiver(java.lang.String id,
                   int canvasSize,
                   CoordinateCartesianAbsolute canvasAnchor)
Creates an ADF receiver.

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

configureKnobs

private void configureKnobs()
Configures the knobs.


getFrequency

public NDBFrequency getFrequency()
Gets the azimuth.

Returns:
the azimuth

handleControlCallback

public void handleControlCallback(ControlCallbackEvent event)
Handles an event from a registered control. This performs validation only. Its actions must be defined in overridden methods.

Overrides:
handleControlCallback in class A_Instrument
Parameters:
event - - the callback event

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

renderControls

private void renderControls()
Renders the knobs.


renderFrequencyWindow

private void renderFrequencyWindow()
Renders the frequency window.


toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object