|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlt.monarch.print.AbstractPrintable
public abstract class AbstractPrintable extends java.lang.Object implements java.awt.print.Printable, PrintableConstants
Base class for implementations of Printable.
Provides public methods and protected variables for managing scaling and
alignment of printout.
| Modifier and Type | Field and Description |
|---|---|
protected HeaderFooterRenderer |
headerFooterRenderer
Stores reference to header/footer renderer. |
protected int |
horizontalAlignment
Stores value of horizontal alignment property. |
protected int |
lastValidPageIndex
Last valid index of print page. |
protected double |
scaligFactorSpecified
Stores specified scaling factor. |
protected int |
scalingFitToPagesGridCols
Stores specified number of columns of grid of pages used for fitting. |
protected int |
scalingFitToPagesGridRows
Stores specified number of rows of grid of pages used for fitting. |
protected int |
scalingMode
Stores value of scaling mode property. |
protected int |
verticalAlignment
Stores value of vertical alignment property. |
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Fields inherited from interface lt.monarch.print.PrintableConstants |
|---|
ALIGNMENT_BOTTOM, ALIGNMENT_CENTER, ALIGNMENT_LEFT, ALIGNMENT_RIGHT, ALIGNMENT_TOP, SCALING_FACTOR_SPECIFIED, SCALING_FIT_TO_PAGES |
| Constructor and Description |
|---|
AbstractPrintable()
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
This method must be invoked after printing is finished and instance of subclass of AbstractPrintable is not necessary anymore. |
HeaderFooterRenderer |
getHeaderFooterRenderer()
Returns assigned renderer of headers and footers. |
void |
setHeaderFooterRenderer(HeaderFooterRenderer headerFooterRenderer)
Assigns the renderer of headers and footers. |
void |
setHorizontalAlignment(int alignment)
Sets horizontal alignment of printout in printable area of page or grid of pages. |
void |
setScalingFactorSpecified(double factor)
The printout will be scaled using specified scaling factor, if the scaling mode is set as PrintableConstants.SCALING_FACTOR_SPECIFIED
(using the
setScalingMode(int)
method). |
void |
setScalingFitToPagesGrid(int rows,
int cols)
Defines number of rows and columns in the grid of pages, which is used, if the scaling mode is set as PrintableConstants.SCALING_FIT_TO_PAGES (using the
setScalingMode(int)
method). |
void |
setScalingMode(int mode)
Defines which scaling mode should be used for printing. |
void |
setVerticalAlignment(int alignment)
Sets vertical alignment of printout in printable area of page or grid of pages. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.awt.print.Printable |
|---|
print |
| Field Detail |
|---|
protected int scalingMode
protected double scaligFactorSpecified
protected int scalingFitToPagesGridRows
protected int scalingFitToPagesGridCols
protected int horizontalAlignment
protected int verticalAlignment
protected int lastValidPageIndex
protected HeaderFooterRenderer headerFooterRenderer
| Constructor Detail |
|---|
public AbstractPrintable()
| Method Detail |
|---|
public void setScalingMode(int mode)
PrintableConstants.SCALING_XXX constants.
mode - the constant indicating scaling mode.
Possible values are:
PrintableConstants.SCALING_FACTOR_SPECIFIED (default),PrintableConstants.SCALING_FIT_TO_PAGES.public void setScalingFactorSpecified(double factor)
PrintableConstants.SCALING_FACTOR_SPECIFIED
(using the
setScalingMode(int)
method).
Default value of user-specified scaling factor is 1.0d and view is printed
at 100% normal size.
factor - desired scaling factor.
public void setScalingFitToPagesGrid(int rows,
int cols)
PrintableConstants.SCALING_FIT_TO_PAGES (using the
setScalingMode(int)
method). In this case the printout is scaled to fit
printable area of [rows x cols] pages layouted in a grid.
By default [1 x 1] grid of pages (i.e. one page) is used.
rows - positive non-zero value meaning number of rows in grid of pages.cols - positive non-zero value meaning number of columns in grid of pages.public void setHorizontalAlignment(int alignment)
alignment - constant indicating horizontal alignment.
Possible values are:
PrintableConstants.ALIGNMENT_LEFT (default),PrintableConstants.ALIGNMENT_CENTER,PrintableConstants.ALIGNMENT_RIGHT.public void setVerticalAlignment(int alignment)
alignment - constant indicating vertical alignment.
Possible values are:
PrintableConstants.ALIGNMENT_TOP (default),PrintableConstants.ALIGNMENT_CENTER,PrintableConstants.ALIGNMENT_BOTTOM.public void setHeaderFooterRenderer(HeaderFooterRenderer headerFooterRenderer)
headerFooterRenderer - renderer of headers and footers.public HeaderFooterRenderer getHeaderFooterRenderer()
public void dispose()
AbstractPrintable is not necessary anymore.
Subclasses should override this method to add functionality if necessary.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||