123456789101112131415161718192021222324252627282930313233343536373839 |
- import * as SRD from "storm-react-diagrams";
- import { LightInformationNodeWidget } from "./lightInformationNodeWidget";
- import { LightInformationNodeModel } from "./lightInformationNodeModel";
- import * as React from "react";
- import { GlobalState } from '../../../globalState';
- /**
- * Node factory which creates editor nodes
- */
- export class LightInformationNodeFactory extends SRD.AbstractNodeFactory {
- private _globalState: GlobalState;
- /**
- * Constructs a LightNodeFactory
- */
- constructor(globalState: GlobalState) {
- super("light-information");
- this._globalState = globalState;
- }
- /**
- * Generates a node widget
- * @param diagramEngine diagram engine
- * @param node node to generate
- * @returns node widget jsx
- */
- generateReactWidget(diagramEngine: SRD.DiagramEngine, node: LightInformationNodeModel): JSX.Element {
- return <LightInformationNodeWidget node={node} globalState={this._globalState} />;
- }
- /**
- * Gets a new instance of a node model
- * @returns light node model
- */
- getNewInstance() {
- return new LightInformationNodeModel();
- }
- }
|