View Javadoc

1   ////////////////////////////////////////////////////////////////////////////////
2   // MillScript-Excel: an Open Spice interpreter and batch website creation tool
3   // Copyright (C) 2005 Open World Ltd, Kevin Rogers
4   //
5   // This file is part of MillScript-Excel.
6   //
7   // MillScript-Excel is free software; you can redistribute it and/or modify it under
8   // the terms of the GNU General Public License as published by the Free
9   // Software Foundation; either version 2 of the License, or (at your option)
10  // any later version.
11  //
12  // MillScript-Excel is distributed in the hope that it will be useful, but WITHOUT
13  // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15  // more details.
16  //
17  // You should have received a copy of the GNU General Public License along with
18  // MillScript-Excel; if not, write to the Free Software Foundation, Inc., 59 Temple
19  // Place, Suite 330, Boston, MA  02111-1307  USA
20  ////////////////////////////////////////////////////////////////////////////////
21  package org.millscript.office.excel.records;
22  
23  import org.millscript.office.excel.Record;
24  import org.millscript.office.excel.blocks.SheetViewSettings;
25  
26  /**
27   * 
28   */
29  public class Window2 extends Record implements SheetViewSettings {
30  
31      private int cachedMagnificationFactorInNormalView;
32  
33      private int cachedMagnificationFactorInPageBreakPreview;
34  
35      private int indexToFirstVisibleTabColumn;
36  
37      private int indexToFirstVisibleTabRow;
38  
39      private int indexToGridLineColor;
40  
41      private char window2Options;
42  
43      public boolean automaticGridLineColour() {
44          return 0 != ( this.window2Options & 0x0020 );
45      }
46  
47      public boolean columnsFromRightToLeft() {
48          return 0 != ( this.window2Options & 0x0040 );
49      }
50  
51      public boolean panesAreFrozen() {
52          return 0 != ( this.window2Options & 0x0008 );
53      }
54  
55      public boolean removeSplitsIfPaneFreezeIsRemoved() {
56          return 0 != ( this.window2Options & 0x0100 );
57      }
58  
59      /**
60       * @param factor The cachedMagnificationFactorInNormalView to set.
61       */
62      public void setCachedMagnificationFactorInNormalView( final int factor ) {
63          this.cachedMagnificationFactorInNormalView = factor;
64      }
65  
66      /**
67       * @param factor The cachedMagnificationFactorInPageBreakPreview to set.
68       */
69      public void setCachedMagnificationFactorInPageBreakPreview( final int factor ) {
70          this.cachedMagnificationFactorInPageBreakPreview = factor;
71      }
72  
73      /**
74       * @param index The indexToFirstVisibleTabColumn to set.
75       */
76      public void setIndexToFirstVisibleTabColumn( final int index ) {
77          this.indexToFirstVisibleTabColumn = index;
78      }
79  
80      /**
81       * @param index The indexToFirstVisibleTabRow to set.
82       */
83      public void setIndexToFirstVisibleTabRow( final int index ) {
84          this.indexToFirstVisibleTabRow = index;
85      }
86  
87      /**
88       * @param index The indexToGridLineColor to set.
89       */
90      public void setIndexToGridLineColor( final int index ) {
91          this.indexToGridLineColor = index;
92      }
93  
94      /**
95       * @param options The options to set.
96       */
97      public void setOptions( final char options ) {
98          this.window2Options = options;
99      }
100 
101     public boolean sheetSelected() {
102         return 0 != ( this.window2Options & 0x0200 );
103     }
104 
105     public boolean sheetVisible() {
106         return 0 != ( this.window2Options & 0x0400 );
107     }
108 
109     public boolean showFormulas() {
110         return 0 != ( this.window2Options & 0x0001 );
111     }
112 
113     public boolean showGridLines() {
114         return 0 != ( this.window2Options & 0x0002 );
115     }
116 
117     public boolean showInPageBreakPreview() {
118         return 0 != ( this.window2Options & 0x0800 );
119     }
120 
121     public boolean showOutlineSymbols() {
122         return 0 != ( this.window2Options & 0x0080 );
123     }
124 
125     public boolean showSheetHeaders() {
126         return 0 != ( this.window2Options & 0x0004 );
127     }
128 
129     public boolean showZeroValues() {
130         return 0 != ( this.window2Options & 0x0010 );
131     }
132 
133 }