|
|||||||||
| 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_CircularInstrument<RevolutionsPerMinute>
uavsim.graphics.instruments.tachometer.Tachometer
public class Tachometer
Defines a tachometer.
| Field Summary | |
|---|---|
private RevolutionsPerMinute |
_rpm
the RPM |
private static CircularFaceplateDescriptor<RevolutionsPerMinute> |
FACEPLATE
the faceplate descriptor |
private static ArcDescriptor<RevolutionsPerMinute> |
GREEN_ARC
the arc descriptor for the green arc |
private static TickDescriptor<RevolutionsPerMinute> |
MAJOR_TICKS
the major-ticks descriptor |
private static TickDescriptor<RevolutionsPerMinute> |
MINOR_TICKS
the minor-ticks descriptor |
private static NeedleDescriptor |
NEEDLE
the needle descriptor |
private static NumberDescriptor<RevolutionsPerMinute> |
NUMBERS
the numbers descriptor |
private static TextProperties |
NUMBERS_TEXT
the text properties of the numbers |
private static ArcDescriptor<RevolutionsPerMinute> |
RED_ARC
the arc descriptor for the red arc |
private static RevolutionsPerMinute |
RPM_MAX
the maximum RPM |
private static RevolutionsPerMinute |
RPM_MIN
the minimum RPM |
| Fields inherited from class uavsim.graphics.instruments.A_CircularInstrument |
|---|
_ringSize, DISK_COLOR, MOUNT_RING_COLOR, MOUNT_RING_INNER_SCALE |
| Fields inherited from class uavsim.graphics.instruments.A_Instrument |
|---|
_canvasAnchor, _canvasSize, _graphics, _id |
| Constructor Summary | |
|---|---|
Tachometer(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor)
Creates a tachometer. |
|
| Method Summary | |
|---|---|
RevolutionsPerMinute |
getRevolutionsPerMinute()
Gets the RPM. |
AngleMathematical |
mapAngle_(RevolutionsPerMinute rpm)
Returns the angle corresponding to the value of a unit. |
void |
render(java.awt.Graphics graphics)
Renders the current state of the instrument. |
private void |
renderArcs()
Renders the arcs. |
private void |
renderNeedle()
Renders the needle. |
private void |
renderNumbers()
Renders the numbers. |
private void |
renderTicks()
Renders the major and minor ticks. |
java.lang.String |
toString()
|
void |
update(RevolutionsPerMinute rpm)
Updates the state of the instrument without rendering it. |
| Methods inherited from class uavsim.graphics.instruments.A_CircularInstrument |
|---|
mapAngle, renderDisk, renderMountRing |
| 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 |
|---|
private RevolutionsPerMinute _rpm
private static final CircularFaceplateDescriptor<RevolutionsPerMinute> FACEPLATE
private static final ArcDescriptor<RevolutionsPerMinute> GREEN_ARC
private static final TickDescriptor<RevolutionsPerMinute> MAJOR_TICKS
private static final TickDescriptor<RevolutionsPerMinute> MINOR_TICKS
private static final NeedleDescriptor NEEDLE
private static final NumberDescriptor<RevolutionsPerMinute> NUMBERS
private static final TextProperties NUMBERS_TEXT
private static final ArcDescriptor<RevolutionsPerMinute> RED_ARC
private static final RevolutionsPerMinute RPM_MAX
private static final RevolutionsPerMinute RPM_MIN
| Constructor Detail |
|---|
public Tachometer(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor)
id - - the unique instrument identifiercanvasSize - - the square size of the instrument footprint in pixelscanvasAnchor - - the anchor position for the center of the canvas in pixels| Method Detail |
|---|
public RevolutionsPerMinute getRevolutionsPerMinute()
public AngleMathematical mapAngle_(RevolutionsPerMinute rpm)
rpm - - the unit
public void render(java.awt.Graphics graphics)
render in class A_CircularInstrument<RevolutionsPerMinute>graphics - - the graphics contextprivate void renderArcs()
private void renderNeedle()
private void renderNumbers()
private void renderTicks()
public java.lang.String toString()
toString in class java.lang.Objectpublic void update(RevolutionsPerMinute rpm)
rpm - - the rpm
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||