Implementations of this interface are responsible for creating masters and style sheets for specific IModelItems and their styles.
Remarks
They are registered at a VsdxExportConfiguration. Usually, there is no need to implement this interface directly. Instead, extend the MasterProviderBase class.
The VsdxExportConfiguration holds a list of IMasterProviders which will called in the order of this list until one master provider returns a value.
Implementations are also responsible for caching masters, so they can be used for multiple items. See CachingMasterProvider for this.
Members
Methods
Note that a master or style sheet is only valid for the same export run it was created.
Implemented in
MasterProviderBase.clearedge
(edge: IEdge, context: MasterProviderContext): Promise<[ ShapeStyleConfiguration, null]> | ShapeStyleConfiguration | nullabstractSee node.
edge
(edge: IEdge, context: MasterProviderContext): Promise<[ ShapeStyleConfiguration, null]> | ShapeStyleConfiguration | nullSee node.
Parameters
- edge: IEdge
- context: MasterProviderContext
Return Value
Implemented in
MasterProviderBase.edgelabel
(label: ILabel, context: MasterProviderContext): Promise<[ ShapeStyleConfiguration, null]> | ShapeStyleConfiguration | nullabstractSee node.
label
(label: ILabel, context: MasterProviderContext): Promise<[ ShapeStyleConfiguration, null]> | ShapeStyleConfiguration | nullSee node.
Parameters
- label: ILabel
- context: MasterProviderContext
Return Value
Implemented in
MasterProviderBase.labelnode
(node: INode, context: MasterProviderContext): Promise<[ ShapeStyleConfiguration, null]> | ShapeStyleConfiguration | nullabstractWill be called once for each node in the graph and shall return a VSDX Master and VSDX
StyleSheets or an empty Promise.
node
(node: INode, context: MasterProviderContext): Promise<[ ShapeStyleConfiguration, null]> | ShapeStyleConfiguration | nullWill 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]> | ShapeStyleConfiguration | null
- A promise with an object containing a master and style sheets to stop the propagation or an empty promise.
Implemented in
MasterProviderBase.nodeport
(port: IPort, context: MasterProviderContext): Promise<[ ShapeStyleConfiguration, null]> | ShapeStyleConfiguration | nullabstractSee node.
port
(port: IPort, context: MasterProviderContext): Promise<[ ShapeStyleConfiguration, null]> | ShapeStyleConfiguration | nullSee node.
Parameters
- port: IPort
- context: MasterProviderContext