我正在以编程方式绘制流程图(使用 Java UNO 运行时参考),其中我正在显示 If-Else 条件。但是在显示“ELSE”条件时我遇到了问题,因为在这种情况下,连接器在中间形状上移动(如 shwon在附图中)
我用来绘制连接器的代码是:-
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));
请建议如何使用 Java 中的 UNO 运行时参考正确布局和路由连接器。