KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > read > biff > Window2Record


1 /*********************************************************************
2 *
3 * Copyright (C) 2003 Andrew Khan
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 ***************************************************************************/

19
20 package jxl.read.biff;
21
22 import common.Logger;
23
24 import jxl.biff.IntegerHelper;
25 import jxl.biff.RecordData;
26
27 /**
28  * Contains the cell dimensions of this worksheet
29  */

30 class Window2Record extends RecordData
31 {
32   /**
33    * The logger
34    */

35   private static Logger logger = Logger.getLogger(Window2Record.class);
36
37   /**
38    * Selected flag
39    */

40   private boolean selected;
41   /**
42    * Show grid lines flag
43    */

44   private boolean showGridLines;
45   /**
46    * Display zero values flag
47    */

48   private boolean displayZeroValues;
49   /**
50    * The window contains frozen panes
51    */

52   private boolean frozenPanes;
53   /**
54    * The window contains panes that are frozen but not split
55    */

56   private boolean frozenNotSplit;
57
58   /**
59    * Constructs the dimensions from the raw data
60    *
61    * @param t the raw data
62    */

63   public Window2Record(Record t)
64   {
65     super(t);
66     byte[] data = t.getData();
67
68     int options = IntegerHelper.getInt(data[0], data[1]);
69
70     selected = ((options & 0x200) != 0);
71     showGridLines = ((options & 0x02) != 0);
72     frozenPanes = ((options & 0x08) != 0);
73     displayZeroValues = ((options & 0x10) != 0);
74     frozenNotSplit = ((options & 0x100) != 0);
75   }
76
77   /**
78    * Accessor for the selected flag
79    *
80    * @return TRUE if this sheet is selected, FALSE otherwise
81    */

82   public boolean isSelected()
83   {
84     return selected;
85   }
86
87   /**
88    * Accessor for the show grid lines flag
89    *
90    * @return TRUE to show grid lines, FALSE otherwise
91    */

92   public boolean getShowGridLines()
93   {
94     return showGridLines;
95   }
96
97   /**
98    * Accessor for the zero values flag
99    *
100    * @return TRUE if this sheet displays zero values, FALSE otherwise
101    */

102   public boolean getDisplayZeroValues()
103   {
104     return displayZeroValues;
105   }
106
107   /**
108    * Accessor for the frozen panes flag
109    *
110    * @return TRUE if this contains frozen panes, FALSE otherwise
111    */

112   public boolean getFrozen()
113   {
114     return frozenPanes;
115   }
116
117   /**
118    * Accessor for the frozen not split flag
119    *
120    * @return TRUE if this contains frozen, FALSE otherwise
121    */

122   public boolean getFrozenNotSplit()
123   {
124     return frozenNotSplit;
125   }
126 }
127
128
129
130
131
132
133
134
Popular Tags