Click or drag to resize

Telogis.GeoBase.Canvas.Shapes.AbstractShape

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
AbstractShape Class

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.

Exceptions
TypeDescription
Errors.ArgumentTypeErrorIf no valid canvas was passed to the Canvas.Shapes.AbstractShape constructor.
Constructor
NameDescription
AbstractShape(canvas)

Arguments

  • canvas (Canvas) - A reference to the canvas that the Canvas.Shapes.AbstractShape should be rendered on. This defines the initial fill and stroke states for the shape, and also the context in which it should be displayed.

Functions
NameDescription
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.

Properties
NameTypeDescription
fillColorColor

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.

lineColorColor

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.