Connection points not correct for multiple connections

@asad.ali, please, add your code snippet in the Sandbox project and run Runner.java. The resulting Visio drawing “ifd1.vsdx” will be added to the root directory. I also attaching it here: ifd1.zip (11.5 KB)

The scenario in which I reproduce the issue is recorded in this GIF: Connectors remain on their positions after elements dragging.gif (275.8 KB)

@iteraplan

Thanks for further explaining the issue.

We have observed the same issue in our environment and logged these details along with the ticket. We will further investigate it accordingly and share our feedback. Please spare us little time.

We are sorry for the inconvenience.

@iteraplan

Please also set indices of connections in code to resolve the issue and final addConnections() method would be as this code:

private void addConnections(Shape shape) 
  { 
      Connection top = new Connection(); 
      top.setIX(0); //set index of connection 
      top.getX().setValue(shape.getXForm().getWidth().getValue()/2); 
      top.getY().setValue(0); 
       
      Connection bottom = new Connection(); 
      bottom.setIX(1); 
      bottom.getX().setValue(shape.getXForm().getWidth().getValue()/2); 
      bottom.getY().setValue(shape.getXForm().getHeight().getValue()); 

       
      Connection left = new Connection(); 
      left.setIX(2); 
      left.getX().setValue(0); 
      left.getY().setValue(shape.getXForm().getHeight().getValue()/2); 
       
       
      Connection right = new Connection(); 
      right.setIX(3); 
      right.getX().setValue(shape.getXForm().getWidth().getValue()); 
      right.getY().setValue(shape.getXForm().getHeight().getValue()/2); 
       
       
      shape.getConnections().add(top); 
      shape.getConnections().add(bottom); 
       
      shape.getConnections().add(left); 
      shape.getConnections().add(right); 
  } 

For your kind reference, we have attached output VSDX file as well. ifd1.zip (11.6 KB)

Hello, @asad.ali. Thanks for reply, last suggestion works for the sandbox project I’ve attached earlier and connectors remain on their shapes now. But the code in the main project was refactored - the structure of a data model (that is used for building a diagram shapes) changed a little. And addConnections(Shape shape) still have no effect for the resulted drawing :frowning:
I have updated the sources in the sandbox project, so you can investigate new scenario: https://drive.google.com/file/d/18uvS0srLcZV7UNGOIMtr_U1Y8qpimgHA/view?usp=sharing

The main change is that I have created abstract class Box.java for rectangular Shape which recursively adds child shapes in its group (it is possible that one shape can contain multiple ones). Also reusable classes and code were moved to common folder.

Refer to IFDDiagram.java, line 83-86, where all shapes are drawn and connected. Also, please check Node, Box, Edge classes where I use Aspose.Diagram (18.7) library for building shapes and connectors.

I assume that one more connections bug appeared or I use Aspose.Diagram not in the right way.
Please, share your findings on the new code.

!To check the scenario please, run Runner.java and also don’t forget to attach your Aspose.Diagram.lic file to \src\main\resources\templ. Resulting drawing will be added to the project root.

Also noticed right now: when resizing a shape in the resulting drawing - connector points’ positions are adjusted in a wrong way: image.png (17.4 KB). Then when dragging a shape, looks like connector points still moving with the shape.

@iteraplan

Thanks for sharing these details.

We have tested the scenario in our environment and managed to observe that connectors were overlapping the shapes in output diagram. Also, we have noticed that connectors got disconnected from shapes while resizing them. We have logged an investigation ticket as DIAGRAMJAVA-50614 in our issue tracking system. We will further check this and let you know about any updates. Please spare us little time.

We are sorry for the inconvenience.

@asad.ali, do you already have some results of your investigation ticket? This issue is making the resulting VISIO-file really confusing, and therefore it has no value for our customers.
Will this issue be fixed in the next release? Sorry for the impatience, but it is really important to us.

@iteraplan

Thanks for your inquiry.

I am afraid that earlier logged ticket is still pending for resolution. Please note that the ticket was logged under free support model and it has low priority. After an initial investigation it is found that the issue is related to grouping shapes and it does not occur when we do not group them. We need to look into this further and due to low priority, it will be investigated/resolved on first come first serve basis.

In case issue is blocker and needs to be resolved on urgent basis, you may please check paid support option where issues have high priority. As soon as we have some definite updates regarding issue resolution, we will surely inform you. Please spare us little time.

We are sorry for the inconvenience.

Hi, thanks for the info. But even after trying to connect shapes without grouping, connectors look weird. Here is another case with shapes and connectors: shapes and connections issue.zip (27.4 KB)
Also I have noticed if I select all elements in result drawing, drag and drop them, the result is almost like expected: shapes and connections issue (after dragging shapes and connectors).zip (28.5 KB). Connectors are reset and are pointing to the correct shapes now.

Here is what I try to achive: Expected result (SVG document).png (79.3 KB)

Hope this will also help to fix connectors issue,
kind regards

@iteraplan

We are testing the scenario and will get back to you shortly.

@iteraplan

We had logged provided details along with the investigation ticket and it definitely helped investigating and resolving the issue. We would also like to share with you that fix to your issue is expected to be included in upcoming 18.9 version of Aspose.Diagram for Java.

This is great news! Glad we could help you with resolving this issue. Thanks for your support. Kind regards

Hello, @asad.ali. The main issue is not reproduced with version 18.9. Thanks!

And what about DIAGRAMJAVA-50614, also reported in this topic (Shape resizing misplacing connection points)?

The issues you have found earlier (filed as DIAGRAMJAVA-50614) have been fixed in Aspose.Diagram for Java18.9.

@iteraplan

The fix against this issue has been included in latest version of the API. Please feel free to let us know if you still experience any issue.

Hello, @asad.ali

The issue with connection points was fixed for rectangular shapes, but now I’m experiencing almost the same issue for circular ones, sharing simplified result drawing with an issue: connections between circles (result visio drawing).zip (18.5 KB). And this is what i’m trying to achieve: image.jpg (41.5 KB)

I have updated sandbox project with the scenario which reproduces the issue. Please, run Runner.java to get resulting drawing (available in root folder). Package com.edvantis.iteraplan.svg.model.hsd contains classes that are mainly used for this Visio diagram and also stencil for it is here - src\main\resources\templ\hsdStencil.vssx.

What I’ve noticed is if I select all elements on resulting drawing and drag them to another place - connections are redrawn and then displayed correctly. Also if I use Connector tool in MS Visio I can see that connection point on one element are not correct: Connection points on one of elements.zip (31.2 KB)

Please, share you ideas what the issue can be here.

P.S.: Aspose license is missing, please before running project attach it here - src\main\resources\templ\

Kind regards

@iteraplan

Thanks for sharing details.

We have logged an issue as DIAGRAMJAVA-50621 in our issue tracking system for further investigation. We will keep you posted with the status of our investigation and issue resolution. Please spare us little time.

We are sorry for the inconvenience.

Dear aspose team,
do you already have some results of your investigation?
Is additional input from our side needed?
Regards

@iteraplan

Thanks for your cooperation.

The issue (DIAGRAMJAVA-50621) has been investigated and resolved. Its fix would be included in upcoming Aspose.Diagram for Java 18.10 release. We will let you know once new version is available for download.

The issues you have found earlier (filed as DIAGRAMJAVA-50621) have been fixed in Aspose.Diagram for Java 18.10.