Hi Lyubo,
Thank you! It works.
May I know how to customize the node label which I've attached to the node like this. Points are displayed on mouse over and selection. But, for points, I need to fill color on mouse over and need to change border color on selection of the label (similar to link selection).
private createCompositeNode(diagramElement: DiagramElement): CompositeNode {
var node = new this.DiagramNode();
node.setBounds(new Rect(diagramElement.x, diagramElement.y, diagramElement.width, diagramElement.height));
node.setMainImage(diagramElement.imageSource);
node.setHandlesStyle(common.Diagramming.HandlesStyle.EasyMove);
var compNode = node as CompositeNode;
var mainImageComponent = compNode.getComponent("MainImage") as any;
mainImageComponent.image.width = diagramElement.width;
mainImageComponent.image.height = diagramElement.height;
node.setHandlesStyle(MindFusion.Diagramming.HandlesStyle.Custom);
this.diagram.addItem(node);
var nodeName = this.addNodeName(this.diagram, diagramElement);
this.diagram.addItem(nodeName);
node.attach(nodeName);
return compNode;
}
private addNodeName(diagram: Diagram, diagramElement: DiagramElement): ShapeNode {
var nameNode = diagram.getFactory().createShapeNode(diagramElement.x, diagramElement.y + 60, 50, 20);
nameNode.setEnableStyledText(true);
nameNode.setText(diagramElement.name);
nameNode.setFont(new Font("Verdana", 10));
nameNode.setAllowOutgoingLinks(false);
nameNode.setAllowIncomingLinks(false);
nameNode.setTransparent(true);
nameNode.setHandlesStyle(common.Diagramming.HandlesStyle.EasyMove);
nameNode.setStroke("Orange");
nameNode.setStrokeThickness(5);
return nameNode;
}
Regards,
Kannan
Lyubo wrote on Jun 26
th, 2019 at 12:23pm:
Hi,
You can set the
ModificationStart property to
AutoHandles. That will show the handles on mouse hover:
diagram.setModificationStart(MindFusion.Diagramming.ModificationStart.AutoHandles);
Regards,
Lyubo