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.

CellStyle.java 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  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. import org.apache.poi.util.Removal;
  17. public interface CellStyle {
  18. /**
  19. * general (normal) horizontal alignment
  20. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#GENERAL} instead.
  21. */
  22. @Removal(version="3.17")
  23. static final short ALIGN_GENERAL = 0x0; //HorizontalAlignment.GENERAL.getCode();
  24. /**
  25. * left-justified horizontal alignment
  26. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#LEFT} instead.
  27. */
  28. @Removal(version="3.17")
  29. static final short ALIGN_LEFT = 0x1; //HorizontalAlignment.LEFT.getCode();
  30. /**
  31. * center horizontal alignment
  32. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#CENTER} instead.
  33. */
  34. @Removal(version="3.17")
  35. static final short ALIGN_CENTER = 0x2; //HorizontalAlignment.CENTER.getCode();
  36. /**
  37. * right-justified horizontal alignment
  38. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#RIGHT} instead.
  39. */
  40. @Removal(version="3.17")
  41. static final short ALIGN_RIGHT = 0x3; //HorizontalAlignment.RIGHT.getCode();
  42. /**
  43. * fill? horizontal alignment
  44. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#FILL} instead.
  45. */
  46. @Removal(version="3.17")
  47. static final short ALIGN_FILL = 0x4; //HorizontalAlignment.FILL.getCode();
  48. /**
  49. * justified horizontal alignment
  50. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#JUSTIFY} instead.
  51. */
  52. @Removal(version="3.17")
  53. static final short ALIGN_JUSTIFY = 0x5; //HorizontalAlignment.JUSTIFY.getCode();
  54. /**
  55. * center-selection? horizontal alignment
  56. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#CENTER_SELECTION} instead.
  57. */
  58. @Removal(version="3.17")
  59. static final short ALIGN_CENTER_SELECTION = 0x6; //HorizontalAlignment.CENTER_SELECTION.getCode();
  60. /**
  61. * top-aligned vertical alignment
  62. * @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#TOP} instead.
  63. */
  64. @Removal(version="3.17")
  65. static final short VERTICAL_TOP = 0x0; //VerticalAlignment.TOP.getCode();
  66. /**
  67. * center-aligned vertical alignment
  68. * @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#CENTER} instead.
  69. */
  70. @Removal(version="3.17")
  71. static final short VERTICAL_CENTER = 0x1; //VerticalAlignment.CENTER.getCode();
  72. /**
  73. * bottom-aligned vertical alignment
  74. * @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#BOTTOM} instead.
  75. */
  76. @Removal(version="3.17")
  77. static final short VERTICAL_BOTTOM = 0x2; //VerticalAlignment.BOTTOM.getCode();
  78. /**
  79. * vertically justified vertical alignment
  80. * @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#JUSTIFY} instead.
  81. */
  82. @Removal(version="3.17")
  83. static final short VERTICAL_JUSTIFY = 0x3; //VerticalAlignment.JUSTIFY.getCode();
  84. /**
  85. * No border
  86. * @deprecated 3.15 beta 2. Use {@link BorderStyle#NONE} instead.
  87. */
  88. @Removal(version="3.17")
  89. static final short BORDER_NONE = 0x0; //BorderStyle.NONE.getCode();
  90. /**
  91. * Thin border
  92. * @deprecated 3.15 beta 2. Use {@link BorderStyle#THIN} instead.
  93. */
  94. @Removal(version="3.17")
  95. static final short BORDER_THIN = 0x1; //BorderStyle.THIN.getCode();
  96. /**
  97. * Medium border
  98. * @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM} instead.
  99. */
  100. @Removal(version="3.17")
  101. static final short BORDER_MEDIUM = 0x2; //BorderStyle.MEDIUM.getCode();
  102. /**
  103. * dash border
  104. * @deprecated 3.15 beta 2. Use {@link BorderStyle#DASHED} instead.
  105. */
  106. @Removal(version="3.17")
  107. static final short BORDER_DASHED = 0x3; //BorderStyle.DASHED.getCode();
  108. /**
  109. * dot border
  110. * @deprecated 3.15 beta 2. Use {@link BorderStyle#DOTTED} instead.
  111. */
  112. @Removal(version="3.17")
  113. static final short BORDER_DOTTED = 0x4; //BorderStyle.DOTTED.getCode();
  114. /**
  115. * Thick border
  116. * @deprecated 3.15 beta 2. Use {@link BorderStyle#THICK} instead.
  117. */
  118. @Removal(version="3.17")
  119. static final short BORDER_THICK = 0x5; //BorderStyle.THICK.getCode();
  120. /**
  121. * double-line border
  122. * @deprecated 3.15 beta 2. Use {@link BorderStyle#DOUBLE} instead.
  123. */
  124. @Removal(version="3.17")
  125. static final short BORDER_DOUBLE = 0x6; //BorderStyle.DOUBLE.getCode();
  126. /**
  127. * hair-line border
  128. * @deprecated 3.15 beta 2. Use {@link BorderStyle#HAIR} instead.
  129. */
  130. @Removal(version="3.17")
  131. static final short BORDER_HAIR = 0x7; //BorderStyle.HAIR.getCode();
  132. /**
  133. * Medium dashed border
  134. * @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM_DASHED} instead.
  135. */
  136. @Removal(version="3.17")
  137. static final short BORDER_MEDIUM_DASHED = 0x8; //BorderStyle.MEDIUM_DASHED.getCode();
  138. /**
  139. * dash-dot border
  140. * @deprecated 3.15 beta 2. Use {@link BorderStyle#DASH_DOT} instead.
  141. */
  142. @Removal(version="3.17")
  143. static final short BORDER_DASH_DOT = 0x9; //BorderStyle.DASH_DOT.getCode();
  144. /**
  145. * medium dash-dot border
  146. * @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM_DASH_DOT} instead.
  147. */
  148. @Removal(version="3.17")
  149. static final short BORDER_MEDIUM_DASH_DOT = 0xA; //BorderStyle.MEDIUM_DASH_DOT.getCode();
  150. /**
  151. * dash-dot-dot border
  152. * @deprecated 3.15 beta 2. Use {@link BorderStyle#DASH_DOT_DOT} instead.
  153. */
  154. @Removal(version="3.17")
  155. static final short BORDER_DASH_DOT_DOT = 0xB; //BorderStyle.DASH_DOT_DOT.getCode();
  156. /**
  157. * medium dash-dot-dot border
  158. * @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM_DASH_DOT_DOT} instead.
  159. */
  160. @Removal(version="3.17")
  161. static final short BORDER_MEDIUM_DASH_DOT_DOT = 0xC; //BorderStyle.MEDIUM_DASH_DOT_DOT.getCode();
  162. /**
  163. * slanted dash-dot border
  164. * @deprecated 3.15 beta 2. Use {@link BorderStyle#SLANTED_DASH_DOT} instead.
  165. */
  166. @Removal(version="3.17")
  167. static final short BORDER_SLANTED_DASH_DOT = 0xD; //BorderStyle.SLANTED_DASH_DOT.getCode();
  168. /**
  169. * Fill Pattern: No background
  170. * @deprecated 3.15 beta 3. Use {@link FillPatternType#NO_FILL} instead.
  171. */
  172. @Removal(version="3.17")
  173. static final short NO_FILL = 0; //FillPatternType.NO_FILL.getCode();
  174. /**
  175. * Fill Pattern: Solidly filled
  176. * @deprecated 3.15 beta 3. Use {@link FillPatternType#SOLID_FOREGROUND} instead.
  177. */
  178. @Removal(version="3.17")
  179. static final short SOLID_FOREGROUND = 1; //FillPatternType.SOLID_FOREGROUND.getCode();
  180. /**
  181. * Fill Pattern: Small fine dots
  182. * @deprecated 3.15 beta 3. Use {@link FillPatternType#FINE_DOTS} instead.
  183. */
  184. @Removal(version="3.17")
  185. static final short FINE_DOTS = 2; //FillPatternType.FINE_DOTS.getCode();
  186. /**
  187. * Fill Pattern: Wide dots
  188. * @deprecated 3.15 beta 3. Use {@link FillPatternType#ALT_BARS} instead.
  189. */
  190. @Removal(version="3.17")
  191. static final short ALT_BARS = 3; //FillPatternType.ALT_BARS.getCode();
  192. /**
  193. * Fill Pattern: Sparse dots
  194. * @deprecated 3.15 beta 3. Use {@link FillPatternType#SPARSE_DOTS} instead.
  195. */
  196. @Removal(version="3.17")
  197. static final short SPARSE_DOTS = 4; //FillPatternType.SPARSE_DOTS.getCode();
  198. /**
  199. * Fill Pattern: Thick horizontal bands
  200. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_HORZ_BANDS} instead.
  201. */
  202. @Removal(version="3.17")
  203. static final short THICK_HORZ_BANDS = 5; //FillPatternType.THICK_HORZ_BANDS.getCode();
  204. /**
  205. * Fill Pattern: Thick vertical bands
  206. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_VERT_BANDS} instead.
  207. */
  208. @Removal(version="3.17")
  209. static final short THICK_VERT_BANDS = 6; //FillPatternType.THICK_VERT_BANDS.getCode();
  210. /**
  211. * Fill Pattern: Thick backward facing diagonals
  212. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_BACKWARD_DIAG} instead.
  213. */
  214. @Removal(version="3.17")
  215. static final short THICK_BACKWARD_DIAG = 7; //FillPatternType.THICK_BACKWARD_DIAG.getCode();
  216. /**
  217. * Fill Pattern: Thick forward facing diagonals
  218. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_FORWARD_DIAG} instead.
  219. */
  220. @Removal(version="3.17")
  221. static final short THICK_FORWARD_DIAG = 8; //FillPatternType.THICK_FORWARD_DIAG.getCode();
  222. /**
  223. * Fill Pattern: Large spots
  224. * @deprecated 3.15 beta 3. Use {@link FillPatternType#BIG_SPOTS} instead.
  225. */
  226. @Removal(version="3.17")
  227. static final short BIG_SPOTS = 9; //FillPatternType.BIG_SPOTS.getCode();
  228. /**
  229. * Fill Pattern: Brick-like layout
  230. * @deprecated 3.15 beta 3. Use {@link FillPatternType#BRICKS} instead.
  231. */
  232. @Removal(version="3.17")
  233. static final short BRICKS = 10; //FillPatternType.BRICKS.getCode();
  234. /**
  235. * Fill Pattern: Thin horizontal bands
  236. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_HORZ_BANDS} instead.
  237. */
  238. @Removal(version="3.17")
  239. static final short THIN_HORZ_BANDS = 11; //FillPatternType.THIN_HORZ_BANDS.getCode();
  240. /**
  241. * Fill Pattern: Thin vertical bands
  242. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_VERT_BANDS} instead.
  243. */
  244. @Removal(version="3.17")
  245. static final short THIN_VERT_BANDS = 12; //FillPatternType.THIN_VERT_BANDS.getCode();
  246. /**
  247. * Fill Pattern: Thin backward diagonal
  248. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_BACKWARD_DIAG} instead.
  249. */
  250. @Removal(version="3.17")
  251. static final short THIN_BACKWARD_DIAG = 13; //FillPatternType.THIN_BACKWARD_DIAG.getCode();
  252. /**
  253. * Fill Pattern: Thin forward diagonal
  254. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_FORWARD_DIAG} instead.
  255. */
  256. @Removal(version="3.17")
  257. static final short THIN_FORWARD_DIAG = 14; //FillPatternType.THIN_FORWARD_DIAG.getCode();
  258. /**
  259. * Fill Pattern: Squares
  260. * @deprecated 3.15 beta 3. Use {@link FillPatternType#SQUARES} instead.
  261. */
  262. @Removal(version="3.17")
  263. static final short SQUARES = 15; //FillPatternType.SQUARES.getCode();
  264. /**
  265. * Fill Pattern: Diamonds
  266. * @deprecated 3.15 beta 3. Use {@link FillPatternType#DIAMONDS} instead.
  267. */
  268. @Removal(version="3.17")
  269. static final short DIAMONDS = 16; //FillPatternType.DIAMONDS.getCode();
  270. /**
  271. * Fill Pattern: Less Dots
  272. * @deprecated 3.15 beta 3. Use {@link FillPatternType#LESS_DOTS} instead.
  273. */
  274. @Removal(version="3.17")
  275. static final short LESS_DOTS = 17; //FillPatternType.LESS_DOTS.getCode();
  276. /**
  277. * Fill Pattern: Least Dots
  278. * @deprecated 3.15 beta 3. Use {@link FillPatternType#LEAST_DOTS} instead.
  279. */
  280. @Removal(version="3.17")
  281. static final short LEAST_DOTS = 18; //FillPatternType.LEAST_DOTS.getCode();
  282. /**
  283. * get the index within the Workbook (sequence within the collection of ExtnededFormat objects)
  284. * @return unique index number of the underlying record this style represents (probably you don't care
  285. * unless you're comparing which one is which)
  286. */
  287. short getIndex();
  288. /**
  289. * set the data format (must be a valid format)
  290. * @see DataFormat
  291. */
  292. void setDataFormat(short fmt);
  293. /**
  294. * get the index of the format
  295. * @see DataFormat
  296. */
  297. short getDataFormat();
  298. /**
  299. * Get the format string
  300. */
  301. public String getDataFormatString();
  302. /**
  303. * set the font for this style
  304. * @param font a font object created or retrieved from the Workbook object
  305. * @see Workbook#createFont()
  306. * @see Workbook#getFontAt(short)
  307. */
  308. void setFont(Font font);
  309. /**
  310. * gets the index of the font for this style
  311. * @see Workbook#getFontAt(short)
  312. */
  313. short getFontIndex();
  314. /**
  315. * set the cell's using this style to be hidden
  316. * @param hidden - whether the cell using this style should be hidden
  317. */
  318. void setHidden(boolean hidden);
  319. /**
  320. * get whether the cell's using this style are to be hidden
  321. * @return hidden - whether the cell using this style should be hidden
  322. */
  323. boolean getHidden();
  324. /**
  325. * set the cell's using this style to be locked
  326. * @param locked - whether the cell using this style should be locked
  327. */
  328. void setLocked(boolean locked);
  329. /**
  330. * get whether the cell's using this style are to be locked
  331. * @return hidden - whether the cell using this style should be locked
  332. */
  333. boolean getLocked();
  334. /**
  335. * set the type of horizontal alignment for the cell
  336. * @param align - the type of alignment
  337. * @see #ALIGN_GENERAL
  338. * @see #ALIGN_LEFT
  339. * @see #ALIGN_CENTER
  340. * @see #ALIGN_RIGHT
  341. * @see #ALIGN_FILL
  342. * @see #ALIGN_JUSTIFY
  343. * @see #ALIGN_CENTER_SELECTION
  344. * @deprecated POI 3.15 beta 3. Use {@link #setAlignment(HorizontalAlignment)} instead.
  345. */
  346. void setAlignment(short align);
  347. /**
  348. * set the type of horizontal alignment for the cell
  349. * @param align - the type of alignment
  350. */
  351. void setAlignment(HorizontalAlignment align);
  352. /**
  353. * get the type of horizontal alignment for the cell
  354. * @return align - the type of alignment
  355. * @see #ALIGN_GENERAL
  356. * @see #ALIGN_LEFT
  357. * @see #ALIGN_CENTER
  358. * @see #ALIGN_RIGHT
  359. * @see #ALIGN_FILL
  360. * @see #ALIGN_JUSTIFY
  361. * @see #ALIGN_CENTER_SELECTION
  362. * @deprecated POI 3.15 beta 3. Use {@link #getAlignmentEnum()} instead.
  363. */
  364. short getAlignment();
  365. /**
  366. * get the type of horizontal alignment for the cell
  367. * @return align - the type of alignment
  368. */
  369. HorizontalAlignment getAlignmentEnum();
  370. /**
  371. * Set whether the text should be wrapped.
  372. * Setting this flag to <code>true</code> make all content visible
  373. * within a cell by displaying it on multiple lines
  374. *
  375. * @param wrapped wrap text or not
  376. */
  377. void setWrapText(boolean wrapped);
  378. /**
  379. * get whether the text should be wrapped
  380. * @return wrap text or not
  381. */
  382. boolean getWrapText();
  383. /**
  384. * set the type of vertical alignment for the cell
  385. * @param align the type of alignment
  386. * @see #VERTICAL_TOP
  387. * @see #VERTICAL_CENTER
  388. * @see #VERTICAL_BOTTOM
  389. * @see #VERTICAL_JUSTIFY
  390. * @deprecated POI 3.15 beta 3. Use {@link #setVerticalAlignment(VerticalAlignment)} instead.
  391. */
  392. void setVerticalAlignment(short align);
  393. /**
  394. * set the type of vertical alignment for the cell
  395. * @param align the type of alignment
  396. */
  397. void setVerticalAlignment(VerticalAlignment align);
  398. /**
  399. * get the type of vertical alignment for the cell
  400. * @return align the type of alignment
  401. * @see #VERTICAL_TOP
  402. * @see #VERTICAL_CENTER
  403. * @see #VERTICAL_BOTTOM
  404. * @see #VERTICAL_JUSTIFY
  405. * @deprecated POI 3.15 beta 3. Use {@link #getVerticalAlignmentEnum()} instead.
  406. */
  407. short getVerticalAlignment();
  408. /**
  409. * get the type of vertical alignment for the cell
  410. * @return align the type of alignment
  411. */
  412. VerticalAlignment getVerticalAlignmentEnum();
  413. /**
  414. * set the degree of rotation for the text in the cell.
  415. *
  416. * Note: HSSF uses values from -90 to 90 degrees, whereas XSSF
  417. * uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges
  418. * accordingly, however the corresponding getter is returning values in the range mandated by the current type
  419. * of Excel file-format that this CellStyle is applied to.
  420. *
  421. * @param rotation degrees (see note above)
  422. */
  423. void setRotation(short rotation);
  424. /**
  425. * get the degree of rotation for the text in the cell.
  426. *
  427. * Note: HSSF uses values from -90 to 90 degrees, whereas XSSF
  428. * uses values from 0 to 180 degrees. The implementations of this method will map between these two value-ranges
  429. * value-range as used by the type of Excel file-format that this CellStyle is applied to.
  430. *
  431. * @return rotation degrees (see note above)
  432. */
  433. short getRotation();
  434. /**
  435. * set the number of spaces to indent the text in the cell
  436. * @param indent - number of spaces
  437. */
  438. void setIndention(short indent);
  439. /**
  440. * get the number of spaces to indent the text in the cell
  441. * @return indent - number of spaces
  442. */
  443. short getIndention();
  444. /**
  445. * set the type of border to use for the left border of the cell
  446. * @param border type
  447. * @see #BORDER_NONE
  448. * @see #BORDER_THIN
  449. * @see #BORDER_MEDIUM
  450. * @see #BORDER_DASHED
  451. * @see #BORDER_DOTTED
  452. * @see #BORDER_THICK
  453. * @see #BORDER_DOUBLE
  454. * @see #BORDER_HAIR
  455. * @see #BORDER_MEDIUM_DASHED
  456. * @see #BORDER_DASH_DOT
  457. * @see #BORDER_MEDIUM_DASH_DOT
  458. * @see #BORDER_DASH_DOT_DOT
  459. * @see #BORDER_MEDIUM_DASH_DOT_DOT
  460. * @see #BORDER_SLANTED_DASH_DOT
  461. * @deprecated 3.15 beta 2. Use {@link #setBorderLeft(BorderStyle)} instead
  462. */
  463. @Removal(version="3.17")
  464. void setBorderLeft(short border);
  465. /**
  466. * set the type of border to use for the left border of the cell
  467. * @param border type
  468. * @since POI 3.15
  469. */
  470. void setBorderLeft(BorderStyle border);
  471. /**
  472. * get the type of border to use for the left border of the cell
  473. * @return border type
  474. * @deprecated POI 3.15. Use {@link #getBorderLeftEnum()} instead.
  475. * This will return a BorderStyle enum in the future.
  476. */
  477. short getBorderLeft();
  478. /**
  479. * get the type of border to use for the left border of the cell
  480. * @return border type
  481. * @since POI 3.15
  482. */
  483. BorderStyle getBorderLeftEnum();
  484. /**
  485. * set the type of border to use for the right border of the cell
  486. * @param border type
  487. * @see #BORDER_NONE
  488. * @see #BORDER_THIN
  489. * @see #BORDER_MEDIUM
  490. * @see #BORDER_DASHED
  491. * @see #BORDER_DOTTED
  492. * @see #BORDER_THICK
  493. * @see #BORDER_DOUBLE
  494. * @see #BORDER_HAIR
  495. * @see #BORDER_MEDIUM_DASHED
  496. * @see #BORDER_DASH_DOT
  497. * @see #BORDER_MEDIUM_DASH_DOT
  498. * @see #BORDER_DASH_DOT_DOT
  499. * @see #BORDER_MEDIUM_DASH_DOT_DOT
  500. * @see #BORDER_SLANTED_DASH_DOT
  501. * @deprecated 3.15 beta 2. Use {@link #setBorderRight(BorderStyle)} instead
  502. */
  503. @Removal(version="3.17")
  504. void setBorderRight(short border);
  505. /**
  506. * set the type of border to use for the right border of the cell
  507. * @param border type
  508. * @since POI 3.15
  509. */
  510. void setBorderRight(BorderStyle border);
  511. /**
  512. * get the type of border to use for the right border of the cell
  513. * @return border type
  514. * @deprecated POI 3.15. Use {@link #getBorderRightEnum()} instead.
  515. * This will return a BorderStyle enum in the future.
  516. */
  517. short getBorderRight();
  518. /**
  519. * get the type of border to use for the right border of the cell
  520. * @return border type
  521. * @since POI 3.15
  522. */
  523. BorderStyle getBorderRightEnum();
  524. /**
  525. * set the type of border to use for the top border of the cell
  526. * @param border type
  527. * @see #BORDER_NONE
  528. * @see #BORDER_THIN
  529. * @see #BORDER_MEDIUM
  530. * @see #BORDER_DASHED
  531. * @see #BORDER_DOTTED
  532. * @see #BORDER_THICK
  533. * @see #BORDER_DOUBLE
  534. * @see #BORDER_HAIR
  535. * @see #BORDER_MEDIUM_DASHED
  536. * @see #BORDER_DASH_DOT
  537. * @see #BORDER_MEDIUM_DASH_DOT
  538. * @see #BORDER_DASH_DOT_DOT
  539. * @see #BORDER_MEDIUM_DASH_DOT_DOT
  540. * @see #BORDER_SLANTED_DASH_DOT
  541. * @deprecated 3.15 beta 2. Use {@link #setBorderTop(BorderStyle)} instead
  542. */
  543. @Removal(version="3.17")
  544. void setBorderTop(short border);
  545. /**
  546. * set the type of border to use for the top border of the cell
  547. * @param border type
  548. * @since POI 3.15
  549. */
  550. void setBorderTop(BorderStyle border);
  551. /**
  552. * get the type of border to use for the top border of the cell
  553. * @return border type
  554. * @deprecated POI 3.15. Use {@link #getBorderTopEnum()} instead.
  555. * This will return a BorderStyle enum in the future.
  556. */
  557. short getBorderTop();
  558. /**
  559. * get the type of border to use for the top border of the cell
  560. * @return border type
  561. * @since POI 3.15
  562. */
  563. BorderStyle getBorderTopEnum();
  564. /**
  565. * set the type of border to use for the bottom border of the cell
  566. * @param border type
  567. * @see #BORDER_NONE
  568. * @see #BORDER_THIN
  569. * @see #BORDER_MEDIUM
  570. * @see #BORDER_DASHED
  571. * @see #BORDER_DOTTED
  572. * @see #BORDER_THICK
  573. * @see #BORDER_DOUBLE
  574. * @see #BORDER_HAIR
  575. * @see #BORDER_MEDIUM_DASHED
  576. * @see #BORDER_DASH_DOT
  577. * @see #BORDER_MEDIUM_DASH_DOT
  578. * @see #BORDER_DASH_DOT_DOT
  579. * @see #BORDER_MEDIUM_DASH_DOT_DOT
  580. * @see #BORDER_SLANTED_DASH_DOT
  581. * @deprecated 3.15 beta 2. Use {@link #setBorderBottom(BorderStyle)} instead.
  582. */
  583. @Removal(version="3.17")
  584. void setBorderBottom(short border);
  585. /**
  586. * set the type of border to use for the bottom border of the cell
  587. * @param border type
  588. * @since POI 3.15
  589. */
  590. void setBorderBottom(BorderStyle border);
  591. /**
  592. * get the type of border to use for the bottom border of the cell
  593. * @return border type
  594. * @deprecated POI 3.15. Use {@link #getBorderBottomEnum()} instead.
  595. * This will return a BorderStyle enum in the future.
  596. */
  597. short getBorderBottom();
  598. /**
  599. * get the type of border to use for the bottom border of the cell
  600. * @return border type
  601. * @since POI 3.15
  602. */
  603. BorderStyle getBorderBottomEnum();
  604. /**
  605. * set the color to use for the left border
  606. * @param color The index of the color definition
  607. */
  608. void setLeftBorderColor(short color);
  609. /**
  610. * get the color to use for the left border
  611. */
  612. short getLeftBorderColor();
  613. /**
  614. * set the color to use for the right border
  615. * @param color The index of the color definition
  616. */
  617. void setRightBorderColor(short color);
  618. /**
  619. * get the color to use for the left border
  620. * @return the index of the color definition
  621. */
  622. short getRightBorderColor();
  623. /**
  624. * set the color to use for the top border
  625. * @param color The index of the color definition
  626. */
  627. void setTopBorderColor(short color);
  628. /**
  629. * get the color to use for the top border
  630. * @return the index of the color definition
  631. */
  632. short getTopBorderColor();
  633. /**
  634. * set the color to use for the bottom border
  635. * @param color The index of the color definition
  636. */
  637. void setBottomBorderColor(short color);
  638. /**
  639. * get the color to use for the left border
  640. * @return the index of the color definition
  641. */
  642. short getBottomBorderColor();
  643. /**
  644. * setting to one fills the cell with the foreground color... No idea about
  645. * other values
  646. *
  647. * @see #NO_FILL
  648. * @see #SOLID_FOREGROUND
  649. * @see #FINE_DOTS
  650. * @see #ALT_BARS
  651. * @see #SPARSE_DOTS
  652. * @see #THICK_HORZ_BANDS
  653. * @see #THICK_VERT_BANDS
  654. * @see #THICK_BACKWARD_DIAG
  655. * @see #THICK_FORWARD_DIAG
  656. * @see #BIG_SPOTS
  657. * @see #BRICKS
  658. * @see #THIN_HORZ_BANDS
  659. * @see #THIN_VERT_BANDS
  660. * @see #THIN_BACKWARD_DIAG
  661. * @see #THIN_FORWARD_DIAG
  662. * @see #SQUARES
  663. * @see #DIAMONDS
  664. *
  665. * @param fp fill pattern (set to 1 to fill w/foreground color)
  666. * @deprecated POI 3.15 beta 3. Use {@link #setFillPattern(FillPatternType)} instead.
  667. */
  668. void setFillPattern(short fp);
  669. /**
  670. * setting to one fills the cell with the foreground color... No idea about
  671. * other values
  672. *
  673. * @see #NO_FILL
  674. * @see #SOLID_FOREGROUND
  675. * @see #FINE_DOTS
  676. * @see #ALT_BARS
  677. * @see #SPARSE_DOTS
  678. * @see #THICK_HORZ_BANDS
  679. * @see #THICK_VERT_BANDS
  680. * @see #THICK_BACKWARD_DIAG
  681. * @see #THICK_FORWARD_DIAG
  682. * @see #BIG_SPOTS
  683. * @see #BRICKS
  684. * @see #THIN_HORZ_BANDS
  685. * @see #THIN_VERT_BANDS
  686. * @see #THIN_BACKWARD_DIAG
  687. * @see #THIN_FORWARD_DIAG
  688. * @see #SQUARES
  689. * @see #DIAMONDS
  690. *
  691. * @param fp fill pattern (set to {@link FillPatternType#SOLID_FOREGROUND} to fill w/foreground color)
  692. * @since POI 3.15 beta 3
  693. */
  694. void setFillPattern(FillPatternType fp);
  695. /**
  696. * get the fill pattern (??) - set to 1 to fill with foreground color
  697. * @return fill pattern
  698. * @deprecated POI 3.15 beta 3. This method will return {@link FillPatternType} in the future. Use {@link #setFillPattern(FillPatternType)} instead.
  699. */
  700. short getFillPattern();
  701. /**
  702. * get the fill pattern (??) - set to 1 to fill with foreground color
  703. * @return fill pattern
  704. * @since POI 3.15 beta 3
  705. */
  706. FillPatternType getFillPatternEnum();
  707. /**
  708. * set the background fill color.
  709. *
  710. * @param bg color
  711. */
  712. void setFillBackgroundColor(short bg);
  713. /**
  714. * get the background fill color, if the fill
  715. * is defined with an indexed color.
  716. * @return fill color index, or 0 if not indexed (XSSF only)
  717. */
  718. short getFillBackgroundColor();
  719. /**
  720. * Gets the color object representing the current
  721. * background fill, resolving indexes using
  722. * the supplied workbook.
  723. * This will work for both indexed and rgb
  724. * defined colors.
  725. */
  726. Color getFillBackgroundColorColor();
  727. /**
  728. * set the foreground fill color
  729. * <i>Note: Ensure Foreground color is set prior to background color.</i>
  730. * @param bg color
  731. */
  732. void setFillForegroundColor(short bg);
  733. /**
  734. * get the foreground fill color, if the fill
  735. * is defined with an indexed color.
  736. * @return fill color, or 0 if not indexed (XSSF only)
  737. */
  738. short getFillForegroundColor();
  739. /**
  740. * Gets the color object representing the current
  741. * foreground fill, resolving indexes using
  742. * the supplied workbook.
  743. * This will work for both indexed and rgb
  744. * defined colors.
  745. */
  746. Color getFillForegroundColorColor();
  747. /**
  748. * Clones all the style information from another
  749. * CellStyle, onto this one. This
  750. * CellStyle will then have all the same
  751. * properties as the source, but the two may
  752. * be edited independently.
  753. * Any stylings on this CellStyle will be lost!
  754. *
  755. * The source CellStyle could be from another
  756. * Workbook if you like. This allows you to
  757. * copy styles from one Workbook to another.
  758. *
  759. * However, both of the CellStyles will need
  760. * to be of the same type (HSSFCellStyle or
  761. * XSSFCellStyle)
  762. */
  763. public void cloneStyleFrom(CellStyle source);
  764. /**
  765. * Controls if the Cell should be auto-sized
  766. * to shrink to fit if the text is too long
  767. */
  768. public void setShrinkToFit(boolean shrinkToFit);
  769. /**
  770. * Should the Cell be auto-sized by Excel to shrink
  771. * it to fit if this text is too long?
  772. */
  773. public boolean getShrinkToFit();
  774. }