jxl
Class SheetSettings

java.lang.Object
  |
  +--jxl.SheetSettings

public final class SheetSettings
extends java.lang.Object

This is a bean which client applications may use to get/set various properties which are associated with a particular worksheet, such as headers and footers, page orientation etc.


Field Summary
private  double bottomMargin
          The margin from the bottom of the paper in inches
private  int defaultColumnWidth
          The default column width, in characters
private static int defaultDefaultColumnWidth
           
private static int defaultDefaultRowHeight
           
private static double defaultFooterMargin
           
private static double defaultHeaderMargin
           
private static double defaultHeightMargin
           
private static PageOrientation defaultOrientation
           
private static PaperSize defaultPaperSize
           
private static int defaultPrintResolution
           
private  int defaultRowHeight
          The default row height, in 1/20th of a point
private static double defaultWidthMargin
           
private  boolean displayZeroValues
          Indicates whether the sheet should display zero values
private  int fitHeight
          The number of pages into which this excel sheet is squeezed heightwise
private  boolean fitToPages
          Indicates whether to fit the print to the pages or scale the output This field is manipulated indirectly by virtue of the setFitWidth/Height methods
private  int fitWidth
          The number of pages into which this excel sheet is squeezed widthwise
private  double footerMargin
          The margin allocated for any page footers, in inches
private  double headerMargin
          The margin allocated for any page headers, in inches
private  boolean hidden
          Indicates whether or not this sheet is hidden
private  int horizontalFreeze
          The horizontal freeze pane
private  int horizontalPrintResolution
          The horizontal print resolution
private  double leftMargin
          The margin from the left hand side of the paper in inches
private  PageOrientation orientation
          The page orientation
private  int pageStart
          The page number at which to commence printing
private  PaperSize paperSize
          The paper size for printing
private  java.lang.String password
          The password for protected sheets
private  int passwordHash
          The password hashcode - used when copying sheets
private  double rightMargin
          The margin from the right hand side of the paper in inches
private  int scaleFactor
          The scale factor used when printing
private  boolean selected
          Indicates whether or not this sheet is selected
private  boolean sheetProtected
          Indicates whether or not this sheet is protected
private  boolean showGridLines
          Indicates whether grid lines should be displayed
private  double topMargin
          The margin from the top of the paper in inches
private  int verticalFreeze
          The vertical freeze position
private  int verticalPrintResolution
          The vertical print resolution
private  int zoomFactor
          The zoom factor used when viewing.
 
Constructor Summary
SheetSettings()
          Default constructor
SheetSettings(SheetSettings copy)
          Copy constructor.
 
