public class PrintManager extends Object
Constructor and Description |
---|
PrintManager()
Constructs a print manager object that can be assigned a printable component
by calling the setPrintable method.
|
PrintManager(JComponent comp)
Constructs a print manager object to handle printing of the specified component.
|
PrintManager(PrintableArrayList aList)
Constructs a print manager object to handle printing of the ArrayList.
|
Modifier and Type | Method and Description |
---|---|
protected Book |
createBook(JComponent compToPrint,
HFPageFormat pf) |
void |
executePrinting()
Executes the printing operation.
|
void |
executePrinting(JComponent waitComp)
Executes the printing operation.
|
static String |
getDateAndTime()
Retrieves the date and time of the current locale.
|
boolean |
getDateAndTimeStatus()
Retrieves the boolean status of date and time.
|
int |
getFormattedPagesCount(JComponent jc,
PageFormat pf)
Computes and returns the number of printing pages based on the printable
component height and the imageable height of the page.
|
boolean |
getPageNumbersStatus()
Retrieves the boolean status of page numbers.
|
void |
setDescArray(ArrayList descList) |
void |
setLeftPageHeader(String header)
The header will be printed at north west corner of each page.
|
void |
setPageFormat(HFPageFormat pf) |
void |
setPreviewDialogParent(JFrame frame)
Assigns the specified parent frame for the preview dialog.
|
void |
setPrintable(JComponent comp)
Assigns a printable component to the print manager.
|
void |
setPrintable(PrintableArrayList aList)
Assigns an ArrayList to the print manager.
|
void |
setRightPageHeader(String header)
The header will be printed at north east corner of each page.
|
void |
showDateAndTime(boolean b)
Displays date and time on the printable page.
|
void |
showPageNumbers(boolean b)
Displays page numbers on the printable page.
|
void |
showPageSetup()
Displays the page setup dialog.
|
void |
showPreview()
Displays the preview dialog.
|
public PrintManager()
public PrintManager(JComponent comp)
comp
- printable componentpublic PrintManager(PrintableArrayList aList)
aList
- printable ArrayListpublic void setPageFormat(HFPageFormat pf)
public void setPrintable(JComponent comp)
comp
- printable componentpublic void setPrintable(PrintableArrayList aList)
aList
- printable ArrayListpublic int getFormattedPagesCount(JComponent jc, PageFormat pf)
compToPrint
- the printable componentpf
- specified page formatpublic void executePrinting() throws NullPrintableException
NullPrintableException
- if the printable component is nullpublic void executePrinting(JComponent waitComp) throws NullPrintableException
panel
- panel on which to set wait cursor during print preparationNullPrintableException
- if the printable component is nullprotected Book createBook(JComponent compToPrint, HFPageFormat pf)
public void setLeftPageHeader(String header)
header
- the text to print.public void setRightPageHeader(String header)
header
- the text to print.public void setDescArray(ArrayList descList)
public void showPageSetup()
public void showPreview() throws NullPrintableException
NullPrintableException
- if the printable component is nullpublic void showDateAndTime(boolean b)
b
- show date and time (true), or not (false)public void showPageNumbers(boolean b)
b
- show page numbers (true), or not (false)public boolean getPageNumbersStatus()
public boolean getDateAndTimeStatus()
public static String getDateAndTime()
public void setPreviewDialogParent(JFrame frame)
frame
- any specific frame to attach the preview dialogCopyright © 2003, 2023, Oracle and/or its affiliates.