KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hdf > extractor > TC


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.hdf.extractor;
21
22 /**
23  * Comment me
24  *
25  * @author Ryan Ackley
26  */

27
28 public class TC
29 {
30
31   boolean _fFirstMerged;
32   boolean _fMerged;
33   boolean _fVertical;
34   boolean _fBackward;
35   boolean _fRotateFont;
36   boolean _fVertMerge;
37   boolean _fVertRestart;
38   short _vertAlign;
39   short[] _brcTop = new short[2];
40   short[] _brcLeft = new short[2];
41   short[] _brcBottom = new short[2];
42   short[] _brcRight = new short [2];
43
44   public TC()
45   {
46   }
47   static TC convertBytesToTC(byte[] array, int offset)
48   {
49     TC tc = new TC();
50     int rgf = Utils.convertBytesToShort(array, offset);
51     tc._fFirstMerged = (rgf & 0x0001) > 0;
52     tc._fMerged = (rgf & 0x0002) > 0;
53     tc._fVertical = (rgf & 0x0004) > 0;
54     tc._fBackward = (rgf & 0x0008) > 0;
55     tc._fRotateFont = (rgf & 0x0010) > 0;
56     tc._fVertMerge = (rgf & 0x0020) > 0;
57     tc._fVertRestart = (rgf & 0x0040) > 0;
58     tc._vertAlign = (short)((rgf & 0x0180) >> 7);
59
60     tc._brcTop[0] = Utils.convertBytesToShort(array, offset + 4);
61     tc._brcTop[1] = Utils.convertBytesToShort(array, offset + 6);
62
63     tc._brcLeft[0] = Utils.convertBytesToShort(array, offset + 8);
64     tc._brcLeft[1] = Utils.convertBytesToShort(array, offset + 10);
65
66     tc._brcBottom[0] = Utils.convertBytesToShort(array, offset + 12);
67     tc._brcBottom[1] = Utils.convertBytesToShort(array, offset + 14);
68
69     tc._brcRight[0] = Utils.convertBytesToShort(array, offset + 16);
70     tc._brcRight[1] = Utils.convertBytesToShort(array, offset + 18);
71
72     return tc;
73   }
74
75 }
76
Popular Tags