DiagramDataUnflatten diagramDataUnflatten = new DiagramDataUnflatten(thisPart); String exchange= XmlUtils.marshaltoString(diagramDataUnflatten.convert(), true, true); System.out.println( exchange ); PrintWriter out = new PrintWriter(System.getProperty("user.dir") List<JAXBElement<CTTextBody>> textFormats = diagramDataUnflatten.getTextFormats(); System.out.println("Template list =============== "); for (JAXBElement<CTTextBody> tb : textFormats) {
public CTTextBody processText(org.opendope.SmartArt.dataHierarchy.ListItem thisListItem, CTPt thisPoint) { CTTextBody textBody = thisPoint.getT(); if (textBody!=null) { TextBody tb = getDataHierarchyObjectFactory().createTextBody(); thisListItem.setTextBody(tb); for(CTTextParagraph p : textBody.getP() ) { if (!p.getEGTextRun().isEmpty() && p.getEGTextRun().get(0) instanceof org.docx4j.dml.CTRegularTextRun ) { // TODO; assumes a single r child, which is // all we handle. ie this model doesn't support // multiple runs, some of which formatted org.docx4j.dml.CTRegularTextRun run = (org.docx4j.dml.CTRegularTextRun)p.getEGTextRun().get(0); tb.getP().add( run.getT() ); } } } return textBody; }
listItem.setDepth(0); processChildrenOf(docPt, listItem);
DiagramDataUnflatten diagramDataUnflatten = new DiagramDataUnflatten(thisPart); String exchange= XmlUtils.marshaltoString(diagramDataUnflatten.convert(), true, true); System.out.println( exchange );
private void processChildrenOf(CTPt pt, org.opendope.SmartArt.dataHierarchy.ListItem listItem) { List<org.opendope.SmartArt.dataHierarchy.ListItem> childModelIds = createListItemsForChildren(pt); CTPt thisPoint = getPoint(modelId); CTTextBody textBody = processText(thisListItem, thisPoint); CTPt imgPt = getAssociatedPres(modelId, PRESNAME_FOR_IMAGE); if (imgPt!=null && imgPt.getSpPr()!=null CTPt sibTrans = getPoint(thisListItem.getSibTransBody().getContentRef() ); processChildrenOf(thisPoint, thisListItem);
private void processChildrenOf(CTPt pt, org.opendope.SmartArt.dataHierarchy.ListItem listItem) { List<org.opendope.SmartArt.dataHierarchy.ListItem> childModelIds = createListItemsForChildren(pt); CTPt thisPoint = getPoint(modelId); CTTextBody textBody = processText(thisListItem, thisPoint); CTPt imgPt = getAssociatedPres(modelId, PRESNAME_FOR_IMAGE); if (imgPt!=null && imgPt.getSpPr()!=null CTPt sibTrans = getPoint(thisListItem.getSibTransBody().getContentRef() ); processChildrenOf(thisPoint, thisListItem);
DiagramDataUnflatten diagramDataUnflatten = new DiagramDataUnflatten(thisPart); String exchange= XmlUtils.marshaltoString(diagramDataUnflatten.convert(), true, true); System.out.println( exchange );
DiagramDataUnflatten diagramDataUnflatten = new DiagramDataUnflatten(thisPart); String exchange= XmlUtils.marshaltoString(diagramDataUnflatten.convert(), true, true); System.out.println( exchange ); PrintWriter out = new PrintWriter(System.getProperty("user.dir") List<JAXBElement<CTTextBody>> textFormats = diagramDataUnflatten.getTextFormats(); System.out.println("Template list =============== "); for (JAXBElement<CTTextBody> tb : textFormats) {
listItem.setDepth(0); processChildrenOf(docPt, listItem);
public CTTextBody processText(org.opendope.SmartArt.dataHierarchy.ListItem thisListItem, CTPt thisPoint) { CTTextBody textBody = thisPoint.getT(); if (textBody!=null) { TextBody tb = getDataHierarchyObjectFactory().createTextBody(); thisListItem.setTextBody(tb); for(CTTextParagraph p : textBody.getP() ) { if (!p.getEGTextRun().isEmpty() && p.getEGTextRun().get(0) instanceof org.docx4j.dml.CTRegularTextRun ) { // TODO; assumes a single r child, which is // all we handle. ie this model doesn't support // multiple runs, some of which formatted org.docx4j.dml.CTRegularTextRun run = (org.docx4j.dml.CTRegularTextRun)p.getEGTextRun().get(0); tb.getP().add( run.getT() ); } } } return textBody; }