KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hwpf > usermodel > ShadingDescriptor


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 package org.apache.poi.hwpf.usermodel;
20
21 import org.apache.poi.util.BitField;
22 import org.apache.poi.util.LittleEndian;
23
24 public class ShadingDescriptor
25   implements Cloneable JavaDoc
26 {
27   public static final int SIZE = 2;
28
29   private short _info;
30     private final static BitField _icoFore = new BitField(0x1f);
31     private final static BitField _icoBack = new BitField(0x3e0);
32     private final static BitField _ipat = new BitField(0xfc00);
33
34   public ShadingDescriptor()
35   {
36   }
37
38   public ShadingDescriptor(byte[] buf, int offset)
39   {
40     this(LittleEndian.getShort(buf, offset));
41   }
42
43   public ShadingDescriptor(short info)
44   {
45     _info = info;
46   }
47
48   public short toShort()
49   {
50     return _info;
51   }
52
53   public void serialize(byte[] buf, int offset)
54   {
55     LittleEndian.putShort(buf, offset, _info);
56   }
57
58   public Object JavaDoc clone()
59     throws CloneNotSupportedException JavaDoc
60   {
61     return super.clone();
62   }
63 }
64
Popular Tags