KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jxl > biff > drawing > DrawingGroupObject


1 /*********************************************************************
2 *
3 * Copyright (C) 2002 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.biff.drawing;
21
22 import java.io.IOException JavaDoc;
23 import java.io.FileInputStream JavaDoc;
24
25 import common.Assert;
26 import common.Logger;
27
28 import jxl.WorkbookSettings;
29 import jxl.biff.ByteData;
30 import jxl.biff.IntegerHelper;
31 import jxl.biff.IndexMapping;
32 import jxl.biff.Type;
33 import jxl.write.biff.File;
34 import jxl.biff.drawing.MsoDrawingRecord;
35 import jxl.biff.drawing.ObjRecord;
36
37 /**
38  * Interface for the various object types that can be added to a drawing
39  * group
40  */

41 public interface DrawingGroupObject
42 {
43   /**
44    * Sets the object id. Invoked by the drawing group when the object is
45    * added to id
46    *
47    * @param objid the object id
48    * @param bip the blip id
49    * @param sid the shape id
50    */

51   void setObjectId(int objid, int bip, int sid);
52
53   /**
54    * Accessor for the object id
55    *
56    * @return the object id
57    */

58   int getObjectId();
59
60   /**
61    * Accessor for the blip id
62    *
63    * @return the blip id
64    */

65   int getBlipId();
66
67   /**
68    * Accessor for the shape id
69    *
70    * @return the shape id
71    */

72   public int getShapeId();
73
74
75   /**
76    * Gets the drawing record which was read in
77    *
78    * @return the drawing record
79    */

80   MsoDrawingRecord getMsoDrawingRecord();
81   
82   /**
83    * Creates the main Sp container for the drawing
84    *
85    * @return the SP container
86    */

87   public EscherContainer getSpContainer();
88
89   /**
90    * Sets the drawing group for this drawing. Called by the drawing group
91    * when this drawing is added to it
92    *
93    * @param dg the drawing group
94    */

95   void setDrawingGroup(DrawingGroup dg);
96
97   /**
98    * Accessor for the drawing group
99    *
100    * @return the drawing group
101    */

102   DrawingGroup getDrawingGroup();
103
104   /**
105    * Gets the origin of this drawing
106    *
107    * @return where this drawing came from
108    */

109   Origin getOrigin();
110   
111   /**
112    * Accessor for the reference count on this drawing
113    *
114    * @return the reference count
115    */

116   int getReferenceCount();
117
118   /**
119    * Sets the new reference count on the drawing
120    *
121    * @param r the new reference count
122    */

123   void setReferenceCount(int r);
124
125   /**
126    * Accessor for the column of this drawing
127    *
128    * @return the column
129    */

130   public double getX();
131
132   /**
133    * Sets the column position of this drawing
134    *
135    * @param x the column
136    */

137   public void setX(double x);
138
139   /**
140    * Accessor for the row of this drawing
141    *
142    * @return the row
143    */

144   public double getY();
145
146   /**
147    * Accessor for the row of the drawing
148    *
149    * @param y the row
150    */

151   public void setY(double y);
152
153   /**
154    * Accessor for the width of this drawing
155    *
156    * @return the number of columns spanned by this image
157    */

158   public double getWidth();
159
160   /**
161    * Accessor for the width
162    *
163    * @param w the number of columns to span
164    */

165   public void setWidth(double w);
166
167   /**
168    * Accessor for the height of this drawing
169    *
170    * @return the number of rows spanned by this image
171    */

172   public double getHeight();
173
174   /**
175    * Accessor for the height of this drawing
176    *
177    * @param h the number of rows spanned by this image
178    */

179   public void setHeight(double h);
180
181
182   /**
183    * Accessor for the type
184    *
185    * @return the type
186    */

187   ShapeType getType();
188
189   /**
190    * Accessor for the image data
191    *
192    * @return the image data
193    */

194   public byte[] getImageData();
195
196   /**
197    * Accessor for the image data
198    *
199    * @return the image data
200    */

201   public byte[] getImageBytes() throws IOException JavaDoc;
202
203   /**
204    * Accessor for the image file path. Normally this is the absolute path
205    * of a file on the directory system, but if this drawing was constructed
206    * using an byte[] then the blip id is returned
207    *
208    * @return the image file path, or the blip id
209    */

210   String JavaDoc getImageFilePath();
211
212   /**
213    * Writes any other records associated with this drawing group object
214    */

215   public void writeAdditionalRecords(File outputFile) throws IOException JavaDoc;
216
217   /**
218    * Writes any records that need to be written after all the drawing group
219    * objects have been written
220    */

221   public void writeTailRecords(File outputFile) throws IOException JavaDoc;
222
223   /**
224    * Accessor for the first drawing on the sheet. This is used when
225    * copying unmodified sheets to indicate that this drawing contains
226    * the first time Escher gubbins
227    *
228    * @return TRUE if this MSORecord is the first drawing on the sheet
229    */

230   public boolean isFirst();
231
232   /**
233    * Queries whether this object is a form object. Form objects have their
234    * drawings records spread over TXO and CONTINUE records and
235    * require special handling
236    *
237    * @return TRUE if this is a form object, FALSE otherwise
238    */

239   public boolean isFormObject();
240 }
241
242
243
244
Popular Tags