|
||||||||||
| PREV CLASS Documentation homepage. NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.util.print.IlvPrintingController
public class IlvPrintingController
The IlvPrintingController is the root object of the print framework.
It is designed to manage various printing tasks. It is the
root from which you can perform different print actions. You can invoke
different dialog boxes to change various printing parameters.
It is designed to manage the following objects:
IlvPrintableDocument, which defines the contents to
be printed.IlvPrintPreviewDialog, which can be used to preview the
contents to be printed.PrinterJob, which is used to print the contents.
The IlvPrintingController has two methods, printDialog()
and print(), which you can use to change the printer
settings and to print the associated IlvPrintableDocument.
IlvPrintableDocument,
IlvPrintPreviewDialog,
print(boolean)| Constructor Summary | |
|---|---|
IlvPrintingController(IlvPrintableDocument document)
Creates a IlvPrintingController for the specified
IlvPrintableDocument. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
Adds a listener to listen to the modification of all properties |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener propertyChangeListener)
Adds a listener to listen to the modification of the specified property. |
protected Window |
createPrintPreviewWindow(Window owner)
Creates the IlvPrintPreviewDialog for previewing the associated
IlvPrintableDocument. |
protected IlvDocumentSetupDialog |
createSetupDialog(Window owner,
boolean printButton,
boolean printPreviewButton)
Creates the dialog box used to edit the parameters of a document. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
Fires a 'PropertyChangeEvent' event for the specified property. |
ComponentOrientation |
getComponentOrientation()
Returns the language-sensitive orientation of the dialogs managed by this controller. |
IlvPrintableDocument |
getDocument()
Returns the IlvPrintableDocument to be printed. |
int |
getPreviewMode()
Returns the mode of the IlvPrintPreviewPanel created by
createPrintPreviewWindow(java.awt.Window). |
PrinterJob |
getPrinterJob()
Gets the PrinterJob if it is already created. |
void |
pageDialog()
This function shows a page format dialog box that allows users to change the page format of the associated IlvPrintableDocument. |
void |
print(boolean showPrintDialog)
Prints the document. |
boolean |
printDialog()
Opens a dialog box for changes the setting of the associated PrinterJob. |
void |
printPreview(Window owner)
Opens a Print Preview dialog box. |
void |
removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
Removes a listener so that it no longer listens to the modification of the properties. |
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener propertyChangeListener)
Removes a listener so that it no longer listens to the modification of the specified property. |
void |
setComponentOrientation(ComponentOrientation o)
Sets the language-sensitive orientation of the dialogs managed by this controller. |
void |
setDocument(IlvPrintableDocument document)
Changes the IlvPrintableDocument to be printed. |
void |
setLookAndFeel(UIManager.LookAndFeelInfo laf)
Updates the look & feel of the dialogs managed by this controller. |
void |
setPreviewMode(int mode)
Changes the mode of the IlvPrintPreviewPanel created by
createPrintPreviewWindow(java.awt.Window). |
void |
setupDialog(Window owner,
boolean printButton,
boolean previewButton)
Opens the dialog box used to edit the parameters of a document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IlvPrintingController(IlvPrintableDocument document)
IlvPrintingController for the specified
IlvPrintableDocument.
document - The IlvPrintableDocument that defines the contents
to be printed.| Method Detail |
|---|
public IlvPrintableDocument getDocument()
IlvPrintableDocument to be printed.
IlvPrintableDocument that defines the contents
to be printed.public void setDocument(IlvPrintableDocument document)
IlvPrintableDocument to be printed. This method refreshes
the preview of the document if it is visible.
document - The document that defines the contents to be printed.public void printPreview(Window owner)
setPreviewMode(int),
createPrintPreviewWindow(java.awt.Window)public int getPreviewMode()
IlvPrintPreviewPanel created by
createPrintPreviewWindow(java.awt.Window). The mode can be one of
IlvPrintPreviewPanel.SINGLE_PAGE_MODE or
IlvPrintPreviewPanel.CONTINUOUS_MODE. The default mode is
IlvPrintPreviewPanel.SINGLE_PAGE_MODE.
printPreview(java.awt.Window)public void setPreviewMode(int mode)
IlvPrintPreviewPanel created by
createPrintPreviewWindow(java.awt.Window). The mode can be one of
IlvPrintPreviewPanel.SINGLE_PAGE_MODE or
IlvPrintPreviewPanel.CONTINUOUS_MODE. The method must be called before the
printPreview(java.awt.Window) method is called.
printPreview(java.awt.Window)protected Window createPrintPreviewWindow(Window owner)
IlvPrintPreviewDialog for previewing the associated
IlvPrintableDocument. This method can be overridden by subclasses
if you want to customize the preview dialog. The preview mode
is defined by the method setPreviewMode(int).
IlvPrintPreviewDialog object.public PrinterJob getPrinterJob()
PrinterJob if it is already created. Otherwise,
a PrinterJob will be created. This
PrinterJob is used to change the printer settings and
to print the IlvPrintableDocument.
PrinterJob used to print the contents.print(boolean)public boolean printDialog()
PrinterJob. Call print()
to print the associated IlvPrintableDocument.
true is the dialog was validated or falseSee Also:print(boolean),
getPrinterJob()
protected IlvDocumentSetupDialog createSetupDialog(Window owner,
boolean printButton,
boolean printPreviewButton)
owner - The owner of the dialog.printButton - Indicates if a button must be added to
the dialog to print the content of the document.printPreviewButton - Indicates if a button must be added
to the dialog to open the 'Print Preview' dialog.
public void setupDialog(Window owner,
boolean printButton,
boolean previewButton)
owner - The owner of the dialog.printButton - Indicates if a button must be added to
the dialog to print the content of the document.previewButton - Indicates if a button must be added
to the dialog to open the 'Print Preview' dialog.public void pageDialog()
IlvPrintableDocument. This
function uses the associated PrinterJob and invokes
its pageDialog method to open the page dialog. Note that
you should better use the setupDialog(java.awt.Window, boolean, boolean) method that opens
a dialog that allows to change the page format and the header and footer.
public void print(boolean showPrintDialog)
throws PrinterException
print
method of the associated PrinterJob.
showPrintDialog - When True the dialog that allows to
choose a printer and set printer parameters will be shown before printing.
PrinterException - an error in the print system caused
the job to be aborted.getPrinterJob()
protected void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
propertyName - The name of the property.oldValue - The old value of the property.newValue - The new value of the property.
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener propertyChangeListener)
propertyName - The name of the property.propertyChangeListener - The listener.public void addPropertyChangeListener(PropertyChangeListener propertyChangeListener)
propertyChangeListener - The listener.
public void removePropertyChangeListener(String propertyName,
PropertyChangeListener propertyChangeListener)
propertyName - The name of the property.propertyChangeListener - The listener.public void removePropertyChangeListener(PropertyChangeListener propertyChangeListener)
propertyChangeListener - The listener.public void setLookAndFeel(UIManager.LookAndFeelInfo laf)
laf - The look & feel.public ComponentOrientation getComponentOrientation()
public void setComponentOrientation(ComponentOrientation o)
|
||||||||||
| PREV CLASS Documentation homepage. NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||