KickJava   Java API By Example, From Geeks To Geeks.

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


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.read.biff;
21
22 import java.util.ArrayList JavaDoc;
23 import java.util.Iterator JavaDoc;
24
25 import jxl.Sheet;
26 import jxl.Cell;
27 import jxl.CellType;
28 import jxl.LabelCell;
29 import jxl.Hyperlink;
30 import jxl.Range;
31 import jxl.SheetSettings;
32 import jxl.WorkbookSettings;
33 import jxl.CellView;
34 import jxl.Image;
35 import jxl.biff.Type;
36 import jxl.biff.FormattingRecords;
37 import jxl.biff.EmptyCell;
38 import jxl.biff.WorkspaceInformationRecord;
39 import jxl.biff.drawing.Chart;
40 import jxl.biff.drawing.DrawingGroupObject;
41 import jxl.biff.drawing.Drawing;
42 import jxl.format.CellFormat;
43
44 /**
45  * Represents a sheet within a workbook. Provides a handle to the individual
46  * cells, or lines of cells (grouped by Row or Column)
47  * In order to simplify this class due to code bloat, the actual reading
48  * logic has been delegated to the SheetReaderClass. This class' main
49  * responsibility is now to implement the API methods declared in the
50  * Sheet interface
51  */

52 public class SheetImpl implements Sheet
53 {
54   /**
55    * The excel file
56    */

57   private File excelFile;
58   /**
59    * A handle to the shared string table
60    */

61   private SSTRecord sharedStrings;
62
63   /**
64    * A handle to the sheet BOF record, which indicates the stream type
65    */

66   private BOFRecord sheetBof;
67
68   /**
69    * A handle to the workbook BOF record, which indicates the stream type
70    */

71   private BOFRecord workbookBof;
72
73   /**
74    * A handle to the formatting records
75    */

76   private FormattingRecords formattingRecords;
77
78   /**
79    * The name of this sheet
80    */

81   private String JavaDoc name;
82
83   /**
84    * The number of rows
85    */

86   private int numRows;
87
88   /**
89    * The number of columns
90    */

91   private int numCols;
92
93   /**
94    * The cells
95    */

96   private Cell[][] cells;
97
98   /**
99    * The start position in the stream of this sheet
100    */

101   private int startPosition;
102
103   /**
104    * The list of specified (ie. non default) column widths
105    */

106   private ColumnInfoRecord[] columnInfos;
107
108   /**
109    * The array of row records
110    */

111   private RowRecord[] rowRecords;
112
113   /**
114    * The list of non-default row properties
115    */

116   private ArrayList JavaDoc rowProperties;
117
118   /**
119    * An array of column info records. They are held this way before
120    * they are transferred to the more convenient array
121    */

122   private ArrayList JavaDoc columnInfosArray;
123
124   /**
125    * A list of shared formula groups
126    */

127   private ArrayList JavaDoc sharedFormulas;
128
129   /**
130    * A list of hyperlinks on this page
131    */

132   private ArrayList JavaDoc hyperlinks;
133
134   /**
135    * A list of charts on this page
136    */

137   private ArrayList JavaDoc charts;
138
139   /**
140    * A list of drawings on this page
141    */

142   private ArrayList JavaDoc drawings;
143
144   /**
145    * A list of drawings (as opposed to comments/validation/charts) on this
146    * page
147    */

148   private ArrayList JavaDoc images;
149
150   /**
151    * A list of data validations on this page
152    */

153   private DataValidation dataValidation;
154
155   /**
156    * A list of merged cells on this page
157    */

158   private Range[] mergedCells;
159
160   /**
161    * Indicates whether the columnInfos array has been initialized
162    */

163   private boolean columnInfosInitialized;
164
165   /**
166    * Indicates whether the rowRecords array has been initialized
167    */

168   private boolean rowRecordsInitialized;
169
170   /**
171    * Indicates whether or not the dates are based around the 1904 date system
172    */

173   private boolean nineteenFour;
174
175   /**
176    * The workspace options
177    */

178   private WorkspaceInformationRecord workspaceOptions;
179
180   /**
181    * The hidden flag
182    */

183   private boolean hidden;
184
185   /**
186    * The environment specific print record
187    */

188   private PLSRecord plsRecord;
189
190   /**
191    * The property set record associated with this workbook
192    */

193   private ButtonPropertySetRecord buttonPropertySet;
194
195   /**
196    * The sheet settings
197    */

198   private SheetSettings settings;
199
200   /**
201    * The horizontal page breaks contained on this sheet
202    */

203   private int[] rowBreaks;
204
205   /**
206    * A handle to the workbook which contains this sheet. Some of the records
207    * need this in order to reference external sheets
208    */

209   private WorkbookParser workbook;
210
211   /**
212    * A handle to the workbook settings
213    */

214   private WorkbookSettings workbookSettings;
215
216   /**
217    * Constructor
218    *
219    * @param f the excel file
220    * @param sst the shared string table
221    * @param fr formatting records
222    * @param sb the bof record which indicates the start of the sheet
223    * @param wb the bof record which indicates the start of the sheet
224    * @param nf the 1904 flag
225    * @param wp the workbook which this sheet belongs to
226    * @exception BiffException
227    */

228   SheetImpl(File f,
229             SSTRecord sst,
230             FormattingRecords fr,
231             BOFRecord sb,
232             BOFRecord wb,
233             boolean nf,
234             WorkbookParser wp)
235     throws BiffException
236   {
237     excelFile = f;
238     sharedStrings = sst;
239     formattingRecords = fr;
240     sheetBof = sb;
241     workbookBof = wb;
242     columnInfosArray = new ArrayList JavaDoc();
243     sharedFormulas = new ArrayList JavaDoc();
244     hyperlinks = new ArrayList JavaDoc();
245     rowProperties = new ArrayList JavaDoc(10);
246     columnInfosInitialized = false;
247     rowRecordsInitialized = false;
248     nineteenFour = nf;
249     workbook = wp;
250     workbookSettings = workbook.getSettings();
251
252     // Mark the position in the stream, and then skip on until the end
253
startPosition = f.getPos();
254
255     if (sheetBof.isChart())
256     {
257       // Set the start pos to include the bof so the sheet reader can handle it
258
startPosition -= (sheetBof.getLength() + 4);
259     }
260
261     Record r = null;
262     int bofs = 1;
263
264     while (bofs >= 1)
265     {
266       r = f.next();
267
268       // use this form for quick performance
269
if (r.getCode() == Type.EOF.value)
270       {
271         bofs--;
272       }
273
274       if (r.getCode() == Type.BOF.value)
275       {
276         bofs++;
277       }
278     }
279   }
280
281   /**
282    * Returns the cell specified at this row and at this column
283    *
284    * @param row the row number
285    * @param column the column number
286    * @return the cell at the specified co-ordinates
287    */

288   public Cell getCell(int column, int row)
289   {
290     // just in case this has been cleared, but something else holds
291
// a reference to it
292
if (cells == null)
293     {
294       readSheet();
295     }
296
297     Cell c = cells[row][column];
298
299     if (c == null)
300     {
301       c = new EmptyCell(column, row);
302       cells[row][column] = c;
303     }
304
305     return c;
306   }
307
308   /**
309    * Gets the cell whose contents match the string passed in.
310    * If no match is found, then null is returned. The search is performed
311    * on a row by row basis, so the lower the row number, the more
312    * efficiently the algorithm will perform
313    *
314    * @param contents the string to match
315    * @return the Cell whose contents match the paramter, null if not found
316    */

317   public Cell findCell(String JavaDoc contents)
318   {
319     Cell cell = null;
320     boolean found = false;
321
322     for (int i = 0; i < getRows() && !found; i++)
323     {
324       Cell[] row = getRow(i);
325       for (int j = 0; j < row.length && !found; j++)
326       {
327         if (row[j].getContents().equals(contents))
328         {
329           cell = row[j];
330           found = true;
331         }
332       }
333     }
334
335     return cell;
336   }
337
338   /**
339    * Gets the cell whose contents match the string passed in.
340    * If no match is found, then null is returned. The search is performed
341    * on a row by row basis, so the lower the row number, the more
342    * efficiently the algorithm will perform. This method differs
343    * from the findCell methods in that only cells with labels are
344    * queried - all numerical cells are ignored. This should therefore
345    * improve performance.
346    *
347    * @param contents the string to match
348    * @return the Cell whose contents match the paramter, null if not found
349    */

350   public LabelCell findLabelCell(String JavaDoc contents)
351   {
352     LabelCell cell = null;
353     boolean found = false;
354
355     for (int i = 0; i < getRows() && !found; i++)
356     {
357       Cell[] row = getRow(i);
358       for (int j = 0; j < row.length && !found; j++)
359       {
360         if ((row[j].getType() == CellType.LABEL ||
361              row[j].getType() == CellType.STRING_FORMULA) &&
362             row[j].getContents().equals(contents))
363         {
364           cell = (LabelCell) row[j];
365           found = true;
366         }
367       }
368     }
369
370     return cell;
371   }
372
373   /**
374    * Returns the number of rows in this sheet
375    *
376    * @return the number of rows in this sheet
377    */

378   public int getRows()
379   {
380     // just in case this has been cleared, but something else holds
381
// a reference to it
382
if (cells == null)
383     {
384       readSheet();
385     }
386
387     return numRows;
388   }
389
390   /**
391    * Returns the number of columns in this sheet
392    *
393    * @return the number of columns in this sheet
394    */

395   public int getColumns()
396   {
397     // just in case this has been cleared, but something else holds
398
// a reference to it
399
if (cells == null)
400     {
401       readSheet();
402     }
403
404     return numCols;
405   }
406
407   /**
408    * Gets all the cells on the specified row. The returned array will
409    * be stripped of all trailing empty cells
410    *
411    * @param row the rows whose cells are to be returned
412    * @return the cells on the given row
413    */

414   public Cell[] getRow(int row)
415   {
416     // just in case this has been cleared, but something else holds
417
// a reference to it
418
if (cells == null)
419     {
420       readSheet();
421     }
422
423     // Find the last non-null cell
424
boolean found = false;
425     int col = numCols - 1;
426     while (col >= 0 && !found)
427     {
428       if (cells[row][col] != null)
429       {
430         found = true;
431       }
432       else
433       {
434         col--;
435       }
436     }
437
438     // Only create entries for non-null cells
439
Cell[] c = new Cell[col + 1];
440
441     for (int i = 0; i <= col; i++)
442     {
443       c[i] = getCell(i, row);
444     }
445     return c;
446   }
447
448   /**
449    * Gets all the cells on the specified column. The returned array
450    * will be stripped of all trailing empty cells
451    *
452    * @param col the column whose cells are to be returned
453    * @return the cells on the specified column
454    */

455   public Cell[] getColumn(int col)
456   {
457     // just in case this has been cleared, but something else holds
458
// a reference to it
459
if (cells == null)
460     {
461       readSheet();
462     }
463
464     // Find the last non-null cell
465
boolean found = false;
466     int row = numRows - 1;
467     while (row >= 0 && !found)
468     {
469       if (cells[row][col] != null)
470       {
471         found = true;
472       }
473       else
474       {
475         row--;
476       }
477     }
478
479     // Only create entries for non-null cells
480
Cell[] c = new Cell[row + 1];
481
482     for (int i = 0; i <= row; i++)
483     {
484       c[i] = getCell(col, i);
485     }
486     return c;
487   }
488
489   /**
490    * Gets the name of this sheet
491    *
492    * @return the name of the sheet
493    */

494   public String JavaDoc getName()
495   {
496     return name;
497   }
498
499   /**
500    * Sets the name of this sheet
501    *
502    * @param s the sheet name
503    */

504   final void setName(String JavaDoc s)
505   {
506     name = s;
507   }
508
509   /**
510    * Determines whether the sheet is hidden
511    *
512    * @return whether or not the sheet is hidden
513    * @deprecated in favour of the getSettings function
514    */

515   public boolean isHidden()
516   {
517     return hidden;
518   }
519
520   /**
521    * Gets the column info record for the specified column. If no
522    * column is specified, null is returned
523    *
524    * @param col the column
525    * @return the ColumnInfoRecord if specified, NULL otherwise
526    */

527   public ColumnInfoRecord getColumnInfo(int col)
528   {
529     if (!columnInfosInitialized)
530     {
531       // Initialize the array
532
Iterator JavaDoc i = columnInfosArray.iterator();
533       ColumnInfoRecord cir = null;
534       while (i.hasNext())
535       {
536         cir = (ColumnInfoRecord) i.next();
537
538         int startcol = Math.max(0, cir.getStartColumn());
539         int endcol = Math.min(columnInfos.length - 1, cir.getEndColumn());
540
541         for (int c = startcol; c <= endcol; c++)
542         {
543           columnInfos[c] = cir;
544         }
545
546         if (endcol < startcol)
547         {
548           columnInfos[startcol] = cir;
549         }
550       }
551
552       columnInfosInitialized = true;
553     }
554
555     return col < columnInfos.length ? columnInfos[col] : null;
556   }
557
558   /**
559    * Gets all the column info records
560    *
561    * @return the ColumnInfoRecordArray
562    */

563   public ColumnInfoRecord[] getColumnInfos()
564   {
565     // Just chuck all the column infos we have into an array
566
ColumnInfoRecord[] infos = new ColumnInfoRecord[columnInfosArray.size()];
567     for (int i = 0; i < columnInfosArray.size(); i++)
568     {
569       infos[i] = (ColumnInfoRecord) columnInfosArray.get(i);
570     }
571
572     return infos;
573   }
574
575   /**
576    * Sets the visibility of this sheet
577    *
578    * @param h hidden flag
579    */

580   final void setHidden(boolean h)
581   {
582     hidden = h;
583   }
584
585   /**
586    * Clears out the array of cells. This is done for memory allocation
587    * reasons when reading very large sheets
588    */

589   final void clear()
590   {
591     cells = null;
592     mergedCells = null;
593     columnInfosArray.clear();
594     sharedFormulas.clear();
595     hyperlinks.clear();
596     columnInfosInitialized = false;
597
598     if (!workbookSettings.getGCDisabled())
599     {
600       System.gc();
601     }
602   }
603
604   /**
605    * Reads in the contents of this sheet
606    */

607   final void readSheet()
608   {
609     // If this sheet contains only a chart, then set everything to
610
// empty and do not bother parsing the sheet
611
// Thanks to steve.brophy for spotting this
612
if (!sheetBof.isWorksheet())
613     {
614       numRows = 0;
615       numCols = 0;
616       cells = new Cell[0][0];
617       // return;
618
}
619
620     SheetReader reader = new SheetReader(excelFile,
621                                          sharedStrings,
622                                          formattingRecords,
623                                          sheetBof,
624                                          workbookBof,
625                                          nineteenFour,
626                                          workbook,
627                                          startPosition,
628                                          this);
629     reader.read();
630
631     // Take stuff that was read in
632
numRows = reader.getNumRows();
633     numCols = reader.getNumCols();
634     cells = reader.getCells();
635     rowProperties = reader.getRowProperties();
636     columnInfosArray = reader.getColumnInfosArray();
637     hyperlinks = reader.getHyperlinks();
638     charts = reader.getCharts();
639     drawings = reader.getDrawings();
640     dataValidation = reader.getDataValidation();
641     mergedCells = reader.getMergedCells();
642     settings = reader.getSettings();
643     settings.setHidden(hidden);
644     rowBreaks = reader.getRowBreaks();
645     workspaceOptions = reader.getWorkspaceOptions();
646     plsRecord = reader.getPLS();
647     buttonPropertySet = reader.getButtonPropertySet();
648
649     reader = null;
650
651     if (!workbookSettings.getGCDisabled())
652     {
653       System.gc();
654     }
655
656     if (columnInfosArray.size() > 0)
657     {
658       ColumnInfoRecord cir = (ColumnInfoRecord)
659         columnInfosArray.get(columnInfosArray.size() - 1);
660       columnInfos = new ColumnInfoRecord[cir.getEndColumn() + 1];
661     }
662     else
663     {
664       columnInfos = new ColumnInfoRecord[0];
665     }
666   }
667
668   /**
669    * Gets the hyperlinks on this sheet
670    *
671    * @return an array of hyperlinks
672    */

673   public Hyperlink[] getHyperlinks()
674   {
675     Hyperlink[] hl = new Hyperlink[hyperlinks.size()];
676
677     for (int i = 0; i < hyperlinks.size(); i++)
678     {
679       hl[i] = (Hyperlink) hyperlinks.get(i);
680     }
681
682     return hl;
683   }
684
685   /**
686    * Gets the cells which have been merged on this sheet
687    *
688    * @return an array of range objects
689    */

690   public Range[] getMergedCells()
691   {
692     if (mergedCells == null)
693     {
694       return new Range[0];
695     }
696
697     return mergedCells;
698   }
699
700   /**
701    * Gets the non-default rows. Used when copying spreadsheets
702    *
703    * @return an array of row properties
704    */

705   public RowRecord[] getRowProperties()
706   {
707     RowRecord[] rp = new RowRecord[rowProperties.size()];
708     for (int i = 0; i < rp.length; i++)
709     {
710       rp[i] = (RowRecord) rowProperties.get(i);
711     }
712
713     return rp;
714   }
715
716   /**
717    * Gets the data validations. Used when copying sheets
718    *
719    * @return the data validations
720    */

721   public DataValidation getDataValidation()
722   {
723     return dataValidation;
724   }
725
726   /**
727    * Gets the row record. Usually called by the cell in the specified
728    * row in order to determine its size
729    *
730    * @param r the row
731    * @return the RowRecord for the specified row
732    */

733   RowRecord getRowInfo(int r)
734   {
735     if (!rowRecordsInitialized)
736     {
737       rowRecords = new RowRecord[getRows()];
738       Iterator JavaDoc i = rowProperties.iterator();
739
740       int rownum = 0;
741       RowRecord rr = null;
742       while (i.hasNext())
743       {
744         rr = (RowRecord) i.next();
745         rownum = rr.getRowNumber();
746         if (rownum < rowRecords.length)
747         {
748           rowRecords[rownum] = rr;
749         }
750       }
751
752       rowRecordsInitialized = true;
753     }
754
755     return rowRecords[r];
756   }
757
758   /**
759    * Gets the row breaks. Called when copying sheets
760    *
761    * @return the explicit row breaks
762    */

763   public final int[] getRowPageBreaks()
764   {
765     return rowBreaks;
766   }
767
768   /**
769    * Gets the charts. Called when copying sheets
770    *
771    * @return the charts on this page
772    */

773   public final Chart[] getCharts()
774   {
775     Chart[] ch = new Chart[charts.size()];
776
777     for (int i = 0; i < ch.length; i++)
778     {
779       ch[i] = (Chart) charts.get(i);
780     }
781     return ch;
782   }
783
784   /**
785    * Gets the drawings. Called when copying sheets
786    *
787    * @return the drawings on this page
788    */

789   public final DrawingGroupObject[] getDrawings()
790   {
791     DrawingGroupObject[] dr = new DrawingGroupObject[drawings.size()];
792     dr = (DrawingGroupObject[]) drawings.toArray(dr);
793     return dr;
794   }
795
796   /**
797    * Determines whether the sheet is protected
798    *
799    * @return whether or not the sheet is protected
800    * @deprecated in favour of the getSettings() api
801    */

802   public boolean isProtected()
803   {
804     return settings.isProtected();
805   }
806
807   /**
808    * Gets the workspace options for this sheet. Called during the copy
809    * process
810    *
811    * @return the workspace options
812    */

813   public WorkspaceInformationRecord getWorkspaceOptions()
814   {
815     return workspaceOptions;
816   }
817
818   /**
819    * Accessor for the sheet settings
820    *
821    * @return the settings for this sheet
822    */

823   public SheetSettings getSettings()
824   {
825     return settings;
826   }
827
828   /**
829    * Accessor for the workbook
830    * @return the workbook
831    */

832   WorkbookParser getWorkbook()
833   {
834     return workbook;
835   }
836
837   /**
838    * Gets the column format for the specified column
839    *
840    * @param col the column number
841    * @return the column format, or NULL if the column has no specific format
842    * @deprecated use getColumnView instead
843    */

844   public CellFormat getColumnFormat(int col)
845   {
846     CellView cv = getColumnView(col);
847     return cv.getFormat();
848   }
849
850   /**
851    * Gets the column width for the specified column
852    *
853    * @param col the column number
854    * @return the column width, or the default width if the column has no
855    * specified format
856    */

857   public int getColumnWidth(int col)
858   {
859     return getColumnView(col).getSize() / 256;
860   }
861
862   /**
863    * Gets the column width for the specified column
864    *
865    * @param col the column number
866    * @return the column format, or the default format if no override is
867              specified
868    */

869   public CellView getColumnView(int col)
870   {
871     ColumnInfoRecord cir = getColumnInfo(col);
872     CellView cv = new CellView();
873
874     if (cir != null)
875     {
876       cv.setDimension(cir.getWidth() / 256); //deprecated
877
cv.setSize(cir.getWidth());
878       cv.setHidden(cir.getHidden());
879       cv.setFormat(formattingRecords.getXFRecord(cir.getXFIndex()));
880     }
881     else
882     {
883       cv.setDimension(settings.getDefaultColumnWidth() / 256); //deprecated
884
cv.setSize(settings.getDefaultColumnWidth());
885     }
886
887     return cv;
888   }
889
890   /**
891    * Gets the row height for the specified column
892    *
893    * @param row the row number
894    * @return the row height, or the default height if the row has no
895    * specified format
896    * @deprecated use getRowView instead
897    */

898   public int getRowHeight(int row)
899   {
900     return getRowView(row).getDimension();
901   }
902
903   /**
904    * Gets the row view for the specified row
905    *
906    * @param row the row number
907    * @return the row format, or the default format if no override is
908              specified
909    */

910   public CellView getRowView(int row)
911   {
912     RowRecord rr = getRowInfo(row);
913
914     CellView cv = new CellView();
915
916     if (rr != null)
917     {
918       cv.setDimension(rr.getRowHeight()); //deprecated
919
cv.setSize(rr.getRowHeight());
920       cv.setHidden(rr.isCollapsed());
921     }
922     else
923     {
924       cv.setDimension(settings.getDefaultRowHeight());
925       cv.setSize(settings.getDefaultRowHeight()); //deprecated
926
}
927
928     return cv;
929   }
930
931
932   /**
933    * Used when copying sheets in order to determine the type of this sheet
934    *
935    * @return the BOF Record
936    */

937   public BOFRecord getSheetBof()
938   {
939     return sheetBof;
940   }
941
942   /**
943    * Used when copying sheets in order to determine the type of the containing
944    * workboook
945    *
946    * @return the workbook BOF Record
947    */

948   public BOFRecord getWorkbookBof()
949   {
950     return workbookBof;
951   }
952
953   /**
954    * Accessor for the environment specific print record, invoked when
955    * copying sheets
956    *
957    * @return the environment specific print record
958    */

959   public PLSRecord getPLS()
960   {
961     return plsRecord;
962   }
963
964   /**
965    * Accessor for the button property set, used during copying
966    *
967    * @return the button property set
968    */

969   public ButtonPropertySetRecord getButtonPropertySet()
970   {
971     return buttonPropertySet;
972   }
973
974   /**
975    * Accessor for the number of images on the sheet
976    *
977    * @return the number of images on this sheet
978    */

979   public int getNumberOfImages()
980   {
981     if (images == null)
982     {
983       initializeImages();
984     }
985
986     return images.size();
987   }
988
989   /**
990    * Accessor for the image
991    *
992    * @param i the 0 based image number
993    * @return the image at the specified position
994    */

995   public Image getDrawing(int i)
996   {
997     if (images == null)
998     {
999       initializeImages();
1000    }
1001
1002    return (Image) images.get(i);
1003  }
1004
1005  /**
1006   * Initializes the images
1007   */

1008  private void initializeImages()
1009  {
1010    if (images != null)
1011    {
1012      return;
1013    }
1014
1015    images = new ArrayList JavaDoc();
1016    DrawingGroupObject[] dgos = getDrawings();
1017
1018    for (int i = 0; i < dgos.length; i++)
1019    {
1020      if (dgos[i] instanceof Drawing)
1021      {
1022        images.add(dgos[i]);
1023      }
1024    }
1025  }
1026
1027}
1028
1029
1030
1031
1032
1033
1034
Popular Tags