draw2d
draw2d copied to clipboard
When a port is pressed, the circle turns bigger. Is it possible to disable this?
If it's possible, how to do?
Thanks in advance.
Hi @Sparks-Lu did you find the solution for that?
Hi
you can override the behaviour of the port. Unfortunately this isn't documented well.
All the interaction behaviour for Figures, Canvas and ports are implemented with "Policies". You can write your own or add/remove existing one. For your purpose you can just remove the "grow" one and replace it with a stnadard behaviour. Either after you have created and added your Ports to the shape (in your own constructor), or global for a all ports.
There is a factory method which is caled to create a port which you can override/replace.
draw2d.Configuration.factory.createInputPort= function(){
let port = new draw2d.InputPort();
port.uninstallEditPolicy("draw2d.policy.port.IntrusivePortsFeedbackPolicy")
port.installEditPolicy(new draw2d.policy.port.ElasticStrapFeedbackPolicy())
return port
}
draw2d.Configuration.factory.createOutputPort= function(){
let port = new draw2d.OutputPort();
port.uninstallEditPolicy("draw2d.policy.port.IntrusivePortsFeedbackPolicy")
port.installEditPolicy(new draw2d.policy.port.ElasticStrapFeedbackPolicy())
return port
}