*
* @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.
*/
@Override
public void setZoom(int numerator, int denominator) {
sclRecord.setDenominator((short) denominator);
getSheet().setSCLRecord(sclRecord);
}
+
+ /**
+ * Window zoom magnification for current view representing percent values.
+ * Valid values range from 10 to 400. Horizontal & Vertical scale together.
+ *
+ * For example:
+ * <pre>
+ * 10 - 10%
+ * 20 - 20%
+ * ...
+ * 100 - 100%
+ * ...
+ * 400 - 400%
+ * </pre>
+ *
+ * @param scale window zoom magnification
+ * @throws IllegalArgumentException if scale is invalid
+ */
+ @Override
+ public void setZoom(int scale) {
+ setZoom(scale*100, 100);
+ }
/**
* The top row in the visible view when the sheet is
*
* @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.
*/
void setZoom(int numerator, int denominator);
+
+ /**
+ * Window zoom magnification for current view representing percent values.
+ * Valid values range from 10 to 400. Horizontal & Vertical scale together.
+ *
+ * For example:
+ * <pre>
+ * 10 - 10%
+ * 20 - 20%
+ * ...
+ * 100 - 100%
+ * ...
+ * 400 - 400%
+ * </pre>
+ *
+ * @param scale window zoom magnification
+ * @throws IllegalArgumentException if scale is invalid
+ */
+ public void setZoom(int scale);
/**
* The top row in the visible view when the sheet is
*
* @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.
*/
@Override
public void setZoom(int numerator, int denominator)
{
_sh.setZoom(numerator,denominator);
}
+
+ /**
+ * Window zoom magnification for current view representing percent values.
+ * Valid values range from 10 to 400. Horizontal & Vertical scale together.
+ *
+ * For example:
+ * <pre>
+ * 10 - 10%
+ * 20 - 20%
+ * ...
+ * 100 - 100%
+ * ...
+ * 400 - 400%
+ * </pre>
+ *
+ * Current view can be Normal, Page Layout, or Page Break Preview.
+ *
+ * @param scale window zoom magnification
+ * @throws IllegalArgumentException if scale is invalid
+ */
+ @Override
+ public void setZoom(int scale) {
+ _sh.setZoom(scale);
+ }
/**
* The top row in the visible view when the sheet is
*
* @param numerator The numerator for the zoom magnification.
* @param denominator The denominator for the zoom magnification.
- * @see #setZoom(int)
+ * @deprecated 2015-11-23 (circa POI 3.14beta1). Use {@link #setZoom(int)} instead.
*/
@Override
public void setZoom(int numerator, int denominator) {
* @param scale window zoom magnification
* @throws IllegalArgumentException if scale is invalid
*/
+ @Override
public void setZoom(int scale) {
if(scale < 10 || scale > 400) throw new IllegalArgumentException("Valid scale values range from 10 to 400");
getSheetTypeSheetView().setZoomScale(scale);
workbook.close();
}
+ @SuppressWarnings("deprecation")
@Test(expected=IllegalArgumentException.class)
public void setZoom() throws IOException {
XSSFWorkbook workBook = new XSSFWorkbook();
workbook.close();
}
+ @SuppressWarnings("deprecation")
@Test
public void zoom() throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();