|
|||||||||
| 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<Time>
uavsim.graphics.instruments.clock.ClockBasic
public class ClockBasic
Defines an analog clock with a second hand.
| Field Summary | |
|---|---|
private Time |
_time
the time |
private static CircularFaceplateDescriptor<Time> |
FACEPLATE
the faceplate descriptor |
private static java.awt.Color |
HAND_PIVOT_COLOR
the color of the pivot circle at the common base of the hands |
private static Scaler |
HAND_PIVOT_SCALE
the size scale of the pivot circle relative to the instrument size |
private static NeedleDescriptor |
HOUR_HAND
the needle for the hour hand |
private static TickDescriptor<Time> |
MAJOR_TICKS
the major-ticks descriptor |
private static TickDescriptor<Time> |
MINOR_TICKS
the minor-ticks descriptor |
private static NeedleDescriptor |
MINUTE_HAND
the needle for the minute hand |
private static NumberDescriptor<Time> |
NUMBERS
the numbers descriptor |
private static TextProperties |
NUMBERS_TEXT
the text properties of the numbers |
private static NeedleDescriptor |
SECOND_HAND
the needle for the second hand |
private static Time |
TIME_END
the end time on the faceplate |
private static Time |
TIME_START
the start time on the faceplate |
| 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 | |
|---|---|
ClockBasic(java.lang.String id,
int canvasSize,
CoordinateCartesianAbsolute canvasAnchor)
Creates an analog clock. |
|
| Method Summary | |
|---|---|
Time |
getTime()
Gets the time. |
AngleMathematical |
mapAngle_(Time time)
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 |
renderHands()
Renders the hands. |
private void |
renderNumbers()
Renders the numbers. |
private void |
renderTicks()
Renders the minor and major ticks. |
java.lang.String |
toString()
|
void |
update(Time time)
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 Time _time
private static final CircularFaceplateDescriptor<Time> FACEPLATE
private static final java.awt.Color HAND_PIVOT_COLOR
private static final Scaler HAND_PIVOT_SCALE
private static final NeedleDescriptor HOUR_HAND
private static final TickDescriptor<Time> MAJOR_TICKS
private static final TickDescriptor<Time> MINOR_TICKS
private static final NeedleDescriptor MINUTE_HAND
private static final NumberDescriptor<Time> NUMBERS
private static final TextProperties NUMBERS_TEXT
private static final NeedleDescriptor SECOND_HAND
private static final Time TIME_END
private static final Time TIME_START
| Constructor Detail |
|---|
public ClockBasic(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 Time getTime()
public AngleMathematical mapAngle_(Time time)
time - - the unit
public void render(java.awt.Graphics graphics)
render in class A_CircularInstrument<Time>graphics - - the graphics contextprivate void renderHands()
private void renderNumbers()
private void renderTicks()
public java.lang.String toString()
toString in class java.lang.Objectpublic void update(Time time)
time - - the time
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||