We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Connectors lose shape when used

Hi !

I need your help again...

I am trying to do a simple thing – connect two rectangles with two connectors, where connectors are connected to the center of the rectangles.

The two connectors must not override each other so I created two connector with a special shape, to avoid the override.

But when I use these connectors from Aspose.Diagram (for Java) – the connectors lose their shape and behave different than I expected.

I am attaching an image with diagrams of what I am trying to do + the result, also attached is my source code and stencil file.

Your help will be very appreciated.

Thanks,

Tamir.



Hi Tamir,


Thank you for contacting support. We managed to replicate the problems said as follows:

Sample code: AddAndConnectShapes1.java
DIAGRAMJAVA-50229 - Geometry of the connector shapes is incorrect

Sample code: AddAndConnectShapes2.java
DIAGRAMJAVA-50230 - Geometry of the connector shapes is incorrect

Your post has also been linked to these issues. We’ll let you know once a significant progress has been made in this regard. We’re sorry for the inconvenience caused.

Note: When we load a stencil file into the Diagram class (using constructor), then we don’t need to add master of the shapes from the same stencil file again (using addMaster method of the Diagram class object).

Hi Tamir,


As a workaround, please set Geometry of the connectors before saving into the resultant file format:

[Java]
// set geometry of connector 1
MoveTo C1MoveTo = connector1.getGeoms().get(0).getCoordinateCol().getMoveToCol().get(0);
C1MoveTo.getX().getUfe().setF(“Width0");
C1MoveTo.getY().getUfe().setF("Height
0”);

LineTo C1LineTo0 = connector1.getGeoms().get(0).getCoordinateCol().getLineToCol().get(0);
C1LineTo0.getX().getUfe().setF(“Width0");
C1LineTo0.getY().getUfe().setF("Height
1”);

LineTo C1LineTo1 = connector1.getGeoms().get(0).getCoordinateCol().getLineToCol().get(1);
C1LineTo1.getX().getUfe().setF(“Width1");
C1LineTo1.getY().getUfe().setF("Height
1”);

LineTo C1newlineTo2 = new LineTo();
C1newlineTo2.getX().getUfe().setF(“Width1");
C1newlineTo2.getY().getUfe().setF("Height
0”);
connector1.getGeoms().get(0).getCoordinateCol().add(C1newlineTo2);

// set geometry of connector 2
MoveTo C2MoveTo = connector2.getGeoms().get(0).getCoordinateCol().getMoveToCol().get(0);
C2MoveTo.getX().getUfe().setF(“Width0");
C2MoveTo.getY().getUfe().setF("Height
1”);

LineTo C2LineTo0 = connector2.getGeoms().get(0).getCoordinateCol().getLineToCol().get(0);
C2LineTo0.getX().getUfe().setF(“Width0");
C2LineTo0.getY().getUfe().setF("Height
0”);

LineTo C2LineTo1 = connector2.getGeoms().get(0).getCoordinateCol().getLineToCol().get(1);
C2LineTo1.getX().getUfe().setF(“Width1");
C2LineTo1.getY().getUfe().setF("Height
0”);

LineTo C2newlineTo2 = new LineTo();
C2newlineTo2.getX().getUfe().setF(“Width1");
C2newlineTo2.getY().getUfe().setF("Height
1”);
connector2.getGeoms().get(0).getCoordinateCol().add(C2newlineTo2);

// save Visio diagram
diagram.save(“C:\temp\MyOutput.vdx”, options);

We hope, this helps. Please let us know in case of any confusion or questions.

Hi Imarn,


Thanks for the workaround option !
It’s… kind of working.

My code does these connections according to data from another application, so it needs to handle a lot of similar scenarios. The code I sent was just an example of a simple case. So in other scenarios the connectors are not always displayed properly. I also need to add text to the connectors and sometimes it appears, sometimes not, sometimes the text is upside down.

Since there are many possible options, it’s not possible to send examples of all the scenarious I see.

It would really help if you will explain what this workaround does, I need to fully understand it so I can adjust it to my needs.

Also - do you estimate that this issue will be solved in a future release ? How problematic is it ?

Thanks !
Tamir.

Hi Tamir,


Thank you for the inquiry. Please note, each shape of the Visio diagram has one or more geometries. The shapesheet window has a geometry section. You can place a connector shape once manually from the provided stencil file on the Visio diagram page and observe the actual formulas in the geometry section. We just applied these formulas programmatically using Aspose.Diagram API. Since as a workaround, whenever you’ll place a connector shape, you’ll also set its geometry.
tamirl1:
So in other scenarios the connectors are not always displayed properly. I also need to add text to the connectors and sometimes it appears, sometimes not, sometimes the text is upside down. Since there are many possible options, it’s not possible to send examples of all the scenarious I see.
Well, we recommend our clients to post each complete use case in the Aspose site’s forum proactively because it helps us in improving the quality and performance of the Aspose API. We’re gradually improving formatting issues in the each release version. We highly appreciate our clients cooperation in this regard. We’re really sorry for the inconvenience caused.
tamirl1:
do you estimate that this issue will be solved in a future release ? How problematic is it ?
These issues have just been identified. It is difficult to say anything prior to the preliminary investigation of the reported ticket ids DIAGRAMJAVA-50229 and DIAGRAMJAVA-50230. Please spare us a little time and stay tuned.

Hi Tamir,


Thank you for being patient. We have a good news for you that the issue id DIAGRAMJAVA-50229 has now been resolved. If there is no issue in the QA phase, then this fix will be included in the next version of Aspose.Diagram for Java 6.0.0. We’ll inform you via this forum thread as soon as the new release is published.

Hi Tamir,


Thank you for being patient. We have a good news for you that the issue id DIAGRAMJAVA-50230 has now been resolved. If there is no issue in the QA phase, then this fix will be included in the next version of Aspose.Diagram for Java 6.0.0. We’ll inform you via this forum thread as soon as the new release is published.

The issues you have found earlier (filed as DIAGRAMJAVA-50229;DIAGRAMJAVA-50230) have been fixed in Aspose.Diagram for Java 6.0.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.