Question

I am programmatically drawing a flowchart(using Java UNO Runtime Reference) in which I am showing If-Else condition.But I am facing problems while showing the "ELSE" condition because in such a case the connector moves over the intermediate shape(as shwon in attached fig)enter image description here

The code I have used to draw connectors is:-

XShapes xShapes = (XShapes)
                UnoRuntime.queryInterface(XShapes.class, xDrawPage);
        XMultiServiceFactory xMsf = UnoRuntime.queryInterface(XMultiServiceFactory.class, xDrawDoc);
        Object connector = xMsf.createInstance("com.sun.star.drawing.ConnectorShape"); 
        xShapes.add(UnoRuntime.queryInterface(XShape.class, connector));

XPropertySet xConnector2PropSet = (XPropertySet)UnoRuntime.queryInterface(
                XPropertySet.class, connector);
        xConnector2PropSet.setPropertyValue("EdgeKind", ConnectorType.STANDARD);
        xConnector2PropSet.setPropertyValue("StartShape", xShape1);
        xConnector2PropSet.setPropertyValue("StartGluePointIndex", new Integer(startPt));
        xConnector2PropSet.setPropertyValue("LineEndName", "Arrow");
        xConnector2PropSet.setPropertyValue("EndShape", xShape2 );
        xConnector2PropSet.setPropertyValue("EndGluePointIndex", new Integer(endPt));

Please suggest how to layout and route connectors properly using UNO Runtime Reference in Java.

Was it helpful?

Solution

I had the same problem in OpenOffice Draw and could not find any possibility to add further handles to one connector. But one connector can end in another one. So I ended up using two connectors, a first one without ending in an arrow (in blue), a second one starting where the first ended (in red).

example of non-crossing connectors

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top