KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > write > Label


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.LabelCell;
23 import jxl.format.CellFormat;
24 import jxl.write.biff.LabelRecord;
25
26 /**
27  * A cell containing text which may be created by user applications
28  */

29 public class Label extends LabelRecord implements WritableCell, LabelCell
30 {
31   /**
32    * Creates a cell which, when added to the sheet, will be presented at the
33    * specified column and row co-ordinates and will contain the specified text
34    *
35    * @param c the column
36    * @param cont the text
37    * @param r the row
38    */

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

54   public Label(int c, int r, String JavaDoc cont, CellFormat st)
55   {
56     super(c, r, cont, st);
57   }
58
59   /**
60    * Copy constructor used for deep copying
61    *
62    * @param col the column
63    * @param row the row
64    * @param l the label to copy
65    */

66   protected Label(int col, int row, Label l)
67   {
68     super(col, row, l);
69   }
70
71   /**
72    * Constructor used internally by the application when making a writable
73    * copy of a spreadsheet being read in
74    *
75    * @param lc the label to copy
76    */

77   public Label(LabelCell lc)
78   {
79     super(lc);
80   }
81
82   /**
83    * Sets the string contents of this cell
84    *
85    * @param s the new data
86    */

87   public void setString(String JavaDoc s)
88   {
89     super.setString(s);
90   }
91
92   /**
93    * Implementation of the deep copy function
94    *
95    * @param col the column which the new cell will occupy
96    * @param row the row which the new cell will occupy
97    * @return a copy of this cell, which can then be added to the sheet
98    */

99   public WritableCell copyTo(int col, int row)
100   {
101     return new Label(col, row, this);
102   }
103 }
104
105
Popular Tags