Method Summary
 double getBottomMargin()
          Accessor for the bottom margin
 int getDefaultColumnWidth()
          Accessor for the default column width
 double getDefaultHeightMargin()
          Gets the default margin height
 int getDefaultRowHeight()
          Accessor for the default row height
 double getDefaultWidthMargin()
          Gets the default margin width
 boolean getDisplayZeroValues()
          Accessor for the displayZeroValues property
 int getFitHeight()
          Accessor for the fit height
 boolean getFitToPages()
          Accessor for the fit width print flag
 int getFitWidth()
          Accessor for the fit width
 double getFooterMargin()
          Accessor for the footer margin
 double getHeaderMargin()
          Accessor for the header margin
 int getHorizontalFreeze()
          Gets the row at which the pane is frozen horizontally
 int getHorizontalPrintResolution()
          Accessor for the horizontal print resolution
 double getLeftMargin()
          Accessor for the left margin
 PageOrientation getOrientation()
          Accessor for the orientation
 int getPageStart()
          Accessor for the page start
 PaperSize getPaperSize()
          Accessor for the paper size
 java.lang.String getPassword()
          Accessor for the password
 int getPasswordHash()
          Accessor for the password hash - used only when copying sheets
 double getRightMargin()
          Accessor for the right margin
 int getScaleFactor()
          Accessor for the scale factor
 boolean getShowGridLines()
          Accessor for the showGridLines property
 double getTopMargin()
          Accessor for the top margin
 int getVerticalFreeze()
          Gets the column at which the pane is frozen vertically
 int getVerticalPrintResolution()
          Accessor for the vertical print resolution
 int getZoomFactor()
          Accessor for the zoom factor.
 boolean isHidden()
          Accessor for the hidden nature of this sheet
 boolean isProtected()
          Queries whether this sheet is protected (ie.
 boolean isSelected()
          Accessor for the selected nature of the sheet
 void setBottomMargin(double m)
          Sets the bottom margin
 void setDefaultColumnWidth(int w)
          Sets the default column width
 void setDefaultRowHeight(int h)
          Sets the default row height
 void setDisplayZeroValues(boolean b)
          Sets the displayZeroValues property
 void setFitHeight(int fh)
          Sets the number of pages vertically that this sheet will be printed into
 void setFitToPages(boolean b)
          Accessor for the fit to pages flag
 void setFitWidth(int fw)
          Sets the number of pages widthwise which this sheet should be printed into
 void setFooterMargin(double d)
          Sets the margin for any page footer
 void setHeaderMargin(double d)
          Sets the margin for any page headers
 void setHidden(boolean h)
          Sets the hidden status of this worksheet
 void setHorizontalFreeze(int row)
          Sets the row at which the pane is frozen horizontally
 void setHorizontalPrintResolution(int hpw)
          Sets the horizontal print resolution
 void setLeftMargin(double m)
          Sets the left margin
 void setOrientation(PageOrientation po)
          Sets the paper orientation for printing this sheet
 void setPageStart(int ps)
          Sets the page number at which to commence printing
 void setPaperSize(PaperSize ps)
          Sets the paper size to be used when printing this sheet
 void setPassword(java.lang.String s)
          Sets the password for this sheet
 void setPasswordHash(int ph)
          Accessor for the password hash - used only when copying sheets
 void setProtected(boolean p)
          Sets the protected (ie.
 void setRightMargin(double m)
          Sets the right margin
 void setScaleFactor(int sf)
          Sets the scale factor for this sheet to be used when printing.
 void setSelected()
          Sets this sheet to be when it is opened in excel
 void setShowGridLines(boolean b)
          Sets the showGridLines property
 void setTopMargin(double m)
          Sets the top margin
 void setVerticalFreeze(int col)
          Sets the row at which the pane is frozen vertically
 void setVerticalPrintResolution(int vpw)
          Sets the vertical print reslution
 void setZoomFactor(int zf)
          Sets the zoom factor.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

orientation

private PageOrientation orientation
The page orientation

paperSize

private PaperSize paperSize
The paper size for printing

sheetProtected

private boolean sheetProtected
Indicates whether or not this sheet is protected

hidden

private boolean hidden
Indicates whether or not this sheet is hidden

selected

private boolean selected
Indicates whether or not this sheet is selected

headerMargin

private double headerMargin
The margin allocated for any page headers, in inches

footerMargin

private double footerMargin
The margin allocated for any page footers, in inches

scaleFactor

private int scaleFactor
The scale factor used when printing

zoomFactor

private int zoomFactor
The zoom factor used when viewing. Note the difference between this and the scaleFactor which is used when printing

pageStart

private int pageStart
The page number at which to commence printing

fitWidth

private int fitWidth
The number of pages into which this excel sheet is squeezed widthwise

fitHeight

private int fitHeight
The number of pages into which this excel sheet is squeezed heightwise

horizontalPrintResolution

private int horizontalPrintResolution
The horizontal print resolution

verticalPrintResolution

private int verticalPrintResolution
The vertical print resolution

leftMargin

private double leftMargin
The margin from the left hand side of the paper in inches

rightMargin

private double rightMargin
The margin from the right hand side of the paper in inches

topMargin

private double topMargin
The margin from the top of the paper in inches

bottomMargin

private double bottomMargin
The margin from the bottom of the paper in inches

fitToPages

private boolean fitToPages
Indicates whether to fit the print to the pages or scale the output This field is manipulated indirectly by virtue of the setFitWidth/Height methods

showGridLines

private boolean showGridLines
Indicates whether grid lines should be displayed

displayZeroValues

private boolean displayZeroValues
Indicates whether the sheet should display zero values

password

private java.lang.String password
The password for protected sheets

passwordHash

private int passwordHash
The password hashcode - used when copying sheets

defaultColumnWidth

private int defaultColumnWidth
The default column width, in characters

defaultRowHeight

private int defaultRowHeight
The default row height, in 1/20th of a point

horizontalFreeze

private int horizontalFreeze
The horizontal freeze pane

verticalFreeze

private int verticalFreeze
The vertical freeze position

defaultOrientation

private static final PageOrientation defaultOrientation

defaultPaperSize

private static final PaperSize defaultPaperSize

defaultHeaderMargin

private static final double defaultHeaderMargin

defaultFooterMargin

private static final double defaultFooterMargin

defaultPrintResolution

private static final int defaultPrintResolution

defaultWidthMargin

private static final double defaultWidthMargin

defaultHeightMargin

private static final double defaultHeightMargin

defaultDefaultColumnWidth

private static final int defaultDefaultColumnWidth

defaultDefaultRowHeight

private static final int defaultDefaultRowHeight
Constructor Detail

SheetSettings

public SheetSettings()
Default constructor

SheetSettings

public SheetSettings(SheetSettings copy)
Copy constructor. Called when copying sheets
Parameters:
copy -  
Method Detail

setOrientation

public void setOrientation(PageOrientation po)
Sets the paper orientation for printing this sheet
Parameters:
po - the orientation

getOrientation

public PageOrientation getOrientation()
Accessor for the orientation
Returns:
the orientation

setPaperSize

public void setPaperSize(PaperSize ps)
Sets the paper size to be used when printing this sheet
Parameters:
ps - the paper size

getPaperSize

public PaperSize getPaperSize()
Accessor for the paper size
Returns:
the paper size

isProtected

public boolean isProtected()
Queries whether this sheet is protected (ie. read only)
Returns:
TRUE if this sheet is read only, FALSE otherwise

setProtected

public void setProtected(boolean p)
Sets the protected (ie. read only) status of this sheet
Parameters:
p - the protected status

setHeaderMargin

public void setHeaderMargin(double d)
Sets the margin for any page headers
Parameters:
d - the margin in inches

getHeaderMargin

public double getHeaderMargin()
Accessor for the header margin
Returns:
the header margin

setFooterMargin

public void setFooterMargin(double d)
Sets the margin for any page footer
Parameters:
d - the footer margin in inches

getFooterMargin

public double getFooterMargin()
Accessor for the footer margin
Returns:
the footer margin

setHidden

public void setHidden(boolean h)
Sets the hidden status of this worksheet
Parameters:
h - the hidden flag

isHidden

public boolean isHidden()
Accessor for the hidden nature of this sheet
Returns:
TRUE if this sheet is hidden, FALSE otherwise

setSelected

public void setSelected()
Sets this sheet to be when it is opened in excel

isSelected

public boolean isSelected()
Accessor for the selected nature of the sheet
Returns:
TRUE if this sheet is selected, FALSE otherwise

setScaleFactor

public void setScaleFactor(int sf)
Sets the scale factor for this sheet to be used when printing. The parameter is a percentage, therefore setting a scale factor of 100 will print at normal size, 50 half size, 200 double size etc
Parameters:
sf - the scale factor as a percentage

getScaleFactor

public int getScaleFactor()
Accessor for the scale factor
Returns:
the scale factor

setPageStart

public void setPageStart(int ps)
Sets the page number at which to commence printing
Parameters:
ps - the page start number

getPageStart

public int getPageStart()
Accessor for the page start
Returns:
the page start

setFitWidth

public void setFitWidth(int fw)
Sets the number of pages widthwise which this sheet should be printed into
Parameters:
fw - the number of pages

getFitWidth

public int getFitWidth()
Accessor for the fit width
Returns:
the number of pages this sheet will be printed into widthwise

setFitHeight

public void setFitHeight(int fh)
Sets the number of pages vertically that this sheet will be printed into
Parameters:
fh - the number of pages this sheet will be printed into heightwise

getFitHeight

public int getFitHeight()
Accessor for the fit height
Returns:
the number of pages this sheet will be printed into heightwise

setHorizontalPrintResolution

public void setHorizontalPrintResolution(int hpw)
Sets the horizontal print resolution
Parameters:
hpw -  

getHorizontalPrintResolution

public int getHorizontalPrintResolution()
Accessor for the horizontal print resolution
Returns:
the horizontal print resolution

setVerticalPrintResolution

public void setVerticalPrintResolution(int vpw)
Sets the vertical print reslution
Parameters:
vpw - the vertical print resolution

getVerticalPrintResolution

public int getVerticalPrintResolution()
Accessor for the vertical print resolution
Returns:
the vertical print resolution

setRightMargin

public void setRightMargin(double m)
Sets the right margin
Parameters:
m - the right margin in inches

getRightMargin

public double getRightMargin()
Accessor for the right margin
Returns:
the right margin in inches

setLeftMargin

public void setLeftMargin(double m)
Sets the left margin
Parameters:
m - the left margin in inches

getLeftMargin

public double getLeftMargin()
Accessor for the left margin
Returns:
the left margin in inches

setTopMargin

public void setTopMargin(double m)
Sets the top margin
Parameters:
m - the top margin in inches

getTopMargin

public double getTopMargin()
Accessor for the top margin
Returns:
the top margin in inches

setBottomMargin

public void setBottomMargin(double m)
Sets the bottom margin
Parameters:
m - the bottom margin in inches

getBottomMargin

public double getBottomMargin()
Accessor for the bottom margin
Returns:
the bottom margin in inches

getDefaultWidthMargin

public double getDefaultWidthMargin()
Gets the default margin width
Returns:
the default margin width

getDefaultHeightMargin

public double getDefaultHeightMargin()
Gets the default margin height
Returns:
the default margin height

getFitToPages

public boolean getFitToPages()
Accessor for the fit width print flag
Returns:
TRUE if the print is to fit to pages, false otherwise

setFitToPages

public void setFitToPages(boolean b)
Accessor for the fit to pages flag
Parameters:
b - TRUE to fit to pages, FALSE to use a scale factor

getPassword

public java.lang.String getPassword()
Accessor for the password
Returns:
the password to unlock this sheet, or NULL if not protected

setPassword

public void setPassword(java.lang.String s)
Sets the password for this sheet
Parameters:
pw - the password

getPasswordHash

public int getPasswordHash()
Accessor for the password hash - used only when copying sheets
Returns:
passwordHash

setPasswordHash

public void setPasswordHash(int ph)
Accessor for the password hash - used only when copying sheets
Parameters:
ph - the password hash

getDefaultColumnWidth

public int getDefaultColumnWidth()
Accessor for the default column width
Returns:
the default column width, in characters

setDefaultColumnWidth

public void setDefaultColumnWidth(int w)
Sets the default column width
Parameters:
w - the new default column width

getDefaultRowHeight

public int getDefaultRowHeight()
Accessor for the default row height
Returns:
the default row height, in 1/20ths of a point

setDefaultRowHeight

public void setDefaultRowHeight(int h)
Sets the default row height
Parameters:
h - the default row height, in 1/20ths of a point

getZoomFactor

public int getZoomFactor()
Accessor for the zoom factor. Do not confuse zoom factor (which relates to the on screen view) with scale factor (which refers to the scale factor when printing)
Returns:
the zoom factor as a percentage

setZoomFactor

public void setZoomFactor(int zf)
Sets the zoom factor. Do not confuse zoom factor (which relates to the on screen view) with scale factor (which refers to the scale factor when printing)
Parameters:
zf - the zoom factor as a percentage

getDisplayZeroValues

public boolean getDisplayZeroValues()
Accessor for the displayZeroValues property
Returns:
TRUE to display zero values, FALSE not to bother

setDisplayZeroValues

public void setDisplayZeroValues(boolean b)
Sets the displayZeroValues property
Parameters:
b - TRUE to show zero values, FALSE not to bother

getShowGridLines

public boolean getShowGridLines()
Accessor for the showGridLines property
Returns:
TRUE if grid lines will be shown, FALSE otherwise

setShowGridLines

public void setShowGridLines(boolean b)
Sets the showGridLines property
Parameters:
b - TRUE to show grid lines on this sheet, FALSE otherwise

getHorizontalFreeze

public int getHorizontalFreeze()
Gets the row at which the pane is frozen horizontally
Returns:
the row at which the pane is horizontally frozen, or 0 if there is no freeze

setHorizontalFreeze

public void setHorizontalFreeze(int row)
Sets the row at which the pane is frozen horizontally
Parameters:
row -  

getVerticalFreeze

public int getVerticalFreeze()
Gets the column at which the pane is frozen vertically
Returns:
the column at which the pane is vertically frozen, or 0 if there is no freeze

setVerticalFreeze

public void setVerticalFreeze(int col)
Sets the row at which the pane is frozen vertically
Parameters:
row -