|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.views.util.print.IlvPrintableDocument
ilog.views.print.IlvManagerPrintableDocument
public class IlvManagerPrintableDocument
A Document subclass for printing the content
of an IlvManager. This class allows you to specify
an area of the IlvManager that must be printed.
This area can be printed in several pages. The pages are
specified either by defining the number of rows or the
number of columns. This object will automatically create the
appropriate number of pages according to the area, the number
of rows and columns and the page format. If both the number
of rows and columns are specified, then the object will take
into account only the value that results in the
minimum number of pages. To print the area in one page, you
may set the number of rows and the number of columns to 1.
| Field Summary |
|---|
| Fields inherited from class ilog.views.util.print.IlvPrintableDocument |
|---|
ORDERED_BY_COLUMNS, ORDERED_BY_ROWS |
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Fields inherited from interface java.awt.print.Pageable |
|---|
UNKNOWN_NUMBER_OF_PAGES |
| Constructor Summary | |
|---|---|
IlvManagerPrintableDocument(String name,
IlvManagerView view)
Creates a ManagerDocument for the specified manager view. |
|
IlvManagerPrintableDocument(String name,
IlvManagerView view,
PageFormat pageFormat)
Creates a ManagerDocument for the specified
manager view and page format. |
|
| Method Summary | |
|---|---|
protected IlvManagerPageBreakPreview |
createPageBreakPreview()
Creates an IlvManagerPageBreakPreview for
previewing the pages in the view that corresponds to this
document. |
protected IlvPage[] |
createPages()
Creates the pages of this document. |
protected IlvPrintableManagerArea |
createPrintableManagerArea(IlvUnit.Rectangle pageArea,
IlvRect managerArea)
Creates a new IlvPrintableManagerArea. |
int |
getColumnCount()
Returns the number of columns of pages in this document. |
IlvFlow |
getFlow()
Overwrites the method to disable the usage of the flow in this type of document. |
double |
getMaximumZoomLevel()
Returns the maximum zoom level that can be used for printing. |
double |
getMinimumZoomLevel()
Returns the minimum zoom level that can be used for printing. |
IlvRect |
getPrintArea()
Returns the area of the manager that is printed. |
IlvRect |
getPrintArea(int pageIndex)
Returns the area of the manager that is printed in the specified page. |
int |
getRowCount()
Returns the number of rows of pages in this document. |
IlvRect |
getTotalManagerPrintableArea()
Returns the total area of the manager to be printed. |
IlvManagerView |
getView()
Returns the manager view used when creating the document. |
double |
getZoomLevel()
Returns the zoom level used when printing. |
IlvTransformer |
getZoomTransformer()
Returns the zoom transformer used when printing. |
boolean |
isAutomaticZoomLevel()
Returns true if the automatic zoom level calculation is
enabled. |
boolean |
isPrintingAllManagerBBox()
Returns true if the area to be printed
is the total area of the manager. |
boolean |
isZoomLevelModificationEnabled()
Returns true if the zoom level used for printing
can be changed from the dialog box. |
protected void |
prepareDocument()
This method is called before printing the document, before showing the 'print preview' dialog or opening the 'page setup' dialog. |
void |
setAutomaticZoomLevel(boolean enable)
Sets whether the automatic zoom level calculation is enabled. |
void |
setColumnCount(int columns)
Changes the number of columns used to print this document. |
void |
setMaximumZoomLevel(double zl)
Sets the maximum zoom level that can be used for printing. |
void |
setMinimumZoomLevel(double zl)
Returns the maximum zoom level that can be used for printing. |
void |
setPageBreakPreviewVisible(boolean set)
Shows or hides the Page Break Preview on the view that corresponds to this document. |
void |
setPrintArea(IlvRect area)
Changes the area of the manager that is printed. |
void |
setRowCount(int rows)
Changes the number of rows used to print this document. |
void |
setZoomLevel(double zl)
Changes the zoom level used when printing. |
void |
setZoomLevelModificationEnabled(boolean set)
Allows the user to change the zoom level used for printing in the setup dialog box. |
void |
setZoomTransformer(IlvTransformer t)
Changes the zoom transformer used when printing. |
| Methods inherited from class ilog.views.util.print.IlvPrintableDocument |
|---|
addPage, addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getAuthor, getDate, getFooter, getHeader, getImageableBounds, getName, getNumberOfPages, getPage, getPageFormat, getPageFormat, getPageIndex, getPageOrder, getPrintable, getTemplatePage, invalidateFlowLayout, invalidatePages, isFlowLayoutValid, print, removeAll, removePage, removePropertyChangeListener, removePropertyChangeListener, setAuthor, setDate, setFooter, setHeader, setName, setPageFormat, setPageOrder, setPages, setTemplatePage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IlvManagerPrintableDocument(String name,
IlvManagerView view,
PageFormat pageFormat)
ManagerDocument for the specified
manager view and page format.
view - The manager view to print.pageFormat - The page format.
public IlvManagerPrintableDocument(String name,
IlvManagerView view)
ManagerDocument for the specified manager view.
The default page format is a letter-sized page with one-inch margins.
view - The manager view to print.| Method Detail |
|---|
public IlvManagerView getView()
public boolean isPrintingAllManagerBBox()
true if the area to be printed
is the total area of the manager.
public IlvRect getTotalManagerPrintableArea()
Invisible layers and layers for which
IlvManagerView.isContributingToViewBBox(int) returns
false are not taken into account when calculating the area.
If the automatic zoom level calculation is enabled, the returned value may only be an approximation. In particular if the manager contains nonzoomable objects, it is recommended to disable the automatic zoom level calculation and to set the zoom transformer instead, so that the returned value is precise with respect to the given zoom transformer.
setAutomaticZoomLevel(boolean),
getZoomTransformer()public IlvTransformer getZoomTransformer()
In the printout, the print area of the manager must be transformed to fit
to the page area. However, the content of an IlvManager may
change when displayed at different zoom level (for example when it
contains nonzoomable objects).
The zoom transformer is used to specify the zoom level when
printing. Still, the print area is transformed to fit to the page area,
but the zoom transformer decides for instance how much of this
transformation contributes to the nonzoomable objects.
If the method returns null, the zoom transformer
of the input view is used instead. In this case, the proportions between
zoomable and nonzoomable objects are in the printout exactly as in the
view.
setZoomTransformer(ilog.views.IlvTransformer),
setZoomLevel(double),
setAutomaticZoomLevel(boolean),
setMaximumZoomLevel(double),
setMinimumZoomLevel(double),
setZoomLevelModificationEnabled(boolean)public void setZoomTransformer(IlvTransformer t)
In the printout, the print area of the manager must be transformed to fit
to the page area. However, the content of an IlvManager may
change when displayed at different zoom level (for example when it
contains nonzoomable objects).
The zoom transformer is used to specify the zoom level when
printing. Still, the print area is transformed to fit to the page area,
but the zoom transformer decides for instance how much of this
transformation contributes to the nonzoomable objects.
If the input zoom transformer is null, the zoom transformer
of the input view is used instead. In this case, the proportions between
zoomable and nonzoomable objects are in the printout exactly as in the
view.
Changing the zoom transformer may affect the result of the printing but will not affect the number of pages or the area on a page that is printed.
getZoomTransformer(),
setZoomLevel(double),
setAutomaticZoomLevel(boolean),
setMaximumZoomLevel(double),
setMinimumZoomLevel(double),
setZoomLevelModificationEnabled(boolean)public double getZoomLevel()
setZoomTransformer(ilog.views.IlvTransformer)public void setZoomLevel(double zl)
setZoomTransformer(ilog.views.IlvTransformer),
setMaximumZoomLevel(double),
setMinimumZoomLevel(double),
setZoomLevelModificationEnabled(boolean)public boolean isAutomaticZoomLevel()
true if the automatic zoom level calculation is
enabled. It is enabled by default.
setAutomaticZoomLevel(boolean),
setZoomTransformer(ilog.views.IlvTransformer)public void setAutomaticZoomLevel(boolean enable)
In the printout, the print area of the manager must be transformed to fit
to the page area. However, the content of an IlvManager may
change when displayed at different zoom level (for example when it
contains nonzoomable objects). In order to adjust the printing, it
is possible to set the zoom transformer (see setZoomTransformer(ilog.views.IlvTransformer)),
which however has only an effect if the automatic zoom level calculation
is disabled. If it is enabled, an internal zoom transformer is calculated
automatically and the explicitly set zoom transformer is ignored.
isAutomaticZoomLevel(),
setZoomTransformer(ilog.views.IlvTransformer)public void setMaximumZoomLevel(double zl)
getMaximumZoomLevel(),
setMinimumZoomLevel(double),
setZoomLevel(double),
setZoomLevelModificationEnabled(boolean)public double getMaximumZoomLevel()
setMaximumZoomLevel(double),
setMinimumZoomLevel(double),
setZoomLevel(double),
setZoomLevelModificationEnabled(boolean)public void setMinimumZoomLevel(double zl)
getMinimumZoomLevel(),
setMaximumZoomLevel(double),
setZoomLevel(double),
setZoomLevelModificationEnabled(boolean)public double getMinimumZoomLevel()
setMinimumZoomLevel(double),
setMaximumZoomLevel(double),
setZoomLevel(double),
setZoomLevelModificationEnabled(boolean)public void setZoomLevelModificationEnabled(boolean set)
true
the setup dialog box allows the user to change the zoom level from the
value specified by setMinimumZoomLevel(double) and setMaximumZoomLevel(double).
isZoomLevelModificationEnabled(),
setMaximumZoomLevel(double),
setMinimumZoomLevel(double),
setZoomLevel(double)public boolean isZoomLevelModificationEnabled()
true if the zoom level used for printing
can be changed from the dialog box.
setZoomLevelModificationEnabled(boolean),
setZoomLevel(double),
setMaximumZoomLevel(double),
setMinimumZoomLevel(double)public void setPrintArea(IlvRect area)
area - The new area in manager coordinate system. When area
is null, then the area to print will be the full area
of the manager.getPrintArea()public IlvRect getPrintArea()
setPrintArea(ilog.views.IlvRect)public IlvRect getPrintArea(int pageIndex)
pageIndex - The index of the page in the document.public void setPageBreakPreviewVisible(boolean set)
createPageBreakPreview()protected IlvManagerPageBreakPreview createPageBreakPreview()
IlvManagerPageBreakPreview for
previewing the pages in the view that corresponds to this
document.
protected IlvPrintableManagerArea createPrintableManagerArea(IlvUnit.Rectangle pageArea,
IlvRect managerArea)
IlvPrintableManagerArea.
This method acts as factory method. It is called whenever a new
printable manager area is needed for the current view (see
getView()) and the current zoom level (see getZoomLevel()).
pageArea - The area in the page where the manager must be printed.managerArea - The area of the manager to be printed in manager's
coordinate system.protected void prepareDocument()
prepareDocument in class IlvPrintableDocumentprotected IlvPage[] createPages()
createPages in class IlvPrintableDocumentpublic void setColumnCount(int columns)
setColumnCount in class IlvPrintableDocumentcolumns - The number of columns, or 0 to indicate that
the number of column is not specified and should be computed
using the number of rows.setRowCount(int),
getColumnCount()public int getColumnCount()
getColumnCount in class IlvPrintableDocumentsetColumnCount(int)public void setRowCount(int rows)
rows - The number of rows, or 0 to indicate that
the number of rows is not specified and should be computed
using the number of columns.setColumnCount(int),
getRowCount()public int getRowCount()
setRowCount(int)public IlvFlow getFlow()
IllegalArgumentException.
getFlow in class IlvPrintableDocumentIlvPrintableDocument.isFlowLayoutValid(),
IlvPrintableDocument.invalidateFlowLayout()
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||