Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

SimpleShape.java 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.sl.usermodel;
  16. import java.awt.Color;
  17. import org.apache.poi.sl.draw.geom.CustomGeometry;
  18. import org.apache.poi.sl.draw.geom.IAdjustableShape;
  19. public interface SimpleShape<
  20. S extends Shape<S,P>,
  21. P extends TextParagraph<S,P,? extends TextRun>
  22. > extends Shape<S,P>, IAdjustableShape, PlaceableShape<S,P> {
  23. FillStyle getFillStyle();
  24. LineDecoration getLineDecoration();
  25. StrokeStyle getStrokeStyle();
  26. /**
  27. * Sets the line attributes.
  28. * Possible attributes are Double (width), LineCap, LineDash, LineCompound, Color
  29. * (implementations of PaintStyle aren't yet supported ...)
  30. *
  31. * If no styles are given, the line will be hidden
  32. *
  33. * @param styles the line attributes
  34. */
  35. void setStrokeStyle(Object... styles);
  36. CustomGeometry getGeometry();
  37. ShapeType getShapeType();
  38. void setShapeType(ShapeType type);
  39. /**
  40. * @return the placeholder or null if none is assigned
  41. * @see #setPlaceholder(Placeholder)
  42. */
  43. Placeholder getPlaceholder();
  44. /**
  45. * Specifies that the corresponding shape should be represented by the generating application
  46. * as a placeholder. When a shape is considered a placeholder by the generating application
  47. * it can have special properties to alert the user that they may enter content into the shape.
  48. *
  49. * @param placeholder the placeholder or null to remove the reference to the placeholder
  50. */
  51. void setPlaceholder(Placeholder placeholder);
  52. /**
  53. * @return an accessor for placeholder details
  54. *
  55. * @since POI 4.0.0
  56. */
  57. PlaceholderDetails getPlaceholderDetails();
  58. /**
  59. * Checks if the shape is a placeholder.
  60. * (placeholders aren't normal shapes, they are visible only in the Edit Master mode)
  61. *
  62. * @return {@code true} if the shape is a placeholder
  63. *
  64. * @since POI 4.0.0
  65. */
  66. boolean isPlaceholder();
  67. Shadow<S,P> getShadow();
  68. /**
  69. * Returns the solid color fill.
  70. *
  71. * @return solid fill color of null if not set or fill color
  72. * is not solid (pattern or gradient)
  73. */
  74. Color getFillColor();
  75. /**
  76. * Specifies a solid color fill. The shape is filled entirely with the
  77. * specified color.
  78. *
  79. * @param color the solid color fill. The value of <code>null</code> unsets
  80. * the solid fill attribute from the underlying implementation
  81. */
  82. void setFillColor(Color color);
  83. /**
  84. * Returns the hyperlink assigned to this shape
  85. *
  86. * @return the hyperlink assigned to this shape
  87. * or <code>null</code> if not found.
  88. *
  89. * @since POI 3.14-Beta1
  90. */
  91. Hyperlink<S,P> getHyperlink();
  92. /**
  93. * Creates a hyperlink and asigns it to this shape.
  94. * If the shape has already a hyperlink assigned, return it instead
  95. *
  96. * @return the hyperlink assigned to this shape
  97. *
  98. * @since POI 3.14-Beta1
  99. */
  100. Hyperlink<S,P> createHyperlink();
  101. }