diff options
author | PJ Fanning <fanningpj@apache.org> | 2017-06-28 10:34:37 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2017-06-28 10:34:37 +0000 |
commit | b68b916d0890a0088db173ea08477d48f80dfc33 (patch) | |
tree | 19e992813e160c50e2e8f884bc3d8ce8217e81bc /src/java | |
parent | 995a28cd868a83fbcbba8d20d459b1eecc45aae4 (diff) | |
download | poi-b68b916d0890a0088db173ea08477d48f80dfc33.tar.gz poi-b68b916d0890a0088db173ea08477d48f80dfc33.zip |
Remove some deprecated *SSF APIs
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800147 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
14 files changed, 14 insertions, 214 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java b/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java index 5cdb2a3576..7b10c1ed8a 100644 --- a/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java +++ b/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java @@ -330,7 +330,7 @@ public class EscherGraphics extends Graphics hssfColor = workbook.getCustomPalette().findSimilarColor((byte)foreground.getRed(), (byte)foreground.getGreen(), (byte)foreground.getBlue()); boolean bold = (matchFont.getStyle() & Font.BOLD) != 0; boolean italic = (matchFont.getStyle() & Font.ITALIC) != 0; - HSSFFont hssfFont = workbook.findFont(bold ? HSSFFont.BOLDWEIGHT_BOLD : 0, + HSSFFont hssfFont = workbook.findFont(bold, hssfColor.getIndex(), (short)(matchFont.getSize() * 20), matchFont.getName(), @@ -341,7 +341,7 @@ public class EscherGraphics extends Graphics if (hssfFont == null) { hssfFont = workbook.createFont(); - hssfFont.setBoldweight(bold ? HSSFFont.BOLDWEIGHT_BOLD : 0); + hssfFont.setBold(bold); hssfFont.setColor(hssfColor.getIndex()); hssfFont.setFontHeight((short)(matchFont.getSize() * 20)); hssfFont.setFontName(matchFont.getName()); diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFClientAnchor.java b/src/java/org/apache/poi/hssf/usermodel/HSSFClientAnchor.java index d4c8c6d689..5a93e847a8 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFClientAnchor.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFClientAnchor.java @@ -21,7 +21,6 @@ import org.apache.poi.ddf.EscherClientAnchorRecord; import org.apache.poi.ddf.EscherRecord; import org.apache.poi.ss.SpreadsheetVersion; import org.apache.poi.ss.usermodel.ClientAnchor; -import org.apache.poi.util.Removal; /** * A client anchor is attached to an excel worksheet. It anchors against a @@ -268,16 +267,6 @@ public final class HSSFClientAnchor extends HSSFAnchor implements ClientAnchor { public void setAnchorType(AnchorType anchorType) { _escherClientAnchor.setFlag(anchorType.value); } - /** - * Sets the anchor type - * @param anchorType the anchor type to set - * @deprecated POI 3.15. Use {@link #setAnchorType(AnchorType)} instead. - */ - @Removal(version="3.17") - @Override - public void setAnchorType(int anchorType) { - _escherClientAnchor.setFlag((short) anchorType); - } private void checkRange(int value, int minRange, int maxRange, String varName) { if (value < minRange || value > maxRange) diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCreationHelper.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCreationHelper.java index 863d1a004a..027a11f22d 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFCreationHelper.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCreationHelper.java @@ -21,7 +21,6 @@ import org.apache.poi.common.usermodel.HyperlinkType; import org.apache.poi.hssf.record.common.ExtendedColor; import org.apache.poi.ss.usermodel.CreationHelper; import org.apache.poi.util.Internal; -import org.apache.poi.util.Removal; public class HSSFCreationHelper implements CreationHelper { private final HSSFWorkbook workbook; @@ -46,16 +45,6 @@ public class HSSFCreationHelper implements CreationHelper { return workbook.createDataFormat(); } - /** - * {@inheritDoc} - * @deprecated POI 3.15 beta 3. Use {@link #createHyperlink(HyperlinkType)} instead. - */ - @Deprecated - @Removal(version="3.17") - @Override - public HSSFHyperlink createHyperlink(int type) { - return new HSSFHyperlink(type); - } @Override public HSSFHyperlink createHyperlink(HyperlinkType type) { return new HSSFHyperlink(type); diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationCell.java b/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationCell.java index 1771b2e35f..2d69ed9419 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationCell.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFEvaluationCell.java @@ -20,7 +20,6 @@ package org.apache.poi.hssf.usermodel; import org.apache.poi.ss.formula.EvaluationCell; import org.apache.poi.ss.formula.EvaluationSheet; import org.apache.poi.ss.usermodel.CellType; -import org.apache.poi.util.Internal; /** * HSSF wrapper for a cell under evaluation */ diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java b/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java index cd3ac619d1..d07da152b1 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java @@ -31,9 +31,18 @@ import org.apache.poi.ss.usermodel.Font; public final class HSSFFont implements Font { /** - * Arial font + * Normal boldness (not bold) */ + final static short BOLDWEIGHT_NORMAL = 0x190; + /** + * Bold boldness (bold) + */ + final static short BOLDWEIGHT_BOLD = 0x2bc; + + /** + * Arial font + */ public final static String FONT_ARIAL = "Arial"; @@ -199,18 +208,6 @@ public final class HSSFFont implements Font { HSSFPalette pallette = wb.getCustomPalette(); return pallette.getColor( getColor() ); } - - /** - * set the boldness to use - * @param boldweight - * @see #BOLDWEIGHT_NORMAL - * @see #BOLDWEIGHT_BOLD - * @deprecated 3.15 beta 2. Scheduled for removal in 3.17. Use {@link #setBold(boolean)} instead. - */ - public void setBoldweight(short boldweight) - { - font.setBoldWeight(boldweight); - } /** * sets the font to be bold or not @@ -222,25 +219,13 @@ public final class HSSFFont implements Font { else font.setBoldWeight(BOLDWEIGHT_NORMAL); } - - /** - * get the boldness to use - * @return boldweight - * @see #BOLDWEIGHT_NORMAL - * @see #BOLDWEIGHT_BOLD - * @deprecated 3.15 beta 2. Scheduled for removal in 3.17. Use {@link #getBold} instead. - */ - public short getBoldweight() - { - return font.getBoldWeight(); - } /** * get if the font is bold or not */ public boolean getBold() { - return getBoldweight() == BOLDWEIGHT_BOLD; + return font.getBoldWeight() == BOLDWEIGHT_BOLD; } /** diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java index 7af241c85a..ac0a902b74 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java @@ -393,7 +393,7 @@ public final class HSSFRow implements Row, Comparable<HSSFRow> { case CREATE_NULL_AS_BLANK: return (cell == null) ? createCell(cellnum, CellType.BLANK) : cell; default: - throw new IllegalArgumentException("Illegal policy " + policy + " (" + policy.id + ")"); + throw new IllegalArgumentException("Illegal policy " + policy); } } diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java index 29816093a3..0af1268b4a 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java @@ -2172,18 +2172,6 @@ public final class HSSFSheet implements org.apache.poi.ss.usermodel.Sheet { } setColumnWidth(column, (int) (width)); } - - } - - /** - * Returns cell comment for the specified row and column - * - * @return cell comment or <code>null</code> if not found - * @deprecated as of 2015-11-23 (circa POI 3.14beta1). Use {@link #getCellComment(CellAddress)} instead. - */ - @Override - public HSSFComment getCellComment(int row, int column) { - return findCellComment(row, column); } /** diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java index 6fe2fd309d..c5e3caf372 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java @@ -1207,39 +1207,6 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss /** * Finds a font that matches the one with the supplied attributes - * @deprecated 3.15 beta 2. Use {@link #findFont(boolean, short, short, String, boolean, boolean, short, byte)} instead. - */ - @Deprecated - @Override - public HSSFFont findFont(short boldWeight, short color, short fontHeight, - String name, boolean italic, boolean strikeout, - short typeOffset, byte underline) - { - short numberOfFonts = getNumberOfFonts(); - for (short i=0; i<=numberOfFonts; i++) { - // Remember - there is no 4! - if(i == 4) { - continue; - } - - HSSFFont hssfFont = getFontAt(i); - if (hssfFont.getBoldweight() == boldWeight - && hssfFont.getColor() == color - && hssfFont.getFontHeight() == fontHeight - && hssfFont.getFontName().equals(name) - && hssfFont.getItalic() == italic - && hssfFont.getStrikeout() == strikeout - && hssfFont.getTypeOffset() == typeOffset - && hssfFont.getUnderline() == underline) - { - return hssfFont; - } - } - - return null; - } - /** - * Finds a font that matches the one with the supplied attributes */ @Override public HSSFFont findFont(boolean bold, short color, short fontHeight, diff --git a/src/java/org/apache/poi/ss/usermodel/ClientAnchor.java b/src/java/org/apache/poi/ss/usermodel/ClientAnchor.java index d11edc56ae..f482e6f510 100644 --- a/src/java/org/apache/poi/ss/usermodel/ClientAnchor.java +++ b/src/java/org/apache/poi/ss/usermodel/ClientAnchor.java @@ -17,7 +17,6 @@ package org.apache.poi.ss.usermodel; import org.apache.poi.util.Internal; -import org.apache.poi.util.Removal; /** * A client anchor is attached to an excel worksheet. It anchors against @@ -35,51 +34,6 @@ import org.apache.poi.util.Removal; public interface ClientAnchor { /** - * Move and Resize With Anchor Cells - * <p> - * Specifies that the current drawing shall move and - * resize to maintain its row and column anchors (i.e. the - * object is anchored to the actual from and to row and column) - * </p> - * @deprecated since POI 3.14beta1 (circa 2015-11-24). Use {@link AnchorType#MOVE_AND_RESIZE} instead. - */ - @Removal(version="3.17") - public static final AnchorType MOVE_AND_RESIZE = AnchorType.MOVE_AND_RESIZE; - - /** - * Move With Cells but Do Not Resize - * <p> - * Specifies that the current drawing shall move with its - * row and column (i.e. the object is anchored to the - * actual from row and column), but that the size shall remain absolute. - * </p> - * <p> - * If additional rows/columns are added between the from and to locations of the drawing, - * the drawing shall move its to anchors as needed to maintain this same absolute size. - * </p> - * @deprecated since POI 3.14beta1 (circa 2015-11-24). Use {@link AnchorType#MOVE_DONT_RESIZE} instead. - */ - @Removal(version="3.17") - public static final AnchorType MOVE_DONT_RESIZE = AnchorType.MOVE_DONT_RESIZE; - - /** - * Do Not Move or Resize With Underlying Rows/Columns - * <p> - * Specifies that the current start and end positions shall - * be maintained with respect to the distances from the - * absolute start point of the worksheet. - * </p> - * <p> - * If additional rows/columns are added before the - * drawing, the drawing shall move its anchors as needed - * to maintain this same absolute position. - * </p> - * @deprecated since POI 3.14beta1 (circa 2015-11-24). Use {@link AnchorType#DONT_MOVE_AND_RESIZE} instead. - */ - @Removal(version="3.17") - public static final AnchorType DONT_MOVE_AND_RESIZE = AnchorType.DONT_MOVE_AND_RESIZE; - - /** * @since POI 3.14beta1 */ public static enum AnchorType { @@ -309,13 +263,6 @@ public interface ClientAnchor { * @since POI 3.14 */ public void setAnchorType( AnchorType anchorType ); - /** - * Sets the anchor type - * @param anchorType the anchor type to set - * @deprecated POI 3.15. Use {@link #setAnchorType(AnchorType)} instead. - */ - @Removal(version="3.17") - public void setAnchorType( int anchorType ); /** * Gets the anchor type diff --git a/src/java/org/apache/poi/ss/usermodel/CreationHelper.java b/src/java/org/apache/poi/ss/usermodel/CreationHelper.java index 53462c1d4e..36cfb1deab 100644 --- a/src/java/org/apache/poi/ss/usermodel/CreationHelper.java +++ b/src/java/org/apache/poi/ss/usermodel/CreationHelper.java @@ -17,7 +17,6 @@ package org.apache.poi.ss.usermodel; import org.apache.poi.common.usermodel.HyperlinkType; -import org.apache.poi.util.Removal; /** * An object that handles instantiating concrete @@ -41,14 +40,6 @@ public interface CreationHelper { * Creates a new DataFormat instance */ DataFormat createDataFormat(); - - /** - * Creates a new Hyperlink, of the given type - * @deprecated POI 3.15 beta 3. Use {@link #createHyperlink(HyperlinkType)} instead. - */ - @Removal(version="3.17") - @Deprecated - Hyperlink createHyperlink(int type); /** * Creates a new Hyperlink, of the given type diff --git a/src/java/org/apache/poi/ss/usermodel/Font.java b/src/java/org/apache/poi/ss/usermodel/Font.java index d4bcc110a5..7c218531c4 100644 --- a/src/java/org/apache/poi/ss/usermodel/Font.java +++ b/src/java/org/apache/poi/ss/usermodel/Font.java @@ -19,19 +19,6 @@ package org.apache.poi.ss.usermodel; public interface Font { - /** - * Normal boldness (not bold) - * @deprecated 3.15 beta 2. Scheduled for removal in 3.17. - * Boldweight constants no longer needed due to {@link #getBold} and {@link #setBold(boolean)} - */ - public final static short BOLDWEIGHT_NORMAL = 0x190; - - /** - * Bold boldness (bold) - * @deprecated 3.15 beta 2. Scheduled for removal in 3.17. - * Boldweight constants no longer needed due to {@link #getBold} and {@link #setBold(boolean)} - */ - public final static short BOLDWEIGHT_BOLD = 0x2bc; /** * normal type of black color. @@ -283,15 +270,7 @@ public interface Font { */ public short getIndex(); - /** - * @deprecated 3.15 beta 2. Scheduled for removal in 3.17. Use {@link #setBold(boolean)}. - */ - public void setBoldweight(short boldweight); public void setBold(boolean bold); - /** - * @deprecated 3.15 beta 2. Scheduled for removal in 3.17. Use {@link #getBold()}. - */ - public short getBoldweight(); public boolean getBold(); } diff --git a/src/java/org/apache/poi/ss/usermodel/Sheet.java b/src/java/org/apache/poi/ss/usermodel/Sheet.java index e21aeafd86..80788a09a1 100644 --- a/src/java/org/apache/poi/ss/usermodel/Sheet.java +++ b/src/java/org/apache/poi/ss/usermodel/Sheet.java @@ -25,7 +25,6 @@ import java.util.Map; import org.apache.poi.ss.util.CellAddress; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.PaneInformation; -import org.apache.poi.util.Removal; /** * High level representation of a Excel worksheet. @@ -615,19 +614,6 @@ public interface Sheet extends Iterable<Row> { * @return true => protection enabled; false => protection disabled */ boolean getScenarioProtect(); - - /** - * Sets the zoom magnication for the sheet. The zoom is expressed as a - * fraction. For example to express a zoom of 75% use 3 for the numerator - * and 4 for the denominator. - * - * @param numerator The numerator for the zoom magnification. - * @param denominator The denominator for the zoom magnification. - * @deprecated 2015-11-23 (circa POI 3.14beta1). Use {@link #setZoom(int)} instead. - */ - @Removal(version="3.16") - @Deprecated - void setZoom(int numerator, int denominator); /** * Window zoom magnification for current view representing percent values. @@ -941,15 +927,6 @@ public interface Sheet extends Iterable<Row> { * @param useMergedCells whether to use the contents of merged cells when calculating the width of the column */ void autoSizeColumn(int column, boolean useMergedCells); - - /** - * Returns cell comment for the specified row and column - * - * @return cell comment or <code>null</code> if not found - * @deprecated as of 2015-11-23 (circa POI 3.14beta1). Use {@link #getCellComment(CellAddress)} instead. - */ - @Deprecated - Comment getCellComment(int row, int column); /** * Returns cell comment for the specified location diff --git a/src/java/org/apache/poi/ss/usermodel/TableStyleType.java b/src/java/org/apache/poi/ss/usermodel/TableStyleType.java index e6fa9dce25..f8636b25b9 100644 --- a/src/java/org/apache/poi/ss/usermodel/TableStyleType.java +++ b/src/java/org/apache/poi/ss/usermodel/TableStyleType.java @@ -17,8 +17,6 @@ package org.apache.poi.ss.usermodel; -import java.util.EnumSet; - import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.CellRangeAddressBase; diff --git a/src/java/org/apache/poi/ss/usermodel/Workbook.java b/src/java/org/apache/poi/ss/usermodel/Workbook.java index 49082536f0..dbac00bffb 100644 --- a/src/java/org/apache/poi/ss/usermodel/Workbook.java +++ b/src/java/org/apache/poi/ss/usermodel/Workbook.java @@ -289,15 +289,6 @@ public interface Workbook extends Closeable, Iterable<Sheet> { * @return new font object */ Font createFont(); - - /** - * Finds a font that matches the one with the supplied attributes - * - * @return the font with the matched attributes or <code>null</code> - * @deprecated POI 3.15 beta 2. Use {@link #findFont(boolean, short, short, String, boolean, boolean, short, byte)} instead. - */ - @Deprecated - Font findFont(short boldWeight, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline); /** * Finds a font that matches the one with the supplied attributes |