I am trialing out go diagram, at the moment I am using proto app as it has lots of features I like the look of.
What I would like to do, is only connect certain types of nodes (that i designate) to a certain type of node but I cant find a good example that does this… I am thinking it is something to do with GoLabeledLink but im not sure actually what or how to do it using this API?
I assume you want to limit what connections users can draw when drawing new links or reconnecting existing links.
That’s the responsibility of either GoPort.IsValidLink, or GoToolLinking.IsValidLink, depending on where you want to put the code. SubGraphApp demonstrates defining two new tools that replace the standard ones, with custom definitions of GoToolLinking.IsValidLink. Demo1 and OrgCharter demonstrate separate tools that happen to make use of GoPort.IsValidLink to decide if a potential link is valid or not.
Thanks for the quick reply
I am using GoLabeledLink as i like some the functionality, I want to keep GoLabeledLink… is it possible? or do I somehow need to switch out the Graphlink from the protoapp example (the one im working with) so it uses GoTool<SPAN =highlight>Linking
<SPAN =highlight>I will look at the current examples and see how I get on
<SPAN =highlight>It would be cool if I could actually select a background colour myself on this forum if i could find it
<SPAN =highlight>Thanks again for your reply
An instance of GoToolLinkingNew is the tool that creates newly drawn links; GoToolRelinking is the tool that handles reconnecting existing links.
You can easily modify the behavior of GoToolLinkingNew.DoNewLink to control what kind of link it creates by setting the GoView.NewLinkPrototype property to an instance of the kind of link that you want it to copy.
I don’t understand your query about background colors – are you asking about how to change the background color of text that you are writing in this forum? Or are you wondering about the GoText.BackgroundColor and GoText.TransparentBackground properties? (The latter has to be false for the former to be painted at all.)
Ive got it… thanks very much get for your quick response.