Telogis.GeoBase.Canvas.Shapes.AbstractShape |
AbstractShape inherits from AbstractDOMEntity.
An abstract base class for every type of primitive, defining the basic functionality and structure common to all. Derivations of this should be created and returned by Canvas drawing calls, and never constructed explicitly. Their properties may be manipulated directly, but changes to them will only be made visible once Canvas.Shapes.AbstractShape.draw is called (usually from Canvas.update. This constructor performs the registration of the Canvas.Shapes.AbstractShape within the calling Canvas, and also sets up the DOM sub-tree for the shape, if necessary.
Type | Description |
---|---|
Errors.ArgumentTypeError | If no valid canvas was passed to the Canvas.Shapes.AbstractShape constructor. |
Name | Description |
---|---|
AbstractShape(canvas) | Arguments
|
Name | Description |
---|---|
destroy () | Removes the primitive from its Canvas.Shapes.AbstractShape._canvas renderer, and breaks the referential cycle between the two. This is called automatically when this Canvas is destroyed, but may also be called explicitly to remove the Canvas.Shapes.AbstractShape from the display. |
draw () | Displays any changes to the properties of the Canvas.Shapes.AbstractShape. If the Canvas implementation uses a raster-graphics API, this involves acquiring a rendering context for the canvas and passing it to a specialized drawing function; if it uses a vector-graphics API, this involves updating the attributes of the shape's underlying DOM to reflect its current properties. This method is called automatically by Canvas.update. |
Name | Type | Description |
---|---|---|
fillColor | Color | The color to fill the Canvas.Shapes.AbstractShape with. If this is null, filling is disabled. This may be modified directly, and the changes displayed with a call to Canvas.update. |
lineColor | Color | The color to stroke the Canvas.Shapes.AbstractShape with. If this is null, line stroking is disabled. This may be modified directly, and the changes displayed with a call to Canvas.update. |