public class HFPageFormat extends PageFormat implements Printable, Cloneable
LANDSCAPE, PORTRAIT, REVERSE_LANDSCAPE
NO_SUCH_PAGE, PAGE_EXISTS
Constructor and Description |
---|
HFPageFormat(PageFormat pf)
Create the HFPageFormat using existing PageFormat.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Makes a copy of this
HFPageFormat with the same
contents as this HFPageFormat . |
int |
getDescAreaHeight()
Get the height of the description area in
int . |
ArrayList |
getDescArray()
Get the description array.
|
Font |
getDescFont()
Get the font for the description area.
|
Font |
getFooterFont()
Get the footer font.
|
int |
getFooterHeight()
Get the height of the footer area in
int . |
Font |
getHeaderFont()
Get the header font.
|
int |
getHeaderHeight()
Get the height of the header area in
int . |
double |
getImageableHeight()
Override the member function of
PageFormat to provide the
header, footer and description area support. |
double |
getImageableY()
Override the member function of
PageFormat to provide the
header, footer and description area support. |
String |
getLeftFooterText()
Get the left footer text.
|
String |
getLeftHeaderText()
Get the left header text.
|
String |
getRightFooterText()
Get the right footer text.
|
String |
getRightHeaderText()
Get the right header text.
|
protected void |
paintDescriptionArea(Graphics g,
PageFormat format,
int pageIndex)
Print the description area.
|
protected void |
paintFooter(Graphics g,
PageFormat format,
int pageIndex)
Print the footer.
|
protected void |
paintHeader(Graphics g,
PageFormat format,
int pageIndex)
Print the header.
|
int |
print(Graphics g,
PageFormat format,
int pageIndex)
Draws the header, description text area and footer.
|
void |
setDescArray(ArrayList descList)
Set the description array which will be printed in the description area.
|
void |
setDescFont(Font f)
Set the description area font.
|
void |
setFooterFont(Font f)
Set the footer font.
|
void |
setHeaderFont(Font f)
Set the font for the header.
|
void |
setLeftFooterText(String text)
Set the left footer text.
|
void |
setLeftHeaderText(String text)
Set the header text at the left margin.
|
void |
setPageFormat(PageFormat pf)
Set the page format to print.
|
void |
setRightFooterText(String text)
Set the right footer text.
|
void |
setRightHeaderText(String text)
Set the right header text.
|
getHeight, getImageableWidth, getImageableX, getMatrix, getOrientation, getPaper, getWidth, setOrientation, setPaper
public HFPageFormat(PageFormat pf)
pf
- the existing PageFormat.public void setPageFormat(PageFormat pf)
pf
- the page format to print.public int print(Graphics g, PageFormat format, int pageIndex)
public Object clone()
HFPageFormat
with the same
contents as this HFPageFormat
.clone
in class PageFormat
HFPageFormat
.public double getImageableHeight()
PageFormat
to provide the
header, footer and description area support.getImageableHeight
in class PageFormat
double
.public double getImageableY()
PageFormat
to provide the
header, footer and description area support.getImageableY
in class PageFormat
double
.public int getHeaderHeight()
int
.public int getDescAreaHeight()
int
.public int getFooterHeight()
int
.public void setHeaderFont(Font f)
f
- the header font.public void setDescFont(Font f)
f
- the description font.public void setFooterFont(Font f)
f
- the footer font.public Font getHeaderFont()
public Font getDescFont()
public Font getFooterFont()
public void setLeftHeaderText(String text)
text
- the left header text.public void setRightHeaderText(String text)
text
- the right header text.public void setDescArray(ArrayList descList)
descList
- the Arraylist to be printed.public void setLeftFooterText(String text)
text
- the left footer text.public void setRightFooterText(String text)
text
- the right footer text.public String getLeftHeaderText()
public String getRightHeaderText()
public ArrayList getDescArray()
public String getLeftFooterText()
public String getRightFooterText()
protected void paintHeader(Graphics g, PageFormat format, int pageIndex)
g
- the graphics context.format
- the pageformat.pageIndex
- the page index starting from 0.protected void paintDescriptionArea(Graphics g, PageFormat format, int pageIndex)
g
- the graphics context.format
- the PageFormat to print.pageIndex
- the page index.protected void paintFooter(Graphics g, PageFormat format, int pageIndex)
g
- the graphics context.format
- the PageFormat to print.pageIndex
- the page index.Copyright © 2003, 2023, Oracle and/or its affiliates.