function that returns current simulation time
function that returns current real time
Optional period: numberPeriod of clock in seconds, the time it takes for the seconds hand to wrap around; default is 2 seconds.
Optional radius: numberRadius of clock in simulation coords, default is 1.0.
Optional location: VectorLocation of center of clock, in simulation coords.
Private fillColor to fill circle with; default is transparent white so that it is visible over a black background.
Private font_Font to use for drawing the time, for example '10pt sans-serif'.
Private handColor to draw the second-hand showing simulation time.
Private handThickness of clock hands, in screen coords (1 means one pixel).
Private lastLast sim time drawn.
Private outlineColor to use for drawing the outline of the clock, a CSS3 color value.
Private outlineThickness of outline, in screen coords (1 means one pixel).
Private realColor to draw the second-hand showing real time.
Private textColor to use for drawing the time, a CSS3 color value.
Whether the DisplayObject contains the given world coordinates point.
the point in world coordinates
true if this DisplayObject contains the given point
Draws this DisplayObject using the given CoordMap.
the canvas's context to draw this object into
the mapping to use for translating between simulation and screen coordinates
Returns the set of MassObjects that this DisplayObject represents. Returns an empty list if this DisplayObject doesn't represent a MassObject.
the set of MassObjects that this DisplayObject represents
Sets color to fill circle with; default is transparent white so that it is visible over a black background.
a CSS3 color value
this object for chaining setters
Font used when drawing the text, a CSS font specification.
a CSS font specification
this object for chaining setters
Sets color to draw the second-hand showing simulation time.
a CSS3 color value
this object for chaining setters
Sets thickness of clock hands, in screen coords (1 means one pixel).
this object for chaining setters
Sets color to use for drawing the outline of the clock.
a CSS3 color value
this object for chaining setters
Sets thickness of outline, in screen coords (1 means one pixel).
this object for chaining setters
Sets this DisplayObject's position in simulation coordinates of the containing SimView. Each type of DisplayObject has a different policy regarding whether this will have an effect. Generally the policies are:
If the DisplayObject does not represent a SimObject, then the position can be set. Examples are DisplayClock, EnergyBarGraph.
If the SimObject's position is dependent on other objects, then the position cannot be set. Examples are DisplayConnector, DisplayRope, DisplaySpring.
If the SimObject can be moved independently and isDragable
is true, then the position of the SimObject is modified. Example: DisplayShape.
this DisplayObject's position, in simulation coordinates.
Sets color to draw the second-hand showing real time.
a CSS3 color value
this object for chaining setters
Returns color for drawing the time.
a CSS3 color value
this object for chaining setters
Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.
For an object whose main purpose is to represent another Printable object, it is
recommended to include the result of calling toStringShort on that other object.
For example, calling toStringShort() on a DisplayShape might return something like
this:
DisplayShape{polygon:Polygon{'chain3'}}
a minimal string representation of this object.
Generated using TypeDoc
Draws a clock with two 'second hands': one tracks the simulation time, the other tracks real time. This makes it easy to see whether the simulation time is keeping up with real time.