/** * Adds a drawing to this workbook * * @param d the drawing to add */ void addDrawing(DrawingGroupObject d) { if (drawingGroup == null) { drawingGroup = new DrawingGroup(Origin.WRITE); } drawingGroup.add(d); }
/** /** * Adds in a drawing group record to this drawing group. The binary * data is extracted from the drawing group and added to a single * byte array * * @param mso the drawing group record to add */ public void add(MsoDrawingGroupRecord mso) { addData(mso.getData()); }
/** * Copy constructor used to copy drawings from read to write * * @param dgo the drawing group object * @param dg the drawing group */ protected Drawing2(DrawingGroupObject dgo, DrawingGroup dg) { Drawing2 d = (Drawing2) dgo; Assert.verify(d.origin == Origin.READ); msoDrawingRecord = d.msoDrawingRecord; initialized = false; origin = Origin.READ; drawingData = d.drawingData; drawingGroup = dg; drawingNumber = d.drawingNumber; drawingGroup.addDrawing(this); }
/** * Accessor for the image data * * @return the image data */ public byte[] getImageData() { Assert.verify(origin == Origin.READ || origin == Origin.READ_WRITE); if (!initialized) { initialize(); } return drawingGroup.getImageData(blipId); }
/** * Gets the drawing data for the given blip id. Called by the Drawing * object * * @param blipId the blipId * @return the drawing data */ byte[] getImageData(int blipId) { numBlips = getBStoreContainer().getNumBlips(); Assert.verify(blipId <= numBlips); Assert.verify(origin == Origin.READ || origin == Origin.READ_WRITE); // Get the blip EscherRecord[] children = getBStoreContainer().getChildren(); BlipStoreEntry bse = (BlipStoreEntry) children[blipId - 1]; return bse.getImageData(); }
drawingGroup = new DrawingGroup(wp.getDrawingGroup()); drawingGroup.updateData(wp.getDrawingGroup());
workbook.getDrawingGroup().add(chart); workbook.getDrawingGroup().setDrawingsOmitted(msoRecord, objRecord);
/** * Removes a drawing from this workbook * * @param d the drawing to remove */ void removeDrawing(Drawing d) { Assert.verify(drawingGroup != null); drawingGroup.remove(d); }
/** * Create a drawing group for this workbook - used when importing sheets * which contain drawings, but this workbook doesn't. * We can't subsume this into the getDrawingGroup() method because the * null-ness of the return value is used elsewhere to determine the * origin of the workbook */ DrawingGroup createDrawingGroup() { if (drawingGroup == null) { drawingGroup = new DrawingGroup(Origin.WRITE); } return drawingGroup; }
/** * Gets hold of the BStore container from the Escher data * * @return the BStore container */ private BStoreContainer getBStoreContainer() { if (bstoreContainer == null) { if (!initialized) { initialize(); } EscherRecord[] children = escherData.getChildren(); if (children.length > 1 && children[1].getType() == EscherRecordType.BSTORE_CONTAINER) { bstoreContainer = (BStoreContainer) children[1]; } } return bstoreContainer; }
if (workbook.getDrawingGroup() != null) dmod |= workbook.getDrawingGroup().hasDrawingsOmitted();
workbook.getDrawingGroup().setDrawingsOmitted(msoRecord, objRecord); workbook.getDrawingGroup().setDrawingsOmitted(msoRecord, objRecord);
/** * Accessor for the image data * * @return the image data */ public byte[] getImageData() { Assert.verify(origin == Origin.READ || origin == Origin.READ_WRITE); if (!initialized) { initialize(); } return drawingGroup.getImageData(blipId); }
/** * Gets the drawing data for the given blip id. Called by the Drawing * object * * @param blipId the blipId * @return the drawing data */ byte[] getImageData(int blipId) { numBlips = getBStoreContainer().getNumBlips(); Assert.verify(blipId <= numBlips); Assert.verify(origin == Origin.READ || origin == Origin.READ_WRITE); // Get the blip EscherRecord[] children = getBStoreContainer().getChildren(); BlipStoreEntry bse = (BlipStoreEntry) children[blipId - 1]; return bse.getImageData(); }
drawingGroup = new DrawingGroup(wp.getDrawingGroup()); drawingGroup.updateData(wp.getDrawingGroup());
workbook.getDrawingGroup().add(chart); workbook.getDrawingGroup().setDrawingsOmitted(msoRecord, objRecord);
/** * Removes a drawing from this workbook * * @param d the drawing to remove */ void removeDrawing(Drawing d) { Assert.verify(drawingGroup != null); drawingGroup.remove(d); }
/** * Create a drawing group for this workbook - used when importing sheets * which contain drawings, but this workbook doesn't. * We can't subsume this into the getDrawingGroup() method because the * null-ness of the return value is used elsewhere to determine the * origin of the workbook */ DrawingGroup createDrawingGroup() { if (drawingGroup == null) { drawingGroup = new DrawingGroup(Origin.WRITE); } return drawingGroup; }
/** * Gets hold of the BStore container from the Escher data * * @return the BStore container */ private BStoreContainer getBStoreContainer() { if (bstoreContainer == null) { if (!initialized) { initialize(); } EscherRecord[] children = escherData.getChildren(); if (children.length > 1 && children[1].getType() == EscherRecordType.BSTORE_CONTAINER) { bstoreContainer = (BStoreContainer) children[1]; } } return bstoreContainer; }
if (workbook.getDrawingGroup() != null) dmod |= workbook.getDrawingGroup().hasDrawingsOmitted();