See Also
Developer's Guide
API
- IVisualCreator
Members
Properties
Gets the Canvas that is associated with this context.
Defined in
ICanvasContext.canvasComponentGets the clipping rectangle in world coordinates.
Rendering outside of this clip may be skipped altogether.
Usually this is the viewport rectangle of the canvasComponent, but may also be a sub-region of it. For image export or printing, this is the rectangle that's exported or printed on a page.
In the default implementations, this property automatically distinguishes between different radii depending on the last interaction event type.
This value already takes the zoom level into account.
See Also
Developer's Guide
Defined in
ICanvasContext.hitTestRadiusGets a transform that can be added to the transform list of a visual to be displayed in the intermediate coordinate system (which still has the same axes directions as the world coordinate system, but doesn't include the projection).
Property Value
Provides access to the SvgDefsManager that manages this instance.
Gets a transform that can be added to the transform list of a visual to be displayed in the view coordinate system.
Property Value
See Also
Developer's Guide
Provides access to the WebGLSupport that provides convenience methods for WebGL rendering.
Defined in
ICanvasContext.zoomMethods
Notifies the context that the visual has been removed from the visual tree.
visual has been removed from the visual tree.This has to be done in a IVisualCreator's updateVisual method if a IVisualCreator's createVisual is called or a previously added visual will be removed or replaced. Calling this method will call a previously registered dispose visual callback that the visual has been removed and needs to free its resources.
If the visual has not been registered previously this method will do nothing.
Parameters
- visual: Visual
- The visual which has been removed.
See Also
Adds an element to the defs section of the document, if it has not been added yet.
Parameters
- defsSupport: ISvgDefsCreator
- The instance that is used to create and update the element and to query if the element is still referenced
Return Value
- string
- The id of the element with which it can be referenced using an url reference.
Defined in
ICanvasContext.getDefsIdConverts the given set of intermediate coordinates to a coordinate pair that can be used to render within the viewTransform.
Parameters
- intermediatePoint: Point
- The coordinates in the intermediate coordinate system.
Return Value
- Point
- The coordinates in the view coordinate system.
null implementations for the types, nor does it have to return the same instance any time. Also, it depends on the type and context whether the instance returned stays up to date or needs to be re-obtained for further use.Parameters
- type: Constructor<T>
- the type for which an instance shall be returned
Return Value
- T
- an instance that is assignable to the type or
null
See Also
Developer's Guide
Defined in
ILookup.lookupregisterForChildrenIfNecessary
<TVisual> (visual: TVisual, callback: function(IRenderContext, TVisual, boolean): TVisual)Registers a visual if children have registered themselves for disposal.
registerForChildrenIfNecessary
<TVisual> (visual: TVisual, callback: function(IRenderContext, TVisual, boolean): TVisual)This is necessary for visual creators which delegate to another visual creator to create one or more child visuals, like style decorators.
Implementors have to add a call to this method at the end of their createVisual and updateVisual methods.
The registered callback has to call childVisualRemoved on all child visuals of the visual.
Parameters
- visual: TVisual
- The visual to be registered. This is the visual which is returned by the createVisual or updateVisual method which calls this method.
- callback: function(IRenderContext, TVisual, boolean): TVisual
- A dispose visual callback which calls childVisualRemoved on all child visuals of the registered
visual.A callback which will be called to free the resources that are occupied by the givenremovedVisualwhen the visual will be removed.Clients have to register this callback in a createVisual method using method setDisposeCallback if the visual occupies resources that have to be cleaned up after the visual is no longer needed.
The method will be called when the
removedVisualis removed to free the resources that are allocated by that visual.This callback can also be used to support caching for temporarily removed visuals. A visual is removed temporarily when it is moved out of the viewport and re-added when it is moved back into the viewport.
If the visual should be cached, the callback has to return the visual. When it is re-added, updateVisual is called for the visual. Note that it is possible that the visual will not be cached or discarded without further notice. Thus, this callback has to free its resources (if necessary) for temporarily removed visuals, too. As a consequence, for cached visuals the updateVisual method has to be able to re-allocate the necessary resources.
Parameters- context: IRenderContext
- A valid render context.
- removedVisual: TVisual
- The visual whose resources need to be freed.
- dispose: boolean
- Indicates that the visual is not going to be used again in any case and can be disposed for good. In the case that this parameter is set to
true, clients should take this as a signal to free the resources used by theremovedVisual. If this parameter is set to false, the visual is eventually made visible in the scene graph of the CanvasComponent again and may therefore be reused.
Return Value- TVisual
- The removed visual if it should be cached,
nullotherwise.
setDisposeCallback
<TVisual> (visual: TVisual, callback: function(IRenderContext, TVisual, boolean): TVisual)Registers a callback which will be called when the visual will be removed from the visual tree.
setDisposeCallback
<TVisual> (visual: TVisual, callback: function(IRenderContext, TVisual, boolean): TVisual)callback which will be called when the visual will be removed from the visual tree.This applies to a IVisualCreator's createVisual method if the created visual allocates resources which should be freed after the visual is no longer used. In this case, the visual has to be registered together with a dispose visual callback which can free the allocated resources. The callback will be called by the framework when the visual is removed from the visual tree.
The callback can also be used to support caching for temporarily removed visuals. See dispose visual callback.
Parameters
- visual: TVisual
- The visual which needs to be disposed after removal.
- callback: function(IRenderContext, TVisual, boolean): TVisual
- A callback which will dispose the
visual.A callback which will be called to free the resources that are occupied by the givenremovedVisualwhen the visual will be removed.Clients have to register this callback in a createVisual method using method setDisposeCallback if the visual occupies resources that have to be cleaned up after the visual is no longer needed.
The method will be called when the
removedVisualis removed to free the resources that are allocated by that visual.This callback can also be used to support caching for temporarily removed visuals. A visual is removed temporarily when it is moved out of the viewport and re-added when it is moved back into the viewport.
If the visual should be cached, the callback has to return the visual. When it is re-added, updateVisual is called for the visual. Note that it is possible that the visual will not be cached or discarded without further notice. Thus, this callback has to free its resources (if necessary) for temporarily removed visuals, too. As a consequence, for cached visuals the updateVisual method has to be able to re-allocate the necessary resources.
Parameters- context: IRenderContext
- A valid render context.
- removedVisual: TVisual
- The visual whose resources need to be freed.
- dispose: boolean
- Indicates that the visual is not going to be used again in any case and can be disposed for good. In the case that this parameter is set to
true, clients should take this as a signal to free the resources used by theremovedVisual. If this parameter is set to false, the visual is eventually made visible in the scene graph of the CanvasComponent again and may therefore be reused.
Return Value- TVisual
- The removed visual if it should be cached,
nullotherwise.