Skip to content

1 to many and many to 1 connections #98

Answered by eckig
amitjoy asked this question in Q&A
Discussion options

You must be logged in to vote

For both modes you need to supply your own io.github.eckig.grapheditor.GConnectorValidator that allows multiple connections from and/or to connectors.

This is a quick hack that does the trick, so you know where to start:

graphEditor.setConnectorValidator(new DefaultConnectorValidator(){
            @Override
            public boolean validate(final GConnector source, final GConnector target) {

                if (source.getType() == null || target.getType() == null) {
                    return false;
                } else if (source.getParent().equals(target.getParent())) {
                    return false;
                }

                final boolean sourceIsInput = DefaultConnec…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@amitjoy
Comment options

Answer selected by amitjoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants