01: /* ====================================================================
02: Licensed to the Apache Software Foundation (ASF) under one or more
03: contributor license agreements. See the NOTICE file distributed with
04: this work for additional information regarding copyright ownership.
05: The ASF licenses this file to You under the Apache License, Version 2.0
06: (the "License"); you may not use this file except in compliance with
07: the License. You may obtain a copy of the License at
08:
09: http://www.apache.org/licenses/LICENSE-2.0
10:
11: Unless required by applicable law or agreed to in writing, software
12: distributed under the License is distributed on an "AS IS" BASIS,
13: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: See the License for the specific language governing permissions and
15: limitations under the License.
16: ==================================================================== */
17:
18: package org.apache.poi.hwpf.usermodel;
19:
20: import org.apache.poi.hwpf.model.types.TAPAbstractType;
21:
22: public class TableProperties extends TAPAbstractType implements
23: Cloneable {
24:
25: public TableProperties() {
26:
27: }
28:
29: public TableProperties(int columns) {
30: field_7_itcMac = (short) columns;
31: field_10_rgshd = new ShadingDescriptor[columns];
32: for (int x = 0; x < columns; x++) {
33: field_10_rgshd[x] = new ShadingDescriptor();
34: }
35: field_11_brcBottom = new BorderCode();
36: field_12_brcTop = new BorderCode();
37: field_13_brcLeft = new BorderCode();
38: field_14_brcRight = new BorderCode();
39: field_15_brcVertical = new BorderCode();
40: field_16_brcHorizontal = new BorderCode();
41: field_8_rgdxaCenter = new short[columns];
42: field_9_rgtc = new TableCellDescriptor[columns];
43: for (int x = 0; x < columns; x++) {
44: field_9_rgtc[x] = new TableCellDescriptor();
45: }
46: }
47:
48: public Object clone() throws CloneNotSupportedException {
49: TableProperties tap = (TableProperties) super .clone();
50: tap.field_10_rgshd = new ShadingDescriptor[field_10_rgshd.length];
51: for (int x = 0; x < field_10_rgshd.length; x++) {
52: tap.field_10_rgshd[x] = (ShadingDescriptor) field_10_rgshd[x]
53: .clone();
54: }
55: tap.field_11_brcBottom = (BorderCode) field_11_brcBottom
56: .clone();
57: tap.field_12_brcTop = (BorderCode) field_12_brcTop.clone();
58: tap.field_13_brcLeft = (BorderCode) field_13_brcLeft.clone();
59: tap.field_14_brcRight = (BorderCode) field_14_brcRight.clone();
60: tap.field_15_brcVertical = (BorderCode) field_15_brcVertical
61: .clone();
62: tap.field_16_brcHorizontal = (BorderCode) field_16_brcHorizontal
63: .clone();
64: tap.field_8_rgdxaCenter = (short[]) field_8_rgdxaCenter.clone();
65: tap.field_9_rgtc = new TableCellDescriptor[field_9_rgtc.length];
66: for (int x = 0; x < field_9_rgtc.length; x++) {
67: tap.field_9_rgtc[x] = (TableCellDescriptor) field_9_rgtc[x]
68: .clone();
69: }
70: return tap;
71: }
72:
73: }
|