Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Sparks-Lu opened this issue Jul 9, 2020 · 2 comments

Comments

@Sparks-Lu
Copy link

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

@Samanoova
Copy link

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

@freegroup
Copy link
Owner

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
      }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants