You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Drawing.java 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.ss.usermodel;
  16. /**
  17. * High level representation of spreadsheet drawing.
  18. */
  19. public interface Drawing<T extends Shape> extends ShapeContainer<T> {
  20. /**
  21. * Creates a picture.
  22. * @param anchor the client anchor describes how this picture is
  23. * attached to the sheet.
  24. * @param pictureIndex the index of the picture in the workbook collection
  25. * of pictures.
  26. *
  27. * @return the newly created picture.
  28. */
  29. Picture createPicture(ClientAnchor anchor, int pictureIndex);
  30. /**
  31. * Creates a comment.
  32. * @param anchor the client anchor describes how this comment is attached
  33. * to the sheet.
  34. * @return the newly created comment.
  35. */
  36. Comment createCellComment(ClientAnchor anchor);
  37. /**
  38. * Creates a new client anchor and sets the top-left and bottom-right
  39. * coordinates of the anchor.
  40. *
  41. * @param dx1 the x coordinate in EMU within the first cell.
  42. * @param dy1 the y coordinate in EMU within the first cell.
  43. * @param dx2 the x coordinate in EMU within the second cell.
  44. * @param dy2 the y coordinate in EMU within the second cell.
  45. * @param col1 the column (0 based) of the first cell.
  46. * @param row1 the row (0 based) of the first cell.
  47. * @param col2 the column (0 based) of the second cell.
  48. * @param row2 the row (0 based) of the second cell.
  49. * @return the newly created client anchor
  50. */
  51. ClientAnchor createAnchor(int dx1, int dy1, int dx2, int dy2, int col1, int row1, int col2, int row2);
  52. /**
  53. * Adds a new OLE Package Shape
  54. *
  55. * @param anchor the client anchor describes how this picture is
  56. * attached to the sheet.
  57. * @param storageId the storageId returned by {@link Workbook#addOlePackage(byte[], String, String, String)}
  58. * @param pictureIndex the index of the picture (used as preview image) in the
  59. * workbook collection of pictures.
  60. *
  61. * @return newly created shape
  62. */
  63. ObjectData createObjectData(ClientAnchor anchor, int storageId, int pictureIndex);
  64. }