ObjectRendererBase<TRenderTag,TVisual extends Visual>
An abstract base class for convenient implementation of IObjectRenderer<T>.
Remarks
Type Parameters
- TRenderTag
- The type of the
subclasses will render. This class will cast the render tag to this type before passing it to subclasses. - TVisual: Visual
- The type of the visual this instance will create. Subclasses may declare a fixed type to make implementing
and more convenient.
Type Details
- yFiles module
- view
Constructors
Initializes a new instance of the ObjectRendererBase<TRenderTag,TVisual> class.
Methods
Creates the visual representation for the renderTag
.
Remarks
Parameters
A map of options to pass to the method.
- context - IRenderContext
- The render context.
- renderTag - TRenderTag
- The render tag this instance renders.
Returns
- ↪TVisual?
- The visual as required by the createVisual interface.
See Also
Gets the bounds of the visual for the render tag in the given context.
Remarks
This method is called in response to a getBounds call to the instance that has been queried from the IObjectRenderer<T>.
This implementation returns INFINITE.
Parameters
A map of options to pass to the method.
- context - ICanvasContext
- The canvas context.
- renderTag - TRenderTag
- The render tag this instance renders.
Returns
- ↪Rect
- The bounds of the visual representation.
See Also
Returns an implementation of IBoundsProvider that can determine the visible bounds of the rendering of the render tag.
Remarks
Parameters
A map of options to pass to the method.
- renderTag - TRenderTag
- the render tag to query the bounds for
Returns
- ↪IBoundsProvider
- An implementation of IBoundsProvider to determine the bounds of the visualization.
Implements
Returns an implementation of IHitTestable that can determine whether the rendering of the render tag has been hit at a given coordinate.
Remarks
Parameters
A map of options to pass to the method.
- renderTag - TRenderTag
- the render tag to do the hit testing for
Returns
- ↪IHitTestable
- An implementation of IHitTestable to determine visibility.
Implements
Returns an implementation of IVisibilityTestable that can determine if the rendering of the render tag would be visible in a given context.
Remarks
Parameters
A map of options to pass to the method.
- renderTag - TRenderTag
- the render tag to query visibility for
Returns
- ↪IVisibilityTestable
- An implementation of IVisibilityTestable to determine visibility.
Implements
Returns an implementation of IVisualCreator that will create the Visual tree for the render tag.
Remarks
Parameters
A map of options to pass to the method.
- renderTag - TRenderTag
- the render tag to create a Visual for
Returns
- ↪IVisualCreator
- An implementation of IVisualCreator to create or update the visualization.
Implements
Determines whether the visual representation of the node has been hit at the given location.
Remarks
This method is called in response to a isHit call to the instance that has been queried from the IObjectRenderer<T>.
This implementation always returns false
.
Parameters
A map of options to pass to the method.
- context - IInputModeContext
- The canvas context.
- location - Point
- The point to test.
- renderTag - TRenderTag
- The render tag this instance renders.
Returns
- ↪boolean
false
.
Determines whether the visualization for the specified node is visible in the given area for the given context.
Remarks
This method is called in response to a isVisible call to the instance that has been queried from the IObjectRenderer<T>.
This implementation always returns true
.
Parameters
A map of options to pass to the method.
- context - ICanvasContext
- The canvas context.
- rectangle - Rect
- The visible area.
- renderTag - TRenderTag
- The render tag this instance renders.
Returns
- ↪boolean
true
.
Updates a visual representation for the renderTag
previously created by createVisual.
Remarks
This method is called in response to a updateVisual call to the instance that has been queried from the IObjectRenderer<T>.
This implementation simply delegates to createVisual so subclasses should override to improve rendering performance.
Parameters
A map of options to pass to the method.
- context - IRenderContext
- The render context.
- oldVisual - TVisual
- The visual that has been created in the call to createVisual.
- renderTag - TRenderTag
- The render tag this instance renders.
Returns
- ↪TVisual?
- The visual as required by the createVisual interface.