public interface IVisualTemplate
Implementations of this class have the purpose of creating a Node that serves as the visual representation of
the object associated with this instance. This special-purpose interface is only used in some places where the user
interface can be customized. The interface is the main interface used by the CanvasControl.
| Modifier and Type | Method and Description |
|---|---|
Node |
createVisual(IRenderContext context,
RectD bounds,
Object dataObject)
This method is called by the framework to create a
Node with the given bounds that will be included into the IRenderContext. |
Node |
updateVisual(IRenderContext context,
Node oldVisual,
RectD bounds,
Object dataObject)
This method updates or replaces a previously created
Node for inclusion in the IRenderContext. |
Node createVisual(IRenderContext context, RectD bounds, Object dataObject)
Node with the given bounds that will be included into the IRenderContext.context - The context that describes where the visual will be used.bounds - The initial bounds to use for the visual.dataObject - The data object to visualize.null.updateVisual(IRenderContext, Node, RectD, Object)Node updateVisual(IRenderContext context, Node oldVisual, RectD bounds, Object dataObject)
Node for inclusion in the IRenderContext.
The CanvasControl uses this method to give implementations a chance to update an existing
Visual that has previously been created by the same instance during a call to
createVisual(IRenderContext, RectD, Object). Implementation may update the oldVisual and return
that same reference, or create a new visual and return the new instance or null.
context - The context that describes where the visual will be used in.oldVisual - The visual instance that had been returned the last time the createVisual(IRenderContext, RectD, Object) method
was called on this instance.bounds - The initial bounds to use for the visual.dataObject - The data object to visualize.oldVisual, if this instance modified the visual, or a new visual that should replace the existing one in the
canvas object visual tree.