C

StripeStyleBase<TVisual>
abstract

An abstract base class that makes it possible to easily implement a custom IStripeStyle.
ImplementsInheritance Hierarchy

Remarks

The only method that needs to be implemented by subclasses is createVisual, however to improve rendering performance it is highly recommended to implement at least updateVisual, too.

Unlike a direct IStripeStyle implementation, StripeStyleBase<TVisual> does not expose a separate IStripeStyleRenderer. The base class uses a fixed renderer and simply forwards its calls back to the style instance.

Note that if your subclass has private fields (defined with JavaScript's # name syntax), the clone method needs to be overridden for the cloning to work properly.

Type Parameters

TVisual

The optional type of the created and updated by the and methods. This type argument can be omitted, but specifying a more concrete type helps conveniently implementing with TypeScript.

See Also

Developer's Guide

Members

Show:

Constructors

Initializes a new instance of the StripeStyleBase<TVisual> class.

Properties

Gets the renderer implementation for this instance.
The private implementation will delegate all API calls back to this instance.
readonlyfinal

Methods

Creates a new object that is a copy of the current instance.

Immutable subclasses should consider returning this for the best performance.

The base class implementation creates a simple shallow clone that copies all own properties to a new instance. This will not work for classes that use private fields or properties (defined with JavaScript's # name syntax) as no constructors will be run and implementations like this cannot be accessed from outside the classes that declare them.

Classes that use private members or require special initialization must override this method and manually create a new instance or call super.clone() and then explicitly copy the private fields and properties explicitly.

Return Value

Object
A new object that is a copy of this instance using a memberwise clone.
Creates the visual.
This method is called in response to a createVisual call to the instance that has been queried from the renderer.
protectedabstract

Parameters

context: IRenderContext
stripe: IStripe
The stripe to which this style instance is assigned.

Return Value

TVisual
The visual as required by the createVisual interface.

See Also

API
updateVisual
Performs the lookup operation for the getContext that has been queried from the renderer.

This implementation yields null for everything but:

For these interfaces an implementation will be returned that delegates to the methods in this instance.

protected

Parameters

stripe: IStripe
The stripe to use for the context lookup.
type: Constructor
The type to query.

Return Value

Object
An implementation of the type or null.
Updates the visual previously created by createVisual.
This method is called in response to a updateVisual call to the instance that has been queried from the renderer. This implementation simply delegates to createVisual so subclasses should override to improve rendering performance.
protected

Parameters

context: IRenderContext
oldVisual: TVisual
The visual that has been created in the call to createVisual.
stripe: IStripe
The stripe to which this style instance is assigned.

Return Value

TVisual
The visual as required by the createVisual interface.

See Also

API
createVisual