public final class PageSettingsBlock extends RecordAggregate
RecordAggregate.PositionTrackingVisitor, RecordAggregate.RecordVisitor
Constructor and Description |
---|
PageSettingsBlock()
Creates a PageSettingsBlock with default settings
|
PageSettingsBlock(RecordStream rs) |
Modifier and Type | Method and Description |
---|---|
void |
addLateHeaderFooter(HeaderFooterRecord rec)
HEADERFOOTER is new in 2007.
|
void |
addLateRecords(RecordStream rs)
This method reads PageSettingsBlock records from the supplied RecordStream until the first
non-PageSettingsBlock record is encountered.
|
int[] |
getColumnBreaks() |
String |
getEvenFooter() |
String |
getEvenHeader() |
String |
getFirstFooter() |
String |
getFirstHeader() |
FooterRecord |
getFooter()
Returns the FooterRecord.
|
HCenterRecord |
getHCenter() |
HeaderRecord |
getHeader()
Returns the HeaderRecord.
|
double |
getMargin(short margin)
Gets the size of the margin in inches.
|
int |
getNumColumnBreaks() |
int |
getNumRowBreaks() |
PrintSetupRecord |
getPrintSetup()
Returns the PrintSetupRecord.
|
int[] |
getRowBreaks() |
VCenterRecord |
getVCenter() |
boolean |
isAlignMargins() |
boolean |
isColumnBroken(int column)
Queries if the specified column has a page break
|
static boolean |
isComponentRecord(int sid) |
boolean |
isDiffFirst() |
boolean |
isDiffOddEven() |
boolean |
isRowBroken(int row)
Queries if the specified row has a page break
|
boolean |
isScaleWithDoc() |
void |
positionRecords(List<RecordBase> sheetRecords)
Some apps can define multiple HeaderFooterRecord records for a sheet.
|
void |
removeColumnBreak(int column)
Removes a page break at the indicated column
|
void |
removeRowBreak(int row)
Removes a page break at the indicated row
|
void |
setAlignMargins(boolean flag) |
void |
setColumnBreak(short column,
short fromRow,
short toRow)
Sets a page break at the indicated column
|
void |
setDiffFirst(boolean flag) |
void |
setDiffOddEven(boolean flag) |
void |
setEvenFooter(String str) |
void |
setEvenHeader(String str) |
void |
setFirstFooter(String str) |
void |
setFirstHeader(String str) |
void |
setFooter(FooterRecord newFooter)
Sets the FooterRecord.
|
void |
setHeader(HeaderRecord newHeader)
Sets the HeaderRecord.
|
void |
setMargin(short margin,
double size)
Sets the size of the margin in inches.
|
void |
setPrintSetup(PrintSetupRecord newPrintSetup)
Sets the PrintSetupRecord.
|
void |
setRowBreak(int row,
short fromCol,
short toCol)
Sets a page break at the indicated row
|
void |
setScaleWithDoc(boolean flag) |
void |
shiftColumnBreaks(short startingCol,
short endingCol,
short count)
Shifts the vertical page breaks for the indicated count
|
void |
shiftRowBreaks(int startingRow,
int endingRow,
int count)
Shifts the horizontal page breaks for the indicated count
|
void |
visitContainedRecords(RecordAggregate.RecordVisitor rv)
Visit each of the atomic BIFF records contained in this
RecordAggregate in the order
that they should be written to file. |
getRecordSize, serialize
public PageSettingsBlock(RecordStream rs)
public PageSettingsBlock()
public static boolean isComponentRecord(int sid)
true
if the specified Record sid is one belonging to the
'Page Settings Block'.public void setColumnBreak(short column, short fromRow, short toRow)
public void removeColumnBreak(int column)
public void visitContainedRecords(RecordAggregate.RecordVisitor rv)
RecordAggregate
RecordAggregate
in the order
that they should be written to file. Implementors may or may not return the actual
Record
s being used to manage POI's internal implementation. Callers should not
assume either way, and therefore only attempt to modify those Record
s after cloningvisitContainedRecords
in class RecordAggregate
public HeaderRecord getHeader()
public void setHeader(HeaderRecord newHeader)
newHeader
- The new HeaderRecord for the sheet.public FooterRecord getFooter()
public void setFooter(FooterRecord newFooter)
newFooter
- The new FooterRecord for the sheet.public PrintSetupRecord getPrintSetup()
public void setPrintSetup(PrintSetupRecord newPrintSetup)
newPrintSetup
- The new PrintSetupRecord for the sheet.public double getMargin(short margin)
margin
- which margin to getpublic void setMargin(short margin, double size)
margin
- which margin to getsize
- the size of the marginpublic void setRowBreak(int row, short fromCol, short toCol)
row
- public void removeRowBreak(int row)
row
- public boolean isRowBroken(int row)
row
- public boolean isColumnBroken(int column)
true
if the specified column has a page breakpublic void shiftRowBreaks(int startingRow, int endingRow, int count)
startingRow
- endingRow
- count
- public void shiftColumnBreaks(short startingCol, short endingCol, short count)
startingCol
- endingCol
- count
- public int[] getRowBreaks()
null
public int getNumRowBreaks()
public int[] getColumnBreaks()
null
public int getNumColumnBreaks()
public VCenterRecord getVCenter()
public HCenterRecord getHCenter()
public void addLateHeaderFooter(HeaderFooterRecord rec)
PageSettingsBlock
where it belongs.public void addLateRecords(RecordStream rs)
RecordFormatException
- if any PSB record encountered has the same type (sid) as
a record that is already part of this PageSettingsBlockpublic void positionRecords(List<RecordBase> sheetRecords)
sheetRecords
- the list of sheet records read so farpublic boolean isDiffOddEven()
public void setDiffOddEven(boolean flag)
public boolean isDiffFirst()
public void setDiffFirst(boolean flag)
public boolean isScaleWithDoc()
public void setScaleWithDoc(boolean flag)
public boolean isAlignMargins()
public void setAlignMargins(boolean flag)
public String getEvenHeader()
public void setEvenHeader(String str)
public String getEvenFooter()
public void setEvenFooter(String str)
public String getFirstHeader()
public void setFirstHeader(String str)
public String getFirstFooter()
public void setFirstFooter(String str)
Copyright © 2020. All rights reserved.