+ (this.refLabels[label.id] = ref)}>
+ {this.props.diagramEngine
+ .getFactoryForLabel(label)
+ .generateReactWidget(this.props.diagramEngine, label)}
+
+
+ );
+ }
+
+ generateLink(path: string, extraProps: any, id: string | number): JSX.Element {
+ var props = this.props;
+
+ var Bottom = React.cloneElement(
+ (props.diagramEngine.getFactoryForLink(this.props.link) as LabViewLinkFactory).generateLinkSegment(
+ this.props.link,
+ this,
+ this.state.selected || this.props.link.isSelected(),
+ path
+ ),
+ {
+ ref: ref => ref && this.refPaths.push(ref)
+ }
+ );
+
+ var Top = React.cloneElement(Bottom, {
+ ...extraProps,
+ strokeLinecap: "round",
+ onMouseLeave: () => {
+ this.setState({ selected: false });
+ },
+ onMouseEnter: () => {
+ this.setState({ selected: true });
+ },
+ ref: null,
+ "data-linkid": this.props.link.getID(),
+ strokeOpacity: this.state.selected ? 0.1 : 0,
+ strokeWidth: 20,
+ onContextMenu: () => {
+ if (!this.props.diagramEngine.isModelLocked(this.props.link)) {
+ event.preventDefault();
+ this.props.link.remove();
+ }
+ }
+ });
+
+ return (
+