uavsim.graphics.instruments
Class A_RectangularInstrument

java.lang.Object
  extended by uavsim.graphics.instruments.A_Instrument
      extended by uavsim.graphics.instruments.A_RectangularInstrument
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, javax.swing.event.MouseInputListener
Direct Known Subclasses:
ADFReceiver, Autopilot, DMEMarkerIndicator, GPSMap, NavCommSelector, StallEnunciator, VORDMEReceiver

public abstract class A_RectangularInstrument
extends A_Instrument

Defines the shared elements of all resizeable rectangular instruments.

Author:
Dan Tappan [14.07.11]

Field Summary
protected  RectangularFaceplaceDescriptor _faceplaceDescriptor
          the faceplate descriptor
protected  Size _faceSize
          the faceplace size in pixels
 
Fields inherited from class uavsim.graphics.instruments.A_Instrument
_canvasAnchor, _canvasSize, _graphics, _id
 
Constructor Summary
A_RectangularInstrument(java.lang.String id, int canvasSize, CoordinateCartesianAbsolute canvasAnchor, RectangularFaceplaceDescriptor faceplaceDescriptor)
          Creates an abstract rectangular instrument.
 
Method Summary
 Size getFaceSize()
          Gets the faceplace size in pixels.
 void render(java.awt.Graphics graphics)
          Renders the current state of the instrument.
protected  void renderBox()
          Renders the mount ring.
 
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, toString, wait, wait, wait
 

Field Detail

_faceplaceDescriptor

protected final RectangularFaceplaceDescriptor _faceplaceDescriptor
the faceplate descriptor


_faceSize

protected Size _faceSize
the faceplace size in pixels

Constructor Detail

A_RectangularInstrument

public A_RectangularInstrument(java.lang.String id,
                               int canvasSize,
                               CoordinateCartesianAbsolute canvasAnchor,
                               RectangularFaceplaceDescriptor faceplaceDescriptor)
Creates an abstract rectangular 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
faceplaceDescriptor - - the faceplate descriptor
Method Detail

getFaceSize

public Size getFaceSize()
Gets the faceplace size in pixels.

Returns:
the size

render

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

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

renderBox

protected void renderBox()
Renders the mount ring.