|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.utils.swing.printing.PrintHeaderFooter
public class PrintHeaderFooter
Specifies header and footer for printed output.
A printed page may have an optional header and/or footer. Optionally labeled page numbers may appear in the header, footer, or both.
Field Summary | |
---|---|
protected java.lang.String |
footer
Footer text. |
static int |
FOOTER
|
protected java.awt.Font |
footerFont
Footer font. |
protected java.lang.String |
header
Header text. |
static int |
HEADER
Possible page number positions. |
static int |
HEADERANDFOOTER
|
protected java.awt.Font |
headerFont
Header font. |
protected java.lang.String |
pageNumberLabel
Page number label. |
(package private) int |
pageNumberLocation
Page number position. |
Constructor Summary | |
---|---|
PrintHeaderFooter(java.lang.String header,
java.lang.String footer,
java.lang.String pageNumberLabel)
Create PrintHeaderFooter. |
Method Summary | |
---|---|
boolean |
doPageNumbersInFooter()
See if we're to print page numbers in footer. |
boolean |
doPageNumbersInHeader()
See if we're to print page numbers in header. |
boolean |
doPrintFooter()
See if footer to be printed. |
boolean |
doPrintHeader()
See if header to be printed. |
java.awt.Font |
getFooterFont()
Get footer font. |
int |
getFooterFontSize()
Get footer font size. |
int |
getFooterFontSize(java.awt.Graphics graphics)
Get footer font size from specified graphics context. |
java.awt.Font |
getHeaderFont()
Get header font. |
int |
getHeaderFontSize()
Get header font size. |
int |
getHeaderFontSize(java.awt.Graphics graphics)
Get header font size from specified graphics context. |
int |
getPageNumberLocation()
Get page number location. |
void |
printHeaderAndFooter(java.awt.Graphics graphics,
int pageNumber,
int pageWidth,
int pageBottom)
Print header and footer into specified graphics context. |
void |
setFooterFont(java.awt.Font footerFont)
Set footer font. |
void |
setHeaderFont(java.awt.Font headerFont)
Set header font. |
void |
setPageNumberLocation(int pageNumberLocation)
Set page number location. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String header
protected java.lang.String footer
protected java.lang.String pageNumberLabel
public static final int HEADER
public static final int FOOTER
public static final int HEADERANDFOOTER
int pageNumberLocation
protected java.awt.Font headerFont
protected java.awt.Font footerFont
Constructor Detail |
---|
public PrintHeaderFooter(java.lang.String header, java.lang.String footer, java.lang.String pageNumberLabel)
header
- Header text. Use null for none.footer
- Footer text. Use null for none.pageNumberLabel
- Label for page numbers (e.g., "Page ").
Use null for no page numbers,
empty string to print page numbers
without a label. Method Detail |
---|
public boolean doPageNumbersInHeader()
public boolean doPageNumbersInFooter()
public java.awt.Font getHeaderFont()
public void setHeaderFont(java.awt.Font headerFont)
headerFont
- Font used to print header. public java.awt.Font getFooterFont()
public void setFooterFont(java.awt.Font footerFont)
footerFont
- Font used to print footer. public int getHeaderFontSize()
public int getHeaderFontSize(java.awt.Graphics graphics)
Note: sets header font as current font in graphics context.
public int getFooterFontSize()
public int getFooterFontSize(java.awt.Graphics graphics)
Note: sets footer font as current font in graphics context.
public int getPageNumberLocation()
public void setPageNumberLocation(int pageNumberLocation)
pageNumberLocation
- Location to print page numbers.
Either HEADER, FOOTER, or
HEADERANDFOOTER.
If the specified location is invalid, the current setting remains unchanged.
public boolean doPrintHeader()
public boolean doPrintFooter()
public void printHeaderAndFooter(java.awt.Graphics graphics, int pageNumber, int pageWidth, int pageBottom)
graphics
- Graphics context to print to.pageNumber
- The page number to print.pageWidth
- The printer page width.pageBottom
- Bottom page position used for
document printing. Footer prints
below this.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |