draw2d icon indicating copy to clipboard operation
draw2d copied to clipboard

When a port is pressed, the circle turns bigger. Is it possible to disable this?

Open Sparks-Lu opened this issue 4 years ago • 2 comments

image If it's possible, how to do? Thanks in advance.

Sparks-Lu avatar Jul 09 '20 10:07 Sparks-Lu

Hi @Sparks-Lu did you find the solution for that?

Samanoova avatar Jan 20 '21 11:01 Samanoova

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
      }

freegroup avatar Jan 20 '21 12:01 freegroup