获取 Visio 形状继承线
Contents
[
Hide
]
检索 Visio 形状的继承线数据
Visio 形状可以继承父样式和主形状。开发者可以获取或设置一个Visio形状的继承线数据。 InheritLine 属性,由形状类,包含由父样式和主控形状继承的形状的线条格式值。
检索继承的行数据编程示例
以下代码片段检索形状的继承线数据。请检查此示例代码:
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.getSharedDataDir(RetrieveInheritedLine.class) + "Shapes/"; | |
// Call the diagram constructor to load a VSDX diagram | |
Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); | |
// Get page by ID | |
Page page = diagram.getPages().getPage("Page-1"); | |
// Get shape by ID | |
Shape shape = page.getShapes().getShape(1); | |
//Get Inherit Line from the parent style and master | |
Line line = shape.getInheritLine(); | |
// Get the line formatting values | |
System.out.println(line.getBeginArrow().getValue()); | |
System.out.println(line.getBeginArrowSize().getValue()); | |
System.out.println(line.getEndArrow().getValue()); | |
System.out.println(line.getEndArrowSize().getValue()); | |
System.out.println(line.getLineColor().getValue()); | |
System.out.println(line.getLinePattern().getValue()); | |
System.out.println(line.getLineWeight().getValue()); | |
System.out.println(line.getRounding().getValue()); |