API / geotoolkit / flowcharts / plugins / VisualFactory / VisualFactory
plugins.VisualFactory.VisualFactory
Factory that is used for creating Diagram Visual prototypes. getInstance returns a singleton instance, otherwise, new visual prototypes can be registered with registerPlugin method.
Example
import {VisualFactory} from '@int/geotoolkit/flowcharts/plugins/VisualFactory';
import {DiagramVisual} from '@int/geotoolkit/flowcharts/shapes/DiagramVisual';
VisualFactory.getInstance().registerPlugin(new DiagramVisual({...}))Constructors
Methods
Methods
▸ getDefaultFillStyle(): FillStyle
Gets a default fill style that should be applied to all newly created visuals
a fill style instance
▸ getDefaultLineStyle(): LineStyle
Gets a default line style that should be applied to all newly created visuals
a line style instance
▸ getPlugins(): IComponent[]
Gets all available plugins
▸ getVisual(prototypeId, width?, height?): Component
Creates a new visual plugin instance using the given prototypeId name
| Name | Type | Description |
|---|---|---|
prototypeId | string | class name for a component to create |
Optional width | number | the desired width of the newly created component. If not set, a default value from prototype will be used |
Optional height | number | the desired height of the newly created component. If not set, a default value from prototype will be used |
a new visual plugin instance or null if an error has occured
▸ registerPlugin(component): void
Registers the given component in the factory
| Name | Type | Description |
|---|---|---|
component | Component | a visual plugin instance |
void
▸ setDefaultFillStyle(fillStyle, merge?): VisualFactory
Sets a default fill style that should be applied to all newly created visuals
| Name | Type | Description |
|---|---|---|
fillStyle | Type | a fill style instance |
Optional merge | boolean | true if you want to merge fillStyle with existing attribute, false by default |
this
▸ setDefaultLineStyle(lineStyle, merge?): VisualFactory
Sets a default line style that should be applied to all newly created visuals
| Name | Type | Description |
|---|---|---|
lineStyle | Type | a line style instance |
Optional merge | boolean | true if you want to merge lineStyle with existing attribute, false by default |
this
▸ Static getInstance(): VisualFactory
Gets a singleton instance
factory