Convenient process creation
ugurdogrusoz opened this issue · 7 comments
When in node creation mode and the current node type is any one of the process nodes, we should allow the user to create the incident edges to the process along with the process by clicking on the substrate node and dragging it to the product node and release the mouse on it. The process node should be created right in between the substrate and the product. Let's discuss the details.
I added this feature. I set the parent of the process (that is created in this action) of the first common ancestor of source and target. If it is undesired I can set it to anything other.
This is great. An important potential improvement is the following:
- Create a single process on mouse release (old behavior) when the node where the left click takes place is not a valid substrate or product (e.g. a process or compartment)
I made that improvement. Also the edge handles was drawn for convenient process creation for example we start draging in a non EPN node. I prevented it because I suppose it was a bug.
Also I realized that currently we are not considering the tap target upon simple node creation. However, we consider it upon convenient process creation. How about considering it upon simple node creation as well. I mean for example if the tap event is ended in the node A, then the node parent would be A or the parent of A if exists.
Yes, let's add nodes to the correct parent in any case
I did it in that way. However, while testing I found out a new issue. If you mouse down and up on an EPN in add node mode when the current node type is a PN. A process with convenient edges is created. Actually this is the expected behaviour algorithmically. However, is it the real expected behaiour. I mean shall we have an exception for process creation with convenient edges if the source and target of the process will be the same node?
Yes, let's disallow source and target being the same node please
I disallow source and target being the same node. I fixed the bug which is preventing process creation with convenient edges when sustainable mode is not active as well.