@Override protected void onDocumentRead() { try { try { _pageContents = PageContentsDocument.Factory.parse(getPackagePart().getInputStream()).getPageContents(); } catch (XmlException | IOException e) { throw new POIXMLException(e); } for (POIXMLDocumentPart part: getRelations()) { if (!(part instanceof XDGFMasterContents)) continue; //throw new POIXMLException("Unexpected page relation: " + part); XDGFMaster master = ((XDGFMasterContents)part).getMaster(); _masters.put(master.getID(), master); } super.onDocumentRead(); for (XDGFShape shape: _shapes.values()) { if (shape.isTopmost()) shape.setupMaster(this, null); } } catch (POIXMLException e) { throw XDGFException.wrap(this, e); } }
@Override public boolean accept(XDGFShape shape) { if (shape.isDeleted()) return false; // text is interesting if (shape.hasText() && shape.getTextAsString().length() != 0) return true; // 1d shapes are interesting, they create connections if (shape.isShape1D()) return true; // User specified shapes are interesting if (!shape.hasMaster() && !shape.hasMasterShape()) return true; if (shape.hasMaster() && !shape.hasMasterShape()) return true; // include stencil content, but try to elide stencil interiors // if (shape.getXmlObject().isSetMaster()) // return true; if (shape.hasMasterShape() && shape.getMasterShape().isTopmost()) return true; return false; }
@Override protected void onDocumentRead() { try { try { _pageContents = PageContentsDocument.Factory.parse(getPackagePart().getInputStream()).getPageContents(); } catch (XmlException | IOException e) { throw new POIXMLException(e); } for (POIXMLDocumentPart part: getRelations()) { if (!(part instanceof XDGFMasterContents)) continue; //throw new POIXMLException("Unexpected page relation: " + part); XDGFMaster master = ((XDGFMasterContents)part).getMaster(); _masters.put(master.getID(), master); } super.onDocumentRead(); for (XDGFShape shape: _shapes.values()) { if (shape.isTopmost()) shape.setupMaster(this, null); } } catch (POIXMLException e) { throw XDGFException.wrap(this, e); } }
@Override public boolean accept(XDGFShape shape) { if (shape.isDeleted()) return false; // text is interesting if (shape.hasText() && shape.getTextAsString().length() != 0) return true; // 1d shapes are interesting, they create connections if (shape.isShape1D()) return true; // User specified shapes are interesting if (!shape.hasMaster() && !shape.hasMasterShape()) return true; if (shape.hasMaster() && !shape.hasMasterShape()) return true; // include stencil content, but try to elide stencil interiors // if (shape.getXmlObject().isSetMaster()) // return true; if (shape.hasMasterShape() && shape.getMasterShape().isTopmost()) return true; return false; }