Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic previous diagram node showing on current diagram (Read 2032 times)
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
previous diagram node showing on current diagram
Dec 8th, 2020 at 6:42am
Print Post  
I have one singlepointercontroller method that i used for original position set,
but i have added on node cancel  remove overlapping related thing for current canceled node.
in this event i added my own method and checked overlapping .
after diagram.clearAll() still it is showing previous diagram node for checking overlapping
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: previous diagram node showing on current diagram
Reply #1 - Dec 8th, 2020 at 8:26am
Print Post  
What are you doing with controllers exactly? If there is a current controller, diagram.clearAll does not cancel it but only removes items from diagram's collections, and Controller.drawInteraction will keep drawing its node. If you've read that much of diagram's code, you can stop drawInteraction from running by replicating whatever happens in MouseInputDispatcher.onMouseUp handler - diagram.mouseInputDispatcher.currentController = null should be the gist of it, but calling cancel and clearing some state fields might be necessary too.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: previous diagram node showing on current diagram
Reply #2 - Dec 8th, 2020 at 9:14am
Print Post  
I do not understand can you please explain in javascript how to do?
I have one problem is like i already have one diagram after clicking on new i am clearing this diagram and creating new but some how previous node list  is showing on event singlepointercontroller in this.diagram .

Can you please give me more detail information while creating new object of diagram what i need to  clear data ?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: previous diagram node showing on current diagram
Reply #3 - Dec 8th, 2020 at 11:15am
Print Post  
What do you mean by previous node list, something about NodeListView? I'd expect you should know what you are doing if using internal implementation class like SinglePointerController. Please post whatever code you have related to it.
  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: previous diagram node showing on current diagram
Reply #4 - Dec 8th, 2020 at 11:51am
Print Post  
previous node list mean suppose i have one diagram object and i have added some node in this diagram. now i  will clear this old(previous)diagram object and creating new diagram object with new node list for this new diagram object when below event is called it is showing this.diagram object old data(i mean previous data) ,
mdiag.SinglePointerController.prototype.cancel = function (position) {
            const overlappedNode = [];
            this.originalStates.forEach(
                function (item, state) {
                    if (MindFusion.AbstractionLayer.isInstanceOfType(mdiag.DiagramNode, item)) {
                        item.restoreLocationState(this);
                        overlappedNode.push(item);
                    }

                }, this);
            this.originalStates.forEach(
                function (item, state) {
                    if (MindFusion.AbstractionLayer.isInstanceOfType(mdiag.DiagramLink, item))
                        item.restoreLocationState(this);
                }, this);
            if (this.diagram)
                this.diagram.cancelCompositeOperation();
}
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: previous diagram node showing on current diagram
Reply #5 - Dec 9th, 2020 at 11:32am
Print Post  
So if you replace the diagram in your page UI while 'this' controller's instance is being used, the controller's diagram field will still point to the old diagram. I guess try replacing the controller's diagram value too, or finish using the controller states before replacing the diagram instance.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint