Crainiate Community

Support and discussion for users of Crainiate component software products
Welcome to Crainiate Community Sign in | Join | Help
in Search

Attaching connections

Last post 07-17-2007 7:48 AM by Mathy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-16-2007 3:12 PM

    • Mathy
    • Top 10 Contributor
    • Joined on 07-16-2007
    • Posts 19

    Attaching connections

    Hi all,

    I am currently evaluating ERM and I would like some pointers on the best way to implement the following problem. I have a number of components represented by shapes that are connected through lines. I also have special components (let's call them parasites) that can "glue" themselves anywhere on the main tree. This includes gluing both to the components and the connections. The main tree's layout is force directed. I want to attach the parasites in such a way that it remains readable.

    As far as I can tell, there is no way to connect a line to another line in ERM. I thought about introducing invisible stub shapes that would be placed in between components that the parasites can attach to, but this wouldn't have the desired result because applying the layout would result in crooked lines between the components while I want them to be straight.

    Another solution I thought about was introducing a layer and positioning the stub shapes above the component / connection manually, but this seems rather cumbersome, and I don't think I'll be able to take advantage of the force directed layout for the parasites. This is not a real requirement but it would be nice / easy to have.

    I hope I made myself clear enough. If anyone could point me in the right direction I'd be most grateful and ERM would most likely become our preferred library.

    thanks,

    Mathy 

    • 194.7.161.130
  • 07-16-2007 7:30 PM In reply to

    Re: Attaching connections

    It is possible to connect lines to other lines, by using Ports. Add a port to the line.Ports collection, then set the Port on the docking line.Start or line.End marker.

    The following example demonstrates this:

    Port port = new Port(50);
    Line line = new Line(new Point(100,100),new Point(100,300));
    line.Ports.Add(
    "port", port);
    model1.Lines.Add(
    "Line1", line);

    Line line2 = new Line(new Point(100,200), new Point(300,200));
    line2.Start.Port = port;
    model1.Lines.Add(
    "Line2", line2);

     

     

    Filed under:
    • 81.132.167.227
  • 07-17-2007 7:48 AM In reply to

    • Mathy
    • Top 10 Contributor
    • Joined on 07-16-2007
    • Posts 19

    Re: Attaching connections

    Thank you. I will try this later and report back 

    • 194.7.161.130
Page 1 of 1 (3 items)