使用连接器类型形状
Contents
[
Hide
]
在 Visio 中设置连接器类型形状的外观
本主题详细说明开发人员如何使用 Aspose.Diagram for Java 更改动态连接器类型形状的外观。
设置连接器外观
公开的 SetConnectorsType 方法形状类可用于设置连接器类型形状的外观。
下面的代码显示了如何:
- 加载示例 diagram。
- 获取特定页面。
- 获得特定的连接器形状。
- 设置形状的外观。
- 保存 diagram
设置连接器外观编程样例
在您的 Java 应用程序中使用以下代码,使用 Aspose.Diagram for Java 设置连接器类型形状的外观。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-diagram/Aspose.Diagram-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(SetConnectorAppearance.class); | |
// call a Diagram class constructor to load the VSDX diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
//get a particular page | |
Page page = diagram.getPages().getPage("Page-3"); | |
//get a dynamic connector type shape by id | |
Shape shape = page.getShapes().getShape(18); | |
// set dynamic connector appearance | |
shape.setConnectorsType(ConnectorsTypeValue.STRAIGHT_LINES); | |
//saving Visio diagram | |
diagram.save(dataDir + "SetConnectorAppearance_Out.vsdx", SaveFileFormat.VSDX); |
选择连接器形状的重新布线选项
ConFixedCode 属性由布局类可用于选择重新路由选项。 Layout 属性,由形状类,会用到。
如何选择重新路由选项 |
---|
下面的代码显示了如何: |
- 加载示例文件。
- 获取特定页面。
- 获得特定的连接器形状。
- 设置重新路由选项。
- 保存 diagram。
选择重新路由选项编程示例
在您的 Java 应用程序中使用以下代码选择使用 Aspose.Diagram for Java 的连接器形状的重新布线选项。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-diagram/Aspose.Diagram-for-Java | |
// The path to the documents directory. | |
String dataDir = Utils.getDataDir(RerouteConnectors.class); | |
// call a Diagram class constructor to load the VSDX diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
// get page by name | |
Page page = diagram.getPages().getPage("Page-3"); | |
// get a particular connector shape | |
Shape shape = page.getShapes().getShape(18); | |
// set reroute option | |
shape.getLayout().getConFixedCode().setValue(ConFixedCodeValue.NEVER_REROUTE); | |
// save Visio diagram | |
diagram.save(dataDir + "RerouteConnectors_Out.vsdx", SaveFileFormat.VSDX); |