Hello:
I am new to Apache POI and have recently stated coding.
My goal is to provide tools to quality check org charts being created by
some technicians.
In other words, I need to be able to extract and analyze SHAPE information,
including simpel shapes and connectors.
I cant find the appropriate methods to extract the fill color, its
linestyle, etc.
Can anyone suggest a way to do this? My code (snippet) is as below:
.
.
.
XSSFWorkbook wb = new XSSFWorkbook(file);
XSSFSheet s = wb.getSheetAt(0);
XSSFDrawing drpt = null;
for(POIXMLDocumentPart dr : s.getRelations()){
if(dr instanceof XSSFDrawing){
drpt = (XSSFDrawing) dr;
break;
}
}
if (drpt != null)
{
System.out.println("Found drawings");
int i = 0;
for (XSSFShape shp :drpt.getShapes())
{
if (shp instanceof XSSFConnector)
{
XSSFConnector xsc = (XSSFConnector) shp;
System.out.println("Connector XML " + xsc);
}
if (shp instanceof XSSFSimpleShape)
{
XSSFSimpleShape xss = (XSSFSimpleShape) shp;
System.out.println("Simple Shape XML " + xss);
}
}
}
Currently, my code prints the XML bean object data, but I am interested in
getting the RGB color, line thickness, etc....
Thanks,
Ashit