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.

ClientAnchor.java 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. * A client anchor is attached to an excel worksheet. It anchors against a
  18. * top-left and bottom-right cell.
  19. *
  20. * @author Yegor Kozlov
  21. */
  22. public interface ClientAnchor {
  23. /**
  24. * Move and Resize With Anchor Cells
  25. * <p>
  26. * Specifies that the current drawing shall move and
  27. * resize to maintain its row and column anchors (i.e. the
  28. * object is anchored to the actual from and to row and column)
  29. * </p>
  30. */
  31. public static final int MOVE_AND_RESIZE = 0;
  32. /**
  33. * Move With Cells but Do Not Resize
  34. * <p>
  35. * Specifies that the current drawing shall move with its
  36. * row and column (i.e. the object is anchored to the
  37. * actual from row and column), but that the size shall remain absolute.
  38. * </p>
  39. * <p>
  40. * If additional rows/columns are added between the from and to locations of the drawing,
  41. * the drawing shall move its to anchors as needed to maintain this same absolute size.
  42. * </p>
  43. */
  44. public static final int MOVE_DONT_RESIZE = 2;
  45. /**
  46. * Do Not Move or Resize With Underlying Rows/Columns
  47. * <p>
  48. * Specifies that the current start and end positions shall
  49. * be maintained with respect to the distances from the
  50. * absolute start point of the worksheet.
  51. * </p>
  52. * <p>
  53. * If additional rows/columns are added before the
  54. * drawing, the drawing shall move its anchors as needed
  55. * to maintain this same absolute position.
  56. * </p>
  57. */
  58. public static final int DONT_MOVE_AND_RESIZE = 3;
  59. /**
  60. * Returns the column (0 based) of the first cell.
  61. *
  62. * @return 0-based column of the first cell.
  63. */
  64. public short getCol1();
  65. /**
  66. * Sets the column (0 based) of the first cell.
  67. *
  68. * @param col1 0-based column of the first cell.
  69. */
  70. public void setCol1(int col1);
  71. /**
  72. * Returns the column (0 based) of the second cell.
  73. *
  74. * @return 0-based column of the second cell.
  75. */
  76. public short getCol2();
  77. /**
  78. * Returns the column (0 based) of the second cell.
  79. *
  80. * @param col2 0-based column of the second cell.
  81. */
  82. public void setCol2(int col2);
  83. /**
  84. * Returns the row (0 based) of the first cell.
  85. *
  86. * @return 0-based row of the first cell.
  87. */
  88. public int getRow1();
  89. /**
  90. * Returns the row (0 based) of the first cell.
  91. *
  92. * @param row1 0-based row of the first cell.
  93. */
  94. public void setRow1(int row1);
  95. /**
  96. * Returns the row (0 based) of the second cell.
  97. *
  98. * @return 0-based row of the second cell.
  99. */
  100. public int getRow2();
  101. /**
  102. * Returns the row (0 based) of the first cell.
  103. *
  104. * @param row2 0-based row of the first cell.
  105. */
  106. public void setRow2(int row2);
  107. /**
  108. * Returns the x coordinate within the first cell
  109. *
  110. * @return the x coordinate within the first cell
  111. */
  112. public int getDx1();
  113. /**
  114. * Sets the x coordinate within the first cell
  115. *
  116. * @param dx1 the x coordinate within the first cell
  117. */
  118. public void setDx1(int dx1);
  119. /**
  120. * Returns the y coordinate within the first cell
  121. *
  122. * @return the y coordinate within the first cell
  123. */
  124. public int getDy1();
  125. /**
  126. * Sets the y coordinate within the first cell
  127. *
  128. * @param dy1 the y coordinate within the first cell
  129. */
  130. public void setDy1(int dy1);
  131. /**
  132. * Sets the y coordinate within the second cell
  133. *
  134. * @return the y coordinate within the second cell
  135. */
  136. public int getDy2();
  137. /**
  138. * Sets the y coordinate within the second cell
  139. *
  140. * @param dy2 the y coordinate within the second cell
  141. */
  142. public void setDy2(int dy2);
  143. /**
  144. * Returns the x coordinate within the second cell
  145. *
  146. * @return the x coordinate within the second cell
  147. */
  148. public int getDx2();
  149. /**
  150. * Sets the x coordinate within the second cell
  151. *
  152. * @param dx2 the x coordinate within the second cell
  153. */
  154. public void setDx2(int dx2);
  155. /**
  156. * Sets the anchor type
  157. * <p>
  158. * 0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.
  159. * </p>
  160. * @param anchorType the anchor type
  161. * @see #MOVE_AND_RESIZE
  162. * @see #MOVE_DONT_RESIZE
  163. * @see #DONT_MOVE_AND_RESIZE
  164. */
  165. public void setAnchorType( int anchorType );
  166. /**
  167. * Gets the anchor type
  168. * <p>
  169. * 0 = Move and size with Cells, 2 = Move but don't size with cells, 3 = Don't move or size with cells.
  170. * </p>
  171. * @return the anchor type
  172. * @see #MOVE_AND_RESIZE
  173. * @see #MOVE_DONT_RESIZE
  174. * @see #DONT_MOVE_AND_RESIZE
  175. */
  176. public int getAnchorType();
  177. }