KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > write > Blank


1 /*********************************************************************
2 *
3 * Copyright (C) 2001 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.write;
21
22 import jxl.Cell;
23 import jxl.format.CellFormat;
24 import jxl.write.biff.BlankRecord;
25
26 /**
27  * A blank cell. Despite not having any contents, it may contain
28  * formatting information. Such cells are typically used when creating
29  * templates
30  */

31 public class Blank extends BlankRecord implements WritableCell
32 {
33   /**
34    * Creates a cell which, when added to the sheet, will be presented at the
35    * specified column and row co-ordinates
36    *
37    * @param c the column
38    * @param r the row
39    */

40   public Blank(int c, int r)
41   {
42     super(c, r);
43   }
44
45   /**
46    * Creates a cell which, when added to the sheet, will be presented at the
47    * specified column and row co-ordinates
48    * in the manner specified by the CellFormat parameter
49    *
50    * @param c the column
51    * @param r the row
52    * @param st the cell format
53    */

54   public Blank(int c, int r, CellFormat st)
55   {
56     super(c, r, st);
57   }
58
59   /**
60    * Constructor used internally by the application when making a writable
61    * copy of a spreadsheet being read in
62    *
63    * @param lc the cell to copy
64    */

65   public Blank(Cell lc)
66   {
67     super(lc);
68   }
69
70
71   /**
72    * Copy constructor used for deep copying
73    *
74    * @param col the column
75    * @param row the row
76    * @param b the balnk cell to copy
77    */

78   protected Blank(int col, int row, Blank b)
79   {
80     super(col, row, b);
81   }
82
83   /**
84    * Implementation of the deep copy function
85    *
86    * @param col the column which the new cell will occupy
87    * @param row the row which the new cell will occupy
88    * @return a copy of this cell, which can then be added to the sheet
89    */

90   public WritableCell copyTo(int col, int row)
91   {
92     return new Blank(col, row, this);
93   }
94 }
95
96
Popular Tags