Package jxl
Class SheetSettings
- java.lang.Object
-
- jxl.SheetSettings
-
public final class SheetSettings extends java.lang.ObjectThis 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
Fields Modifier and Type Field Description static intDEFAULT_DEFAULT_ROW_HEIGHTThe default value for the default row height
-
Constructor Summary
Constructors Constructor Description SheetSettings(Sheet s)Default constructorSheetSettings(SheetSettings copy, Sheet s)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleangetAutomaticFormulaCalculation()Retrieves the automatic formula calculation flagdoublegetBottomMargin()Accessor for the bottom marginintgetCopies()Accessor for the number of copies to printintgetDefaultColumnWidth()Accessor for the default column widthdoublegetDefaultHeightMargin()Gets the default margin heightintgetDefaultRowHeight()Accessor for the default row heightdoublegetDefaultWidthMargin()Gets the default margin widthbooleangetDisplayZeroValues()Accessor for the displayZeroValues propertyintgetFitHeight()Accessor for the fit heightbooleangetFitToPages()Accessor for the fit width print flagintgetFitWidth()Accessor for the fit widthHeaderFootergetFooter()Accessor for the footerdoublegetFooterMargin()Accessor for the footer marginHeaderFootergetHeader()Accessor for the headerdoublegetHeaderMargin()Accessor for the header marginintgetHorizontalFreeze()Gets the row at which the pane is frozen horizontallyintgetHorizontalPrintResolution()Accessor for the horizontal print resolutiondoublegetLeftMargin()Accessor for the left marginintgetNormalMagnification()Accessor for the nomral view magnificaton factor.PageOrientationgetOrientation()Accessor for the orientationintgetPageBreakPreviewMagnification()Accessor for the page break preview mangificaton factor.booleangetPageBreakPreviewMode()Accessor for the pageBreakPreview modePageOrdergetPageOrder()Accessor for the orderintgetPageStart()Accessor for the page startPaperSizegetPaperSize()Accessor for the paper sizejava.lang.StringgetPassword()Accessor for the passwordintgetPasswordHash()Accessor for the password hash - used only when copying sheetsRangegetPrintArea()Accessor for the print areabooleangetPrintGridLines()Accessor for the printGridLines propertybooleangetPrintHeaders()Accessor for the printHeaders propertyRangegetPrintTitlesCol()Accessor for the print column titlesRangegetPrintTitlesRow()Accessor for the print row titlesbooleangetRecalculateFormulasBeforeSave()Retrieves the recalculate formulas before save flagdoublegetRightMargin()Accessor for the right marginintgetScaleFactor()Accessor for the scale factorbooleangetShowGridLines()Accessor for the showGridLines propertydoublegetTopMargin()Accessor for the top marginintgetVerticalFreeze()Gets the column at which the pane is frozen verticallyintgetVerticalPrintResolution()Accessor for the vertical print resolutionintgetZoomFactor()Accessor for the zoom factor.booleanisHidden()Accessor for the hidden nature of this sheetbooleanisHorizontalCentre()Accessor for the horizontal centrebooleanisProtected()Queries whether this sheet is protected (ie.booleanisSelected()Accessor for the selected nature of the sheetbooleanisVerticalCentre()Accessor for the vertical centrevoidsetAutomaticFormulaCalculation(boolean auto)Sets the automatic formula calculation flagvoidsetBottomMargin(double m)Sets the bottom marginvoidsetCopies(int c)Sets the number of copiesvoidsetDefaultColumnWidth(int w)Sets the default column widthvoidsetDefaultRowHeight(int h)Sets the default row heightvoidsetDisplayZeroValues(boolean b)Sets the displayZeroValues propertyvoidsetFitHeight(int fh)Sets the number of pages vertically that this sheet will be printed intovoidsetFitToPages(boolean b)Accessor for the fit to pages flagvoidsetFitWidth(int fw)Sets the number of pages widthwise which this sheet should be printed intovoidsetFooter(HeaderFooter f)Sets the footervoidsetFooterMargin(double d)Sets the margin for any page footervoidsetHeader(HeaderFooter h)Sets the headervoidsetHeaderMargin(double d)Sets the margin for any page headersvoidsetHidden(boolean h)Sets the hidden status of this worksheetvoidsetHorizontalCentre(boolean horizCentre)Sets the horizontal centrevoidsetHorizontalFreeze(int row)Sets the row at which the pane is frozen horizontallyvoidsetHorizontalPrintResolution(int hpw)Sets the horizontal print resolutionvoidsetLeftMargin(double m)Sets the left marginvoidsetNormalMagnification(int f)Accessor for the normal magnificaton factor.voidsetOrientation(PageOrientation po)Sets the paper orientation for printing this sheetvoidsetPageBreakPreviewMagnification(int f)Accessor for the page break preview magnificaton factor.voidsetPageBreakPreviewMode(boolean b)Sets the pageBreakPreviewMode propertyvoidsetPageOrder(PageOrder order)Sets the page order for printing this sheetvoidsetPageStart(int ps)Sets the page number at which to commence printingvoidsetPaperSize(PaperSize ps)Sets the paper size to be used when printing this sheetvoidsetPassword(java.lang.String s)Sets the password for this sheetvoidsetPasswordHash(int ph)Accessor for the password hash - used only when copying sheetsvoidsetPrintArea(int firstCol, int firstRow, int lastCol, int lastRow)Sets the print area for this sheetvoidsetPrintGridLines(boolean b)Sets the printGridLines propertyvoidsetPrintHeaders(boolean b)Sets the printHeaders propertyvoidsetPrintTitles(int firstRow, int lastRow, int firstCol, int lastCol)Sets both of the print titles for this sheetvoidsetPrintTitlesCol(int firstCol, int lastCol)Sets the print column titles for this sheetvoidsetPrintTitlesRow(int firstRow, int lastRow)Sets the print row titles for this sheetvoidsetProtected(boolean p)Sets the protected (ie.voidsetRecalculateFormulasBeforeSave(boolean recalc)Sets the recalculate formulas when the sheet is saved flagvoidsetRightMargin(double m)Sets the right marginvoidsetScaleFactor(int sf)Sets the scale factor for this sheet to be used when printing.voidsetSelected()Deprecated.use overloaded version which takes a booleanvoidsetSelected(boolean s)Sets this sheet to be when it is opened in excelvoidsetShowGridLines(boolean b)Sets the showGridLines propertyvoidsetTopMargin(double m)Sets the top marginvoidsetVerticalCentre(boolean vertCentre)Sets the vertical centrevoidsetVerticalFreeze(int col)Sets the row at which the pane is frozen verticallyvoidsetVerticalPrintResolution(int vpw)Sets the vertical print reslutionvoidsetZoomFactor(int zf)Sets the zoom factor.
-
-
-
Field Detail
-
DEFAULT_DEFAULT_ROW_HEIGHT
public static final int DEFAULT_DEFAULT_ROW_HEIGHT
The default value for the default row height- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SheetSettings
public SheetSettings(Sheet s)
Default constructor
-
SheetSettings
public SheetSettings(SheetSettings copy, Sheet s)
Copy constructor. Called when copying sheets- Parameters:
copy- the settings to 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
-
getPageOrder
public PageOrder getPageOrder()
Accessor for the order- Returns:
-
setPageOrder
public void setPageOrder(PageOrder order)
Sets the page order for printing this sheet- Parameters:
order-
-
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()
Deprecated.use overloaded version which takes a booleanSets this sheet to be when it is opened in excel
-
setSelected
public void setSelected(boolean s)
Sets this sheet to be when it is opened in excel- Parameters:
s- sets whether this sheet is selected or not
-
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- the print resolution
-
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:
s- 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
-
getPageBreakPreviewMagnification
public int getPageBreakPreviewMagnification()
Accessor for the page break preview mangificaton factor. Do not confuse zoom factor or scale factor- Returns:
- the page break preview magnification a percentage
-
setPageBreakPreviewMagnification
public void setPageBreakPreviewMagnification(int f)
Accessor for the page break preview magnificaton factor. Do not confuse zoom factor or scale factor- Parameters:
f- the page break preview magnification as a percentage
-
getNormalMagnification
public int getNormalMagnification()
Accessor for the nomral view magnificaton factor. Do not confuse zoom factor or scale factor- Returns:
- the page break preview magnification a percentage
-
setNormalMagnification
public void setNormalMagnification(int f)
Accessor for the normal magnificaton factor. Do not confuse zoom factor or scale factor- Parameters:
f- the page break preview magnification 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
-
getPageBreakPreviewMode
public boolean getPageBreakPreviewMode()
Accessor for the pageBreakPreview mode- Returns:
- TRUE if page break preview is enabled, FALSE otherwise
-
setPageBreakPreviewMode
public void setPageBreakPreviewMode(boolean b)
Sets the pageBreakPreviewMode property- Parameters:
b- TRUE to launch in page break preview mode, FALSE otherwise
-
getPrintGridLines
public boolean getPrintGridLines()
Accessor for the printGridLines property- Returns:
- TRUE if grid lines will be printed, FALSE otherwise
-
setPrintGridLines
public void setPrintGridLines(boolean b)
Sets the printGridLines property- Parameters:
b- TRUE to print grid lines on this sheet, FALSE otherwise
-
getPrintHeaders
public boolean getPrintHeaders()
Accessor for the printHeaders property- Returns:
- TRUE if headers will be printed, FALSE otherwise
-
setPrintHeaders
public void setPrintHeaders(boolean b)
Sets the printHeaders property- Parameters:
b- TRUE to print headers 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- the row number to freeze at
-
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:
col- the column number to freeze at
-
setCopies
public void setCopies(int c)
Sets the number of copies- Parameters:
c- the number of copies
-
getCopies
public int getCopies()
Accessor for the number of copies to print- Returns:
- the number of copies
-
getHeader
public HeaderFooter getHeader()
Accessor for the header- Returns:
- the header
-
setHeader
public void setHeader(HeaderFooter h)
Sets the header- Parameters:
h- the header
-
setFooter
public void setFooter(HeaderFooter f)
Sets the footer- Parameters:
f- the footer
-
getFooter
public HeaderFooter getFooter()
Accessor for the footer- Returns:
- the footer
-
isHorizontalCentre
public boolean isHorizontalCentre()
Accessor for the horizontal centre- Returns:
- Returns the horizontalCentre.
-
setHorizontalCentre
public void setHorizontalCentre(boolean horizCentre)
Sets the horizontal centre- Parameters:
horizCentre- The horizontalCentre to set.
-
isVerticalCentre
public boolean isVerticalCentre()
Accessor for the vertical centre- Returns:
- Returns the verticalCentre.
-
setVerticalCentre
public void setVerticalCentre(boolean vertCentre)
Sets the vertical centre- Parameters:
vertCentre- The verticalCentre to set.
-
setAutomaticFormulaCalculation
public void setAutomaticFormulaCalculation(boolean auto)
Sets the automatic formula calculation flag- Parameters:
auto- - TRUE to automatically calculate the formulas, FALSE otherwise
-
getAutomaticFormulaCalculation
public boolean getAutomaticFormulaCalculation()
Retrieves the automatic formula calculation flag- Returns:
- TRUE if formulas are calculated automatically, FALSE if they are calculated manually
-
setRecalculateFormulasBeforeSave
public void setRecalculateFormulasBeforeSave(boolean recalc)
Sets the recalculate formulas when the sheet is saved flag- Parameters:
recalc- - TRUE to automatically calculate the formulas when the, spreadsheet is saved, FALSE otherwise
-
getRecalculateFormulasBeforeSave
public boolean getRecalculateFormulasBeforeSave()
Retrieves the recalculate formulas before save flag- Returns:
- TRUE if formulas are calculated before the sheet is saved, FALSE otherwise
-
setPrintArea
public void setPrintArea(int firstCol, int firstRow, int lastCol, int lastRow)Sets the print area for this sheet- Parameters:
firstCol- the first column of the print areafirstRow- the first row of the print arealastCol- the last column of the print arealastRow- the last row of the print area
-
getPrintArea
public Range getPrintArea()
Accessor for the print area- Returns:
- the print area, or NULL if one is not defined for this sheet
-
setPrintTitles
public void setPrintTitles(int firstRow, int lastRow, int firstCol, int lastCol)Sets both of the print titles for this sheet- Parameters:
firstRow- the first row of the print row titleslastRow- the last row of the print row titlesfirstCol- the first column of the print column titleslastCol- the last column of the print column titles
-
setPrintTitlesRow
public void setPrintTitlesRow(int firstRow, int lastRow)Sets the print row titles for this sheet- Parameters:
firstRow- the first row of the print titleslastRow- the last row of the print titles
-
setPrintTitlesCol
public void setPrintTitlesCol(int firstCol, int lastCol)Sets the print column titles for this sheet- Parameters:
firstRow- the first row of the print titleslastRow- the last row of the print titles
-
getPrintTitlesRow
public Range getPrintTitlesRow()
Accessor for the print row titles- Returns:
- the print row titles, or NULL if one is not defined for this sheet
-
getPrintTitlesCol
public Range getPrintTitlesCol()
Accessor for the print column titles- Returns:
- the print column titles, or NULL if one is not defined for this sheet
-
-