Optional
line: null | Linethe Line to display
Optional
proto: null | DisplayLinethe prototype DisplayLine to inherit properties from
Private
color_Color used when drawing the line, a CSS3 color value.
Private
lineLine dash array used when drawing the line. Corresponds to lengths of dashes
and spaces, in screen coordinates. For example, [3, 5]
alternates dashes of
length 3 with spaces of length 5. Empty array indicates solid line.
Private
scale_Scaling factor to adjust length of line.
Private
thickness_Thickness to use when drawing the line, in screen coordinates, so a unit is a screen pixel.
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
Color used when drawing the line, a CSS3 color value.
this object for chaining setters
Line dash array used when drawing the line. Corresponds to lengths of dashes
and spaces, in screen coordinates. For example, [3, 5]
alternates dashes of
length 3 with spaces of length 5. Empty array indicates solid line.
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 scale factor that adjusts length of line. The start point of the line is unchanged. The end point is moved so the line has a length = scale * the current length.
this object for chaining setters
Thickness to use when drawing the line, in screen coordinates, so a unit is a screen pixel. Line will appear only with positive thickness. Can be set to zero to make the line disappear.
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 a Line as a colored line.
The position is determined by the position of the Line, so setPosition has no effect, and the DisplayLine is never dragable. The position is reported as the midpoint of the Line by getPosition.