An abstract base class that provides functionality for caching Master and StyleSheet instances.
Remarks
For each yFiles style instance, this master provider shall accept, one set of Master and StyleSheet instances is created and stored in a map. These instances will be returned for any future graph items with the same yFiles style instance.
Members
Constructors
Initializes a new instance of the CachingMasterProvider class.
Initializes a new instance of the CachingMasterProvider class.
The user should pass one or multiple style types that this master provider shall accept.
Parameters
- nodeStyleType?: ClassConstructor<INodeStyle>
- edgeStyleType?: ClassConstructor<IEdgeStyle>
- portStyleType?: ClassConstructor<IPortStyle>
- labelStyleType?: ClassConstructor<ILabelStyle>
Initializes a new instance of the CachingMasterProvider class.
Initializes a new instance of the CachingMasterProvider class.
The user should pass one or multiple style types that this master provider shall accept.
Parameters
- nodeStyleType?: ClassConstructor<INodeStyle>
- edgeStyleType?: ClassConstructor<IEdgeStyle>
- portStyleType?: ClassConstructor<IPortStyle>
- labelStyleType?: ClassConstructor<ILabelStyle>
Methods
Note that a master or style sheet is only valid for the same export run it was created.
Overrides
MasterProviderBase.clearOverridden in
ImageNodeProvider.clearcreateForEdge
(edge: IEdge, context: MasterProviderContext): Promise<ShapeStyleConfiguration> | ShapeStyleConfigurationprotectedThis method shall create an object containing a master and style sheets that will be cached
for later calls. You do not need to check if the item's style has the correct type.
createForEdge
(edge: IEdge, context: MasterProviderContext): Promise<ShapeStyleConfiguration> | ShapeStyleConfigurationThis method shall create an object containing a master and style sheets that will be cached for later calls. You do not need to check if the item's style has the correct type.
createForLabel
(label: ILabel, context: MasterProviderContext): Promise<ShapeStyleConfiguration> | ShapeStyleConfigurationprotectedThis method shall create an object containing a master and style sheets that will be cached
for later calls. You do not need to check if the item's style has the correct type.
createForLabel
(label: ILabel, context: MasterProviderContext): Promise<ShapeStyleConfiguration> | ShapeStyleConfigurationThis method shall create an object containing a master and style sheets that will be cached for later calls. You do not need to check if the item's style has the correct type.
createForNode
(node: INode, context: MasterProviderContext): Promise<ShapeStyleConfiguration> | ShapeStyleConfigurationprotectedThis method shall create an object containing a master and style sheets that will be cached
for later calls. You do not need to check if the item's style has the correct type.
createForNode
(node: INode, context: MasterProviderContext): Promise<ShapeStyleConfiguration> | ShapeStyleConfigurationThis method shall create an object containing a master and style sheets that will be cached for later calls. You do not need to check if the item's style has the correct type.
createForPort
(port: IPort, context: MasterProviderContext): Promise<ShapeStyleConfiguration> | ShapeStyleConfigurationprotectedThis method shall create an object containing a master and style sheets that will be cached
for later calls. You do not need to check if the item's style has the correct type.
createForPort
(port: IPort, context: MasterProviderContext): Promise<ShapeStyleConfiguration> | ShapeStyleConfigurationThis method shall create an object containing a master and style sheets that will be cached for later calls. You do not need to check if the item's style has the correct type.
See node.
See node.
See node.
See node.
Parameters
- label: ILabel
- context: MasterProviderContext
Return Value
Overrides
MasterProviderBase.labelOverridden in
LabelProvider.labelWill be called once for each node in the graph and shall return a VSDX Master and VSDX
StyleSheets or an empty Promise.
Will be called once for each node in the graph and shall return a VSDX Master and VSDX StyleSheets or an empty Promise.
When this method returns a value the propagation will be stopped and the returned master and styles are used for the shape representing this node. Otherwise, this node will be propagated through other IMasterProviders in the chain after this one.
Parameters
- node: INode
The node to create the master and styles for.
- context: MasterProviderContext
Return Value
- Promise<[ShapeStyleConfiguration, null]>
- A promise with an object containing a master and style sheets to stop the propagation or an empty promise.
Overrides
MasterProviderBase.nodeSee node.
See node.