KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hwpf > model > types > TCAbstractType


1
2 /* ====================================================================
3    Copyright 2002-2004 Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        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
19
20 package org.apache.poi.hwpf.model.types;
21
22
23
24 import org.apache.poi.util.BitField;
25 import org.apache.poi.util.LittleEndian;
26 import org.apache.poi.util.StringUtil;
27 import org.apache.poi.util.HexDump;
28 import org.apache.poi.hdf.model.hdftypes.HDFType;
29 import org.apache.poi.hwpf.usermodel.*;
30
31 /**
32  * Table Cell Descriptor.
33  * NOTE: This source is automatically generated please do not modify this file. Either subclass or
34  * remove the record in src/records/definitions.
35
36  * @author S. Ryan Ackley
37  */

38 public abstract class TCAbstractType
39     implements HDFType
40 {
41
42     protected short field_1_rgf;
43         private static BitField fFirstMerged = new BitField(0x0001);
44         private static BitField fMerged = new BitField(0x0002);
45         private static BitField fVertical = new BitField(0x0004);
46         private static BitField fBackward = new BitField(0x0008);
47         private static BitField fRotateFont = new BitField(0x0010);
48         private static BitField fVertMerge = new BitField(0x0020);
49         private static BitField fVertRestart = new BitField(0x0040);
50         private static BitField vertAlign = new BitField(0x0180);
51     protected short field_2_unused;
52     protected BorderCode field_3_brcTop;
53     protected BorderCode field_4_brcLeft;
54     protected BorderCode field_5_brcBottom;
55     protected BorderCode field_6_brcRight;
56
57
58     public TCAbstractType()
59     {
60
61     }
62
63     protected void fillFields(byte [] data, int offset)
64     {
65         field_1_rgf = LittleEndian.getShort(data, 0x0 + offset);
66         field_2_unused = LittleEndian.getShort(data, 0x2 + offset);
67         field_3_brcTop = new BorderCode(data, 0x4 + offset);
68         field_4_brcLeft = new BorderCode(data, 0x8 + offset);
69         field_5_brcBottom = new BorderCode(data, 0xc + offset);
70         field_6_brcRight = new BorderCode(data, 0x10 + offset);
71
72     }
73
74     public void serialize(byte[] data, int offset)
75     {
76         LittleEndian.putShort(data, 0x0 + offset, (short)field_1_rgf);;
77         LittleEndian.putShort(data, 0x2 + offset, (short)field_2_unused);;
78         field_3_brcTop.serialize(data, 0x4 + offset);;
79         field_4_brcLeft.serialize(data, 0x8 + offset);;
80         field_5_brcBottom.serialize(data, 0xc + offset);;
81         field_6_brcRight.serialize(data, 0x10 + offset);;
82
83     }
84
85     public String JavaDoc toString()
86     {
87         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
88
89         buffer.append("[TC]\n");
90
91         buffer.append(" .rgf = ");
92         buffer.append(" (").append(getRgf()).append(" )\n");
93         buffer.append(" .fFirstMerged = ").append(isFFirstMerged()).append('\n');
94         buffer.append(" .fMerged = ").append(isFMerged()).append('\n');
95         buffer.append(" .fVertical = ").append(isFVertical()).append('\n');
96         buffer.append(" .fBackward = ").append(isFBackward()).append('\n');
97         buffer.append(" .fRotateFont = ").append(isFRotateFont()).append('\n');
98         buffer.append(" .fVertMerge = ").append(isFVertMerge()).append('\n');
99         buffer.append(" .fVertRestart = ").append(isFVertRestart()).append('\n');
100         buffer.append(" .vertAlign = ").append(getVertAlign()).append('\n');
101
102         buffer.append(" .unused = ");
103         buffer.append(" (").append(getUnused()).append(" )\n");
104
105         buffer.append(" .brcTop = ");
106         buffer.append(" (").append(getBrcTop()).append(" )\n");
107
108         buffer.append(" .brcLeft = ");
109         buffer.append(" (").append(getBrcLeft()).append(" )\n");
110
111         buffer.append(" .brcBottom = ");
112         buffer.append(" (").append(getBrcBottom()).append(" )\n");
113
114         buffer.append(" .brcRight = ");
115         buffer.append(" (").append(getBrcRight()).append(" )\n");
116
117         buffer.append("[/TC]\n");
118         return buffer.toString();
119     }
120
121     /**
122      * Size of record (exluding 4 byte header)
123      */

124     public int getSize()
125     {
126         return 4 + + 2 + 2 + 4 + 4 + 4 + 4;
127     }
128
129
130
131     /**
132      * Get the rgf field for the TC record.
133      */

134     public short getRgf()
135     {
136         return field_1_rgf;
137     }
138
139     /**
140      * Set the rgf field for the TC record.
141      */

142     public void setRgf(short field_1_rgf)
143     {
144         this.field_1_rgf = field_1_rgf;
145     }
146
147     /**
148      * Get the unused field for the TC record.
149      */

150     public short getUnused()
151     {
152         return field_2_unused;
153     }
154
155     /**
156      * Set the unused field for the TC record.
157      */

158     public void setUnused(short field_2_unused)
159     {
160         this.field_2_unused = field_2_unused;
161     }
162
163     /**
164      * Get the brcTop field for the TC record.
165      */

166     public BorderCode getBrcTop()
167     {
168         return field_3_brcTop;
169     }
170
171     /**
172      * Set the brcTop field for the TC record.
173      */

174     public void setBrcTop(BorderCode field_3_brcTop)
175     {
176         this.field_3_brcTop = field_3_brcTop;
177     }
178
179     /**
180      * Get the brcLeft field for the TC record.
181      */

182     public BorderCode getBrcLeft()
183     {
184         return field_4_brcLeft;
185     }
186
187     /**
188      * Set the brcLeft field for the TC record.
189      */

190     public void setBrcLeft(BorderCode field_4_brcLeft)
191     {
192         this.field_4_brcLeft = field_4_brcLeft;
193     }
194
195     /**
196      * Get the brcBottom field for the TC record.
197      */

198     public BorderCode getBrcBottom()
199     {
200         return field_5_brcBottom;
201     }
202
203     /**
204      * Set the brcBottom field for the TC record.
205      */

206     public void setBrcBottom(BorderCode field_5_brcBottom)
207     {
208         this.field_5_brcBottom = field_5_brcBottom;
209     }
210
211     /**
212      * Get the brcRight field for the TC record.
213      */

214     public BorderCode getBrcRight()
215     {
216         return field_6_brcRight;
217     }
218
219     /**
220      * Set the brcRight field for the TC record.
221      */

222     public void setBrcRight(BorderCode field_6_brcRight)
223     {
224         this.field_6_brcRight = field_6_brcRight;
225     }
226
227     /**
228      * Sets the fFirstMerged field value.
229      *
230      */

231     public void setFFirstMerged(boolean value)
232     {
233         field_1_rgf = (short)fFirstMerged.setBoolean(field_1_rgf, value);
234
235         
236     }
237
238     /**
239      *
240      * @return the fFirstMerged field value.
241      */

242     public boolean isFFirstMerged()
243     {
244         return fFirstMerged.isSet(field_1_rgf);
245         
246     }
247
248     /**
249      * Sets the fMerged field value.
250      *
251      */

252     public void setFMerged(boolean value)
253     {
254         field_1_rgf = (short)fMerged.setBoolean(field_1_rgf, value);
255
256         
257     }
258
259     /**
260      *
261      * @return the fMerged field value.
262      */

263     public boolean isFMerged()
264     {
265         return fMerged.isSet(field_1_rgf);
266         
267     }
268
269     /**
270      * Sets the fVertical field value.
271      *
272      */

273     public void setFVertical(boolean value)
274     {
275         field_1_rgf = (short)fVertical.setBoolean(field_1_rgf, value);
276
277         
278     }
279
280     /**
281      *
282      * @return the fVertical field value.
283      */

284     public boolean isFVertical()
285     {
286         return fVertical.isSet(field_1_rgf);
287         
288     }
289
290     /**
291      * Sets the fBackward field value.
292      *
293      */

294     public void setFBackward(boolean value)
295     {
296         field_1_rgf = (short)fBackward.setBoolean(field_1_rgf, value);
297
298         
299     }
300
301     /**
302      *
303      * @return the fBackward field value.
304      */

305     public boolean isFBackward()
306     {
307         return fBackward.isSet(field_1_rgf);
308         
309     }
310
311     /**
312      * Sets the fRotateFont field value.
313      *
314      */

315     public void setFRotateFont(boolean value)
316     {
317         field_1_rgf = (short)fRotateFont.setBoolean(field_1_rgf, value);
318
319         
320     }
321
322     /**
323      *
324      * @return the fRotateFont field value.
325      */

326     public boolean isFRotateFont()
327     {
328         return fRotateFont.isSet(field_1_rgf);
329         
330     }
331
332     /**
333      * Sets the fVertMerge field value.
334      *
335      */

336     public void setFVertMerge(boolean value)
337     {
338         field_1_rgf = (short)fVertMerge.setBoolean(field_1_rgf, value);
339
340         
341     }
342
343     /**
344      *
345      * @return the fVertMerge field value.
346      */

347     public boolean isFVertMerge()
348     {
349         return fVertMerge.isSet(field_1_rgf);
350         
351     }
352
353     /**
354      * Sets the fVertRestart field value.
355      *
356      */

357     public void setFVertRestart(boolean value)
358     {
359         field_1_rgf = (short)fVertRestart.setBoolean(field_1_rgf, value);
360
361         
362     }
363
364     /**
365      *
366      * @return the fVertRestart field value.
367      */

368     public boolean isFVertRestart()
369     {
370         return fVertRestart.isSet(field_1_rgf);
371         
372     }
373
374     /**
375      * Sets the vertAlign field value.
376      *
377      */

378     public void setVertAlign(byte value)
379     {
380         field_1_rgf = (short)vertAlign.setValue(field_1_rgf, value);
381
382         
383     }
384
385     /**
386      *
387      * @return the vertAlign field value.
388      */

389     public byte getVertAlign()
390     {
391         return ( byte )vertAlign.getValue(field_1_rgf);
392         
393     }
394
395
396 } // END OF CLASS
397

398
399
400
401
Popular Tags