Optional
proto: null | DisplayPaththe prototype DisplayPath to inherit properties from
Private
defaultDefault style for drawing a path, used as default in addPath.
Private
lastto detect when redraw needed; when the coordmap changes, we need to redraw.
Private
redraw_tells when need to redraw the bitmap from the paths
Private
sequence_sequence numbers indicate when a path has changed.
Private
useWhether to draw into the offscreen buffer.
Adds a Path to the set of paths to display.
the Path to display
Optional
opt_style: DrawingStylethe DrawingStyle to use for drawing this Path; uses the default style if not specified, see setStyle.
Whether the DisplayObject contains the given world coordinates point.
the point in world coordinates
true
if this DisplayObject contains the given point
Whether the Path is in the set of paths to display.
the Path of interest
true
if path
is in the set of paths to display
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
Private
drawthe DrawingStyle to use for drawing the Path
Sets default DrawingStyle used in addPath.
the default DrawingStyle to use when adding a Path
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
Returns the screen rectangle that this DisplayPath is occupying within the LabCanvas, in screen coordinates.
the screen rectangle of this DisplayPath in screen coordinates
Returns DrawingStyle used for drawing a Path.
index of Path
the DrawingStyle being used for drawing the Path
Removes a Path from the set of paths to display.
the Path to remove
Sets default DrawingStyle used in addPath.
the default DrawingStyle to use when adding a Path
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 the screen rectangle that this DisplayPath should occupy within the LabCanvas, in screen coordinates.
the screen coordinates of the area this DisplayPath should occupy.
Sets DrawingStyle used for drawing a Path.
index of Path
the DrawingStyle to use for drawing the Path
Whether to draw the Paths into an offscreen buffer. For a Path that changes every frame, it saves time to not use an offscreen buffer.
Whether to draw the Paths into an offscreen buffer
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
Displays one or more Path's within a specified screen rectangle in the canvas. The screen rectangle is initially empty, so it must be set with setScreenRect. Paths can be added or removed with methods addPath, removePath.
TO DO make DRAW_POINTS settable.
TO DO Could allow setting background color.
TO DO getPosition() and contains() should return something related to position of screenRect.