I created a new visio diagram and added one shape: lateral line [as I understand this shape comes with Visio]. I modified ChangeShapeSize.java from the examples project to use this object, but it doesn’t resize it at all - the only result is that the form is broken. How can I resize this object?
public static void main(String[] args) throws Exception {
// ExStart:ChangeShapeSize
// The path to the documents directory.
String dataDir = "C:\\";
// 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-1");
// get shape by id
// Shape shape = page.getShapes().getShape(796);
Shape shape = page.getShapes().getShape(1);
// alter the size of Shape
shape.setWidth(10 * shape.getXForm().getWidth().getValue());
shape.setHeight(2 * shape.getXForm().getHeight().getValue());
// save diagram
diagram.save(dataDir + "ChangeShapeSize_Out.vsdx", SaveFileFormat.VSDX);
// ExEnd:ChangeShapeSize
}
}
As you can see the in the output file size is not changed and the form is broken. Should I not be using setWidth/setHeight to resize this object? I don’t see any reference to those methods and any resizing in the link you provided. pack.zip (26.2 KB)
We have logged an investigation ticket as DIAGRAMJAVA-50951 in our issue tracking system to further analyze this case. We will look into ticket detail and let you know once it is resolved. Please be patient and spare us some time.
The issues you have found earlier (filed as DIAGRAMJAVA-50951) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou
We have logged another ticket as DIAGRAMJAVA-50967 in our issue tracking system against your recent feedback. We will investigate it and let you know once it is resolved. Please spare us some time.
Actually I also have the same issue with the custom stencils I add to the document - when I manually add shapes using those I can reshape them, but the ones added programmatically using the lib cannot be reshaped - when I drag the xframe only it’s size changes and the shape’s inside the frame stay the same. I assume that there can be a common cause.
The issues you have found earlier (filed as DIAGRAMJAVA-50967) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou
Another ticket as DIAGRAMJAVA-51006 has been logged in our issue tracking system to investigate this issue. We will look into its details and let you know as soon as it is resolved. Please spare us some time.
The issues you have found earlier (filed as DIAGRAMJAVA-51006) have been fixed in this update. This message was posted using Bugs notification tool by philip.zhou