]> source.dussan.org Git - poi.git/commitdiff
HSSF* classes implement same interfaces as XSSF* classes.
authorUgo Cei <ugo@apache.org>
Thu, 24 Jan 2008 10:10:55 +0000 (10:10 +0000)
committerUgo Cei <ugo@apache.org>
Thu, 24 Jan 2008 10:10:55 +0000 (10:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@614830 13f79535-47bb-0310-9956-ffa450edef68

17 files changed:
src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
src/java/org/apache/poi/hssf/usermodel/HSSFComment.java
src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
src/java/org/apache/poi/hssf/usermodel/HSSFFont.java
src/java/org/apache/poi/hssf/usermodel/HSSFFooter.java
src/java/org/apache/poi/hssf/usermodel/HSSFHeader.java
src/java/org/apache/poi/hssf/usermodel/HSSFName.java
src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java
src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
src/java/org/apache/poi/hssf/usermodel/HSSFPrintSetup.java
src/java/org/apache/poi/hssf/usermodel/HSSFRichTextString.java
src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java
src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
src/java/org/apache/poi/hssf/util/HSSFColor.java

index b3b4fc9297d273ec03423d139c31d9b9b773ce77..e076047c5efccd35afb1d0734188a39966ca40a4 100644 (file)
@@ -50,6 +50,10 @@ import org.apache.poi.hssf.record.TextObjectRecord;
 import org.apache.poi.hssf.record.UnicodeString;
 import org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate;
 import org.apache.poi.hssf.record.formula.Ptg;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.Comment;
+import org.apache.poi.ss.usermodel.RichTextString;
 
 /**
  * High level representation of a cell in a row of a spreadsheet.
@@ -70,7 +74,7 @@ import org.apache.poi.hssf.record.formula.Ptg;
  * @version 1.0-pre
  */
 
-public class HSSFCell
+public class HSSFCell implements Cell
 {
 
     /**
@@ -590,12 +594,13 @@ public class HSSFCell
      * If value is null then we will change the cell to a Blank cell.
      */
 
-    public void setCellValue(HSSFRichTextString value)
+    public void setCellValue(RichTextString value)
     {
+        HSSFRichTextString hvalue = (HSSFRichTextString) value;
         int row=record.getRow();
         short col=record.getColumn();
         short styleIndex=record.getXFIndex();
-        if (value == null)
+        if (hvalue == null)
         {
             setCellType(CELL_TYPE_BLANK, false, row, col, styleIndex);
         }
@@ -607,7 +612,7 @@ public class HSSFCell
             }
             int index = 0;
 
-            UnicodeString str = value.getUnicodeString();            
+            UnicodeString str = hvalue.getUnicodeString();            
 //          jmh            if (encoding == ENCODING_COMPRESSED_UNICODE)
 //          jmh            {
 //          jmh                str.setCompressedUnicode();
@@ -617,7 +622,7 @@ public class HSSFCell
 //          jmh            }
             index = book.addSSTString(str);            
             (( LabelSSTRecord ) record).setSSTIndex(index);
-            stringValue = value;
+            stringValue = hvalue;
             stringValue.setWorkbookReferences(book, (( LabelSSTRecord ) record));
             stringValue.setUnicodeString(book.getSSTString(index));            
         }
@@ -873,7 +878,7 @@ public class HSSFCell
      * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getCellStyleAt(short)
      */
 
-    public void setCellStyle(HSSFCellStyle style)
+    public void setCellStyle(CellStyle style)
     {
         record.setXFIndex(style.getIndex());
     }
@@ -1000,10 +1005,10 @@ public class HSSFCell
      *
      * @param comment comment associated with this cell
      */
-    public void setCellComment(HSSFComment comment){
+    public void setCellComment(Comment comment){
         comment.setRow((short)record.getRow());
         comment.setColumn(record.getColumn());
-        this.comment = comment;
+        this.comment = (HSSFComment) comment;
     }
 
     /**
index cdea9ee5be4f8d4564b5f7628e70953e9ec75a38..fa8489cbaba8190acb9193e4cb5575c99b81122d 100644 (file)
@@ -20,8 +20,9 @@ package org.apache.poi.hssf.usermodel;
 
 import org.apache.poi.hssf.model.Workbook;
 import org.apache.poi.hssf.record.ExtendedFormatRecord;
-import org.apache.poi.hssf.record.FormatRecord;
-import org.apache.poi.hssf.util.*;
+import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.Font;
 
 /**
  * High level representation of the style of a cell in a sheet of a workbook.
@@ -35,7 +36,7 @@ import org.apache.poi.hssf.util.*;
  * @see org.apache.poi.hssf.usermodel.HSSFCell#setCellStyle(HSSFCellStyle)
  */
 
-public class HSSFCellStyle
+public class HSSFCellStyle implements CellStyle
 {
     private ExtendedFormatRecord format                     = null;
     private short                index                      = 0;
@@ -287,7 +288,7 @@ public class HSSFCellStyle
      * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(short)
      */
 
-    public void setFont(HSSFFont font)
+    public void setFont(Font font)
     {
         format.setIndentNotParentFont(true);
         short fontindex = font.getIndex();
@@ -309,7 +310,7 @@ public class HSSFCellStyle
      * @see org.apache.poi.hssf.usermodel.HSSFCellStyle#getFontIndex()
      * @see org.apache.poi.hssf.usermodel.HSSFWorkbook#getFontAt(short)
      */
-    public HSSFFont getFont(HSSFWorkbook parentWorkbook) {
+    public Font getFont(org.apache.poi.ss.usermodel.Workbook parentWorkbook) {
        return parentWorkbook.getFontAt(getFontIndex());
     }
 
index 258f26e228dbe4769d51ef61bc76b62b685afdf3..08d209a2723df5fe20a7eed8561c1cabf9f9baf1 100644 (file)
 ==================================================================== */
 package org.apache.poi.hssf.usermodel;
 
-import org.apache.poi.hssf.record.EscherAggregate;
 import org.apache.poi.hssf.record.NoteRecord;
 import org.apache.poi.hssf.record.TextObjectRecord;
-import org.apache.poi.ddf.*;
-
-import java.util.Map;
-import java.util.List;
-import java.util.Iterator;
+import org.apache.poi.ss.usermodel.Comment;
+import org.apache.poi.ss.usermodel.RichTextString;
 
 /**
  * Represents a cell comment - a sticky note associated with a cell.
  *
  * @author Yegor Kozlov
  */
-public class HSSFComment extends HSSFTextbox {
+public class HSSFComment extends HSSFTextbox implements Comment {
 
     private boolean visible;
     private short col, row;
@@ -147,7 +143,7 @@ public class HSSFComment extends HSSFTextbox {
      *
      * @param string    Sets the rich text string used by this object.
      */
-    public void setString( HSSFRichTextString string )  {
+    public void setString( RichTextString string )  {
         //if font is not set we must set the default one
         if (string.numFormattingRuns() == 0) string.applyFont((short)0);
 
@@ -155,7 +151,7 @@ public class HSSFComment extends HSSFTextbox {
             int frLength = ( string.numFormattingRuns() + 1 ) * 8;
             txo.setFormattingRunLength( (short) frLength );
             txo.setTextLength( (short) string.length() );
-            txo.setStr( string );
+            txo.setStr( (HSSFRichTextString) string );
         }
         super.setString(string);
     }
index 64fbccb8b2e626a24b1fce0f0a230c674cfc53c9..547ec83038afd68b8151284222f3adc9f0816419 100644 (file)
  */
 package org.apache.poi.hssf.usermodel;
 
-import org.apache.poi.hssf.model.Workbook;
-import org.apache.poi.hssf.record.FormatRecord;
-
 import java.util.Iterator;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.Vector;
 
+import org.apache.poi.hssf.model.Workbook;
+import org.apache.poi.hssf.record.FormatRecord;
+import org.apache.poi.ss.usermodel.DataFormat;
+
 /**
  * Utility to identify builtin formats.  Now can handle user defined data formats also.  The following is a list of the formats as
  * returned by this class.<P>
@@ -79,7 +80,7 @@ import java.util.Vector;
  * @author  Shawn M. Laubach (slaubach at apache dot org)
  */
 
-public class HSSFDataFormat
+public class HSSFDataFormat implements DataFormat
 {
     private static List builtinFormats = createBuiltinFormats();
 
index cfaa5e4f4827855dc5476c9d031460565834d808..282704357539146df7318d547fbcef644417e0f5 100644 (file)
@@ -24,6 +24,7 @@
 package org.apache.poi.hssf.usermodel;
 
 import org.apache.poi.hssf.record.FontRecord;
+import org.apache.poi.ss.usermodel.Font;
 
 /**
  * Represents a Font used in a workbook.
@@ -35,7 +36,7 @@ import org.apache.poi.hssf.record.FontRecord;
  * @see org.apache.poi.hssf.usermodel.HSSFCellStyle#setFont(HSSFFont)
  */
 
-public class HSSFFont
+public class HSSFFont implements Font
 {
 
     /**
index a72010378ffbaa69d81f58b8c3736877aaacf6cf..4e62e8b4743109e01cf29d70e3883f65bffe76f9 100644 (file)
@@ -19,6 +19,7 @@
 package org.apache.poi.hssf.usermodel;
 
 import org.apache.poi.hssf.record.FooterRecord;
+import org.apache.poi.ss.usermodel.Footer;
 
 /**
  * Class to read and manipulate the footer.
@@ -32,7 +33,7 @@ import org.apache.poi.hssf.record.FooterRecord;
  * <P>
  * @author Shawn Laubach (slaubach at apache dot org)
  */
-public class HSSFFooter extends Object {
+public class HSSFFooter implements Footer {
 
     FooterRecord footerRecord;
     String left;
index 614caf9b447ba7900a07eaf5143185440c3a2e2e..e1cd0b009128dee89f593d885083e7776a8ba04e 100644 (file)
@@ -18,6 +18,7 @@
 package org.apache.poi.hssf.usermodel;
 
 import org.apache.poi.hssf.record.HeaderRecord;
+import org.apache.poi.ss.usermodel.Header;
 
 /**
  * Class to read and manipulate the header.
@@ -32,7 +33,7 @@ import org.apache.poi.hssf.record.HeaderRecord;
  *
  * @author Shawn Laubach (slaubach at apache dot org)
  */
-public class HSSFHeader
+public class HSSFHeader implements Header
 {
 
     HeaderRecord headerRecord;
index 73da4fe9c4759933149ac90a8f5a695b722ec2e1..501373e35f38d18b834861f7490cbd1264db6696 100644 (file)
@@ -18,9 +18,9 @@
 package org.apache.poi.hssf.usermodel;
 
 import org.apache.poi.hssf.model.Workbook;
-import org.apache.poi.hssf.record.BoundSheetRecord;
 import org.apache.poi.hssf.record.NameRecord;
 import org.apache.poi.hssf.util.RangeAddress;
+import org.apache.poi.ss.usermodel.Name;
 
 /**
  * Title:        High Level Represantion of Named Range <P>
@@ -28,7 +28,7 @@ import org.apache.poi.hssf.util.RangeAddress;
  * @author Libin Roman (Vista Portal LDT. Developer)
  */
 
-public class HSSFName {
+public class HSSFName implements Name {
     private Workbook         book;
     private NameRecord       name;
     
index 7fc552595047ab8f069ca937d8c9febc28bb51f8..42773d4a33255876faf9148fed32bc6563abf04e 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.poi.hssf.usermodel;
 
 import org.apache.poi.hssf.record.PaletteRecord;
 import org.apache.poi.hssf.util.HSSFColor;
+import org.apache.poi.ss.usermodel.Palette;
 
 /**
  * Represents a workbook color palette.
@@ -28,7 +29,7 @@ import org.apache.poi.hssf.util.HSSFColor;
  *
  * @author Brian Sanders (bsanders at risklabs dot com)
  */
-public class HSSFPalette
+public class HSSFPalette implements Palette
 {
     private PaletteRecord palette;
     
index 583e1b47930ac1d9eda59be1ec9589606505de42..9e69fa255d89ffbd04a3c00892ef506e4befae5c 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.poi.ddf.EscherComplexProperty;
 import org.apache.poi.ddf.EscherOptRecord;
 import org.apache.poi.ddf.EscherProperty;
 import org.apache.poi.hssf.record.EscherAggregate;
-import org.apache.poi.util.LittleEndian;
+import org.apache.poi.ss.usermodel.Patriarch;
 import org.apache.poi.util.StringUtil;
 
 /**
@@ -35,7 +35,7 @@ import org.apache.poi.util.StringUtil;
  * @author Glen Stampoultzis (glens at apache.org)
  */
 public class HSSFPatriarch
-        implements HSSFShapeContainer
+        implements HSSFShapeContainer, Patriarch
 {
     List shapes = new ArrayList();
     HSSFSheet sheet;
index 713f44b3d96382c1b703f0ca0a71b38eda2b8df2..36956165438ed2c705bb9e399cc9520662b916e9 100644 (file)
@@ -19,6 +19,7 @@
 package org.apache.poi.hssf.usermodel;
 
 import org.apache.poi.hssf.record.PrintSetupRecord;
+import org.apache.poi.ss.usermodel.PrintSetup;
 
 /**
  * Used to modify the print setup.
@@ -36,16 +37,7 @@ import org.apache.poi.hssf.record.PrintSetupRecord;
  *  public static final short ENVELOPE_MONARCH_PAPERSIZE  = 37;<br>
  * <P>
  * @author Shawn Laubach (slaubach at apache dot org) */
-public class HSSFPrintSetup extends Object {    
-    public static final short LETTER_PAPERSIZE                   = 1;
-    public static final short LEGAL_PAPERSIZE            = 5;
-    public static final short EXECUTIVE_PAPERSIZE        = 7;
-    public static final short A4_PAPERSIZE               = 9;
-    public static final short A5_PAPERSIZE               = 11;
-    public static final short ENVELOPE_10_PAPERSIZE      = 20;
-    public static final short ENVELOPE_DL_PAPERSIZE      = 27;
-    public static final short ENVELOPE_CS_PAPERSIZE      = 28;
-    public static final short ENVELOPE_MONARCH_PAPERSIZE  = 37;
+public class HSSFPrintSetup implements PrintSetup {    
     PrintSetupRecord printSetupRecord;
     
     /**    
index 93db9214a60d0b547af4449543f293ae9718a7a0..bd9a4cd7929fa42a2f3275ea2899b8636d1e589f 100644 (file)
 
 package org.apache.poi.hssf.usermodel;
 
+import java.util.Iterator;
+
 import org.apache.poi.hssf.model.Workbook;
 import org.apache.poi.hssf.record.LabelSSTRecord;
 import org.apache.poi.hssf.record.UnicodeString;
-
-import java.util.Iterator;
+import org.apache.poi.ss.usermodel.Font;
+import org.apache.poi.ss.usermodel.RichTextString;
 /**
  * Rich text unicode string.  These strings can have fonts applied to
  * arbitary parts of the string.
@@ -30,7 +32,7 @@ import java.util.Iterator;
  * @author Jason Height (jheight at apache.org)
  */
 public class HSSFRichTextString
-        implements Comparable
+        implements Comparable, RichTextString
 {
     /** Place holder for indicating that NO_FONT has been applied here */
     public static final short NO_FONT = 0;
@@ -136,7 +138,7 @@ public class HSSFRichTextString
      * @param endIndex      The end index to apply to font to (exclusive)
      * @param font          The index of the font to use.
      */
-    public void applyFont(int startIndex, int endIndex, HSSFFont font)
+    public void applyFont(int startIndex, int endIndex, Font font)
     {
         applyFont(startIndex, endIndex, font.getIndex());
     }
@@ -145,7 +147,7 @@ public class HSSFRichTextString
      * Sets the font of the entire string.
      * @param font          The font to use.
      */
-    public void applyFont(HSSFFont font)
+    public void applyFont(Font font)
     {
         applyFont(0, string.getCharCount(), font);
     }
index ae5727bc6827f69ebad7c867d427dc99816e2d6e..ce2bc605fb804df3a0b9830b69c52b57a19f51fe 100644 (file)
@@ -29,6 +29,8 @@ import org.apache.poi.hssf.model.Sheet;
 import org.apache.poi.hssf.model.Workbook;
 import org.apache.poi.hssf.record.CellValueRecordInterface;
 import org.apache.poi.hssf.record.RowRecord;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
 
 /**
  * High level representation of a row of a spreadsheet.
@@ -40,7 +42,7 @@ import org.apache.poi.hssf.record.RowRecord;
  */
 
 public class HSSFRow
-        implements Comparable
+        implements Comparable, Row
 {
 
     // used for collections
@@ -156,26 +158,29 @@ public class HSSFRow
      * remove the HSSFCell from this row.
      * @param cell to remove
      */
-    public void removeCell(HSSFCell cell) {
+    public void removeCell(Cell cell) {
        removeCell(cell, true);
     }
-    private void removeCell(HSSFCell cell, boolean alsoRemoveRecords) {
+    
+    private void removeCell(Cell cell, boolean alsoRemoveRecords) {
+        
+        HSSFCell hcell = (HSSFCell) cell;
        if(alsoRemoveRecords) {
-               CellValueRecordInterface cval = cell.getCellValueRecord();
+               CellValueRecordInterface cval = hcell.getCellValueRecord();
                sheet.removeValueRecord(getRowNum(), cval);
        }
        
-        short column=cell.getCellNum();
-        if(cell!=null && column<cells.length)
+        short column=hcell.getCellNum();
+        if(hcell!=null && column<cells.length)
         {
           cells[column]=null;
         }
 
-        if (cell.getCellNum() == row.getLastCol())
+        if (hcell.getCellNum() == row.getLastCol())
         {
             row.setLastCol(findLastCell(row.getLastCol()));
         }
-        if (cell.getCellNum() == row.getFirstCol())
+        if (hcell.getCellNum() == row.getFirstCol())
         {
             row.setFirstCol(findFirstCell(row.getFirstCol()));
         }
index 0250a4cbaab23ea830e847e518fbbb8a01d4d79a..aa7ea2db480c0b31056b77118722062893888ba6 100644 (file)
  */
 package org.apache.poi.hssf.usermodel;
 
+import java.awt.font.FontRenderContext;
+import java.awt.font.TextAttribute;
+import java.awt.font.TextLayout;
+import java.awt.geom.AffineTransform;
+import java.io.PrintWriter;
+import java.text.AttributedString;
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Stack;
+import java.util.TreeMap;
+
 import org.apache.poi.ddf.EscherRecord;
 import org.apache.poi.hssf.model.FormulaParser;
 import org.apache.poi.hssf.model.Sheet;
 import org.apache.poi.hssf.model.Workbook;
-import org.apache.poi.hssf.record.*;
+import org.apache.poi.hssf.record.CellValueRecordInterface;
+import org.apache.poi.hssf.record.DVALRecord;
+import org.apache.poi.hssf.record.DVRecord;
+import org.apache.poi.hssf.record.EOFRecord;
+import org.apache.poi.hssf.record.EscherAggregate;
+import org.apache.poi.hssf.record.HCenterRecord;
+import org.apache.poi.hssf.record.PageBreakRecord;
+import org.apache.poi.hssf.record.Record;
+import org.apache.poi.hssf.record.RowRecord;
+import org.apache.poi.hssf.record.SCLRecord;
+import org.apache.poi.hssf.record.VCenterRecord;
+import org.apache.poi.hssf.record.WSBoolRecord;
+import org.apache.poi.hssf.record.WindowTwoRecord;
 import org.apache.poi.hssf.record.formula.Ptg;
 import org.apache.poi.hssf.record.formula.ReferencePtg;
 import org.apache.poi.hssf.util.HSSFCellRangeAddress;
 import org.apache.poi.hssf.util.HSSFDataValidation;
-import org.apache.poi.hssf.util.Region;
 import org.apache.poi.hssf.util.PaneInformation;
+import org.apache.poi.hssf.util.Region;
+import org.apache.poi.ss.usermodel.CellStyle;
+import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
 
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Stack;
-import java.util.TreeMap;
-import java.text.AttributedString;
-import java.text.NumberFormat;
-import java.text.DecimalFormat;
-import java.awt.font.TextLayout;
-import java.awt.font.FontRenderContext;
-import java.awt.font.TextAttribute;
-
-import java.awt.geom.AffineTransform;
-
 /**
  * High level representation of a worksheet.
  * @author  Andrew C. Oliver (acoliver at apache dot org)
@@ -61,7 +74,7 @@ import java.awt.geom.AffineTransform;
  * @author  Yegor Kozlov (yegor at apache.org) (Autosizing columns)
  */
 
-public class HSSFSheet
+public class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet
 {
     private static final int DEBUG = POILogger.DEBUG;
 
@@ -227,7 +240,7 @@ public class HSSFSheet
      * @param row   representing a row to remove.
      */
 
-    public void removeRow(HSSFRow row)
+    public void removeRow(Row row)
     {
         sheet.setLoc(sheet.getDimsLoc());
         if (rows.size() > 0)
@@ -250,7 +263,7 @@ public class HSSFSheet
                 sheet.removeValueRecord(row.getRowNum(),
                         cell.getCellValueRecord());
             }
-            sheet.removeRow(row.getRowRecord());
+            sheet.removeRow(((HSSFRow) row).getRowRecord());
         }
     }
 
@@ -1636,7 +1649,7 @@ public class HSSFSheet
      * @param column the column index
      * @param style the style to set
      */
-    public void setDefaultColumnStyle(short column, HSSFCellStyle style) {
+    public void setDefaultColumnStyle(short column, CellStyle style) {
        sheet.setColumn(column, new Short(style.getIndex()), null, null, null, null);
     }
 
index 51c4c25b5bf6c09575941762ff73bbbd9ba94a1e..ac86b2d8dd2ae9de85eb979991abbf1ef82935f2 100644 (file)
@@ -17,6 +17,8 @@
 
 package org.apache.poi.hssf.usermodel;
 
+import org.apache.poi.ss.usermodel.RichTextString;
+
 /**
  * A textbox is a shape that may hold a rich text string.
  *
@@ -53,9 +55,9 @@ public class HSSFTextbox
     /**
      * @param string    Sets the rich text string used by this object.
      */
-    public void setString( HSSFRichTextString string )
+    public void setString( RichTextString string )
     {
-        this.string = string;
+        this.string = (HSSFRichTextString) string;
     }
 
     /**
index e237ed75db23ae926b123ddcd014ebb6b21adb8a..972051e87a177bbf6d0c66745368900159889d27 100644 (file)
  */
 package org.apache.poi.hssf.usermodel;
 
+import java.io.ByteArrayInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Stack;
+
 import org.apache.poi.POIDocument;
 import org.apache.poi.ddf.EscherBSERecord;
 import org.apache.poi.ddf.EscherBitmapBlip;
-import org.apache.poi.ddf.EscherRecord;
 import org.apache.poi.ddf.EscherBlipRecord;
+import org.apache.poi.ddf.EscherRecord;
 import org.apache.poi.hssf.eventmodel.EventRecordFactory;
 import org.apache.poi.hssf.model.Sheet;
 import org.apache.poi.hssf.model.Workbook;
-import org.apache.poi.hssf.record.*;
+import org.apache.poi.hssf.record.AbstractEscherHolderRecord;
+import org.apache.poi.hssf.record.BackupRecord;
+import org.apache.poi.hssf.record.DrawingGroupRecord;
+import org.apache.poi.hssf.record.EmbeddedObjectRefSubRecord;
+import org.apache.poi.hssf.record.ExtendedFormatRecord;
+import org.apache.poi.hssf.record.FontRecord;
+import org.apache.poi.hssf.record.LabelRecord;
+import org.apache.poi.hssf.record.LabelSSTRecord;
+import org.apache.poi.hssf.record.NameRecord;
+import org.apache.poi.hssf.record.ObjRecord;
+import org.apache.poi.hssf.record.Record;
+import org.apache.poi.hssf.record.RecordFactory;
+import org.apache.poi.hssf.record.SSTRecord;
+import org.apache.poi.hssf.record.UnicodeString;
+import org.apache.poi.hssf.record.UnknownRecord;
+import org.apache.poi.hssf.record.WindowTwoRecord;
 import org.apache.poi.hssf.record.formula.Area3DPtg;
 import org.apache.poi.hssf.record.formula.MemFuncPtg;
 import org.apache.poi.hssf.record.formula.UnionPtg;
 import org.apache.poi.hssf.util.CellReference;
-import org.apache.poi.poifs.filesystem.*;
+import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.util.POILogFactory;
 import org.apache.poi.util.POILogger;
 
-import java.io.ByteArrayInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Stack;
-
 /**
  * High level representation of a workbook.  This is the first object most users
  * will construct whether they are reading or writing a workbook.  It is also the
@@ -64,7 +79,7 @@ import java.util.Stack;
  * @version 2.0-pre
  */
 
-public class HSSFWorkbook extends POIDocument
+public class HSSFWorkbook extends POIDocument implements org.apache.poi.ss.usermodel.Workbook
 {
     private static final int DEBUG = POILogger.DEBUG;
 
@@ -495,7 +510,7 @@ public class HSSFWorkbook extends POIDocument
      * @param sheet the sheet to look up
      * @return index of the sheet (0 based)
      */
-    public int getSheetIndex(HSSFSheet sheet)
+    public int getSheetIndex(org.apache.poi.ss.usermodel.Sheet sheet)
     {
        for(int i=0; i<sheets.size(); i++) {
                if(sheets.get(i) == sheet) {
index bc5fb29a5aa08c2f074855e4ada34357256dc126..9251ccc74e3c340c8f9487fa4c197f136b6c12ef 100644 (file)
@@ -18,7 +18,9 @@
 
 package org.apache.poi.hssf.util;
 
-import java.util.*;
+import java.util.Hashtable;
+
+import org.apache.poi.ss.usermodel.Color;
 
 /**
  * Intends to provide support for the very evil index to triplet issue and
@@ -34,7 +36,7 @@ import java.util.*;
  * @author  Brian Sanders (bsanders at risklabs dot com) - full default color palette
  */
 
-public class HSSFColor
+public class HSSFColor implements Color
 {
     private final static int PALETTE_SIZE = 56;
     private final static int DISTINCT_COLOR_COUNT = 46;