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.

TableProperties.java 2.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.hwpf.usermodel;
  16. import org.apache.poi.common.Duplicatable;
  17. import org.apache.poi.hwpf.model.types.TAPAbstractType;
  18. import org.apache.poi.util.Removal;
  19. public final class TableProperties extends TAPAbstractType implements Duplicatable {
  20. public TableProperties() {
  21. setTlp(new TableAutoformatLookSpecifier());
  22. setShdTable(new ShadingDescriptor());
  23. setBrcBottom(new BorderCode());
  24. setBrcHorizontal(new BorderCode());
  25. setBrcLeft(new BorderCode());
  26. setBrcRight(new BorderCode());
  27. setBrcTop(new BorderCode());
  28. setBrcVertical(new BorderCode());
  29. setRgbrcInsideDefault_0(new BorderCode());
  30. setRgbrcInsideDefault_1(new BorderCode());
  31. setRgdxaCenter(new short[0]);
  32. setRgdxaCenterPrint(new short[0]);
  33. setRgshd(new ShadingDescriptor[0]);
  34. setRgtc(new TableCellDescriptor[0]);
  35. }
  36. public TableProperties(TableProperties other) {
  37. super(other);
  38. }
  39. public TableProperties( short columns ) {
  40. setItcMac( columns );
  41. setRgshd( new ShadingDescriptor[columns] );
  42. for ( int x = 0; x < columns; x++ )
  43. {
  44. getRgshd()[x] = new ShadingDescriptor();
  45. }
  46. TableCellDescriptor[] tableCellDescriptors = new TableCellDescriptor[columns];
  47. for ( int x = 0; x < columns; x++ )
  48. {
  49. tableCellDescriptors[x] = new TableCellDescriptor();
  50. }
  51. setRgtc( tableCellDescriptors );
  52. setRgdxaCenter( new short[columns] );
  53. setRgdxaCenterPrint( new short[columns] );
  54. }
  55. @Override
  56. @SuppressWarnings({"squid:S2975", "MethodDoesntCallSuperMethod"})
  57. @Deprecated
  58. @Removal(version = "5.0.0")
  59. public TableProperties clone() {
  60. return copy();
  61. }
  62. @Override
  63. public TableProperties copy() {
  64. return new TableProperties(this);
  65. }
  66. }