uavsim.graphics.instruments.vorreceiver
Class VORDMEReceiver

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

public class VORDMEReceiver
extends A_RectangularInstrument

Defines a receiver for a VOR station.

Author:
Dan Tappan [14.07.11]

Field Summary
private  PushButton _buttonExchange
          the button to exchange the active and standby frequencies
private static ButtonProperties _buttonExchangeProperties
          the exchange-button properties
private  VOR_ILS_DME_Frequency _frequencyActive
          the active frequency in the left display
private  VOR_ILS_DME_Frequency _frequencyStandby
          the standby frequency on the right display
private  Knob _knobPrimary
          the primary knob for setting the frequency
private static KnobProperties _knobPrimaryProperties
          the primary-knob properties
private  Knob _knobSecondary
          the secondary knob for setting the frequency
private static KnobProperties _knobSecondaryProperties
          the secondary-knob properties
private static TextProperties BUTTON_LABEL_PROPERTIES
          the text properties of the knob label
private static RectangularFaceplaceDescriptor FACEPLATE
          the faceplace
private static TextProperties FREQUENCIES_TEXT
          the text properties of the frequencies
private static java.awt.Color FREQUENCY_WINDOW_BODY_COLOR
          the color of the frequency window
private static java.awt.Color FREQUENCY_WINDOW_OUTLINE_COLOR
          the color of the frequency window outline
private static Scaler FREQUENCY_WINDOW_OUTLINE_SCALE
          the size scale of the window outline relative to the instrument size
private static ScalerPair FREQUENCY_WINDOW_SIZE_SCALE
          the size scale of the window relative to the instrument size
private static CoordinateCartesianRelative FREQUENCY1_WINDOW_ANCHOR_SCALE
          the anchor position of the active-frequency window relative to the center of the instrument
private static CoordinateCartesianRelative FREQUENCY2_WINDOW_ANCHOR_SCALE
          the anchor position of the standby-frequency window relative to the center of the instrument
private static TextProperties KNOB_PRIMARY_LABEL_PROPERTIES
          the text properties of the primary knob
private static VOR_ILS_DME_Frequency KNOB_PRIMARY_STEP
          the step value of the primary knob
private static TextProperties KNOB_SECONDARY_LABEL_PROPERTIES
          the text properties of the secondary knob
private static VOR_ILS_DME_Frequency KNOB_SECONDARY_STEP
          the step value of 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
VORDMEReceiver(java.lang.String id, int canvasSize, CoordinateCartesianAbsolute canvasAnchor)
          Creates a VOR receiver.
 
Method Summary
private  void configureControls()
          Configures the controls.
 VOR_ILS_DME_Frequency getFrequencyActive()
          Gets the azimuth.
 VOR_ILS_DME_Frequency getFrequencyStandby()
          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 controls.
private  void renderFrequencyWindow(CoordinateCartesianRelative anchorRelative, VOR_ILS_DME_Frequency frequency)
          Renders a frequency window.
private  void renderFrequencyWindows()
          Renders the frequency windows.
 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

_buttonExchange

private final PushButton _buttonExchange
the button to exchange the active and standby frequencies


_buttonExchangeProperties

private static final ButtonProperties _buttonExchangeProperties
the exchange-button properties


_frequencyActive

private VOR_ILS_DME_Frequency _frequencyActive
the active frequency in the left display


_frequencyStandby

private VOR_ILS_DME_Frequency _frequencyStandby
the standby frequency on the right display


_knobPrimary

private final Knob _knobPrimary
the primary knob for setting the frequency


_knobPrimaryProperties

private static final KnobProperties _knobPrimaryProperties
the primary-knob properties


_knobSecondary

private final Knob _knobSecondary
the secondary knob for setting the frequency


_knobSecondaryProperties

private static final KnobProperties _knobSecondaryProperties
the secondary-knob properties


BUTTON_LABEL_PROPERTIES

private static final TextProperties BUTTON_LABEL_PROPERTIES
the text properties of the knob label


FACEPLATE

private static final RectangularFaceplaceDescriptor FACEPLATE
the faceplace


FREQUENCIES_TEXT

private static final TextProperties FREQUENCIES_TEXT
the text properties of the frequencies


FREQUENCY_WINDOW_BODY_COLOR

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


FREQUENCY_WINDOW_OUTLINE_COLOR

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


FREQUENCY_WINDOW_OUTLINE_SCALE

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


FREQUENCY_WINDOW_SIZE_SCALE

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


FREQUENCY1_WINDOW_ANCHOR_SCALE

private static final CoordinateCartesianRelative FREQUENCY1_WINDOW_ANCHOR_SCALE
the anchor position of the active-frequency window relative to the center of the instrument


FREQUENCY2_WINDOW_ANCHOR_SCALE

private static final CoordinateCartesianRelative FREQUENCY2_WINDOW_ANCHOR_SCALE
the anchor position of the standby-frequency window relative to the center of the instrument


KNOB_PRIMARY_LABEL_PROPERTIES

private static final TextProperties KNOB_PRIMARY_LABEL_PROPERTIES
the text properties of the primary knob


KNOB_PRIMARY_STEP

private static final VOR_ILS_DME_Frequency KNOB_PRIMARY_STEP
the step value of the primary knob


KNOB_SECONDARY_LABEL_PROPERTIES

private static final TextProperties KNOB_SECONDARY_LABEL_PROPERTIES
the text properties of the secondary knob


KNOB_SECONDARY_STEP

private static final VOR_ILS_DME_Frequency KNOB_SECONDARY_STEP
the step value of the secondary knob

Constructor Detail

VORDMEReceiver

public VORDMEReceiver(java.lang.String id,
                      int canvasSize,
                      CoordinateCartesianAbsolute canvasAnchor)
Creates a VOR 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

configureControls

private void configureControls()
Configures the controls.


getFrequencyActive

public VOR_ILS_DME_Frequency getFrequencyActive()
Gets the azimuth.

Returns:
the azimuth

getFrequencyStandby

public VOR_ILS_DME_Frequency getFrequencyStandby()
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 controls.


renderFrequencyWindow

private void renderFrequencyWindow(CoordinateCartesianRelative anchorRelative,
                                   VOR_ILS_DME_Frequency frequency)
Renders a frequency window.

Parameters:
anchorRelative - - the relative position of the window from the center of the instrument
frequency - - the frequency

renderFrequencyWindows

private void renderFrequencyWindows()
Renders the frequency windows.


toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object