aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorUgo Cei <ugo@apache.org>2008-01-24 10:10:55 +0000
committerUgo Cei <ugo@apache.org>2008-01-24 10:10:55 +0000
commit1dda0ecda1eff8c48ad6b026291d407d907dc0d7 (patch)
treea27214cab0dea7c98483e824214c5c9eb5333961 /src/java/org
parente06533f54febee043688ab738c842a4368b85be8 (diff)
downloadpoi-1dda0ecda1eff8c48ad6b026291d407d907dc0d7.tar.gz
poi-1dda0ecda1eff8c48ad6b026291d407d907dc0d7.zip
HSSF* classes implement same interfaces as XSSF* classes.
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/ooxml@614830 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFCell.java21
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java11
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFComment.java14
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java9
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFFont.java3
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFFooter.java3
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFHeader.java3
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFName.java4
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java3
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java4
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFPrintSetup.java12
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFRichTextString.java12
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFRow.java21
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java55
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java6
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java47
-rw-r--r--src/java/org/apache/poi/hssf/util/HSSFColor.java6
17 files changed, 136 insertions, 98 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
index b3b4fc9297..e076047c5e 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
@@ -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;
}
/**
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
index cdea9ee5be..fa8489cbab 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
@@ -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());
}
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFComment.java b/src/java/org/apache/poi/hssf/usermodel/HSSFComment.java
index 258f26e228..08d209a272 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFComment.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFComment.java
@@ -16,21 +16,17 @@
==================================================================== */
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);
}
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java b/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
index 64fbccb8b2..547ec83038 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
@@ -23,14 +23,15 @@
*/
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();
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java b/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java
index cfaa5e4f48..2827043575 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java
@@ -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
{
/**
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFFooter.java b/src/java/org/apache/poi/hssf/usermodel/HSSFFooter.java
index a72010378f..4e62e8b474 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFFooter.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFFooter.java
@@ -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;
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFHeader.java b/src/java/org/apache/poi/hssf/usermodel/HSSFHeader.java
index 614caf9b44..e1cd0b0091 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFHeader.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFHeader.java
@@ -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;
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFName.java b/src/java/org/apache/poi/hssf/usermodel/HSSFName.java
index 73da4fe9c4..501373e35f 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFName.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFName.java
@@ -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;
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java b/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java
index 7fc5525950..42773d4a33 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java
@@ -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;
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java b/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
index 583e1b4793..9e69fa255d 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFPatriarch.java
@@ -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;
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFPrintSetup.java b/src/java/org/apache/poi/hssf/usermodel/HSSFPrintSetup.java
index 713f44b3d9..3695616543 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFPrintSetup.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFPrintSetup.java
@@ -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;
/**
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFRichTextString.java b/src/java/org/apache/poi/hssf/usermodel/HSSFRichTextString.java
index 93db9214a6..bd9a4cd792 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFRichTextString.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFRichTextString.java
@@ -17,11 +17,13 @@
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);
}
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
index ae5727bc68..ce2bc605fb 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
@@ -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()));
}
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
index 0250a4cbaa..aa7ea2db48 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java
@@ -22,35 +22,48 @@
*/
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);
}
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java b/src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java
index 51c4c25b5b..ac86b2d8dd 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFTextbox.java
@@ -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;
}
/**
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
index e237ed75db..972051e87a 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
@@ -23,34 +23,49 @@
*/
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) {
diff --git a/src/java/org/apache/poi/hssf/util/HSSFColor.java b/src/java/org/apache/poi/hssf/util/HSSFColor.java
index bc5fb29a5a..9251ccc74e 100644
--- a/src/java/org/apache/poi/hssf/util/HSSFColor.java
+++ b/src/java/org/apache/poi/hssf/util/HSSFColor.java
@@ -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;