Central interface used by the CanvasComponent to render elements from the scene graph.
Inheritance Hierarchy
Remarks
Implementations will be queried using the tag for the corresponding implementations of the various aspects of the render tag.
This interface can conveniently be implemented by subclassing ObjectRendererBase<TRenderTag, TVisual>.
Type Parameters
TRenderTag
See Also
Developer's Guide
API
- ObjectRendererBase, RenderTree
Members
No filters for this type
Methods
Returns an implementation of IBoundsProvider that can determine the visible bounds of the rendering of the render tag.
Returns an implementation of IBoundsProvider that can determine the visible bounds of the rendering of the render tag.
This method may always return the same instance. By contract, clients will not cache instances returned, but will always call this method before the methods on the instance will be called. This contract enables the use of the flyweight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.
abstract
Parameters
- renderTag: TRenderTag
- the render tag to query the bounds for
Return Value
- IBoundsProvider
- An implementation of IBoundsProvider to determine the bounds of the visualization.
Implemented in
HandlesRenderer.getBoundsProvider, GraphOverviewRenderer.getBoundsProvider, GridRenderer.getBoundsProvider, ObjectRendererBase.getBoundsProvider, PortCandidateRenderer.getBoundsProvider, EdgeStyleIndicatorRenderer.getBoundsProvider, LabelStyleIndicatorRenderer.getBoundsProvider, NodeStyleIndicatorRenderer.getBoundsProvider, PortStyleIndicatorRenderer.getBoundsProvider, EdgeStyleIndicatorRenderer.getBoundsProvider, LabelStyleIndicatorRenderer.getBoundsProvider, NodeStyleIndicatorRenderer.getBoundsProvider, PortStyleIndicatorRenderer.getBoundsProvider, EdgeStyleIndicatorRenderer.getBoundsProvider, LabelStyleIndicatorRenderer.getBoundsProvider, NodeStyleIndicatorRenderer.getBoundsProvider, PortStyleIndicatorRenderer.getBoundsProviderReturns an implementation of IHitTestable that can determine whether the rendering of the render tag has been hit at a given coordinate.
Returns an implementation of IHitTestable that can determine whether the rendering of the render tag has been hit at a given coordinate.
This method may always return the same instance. By contract, clients will not cache instances returned, but will always call this method before the methods on the instance will be called. This contract enables the use of the flyweight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.
abstract
Parameters
- renderTag: TRenderTag
- the render tag to do the hit testing for
Return Value
- IHitTestable
- An implementation of IHitTestable to determine visibility.
Implemented in
HandlesRenderer.getHitTestable, GraphOverviewRenderer.getHitTestable, GridRenderer.getHitTestable, ObjectRendererBase.getHitTestable, PortCandidateRenderer.getHitTestable, EdgeStyleIndicatorRenderer.getHitTestable, LabelStyleIndicatorRenderer.getHitTestable, NodeStyleIndicatorRenderer.getHitTestable, PortStyleIndicatorRenderer.getHitTestable, EdgeStyleIndicatorRenderer.getHitTestable, LabelStyleIndicatorRenderer.getHitTestable, NodeStyleIndicatorRenderer.getHitTestable, PortStyleIndicatorRenderer.getHitTestable, EdgeStyleIndicatorRenderer.getHitTestable, LabelStyleIndicatorRenderer.getHitTestable, NodeStyleIndicatorRenderer.getHitTestable, PortStyleIndicatorRenderer.getHitTestableReturns an implementation of IVisibilityTestable that can determine if the rendering of the render tag would be visible in a given context.
Returns an implementation of IVisibilityTestable that can determine if the rendering of the render tag would be visible in a given context.
This method may always return the same instance. By contract clients will not cache instances returned but will always call this method before the methods on the instance will be called. This contract enables the use of the flyweight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.
abstract
Parameters
- renderTag: TRenderTag
- the render tag to query visibility for
Return Value
- IVisibilityTestable
- An implementation of IVisibilityTestable to determine visibility.
Implemented in
HandlesRenderer.getVisibilityTestable, GraphOverviewRenderer.getVisibilityTestable, GridRenderer.getVisibilityTestable, ObjectRendererBase.getVisibilityTestable, PortCandidateRenderer.getVisibilityTestable, EdgeStyleIndicatorRenderer.getVisibilityTestable, LabelStyleIndicatorRenderer.getVisibilityTestable, NodeStyleIndicatorRenderer.getVisibilityTestable, PortStyleIndicatorRenderer.getVisibilityTestable, EdgeStyleIndicatorRenderer.getVisibilityTestable, LabelStyleIndicatorRenderer.getVisibilityTestable, NodeStyleIndicatorRenderer.getVisibilityTestable, PortStyleIndicatorRenderer.getVisibilityTestable, EdgeStyleIndicatorRenderer.getVisibilityTestable, LabelStyleIndicatorRenderer.getVisibilityTestable, NodeStyleIndicatorRenderer.getVisibilityTestable, PortStyleIndicatorRenderer.getVisibilityTestableReturns an implementation of IVisualCreator that will create the Visual tree for the render tag.
Returns an implementation of IVisualCreator that will create the Visual tree for the render tag.
This method may always return the same instance. By contract, clients will not cache instances returned, but will always call this method before the methods on the instance will be called. This contract enables the use of the flyweight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.
abstract
Parameters
- renderTag: TRenderTag
- the render tag to create a Visual for
Return Value
- IVisualCreator
- An implementation of IVisualCreator to create or update the visualization.
See Also
Developer's Guide
Implemented in
HandlesRenderer.getVisualCreator, GraphOverviewRenderer.getVisualCreator, GridRenderer.getVisualCreator, ObjectRendererBase.getVisualCreator, PortCandidateRenderer.getVisualCreator, EdgeStyleIndicatorRenderer.getVisualCreator, LabelStyleIndicatorRenderer.getVisualCreator, NodeStyleIndicatorRenderer.getVisualCreator, PortStyleIndicatorRenderer.getVisualCreator, EdgeStyleIndicatorRenderer.getVisualCreator, LabelStyleIndicatorRenderer.getVisualCreator, NodeStyleIndicatorRenderer.getVisualCreator, PortStyleIndicatorRenderer.getVisualCreator, EdgeStyleIndicatorRenderer.getVisualCreator, LabelStyleIndicatorRenderer.getVisualCreator, NodeStyleIndicatorRenderer.getVisualCreator, PortStyleIndicatorRenderer.getVisualCreatorConstants
static
Examples
Adding a visualization. The renderer queries the tag's lookup for an IVisualCreator instance.
// the node provides an IVisualCreator via its lookup
const renderTreeElement = graphComponent.renderTree.createElement(
graphComponent.renderTree.backgroundGroup,
node,
)Examples
Adding a visualization. The renderer installs the provided
image to the canvas.const image = window.document.createElementNS(
'http://www.w3.org/2000/svg',
'image',
)
image.setAttributeNS(
'http://www.w3.org/1999/xlink',
'href',
'resources/background.png',
)
image.x.baseVal.value = 1
image.y.baseVal.value = 1
image.width.baseVal.value = 100
image.height.baseVal.value = 100
const visual = new SvgVisual(image)
graphComponent.renderTree.createElement(
graphComponent.renderTree.rootGroup,
visual,
)A renderer that treats tag as an instance of IVisualCreator.
A renderer that treats tag as an instance of IVisualCreator.
This renderer tries to cast the tag to IVisualCreator and use this instance to handle the visual representation of the IRenderTreeElement.
If the tag does not implement IVisualCreator nothing will be displayed.
static
Examples
Adding a visualization. The tag is an IVisualCreator instance.
const renderTreeElement = graphComponent.renderTree.createElement(
graphComponent.renderTree.backgroundGroup,
new RectangleVisualCreator(rectangle),
)An immutable and shareable instance of the IObjectRenderer<T> class that renders nothing.
An immutable and shareable instance of the IObjectRenderer<T> class that renders nothing.