Hello poi users and devs,
I have the following question, after the creation of my shapes and their
connectors, the shapes are displayed and but the connector shapes (lines in
my case) are not redered as i would like to. But for instance if I move a
shape (not connector) its connection are displayed as expected.
private void createConnection(XSSFDrawing patriarch, XSSFClientAnchor
currAnchor, XSSFSimpleShape shape) {
XSSFClientAnchor connectAnchor =
createAnchorRelativeToPosition(patriarch, currAnchor);
XSSFConnector connect = patriarch.createConnector(connectAnchor);
CTConnector ctConnector = connect.getCTConnector();
ctConnector.getSpPr().getPrstGeom().setPrst(STShapeType.BENT_CONNECTOR_3);
CTNonVisualConnectorProperties cx =
ctConnector.getNvCxnSpPr().getCNvCxnSpPr();
CTConnection startCnx = cx.addNewStCxn();
startCnx.setId(shapeIdBefor);
startCnx.setIdx(2);
CTConnection endCnx = cx.addNewEndCxn();
endCnx.setId( shape.getCTShape().getNvSpPr().getCNvPr().getId() );
endCnx.setIdx(0);
}
private XSSFClientAnchor createAnchorRelativeToPosition(XSSFDrawing
patriarch, XSSFClientAnchor currAnchor) {
short startCol, endCol;
int startRow, endRow;
startCol = anchorBefor.getCol1() < currAnchor.getCol1() ?
anchorBefor.getCol1() : currAnchor.getCol1();
endCol = anchorBefor.getCol2() < currAnchor.getCol2() ?
anchorBefor.getCol1() : currAnchor.getCol2();
startRow = anchorBefor.getRow1() < currAnchor.getRow1() ?
anchorBefor.getRow1() : currAnchor.getRow1();
endRow =anchorBefor.getRow2() < currAnchor.getRow2() ?
anchorBefor.getRow2() : currAnchor.getRow2();
return patriarch.createAnchor(0,0,0,0,
startCol,startRow, endCol, endRow);
}
<http://apache-poi.1045710.n5.nabble.com/file/n5717840/poi-prob.png>
--
View this message in context:
http://apache-poi.1045710.n5.nabble.com/XSSFConnections-are-created-but-not-rendered-accordingly-tp5717840.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]