Cannot Set Connector Text Location


#1

There is a bug which prevents me from setting the text pin X/Y value on a connector shape. The value is set to a number calculated by the library, but cannot be set or overridden programatically.


This code demonstrates the issue. No matter what value is written for the TextXForm property, it is not written to the file.

License lic = new License();
lic.setLicense(“config/Aspose.Diagram.lic”);
Diagram visioDiagram = new Diagram(“config/Topology.vss”);
Page currentPage = visioDiagram.getPages().getPage(0);
long shape1Id = currentPage.addShape(0, 0, “Circle”);
long shape2Id = currentPage.addShape(3, 3, “Circle”);
Shape connector = new Shape();
long connectorId = currentPage.addShape(connector, “Dynamic Connector”);
currentPage.connectShapesViaConnector(shape1Id, ConnectionPointPlace.CENTER,
shape2Id, ConnectionPointPlace.CENTER, connectorId);
connector.getText().getValue().setWholeText(“Test”);
connector.getTextXForm().getTxtPinX().getUfe().setF(“Width/2”); // Has no effect
connector.getTextXForm().getTxtPinY().getUfe().setF(“Height/2”); // Has no effect
visioDiagram.save(“Test.vdx”, SaveFileFormat.VDX);

#2

Hi Chris,


Thank you for contacting support. Please note that we can adjust connector text location by setting TxtPinX and TxtPinY values as follows:

[Java]
connector.getTextXForm().getTxtPinX().setValue(connector.getTextXForm().getTxtWidth().getValue() * 0.5);
connector.getTextXForm().getTxtPinY().setValue(connector.getTextXForm().getTxtHeight().getValue() * 0.5);

We hope, this helps. Please feel free to reply us in case of any confusion or questions.


#3

Hi Imran,

Unfortunately, this won’t work because the text height and width are being set as formula, so its numeric value is not know at creation time.


xform.getTxtWidth().getUfe().setF(“TEXTWIDTH(TheText)”);
xform.getTxtHeight().getUfe().setF(“TEXTHEIGHT(TheText, TxtWidth)”);
xform.getTxtPinX().getUfe().setF(“Width/2”);
xform.getTxtPinY().getUfe().setF(“Height/2”);

I would like to be able to set the pinX and pinY values as formulae.

#4

Hi Chris,


Thank you for the clarification. We managed to replicate the problem of not being able to set PinX and PinY values as formulae. We have logged this issue in our issue tracking system as DIAGRAMJAVA-50111. This forum thread has also been linked to the issue for notification purposes. We’ll let you know once an update is available. We’re sorry for the inconvenience caused.


#5

Hi Imran,

I tried to set the connect text PinX and PinY values as doubles, but this does not work either.

connectorShape.getTextXForm().getTxtPinX().setValue(5);
connectorShape.getTextXForm().getTxtPinY().setValue(3);

After running this code, the actual PinX and PinY values are seemingly random in the output VDX.

#6

Hi Chris,


Thank you for the details. We have tested our sample Visio drawing against the latest build of Aspose.Diagram for Java 3.0.0 and it works perfect. Please provide us the problematic Visio drawing in this forum thread. We’ll check and guide you accordingly.


#7

Using the enclosed Java file and output file, you can see that the code sets the connector text TxtPinX to 5 and TxtPinY to 3. When I open the output VDX file in Visio Professional 2013, the TxtPinX is 4.4142 and TxtPinY is 1.5858.


Thank you,
Chris

#8

Hi Chris,


Thank you for providing the sample code and resultant diagram. Please also share the input Visio drawing and stencil file. It will allow us to replicate the issue on our side. Once the issue is reproducible on our side, then we can start analyzing the root cause which leads to fix the defect. We appreciate your cooperation.


#9

Hi Imran,

I’ve included the requested files. Please let me know if you need anything else.

Thanks,
Chris

#10

Hi Chris,


Thank you for contacting support. We managed to replicate the incorrect values of TxtPinX and TxtPinY. We’ve logged this issue under ticket id DIAGRAMJAVA-50124 in our issue tracking system. Your post has also been linked to this issue. We’ll keep you informed regarding any available updates. We’re sorry for the inconvenience caused.


#11

Hi Chris,


Thank you for being patient. We have a good news for you that the issue id DIAGRAMJAVA-50124 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.1.0. We’ll inform you via this forum thread as soon as the new release is published.


#12

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


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

#13

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