Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) connecting two container node with elbow connector line while moving node changing the location (Read 7737 times)
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #15 - Jun 10th, 2020 at 2:28pm
Print Post  
yes i have tried this but it's very simple example
what i new observed when i am moving node from another node and put on that other node this node that time links are disconnected
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #16 - Jun 11th, 2020 at 5:55am
Print Post  
If you mean moving nodes into and out of containers, that works correctly in my test with containers.js. I've changed links insides containers there to elbow / cascading style -

Code
Select All
var tl = new MindFusion.Graphs.TreeLayout();
tl.linkType = MindFusion.Graphs.TreeLayoutLinkType.Cascading;
container.arrange(tl); 



If they become unconnected in your project, check for errors in console. An exception in context of mouse events will probably leave links in some incomplete state. If that happens specifically when you move child nodes in/out of containers, check your containerChildAdded / containerChildRemoved event handlers.
  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #17 - Jun 15th, 2020 at 4:40am
Print Post  
There is no error on console but on containerchildadding i have one scope and i do not want to move node in that scope so that's why i put agrs.setcancel(true) and beacuse of this my links are disconnected.
on nodeModifying event or on some other node related event if i did args.cancelDrag(); then link disconnected can you please suggest me if i want this code(args.cancelDrag()) compulsory but not disconnected from link?

and one more case is args.setCancel(true) on adding child i do not want to add that child in scope this also disconnected link from node
« Last Edit: Jun 15th, 2020 at 11:08am by reshma »  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #18 - Jun 15th, 2020 at 2:04pm
Print Post  
We have reproduced. For time being try this for a fix -

Code
Select All
var mdiag = MindFusion.Diagramming;
mdiag.SinglePointerController.prototype.cancel = function (position)
	{
		this.originalStates.forEach(
			function (item, state)
			{
				if (mflayer.isInstanceOfType(mdiag.DiagramNode, item))
					item.restoreLocationState(this);
			}, this);
		this.originalStates.forEach(
			function (item, state)
			{
				if (mflayer.isInstanceOfType(mdiag.DiagramLink, item))
					item.restoreLocationState(this);
			}, this);
		if (this.modifiedDiagram)
			this.modifiedDiagram.cancelCompositeOperation();
	} 



Regards,
Slavcho
« Last Edit: Jun 16th, 2020 at 6:00am by Slavcho »  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #19 - Jun 15th, 2020 at 2:48pm
Print Post  
i have write but i am not getting cancel method for singlepointcontroller
can you please tell me what is originalstate,mflayer ?
i am little confused above code

i write code in below way in angular 4
mdiag.SinglePointerController.prototype.cancel = function (position: Point) {
console.log(position);
console.log("Singlecontroller");
this.originalStates.forEach(
function (item, state) {
//if (mflayer.isInstanceOfType(mdiag.DiagramNode, item))
// item.restoreLocationState(this);
}, this);
this.originalStates.forEach(
function (item, state) {
//if (mflayer.isInstanceOfType(mdiag.DiagramLink, item))
// item.restoreLocationState(this);
}, this);
if (this.diagram)
this.diagram.cancelCompositeOperation();
}
« Last Edit: Jun 16th, 2020 at 6:08am by reshma »  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #20 - Jun 15th, 2020 at 3:33pm
Print Post  
What do you mean by not getting method? Are you trying to code this from TypeScript?
  
Back to top
 
IP Logged
 
reshma
Junior Member
**
Offline


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #21 - Jun 15th, 2020 at 3:42pm
Print Post  
yes i am using typescript i write in above way but not called this method cancel method
i write code in below way in angular 4
mdiag.SinglePointerController.prototype.cancel = function (position: Point) {
console.log(position);
console.log("Singlecontroller");
this.originalStates.forEach(
function (item, state) {
//if (mflayer.isInstanceOfType(mdiag.DiagramNode, item))
// item.restoreLocationState(this);
}, this);
this.originalStates.forEach(
function (item, state) {
//if (mflayer.isInstanceOfType(mdiag.DiagramLink, item))
// item.restoreLocationState(this);
}, this);
if (this.diagram)
this.diagram.cancelCompositeOperation();
}
« Last Edit: Jun 16th, 2020 at 6:08am by reshma »  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3148
Joined: Oct 19th, 2005
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #22 - Jun 16th, 2020 at 6:17am
Print Post  
Try this -

Code
Select All
var mdiag = MindFusion.Diagramming;
mdiag.SinglePointerController.prototype.cancel = function (position)
{
    this.originalStates.forEach(
        function (item, state)
        {
            if (MindFusion.AbstractionLayer.isInstanceOfType(mdiag.DiagramNode, item))
                item.restoreLocationState(this);
        }, this);
    this.originalStates.forEach(
        function (item, state)
        {
            if (MindFusion.AbstractionLayer.isInstanceOfType(mdiag.DiagramLink, item))
                item.restoreLocationState(this);
        }, this);
    if (this.modifiedDiagram)
        this.modifiedDiagram.cancelCompositeOperation();
}

mdiag.ModifyNodeController.prototype.cancel = mdiag.SinglePointerController.prototype.cancel;
mdiag.ModifySelectionController.prototype.cancel = mdiag.SinglePointerController.prototype.cancel; 



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


I Love MindFusion!

Posts: 91
Joined: Jan 16th, 2018
Re: connecting two container node with elbow connector line while moving node changing the location
Reply #23 - Jun 16th, 2020 at 11:59am
Print Post  
Above solution works for me
Thank you so much.....Smiley Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint