How to directly connect nodes without the edge creation tool from the tool palette? #768
-
Hey, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@TheMicDiet Unfortunately, we do not have that example online. However, the basic idea is that the tool manager in GLSP ensures which tools are enabled or disabled. Tools can be registered as default tool or "regular" tool whereas a default tool is enabled by default (e.g., the selection tool which registers a mouse listener to adapt the selected state). This behavior can be managed through the When you click on one of the icons in the tool palette, that particular tool gets enabled and all other tools are disabled (mainly to avoid conflicts between the tools). So to get the behavior you describe, you need to register a connection tool as default tool. That tool can then register a mouse listener on its enablement where you can listen to clicks, dragging, etc. to ensure you get the correct elements that you aim to connect. This should get you started on the right track. |
Beta Was this translation helpful? Give feedback.
@TheMicDiet Unfortunately, we do not have that example online. However, the basic idea is that the tool manager in GLSP ensures which tools are enabled or disabled. Tools can be registered as default tool or "regular" tool whereas a default tool is enabled by default (e.g., the selection tool which registers a mouse listener to adapt the selected state). This behavior can be managed through the
EnableToolsAction
and theEnableDefaultToolsAction
.When you click on one of the icons in the tool palette, that particular tool gets enabled and all other tools are disabled (mainly to avoid conflicts between the tools). So to get the behavior you describe, you need to register a connection tool a…